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

Team "TEAM"

WIKI Homework Report 2

Summary of Lecture Notes from Sept. 8 to Sept. 19 and MATLAB Code

The Element Picture(6-1 to 6-3)
Global FD at the element level

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

k is the element stiffness matrix for elem (e = 1, 2).

d is element displacement matrix of elem e.

f is element force matix.

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

$$ l^{(e)}, m^{(e)} = $$ director cosines of $$ \tilde x $$  axis (goes from [1] to [2]) write global (x,y) coordinates.

Derivation of director cosines:

$$ \tilde i = cos \theta^{(e)}*i + sin \theta^{(e)}*j $$

$$l^{(e)} = \tilde i \bullet  i = (cos \theta ^{(e)}i + sin \theta ^{(e)}j) \bullet i $$ $$ = cos \theta ^{(e)}(i \bullet i) + sin \theta ^{(e)}(j \bullet i) $$ where $$ i \bullet i = 1 $$and $$j \bullet i = 0 = cos \theta ^{e)} $$

$$m^{(e)}= \tilde i \bullet j = (cos \theta ^{(e)} i + sin \theta ^{(e)} j) \bullet j$$

$$= cos\theta^{(e)}(i\bullet j) + sin \theta ^{(e)}(j \theta j)$$ where $$i \bullet j = 0 $$ and $$j \bullet j = 1$$ $$= sin \theta ^{(e)}$$

The Two Bar Truss Model (7-1 to 7-2)


Element One
Inclination angle $$\theta^{(1)} = 30 \deg$$

Element Length $$L^{(1)} = 4$$

Cross-sectional area $$A^{(1)} = 1$$

therefore the computed value for l(1) and m(1) are as follows:

$$l^{(1)} = cos \theta^{(1)}$$ $$l^{(1)} = cos {(30)}$$ $$l^{(1)} = 0.866$$

$$m^{(1)} = sin \theta^{(1)}$$ $$m^{(1)} = sin {(30)}$$ $$m^{(1)} = 0.5$$

Once the values for l(1) and m(1) are computed, the stiffness matrix for element 1 can be determined:

$$K^{(1)}_{11} = [K^{(1)}(l^{(1)})^{2}] = [\frac {3}{4})(\frac{\sqrt{3}}{2})^{2}] = (\frac {9}{16}) = 0.5625$$

$$K^{(1)}_{12} = [K^{(1)}(l^{(1)})*m^{(1)}] = [\frac {3\sqrt{3}}{16} = 0.325$$

$$K^{(1)}_{42} = -[K^{(1)}(m^{(1)})^{2}] = \frac {-3}{16} = -0.1875$$

Obs:


 * 1) You only need to compute 3 numbers. The other coefficients have the same absolute value; they just differ by +/-.
 * 2) Matrix K(1) is symmetric, i.e.,

$$K^{(1)}_{ij} = K^{(1)}_{ji}$$ $$K^{(1)}_{13} = K^{(1)}_{31}$$

$$ K^{(e)} = \begin{bmatrix} K^{(e)}_{11} & K^{(e)}_{12} & K^{(e)}_{13} & K^{(e)}_{14} \\

& K^{(e)}_{22} & K^{(e)}_{23} & K^{(e)}_{24} \\

& & K^{(e)}_{33} & K^{(e)}_{34} \\

& & & K^{(e)}_{44} \\ \end{bmatrix} $$

Here, the upper right "triangle" portion of the matrix has to be computed. The remaining values are symmetric and differ by +/-.

Element Two
$$K^{(2)} = (\frac{E^{(2)}*A^{(2)}}{L^{(2)}}) = (\frac{5*2}{2}) = 5$$

$$\theta^{(2)} = (-\frac{\pi}{4})$$ therefore $$l^{(2)} = cos (\frac{-\pi}{4}) = (\frac{\sqrt{2}}{2}) $$

$$K^{(2)} = [K^{(2)}_{ij}]_{(4x4)}$$

$$K^{(2)}_{11} = K^{(2)}(l^{(2)})^{2} = 5 * (\frac {\sqrt{2}}{2})^{2} = 2.5$$

