matla and report

profilerasoad-2n
cee210_cp4-instructions.pdf

CEE/CNE 210—Statics SSEBE Mechanics Group

Arizona State University

1

Computing Project 4: Truss Analysis

Program

Computing Project 4 builds upon CP3 to develop a program to perform truss analysis. A truss consists of

straight, slender bars pinned together at their end points. Truss members are considered to be two force,

axial members. Thus, the force caused by each truss member - and the internal force in each member - acts

only along it’s axis. In other words, the direction of each member force is known and only the magnitudes

must be determined.

To analyze a truss we study the forces acting at each individual pin joint. This is known as the Method of

Joints. We will call each pin joint a node and the slender bars connecting the nodes will be called members.

The previous project computed a unit vector to describe the vector direction of every member of a truss

structure. To analyze the structure a few other key inputs must be included like the support reactions and

external loads applied to the structure. With all of this information, you will need to make the correct

changes to the provided planar (2-D) truss template program to be able to analyze a space (3-D) truss.

What you need to do

For a planar truss, every node has 2 degrees of freedom, the e1 and e2 directions. Therefore, for every planar

truss problem, the total number of degrees of freedom (DOF) in the structure is equal to 2 times the number

of nodes. We will consider the first degree of freedom for each node as the component acting in the e1

direction. So for any given node, i, the corresponding degree of freedom is (2·i)-1. For the same node, i,

the corresponding value for the second degree of freedom, the component in the e2 direction, is 2-i. This

numbering notation can be modified for a space truss. The difference with the space truss is that every

node has 3 degrees of freedom, one degree for each of the e1, e2 and e3 directions. The degree of freedom

indices are extremely crucial in understanding how to set up the matrices for the truss analysis.

For this computing project, you will first need to understand the planar truss program and the inputs that

are needed for that program. The first input is the spatial coordinates (x, y, z) of the nodal locations for a

truss. It is convenient to label each node with a unique number (also known as the “node number”). Each

row of the nodal coordinate array should contain the x and y coordinates of the node. We will use the matrix

name of “x” for all nodal coordinates. Please note that “nNode” is an integer value that corresponds to the

number of nodes in the truss and must be adjusted for every new truss problem. For Node 1 this matrix

array input looks like:

Node(1,:) = [0,0];

Once the coordinates of the nodes are in the program, you will need to input how those nodes are connected

by the members of the truss. In order to describe how the members connect the nodes you will also need

to label each member with a “member number”. This connectivity array should contain only the nodes that

are joined by a member, with each row containing first the node at the start of the member and then the

node at the other end of the member. The first node that is input into the Member array will be called the

start node (SN) and the second node that is input is known as the end node (EN). For any member it doesn’t

matter which end you call the start node and which is the end node. We will use the matrix name of

“Member” for the connectivity array. Also note that “nMembers” is a single integer value that must equal

the total number of members for each truss. The nodes and members can be numbered in any way you

CEE/CNE 210—Statics SSEBE Mechanics Group

Arizona State University

2

want, but it can sometimes be advantageous to use some sort of logical systematic order if you can discern

one. For Member 1 this matrix array input should look like:

Member(1,:) = [1,2];

The support reactions for the truss must then be input. The variable “nReactions” is an integer that corre-

sponds to the total number of supports. Note: a pin support counts as one reaction for the nReaction count

even though it has two unknowns. The support reactions will be input into the “Reaction” matrix. The

first input value is the node number of where the support reaction is. The second and third inputs are for

the fixity conditions at that node. If the support reaction provides resistance in a direction then a 1 should

be used otherwise a 0 is used to denote that the truss is free to move in that direction. For example, if a

roller support was used at node 4 and had resistance in the e2 direction but was free to move in the e1

direction it would be input as follows:

Reaction(2,:) = [4,0,1];

Finally, the external loads must be input. The variable “nLoads” is a single integer value that corresponds

to the number of loads placed on the truss. The matrix name of “Load” will be used to store all external

loads. The first input is the node number where the load acts. The second and third inputs are the magnitude

of the force in the e1 and e2 direction at that node. For a load placed at node 3, that has a magnitude of 1200

