User:Eml4500.f08.ramrod.D/HW5

Debugged 2 Bar Truss System
Below is the code to the debugged two bar truss system. Since the modulus of elasticity and the areas for the given example were not the same the code had to be modified in order for it to run properly. Before the correction the code was running as if the all of the elements had the same modulus of elasticity and the same area. Below is the corrected code and the results from the corrected code. Functions PlaneTrussElemtens.m, NodalSoln.m and PlaneTrussResults.m were used in this code and the discription for these functions can be found in the functions section.

Results from the debugged two bar truss code

Comparison of Results
Once the code was corrected the same reaction results were obtained when comparing it to the statics methods that have been done in class. Below are the results to the statics method.

Finite Element Method:

Using this equation, we can now solve for the f(1) matrix and thus we find the values for the reactions: $$f^{(1)}_{1} = F_{1} = -4.4378$$ $$ f^{(1)}_{2} = F_{2} = -2.5622$$

Using this same procedure applied to element 2, we can solve for the values of the other two unknown reactions giving us: $$f^{(2)}_{3} = F_{5} = 4.4378$$ $$f^{(2)}_{4} = F_{6} = -4.4378$$

Statics

Using the Euler cut method, you find the following components from the resultant P forces.

$$P_x^1 = -4.4378$$ $$P_y^1=-2.5622$$ $$P_x^2=4.4378$$ $$P_y^2=-4.4378$$

Six Bar Truss Code
Below is the code for the six bar truss system found on page 226 in the the textbook. All six of the bars have the same modulus of elasticity (e) and the same area (A). The MATLAB functions of PlaneTrussElement.m, NodalSoln.m, and PlaneTrussResults.m are all found in the code. The descriptions and functions can be found below the results of the six bar truss system.

Results of the above code.

Functions
The functions PlaneTrussElement.m, NodalSoln.m, PlaneTrussResults.m were all called in the code for the 5 truss system. They are all necessary for the completion of the truss problem.

PlaneTrussElement.m

This function take the Young's Modulus (e), the Area of the element (A) and the coordinates of the element ends (coord) and generates the stiffness matrix for a plane truss element. The function first calculates the lengths of the the elements. Once those are calculated the stiffness matrix is calculated.

NodalSoln.m

The function takes the global coefficient matrix (K), the global right hand side vector (R), the list of degrees of freedom with specified values, and the specified values to determine the displacements and reactions at each node. The dof of the the system is first found by using the  command which finds the longest dimension of R. df then finds the difference between the dofs that have known values (a value of zero) and the dof that were found in the previous line. The displacements and the reactions are then calculated.

PlaneTrussResults.m

This function computes the plane truss element results. It takes in the modulus of elasticity (e), the area of the cross-section (A), the coordinates at the element ends (coord), and the displacements at the elemtent ends (disps) and calculates the axial strain (eps), stress(sigma) and force (force). The results are stored in the variable  and sent back to the main program.

Plot of Six Bar Truss System
Below is the code and the plot of the six bar truss system. The plot was made from the results that were found in the above code. The results demonstrate that only node 2 and node 5 had a displacement of (0.2131, 0.2500) and (-0.0061, 0.0122) respectively. The undeformed system is plotted with the dotted lines and the deformed system is plotted with solid lines. The deformed displacements have been scaled up by a factor of 1.2 in order to enhance in the plot.

Three Bar Space Truss Example
Below is the code for the the 3D three bar truss system found in the textbook on page 230. There are four nodes in the system with each node containing 3 degrees of freedom. The code uses three additional functions for it to be run. SpaceTrussElement.m, NodalSoln.m, and NodalSoln.m were all used for the code. Below this code a description of each function can be found.

Functions
The functions SpaceTrussElement.m, NodalSoln.m, SpaceTrussResults.m were all called in the code for the 5 truss system. They are all necessary for the completion of the truss problem.

SpaceTrussElement.m This function creates the stiffness matrix of a space truss element. It takes in the modulus of elacticity (e), the truss area (A), and the corresponding coordinates for the truss. The function first calculates the length of each element and then calculates the stiffness matrix (k).

NodalSoln.m

The function takes the global coefficient matrix (K), the global right hand side vector (R), the list of degrees of freedom with specified values, and the specified values to determine the displacements and reactions at each node. The dof of the the system is first found by using the  command which finds the longest dimension of R. df then finds the difference between the dofs that have known values (a value of zero) and the dof that were found in the previous line. The displacements and the reactions are then calculated.

SpaceTrussResults.m

This function takes in the modulus of elasticity (e), the area of each truss (A), the coordinate of the nodes and the displacements (disps) at the element ends. It calculates the axial strain (eps), stress(sigma) and force (force). The results are stored in the variable  and sent back to the main program.

3 Bar Space Truss Results
Below are the results from the three bar space truss example.

Code for the lot of the 3 Bar Space Truss
Below is the code for the 3 Bar Space Truss.

Plot of 3 Bar Space Truss
Below is the plot of the 3 bar Space truss with the viewing mode of x = 1m, y = 1m, and z= 1m. The dotted lines represent the undeformed truss system and the solid lines represent the deformed truss system.

]

Below is the same plot but in plane view down the x axis, plane view down the y axis, and plane view down the z axis.