Obj:

<p style="text-align:center;">$$K^{(2)}_{ij}, e=2, (i,j) = 1,....,4$$ <p style="text-align:center;">are all the same: comp. 1 coefficient e <p style="text-align:center;">For other coefficients, add + or -
 * Absolute value of all coefficients:


 * K11(2)T = K(2), i.e. (K(2) is symmetric)

<p style="text-align:center;">$$K^{(e)}d^{(e)} = f$$ <p style="text-align:center;">e = 1,2
 * Element FD relationship:

<p style="text-align:center;">$$ d^{(e)} = \begin{bmatrix} d^{(e)}_{1} \\

d^{(e)}_{2} \\

d^{(e)}_{3} \\

d^{(e)}_{4} \\ \end{bmatrix}_{(4x1)} $$

<p style="text-align:center;">and

<p style="text-align:center;">$$ f^{(e)} = \begin{bmatrix} f^{(e)}_{1} \\

f^{(e)}_{2} \\

f^{(e)}_{3} \\

f^{(e)}_{4} \\ \end{bmatrix}_{(4x1)} $$

<p style="text-align:center;">$$K_{(nxn)} * d_{(nx1)} = f_{(nx1)}$$ <p style="text-align:center;">Here n = 6
 * Global FD relationship:

Element Stiffness Matrices (7-3 to 7-5)
In order to analyze the two different elements of the two-bar truss system, their individual stiffness matrices must be calculated. The notation for the elemental stiffness matrix can be denotes with an underlined, lower case "k" with a superscript "e" where "e" equals either 1 or 2 corresponding to its respective element. It can also be represented by an actual four by four matrix or an underlined k with a superscript "e" and a subscript "ij" uncased in brackets as seen below. "e" again denotes the element number, "i" denotes the row number, and "j" denotes the column number. Here in this example, "i" and "j" range from 1 to 4. <p style="text-align:center;">$$\displaystyle k^{(e)}_{matrix} $$ = $$\begin{bmatrix} k_{11} & k_{12} &k_{13} &k_{14} \\ k_{21} & k_{22} &k_{23} &k_{24} \\ k_{31} & k_{32} &k_{33} &k_{34} \\ k_{41} & k_{42} &k_{43} &k_{44} \\ \end{bmatrix} $$ =$$\begin{bmatrix} k^{(e)}_{ij} \\ \end{bmatrix} $$ However, an important aspect of the stiffness matrix is noticed using a more specific representation of this four b four matrix in this problem. From previous notes, the stiffness matrix is seen below. <p style="text-align:center;">$$\displaystyle k^{(e)}_{matrix} $$ = $$k^{(e)}\begin{bmatrix} (l^{(e)})^2 & l^{(e)}m^{(e)} & -(l^{(e)})^2 & -l^{(e)}m^{(e)} \\ l^{(e)}m^{(e)} & (m^{(e)})^2 &  -l^{(e)}m^{(e)} & -(m^{(e)})^2 \\ -(l^{(e)})^2 & -l^{(e)}m^{(e)} &  (l^{(e)})^2 & l^{(e)}m^{(e)} \\ -l^{(e)}m^{(e)} & -(m^{(e)})^2 & l^{(e)}m^{(e)} & (m^{(e)})^2 \\ \end{bmatrix} $$ As mentioned before, l and m and their element number superscripts are the director cosines of the inclined local axis (x_tilda) from local node 1 to local node 2 with respect to the global (x,y) coordinate system. However, more importantly is that this element stiffness matrix representation shows that the matrix is symmetrical about the diagonal ($$k^{(1e)}_{ij}=k^{(1e)}_{ji}$$). This also means that its transpose is equal to itself. This characteristic of the stiffness matrix allows for you to check your work upon calculation. If the matrix does not turn out to be symmetrical, there may be an error in your calculations. Now it is necessary to calculate the values of the stiffness matrix. Let us examine the element stiffness matrix of element one. Recall that element one has an elastic modulus (E) of 3, length (L) of 4, a cross sectional area (A) of 1, and an inclination angle (theta) of 30 degrees. A picture of element one is below in the collapsible box to better recall the characteristics.

