User:Eml4500.f08.team.foskey.ckf/hw5c

MATLAB Assignment The Three Bar Space Truss

The Three Bar Problem
The Three Bar Truss problem is from Example 4.2 on page 230 of the text Fundamental Finite Element Analysis and Applications by M. Asghar Bhatti. The problem setup is shown in the figure below.



All of the bars have a Young's Modulus of 200GPa. The cross sectional area of elements 1 and 2 is 200mm2 and 600mm2 for element 3. The applied load P is 20kN. The nodal coordinates are as follows: Node 1 : (0.96, 1.92, 0) m Node 2 : (-1.44, 1.44, 0) m Node 3 : (0, 0, 0) m

Comments On The Main Code
The code used to solve the three bar space truss problem has comments throughout that help identify variables, and functions of parts of the code.

The code above systematically calculates the needed values to completely solve the problem. The code receives the element properties, and the nodal positions. Next it calculates the lengths of each bar, then creates the connectivity array and location matrix master array. The applied force matrix is then created. The global stiffness matrix is then calculated by looping through all of the elements. With this information, the output results shows the elemental stiffness matrices, the global stiffness matrix, the applied loads (in a global coordinate system), the displacements and the reactions. The results matrix displays the strain, stress, and axial forces in columns, for each element ( each row).

With all the important values calculated and displayed, the code next focuses on plotting the deformed and undeformed trusses. Each node is given a number, and each dislocated node is given a new number. Next, the code assigns each end of an element a node number (either and original node or a new dislocated node). The code then plots each element based on the node data. Line styles and color are changed after plotting the undeformed truss so that the deformed truss can be easily identified.

Part of the requirements of this assignment was to create plots of the truss in several views. To accomplish this, the plotting section of the code is embedded within a loop. Each time the loop is plotted, it is plotted in a different view perspective, adjusting the axis dimensions if necessary.

Also, for the benefit of the user, the two perspective view plots make use of MATLAB's "rotate3d" function. This allows the user to click on the figure and manually rotate the figure.

Functions used
SpaceTrussElement NodalSoln

SpaceTrussResults

Comments On The Functions
The functions above are modified versions of the functions used for plane trusses, as seen and explained here.

The function SpaceTrussElement behaves like the function PlaneTrussElement in that it calculates the length of an element, the director cosines, and the elemental stiffness matrix for an element from the values it is given (Young's Modulus, cross sectional area, and element end coordinates). The differences between the two functions is seen in the length calculation, where z coordinates are taken into consideration, the calculation of an additional director cosine for the third dimension, and a stiffness matrix that accounts for the third dimension.

SpaceTrussResults behaves like PlaneTrussResults, except it accounts for the z direction in the calculations of element length, director cosines, and in the transform matrix.

NodalSoln remains unchanged and is the same as the function used in the two bar truss problem.

Click here for the plane truss functions and their explanations.

Results Output
Running the above main code for the three bar space truss gives the following output:

Comments On the Results Output
The output results shows the elemental stiffness matrices( in local and global coordinate systems), the global stiffness matrix, the applied loads (in a global coordinate system), the displacements and the reactions(both in the global coordinate system). The results matrix displays in three columns the strain, stress, and axial forces (respectively) for each element. Each element is represented by a row, with row 1 being element 1 and so forth.

Note on Units: The units of the output values are as follows:

Stiffness Matrices, k_local, k, and K : Newtons per meter (N/m) Applied Loads, R : Newtons (N) Global Displacements, d : millimeters (mm) Reaction Forces, reactions : Newtons (N) Results, results : Dimensionless (m/m) for strain, Pascals (pa) for stress, and Newtons (N) for axial force

Figures


Figure 1 above shows the undeformed truss in red dotted lines, and the deformed truss in blue solid lines. It is shown as a view down the x axis, resulting in a plot in the yz plane.



Figure 2 again shows the undeformed truss in red, and the deformed truss in blue. The view for this plot is down the y axis, in the xz plane.



Figure 3 shows the deformed and undeformed trusses in the xy plane, down the z axis.



Figure 4 is a perspective view generated as a view of the trusses from the point (-2, -2, 3).



Figure 5 is also a perspective view, but from the point (-2, -1.5, 1). It was felt that this viewpoint offered a better view of the deformed truss system than the suggested viewpoint used in Figure 4.

In all five figures, the undeformed truss is shown in red dotted lines, and the deformed truss is shown in blue solid lines. Nodes and Elements were not labeled as it would severely clutter the plots, and it was not part of the assignment.