# University of Florida/Eml4507/Fead-s13-team4-R2
## Problem R2.1 Model 2-D Truss With 2 Inclined Elements and Verify Assembly
### Given 2-D Truss Model and Constants

Consider the 2D truss system
Use the following constants to very calculations
$l^{(1)}=4$
$l^{(2)}=2$
$E^{(1)}=3$
$E^{(2)}=5$
$A^{(1)}=1$
$A^{(2)}=2$
$\emptyset ^{(1)}=30^{\circ }$
$\emptyset ^{(2)}=135^{\circ }$
$P=7$

### Solution: Assembly Process for 2d Truss System
#### Construct local stiffness matrices

The stiffness matrices will be constructed for individual elements 1 and 2. The rows and columns will be numbered to represent the force and degree of freedom. For element 1
${\vec {K^{(1)}}}={\begin{bmatrix}&1&2&3&4\\1&(l^{(1)})^{2}&l^{(1)}m^{(1)}&-(l^{(1)})^{2}&-l^{(1)}m^{(1)}\\2&l^{(1)}m^{(1)}&(m^{(1)})^{2}&-l^{(1)}m^{(1)}&-(m^{(1)})^{2}\\3&-(l^{(1)})^{2}&-l^{(1)}m^{(1)}&(l^{(1)})^{2}&l^{(1)}m^{(1)}\\4&-l^{(1)}m^{(1)}&-(m^{(1)})^{2}&l^{(1)}m^{(1)}&(m^{(1)})^{2}\\\end{bmatrix}}*K^{(1)}$
For element 2
${\vec {K^{(2)}}}={\begin{bmatrix}&3&4&5&6\\3&(l^{(2)})^{2}&l^{(2)}m^{(2)}&-(l^{(2)})^{2}&-l^{(2)}m^{(2)}\\4&l^{(2)}m^{(2)}&(m^{(2)})^{2}&-l^{(2)}m^{(2)}&-(m^{(2)})^{2}\\5&-(l^{(2)})^{2}&-l^{(2)}m^{(2)}&(l^{(2)})^{2}&l^{(2)}m^{(2)}\\6&-l^{(2)}m^{(2)}&-(m^{(2)})^{2}&l^{(2)}m^{(2)}&(m^{(2)})^{2}\\\end{bmatrix}}*K^{(2)}$
The variable K can be determined by
$K^{(e)}={\frac {EA}{L}}$
If the variables are plugged in, we get the following matrices:
For element 1
${\vec {K^{(1)}}}={\begin{bmatrix}&1&2&3&4\\1&0.5625&0.3248&-0.5625&-0.3248\\2&0.3248&0.1875&-0.3248&-0.1875\\3&-0.5625&-0.3248&0.5625&0.3248\\4&-0.3248&-0.1875&0.3248&0.1875\\\end{bmatrix}}$
For element 2
${\vec {K^{(2)}}}={\begin{bmatrix}&3&4&5&6\\3&2.5&-2.5&-2.5&2.5\\4&-2.5&2.5&2.5&-2.5\\5&-2.5&2.5&2.5&-2.5\\6&2.5&-2.5&-2.5&2.5\\\end{bmatrix}}$
It is clear that if we wish to combine the matrices, it will place coordinate 3,3 of element 2 on the location of 3,3 of element 1 due to them referencing the same point in the same direction. When combining the matrices, addition will be used since the matrices represent directional forces and forces always combine in the same direction by addition.

#### Combining local stiffness matrices into a global matrix

The local matrices from element 1 and 2 will be combined as described above to give
${\vec {K}}={\begin{bmatrix}&1&2&3&4&5&6\\1&0.5625&0.3248&-0.5625&-0.3248&0&0\\2&0.3248&0.1875&-0.3248&-0.1875&0&0\\3&-0.5625&-0.3248&3.0625&-2.1752&-2.5&2.5\\4&-0.3248&-0.1875&-2.1752&2.6875&2.5&-2.5\\5&0&0&-2.5&2.5&2.5&-2.5\\6&0&0&2.5&-2.5&-2.5&2.5\\\end{bmatrix}}$

### Solution: Verify With CALFEM
#### MatLab Code