Element One
<ul><ul> $$l^{(1)}=cos(\theta^{(1)})=cos(30), m^{(1)}=sin(\theta^{(1)})=sin(30), k^{(1)}=\frac{E^{(1)}A^{(1)}}{L^{(1)}}$$

$$k^{(1)}_{11}=k^{(1)}(l^{(1)})^2=\frac{3}{4}(\frac{\sqrt{3}}{2})^2=\frac{9}{16} $$

$$k^{(1)}_{12}=k^{(1)}l^{(1)}m^{(1)}=\frac{3}{4}(\frac{3}{2})\frac{1}{2}=\frac{3\sqrt{3}}{17}$$ $$k^{(1)}_{42}=-k^{(1)}(m^{(1)})^2=\frac{3}{4}(\frac{1}{2})^2=\frac{-3}{16}$$</ul></ul> One can observe that only three values of the matrix need to be calculate because all of the values in the matrix have one of these three values' magnitudes. Noticing this can save an ample amount of computation time. Similarly, element stiffness matrix of element two can be calculated. Recalling the properties of element two, it has an elastic modulus (E) of 5, length (L) of 2, a cross sectional area (A) of 2, and an inclination angle (theta) of -45 degrees. A picture of element two is below in the collapsible box to better recall the characteristics. These images are not drawn to scale.

Element Two
<ul><ul> $$l^{(2)}=cos(\theta^{(2)})=cos(-45), m^{(2)}=sin(\theta^{(2)})=sin(-45), k^{(2)}=\frac{E^{(2)}A^{(2)}}{L^{(2)}}$$ $$k^{(2)}_{11}=k^{(2)}(l^{(2)})^2=(5)\frac{2}{4}=\frac{5}{2} $$</ul></ul> Now, one can observe for this element stiffness matrix that the absolute values of all coefficients $$k^{(2)}_{ij}$$ are the same. Therefore, you can compute one coefficient to fill in the entire matrix. This is due to the director cosines of this element being equal with an inclination angle of -45 degrees. These element stiffness matrices all only have four displacement degrees of freedom thus they are represented by a four by four matrix. However, the global stiffness matrix has a total of six displacement degrees of freedom.

The Global Force Displacement Equation (8-1 to 8-2)
br> In compact notation, the Global Force Displacement Equation is $$\left[K_{ij} \right]_{6x6} \left\{d_{j} \right\}_{6x1}=\left\{F_{i} \right\}_{6x1}$$ Here the $$\mathbf{K}$$ matrix is generally n by n. Note that a capital K is a global stiffness matrix and a lowercase k is a element stiffness matrix. $$\sum_{j=1}^{6}{k_{ij}d_{j}}=F_{i} $$ where i = 1,...,6

The Global Stiffness Matrix is $$\mathbf{K}_{nxn} = \left[k_{ij} \right]_{nxn}$$ The Global Displacement Matrix is $$\mathbf{d}_{nxn}=\left\{d_{j} \right\}_{nxn}$$

Recall the Element Force Displacement rel. from P. 7-5 $$\mathbf{k}_{4x4}^{e}\mathbf{d}_{4x1}^{e}=\mathbf{f}_{4x1}^{e}$$ How would one go from element matrices (stiffness, displacement and force) to global matrices? The answer is through an assembly process: $$\bullet$$ Identify the correspondence between elements displacement dofs and global displacement dofs.

Assembling the Global FD Equation (8-3 to 8-4)
Continued from P (7-5), in Compact notation

$$ [k_{ij}] $${ $$d_{j}$$ } = { $$f_{ij} $$ }

where k is a 6x6 matrix

More generally nxn

kijdj=fij    i=1,……,6

knxn=[kij]

nxn=global stiffness matrix

d={dj}

nx1=global displacement matrix

F=global force matrix

