User:Eml4500.f08.ramrod.D/HW2

Lecture Notes 9/15/2008
$$\mathbf{K}= \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}$$

The appropriate numbers will be inputted into matrix K which is a 6x6 matrix.

$$\mathbf{K}= \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)} & (k_{33}^{(1)}+k_{11}^{(2)}) & (k_{34}^{(1)}+k_{12}^{(2)}) & k_{13}^{(2)} & k_{14}^{(2)}\\k_{41}^{(1)} & k_{42}^{(1)} & (k_{43}^{(1)}+k_{21}^{(2)}) & (k_{44}^{(1)}+k_{22}^{(2)}) & 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}$$

$$k_{11}^{(1)}=\frac{9}{16}=0.5625$$

$$k_{12}^{(1)}=\frac{3\sqrt{3}}{16}=0.3248$$

$$k_{13}^{(1)}=-k_{11}^{(1)}=-0.5625$$

$$k_{14}^{(1)}=-k_{12}^{(1)}=-0.3248$$

$$k_{22}^{(1)}=\frac{3}{16}=0.1875$$

$$k_{24}^{(1)}=-k_{22}^{(1)}=-0.1875$$

$$k_{13}^{(2)}=-k_{11}^{(2)}=\frac{-5}{2}=-2.5$$

$$k_{14}^{(2)}=-k_{12}^{2}=2.5$$

$$k_{24}^{(2)}=\frac{-5}{2}=-2.5$$

$$k_{33}^{(2)}=\frac{5}{2}=2.5$$

$$k_{34}^{(2)}=\frac{-5}{2}=-2.5$$

$$k_{44}^{(2)}=\frac{5}{2}=2.5$$

$$K_{15}^{}=K_{16}=K_{25}=K_{26}=K_{51}=K_{52}=K_{61}=K_{62}=0$$

$$\mathbf{}= \begin{bmatrix} 0.5625 & 0.32475 & -0.5625 & -0.32475 & 0 & 0\\0.32475 & 0.1875 & -0.3247 & -0.1875 & 0 & 0\\-0.5625 & -0.32475 & (0.5625+2.5) & (0.32475-2.5) & -2.5 & 2.5\\-0.32475 & -0.1875 & (0.32475-2.5) & (0.1875+2.5) & 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}$$

$$\mathbf{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}$$

Two Bar Truss System MATLAB Code
This section goes over the finite element MATLAB code for a two bar truss system. All of the resulting matrices are below the code. The MATLAB example code can also be found on Dr. Vu-Quoc's website:

http://clesm.mae.ufl.edu/~vql/courses/fead/2008.fall/codes/twoBarTrussEx.txt

% 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

k_local = 0.75       -0.75        -0.75         0.75

k = 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

k_local = 5   -5    -5     5

k = 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

K = 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

R = 0    0     0     7     0     0

d =

0           0        4.352       6.1271            0            0

reactions = -4.4378     -2.5622       4.4378      -4.4378

results = 1.7081      5.1244       8.5406       5.1244       17.081       0.6276       1.8828        3.138       1.8828        6.276