Answered step by step
Verified Expert Solution
Question
1 Approved Answer
I need help with this MATLAB code Part 2 We often see structures with curved elements in which the supports beneath the surface are actually
I need help with this MATLAB code
Part
We often see structures with curved elements in which the supports beneath the surface are actually formed
of a series of straight line segments. The second part of this project is to consider a polygon with points
that lie on a half circle. The task in this case is to generate the coordinate array and connectivity arrays for
the points with the flexibility to specify any number of sides on the polygon, say sides. This simulates a
truss of any shape and with any number of members.
Figure : A Structural Arch
The semicircular arc shown in Figure has been described by members with nodes. The coordinates
of each node can be described as a function of and which should be values input in the program at
the start A for loop can be used to generate the coordinates of each node. Once the coordinates have
been created, a second for loop can be used to compute the connections between each node along with the
unit vector that describes the direction of each member. The number of nodes and the radius of the arc
should be able to be varied by one small input change in the program. Plot the polygon trusses you cre
ate.
Here is the code I was given to start this part:
PART
Polygon
Input problem data radius # of points, # of members, theta
Radius
nNodesPoly
nMembersPoly nNodesPoly ;
theta a semicircular arch
Use a for loop to compute the x y and z coordinates of each point and
create a matrix to store each point.
You can use the variable name "nodePoly" for the nodal coordinates of
the polygon.
FINISH THIS SECTION
Use a for loop to compute the members or connections and the unit
vector for each member.
You can use the variable name "UnVecPoly" for the unit vectors.
FINISH THIS SECTION
Create output for command window
fprintfs
fprintfs
Polygon
fprintfs
for i : nNodesPoly
fprintfsifff
Node: nodePolyi:
end
fprintf
for i : nMembersPoly
fprintfsifff
Unit Vector: i UnVecPolyi:
end
fprintf
Create the plot
fig
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started