User:Eml4500.f08.bottle.vitello/HW 4

Lecture Notes
Before we continue with our analysis of the 3-bar truss system we will make a quick comment on modifying a 2-bar truss program in MATLAB to solve a 3-bar truss system.

First, we define the connection array as "conn". Consider the 2-bar truss system:

$$ conn = \begin{bmatrix} 1 & 2\\ 2& 3 \end{bmatrix}$$ where column 1 corresponds to local node $$ 1 \! $$ and column 2 corresponds to local node $$ 2 \! $$. Similarly, row 1 represents element $$ 1 \! $$ and row 2 represents element $$ 2 \! $$. This array can then be represented by conn(e,j) = global node # of local node $$ j \! $$ of element $$ e \! $$

We denote the location master array by "lmm". Therefore

$$ lmm = \begin{bmatrix} 1 & 2 & 3 & 4\\ 3& 4 & 5 & 6 \end{bmatrix} $$

where row 1 represents element $$ 1 \! $$ and row 2 represents element $$ 2 \! $$, each column represents a local degree of freedom number with each number in the matrix representing the global degree of freedom number (or equation number) in $$ K \! $$.

This can be rewritten as limm(i,j)= equation number (global degree of freedom) for the element stiffness matrix coefficient corresponding to the $$jth \! $$ local degree of freedom number

Returning to our analysis of FEA, our goal is to find $$ \tilde{T}^{(e)}_{4X4} $$ that transforms the set of local element dof's $$ d^{(e)}_{4X1} $$ to another set of local element $$ \tilde{d}^{(e)}_{4X1}$$ such that $$ \tilde{T}^{(e)} $$ is invertible.



From previous lectures we know that:

$$ \underbrace {\tilde{d}_{1}^{(e)}}_{q_{1}^{(e)}} = \begin{vmatrix} l^{(e)} & m^{(e)} \end{vmatrix}\begin{Bmatrix} d_{1}^{(e)}\\ d_{2}^{(e)} \end{Bmatrix} $$

and $$ \tilde{d}_{2}^{(e)}= \vec{d}^{(e)}_{1}\circ \vec{\tilde{j}} $$ $$= -\sin \theta ^{(e)}d_{1}^{(e)}+\cos \theta ^{(e)}d_{2}^{(e)}$$

therefore:

$$ \tilde{d}_{2}^{(e)} = \begin{vmatrix} -m^{(e)} & l^{(e)} \end{vmatrix}\begin{Bmatrix} d^{(e)}_{1}\\ d_{2}^{(e)} \end{Bmatrix} $$

If we combine the two we get the following equation in matrix form: $$ \begin{Bmatrix} \tilde{d}_{1}^{(e)}\\ \tilde{d}_{2}^{(e)} \end{Bmatrix} = \begin{bmatrix} l^{(e)} & m^{(e)}\\ -m^{(e)} & l^{(e)} \end{bmatrix}\begin{Bmatrix} d_{1}^{(e)}\\ d_{2}^{(e)} \end{Bmatrix} $$

where $$ \begin{bmatrix} l^{(e)} & m^{(e)}\\ -m^{(e)} & l^{(e)} \end{bmatrix} = R^{(e)} $$

This can be expanded to : $$\underbrace{\begin{Bmatrix} \tilde{d}^{(e)}_{1}\\ \tilde{d}^{(e)}_{2}\\ \tilde{d}^{(e)}_{3}\\ \tilde{d}^{(e)}_{4} \end{Bmatrix}}_{\tilde{d}^{(e)}_{4X1}}= \underbrace{\begin{bmatrix} R^{(e)} & 0\\ 0 & R^{(e)} \end{bmatrix}}_{\tilde{T}^{(e)}_{4X4}}\underbrace{\begin{Bmatrix} d^{(e)}_{1}\\ d^{(e)}_{2}\\ d^{(e)}_{3}\\ d^{(e)}_{4} \end{Bmatrix}}_{d^{(e)}_{4X1}}$$