d5=d3(2) { node (3)

d6=d4(2)

Conceptual step of the assembly:

(Topology of K)



The Global Stiffness Matrix (9-1 to 9-2)
Going from the elemental stiffness matrices to the global stiffness matrix, the correspondence between displacement degrees of freedom, globally and locally, must be identified. Due to the sharing of nodes of different elements, some local displacement degrees of freedom will equal each other because the deflection of the local nodes are constrained by the fact that these local nodes share a same global node. Upon, identifying these similarities and relationships, the assembly of the global stiffness matrix can be written in terms of elemental stiffness values. This is the topology of $$\displaystyle K$$. First, it is necessary to just recall the element stiffness matrices. <p style="text-align:center;">$$\displaystyle k^{(1)}_{matrix} $$ = $$\begin{bmatrix} k_{11}^{(1)} & k_{12}^{(1)} &k_{13}^{(1)} &k_{14}^{(1)} \\ k_{21}^{(1)} & k_{22}^{(1)} &k_{23}^{(1)} &k_{24}^{(1)} \\ k_{31}^{(1)} & k_{32}^{(1)} &k_{33}^{(1)} &k_{34}^{(1)} \\ k_{41}^{(1)} & k_{42}^{(1)} &k_{43}^{(1)} &k_{44}^{(1)} \\ \end{bmatrix} $$  , $$\displaystyle k^{(2)}_{matrix} $$ = $$\begin{bmatrix} k_{11}^{(2)} & k_{12}^{(2)} &k_{13}^{(2)} &k_{14}^{(2)} \\ k_{21}^{(2)} & k_{22}^{(2)} &k_{23}^{(2)} &k_{24}^{(2)} \\ k_{31}^{(2)} & k_{32}^{(2)} &k_{33}^{(2)} &k_{34}^{(2)} \\ k_{41}^{(2)} & k_{42}^{(2)} &k_{43}^{(2)} &k_{44}^{(2)} \\

\end{bmatrix} $$ Also, it is necessary to recall the relationships between the local displacement degrees of freedom and the global displacement degrees of freedom: <p style="text-align:center;">$$\displaystyle d_1^{(1)}=d_1, d_2^{(1)}=d_2, d_3^{(1)}=d_3=d_1^{(2)}, d_4^{(1)}=d_4=d_2^{(2)}, d_5^{(2)}=d_5, d_4^{(2)}=d_6$$ $$\displaystyle d_{global} $$ = $$\begin{bmatrix} d_{1} \\ d_{2} \\ d_{3} \\ d_{4} \\ d_5 \\ d_6\\ \end{bmatrix}$$  , $$\displaystyle d^{(1)} $$ = $$\begin{bmatrix} d_{1}^{(1)} \\ d_{2}^{(1)} \\ d_{3}^{(1)} \\ d_{4}^{(1)} \\ \end{bmatrix}$$  , $$\displaystyle d^{(2)} $$ = $$\begin{bmatrix} d_{1}^{(2)} \\ d_{2}^{(2)} \\ d_{3}^{(2)} \\ d_{4}^{(2)} \\ \end{bmatrix}$$

<p style="text-align:center;"> Now, it is possible to construct the global stiffness matrix: <p style="text-align:center;">$$\displaystyle K_{global} $$ = $$\begin{bmatrix} k_{11}^{(1)} & k_{12}^{(1)} & k_{13}^{(1)} & k_{14}^{(1)} & 0  & 0  \\ k_{21}^{(1)} & k_{22}^{(1)} & k_{23}^{(1)} & k_{24}^{(1)} & 0  & 0  \\ k_{31}^{(1)} & k_{32}^{(1)}  & a  & b & k_{13}^{(2)} & k_{14}^{(2)} \\ k_{41}^{(1)} & k_{42}^{(1)}  & c  & d  & k_{23}^{(2)} & k_{24}^{(2)} \\ 0 & 0 & k_{31}^{(2)} & k_{32}^{(2)} & k_{33}^{(2)} & k_{34}^{(2)}  \\ 0 & 0 & k_{41}^{(2)} & k_{42}^{(2)} & k_{43}^{(2)} & k_{44}^{(2)}  \\ \end{bmatrix} $$ = $$\begin{bmatrix} K_{11} & K_{12} & K_{13} & K_{14} & K_{15}  & K_{16}  \\ K_{21} & K_{22} & K_{23} & K_{24} & K_{25}  & K_{26}  \\ K_{31} & K_{32} & K_{33} & K_{34} & K_{35}  & K_{36}  \\ K_{41} & K_{42} & K_{43} & K_{44} & K_{45}  & K_{46}  \\ K_{51} & K_{52} & K_{53} & K_{54} & K_{55}  & K_{56}  \\ K_{61} & K_{62} & K_{63} & K_{64} & K_{65}  & K_{66}  \\ \end{bmatrix} $$

where $$ a=k_{33}^{(1)}+k_{11}^{(2)}, b=k_{34}^{(1)}+k_{12}^{(2)}, c=k_{43}^{(1)}+k_{21}^{(2)}, d=k_{44}^{(1)}+k_{22}^{(2)}$$ and $$K_{11}= k_{11}^{(1)}, K_{12}=k_{12}^{(1)}...K_{33}=a=k_{33}^{(1)}+k_{11}^{(2)},K_{34}=b=k_{34}^{(1)}+k_{12}^{(2)}...$$ The numeric values of the global stiffness matrix are as follows:

$$K_{11}=\frac{9}{16},K_{12}=\frac{3\sqrt{3}}{16},K_{33}=\frac{9}{16}+\frac{5}{2},K_{34}=\frac{3\sqrt{3}}{16}-\frac{5}{2}, K_{44}=\frac{3}{16}+\frac{5}{2}$$

Applying the boundary conditions where the global nodes one and three are fixed due to the pinned joints ($$d_1=d_2=d_5=d_6=0$$). Thus, elimination of known displacement degrees of freedom it is possible to reduce the global force displacement relationship leaving $$d_3 and d_4$$ to be unknown. Removing $$d_1, d_2, d_5$$ and $$d_6$$ is like replacing columns 1,2,5,6 with zeros because of matrix algebra.

Solving for the Displacements (10-1 to 10-3)
Previously, the global matrices were found to be

$$\mathbf{K}_{6x6} \; \begin{Bmatrix} d_{1}=0\\ d_{2}=0\\ d_{3}\\ d_{4}\\ d_{5}=0\\ d_{6}=0\\ \end{Bmatrix}_{6x6} = \begin{bmatrix} 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{bmatrix}_{6x6}

\begin{Bmatrix} d_{3}\\ d_{4}\\ \end{Bmatrix}_{2x1} =\mathbf{F}_{6x1} $$

More rows in the K matrix can be removed by using the principle of virtual work. Also, incorporating the fixed boundary conditions leds to the deletion of the corresponding columns in the global stiffness matrix K. By principle of virtual work (PVW) the corresponding rows are also deleted, here rows 1, 2, 5, and 6. The corresponding rows in F are deleted as well.

The resulting Force Displacement relationship becomes

$$ \begin{bmatrix} K_{3x3} &K_{3x4} \\ K_{4x3} &K_{4x4} \end{bmatrix}_{2x2} \begin{Bmatrix} d_{3}\\ d_{4} \end{Bmatrix}_{2x1} = \begin{Bmatrix} F_{3}\\ F_{4} \end{Bmatrix}_{2x1} $$

which can alternately be written

$$ \mathbf{\bar{K}}_{2x2} \mathbf{\bar{d}}_{2x1} = \mathbf{\bar{F}}_{2x1} $$

$$ \mathbf{\bar{F}}= \begin{Bmatrix} F_{3}\\ F_{4} \end{Bmatrix} = \begin{Bmatrix} 0\\ P \end{Bmatrix} $$ where F3 is known to be 0 and P is 7.

Recall that for $$\mathbf{\bar{K}}_{2x2}$$ above, the determinate is

$$det\; \mathbf{\bar{K}}=k_{33}k_{44}-k_{34}k_{43}$$

and also that the inverse of $$\mathbf{\bar{K}}_{2x2}$$ is

$$ \mathbf{k^{-1}}=\frac{1}{det \; \mathbf{k}} \begin{bmatrix} k_{44} &-k_{34} \\ -k_{43} & k_{33} \end{bmatrix} $$

Verifying the above two properties

$$ \mathbf{\bar{K}}\; \mathbf{\bar{K}}^{-1} =\mathbf{\bar{K}}^{-1}\; \mathbf{\bar{K}} = \mathbf{I}=\begin{bmatrix} 1 &0 \\ 0 &1 \end{bmatrix} = \frac{1}{det \boldsymbol{\bar{k}}} \begin{bmatrix} det \boldsymbol{\bar{k}} &0 \\ 0 & det \boldsymbol{\bar{k}} \end{bmatrix} $$

For finite element method, $$ k_{43} = k_{34}$$?

Note: $$ \mathbf{\bar{k}}^{T}=\begin{bmatrix} k_{33} &k_{43} \\ k_{34} & k_{44} \end{bmatrix} $$

$$ \mathbf{\bar{k}}^{-1}\neq \frac{1}{det\mathbf{\bar{k}}}\mathbf{\bar{k}}^{T} $$ Row echelon method

Back to 2D bar truss system:

$$ \begin{Bmatrix} d_{3}\\ d_{4} \end{Bmatrix} = \mathbf{\bar{k}}^{-1} \begin{Bmatrix} 0\\ \mathbf{P} \end{Bmatrix} = \begin{Bmatrix} d_{3}\\ d_{4} \end{Bmatrix} = \mathbf{\bar{k}}^{-1} \begin{Bmatrix} 4.352\\ 6.1271 \end{Bmatrix} $$

which is the displacement of node 2.

Computing the Reactions (10-4 to 10-5)
- 2 methods:

5.1) use element FD relationships.