EDU>> Edof = [1 1 2 3 4
2 3 4 5 6];
EDU>> K = zeros(6);
EDU>> f = zeros(6,1);
EDU>> f(4) = -7;
EDU>> E1 = 3; E2 = 5;
EDU>> L1 = 4;L2 = 2;
EDU>> A1 = 1;A2 = 2;
EDU>> ep1 = [E1 A1]
ep1 =
EDU>> ep2 = [E2 A2]
ep2 =
EDU>> ex1 = [-3.464 0]; ex2 = [0 1.414];
EDU>> ey1 = [-2 0]; ey2 = [0 -1.414];
EDU>> Ke1 = bar2e(ex1,ey1,ep1)
Ke1 =
EDU>> Ke2 = bar2e(ex2,ey2,ep2)
Ke2 =
EDU>> K = assem(Edof(1,:),K,Ke1);
EDU>> K = assem(Edof(2,:),K,Ke2)
K =
EDU>> bc = [1 0;2 0;5 0;6 0];
EDU>> [a,r]=solveq(K,f,bc)
a =
r =

### Conclusion

By comparing the value from the hand calculation and the value from the CALFEM program, we can see that the two matrices are identical. This verifies the assembly process of using addition when combining local matrices by addition.

## Problem R2.2
### Disccription:

We are asked to consider the L2-ODE-CC system referenced in (1) p.53-2 to have the following complex conjugate roots:
$\lambda _{1,2}=-0.5\pm 2i$
We are asked to find the homogeneous solution in standard form and to find the damping ratio, $\zeta$
We are then to consider the initial conditions
$y(0)=1,y'(0)=0$
We are to plot this solution and then use that plot to find the log decrement and compare it to the log decrement that would be obtained using (6) p.53-5b.
Finally, we're to find the quality factor, Q, and the loss factor, $\eta$

### Solution:

From R1.5, we have already obtained that for the above conditions,
$y(t)=e^{-0.5t}cos(2t)+({\frac {1}{4}})e^{-0.5t}sin(2t)$
with coefficients to the characteristic equation of
$a=1$ and $b={\frac {17}{4}}$
From (1) and (2) p.53-5, we have that
$\omega ^{2}=b$
$2\omega \zeta =a$
Knowing both a and b we get
$\omega ={\sqrt {\frac {17}{4}}}=2.0615$
$\zeta ={\frac {1}{2\omega }}={\frac {1}{2*2.0615}}=0.2425$
We then have from equation (1) p.53-5d
$\delta ={\frac {1}{3}}[\delta ^{(1)}+\delta ^{(2)}+\delta ^{(3)}]$
Using the above graph of the homogeneous solution, accurate estimates were able to be made as to the various values of y at the peaks
Using equation (3) p.53-5c we are able to find
$\delta ^{(1)}=log(1/0.2075)=0.68235$ $\delta ^{(2)}=log(0.2075/0.0432)=0.68216$ $\delta ^{(3)}=log(0.0432/0.009)=0.68124$

### Conclusion

We then arrive at
$\delta ={\frac {1}{3}}[0.68235+0.68216+0.68124]=0.68192$
For comparison, the equation (6) p.53-5b gives
$\delta ={\frac {2\pi \zeta }{\sqrt {1-\zeta ^{2}}}}={\frac {2\pi 0.2425}{\sqrt {1-0.2425^{2}}}}=1.5705$
We now find the quality factor, Q. From (2) p.53-5d, we have
$Q={\frac {\delta }{\pi }}={\frac {\sqrt {1-\zeta ^{2}}}{2\zeta }}={\frac {\sqrt {1-0.2425^{2}}}{2*0.2425}}=2$
From (5) p.53-5d, we know that the loss factor is just the inverse of the quality factor so
$\eta ={\frac {1}{Q}}={\frac {1}{2}}=0.5$

## Problem R2.3
### Problem Statement

KS 2008 p.103 sec.2.7 pb.21 write a matlab program to assemble the global stiffness matrix, compute the unknown disp dofs, the reaction forces, the member forces; compare the results with exact hand calculation Statics, Mechanics of Materials).
run CALFEM to verify the results, but now do this problem in a different way (as in commercial FE codes).
first, establish 2 arrays: (1) the global node coordinate array “coord”, and (2) the elem connectivity array “conn”. next, write a matlab code to loop over the number of element to call the function “bar2e” of CALFEM to compute the element stiffness matrices. with this method, you let your matlab code construct the arrays ex1, ey1, ex2, ey2, etc. for you, using the info from the arrays “coord” and “conn”.

### Solution
##### MATLAB Code

The following is a MATLAB code that assembles the global stiffness matrix, computes the unknown displacement dofs, reaction forces, and member forces
With this, the output is as follows:
It can be seen here that the problem done by hand corresponds to the force output of the MATLAB program.

##### CALFEM MATLAB

