User:Eml4500.f08.Lulz.Layton.Eric/Hw3

Class Notes
Derivation of element force displacement with respect to the global coordinate system (p. 6-1)

$$\textbf{k}^{(e)}\textbf{d}^{(e)}=\textbf{f}^{(e)}$$ (1)

Where k(e) is the 4 x 4 element stiffness for element e, d(e) is the 4 x 1 element displacement of element e, and f(e) is the element force matrix.

A two force body argument example is given below:



The matrix equation for solving for the axial force can be written below:

$$k^{(e)}\hat{\textbf{k}}^{(e)}\textbf{q}^{(e)}=\textbf{p}^{(e)}$$ (2)

$$k^{(e)}\left[\begin{array}{c c} 1 & -1\\ -1 & 1 \end{array}\right] \begin{Bmatrix} q_1^{(e)}\\ q_2^{(e)} \end{Bmatrix}= \begin{Bmatrix} P_1^{(e)}\\ P_2^{(e)} \end{Bmatrix}$$

where:

$$q_i^{(e)}$$ = axial displacement of element e at local node i

$$P_i^{(e)}$$ = axial force of element e at local node i

The goal is to derive Equation (1) from Equation (2). We would like to find a relationship between q(e) and d(e) and between P(e) and f(e)

This relationship can be expressed in the form:

$$\textbf{q}^{(e)}=\textbf{T}^{(e)}\textbf{f}^{(e)}$$

Considering the displacement vector of local node 1:



$$d_1^{(e)}=d_1^{(e)}\overrightarrow{i}+d_2^{(e)}\overrightarrow{j}$$

$$q_1^{(e)}$$ = axial disp of node 1 is the orthogonal projection of the displacement. Vector $$\overrightarrow{d}_1^{(e)}$$ of node 1 on the axis x of elem e.

$$q_1^{(e)}=\vec{d_1^{(e)}}\cdot\vec{\tilde{i}}$$

$$q_1^{(e)}=(d_1^{(e)}\vec{i}+d_2^{(e)}\vec{j})\cdot\vec{\tilde{i}}$$

$$q_1^{(e)}=d_1^{(e)}(\vec{i}\cdot\vec{\tilde{i}})+d_2^{(e)}(\vec{j}\cdot\vec{\tilde{i}})$$

$$(\vec{i}\cdot\vec{\tilde{i}})$$ and $$(\vec{j}\cdot\vec{\tilde{i}})$$ are director cosines

$$q_1^{(e)}=l^{(e)}d_1^{(e)}+m^{(e)}d_2^{(e)}$$

$$q_1^{(e)}=\lfloor\begin{array}{c c} l^{(e)} & m^{(e)} \end{array}\rfloor \begin{Bmatrix} d_1^{(e)}\\ d_2^{(e)} \end{Bmatrix}$$

where $$q_1^{(e)}$$ is a 1 X 1 scalar matrix. similarly for local node 2:

$$q_2^{(e)}=\lfloor\begin{array}{c c} l^{(e)} & m^{(e)} \end{array}\rfloor \begin{Bmatrix} d_3^{(e)}\\ d_4^{(e)} \end{Bmatrix}$$

Therefor:

$$\begin{Bmatrix} q_1^{(e)}\\ q_2^{(e)} \end{Bmatrix}= \left[\begin{array}{c c c c} l^{(e)} & m^{(e)} & 0 & 0\\ 0 & 0 & l^{(e)} & m^{(e)} \end{array}\right] \left\{\begin{array}{c} d_1^{(e)}\\ d_2^{(e)}\\ d_3^{(e)}\\ d_4^{(e)} \end{array}\right\}$$

Similarly:

$$\begin{Bmatrix} P_1^{(e)}\\ P_2^{(e)} \end{Bmatrix}=\textbf{T}^{(e)} \left\{\begin{array}{c} f_1^{(e)}\\ f_2^{(e)}\\ f_3^{(e)}\\ f_4^{(e)} \end{array}\right\}$$