<p style="text-align:center;">$$ \ k^{(e)}*d^{(e)} = f^{(e)}, e = 1, 2 $$

 Element 1 (e=1): 

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

k is known d is known f is unknown

$$d^{(1)} = \begin{Bmatrix} 0 \\ 0 \\ 4.352 \\ 6.1271 \end{Bmatrix}$$

 Element 2 (e=2): 

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

k is known d is known f is unknown

$$d^{(1)} = \begin{Bmatrix} 4.352 \\ 6.1271 \\ 0 \\ 0 \end{Bmatrix}$$

Finding the remaining Unknowns (11-1 to 11-3)
Element 1

K(1)*d(1)=f(1)

$$\begin{bmatrix} k & -k \\ -k & k \\ \end{bmatrix} $$ $$\begin{bmatrix} d_1 \\ d_2 \\ \end{bmatrix} $$ = $$\begin{bmatrix} F_1 \\ F_2 \\ \end{bmatrix} $$

$$\begin{bmatrix} 0.5625 & 0.32476 & .... & ....\\ .... & .... & .... & ....\\ .... & ....& .... & ....\\ .... & ....& .... & ....\\ \end{bmatrix} $$ = $$\begin{bmatrix} 0\\ 0\\ 4.52\\ 6.1271\\ \end{bmatrix} $$