Examining the element below



we find $$ \tilde{f}^{(e)}= k^{(e)}\begin{bmatrix} 1 &0 & -1 & 0\\ 0&  0& 0 & 0\\  -1&  0&  1& 0\\  0& 0 & 0 &0  \end{bmatrix}\tilde{d}^{(e)}$$

where $$ \tilde{f}^{(e)}_{4X1}=\tilde{k}^{(e)}_{4X4}\tilde{d}^{(e)}_{4X1} $$

To find the values of K, we break down the problem by using interpolation of the transverse degrees of freedom using: $$ \tilde{d}^{(e)}=\tilde{T}^{(e)}d^{(e)}$$ and $$ \tilde{f}^{(e)}=\tilde{T}^{(e)}f^{(e)}$$ Using the simple force equation derived earlier $$ \tilde{K}^{(e)}\tilde{d}^{(e)}=\tilde{f}^{(e)}$$ we can then plug in the DOF equations as before and and get the result: $$ \tilde{K}^{(e)}\tilde{T}^{(e)}d^{(e)}=\tilde{T}^{(e)}f^{(e)} $$

And if we assume that T is invertable, we derive this result for the force equation:

$$ \left[\tilde{T}^{(e)^{-1}} \tilde{K}^{(e)} \tilde{T}^{(e)} \right]d^{(e)}=f^{(e)}$$

A way to prove that this inversion for T works is to consider a general block diagram matrix:

$$ B=\begin{bmatrix} d_{11} & 0 & 0 & 0\\ 0 & d_{22} & 0 & 0\\ 0 & 0 & ... & 0\\ 0 & 0 & 0 & d_{nn} \end{bmatrix}$$

By applying the inverse on this matrix gives this result:

$$ B^{-1}=\begin{bmatrix} \frac{1}{d_{11}} & 0 & 0 & 0\\ 0 & \frac{1}{d_{22}} & 0 & 0\\ 0 & 0 & ... & 0\\ 0 & 0 & 0 & \frac{1}{d_{nn}} \end{bmatrix}$$

Using the same method applied above for $$ R^{(e)}=\begin{bmatrix} l^{(e)} & m^{(e)}\\ -m^{(e)} & l^{(e)} \end{bmatrix} $$ gives the following result:

$$ R^{(e)^{T}}=\begin{bmatrix} l^{(e)} & -m^{(e)}\\ m^{(e)} & l^{(e)} \end{bmatrix} $$

Plugging the inverse of R will also give the inverse of T.

$$ \tilde{T}^{(e)^{-1}}=diag\left[ R^{(e)^{T}},R^{(e)^{T}} \right] $$

in which the value can be plugged back into the derivation

$$ \left[ \tilde{T}^{(e)^{-1}}\tilde{K}^{(e)}\tilde{T}^{(e)} \right]d^{(e)}=f^{(e)} $$

to give the results for K:

$$ k^{(e)}=\tilde{T}^{(e)^{T}}\tilde{k}^{(e)}\tilde{T}^{(e)} $$

In previous meetings we found the eigenvalues associated with a 2-bar truss system. Four eigenvalues were found, three of which were due to rigid body motion and the forth resulting from mechanisms. To understand the concept of a mechanism, we imagine that the support on a 2-bar truss system is cut and the structure can now move freely. The two bars can now move in a "scissor" motion about the pin joint. This is possible because there is no stored energy in the pin.

For the eigenvalue problem we have: $$ Kv=\lambda v \! $$, where $$ Kv $$ is the mass matrix and $$ \lambda v $$ is the identity matrix.

Let $$ \begin{Bmatrix} (u_{1})_{6X1} & (u_{2})_{6X1} & (u_{3})_{6X1} & (u_{4})_{6X1} \end{Bmatrix} $$ be pure eigenvalues corresponding to the four eigenvalues.

