Friday 29 September 2023

Truss Analysis Using Python Code


Input Data

 #Node coordinates

Node=np.array([[0,0],[180,0],[180,240],[0,240]])

#Member connectivity

Conn=np.array([[0,2],[1,2],[3,2]])

#Boundary condition

BC=np.array([[0,1,1],[1,1,1],[3,1,1]])

#Joint loads

ELD=np.array([[2,50,-86.6]])

E=29000

A = 9

[[ 313.2  417.6 -313.2 -417.6]

 [ 417.6  556.8 -417.6 -556.8]

 [-313.2 -417.6  313.2  417.6]

 [-417.6 -556.8  417.6  556.8]]

Stiffness Matrix for Member 1

[[    0.      0.     -0.     -0. ]

 [    0.   1087.5    -0.  -1087.5]

 [   -0.     -0.      0.      0. ]

 [   -0.  -1087.5     0.   1087.5]]

Stiffness Matrix for Member 2

[[ 1450.     0. -1450.    -0.]

 [    0.     0.    -0.    -0.]

 [-1450.    -0.  1450.     0.]

 [   -0.    -0.     0.     0.]]

Stiffness Matrix for Member 3

[[  313.2   417.6     0.      0.   -313.2  -417.6     0.      0. ]

 [  417.6   556.8     0.      0.   -417.6  -556.8     0.      0. ]

 [    0.      0.      0.      0.      0.      0.      0.      0. ]

 [    0.      0.      0.   1087.5     0.  -1087.5     0.      0. ]

 [ -313.2  -417.6     0.      0.   1763.2   417.6 -1450.      0. ]

 [ -417.6  -556.8     0.  -1087.5   417.6  1644.3     0.      0. ]

 [    0.      0.      0.      0.  -1450.      0.   1450.      0. ]

 [    0.      0.      0.      0.      0.      0.      0.      0. ]]

Global Stiffness Matrix for the Structure

0 -21.657

1 -69.274

2 62.994

Computed forces for the Members

Node No X-react Y-react

======= ======= =======

Node No X-react Y-react

======= ======= =======

0     12.994     17.326

1             0.0     69.274

3         -62.994     0.0

Computed Reactions at the Nodes


Original and Deflected Truss Shape


Members Forces Diagram for the Structure

No comments:

Post a Comment