The output to the CALFEM code is as follows:
The results of all methods verifies their accuracy.

## Problem R2.4
### Description:

We are to find an expression for the excitation referenced in (1) p.53-6 and then find the actual solution and the amplification factor, A for the following conditions:
$f_{0}/m=r_{0}=1$ ${\bar {w}}=0.9w$
We are then to find the complete solution.

### Solution:

$y''+y'+({\frac {17}{4}})y={\frac {f_{0}}{m}}cos({\bar {w}}t)$
Let us guess the solution is:
$y_{p}(t)=Asin({\bar {w}}t)+Bcos({\bar {w}}t)$
then
$y_{p}(t)=Asin({\bar {w}}t)+Bcos({\bar {w}}t)$ $y'_{p}(t)=A{\bar {w}}cos({\bar {w}}t)-B{\bar {w}}sin({\bar {w}}t)$ $y''_{p}(t)=-A{\bar {w}}^{2}cos({\bar {w}}t)-B{\bar {w}}^{2}sin({\bar {w}}t)$
We then write
$[-A{\bar {w}}^{2}-B{\bar {w}}+({\frac {17}{4}})A]sin({\bar {w}}t)+[-B{\bar {w}}^{2}+A{\bar {w}}+({\frac {17}{4}})B]cos({\bar {w}}t)={\frac {f_{0}}{m}}cos({\bar {w}}t)$
It follows that
$[-A{\bar {w}}^{2}-B{\bar {w}}+({\frac {17}{4}})A]=0$ and that $[-B{\bar {w}}^{2}+A{\bar {w}}+({\frac {17}{4}})B]={\frac {f_{0}}{m}}$
We solve for A and B to be
$A={\frac {f_{0}/m}{[{\bar {w}}+({\frac {17}{4}})^{2}({\frac {1}{\bar {w}}})-{\frac {34{\bar {w}}}{4}}+{\bar {w}}^{3}]}}$ $B={\frac {{\frac {f_{0}}{m}}[{\frac {17}{4}}-{\bar {w}}^{2}]}{[[{\bar {w}}+({\frac {17}{4}})^{2}({\frac {1}{\bar {w}}})-{\frac {34{\bar {w}}}{4}}+{\bar {w}}^{3}]({\bar {w}})]}}$
Once given the conditions
$f_{0}/m=r_{0}=1$ ${\bar {w}}=0.9w$
we can find
${\bar {w}}=0.9w={\bar {w}}=0.9*2.0615=1.855$
Plugging these values in yields
$A=0.4528$ $B=0.1975$
The particular solution is then
$y_{p}(t)=0.4528sin(1.855t)+0.1975cos(1.855t)$
Equations (3) p. 53-8 and (2) p. 53-8 give us
$\rho ={\frac {\bar {w}}{w}}={\frac {1.855}{2.0615}}=0.9$ $A={\frac {1}{[(1-\rho ^{2})^{2}+(2\zeta \rho )^{2}]^{\frac {1}{2}}}}={\frac {1}{[(1-0.9^{2})^{2}+(2*0.2425*0.9)^{2}]^{\frac {1}{2}}}}=2.628$
The following is the graph of the homogeneous solution:
The following is the graph of the particular solution:
The following is the graph of the total solution, $y(t)=y_{h}(t)+y_{p}(t)$:
A graph of all three plots is produced below:

## Problem R2.5 CALFEM 3.4 Manual exs1 on a Spring System and Verification
### Given a Linearly Elastic Spring System

Consider a system of 3 linearly elastic springs
Use the following diagram for the node locations

### Solution: Results of CALFEM
#### Construct the topology matrix

This matrix contains the node numbers and degrees of freedom.
${\begin{bmatrix}1&1&2\\2&2&3\\3&2&3\end{bmatrix}}$

#### Construct the global stiffness matrix and load vector f

$\mathbf {K} ={\begin{bmatrix}0&0&0\\0&0&0\\0&0&0\end{bmatrix}}$
The load vector is in position 2 with F=100
$\mathbf {f} ={\begin{bmatrix}0\\100\\0\end{bmatrix}}$

#### Generating the element stiffness matrices

The element stiffness matrices are generated using the CALFEM function spring1e. The matrices are generated using k and 2k where k=1500
$\mathbf {Ke1} ={\begin{bmatrix}1500&-1500\\-1500&1500\end{bmatrix}}$
$\mathbf {Ke2} ={\begin{bmatrix}3000&-3000\\-3000&3000\end{bmatrix}}$