$$ K_{6X6}(u_{i})_{6X1}= \underbrace {0 u_{i}}_{0_{6X1}}, i = 1, ... ,4 $$

We can write the linear combination of $$ \begin{Bmatrix} u_{i}, i = 1, ... , 4 \end{Bmatrix}$$ as $$ \Sigma (\alpha _{i})_{1X1}(u_{i})_{6X1} = W_{6X1} \!$$

where $$\alpha _{i} = real numbers \!$$

Physically this means that the linear combination of movement in the  x \! and $$ y \! $$ directions and rotation.

$$ W \! $$ is also an eigenvalue that corresponds to a zero eigenvalue $$ KW=K(\sum_{i = 1}^{4} \alpha_{i}u_{i} ) $$ $$= \sum_{i = 1}^{4}{\alpha _{i}\underbrace{(Ku_{i})}_{0_{6X1}}} = 0 $$ $$ = 0_{1x1} W_{6X1} \!$$ We will now begin the justification of the assembly of the elemental stiffness matrix $$ k^{(e)} \!$$ into the global stiffness matrix.

Consider the example of the 2-bar truss and recall the following: 1. The elemental FD relationship can be written as $$ k^{(e)}d^{(2)}=f^{(e)} \!$$ 2. We used the Euler cut principle to find the equivalent of global node $$ 2 \! $$ 3. We drew the FBD's of element $$ 1 \! $$ and $$ 2 \! $$ to find the elemental degrees of freedom $$ d^{(e)}_{4X1} $$ 4. We identified the global degrees of freedom to elemental degrees of freedom for node $$ 2 \! $$  for element  $$ 1 \! $$ and $$ 2 \! $$

We can draw the following FBD to represent the equilibrium for node $$ 2 \! $$



We can now see that the addition of factors in the global stiffness matrix is because of the equilibrium position of node $$ 2 \! $$. The equations of equilibrium are $$ \sum{F_{x}}= 0 = -f^{(1)}_{3}-f^{(2)}_{1}$$ $$ \sum{F_{y}}= 0 = P-f^{(1)}_{4}-f^{(2)}_{2} $$

Leading to the summation of, $$ f^{(1)}_{3}+f^{(2)}_{1}=0$$ $$ f^{(1)}_{4}+f^{(2)}_{2}=P $$

The Kd=F matrices can be plugged into the summation of forces to get the overall big picture of the small deflections in the two bar truss and ultimately, obtain the values for the K matrix.

$$ \left[k^{(1)}_{31}d^{(1)}_{1}+k^{(1)}_{32}d^{(1)}_{2}+k^{(1)}_{33}d^{(1)}_{3}+k^{(1)}_{34}d^{(1)}_{4} \right]+\left[k^{(2)}_{11}d^{(2)}_{1}+k^{(2)}_{12}d^{(2)}_{2}+k^{(2)}_{13}d^{(2)}_{3}+k^{(2)}_{14}d^{(2)}_{4} \right]=0$$

$$ \left[k^{(1)}_{41}d^{(1)}_{1}+k^{(1)}_{42}d^{(1)}_{2}+k^{(1)}_{43}d^{(1)}_{3}+k^{(1)}_{44}d^{(1)}_{4} \right]+\left[k^{(2)}_{21}d^{(2)}_{1}+k^{(2)}_{22}d^{(2)}_{2}+k^{(2)}_{23}d^{(2)}_{3}+k^{(2)}_{24}d^{(2)}_{4} \right]=P $$

Prove $$ \textbf{k}^{(e)} = \textbf{T}^{(e)^{T}} \hat{\textbf{k}}^{(e)} \textbf{T}^{(e)} $$
Where

