Question: Flat truss to solve python E = 2 1 0 8 k N m 2 I want you to add the following explicitly step by
Flat truss to solve python
I want you to add the following explicitly step by step, indicating the equation that was used to solve in comments. It is to solve the exercise using the stiffness method of a truss in Python and the instructions to solve are a print on the screen the system of equations in local coordinates of each element using Python.
b print on the screen the system of equations of each element in global coordinates in python.
c Print on the screen in python the Calculation of local displacements indicating node local displacement in x is:
node local displacement in y is:
d prints on the screen the displacement in global coordinates of each bar. indicating the x global node is:
node and global is:
e Print the reactions on the screen indicating the restricted degree of freedom in python.
f Print on the screen the calculation of axial forces in each element per bar in local coordinates indicating the axial forces of bar number is:
g Print on the screen the calculation of axial forces in each element per bar in global coordinates indicating the axial forces of bar number in global x is:
axial force of bar in y global is:
h Plot the axial force of the complete structure
The python code in which you must explicitly add the instructions is:
import numpx as np
import matplotlib as mall
import matplotlik, pxplot as plt
'Code to solve D trusses'
'Units are consistent and depend on the user'
# Geometry of the structure
#Input nodes and coordinates#
#Initializing node names matrix
ID
#Enter the coordinates
CogrdinatesX
CogrdinatesY
# Input supports
UX #####X Restriction
UY #####Y Restriction
# Input connectivity
Node.i
Nodei
# Input properties
Emp@subsupmp@subsupmp@subsup
# Input nodal loads
Fxk
Fy
# Scale factor for deformations
esc
#
########################## Function definitions ###############################
# Plot function
def PlotNodej Node.j ID CorrdingtesX, CqordinatesY:
fig pltfisure
for i in rangelenNgdei:
ni Nodeii
nfmathrm Nodeji
XX
YY
for j in rangelenID:
if ni IDj:
XX appendCordinatesXj
YY saprendCgerdinatesYb
if nf IDj: pltwelot:XX YY markero color'black'
pltashowx
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