#### Assembling the element stiffness matrices into the global stiffness matrix

The assembly is done using the assem fucntion from CALFEM.
Assembling the second element at the first row:
$\mathbf {K} ={\begin{bmatrix}3000&-3000&0\\-3000&3000&0\\0&0&0\end{bmatrix}}$
Assembling the first element at the second row:
$\mathbf {K} ={\begin{bmatrix}3000&-3000&0\\-3000&4500&-1500\\0&-1500&1500\end{bmatrix}}$
Assembling the second element at the third row:
$\mathbf {K} ={\begin{bmatrix}3000&-3000&0\\-3000&7500&-4500\\0&-4500&4500\end{bmatrix}}$

#### Solve the system of equations using boundary conditions

The CALFEM fucntion solveq is used to solve the system of equations subject to certain boundary conditions.
$\mathbf {bc} ={\begin{bmatrix}1&0\\3&0\end{bmatrix}}$
$\mathbf {a} ={\begin{bmatrix}0\\0.0133\\0\end{bmatrix}}$
$\mathbf {a} ={\begin{bmatrix}-40\\0\\-60\end{bmatrix}}$

#### Evaluate the element forces from the element displacements

$\mathbf {ed1} ={\begin{bmatrix}0&0.0133\end{bmatrix}}$
$\mathbf {ed2} ={\begin{bmatrix}0.0133&0\end{bmatrix}}$
$\mathbf {ed3} ={\begin{bmatrix}0.0133&0\end{bmatrix}}$

#### Evaluate the spring forces from function spring1s

$\mathbf {es1} ={\begin{bmatrix}40\end{bmatrix}}$
$\mathbf {es2} ={\begin{bmatrix}-20\end{bmatrix}}$
$\mathbf {es3} ={\begin{bmatrix}-40\end{bmatrix}}$

### Solution: Results of verification

This section verifies the CALFEM code by manual calculations

#### Nodal equilibrium equations

$f_{1}^{(1)}=F_{1}=R_{1}$
$f_{2}^{(1)}+f_{2}^{(2)}+f_{2}^{(3)}=F=100$
$f_{3}^{(2)}+f_{3}^{(3)}=F_{2}=R_{2}$

#### Setting up the equation to solve

${\begin{bmatrix}K_{s}\end{bmatrix}}{\begin{Bmatrix}Q_{s}\end{Bmatrix}}={\begin{Bmatrix}F_{s}\end{Bmatrix}}$
$1000{\begin{bmatrix}3&-3&-2&0\\-3&7.5&-4.5\\0&-4.5&4.5\end{bmatrix}}{\begin{Bmatrix}u_{1}\\u_{2}\\u_{3}\end{Bmatrix}}={\begin{Bmatrix}R_{1}\\100\\R_{2}\end{Bmatrix}}$

#### Implementing the boundary conditions

$1000{\begin{bmatrix}7.5\end{bmatrix}}{\begin{Bmatrix}u_{2}\end{Bmatrix}}={\begin{Bmatrix}100\end{Bmatrix}}$

#### Inverting the global stiffness matrix to find displacements

$u_{2}=0.01333$
Displacements 1 and 3 are zero due to boundary conditions.

#### Calculate forces in springs from equation

The forces in the springs are found by the following equations. Negative forces display compressions and positive tensions.
$P=k(u_{j}-u_{i})$
$P^{(1)}=3000(0.01333-0)=40$
$P^{(2)}=1500(0-0.01333)=-20$
$P^{(3)}=3000(0-0.01333)=-40$

#### Discuss if the solution is verified

The solution by CALFEM is verified since both the displacements and the forces are the same by both methods.

## Problem R2.6
### Problem Statement

Find the displacements of the nodes as well as the forces in the springs(tension/compression). Also determine the reaction forces at the walls.

### Nodal Equilibrium Equations

Using Matlab Solutions Displacements
These are the displacements at $u_{2}$, $u_{3}$, and $u_{4}$ respectively. The negative sign shows that the nodes are moving in the direction of the applied force which is against the convention of positive displacement left to right.
Now it is possible to find the forces in the spring. Negative forces denote compression and positive forces denote tension.

### Forces in Springs

Now,

### Verification with Calfem

a values are the nodal displacements 1 through 5. r values are the reaction forces at the walls. es1-es6 are the forces in the springs. Negative values denote compression and positive values denote tension. These answers match those previously calculated.
--EML4507.s13.team4ever.Wulterkens (discuss • contribs) 07:21, 6 February 2013 (UTC)