Recall the element axial Force-Displacement relationship:

$$\hat{\textbf{k}}^{(e)}\textbf{q}^{(e)}=\textbf{P}^{(e)}$$

$$\hat{\textbf{k}}^{(e)}(\textbf{T}^{(e)}\textbf{d}^{(e)})=\textbf{T}^{(e)}\textbf{f}^{(e)}$$

Now we want to have:

$$\hat{\textbf{k}}^{(e)}\textbf{d}^{(e)}=\textbf{f}^{(e)}$$

So we move $$\textbf{T}^{(e)}$$ to left hand side. Unfortunately T(e) is a rectangular matrix (2x4) so we can't invert.

Therefore we get:

$$[\textbf{T}^{(e)T}\hat{\textbf{k}}^{(e)}\textbf{T}^{(e)}]\text{d}^{(e)}=\textbf{f}^{(e)}$$

$$\textbf{k}^{(e)}\textbf{d}^{(e)}=\textbf{f}^{(e)}$$

This equation is given without proof, so a homework problem was given to prove that the left hand side is equal to the right hand side of the equation. The justification for pursuing the above equation is due to the Principle of Virtual Work (PVW). Page 10-1 has the 1st applied use of PVW reduction of global force displacement.

Why not solve like so?

$$\textbf{d}=\textbf{K}^{-1}\textbf{F}$$

This method cannot be pursued because the determinant of K is zero, which causes a singularity when moving to the right hand side.

$$\frac{1}{det\textbf{K}}=\frac10$$

$$\frac{1}{det\textbf{K}}$$ is needed to find the inverse K-1. In an unconstrained structural system, there are 3 possible rigid body motions in 3-D. This includes 2 translational and 1 rotational reactions.

Closing the loop between the FEM and statics is virtual displacement.

The two-bar truss system

Closing the Loop FEM Computational Displacement Computational Reactions Statics

From Page 11-2, the Free Body Diagram of the 2 force bodies. (elem 1,2). Using statics, the reactions are known and the number of forces are then known.

$$P_1^{(1)}$$ and $$P_2^{(2)}$$ are known by statics. In order to compute the axial displacement (amount of extension in the bars) dof, $$q_2^{(1)} $$ must be found.

$$q_2^{(1)} = \frac{|P_1^{(1)}|}{k^{(1)}} = \frac{|P_2^{(2)}|}{k^{(1)}}$$

$$q_2^{(1)} = 0 $$. This is fixed at node 1.

The following picture reveals an undeformed truss system and deformed truss system.



How can we be certain that the above picture represents the displacements correctly?



From this picture we see that:

$$u_y=Rsin(\alpha)$$

$$u_x=R[1-cos(\alpha)]$$

Assuming that alpha is small allows us to assume:

$$u_y=R\alpha$$

$$u_x=R$$

There are two unknowns $$(x_D, y_D)$$

We need equations for line AB and line BC

The following is a general problem to further explain this method:



Where Q can slide anywhere along the line.

$$\textbf{PQ}=(PQ)\overrightarrow{\tilde{i}}=(PQ)[cos\theta\overrightarrow{i}+sin\theta\overrightarrow{j}]$$

$$\textbf{PQ}=(x-x_P)\overrightarrow{i}+(y-y_P)\overrightarrow{j}$$

Therefore:

$$x-x_P=(PQ)cos\theta$$

$$y-y_P=(PQ)sin\theta$$

Further:

$$\frac{y-y_P}{x-x_P}=tan\theta$$

Finally:

$$y-y_P=(tan\theta)(x-x_P)$$

So, an equation for a line perpendicular to the above line, passing through point P is:

$$y-y_P=tan(\theta+\frac{\pi}{2}(x-x_P)$$

3-bar Truss System


For element 1:

$$E^{(1)}=2$$ $$A^{(1}=3$$ $$L^{(1)}=5$$ $$\theta^{(1)}=30$$(deg)

For element 2:

$$E^{(2)}=4$$ $$A^{(2}=1$$ $$L^{(2)}=5$$ $$\theta^{(2)}=30$$(deg)

For element 3:

$$E^{(3)}=3$$ $$A^{(3}=2$$ $$L^{(3)}=10$$ $$\theta^{(3)}=45$$(deg)

If we break down each element into its free-body diagram we get the following 3 pictures:







If we put these 3 pictures together we get:



We cannot solve this problem by statics because we only have 2 useful equations.

$$\Sigma F_x=0$$

$$\Sigma F_y=0$$

The moment equation $$\Sigma M_A=0$$ is trivial and does not help us solve the problem.

But what about taking the moment about an arbitrary point B?



Following the math for this we get:

$$\Sigma\textbf{M}_B=\textbf{BA}\times\textbf{F}$$

$$\Sigma\textbf{M}_B=\textbf{BA}^'\times\textbf{F}$$

$$\textbf{BA}^'=\textbf{BA}\times\textbf{AA}^'$$

$$\Sigma\textbf{M}_B=(\textbf{BA}+\textbf{AA}^')\times\textbf{F}$$

$$\Sigma\textbf{M}_B=\textbf{BA}\times\textbf{F} + \textbf{AA}^'\times\textbf{F}$$

Where: $$\textbf{AA}^'\times\textbf{F}=0$$ which is trivial and doesn't help us.

Now if we look back at the three-bar truss example we see that node A is in equilibrium.

$$\Sigma_{i=0}^3\textbf{F}_i=\overrightarrow{0}$$

So, where A' is any point on the line of action of Fi:

$$\Sigma\textbf{M}_{Bi}=\Sigma\textbf{BA}_i^' x \textbf{F}_i$$

Where $$\Sigma_i\textbf{F}_i=0$$ and is trivial.

Now we need to find the global stiffness matrix. This can be found in the following manner:



So, for example we see:

$$K_{33}=k_{33}^{(1)}+k_{11}^{(2)}+k_{11}^{(3)}$$

$$K_{34}=k_{34}^{(1)}+k_{12}^{(2)}+k_{12}^{(3)}$$

Axial displacement calculation for local node 2
During meeting 12, a calculation for the axial displacement of local node 1 for an arbitrary element e was considered. What follows is a similar calculation for local node 2 of the same element.

First, we define the displacement vector at local node 2 (Please note the [#] subscript was used in place of the "box" subscript used in class):

$$ \vec{\mathbf{d}^{(e)}_{[2]}} = d_{3}^{(e)} \vec{i} + d_{4}^{(e)} \vec{j} $$

Next, the axial displacement at node 2 is defined: $$ q_{2}^{(e)} = \vec{\mathbf{d}^{(e)}_{[2]}}\cdot\vec{\tilde{i}} $$

$$ q_{2}^{(e)} = (d_{3}^{(e)}\vec{i} + d_{4}^{(e)}\vec{j})\vec{\tilde{i}} $$

$$ q_{2}^{(e)} = d_{3}^{(e)}(\vec{i}\cdot\vec{\tilde{i}}) + d_{4}^{(e)}(\vec{j}\cdot\vec{\tilde{i}}) $$

From a previous homework question and the class notes, the following relations are valid:

$$\vec{\tilde{i}}\cdot\vec{i}=\cos\theta^{(e)}$$ $$\vec{\tilde{i}}\cdot\vec{j}=\sin\theta^{(e)}$$

Substituting,

$$ q_{2}^{(e)} = d_{3}^{(e)}\cos \theta^{(e)} + d_{4}^{(e)}\sin\theta^{(e)} $$

From the notes, the following relations are valid:

$$\cos\theta^{\left(e\right)} = l^{(e)}$$ $$\sin\theta^{\left(e\right)} = m^{(e)}$$

Substituting,

$$ q_{2}^{(e)} = d_{3}^{(e)}l^{(e)} + d_{4}^{(e)}m^{(e)} $$

Putting the above equation yields the following result, consistent with that of the axial displacement of local node 1:

$$ q_{2}^{(e)} = \begin{bmatrix} l^{(e)} & m^{(e)} \end{bmatrix}\begin{Bmatrix} d_{3}^{(e)}\\ d_{4}^{(e)} \end{Bmatrix} $$

Proof of $$\mathbf{k}^{(e)} = \mathbf{T}^{(e)^{T}} \mathbf{\hat{k}}^{(e)}\mathbf{T}^{(e)}$$
In this question we are asked to prove that the above matrix product generates the generic element stiffness matrix $$\mathbf{k}^{(e)}$$.

First, the three matrices used to generate the product:

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

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

$$\mathbf{\hat{k}}^{(e)} = \begin{bmatrix} 1&-1 \\ -1&1 \\ \end{bmatrix}$$

The product of the first two matrices:

$$\mathbf{\hat{k}}^{(e)}\mathbf{T}^{(e)} = \begin{bmatrix} 1&-1 \\ -1&1 \\ \end{bmatrix} \begin{bmatrix} l^{(e)}&m^{(e)}&0&0 \\ 0&0&l^{(e)}&m^{(e)} \end{bmatrix} = \begin{bmatrix} l^{(e)}&m^{(e)}&-l^{(e)}&-m^{(e)} \\ -l^{(e)}&-m^{(e)}&l^{(e)}&m^{(e)} \\ \end{bmatrix}$$

The entire product multiplied out:

$$\mathbf{T}^{(e)^{T}}\mathbf{\hat{k}}^{(e)}\mathbf{T}^{(e)} = \begin{bmatrix} l^{(e)}&0 \\ m^{(e)}&0 \\ 0&l^{(e)} \\ 0&m^{(e)} \\ \end{bmatrix} \begin{bmatrix} l^{(e)}&m^{(e)}&-l^{(e)}&-m^{(e)} \\ -l^{(e)}&-m^{(e)}&l^{(e)}&m^{(e)} \\ \end{bmatrix} $$ $$ = \begin{bmatrix} l^{(e)^{2}} & m^{(e)}l^{(e)} & -l^{(e)^{2}} & -m^{(e)}l^{(e)} \\ m^{(e)}l^{(e)} & m^{(e)^{2}} & -m^{(e)}l^{(e)} & -m^{(e)^{2}}\\ -l^{(e)^{2}} & -m^{(e)}l^{(e)} & l^{(e)^{2}} & m^{(e)}l^{(e)}\\ -m^{(e)}l^{(e)} & -m^{(e)^{2}} & m^{(e)}l^{(e)} & m^{(e)^{2}} \\ \end{bmatrix} $$

As shown in previous homework question, the element stiffness matrix:

$$\mathbf{k}^{(e)} = \begin{bmatrix} l^{(e)^{2}} & m^{(e)}l^{(e)} & -l^{(e)^{2}} & -m^{(e)}l^{(e)} \\ m^{(e)}l^{(e)} & m^{(e)^{2}} & -m^{(e)}l^{(e)} & -m^{(e)^{2}}\\ -l^{(e)^{2}} & -m^{(e)}l^{(e)} & l^{(e)^{2}} & m^{(e)}l^{(e)}\\ -m^{(e)}l^{(e)} & -m^{(e)^{2}} & m^{(e)}l^{(e)} & m^{(e)^{2}} \\ \end{bmatrix}$$

Thus, it is easily shown that the following relation is indeed true:

$$\mathbf{k}^{(e)} = \mathbf{T}^{(e)^{T}} \mathbf{\hat{k}}^{(e)}\mathbf{T}^{(e)}$$

Eigenvalues of the Global Stiffness Matrix
From Homework 2, the MATLAB code for the two bar truss system produced the global stiffness matrix (K) verified by manual calculations. This matrix was used to determine the eigenvalues. After running the M-file "TwoBarTrussSystem" and the command "format", the following output was produced.

>> K

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

>> eig(K)

ans =

-0.0000  -0.0000    0.0000    0.0000    1.4705   10.0295 The negative sign in front of the first two zeros implies that all four "zeros" are actually very small values. Due to the precision in MATLAB, it is assumed that the "zeros" are essentially zero.

Under this assumption, the result of four zeros as eigenvalues represents the four degrees of freedom of the two bar truss system that are fixed. Those four degrees of freedom are the x and y directional displacements at global nodes 1 and 3.

Comparison of Global F-d relationships and Elemental F-d relationships
From Homework 2, the elemental F-d relationships produced reactions at global nodes 1 and 3 as shown below.

$$ \begin{bmatrix} F_{1} \\ F_{2} \\ F_{5} \\ F_{6} \end{bmatrix}= \begin{bmatrix} -4.4378 \\ -2.5622 \\ 4.4378 \\ -4.4378 \end{bmatrix} $$

For the global F-d relationships method, the following calculations were performed to produce the reactions at all the nodes. Columns 1, 2, 5, and 6 were removed from the global stiffness matrix, and rows of the same rank were removed from the displacement matrix. This is because the four directional displacements of Nodes 1 and 3 are all zero because the nodes are fixed.

$$ d_1 = d_2 = d_5 = d_6 = 0 $$

$$ \left[ \begin{array}{cc} K_{13} & K_{14} \\ K_{23} & K_{24} \\ K_{33} & K_{34} \\ K_{43} & K_{44} \\ K_{53} & K_{54} \\ K_{63} & K_{64} \end{array} \right]\begin{bmatrix} d_{3} \\ d_{4} \end{bmatrix}= \begin{bmatrix} F_{1} \\ F_{2} \\ F_{3} \\ F_{4} \\ F_{5} \\ F_{6} \end{bmatrix} $$

After running the M-file "TwoBarTrussSystem" and the command "format", the following output was produced. The global stiffness matrix (K) was the same one from the previous section.

>> d

d =

0        0    4.3520    6.1271         0         0

>> K34 = K(1:6,3:4)

K34 =

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

>> d34 = d(3:4)

d34 =

4.3520   6.1271

>> F = K34*d34

F =

-4.4378  -2.5622    0.0000    7.0000    4.4378   -4.4378

The reactions produced using the global F-d relationships method are identical to the results from the elemental F-d relationships method. The additional two values (rows 3 and 4) of the global method verify the load to the system.

Solve for AC and AB
As given in class, AC and AB are dependent on their elemental P's and K's. In HW 2 we solved for both elemental K values and one of the P values: that work is reproduced as appropriate in the proof below

$$AC = \frac{|P^{(1)}_2|}{K^{(1)}} = \frac{\sqrt{\left(f_3^{(1)}\right)^2 + \left(f_4^{(1)}\right)^2}}{\left(\frac{EA}L\right)} = \frac{\sqrt{(4.4378)^2 + (2.5622)^2}} = \frac{5.1243}{0.75} = 6.8324$$

$$AB = \frac{|P^{(2)}_1|}{K^{(2)}} = \frac{\sqrt{\left(f_1^{(2)}\right)^2 + \left(f_2^{(2)}\right)^2}}{\left(\frac{EA}L\right)} = \frac{\sqrt{(-4.438)^2 + (4.438)^2}} = \frac{6.2763}5 = 1.2553$$

Find (x,y) coordinates for $$(x_B, y_B), (x_C, y_C)$$, and $$(x_D,y_D)$$
From the previous homework problem we know that:

AC = 6.8324

AB = 1.255

We also know from the notes that the two following equations are true:

$$x_C=AC\cos(\theta)$$

$$y_C=AC\sin(\theta)$$

$$x_B=AB\cos(\theta)$$

$$y_B=AB\sin(\theta)$$

Knowing that for $$(x_b,y_b)$$ $$\theta$$ equals 135 and for $$(x_c,y_c)$$ $$\theta$$ equals 30 the two coordinates are found to be:

$$(x_B,y_B) = (-.887,.887)$$

$$(x_C,y_C) = (5.917,3.416)$$

The coordinates for $$(x_d,y_d)$$ are obtained using the following equation:

$$AD = (x_D - x_A)i + (y_D - y_A)j$$

Which reduces to:

$$AD = (x_D)i + (y_D)j$$

due to point a being at the origin. AD also equals:

$$AD = d_3i +d_4j$$

Knowing that $$d_3 = 4.35$$ and that $$d_4 = 6.127$$ it then can be determined that:

$$(x_D,y_D) = (4.35,6.127)$$

Global Stiffness Matrix for a Three-bar Truss System
For this portion of the homework we were asked to fill in the global stiffness matrix for the three-bar truss system. The global K matrix follows:

$$\left[\begin{array}{c c c c c c c c} k_{11}^{(1)}&k_{12}^{(1)}&k_{13}^{(1)}&k_{14}^{(1)}&0&0&0&0\\ k_{21}^{(1)}&k_{22}^{(1)}&k_{23}^{(1)}&k_{24}^{(1)}&0&0&0&0\\ k_{31}^{(1)}&k_{32}^{(1)}&(k_{33}^{(1)}+k_{11}^{(2)}+k_{11}^{(3)})& (k_{34}^{(1)}+k_{12}^{(2)}+k_{12}^{(3)})&k_{13}^{(2)}&k_{14}^{(2)}& k_{13}^{(3)}&k_{14}^{(3)}\\ k_{41}^{(1)}&k_{42}^{(1)}&(k_{43}^{(1)}+k_{21}^{(2)}+k_{21}^{(3)})& (k_{44}^{(1)}+k_{22}^{(2)}+k_{22}^{(3)})&k_{23}^{(2)}&k_{24}^{(2)}& k_{23}^{(3)}&k_{24}^{(3)}\\ 0&0&k_{31}^{(2)}&k_{32}^{(2)}&k_{33}^{(2)}&k_{34}^{(2)}&0&0\\ 0&0&k_{41}^{(2)}&k_{42}^{(2)}&k_{43}^{(2)}&k_{44}^{(2)}&0&0\\ 0&0&k_{31}^{(3)}&k_{32}^{(3)}&0&0&k_{33}^{(3)}&k_{34}^{(3)}\\ 0&0&k_{41}^{(3)}&k_{42}^{(3)}&0&0&k_{43}^{(3)}&k_{44}^{(3)} \end{array}\right]$$

Matlab Code
The following Matlab code was written to plot the shape of the undeformed and deformed two-bar truss system that was discussed in class. The first part of the code clears all previous data and closes any open figures. The next part is the definition of the inputs. First we define the displacements as obtained from running the Matlab code from HW2, the number of nodes and the number of elements. Next we input the material properties of element 1 and element 2 which have already been defined. Using the lengths and angels of each element, and assuming that global node 1 is at the origin, we populate a position array pos with the x and y coordinates of the local nodes of each element, where row 1 is element 1 and row 2 is element 2. Then, using a simple for loop, we transfer this data two separate column arrays, x and y, that hold the x and y coordinates of each node respectively. The following part sets up the connectivity arrays for element 1 and element 2 using the following formula:

node_conn(local node number, elemnt number) = global node number

Following this we have a for loop which plots the undeformed shape of the two-bar truss system and a couple lines to add text to the figure to label the nodes and elements. To be able to plot the deformed shape, we first need to re-define the position matrix to account for the displacements of each node. We then re-populate the x and y arrays with the new values. Now we can plot the deformed shape using the same basic for loop and the same connectivity arrays.

The Matlab code and the resulting plot follow:

% Matlab Script %***************************************************** % % Purpose: %  Sketch the undeformed and deformed %  two-bar truss system from the clas %  example problem. % % Author: Benjamin Mitchell % % Created: 10-07-2008 00:25:38 EST % %***************************************************** clear; close; d1 = 0;        %disp of node 1 in the x direction d2 = 0;        %disp of node 1 in the y direction d3 = 4.3520;   %disp of node 2 in the x direction d4 = 6.1271;   %disp of node 2 in the y direction d5 = 0;        %disp of node 3 in the x direction d6 = 0;        %disp of node 3 in the y direction %input nodal coordinates num_nodes = 3;              %total number of nodes num_elems = 2;              %total number of elements tot_dofs = 2 * num_nodes;   %total dofs of the system %element 1 details L1 = 4; E1 = 3; A1 = 1; theta1 = 30; %deg thetar1 = (pi * theta1)/180; %element 2 details L2 = 2; E2 = 5; A2 = 2; theta2 = -45; %deg thetar2 = (pi * theta2)/180; %undeformed positions pos(1,:)=[0,L1*cos(thetar1),L1*cos(thetar1) + L2*cos(thetar2)]; pos(2,:)=[0,L1*sin(thetar1),0]; %undeformed nodal coordinate arrays for i=1:num_nodes x(i)=pos(1,i); y(i)=pos(2,i); end %element connectivity array %follows: %node_conn(local node number, elemnt number) = global node number node_conn(1,1)=1;    %element 1 node_conn(2,1)=2; node_conn(1,2)=2;    %element 2 node_conn(2,2)=3; %plot the undeformed 2-bar truss system for i=1:num_elems node_1=node_conn(1,i); node_2=node_conn(2,i); xx=[x(node_1),x(node_2)]; yy=[y(node_1),y(node_2)]; axis([-4 10 -4 10]) plot(xx,yy,'--rs') hold on end text(x(node_conn(1,1)),y(node_conn(1,1))-.5,'Global Node 1','HorizontalAlignment','center') text(x(node_conn(2,1)),y(node_conn(2,1))+.5,'Global Node 2','HorizontalAlignment','center') text(x(node_conn(2,2)),y(node_conn(2,2))-.5,'Global Node 3','HorizontalAlignment','center') text(x(node_conn(2,1))/2,y(node_conn(2,1))/2,'Element 1','HorizontalAlignment','center') text(x(node_conn(2,1))+(x(node_conn(2,2))-x(node_conn(2,1)))/2,(y(node_conn(1,2)))/2,... 'Element 2','HorizontalAlignment','center') %deformed positions pos(1,:)=[0 + d1,L1*cos(thetar1) + d3,L1*cos(thetar1) + L2*cos(thetar2) + d5]; pos(2,:)=[0 + d2,L1*sin(thetar1) + d4,0 + d6]; %deformed nodal coordinate arrays for i=1:num_nodes x(i)=pos(1,i); y(i)=pos(2,i); end %plot the deformed 2-bar truss system for i=1:num_elems hold on    node_1=node_conn(1,i); node_2=node_conn(2,i); xx=[x(node_1),x(node_2)]; yy=[y(node_1),y(node_2)]; plot(xx,yy,'-s') end text(x(node_conn(2,1)),y(node_conn(2,1))-.5,'Global Node 2','HorizontalAlignment','center') text(x(node_conn(2,1))/2,y(node_conn(2,1))/2,'Element 1','HorizontalAlignment','center') text(x(node_conn(2,1))+(x(node_conn(2,2))-x(node_conn(2,1)))/2,(y(node_conn(1,2)))/2,... 'Element 2','HorizontalAlignment','center') title('Deformed and Undeformed Two-bar Truss System') xlabel('X') ylabel('Y')



Contributing Members
Ben Mitchell - Eml4500.f08.Lulz.mitchell.bm 16:46, 8 October 2008 (UTC)

Sam Miorelli - Eml4500.f08.lulz.abcd 19:09, 8 October 2008 (UTC)

Aaron Fisher - Eml4500.f08.Lulz.fisher 19:11, 8 October 2008 (UTC)

Andrew Strack - Eml4500.f08.lulz.strack 19:19, 8 October 2008 (UTC)

Eric Layton - Eml4500.f08.Lulz.Layton.Eric 19:23, 8 October 2008 (UTC)

John Saxon - Eml4500.f08.Lulz.js 19:31, 8 October 2008 (UTC)