4x4 matrix multiplied by a 1x4 matrix

Since the top two numbers for d(1) are zero it means you can reduce the 4x4 matrix into a 2x2 matrix.

=$$\begin{bmatrix}

0.5625 & 0.3247\\ .... & ....\\

\end{bmatrix} $$ $$\begin{bmatrix} 4.52\\ 6.1271\\ \end{bmatrix} $$ =$$\begin{bmatrix} -4.4378\\ -2.5622\\ 4.4378\\ 2.5622\\ \end{bmatrix} $$ Obs Element 1 is inequal

ΣFx=F1(1) + F3(1)= 0

ΣFy=F3(1) + F4(1)= 0





P1(1) = [(F1(2))2+ (F2(1)2]1/2

Method 2: Solve for 2 Bar Truss using Statics Method

Statics Method



Other Method



Equlibrium of the Nodes (11-4)
To bring the force P back into the problem, the truss is analyzed using the Euler Cut Principle. To accomplish this, The equilibrium of global node 2 will be analyzed.

MATLAB
The following MATLAB code was provided to show how computer programs can be used to solve the truss problem using the finite element method:

% Two bar truss example clear all; e = [3 5]; A = [1 2]; P = 7; L=[4 2]; alpha = pi/3; beta = pi/4; nodes = [0, 0; L(1)*cos(pi/2-alpha), L(1)*sin(pi/2-alpha); L(1)*cos(pi/2-alpha)+L(2)*sin(beta),L(1)*sin(pi/2-alpha)-L(2)*cos(beta)]; dof=2*length(nodes); conn=[1,2; 2,3]; lmm = [1, 2, 3, 4; 3, 4, 5, 6]; elems=size(lmm,1); K=zeros(dof); R = zeros(dof,1); debc = [1, 2, 5, 6]; 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

Running the above code as a MATLAB Mfile results in the following output:

$$ k_{local} = \begin{bmatrix}

0.75   &    -0.75 \\        -0.75     &    0.75 \\ \end{bmatrix}$$

$$ k = \begin{bmatrix}

0.5625 &    0.32476  &    -0.5625 &    -0.32476 \\      0.32476  &     0.1875   &  -0.32476  &   -0.1875 \\      -0.5625   &  -0.32476    &   0.5625   &   0.32476 \\     -0.32476    &  -0.1875     & 0.32476    &   0.1875 \\ \end{bmatrix}$$

$$ k_{local} = \begin{bmatrix}

5 &  -5 \\    -5   &  5 \\ \end{bmatrix}$$

$$ k = \begin{bmatrix}

2.5 &       -2.5 &        -2.5  &        2.5 \\         -2.5  &        2.5  &        2.5   &      -2.5 \\         -2.5   &       2.5   &       2.5    &     -2.5 \\          2.5    &     -2.5    &     -2.5     &     2.5 \\ \end{bmatrix}$$

$$ K = \begin{bmatrix}

0.5625  &   0.32476 &     -0.5625 &    -0.32476 &           0  &          0 \\      0.32476    &   0.1875  &   -0.32476  &    -0.1875  &          0   &         0 \\      -0.5625     & -0.32476  &     3.0625  &    -2.1752  &       -2.5   &       2.5 \\     -0.32476  &    -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}$$