$$ \textbf{k}^{(e)}= \left[ \begin{array}{cccc} l_{s}^{2} & l_{s}m_{s} & -l_{s}^{2} & -l_{s}m_{s} \\ l_{s}m_{s} & m_{s}^{2} & l_{s}m_{s} & -m_{s}^{2} \\ -l_{s}^{2} & -l_{s}m_{s} & l_{s}^{2} & l_{s}m_{s} \\ -l_{s}m_{s} & -m_{s}^{2} & l_{s}m_{s} & m_{s}^{2} \end{array} \right]$$

As given in the notes above

$$ \textbf{T}^{(e)^{T}} = \left [ \begin{array}{cccc} l_{s}^{(e)} & 0 \\ m_{s}^{(e)} & 0 \\ 0 & l_{s}^{(e)} \\ 0 & m_{s}^{(e)} \end{array} \right] $$

and

$$ \hat\textbf{k}^{(e)} = \left [ \begin{array}{cccc} 1 & -1 \\ -1 & 1 \end{array} \right] $$

Therefore

$$ \hat\textbf{k}^{(e)}\textbf{T}^{(e)} = \left [ \begin{array}{cccc} l_{s}^{(e)} & m_{s}^{(e)} & -l_{s}^{(e)} & -m_{s}^{(e)} \\ -l_{s}^{(e)} & -m_{s}^{(e)} & l_{s}^{(e)} & m_{s}^{(e)} \end{array} \right] $$

Finally, multiplying by $$ T^{(e)^{T}} $$ gives

$$ \left[ \begin{array}{cccc} l_{s}^{2} & l_{s}m_{s} & -l_{s}^{2} & -l_{s}m_{s} \\ l_{s}m_{s} & m_{s}^{2} & l_{s}m_{s} & -m_{s}^{2} \\ -l_{s}^{2} & -l_{s}m_{s} & l_{s}^{2} & l_{s}m_{s} \\ -l_{s}m_{s} & -m_{s}^{2} & l_{s}m_{s} & m_{s}^{2} \end{array} \right]$$

5-Bar Truss System
The execution of this code results in:

EDU>> TrussAssemblyEx

K =

1.0e+005 *

0.3260   0.7607   -0.3260   -0.7607         0         0         0         0    0.7607    1.7749   -0.7607   -1.7749         0         0         0         0   -0.3260   -0.7607    0.3260    0.7607         0         0         0         0   -0.7607   -1.7749    0.7607    1.7749         0         0         0         0         0         0         0         0         0         0         0         0         0         0         0         0         0         0         0         0         0         0         0         0         0         0         0         0         0         0         0         0         0         0         0         0

K =

1.0e+005 *

0.3260   0.7607   -0.3260   -0.7607         0         0         0         0    0.7607    1.7749   -0.7607   -1.7749         0         0         0         0   -0.3260   -0.7607    2.1009    1.5213         0         0   -1.7749   -0.7607   -0.7607   -1.7749    1.5213    2.1009         0         0   -0.7607   -0.3260         0         0         0         0         0         0         0         0         0         0         0         0         0         0         0         0         0         0   -1.7749   -0.7607         0         0    1.7749    0.7607         0         0   -0.7607   -0.3260         0         0    0.7607    0.3260

K =

1.0e+005 *

0.3260   0.7607   -0.3260   -0.7607         0         0         0         0    0.7607    2.9749   -0.7607   -1.7749         0   -1.2000         0         0   -0.3260   -0.7607    2.1009    1.5213         0         0   -1.7749   -0.7607   -0.7607   -1.7749    1.5213    2.1009         0         0   -0.7607   -0.3260         0         0         0         0         0         0         0         0         0   -1.2000         0         0         0    1.2000         0         0         0         0   -1.7749   -0.7607         0         0    1.7749    0.7607         0         0   -0.7607   -0.3260         0         0    0.7607    0.3260

K =

1.0e+005 *

