User:Eml4500.f08.ateam.didomenico/hw 4

Five-Bar Truss System: MATLAB Dissection
Analysis of the five-bar truss system MATLAB code is important before attempting to write code for the three-bar truss system. The following code is from the  file found at the website for the class textbook, Fundamental Finite Element Analysis and Applications.

Additional Functions
The following functions are essential for the MATLAB program above to run. They are also found at the course textbook website. These functions include,  , and. The details of these functions are outlined below.

This function generates the element stiffness matrix for each element. When the function is called it calculates the X and Y coordinate positions of the element ends from the coordinates passed in. It produces the element length from this information. Next it calculates the direction cosines of the element. Using the Young's modulus and cross-sectional area of the element, the element stiffness matrix, k, is assembled. The stiffness matrix is passed back to the.

This function solves the force-displacement relationship for each node, resulting in the displacements and reactions at each node. This information is passed back to the.

This function outputs the axial strain, axial stress, and axial force of each element.

MATLAB Results
The following is a printout of the exact results of the MATLAB analysis. It includes the complete Global Stiffness matrix (K), the Applied Force matrix (R), the Displacement matrix (d), the reaction forces, and the resulting stresses and strains.

K = Columns 1 through 6 32600       76067       -32600       -76067            0            0        76067  2.9749e+005       -76067 -1.7749e+005            0    -1.2e+005 -32600      -76067  2.4309e+005  1.1914e+005       -32998        32998 -76067 -1.7749e+005 1.1914e+005  2.4309e+005        32998       -32998 0           0       -32998        32998    1.53e+005       -32998 0   -1.2e+005        32998       -32998       -32998    1.53e+005 0           0 -1.7749e+005       -76067    -1.2e+005            0 0           0       -76067       -32600            0            0 Columns 7 through 8 0           0            0            0 -1.7749e+005       -76067 -76067      -32600    -1.2e+005            0 0           0  2.9749e+005        76067 76067       32600 R = 0          0           0     -150000           0           0           0           0 d = 0           0      0.53895     -0.95306       0.2647      -0.2647            0            0 reactions = 54927 1.5993e+005 -54927     -9926.7 results = -0.0001743     -34.859 -1.3944e+005 -3.15e-005     -6.2999       -25200 -5.2941e-005     -10.588       -31764 -5.2941e-005     -10.588       -31764 0.00032087      22.461        44922

The d matrix represents the displacements at each node.

$$\begin{Bmatrix} d_1 \\ d_2 \\ d_3 \\ d_4 \\ d_5 \\ d_6 \\ d_7 \\ d_8 \\ \end{Bmatrix}$$ = $$\begin{Bmatrix} 0 \\ 0 \\ 0.53895 \\ -0.95306 \\ 0.2647 \\ -0.2647 \\ 0 \\ 0 \\ \end{Bmatrix}$$

Reaction forces at Global Node 1 and Global Node 4:

Resulting Stresses and Strains:

Three-Bar Truss System: MATLAB Dissection
The following code solves the three-bar truss system presented in class. The two-bar truss system code provided by Dr. Vu-Quoc on the EML4500 website was modified to account for the additional element. The original code can be found here. After analysis, the resulting deformation was scaled by a factor of 1/500 for presentation.