$$ R = \begin{bmatrix}

0\\    0\\     0\\     7\\     0\\     0\\ \end{bmatrix}$$

$$ d = \begin{bmatrix}

0 \\           0 \\        4.352 \\       6.1271  \\            0  \\            0 \\ \end{bmatrix}$$

$$ reactions = \begin{bmatrix}

-4.4378 \\     -2.5622 \\       4.4378 \\      -4.4378 \\ \end{bmatrix}$$

$$ results = \begin{bmatrix}

1.7081   &   5.1244  &     8.5406   &    5.1244   &    17.081  \\       0.6276  &     1.8828  &      3.138    &   1.8828  &      6.276  \\ \end{bmatrix}$$

NOTE
The provided MATLAB code used two functions, PlaneTrussElement and NodalSoln, as part of the code to solve the truss problem. However, niether of those functions were defined in the code provided. As a result, MATLAB is not able to run the code as is. The results given are the results that would have been generated if the code was complete.

Contributing Group Members
Cory Foskey Eml4500.f08.team.foskey.ckf 21:01, 25 September 2008 (UTC)

Joseph Figuerrez Eml4500.f08.team.figuerrez 21:01, 25 September 2008 (UTC)

Timothy Bengtson Eml4500.f08.team.Bengtson 02:05, 26 September 2008 (UTC)

James Dwyer Eml4500.f08.team.dwyer.jd 15:23, 26 September 2008 (UTC)

Owen Allen Eml4500.f08.team.allen.oca 17:09, 26 September 2008 (UTC)

Jin Yu Guan Eml4500.f08.team.guan 18:02, 26 September 2008 (UTC)