0.3260   0.7607   -0.3260   -0.7607         0         0         0         0    0.7607    2.9749   -0.7607   -1.7749         0   -1.2000         0         0   -0.3260   -0.7607    2.1009    1.5213         0         0   -1.7749   -0.7607   -0.7607   -1.7749    1.5213    2.1009         0         0   -0.7607   -0.3260         0         0         0         0    1.2000         0   -1.2000         0         0   -1.2000         0         0         0    1.2000         0         0         0         0   -1.7749   -0.7607   -1.2000         0    2.9749    0.7607         0         0   -0.7607   -0.3260         0         0    0.7607    0.3260

K =

1.0e+005 *

0.3260   0.7607   -0.3260   -0.7607         0         0         0         0    0.7607    2.9749   -0.7607   -1.7749         0   -1.2000         0         0   -0.3260   -0.7607    2.4309    1.1914   -0.3300    0.3300   -1.7749   -0.7607   -0.7607   -1.7749    1.1914    2.4309    0.3300   -0.3300   -0.7607   -0.3260         0         0   -0.3300    0.3300    1.5300   -0.3300   -1.2000         0         0   -1.2000    0.3300   -0.3300   -0.3300    1.5300         0         0         0         0   -1.7749   -0.7607   -1.2000         0    2.9749    0.7607         0         0   -0.7607   -0.3260         0         0    0.7607    0.3260

R =

0          0           0     -150000           0           0           0           0

Using this data, it is possible to create MATLAB code to graphically represent a scaled version of the deformed truss system.



