CivilStructural Guru
The Very Essence of Civil/Structural Engineering. Civil Structural Engineering Educational Blog. Feel Free to Learn
Friday, 20 February 2026
Truss Analysis Application Using the Finite Element Method
Wednesday, 14 January 2026
Intelligent Slab Analysis and Design to BS 8110
Thursday, 9 November 2023
Plane Frame Analysis Using Python
Wednesday, 8 November 2023
Friday, 29 September 2023
Truss Analysis Using Python Code Example 2
#Node coordinates
Node=np.array([[0,0],[3,0],[6,0],[4.5,3],[1.5,3]])
#Member connectivity
Conn=np.array([[0,1],[1,2],[0,4],[4,1],[1,3],[3,2],[4,3]])
#Boundary condition
BC=np.array([[0,1,1],[2,1,1]])
#Joint loads
ELD=np.array([[4,0,-50],[3,0,-50]])
E=210000000
A = 0.0001
Input Data
[[ 7000. 0. -7000. -0.]
[ 0. 0. -0. -0.]
[-7000. -0. 7000. 0.]
[ -0. -0. 0. 0.]]
Stiffness Matrix for member 1
[[ 7000. 0. -7000. -0.]
[ 0. 0. -0. -0.]
[-7000. -0. 7000. 0.]
[ -0. -0. 0. 0.]]
Stiffness Matrix for member 2
[[ 1252.1980674 2504.3961348 -1252.1980674 -2504.3961348]
[ 2504.3961348 5008.7922696 -2504.3961348 -5008.7922696]
[-1252.1980674 -2504.3961348 1252.1980674 2504.3961348]
[-2504.3961348 -5008.7922696 2504.3961348 5008.7922696]]
Stiffness Matrix for member 3
[[ 1252.1980674 -2504.3961348 -1252.1980674 2504.3961348]
[-2504.3961348 5008.7922696 2504.3961348 -5008.7922696]
[-1252.1980674 2504.3961348 1252.1980674 -2504.3961348]
[ 2504.3961348 -5008.7922696 -2504.3961348 5008.7922696]]
Stiffness Matrix for member 4
[[ 1252.1980674 2504.3961348 -1252.1980674 -2504.3961348]
[ 2504.3961348 5008.7922696 -2504.3961348 -5008.7922696]
[-1252.1980674 -2504.3961348 1252.1980674 2504.3961348]
[-2504.3961348 -5008.7922696 2504.3961348 5008.7922696]]
Stiffness Matrix for member 5
[[ 1252.1980674 -2504.3961348 -1252.1980674 2504.3961348]
[-2504.3961348 5008.7922696 2504.3961348 -5008.7922696]
[-1252.1980674 2504.3961348 1252.1980674 -2504.3961348]
[ 2504.3961348 -5008.7922696 -2504.3961348 5008.7922696]]
Stiffness Matrix for member 6
[[ 7000. 0. -7000. -0.]
[ 0. 0. -0. -0.]
[-7000. -0. 7000. 0.]
[ -0. -0. 0. 0.]]
Stiffness Matrix for member 7
[[ 8252.1980674 2504.3961348 -7000. 0. 0.
0. 0. 0. -1252.1980674 -2504.3961348]
[ 2504.3961348 5008.7922696 0. 0. 0.
0. 0. 0. -2504.3961348 -5008.7922696]
[-7000. 0. 16504.3961348 0. -7000.
0. -1252.1980674 -2504.3961348 -1252.1980674 2504.3961348]
[ 0. 0. 0. 10017.5845392 0.
0. -2504.3961348 -5008.7922696 2504.3961348 -5008.7922696]
[ 0. 0. -7000. 0. 8252.1980674
-2504.3961348 -1252.1980674 2504.3961348 0. 0. ]
[ 0. 0. 0. 0. -2504.3961348
5008.7922696 2504.3961348 -5008.7922696 0. 0. ]
[ 0. 0. -1252.1980674 -2504.3961348 -1252.1980674
2504.3961348 9504.3961348 0. -7000. 0. ]
[ 0. 0. -2504.3961348 -5008.7922696 2504.3961348
-5008.7922696 0. 10017.5845392 0. 0. ]
[-1252.1980674 -2504.3961348 -1252.1980674 2504.3961348 0.
0. -7000. 0. 9504.3961348 0. ]
[-2504.3961348 -5008.7922696 2504.3961348 -5008.7922696 0.
0. 0. 0. 0. 10017.5845392]]
Global Stiffness Matrix for the Structure
0 -0.0
1 0.0
2 -55.902
3 0.0
4 0.0
5 - 55.902
6 -25.0
Member forces for the Structure
Node No X-react Y-react
======= ======= =======
0 25.0 50.0
2 -25.0 50.0
Support Reactions for the Structure
Original and Deflected Shape of the Structure
Member forces for the Structure



