N in the –e2 direction should be input like:

Load(1,:) = [3,0,-1200];

Next, the unit vectors (direction vectors) must be computed for every member. The direction of the unit

vector will depend on the node of the connection you chose to be the start node and the node that was

selected as the end node. Implement your CP3 code (the part that computes the unit vectors) into the code.

Use the matrix name “UnVec” for the matrix that will store all the positive unit vector values (the vectors

pointing from SN to EN). Use the matrix name “OppUnVec” to store all the negative unit vector values

(the vectors pointing from EN to SN).

Once all the unit vectors are created for every member, the coefficient matrix is formed. We will call this

matrix “C” and it will have the size of (DOF, Members). For each member the SN and EN must be deter-

mined. These nodal values have components in the member unit vector array that correspond to a degree

of freedom value in the truss. This component from the unit vector array is stored in the matching degree

of freedom row and corresponding member column in the “C” matrix. Note: the negative value of the unit

vector should be stored for every end node.

The load vector is then created. The load vector has the same number of rows as DOF. The external loads

have the same corresponding degree of freedom value as the nodal coordinates, so a loop is used to create

this vector to store the load values in the correct row. The array name of “F” will be used to store all

external forces.

Once the coefficient matrix has been created, this matrix must be partitioned into two separate matrices.

The first matrix contains the rows that correspond to a degree of freedom value that has a support reaction,

and the second matrix will contain the rows that are not restrained. For every support reaction using the

corresponding degree of freedom, that row from the coefficient matrix should be placed in the “Crest”

matrix. The “Crest” matrix should have the same number of rows as the number of degrees of freedom

that are restricted in the system (i.e. support reactions – 2 for a pin and 1 for a roller).

CEE/CNE 210—Statics SSEBE Mechanics Group

Arizona State University

3

When the reaction force matrix has been created then the member force matrix is created using all the rows

not in the “Crest” matrix. This matrix can be labeled “Cfree”. This member force matrix should be a

square matrix of the size (Members, Members) for any statically determinate truss. The load vector must

also be partitioned to contain only the degree of freedom values that are not restricted by a support. The

new load vector (called “Ffree”) should have the same number of rows as the number of members.

Once the free coefficient matrix has been created then an array named “T” solves for the individual member

forces using

      1

 T Cfree Ffree

Then an array named “Reactions” solves for the support reactions using

     Reactions Crest T

Once the reactions are calculated a “SupportReaction” matrix is created that contains all the values of the

support reactions in the corresponding degree of freedom spot for each node. The first input for the support

reaction matrix is the node number of the support and the second and third input are the corresponding

reaction value for the two degrees of freedom for that node. Note: if there is no resistance for a degree of

freedom then the value should be 0.

The template file provided to you will work for any planar truss once you implement the unit vector calcu-

lation code. You need to get the planar truss code working and understand it. Then make all the necessary

changes to create a space truss program. The changes do not need to be very extensive. Note: when your

code is graded there will be at least two different truss problems run in your code to ensure your code is

robust.

Also provided is a truss data input file. Use this file to create several input sections that can be easily copied

and pasted into the input section of your truss analysis code. This allows you to create and store several

trusses (2-D and 3-D) that can be analyzed quickly and easily. Be sure to test your code with a few different

2-D trusses and several 3-D trusses.

Report

Write a report only after you have a working 3-D truss analysis code. Document your work and the results

(in accord with the specifications given in the document CEE210 Guidelines for Computing Project Re-

ports). Include figures, plots, and results. Discuss your discoveries and explorations. All test cases need

to be included in your report with detailed documentation of the problem (i.e. a figure and tables) and the

results (i.e. a table of the member forces and reactions). For every truss you test, there needs to be back-up

calculations to verify that the code is working correctly (either hand calcs or copies of existing problem

solutions with proper source citations). The back-up calculations should be placed in the Appendix of the

report. Also include a copy of your MATLAB .m program code and you truss input data .m cod in the

appendix.

Upload your report to Blackboard prior to the deadline. Also upload your MATLAB .m truss analysis

program file and your truss data input .m file to Blackboard as well. Make sure your .m and report files

include your first and last name in the file name.