Three-bar truss system
The code used to solve the two-bar truss system was altered to solve the three-bar truss system. The altered code is displayed below, followed by the functions required to solve the system, along with a diagram near the end portraying the deformation in the system. % Three bar truss example taken from 2 bar truss example % modified for three bars instead clear all; % Matrices e, A, and L represent Young's Modulus, cross sectional area, and % length of the three elements e = [2 4 3]; A = [3 1 2]; L=[5 5 10]; % Verical force exerted on node 2 P = 30; % Angles between each element and the horizontal alpha = pi/6; beta = pi/6; ceta = pi/4;  % note: "ceta" is not actually a greek letter % Coordinates of each of the 4 nodes calculated with trigonometry nodes = [0, 0; L(1)*cos(alpha), L(1)*sin(alpha); 2*L(1)*cos(alpha), 0; L(1)*cos(alpha)-L(3)*cos(ceta),L(1)*sin(alpha)-L(3)*sin(ceta)]; % Since the problem contains 4 nodes, there are 8 global degrees of freedom dof=2*length(nodes); % The connectivity matrix describes which nodes are connected to one % another by listing each row as an element and the global nodes it % connects conn=[1,2; 2,3; 2,4]; % The location matrix master array details which global degrees of freedom % are related to matching local degrees of freedom. lmm = [1, 2, 3, 4; 3, 4, 5, 6; 3, 4, 7, 8]; % The number of elements is determined by the size of the lmm matrix elems=size(lmm,1); % The K (square) and R (columnar) matrices are initialized with zeros K=zeros(dof); R = zeros(dof,1); debc = [1, 2, 5, 6, 7, 8]; ebcVals = zeros(length(debc),1); % Load vector R = zeros(dof,1); R(4) = P; % Assemble global stiffness matrix K=zeros(dof); for i=1:elems lm=lmm(i,:); con=conn(i,:); k_local=e(i)*A(i)/L(i)*[1 -1; -1 1] k=PlaneTrussElement(e(i), A(i), nodes(con,:)) K(lm, lm) = K(lm, lm) + k; end K R % Nodal solution and reactions [d, reactions] = NodalSoln(K, R, debc, ebcVals) results=[]; for i=1:elems results = [results; PlaneTrussResults(e, A, ...           nodes(conn(i,:),:), d(lmm(i,:)))]; end format short g results The above code uses the following functions obtained from the website highlighted in the Fundamental Finite Element Analysis and Applications textbook by Bhatti. function k = PlaneTrussElement(e, A, coord) % PlaneTrussElement(e, A, coord) % Generates stiffness matrix for a plane truss element % e = modulus of elasticity % A = area of cross-section % coord = coordinates at the element ends x1=coord(1,1); y1=coord(1,2); x2=coord(2,1); y2=coord(2,2); L=sqrt((x2-x1)^2+(y2-y1)^2); ls=(x2-x1)/L; ms=(y2-y1)/L; k = e*A/L*[ls^2, ls*ms,-ls^2,-ls*ms; ls*ms, ms^2,-ls*ms,-ms^2; -ls^2,-ls*ms,ls^2,ls*ms; -ls*ms,-ms^2,ls*ms,ms^2]; function [d, rf] = NodalSoln(K, R, debc, ebcVals) % [nd, rf] = NodalSoln(K, R, debc, ebcVals) % Computes nodal solution and reactions % K = global coefficient matrix % R = global right hand side vector % debc = list of degrees of freedom with specified values % ebcVals = specified values dof = length(R); df = setdiff(1:dof, debc); Kf = K(df, df); Rf = R(df) - K(df, debc)*ebcVals; dfVals = Kf\Rf; d = zeros(dof,1); d(debc) = ebcVals; d(df) = dfVals; rf = K(debc,:)*d - R(debc); function [eps, sigma, force] = PlaneTrussResults(e, A, coord, disps) % [eps, sigma, force] = PlaneTrussResults(e, A, coord, disps) % Compute plane truss element results % e = modulus of elasticity % A = Area of cross-section % coord = coordinates at the element ends % disps = displacements at element ends % The output quantities are eps = axial strain % sigma = axial stress and force = axial force. x1=coord(1,1); y1=coord(1,2); x2=coord(2,1); y2=coord(2,2); L=sqrt((x2-x1)^2+(y2-y1)^2); ls=(x2-x1)/L; ms=(y2-y1)/L; T=[ls,ms,0,0; 0,0,ls,ms]; d = T*disps; eps= (d(2)-d(1))/L; sigma = e.*eps; force = sigma.*A; Results of the solved 3-bar truss problem are as follows: k_local = 1.2        -1.2         -1.2          1.2 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_local = 0.8        -0.8         -0.8          0.8 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_local = 0.6        -0.6         -0.6          0.6 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 = 0.9     0.51962         -0.9     -0.51962            0            0            0            0      0.51962          0.3     -0.51962         -0.3            0            0            0            0         -0.9     -0.51962          1.8      0.47321         -0.6      0.34641         -0.3         -0.3     -0.51962         -0.3      0.47321          0.8      0.34641         -0.2         -0.3         -0.3            0            0         -0.6      0.34641          0.6     -0.34641            0            0            0            0      0.34641         -0.2     -0.34641          0.2            0            0            0            0         -0.3         -0.3            0            0          0.3          0.3            0            0         -0.3         -0.3            0            0          0.3          0.3 R = 0    0     0    30     0     0     0     0 d = 0           0      -11.674       44.405            0            0            0            0 reactions = -12.567     -7.2557       22.387      -12.925      -9.8194      -9.8194 results = 2.4186      6.4625       2.3145

