Answered step by step
Verified Expert Solution
Link Copied!

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 2
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 n sides. This simulates a
truss of any shape and with any number of members.
Figure 3: A Structural Arch
The semi-circular arc shown in Figure 3 has been described by 5 members with 6 nodes. The coordinates
of each node can be described as a function of R 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 2
%.... Polygon
%....
%-----------------------------------------------------------------
%.... Input problem data (radius, # of points, # of members, theta)
Radius =
nNodesPoly =
nMembersPoly = nNodesPoly -1;
theta =%a semi-circular 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
fprintf('%s
','---------------------------------------')
fprintf('%s
','--------------Polygon------------------')
fprintf('%s
','---------------------------------------')
for (i =1 : nNodesPoly)
fprintf('%s%8i%8.3f%8.3f%8.3f
',' Node: ', nodePoly(i,:)')
end
fprintf('
')
for (i =1 : nMembersPoly)
fprintf('%s%8i%8.3f%8.3f%8.3f
',' Unit Vector: ',i, UnVecPoly(i,:)')
end
fprintf('
')
%%..Create the plot
fig3=
image text in transcribed

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

More Books

Students also viewed these Databases questions