MATLAB Results
n_nodes = 4 n_elem = 3 k = 0.9     0.51962         -0.9     -0.51962      0.51962          0.3     -0.51962         -0.3         -0.9     -0.51962          0.9      0.51962     -0.51962         -0.3      0.51962          0.3 k = 0.6     0.34641         -0.6     -0.34641      0.34641          0.2     -0.34641         -0.2         -0.6     -0.34641          0.6      0.34641     -0.34641         -0.2      0.34641          0.2 k = 0.3         0.3         -0.3         -0.3          0.3          0.3         -0.3         -0.3         -0.3         -0.3          0.3          0.3         -0.3         -0.3          0.3          0.3 K = Columns 1 through 6 0.9     0.51962         -0.9     -0.51962            0            0      0.51962          0.3     -0.51962         -0.3            0            0         -0.9     -0.51962          1.8        1.166         -0.6     -0.34641     -0.51962         -0.3        1.166          0.8     -0.34641         -0.2            0            0         -0.6     -0.34641          0.6      0.34641            0            0     -0.34641         -0.2      0.34641          0.2            0            0         -0.3         -0.3            0            0            0            0         -0.3         -0.3            0            0  Columns 7 through 8 0           0            0            0         -0.3         -0.3         -0.3         -0.3            0            0            0            0          0.3          0.3          0.3          0.3 R = 0    0     0    30     0     0     0     0 d = 0           0      -435.17       671.77            0            0            0            0 reactions = 42.588      24.588       28.392       16.392      -70.981      -70.981

Unstable Three-Bar Truss: MATLAB Dissection
The following code is the three-bar truss system code modified for the unstable three-bar truss system shown at the left of the figure below. To stabilize this truss, an additional member is added at shown at the right of the figure. A force, P, of magnitude 0.5 is applied as shown to evaluate the truss system stability.



Breakdown of FEM
Running this MATLAB code results in a breakdown of the FEM. The system above is unstable and results in a singular stiffness matrix. FEM cannot be used to solve for the displacements and forces at each node. This breakdown is shown below.

EDU>> three_unstable n_nodes = 4 n_elem = 3 k = 0    0     0     0     0     6     0    -6     0     0     0     0     0    -6     0     6 k = 6    0    -6     0     0     0     0     0    -6     0     6     0     0     0     0     0 k = 0    0     0     0      0     6     0    -6      0     0     0     0      0    -6     0     6 K = 0    0     0     0     0     0     0     0      0     6     0    -6     0     0     0     0      0     0     6     0    -6     0     0     0      0    -6     0     6     0     0     0     0      0     0    -6     0     6     0     0     0      0     0     0     0     0     6     0    -6      0     0     0     0     0     0     0     0      0     0     0     0     0    -6     0     6 R = 0     0      0      0      1      0      0      0 Warning: Matrix is singular to working precision. > In NodalSoln at 12 In three_unstable at 67 d = 0     0    Inf NaN NaN NaN 0     0 reactions = NaN NaN NaN NaN

Stabilization Due to Additional Member
To add the cross-bar member to the truss the MATLAB code is modified to the following.

This code produces the following results.

EDU>> three_stable n_nodes = 4 n_elem = 4 k = 2.2496e-032 3.6739e-016 -2.2496e-032 -3.6739e-016 3.6739e-016           6 -3.6739e-016           -6 -2.2496e-032 -3.6739e-016 2.2496e-032  3.6739e-016 -3.6739e-016          -6  3.6739e-016            6 k = 6           0           -6            0            0            0            0            0           -6            0            6            0            0            0            0            0 k = 0    0     0     0     0     6     0    -6     0     0     0     0     0    -6     0     6 k = 2.1213      2.1213      -2.1213      -2.1213       2.1213       2.1213      -2.1213      -2.1213      -2.1213      -2.1213       2.1213       2.1213      -2.1213      -2.1213       2.1213       2.1213 K = Columns 1 through 7 2.1213      2.1213 -2.2496e-032 -3.6739e-016      -2.1213      -2.1213            0 2.1213      8.1213 -3.6739e-016           -6      -2.1213      -2.1213            0 -2.2496e-032 -3.6739e-016           6  3.6739e-016           -6            0            0 -3.6739e-016          -6  3.6739e-016            6            0            0            0 -2.1213     -2.1213           -6            0       8.1213       2.1213            0      -2.1213      -2.1213            0            0       2.1213       8.1213            0            0            0            0            0            0            0            0            0            0            0            0            0           -6            0  Column 8 0           0            0            0            0           -6            0            6 R = 0           0          0.5            0            0            0            0            0 d = 0           0      0.40237 -2.4638e-017 0.31904   -0.083333            0            0 reactions = -0.5        -0.5            0          0.5