Displaying the three-bar truss problem can be done with the code written below. clear; close; % The 3-bar truss problem has 8 connection points between lines that will % be displayed n_node = 8; % there are 9 dotted lines to be displayed, showing the 3-bar truss system % before deformation and showing the lines AB, AC, AD n_elem = 9; % P values calculated from the results above based on the equation % P = sqrt[(f1_1)^2 + (f2_1)^2] P2_1 = 14.512; P1_2 = 25.849; P1_3 = 13.88676; k_1 = 1.2; k_2 = 0.8; k_3 = 0.6; % Deformation in each bar calculated by P(e)/k(e) AB = P2_1/k_1; AC = P1_2/k_2; AD = P1_3/k_3; % Positions of all 8 nodes based on the origin at global node 4 position(:,1) = [10*cos(pi/4)-5*cos(pi/6); 10*sin(pi/4)-5*sin(pi/6); 0];  % global node 1 position(:,2) = [10*cos(pi/4); 10*sin(pi/4); 0];    % Point A, global node 2 position(:,3) = [10*cos(pi/4)+5*cos(pi/6); 10*sin(pi/4)-5*sin(pi/6); 0];     % global node 3 position(:,4) = [0; 0; 0]; % global node 4 position(:,5) = [10*cos(pi/4)+AB*cos(pi/6); 10*sin(pi/4)+AB*sin(pi/6); 0]; % point B position(:,6) = [10*cos(pi/4)-AC*cos(pi/6); 10*sin(pi/4)+AC*sin(pi/6); 0];  % point C position(:,7) = [10*cos(pi/4)+AD*cos(pi/4); 10*sin(pi/4)+AD*sin(pi/4); 0];  % point D position(:,8) = [-4.60; 51.48; 0];  % point E, or global node 2 after deformation % Creates x,y,z coordinates for the position of each node above for i = 1 : n_node; x(i) = position(1,i); y(i) = position(2,i); z(i) = position(3,i); end % node_connect(local node number, element number) = global node number node_connect(1,1) = 1; node_connect(2,1) = 2; node_connect(1,2) = 2; node_connect(2,2) = 3; node_connect(1,3) = 2; node_connect(2,3) = 4; node_connect(1,4) = 2; node_connect(2,4) = 5; node_connect(1,5) = 2; node_connect(2,5) = 6; node_connect(1,6) = 2; node_connect(2,6) = 7; node_connect(1,7) = 5; node_connect(2,7) = 8; node_connect(1,8) = 6; node_connect(2,8) = 8; node_connect(1,9) = 7; node_connect(2,9) = 8; % Plotting a dotted line between nodes for i = 1 : n_elem; node_1 = node_connect(1,i); node_2 = node_connect(2,i); xx = [x(node_1),x(node_2)]; yy = [y(node_1),y(node_2)]; zz = [z(node_1),z(node_2)]; plot3(xx,yy,zz,':') hold on end % Plotting a solid line to represent the deformed 3-bar truss system % Element 1 node_1 = 1; node_2 = 8; xx = [x(node_1),x(node_2)]; yy = [y(node_1),y(node_2)]; zz = [z(node_1),z(node_2)]; % Element 2 node_1 = 3; node_2 = 8; xxx = [x(node_1),x(node_2)]; yyy = [y(node_1),y(node_2)]; zzz = [z(node_1),z(node_2)]; % Element 3 node_1 = 4; node_2 = 8; xxxx = [x(node_1),x(node_2)]; yyyy = [y(node_1),y(node_2)]; zzzz = [z(node_1),z(node_2)]; plot3(xx,yy,zz,'-') plot3(xxx,yyy,zzz,'-') plot3(xxxx,yyyy,zzzz,'-') title('Deformed and undeformed three-bar truss system') xlabel('x') ylabel('y') zlabel('z') view([0 0 1])     % xy plane view

''Note: this MATLAB code was created using the following codes as examples:

- The MATLAB script for analyzing the Two Bar Truss System was obtained from Professor Vu-Quoc's website http://clesm.mae.ufl.edu/~vql/courses/fead/2008.fall/codes/twoBarTrussEx.txt

- The MATLAB script for the plot of a crab-leg structure created by X.G. Tan (2003) and obtained from Professor Vu-Quoc's website http://apollo.mae.ufl.edu/~vql/courses/fead/2006.fall/codes/matlab_plot_example2.m

- The MATLAB script for the plot of an electric pylon (undeformed five-bar truss structure) created by Team MeshWorks (2003) and obtained from Professor Vu-Quoc's website http://apollo.mae.ufl.edu/~vql/courses/fead/2006.fall/code.web.pages/electric_pylon.m''

From the above 2-bar truss system, expand the relationship F = k d for the sum of the vertical forces  In Local DOFs:

$$P = [k_{41}^{(1)}d_1^{(1)} + k_{42}^{(1)}d_2^{(1)} + k_{43}^{(1)}d_3^{(1)} + k_{44}^{(1)}d_4^{(1)}] + [k_{21}^{(2)}d_1^{(2)} + k_{22}^{(2)}d_2^{(2)} + k_{23}^{(2)}d_3^{(2)} + k_{24}^{(2)}d_4^{(2)}]$$

In Global DOFs:

$$P = [k_{41}^{(1)}d_1 + k_{42}^{(1)}d_2 + k_{43}^{(1)}d_3 +k_{44}^{(1)}d_4] + [k_{21}^{(2)}d_3  + k_{22}^{(2)}d_4 + k_{23}^{(2)}d_5 + k_{24}^{(2)}d_6]$$

Where

$$d_1^{(1)} = d_1$$ $$d_2^{(1)} = d_2$$ $$d_3^{(1)} = d_2^{(2)}=d_3$$ $$d_4^{(1)} = d_1^{(2)}=d_4$$ $$d_3^{(2)} = d_5$$ $$d_4^{(2)} = d_6$$

are defined as the conversions between local DOFs to global DOFs.

2-Bar Truss Eigenvectors
The eigenvalues of the global stiffness matrix are as follows:

$$\textbf{K}= \begin{bmatrix} 0.5625 & 0.3248 & -0.5625 & -0.3248 & 0 & 0 \\ 0.3248 & 0.1875 & -0.3248 & -0.1875 & 0 & 0 \\ -0.5625 & -0.3248 & 3.0625 & -2.1752 & -2.5 & 2.5 \\ -0.3248 & -0.1875 & -2.1752 & 2.6875 & 2.5 & -2.5 \\ 0 & 0 & -2.5 & 2.5 & 2.5 & -2.5 \\ 0 & 0 & 2.5 & -2.5 & -2.5 & 2.5  \end{bmatrix}\,$$

To find the eigenvectors corresponding to the eigenvalues of the global stiffness matrix, first the matrix of eigenvalues is defined in MATLAB:

k =

0.5625   0.3248   -0.5625   -0.3248         0         0    0.3248    0.1875   -0.3248   -0.1875         0         0   -0.5625   -0.3248    3.0625   -2.1752   -2.5000    2.5000   -0.3248   -0.1875   -2.1752    2.6875    2.5000   -2.5000         0         0   -2.5000    2.5000   -2.5000    2.5000         0         0    2.5000   -2.5000    2.5000   -2.5000

Then, the following command is implemented:

EDU>> E = eig(k)

E =

-7.0650  -0.0000   -0.0000    0.0000    1.4401    7.1249

Plotting these values in yields the following graph:



Plotting eigenvectors corresponding to zero eigenvectors for a 3 bar truss system
Assume the following case of a 3 bar truss system:



Where a=b=1, and the three bar properties consist of; E=2 and A=3. This means for all elements, $$\ k=\frac{(EA)}{L}=\frac{(2*3)}{1}=6 $$

The system can be described as $$\ \mathbf{K} * \mathbf{v}= \mathbf{\lambda\ }* \mathbf{v} $$

Where $$\ \mathbf{K} $$ is the 6x6 stiffness matrix for the contrained system.

Individual Contributions
Eml4500.f08.bottle.vitello 17:49, 12 October 2008 (UTC) Eml4500.f08.bottle.butler 21:01, 16 October 2008 (UTC) Eml4500.f08.bottle.hipps 20:32, 19 October 2008 (UTC) Eml4500.f08.bottle.brockmiller 20:21, 23 October 2008 (UTC) Eml4500.f08.bottle.loschak 04:49, 24 October 2008 (UTC) Eml4500.f08.bottle.barnes 15:04, 24 October 2008 (UTC) Eml4500.f08.bottle.ranto 15:48, 24 October 2008 (UTC)