text:
User:Uf.team.wiki/HW2

Introduction
The first step to solving a 2 truss system is to look at the picture from each element, and use the derived recipe to help solve.

Recall: Use the Derived "Recipe" to Simplify the Problem
Recalling the recipe will help us solve Truss problems with the use of FEA requirements and notation.

Statically Determinate: Problem 1.2 (continued)
The following is an example of a two member truss system which is known to be statically determinate. Given the specified information, and since it is statically determinate, this problem can be setup and solved using simple statics to determine any unknown forces, and moments. Solving this problem will also provide us with further exposure to FEAD notation in problem solving.

Figure 1: Given Two Member Truss System

 * This problem can be solved using the knowledge of two forces members. It simplifies the unknowns so we have the same number of equations and unknowns. This means that we would not have to use the Finite Element Method (FEM). This problem can be solved by simply using a statics method learned previously. The system will generate forces that act along the members themselves which will reduce unknowns.

=Step 1: Global Picture=

Figure 2: Global Forces of Two Member Truss System

 * The global forces are shown here in the global coordinate system. We see both the applied forces and the reactions forces. We see the additional unknowns (reaction forces) added to the system by removing the constraints of the ground connections.

=Step 2: Elemental Picture=  Element 1  Element 1: θ(1)=30°

Figure 3: First Element Forces

 Element 2  θ(1)=-45°
 * The element is broken down and the element forces are displayed. With this we can now determine the magnitudes and direction of the combined forces. We see here that at the pin connection we display the reaction forces created by the separation of the two elements. With the two force member method we can solve the system

Figure 4: Second Element Forces

 * The second element is broken down and the element forces are displayed. With this we can now determine the magnitudes and direction of the combined forces. We see here that at the pin connection we display the reaction forces created by the separation of the two elements. With the two force member method we can solve the system

Problem Setup
The elemental picture includes a stiffness matrix ' k ', a displacement matrix ' d ', and a force matrix ' f '. k (e) X d (e) = f (e)

For this problem there are two elements 1 and 2 (e=1,2).

 * k (e) is considered a 4 X 4 matrix
 * d (e) is considered a 4 X 1 matrix
 * f (e) is considered a 4 X 1 matrix

Figure 5: Direction Cosine Coordinate System Solve for k : $$\underset{}{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} = \underset{--}{k^{(e)}}$$ k(e) = $$\frac{E^e A^e}{L^e }$$:

where,

 * E(e) is the Young's Modulus of each element, e
 * A(e) is the cross-sectional area of element, e
 * L(e) is the length of each element, e

$$k^1 = \frac{3(1)}{4 }=\frac{3}{4}$$, $$k^2 = \frac{5(2)}{2 } = 5$$

l(e)=cos(θe): $$l^1 = \frac{\sqrt{3}}{2}$$, $$l^2 = \frac{1}{\sqrt{2}}$$ m(e)=sin(θe): $$m^1 = \frac{1}{2}$$, $$m^2 = -\frac{1}{\sqrt{2}}$$ Here are the k (1) and k (2) matrices:

k (1) = $$\begin{bmatrix} \frac{9}{16} & \frac{3\sqrt{3}}{16} & -\frac{9}{16} & -\frac{3\sqrt{3}}{16}\\ \frac{3\sqrt{3}}{16} & \frac{3}{16} &-\frac{3\sqrt{3}}{16} & -\frac{3}{16}\\ -\frac{9}{16} & -\frac{3\sqrt{3}}{16} & \frac{9}{16} & \frac{3\sqrt{3}}{16}\\ -\frac{3\sqrt{3}}{16}& -\frac{3}{16} & \frac{3\sqrt{3}}{16} & \frac{3}{16} \end{bmatrix} $$ k (2) = $$\begin{bmatrix} \frac{5}{2}& -\frac{5}{2} &-\frac{5}{2} &\frac{5}{2}\\ -\frac{5}{2}& \frac{5}{2} & \frac{5}{2} &-\frac{5}{2} \\ -\frac{5}{2}& \frac{5}{2} &\frac{5}{2} &-\frac{5}{2}\\ \frac{5}{2}& -\frac{5}{2} & -\frac{5}{2} &\frac{5}{2} \end{bmatrix}$$

= Step 3: Global Force Displacement Relationships = $$\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} \begin{Bmatrix} d_{1}\\ d_{2}\\ d_{3}\\ d_{4}\\ d_{5}\\ d_{6}\\ \end{Bmatrix} = \begin{Bmatrix} F_{1}\\ F_{2}\\ F_{3}\\ F_{4}\\ F_{5}\\ F_{6}\\ \end{Bmatrix} $$

In Compact Notation:

$$ \left[K_\underset{6 \times 6}{ij} \right]\left\{d_\underset{6 \times 1}{j} \right\}=\left\{F_\underset{6 \times 1}{i} \right\} $$

More General Form of nxn Matrix:

$$ \sum_{j=1}^{6}{K_{ij}d_{j}} = F_{i} $$ ,where i = 1,...,6

$$ \mathbf{\underset{n \times n}K}=\left[K_\underset{n \times n}{ij} \right] $$ = Global Stifness Matrix

$$ \mathbf{\underset{n \times 1}d}=\left\{d_\underset{n \times 1}{j} \right\} $$ = Global Displacement Matrix

$$ \mathbf{\underset{n \times 1}F}=\left\{F_\underset{n \times 1}{i} \right\} $$ = Global Force Matrix

Recall the Element Force Displacement Relation:

$$ \mathbf{\underset{4 \times 4}k^{(e)}}\mathbf{\underset{4 \times 1}d^{(e)}}=\mathbf{\underset{4 \times 1}f^{(e)}} $$

$$ \mathbf{\underset{4 \times 4}k^{(e)}}=\left[k^{(e)}_{ij} \right] $$ = Element Stifness Matrix

$$ \mathbf{\underset{4 \times 1}d^{(e)}}=\left\{d_{i}^{(e)} \right\} $$ = Element Displacement Matrix

$$ \mathbf{\underset{4 \times 1}f^{(e)}}=\left\{f_{i}^{(e)} \right\} $$ = Element Force Matrix

How to go from element matricies (stiffness, displacement, force) to global matrix?

Through an assembly process:
 * Identify the correspondence between element displacement definitions and global displacement definitions.

Global Level:

$$ \left\{d_{1},d_{2},d_{3},d_{4},d_{5},d_{6} \right\} $$

Element Level: $$ \left\{d_{1}^{(1)},d_{2}^{(1)},d_{3}^{(1)},d_{4}^{(1)},d_{5}^{(1)},d_{6}^{(1)} \right\} $$ $$ \left\{d_{1}^{(2)},d_{2}^{(2)},d_{3}^{(2)},d_{4}^{(2)},d_{5}^{(2)},d_{6}^{(2)} \right\} $$
 * Element 1
 * Element 2

Identification of Global to Local Degrees of Freedoms:

$$ \left.\begin{matrix} d_{1} = d_{1}^{(1)}\\ d_{2} = d_{2}^{(1)}\\ \end{matrix}\right\} $$ = Node (1)

$$ \left.\begin{matrix} d_{3} = d_{3}^{(1)} = d_{1}^{(2)}\\ d_{4} = d_{4}^{(1)} = d_{2}^{(2)}\\ \end{matrix}\right\} $$ = Node (2)

$$ \left.\begin{matrix} d_{5} = d_{3}^{(2)}\\ d_{6} = d_{4}^{(2)}\\ \end{matrix}\right\} $$ = Node (3)

Conceptual Step of Assembly:

(Topology of K)

$$\begin{Bmatrix} d_{1}\\ d_{2}\\ d_{3}\\ d_{4}\\ d_{5}\\ d_{6}\\ \end{Bmatrix} = \begin{Bmatrix} F_{1}\\ F_{2}\\ F_{3}\\ F_{4}\\ F_{5}\\ F_{6}\\ \end{Bmatrix} $$

In the Global Stiffness Matrix, The first Element Stiffness Matrix occupies the top left, while the second Element Stiffness Matrix occupies the bottom left. The two Element Stiffness Matrices overlap in the middle, where the values are summed. The resulting empty locations in the Global Stiffness Matrix are zero.

$$ \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} = \begin{bmatrix} \frac{9}{16} &  \frac{3\sqrt{3}}{16}  &  -\frac{9}{16}  &  -\frac{3\sqrt{3}}{16}  &  0  &  0 \\ \frac{3\sqrt{3}}{16} &  \frac{3}{16}  &  -\frac{3\sqrt{3}}{16}  &  -\frac{3}{16}  &  0  &  0 \\ -\frac{9}{16} &  -\frac{3\sqrt{3}}{16}  &  \frac{49}{16}  &  \frac{3\sqrt{3}-40}{16}  &  -\frac{5}{2}  &  \frac{5}{2} \\ -\frac{3\sqrt{3}}{16} &  -\frac{3}{16}  &  \frac{3\sqrt{3}-40}{16}  &  \frac{43}{16}  &  \frac{5}{2}  &  -\frac{5}{2} \\ 0 &  0  &  -\frac{5}{2}  &  \frac{5}{2}  &  \frac{5}{2}  &  -\frac{5}{2} \\ 0 &  0  &  \frac{5}{2}  &  -\frac{5}{2}  &  -\frac{5}{2}  &  \frac{5}{2} \\ \end{bmatrix} = \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} $$

= Step 4:Elimination of Known Degrees of Freedom =

Elimination of Known Degrees of Freedom=>

Reduce the Global Force Displacement Relation (See Lecture 5-3)

$$ d_{1} = d_{2} = d_{5} = d_{6} = 0 $$

$$\underset{6 \times 6}{K} \begin{pmatrix}

d_1= 0 \\

d_2 = 0 \\

d_3 = ? \\

d_4 = ? \\

d_5 = 0 \\

d_6 = 0 \end{pmatrix} \Rightarrow \mathbf \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} \begin{pmatrix}

d_3 \\

d_4 \end{pmatrix} = \underset{6 \times 1}{F}$$

 * Apply fixed boundary conditions $$ \Rightarrow $$ delete corresponding columns in the global stiffness matrix, K

 * By Principal of [Virtual work] $$ \Rightarrow $$ delete corresponding rows (here, rows 1,2,5,6) of K; therefore, corresponding rows of F may also be deleted

Resulting force-displacement relation:

$$ \begin{bmatrix}

K_{33} & K_{34} \\

K_{43} & K_{44} \\ \end{bmatrix} \begin{pmatrix}

d_3 \\

d_4 \end{pmatrix} = \begin{pmatrix}

F_3 \\

F_4 \end{pmatrix} $$

$$ \mathbf F = \begin{pmatrix}

F_3 \\

F_4 \end{pmatrix} = \begin{pmatrix}

0 \\

P \end{pmatrix} $$  {Known$$\Rightarrow$$ Problem Statement}

Recall: $$ \mathbf K  \mathbf d = \mathbf F $$

$$ \Rightarrow \mathbf d = \mathbf F \mathbf K^{-1}$$

$$ \begin{pmatrix}

d_3 \\

d_4 \end{pmatrix} = \mathbf K^{-1} $$  $$ \begin{pmatrix}

0 \\

P \end{pmatrix}$$

$$ \Rightarrow \mathbf K^{-1} = \begin{bmatrix}

0.7681 & 0.6217 \\

0.6217 & 0.8753 \\ \end{bmatrix}$$

$$ \Rightarrow P = 7 $$

$$ \begin{pmatrix}

d_3 \\

d_4 \end{pmatrix} = $$   $$ \begin{bmatrix}

0.7681 & 0.6217 \\

0.6217 & 0.8753 \\ \end{bmatrix}$$ $$ \begin{pmatrix}

0 \\

7 \end{pmatrix} = $$ $$ \begin{pmatrix}

4.3519 \\

6.1271 \end{pmatrix} $$

= Step 5: Computation of Element Forces =

Use the global force-displacement relationship to compute element forces:

$$ \Rightarrow \begin{pmatrix}

d_3 \\

d_4 \end{pmatrix} = \begin{pmatrix}

d^{(1)}_3 \\

d^{(1)}_4 \end{pmatrix} = \begin{pmatrix}

d^{(2)}_1 \\

d^{(2)}_2 \end{pmatrix} = \begin{pmatrix}

4.3519 \\

6.1271 \end{pmatrix} $$

Recall:

$$\underset{4 \times 4}{k^{(e)}}\underset{4 \times 1}{d^{(e)}} = \underset{4 \times 1}{f^{(e)}} $$     {e = 1, 2}

For Element 1: (e=1)

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

$$ \mathbf d^{(1)} = \begin{pmatrix}

0 \\ 0 \\ 4.3519 \\ 6.1271 \end{pmatrix} $$

Recall, $$

\mathbf k^{(1)} = \begin{bmatrix} \frac{9}{16} & \frac{3\sqrt{3}}{16} & -\frac{9}{16} & -\frac{3\sqrt{3}}{16}\\ \frac{3\sqrt{3}}{16} & \frac{3}{16} &-\frac{3\sqrt{3}}{16} & -\frac{3}{16}\\ -\frac{9}{16} & -\frac{3\sqrt{3}}{16} & \frac{9}{16} & \frac{3\sqrt{3}}{16}\\ -\frac{3\sqrt{3}}{16}& -\frac{3}{16} & \frac{3\sqrt{3}}{16} & \frac{3}{16} \end{bmatrix} $$

$$ \Rightarrow \mathbf f^{(1)} = \begin{pmatrix}

f^{(1)}_1 \\ f^{(1)}_2 \\ f^{(1)}_3 \\ f^{(1)}_4 \end{pmatrix} = \begin{pmatrix}

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

Similarly, For Element 2: (e=2)

$$ \mathbf k^{(2)} \mathbf d^{(2)} = \mathbf f^{(2)} $$

$$ \mathbf d^{(2)} = \begin{pmatrix}

4.3519 \\ 6.1271 \\ 0 \\ 0 \end{pmatrix} $$

Recall, $$ \mathbf k^{(2)} = \begin{bmatrix} \frac{5}{2}& -\frac{5}{2} &-\frac{5}{2} &\frac{5}{2}\\ -\frac{5}{2}& \frac{5}{2} & \frac{5}{2} &-\frac{5}{2} \\ -\frac{5}{2}& \frac{5}{2} &\frac{5}{2} &-\frac{5}{2}\\ \frac{5}{2}& -\frac{5}{2} & -\frac{5}{2} &\frac{5}{2} \end{bmatrix}$$

$$ \Rightarrow \mathbf f^{(2)} = \begin{pmatrix}

f^{(2)}_1 \\ f^{(2)}_2 \\ f^{(2)}_3 \\ f^{(2)}_4 \end{pmatrix} = \begin{pmatrix}

-4.442 \\ 4.442 \\ 4.442 \\ -4.442 \end{pmatrix}$$

= Step 6: Computation of Reaction Forces =

Figure 8: Axial Forces in Member 1

$$ P^{(1)}_1 = [(f^{(1)}_1)^2 + (f^{(1)}_2)^2]^{1/2} $$

and

$$ P^{(1)}_2 = [(f^{(1)}_3)^2 + (f^{(1)}_4)^2]^{1/2} $$

Element 1 is a two-force member, thus:

$$ P^{(1)}_1 = P^{(1)}_2 $$

Similarly, in element 2, the global nodes are translated into the local nodal coordinate system and are shown in the figure below.

Figure 9: Axial Forces in Member 2

=Further Analysis=

Looking at the axial forces shown in section below in the two figures, we may use statics to relate the relationship between all the forces. Both elements are in equilibrium.

For Element 1:

$$ \sum F_x = f^{(1)}_1 + f^{(1)}_3 = 0$$

$$ \sum F_y = f^{(1)}_2 + f^{(1)}_4 = 0 $$

For Element 2:

$$ \sum F_x = f^{(2)}_1 + f^{(2)}_3 = 0 $$

$$ \sum F_y = f^{(2)}_2 + f^{(2)}_4 = 0 $$

= Method 2: Statics and Euler Cut Principle=

Second method for solving the two-bar truss example using ] and the Euler cut principle. It is useful to use Euler's method rather than statics or the FEM "recipe" method to solve since it allows us to break away specific sections of the system, and recreate them specifically into distinct sections.

Figure : One example of Euler Cut Principle with Two Bar System

Figure : Another example of Euler Cut Principle with same Two Bar System

More information on Euler's Law and Cut Principle can be found by clicking here: [Euler's Laws and Cut Principles]

= Example 1.2 Solved in MathCAD =

In the following pictures we solve example problem 1.2 using PTC's MathCAD software.

Figure 11: Element 1's Stiffness Matrix

 * Here we are simply defining all of the variables for Element 1's Stiffness Matrix.Defined here is The Young's Modulus, Cross sectional area, and Length. The Matrix coefficient is defined here. We also and solve for Element 1's Stiffness Matrix.

Figure 12: Element 2's Stiffness Matrix

 * Here we are simply defining all of the variables for Element 2's Stiffness Matrix.Defined here is The Young's Modulus, Cross sectional area, and Length. The Matrix coefficient is defined here. We also and solve for Element 2's Stiffness

Figure 13: Combining Element Stiffness Matrices

Figure 14: Combined Global Stiffness Matrix

 * Above we combine the Element Stiffness Matrices as stated in step 3 of example 1.2 solution above.

Figure 15: What is left of the Global Matrices after Virtual Work

 * By Principal of Virtual Work we delete corresponding rows (here, rows 1,2,5,6) of K; therefore, corresponding rows of F may also be deleted. We end up with the following variables left. We also take the inverse of the remaining Global Stiffness Matrix.

Figure 16: Global Displacement Matrix values

 * Here we simply solve for the Global Displacement Matrix values.

Figure 17: Reaction forces

 * We now take the Global Displacement values and return them respectively to their corresponding Element Stiffness Matrix. The we compute the reaction forces at each pin.

= Solution for example 1.2 using two force member principle In MathCAD =

In the following picture we solve the axial load picture from the notes using PTC's MathCAD software.

Figure 18: Solution of Example 1.2 with two force member.

 * You can refer to Figure 7 to see the system solved using the principle of two force members

= Help with MathCAD = For help with ], we found some practical help on LSU's webpages. [Source: LSU]

= References =

In this section we will list some of our references and sources to help readers improve and further there understanding of the material covered in this assignment.

Principles in [Virtual work] were touched upon to help facilitate learning in the subject. [Source: Wikipedia]

] method of work was also used to help solve some problems. [Source: Wikipedia]

For help with ], we found some practical help on LSU's webpages. [Source: LSU]

= Contributing Members = The following Team Wiki members contributed to this report.

Rodney Dagulo --Eml4500.f08.wiki.dagulo.r 11:51, 25 September 2008 (UTC)

Renee Hood -- Eml4500.f08.wiki.hood 22:52, 25 September 2008 (UTC)

Cortland Glowacki -- Eml4500.f08.wiki.cort 8:34, 25 September 2008 (UTC)

Ricardo Lopez --Eml4500.f08.wiki.Lopez 1:23, 26 September 2008 (UTC)

Gonzalo Barcia --Eml4500.f08.wiki.Barcia 3:14, 26 September 2008 (UTC)

title: User:Uf.team.wiki/HW2


text:
User:Gjalt-Jorn

See my wikipedia user page :-)

(which is here)

license: Creative Commons - Attribution Share-Alike - https://creativecommons.org/licenses/by-sa/4.0/

title: User:Gjalt-Jorn


text:
File talk:HW2elementalmatrix.jpg

The first step to solving a 2 truss system is to look at the elemental picture. The elemental picture includes a stiffness matrix ' k ', a displacement matrix ' d ', and a force matrix ' f '.

title: File talk:HW2elementalmatrix.jpg


text:
User:Zyxw

This page intentionally left blank.

title: User:Zyxw


text:
User talk:Gjalt-Jorn

 Hello Gjalt-Jorn, and welcome to Wikiversity! If you need help, feel free to visit my talk page, or contact us and ask questions. After you leave a comment on a talk page, remember to sign and date; it helps everyone follow the threads of the discussion. The signature icon in the edit window makes it simple. To get started, you may

 * Take a guided tour and learn to edit.
 * Visit a (kind of) random random project.
 * Browse everything on Wikiversity, or visit a portal corresponding to your educational level: pre-school, primary, secondary, tertiary, non-formal education.
 * Find out about research activities on Wikiversity.

 * Read an introduction for teachers and find out how to write an educational resource for Wikiversity.
 * Give feedback about your initial observations
 * Discuss Wikiversity issues or ask questions at the colloquium.
 * Chat with other Wikiversitans on #wikiversity-en.

And don't forget to explore Wikiversity with the links to your left. Be bold to contribute and to experiment with the sandbox or your userpage, and see you around Wikiversity! Jtneill - Talk - c 14:17, 22 September 2008 (UTC)

 Hi! Our name is Vicky-Verity. We are twins and are Wikiversity mascots. We think Wikiversity is a great place to learn and make friends (when we aren't sleeping). Leave us a message!

Psychology
Maybe we connect around "psychology"? -- Jtneill - Talk - c 14:17, 22 September 2008 (UTC)

title: User talk:Gjalt-Jorn


text:
User:EAS4200c.f08.Blue.E/Lecture 10

Homework Assignments

The first homework assigned in class consists of four individual problems.

The first Problem is to define the moment of inertia $$I_y$$ for a solid circular cross section through integration using polar coordinates. The integral being $$I_y=\int\int_A(Z^2dA)$$.

Also the derivation of $$I_y$$ for a square cross section is required which would be derived by the use of the integral $$I_y=\int\int_A(Z^2dYdZ)$$

The second problem assigned required comparing the moment of inertia defined for the circular cross section (case:1) in the previous problem to a redistributed equivalent area (case:2)

Where $$a=b$$, $$ A_2=3(a)(t)=\pi(r^2)$$,  and $$ t=a/10$$

The moment of inertia will be calculated assuming the y-axis passes through the centroid of case:1 and case:2 for fair comparison. The moment of inertia for case:2 will be calculated by using the fact that the moment of inertia for a rectagular cross section is $$I_y=1/12(b)(h^3)$$ along with the parallel axis theorem which is $$I_y=I+Ad^2$$

The third problem assigned was a modified version of problem 1.7. The modification was that all rectangular surfaces be changed to circular surfaces. The problem is to compare the moment of inertia $$I_y$$ of a circular cross section (case:1) to a modified cricular cross section (case:2) calculating the moment of inertia $$I_y$$ for both cases through the centroid of the cross section.

Where $$r_0=10cm$$, $$t=r_0/10$$, and $$A_1=A_2$$

The moment of inertia will be calculated for the circle from the answer to problem number one since it will be the same the moment of inertia for case 2 will be from a combination of rectangle moment of inertia and circular moment of inertia with use of the parallel axis theorem.

The fourth problem assigned was to show why a open rectangular cross section would be preferable to a hollow recangular cross section by comparing moment of inertia, manufacturing, and assembly techniques.

title: User:EAS4200c.f08.Blue.E/Lecture 10


text:
User:Eml 4500.f08.delta 6.specht/HW2

Unit Vector Multiplication
The value for m(e) can be calculated in the manner shown below. It is equal to the final solution that is found. It should be noted that the dot product of the i and j unit vectors equals zero, and the dot product of the two j unit vectors is equal to one.

Element Stiffness Matrices
The values that are used to calculate the scalar value k are shown below. The direction cosine matrix is multiplied by the scalar k value, which is the spring constant of each element. The value that is obtained from this operation is the stiffness matrix for each element. The values for the direction cosines of each element are as follows: l(1) = cos θ(1) = cos30° = $$\frac{\sqrt{3}}{2}$$ m(1) = sin θ(1) = sin30° = $$\frac{1}{2}$$ l(2) = cos θ(2) = $$cos(-\frac{\Pi }{4}) = \frac{\sqrt{2}}{2}$$ m(2) = sin θ(2) = $$\sin (-\frac{\Pi }{4}) = -\frac{\sqrt{2}}{2}$$ These values can then be substituted into the matrix of direction cosines in order to calculate the element stiffness matrices.

Verification of Equilibrium of element 1:
Note: The reactions for node 1 were calculated to be

F1(1) = -4.4278

F2(1) = -2.5622

F3(1) = 4.4278

F4(1) = 2.5622

Note: Negative values signify that the direction of the forces in element 1 were assumed to be in the wrong direction.

Redrawing the free body diagram with all positive forces shows more clearly how the resultant forces P1 and P2 cancel each other out.

Now,

F1(1) = 4.4278

F2(1) = 2.5622

F3(1) = 4.4278

F4(1) = 2.5622

Determining Resultants:

P1= [(f1(1))2 + (f2(1))2]1/2= [(4.4278)2+ (2.5622)2]1/2= 5.12

P2= [ (f3(1))2 + (f4(1))2]1/2= [(4.4278)2+ (2.5622)2]1/2= 5.12

Note: P1 = P2, thus element 1 is in equilibrium.

Statics Solution Method

P = 7 L(1) = 4 L(2) = 2 θ(1) = 30° θ(2) = 45°

Observation:

By using trigonometry and the angles given the unknown lengths can be determined. These lengths will be needed when analyzing the summation of the moments of each node.

$$\sin {30^{\circ} } = \frac{L_c}{4} \Rightarrow L_c = 4 \sin {30^{\circ} } = 2$$

$$\cos {30^{\circ} } = \frac{L_x}{4} \Rightarrow L_x = 4 \cos {30^{\circ} } = 3.46$$

$$\sin {45^{\circ} } = \frac{L_b}{2} \Rightarrow L_b = 2 \sin {45^{\circ} } = 1.4$$

$$\cos {45^{\circ} } = \frac{L_y}{2} \Rightarrow L_y = 2 \cos {45^{\circ} } = 1.4$$

Lz = Lx + Ly = 3.46 + 1.4 = 4.86

La = Lc - Lb = 2 - 1.4 = 0.6

Moment equations can now be analyzed since all lengths are known.

(1) M1: -(P)(Lx) + (F4)(Lz) + (F3)(La) = -(7)(3.46) + (F4)(4.86) + (F3)(0.6)

(2) M2: (P)(Ly) + (F1)(La) - (F2)(Lz) = (7)(1.4) + (F1)(0.6) - (F2)(4.86)

(3) M3: (F1)(Lc) - (F2)(Lx) - (F3)(Lb) + (F4)(Ly) = (F1)(2) - (F2)(3.46) - (F3)(1.4) + (F4)(1.4)

Note: There are 4 unknowns with only 3 equations. However, by inspection it is known that the summation of the forces in the x direction are equal to zero, giving us 4 equations with 4 unknowns. (4) $$\sum{F_x} = 0: F_1 - F_3 = 0 $$

All forces can now be determined by using the system of equations. Rearrange the equations solving for a common variable in order to calculate the first unknown force. Next, using the rearrange equations all unknown forces can be calculated.

(1) -24.22 + 4.86 F4 + 0.6 F3 = 0

(2) 9.8 + 0.6 F1 - 4.86 F2 = 0

(3) 2 F1 - 3.46 F2 - 1.4 F3 + 1.4 F4 = 0

(4) F1 = F3

Since F3 is already in terms of F1, F2 and F4 will also solved in terms of F1

(1) $$F_4 = \frac{24.22 - 0.6 F_3}{4.86} = \frac{24.22 - 0.6 F_1}{4.86}$$ (2) $$F_2 = \frac{9.8 + 0.6 F_1}{4.86}$$ (4) F3 = F1

Plugging in these relationships into equation (3), F1 and the rest of the forces can be solved for as follows:

(3) $$2 F_1 - 3.46 (\frac{9.8 + 0.6 F_1}{4.86}) - 1.4 F_1 + 1.4 (\frac{24.22 - 0.6 F_1}{4.86}) = 0 \Rightarrow $$

Combining like terms,

(3) $$2 F_1 - 6.976 - 0.427 F_1 - 1.4 F_1 + 6.976 - 0.173 F_1 = 0 \Rightarrow 0 = 0$$

Thus, F1 = F3 = 0

(2) $$F_2 = \frac{9.8 + 0.6(0)}{4.86} = 2.01$$ (1) $$F_4 = \frac{24.22 + 0.6(0)}{4.86} = 4.98$$

Results

F1 = 0 F2 = 2.01 F3 = 0 F4 = 4.98

Two Bar Truss Example (MATLAB)
It is important to understand how to solve a bar truss system employing a finite element MATLAB code in order to compare the resulting matrices with those obtained from hand calculations.

Take this truss example with the following: Data

MATLAB Code Note: this MATLAB code was obtained from Dr. L. Vu-Quoc website http://clesm.mae.ufl.edu/~vql/courses/fead/2008.fall/codes/twoBarTrussEx.txt

Results:

Testing the Steps
It is important to see how the steps to solve truss systems work.

Given

Take this truss example with the following data:

Step 1: Global Picture
Releasing the truss system from its supports and showing the reactions, we have:

There are 6 unknowns for which we need to solve for, therefore we need to analyze each element. The matrix equation is as follows.

 * $$\begin{pmatrix}

f_1\\ ...\\ f_6\end{pmatrix}$$ = $$\begin{bmatrix} & &  \\  & k &  \\ & &  \end{bmatrix}$$ $$\begin{pmatrix} d_1\\ ...\\ d_6\end{pmatrix}$$

which corresponds to

 * $$\mathbf{F}$$=$$\mathbf{K}$$ $$\mathbf{d}$$.

To solve for the reactions, we have to now examine the whole system by breaking it down into elements.

Step 2: Element Picture
Analyzing each element with its own force and dofs yields:

It is important to notice the chosen coordinate axis since they will allow for ease of analyzing each element. The tilda on the coordinate direction names designate a non-horizontal or non-vertical direction.

We now want to creat a matrix equation, just like for the global picture, for the element picture. The matrix equation consists on the basic force-distance relationship, however, this principle is applied at the element level. The notation is altered in that each term is designated to belong to the particular element with an upper script number in parenthesis so that we get, 'F(e)='k(e) d(e), named as the element force matrix, the element stiffness matrix, and the element distance matrix.

Step 3: Force-Displacement Relationship
To build the element stiffness matrix, we have to follow a "recipe" for calculating each term. This stiffness matrix will end up measuring 4x4.

The recipe is as follows, and in the wise words of Prof. Vu-Quoc, "The notation is beautiful here. It tells you no more, no less."

 * 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}$$ = k$$^{(e)}$$

where the axial stiffness k$$^{(e)}$$ of the bar element "e" is

 * $$k^{(e)}=\frac{E^{(e)} A^{(e)}}{L^{(e)}}$$,

where $$E^{(e)}$$ is the element's material Young's Modulus, $$A^{(e)}$$ is the element cross-sectional area, and $$L^{(e)}$$ the element length. Also, $$l^{(e)}$$ and $$m^{(e)}$$ are te director cosines of the rotated, and convenient, coordinate axes with respect to the positive, and horizontal, x-direction (the global axis).

It is very important to make the following observations for the efficiency to construct the stiffness matrix:
 * 1. It is only needed to compute 3 numbers, both of the squares and the product of eachother, and the determination of a negeative or a positive sign.
 * 2. The matrix k$$^{(e)}$$ is symmetric, which means that there is no need to calculate the bottom triangular part once the top has been determined, including the diagonal.

Director Cosines: The director cosines will yield the projections of vectors oriented with an inclination w.r.t. the positive x-axis on the horizontal or vertical directions. These horizontal and vertical directions are more precisely for this course the global x-y coordinates. From this diagram, we can derive our much needed $$l^{(e)}$$ and $$m^{(e)}$$ values. $$l^{(e)}$$ = $$\vec{\tilde{i}}$$ • $$\vec{\hat{i}}$$ = cosθ$$^{(e)}$$ $$m^{(e)}$$ = $$\vec{\tilde{i}}$$ • $$\vec{\hat{j}}$$ = sinθ$$^{(e)}$$ = cos(π/2-θ$$^{(e)})$$ Also, $$\vec{\tilde{i}}$$=cosθ$$^{(e)}$$•$$\vec{\hat{i}}$$+sinθ$$^{(e)}$$•$$\vec{\hat{j}}$$

Global stiffness matrix K.

 * {| style="text-align:center; border-collapse:collapse;" cellpadding="4"

 * rowspan="6" | K  =
 * rowspan="6" | $$\left.\begin{align} \\ \\ \\ \\ \\ \\ \\ \\ \\ \\ \end{align} \right($$
 * title="stiffness matrix from element one" style="border-left: 1px solid black; border-top: 1px solid black;" | $$k_{11}^{(1)}$$
 * title="stiffness matrix from element one" style="border-top: 1px solid black;" | $$k_{12}^{(1)}$$
 * title="stiffness matrix from element one" style="border-top: 1px solid black;" | $$k_{13}^{(1)}$$
 * title="stiffness matrix from element one" style="border-top: 1px solid black; border-right: 1px solid black;" | $$k_{11}^{(1)}$$
 * 0
 * 0
 * rowspan="6" | $$\left)\begin{align} \\ \\ \\ \\ \\ \\ \\ \\ \\ \\ \end{align} \right.$$
 * title="stiffness matrix from element one" style="border-left: 1px solid black;" | $$k_{21}^{(1)}$$
 * title="stiffness matrix from element one" | $$k_{22}^{(1)}$$
 * title="stiffness matrix from element one" | $$k_{23}^{(1)}$$
 * title="stiffness matrix from element one" style="border-right: 1px solid black;" | $$k_{24}^{(1)}$$
 * 0
 * 0
 * title="stiffness matrix from element one" style="border-left: 1px solid black;" | $$k_{31}^{(1)}$$
 * title="stiffness matrix from element one" style="border-right: 1px solid black;" | $$k_{32}^{(1)}$$
 * title="stiffness matrix from element one and element two" style="border-top: 1px solid black;" | $$k_{33}^{(1)} + k_{11}^{(2)}$$
 * title="stiffness matrix from element one and element two" style="border-right: 1px solid black; border-top: 1px solid black;" | $$k_{34}^{(1)} + k_{12}^{(2)}$$
 * title="stiffness matrix from element two" style="border-top: 1px solid black;" | $$k_{13}^{(2)}$$
 * title="stiffness matrix from element two" style="border-right: 1px solid black; border-top: 1px solid black;" | $$k_{14}^{(2)}$$
 * title="stiffness matrix from element one" style="border-left: 1px solid black; border-bottom: 1px solid black;" | $$k_{41}^{(1)}$$
 * title="stiffness matrix from element one" style="border-right: 1px solid black; border-bottom: 1px solid black;" | $$k_{41}^{(1)}$$
 * title="stiffness matrix from element one and element two" style="border-bottom: 1px solid black;" | $$k_{43}^{(1)} + k_{21}^{(2)}$$
 * title="stiffness matrix from element one and element two" style="border-right: 1px solid black; border-bottom: 1px solid black;" | $$k_{44}^{(1)} + k_{22}^{(2)}$$
 * title="stiffness matrix from element two" | $$k_{23}^{(2)}$$
 * title="stiffness matrix from element two" style="border-right: 1px solid black;" | $$k_{24}^{(2)}$$
 * 0
 * style="border-right: 1px solid black;" | 0
 * title="stiffness matrix from element two" | $$k_{31}^{(2)}$$
 * title="stiffness matrix from element two" | $$k_{32}^{(2)}$$
 * title="stiffness matrix from element two" | $$k_{33}^{(2)}$$
 * title="stiffness matrix from element two" style="border-right: 1px solid black;" | $$k_{34}^{(2)}$$
 * 0
 * style="border-right: 1px solid black;" | 0
 * title="stiffness matrix from element two" style="border-bottom: 1px solid black;" | $$k_{41}^{(2)}$$
 * title="stiffness matrix from element two" style="border-bottom: 1px solid black;" | $$k_{42}^{(2)}$$
 * title="stiffness matrix from element two" style="border-bottom: 1px solid black;" | $$k_{43}^{(2)}$$
 * title="stiffness matrix from element two" style="border-right: 1px solid black; border-bottom: 1px solid black;" | $$k_{44}^{(2)}$$
 * }
 * 0
 * style="border-right: 1px solid black;" | 0
 * title="stiffness matrix from element two" | $$k_{31}^{(2)}$$
 * title="stiffness matrix from element two" | $$k_{32}^{(2)}$$
 * title="stiffness matrix from element two" | $$k_{33}^{(2)}$$
 * title="stiffness matrix from element two" style="border-right: 1px solid black;" | $$k_{34}^{(2)}$$
 * 0
 * style="border-right: 1px solid black;" | 0
 * title="stiffness matrix from element two" style="border-bottom: 1px solid black;" | $$k_{41}^{(2)}$$
 * title="stiffness matrix from element two" style="border-bottom: 1px solid black;" | $$k_{42}^{(2)}$$
 * title="stiffness matrix from element two" style="border-bottom: 1px solid black;" | $$k_{43}^{(2)}$$
 * title="stiffness matrix from element two" style="border-right: 1px solid black; border-bottom: 1px solid black;" | $$k_{44}^{(2)}$$
 * }
 * title="stiffness matrix from element two" style="border-bottom: 1px solid black;" | $$k_{43}^{(2)}$$
 * title="stiffness matrix from element two" style="border-right: 1px solid black; border-bottom: 1px solid black;" | $$k_{44}^{(2)}$$
 * }
 * }

The box, within the matrix on the top left, is the stiffness matrix from element one. The box to the lower right is the stiffness matrix from element two. Combined the two become the global stiffness matrix.

Where capital k (K) is the global stiffness coefficient and lowercase k (k) is the element stiffness coefficient. Below is the relationship between the global stiffness coefficients and the element stiffness coefficients for the global stiffness matrix above.

K11 = k11(1) ; K12 = k12(1) ; K13 = k13(1) ; K14 = k14(1) ; K15 = 0 ; K16 = 0

K21 = k21(1) ; K22 = k22(1) ; K23 = k23(1) ; K24 = k24(1) ; K25 = k25(1) ; K26 = k26(1)

K31 = k31(1) ; K32 = k32(1) ; K33 = k33(1) + k11(2) ; K34 = k34(1) + k12(2); K13 = k13(2) ; K14 = k14(2)

K41 = k41(1) ; K42 = k42(1) ; K43 = k43(1) + k21(2) ; K44 = k44(1) + k22(2); K23 = k23(2) ; K24 = k24(2)

K51 = 0 ; K52 = 0 ; K53 = k31(2) ; K54 = k32(2) ; K55 = k33(2) ; K56 = k34(2)

K61 = 0 ; K62 = 0 ; K63 = k41(2) ; K64 = k42(2) ; K65 = k43(2) ; K66 = k44(2) The calculation of the values in the k matrices for element 1 and element 2 are as follows: θ(1) = 30° l(1) = cos θ(1) = cos30° = $$\frac{\sqrt{3}}{2}$$ m(1) = sin θ(1) = sin30° = $$\frac{1}{2}$$ k(1) = E(1)·A(1)/ L(1) = $$\frac{3}{4}$$

$$k^{(1)} = k_{(1)} \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}$$

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

k12(1) = k(1) · l(1) · m(1) = $$\frac{3}{4}$$ · $$\frac{\sqrt{3}}{2}$$· $$\frac{1}{2}$$ = $$\frac{\sqrt{3}}{16}$$

k42(1) = - k(1) · ( m(1) )2 = - $$\frac{3}{4}$$ · $$(\frac{2})^{2}$$ = - $$\frac{3}{16}$$

Observation:

1) Only three numbers need to be computed. Other coefficients have the same absolute value just differ by sign (+ or -) 2) Matrix k(1) is symmetrical i.e., kij(1) = kji(1); just interchange the row and column indices

For example: k13(1) = k31(1)

In general,

kij(e) = kji(e) or k ij(1)Т = k (1)

where Т represents the transpose of the matrix.

$$k^{(e)} = \begin{bmatrix} k_{11}^{(1)} & k_{12}^{(1)} & k_{13}^{(1)} & k_{14}^{(1)}\\ & k_{22}^{(1)} & k_{23}^{(1)} & k_{24}^{(1)}\\ & & k_{33}^{(1)} & k_{34}^{(1)}\\ & &  & k_{44}^{(1)} \end{bmatrix}$$

Since the matrix is symmetric about the diagonal, only the upper right triangle part needs to be calculated.

$$k^{(1)} = \begin{bmatrix} \frac{9}{16} & \frac{\sqrt{3}}{16} & -\frac{9}{16} & -\frac{\sqrt{3}}{16}\\ \frac{\sqrt{3}}{16} & \frac{3}{16} & -\frac{\sqrt{3}}{16} & -\frac{3}{16}\\ -\frac{9}{16} & -\frac{\sqrt{3}}{16} & \frac{9}{16} & \frac{\sqrt{3}}{16}\\ -\frac{\sqrt{3}}{16} & -\frac{3}{16} & \frac{\sqrt{3}}{16} & \frac{3}{16} \end{bmatrix}$$

Element 2:

k(2) = E(2)·A(2)/ L(2) = 5 θ(2) = $$-\frac{\Pi }{4}$$ l(2) = cos θ(2) = $$cos(-\frac{\Pi }{4}) = \frac{\sqrt{2}}{2}$$ m(2) = sin θ(2) = $$\sin (-\frac{\Pi }{4}) = -\frac{\sqrt{2}}{2}$$

k(2) = [kji(2)]4x4

Observation:

1) The absolute value of all coefficients kji(e), e=2 (i,j) = 1,...,4 are the same (|l| = |m|) → Only four coefficients need to be computed; all other coefficients add + or -. 2) k ij(2)Т = k (2)

$$k^{(2)} = \begin{bmatrix} \frac{5}{2} & -\frac{5}{2} & -\frac{5}{2} & \frac{5}{2}\\ -\frac{5}{2} & \frac{5}{2} & \frac{5}{2} & -\frac{5}{2}\\ -\frac{5}{2} & \frac{5}{2} & \frac{5}{2} & -\frac{5}{2}\\ \frac{5}{2} & -\frac{5}{2} & -\frac{5}{2} & \frac{5}{2} \end{bmatrix}$$

Step 4: Elimination of known degrees of freedom (dofs)
This Process reduces the global force displacement relationship by eliminating the first and last two columns of the global stiffness matrix.

d1 = d2 = d5 = d6 = 0

The displacements above are zero. Therefore, columns 1, 2, 5 and 6 of the global stiffness matrix go to zero. This reduces the matrix to a 6x2.

The following displays the F matrix calculated two different ways.

$$ \textbf{K}\begin{bmatrix} d_{1}=0\\ d_{2}=0\\ d_{3}\\ d_{4}\\ d_{5}=0\\ d_{6}=0 \end{bmatrix} =\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} \begin{bmatrix} d_{3}\\ d_{4} \end{bmatrix} = \textbf{F} $$

Here, we delete the corresponding columns in the global stiffness matix, K. Due to the Principle of Virtual Work (PVW), we must also delete the corresponding rows (rows 1, 2, 5, 6).

Below, we have the Resulting Force Displacement relation:

$$ \begin{bmatrix} K_{33} &K_{34} \\ K_{43} & K_{44} \end{bmatrix} \begin{bmatrix} d_{3}\\ d_{4} \end{bmatrix} = \begin{bmatrix} F_{3}\\ F_{4} \end{bmatrix} $$ where the F matrix is found below.

$$ \textbf{F} = \begin{bmatrix} F_{3}\\ F_{4} \end{bmatrix} = \begin{bmatrix} 0\\ P \end{bmatrix} $$ Before we continue, we will find the determinant and inverse of the K matrix. The determinant is simply equal to:

$$ det\; \textbf{K} = K_{33}K_{44}-K_{34}K_{43} $$

Now that we have the determinant, we can calculate the inverse using the formula below.

$$ \textbf{K}^{-1} = \frac{1}{det\; \textbf{K}} \begin{bmatrix} K_{44} & -K_{34}\\ -K_{43} & K_{33} \end{bmatrix} $$

*NOTE* The inverse of the K matrix cannot be found by using the transpose of the matrix, illustrated below.

$$ \textbf{K}^{T} = \begin{bmatrix} K_{33} & K_{34}\\ K_{43} & K_{44} \end{bmatrix} , where\; \textbf{K}^{-1}\neq \frac{1}{det\; \textbf{K}} \textbf{K}^{T} $$

With the inverse of the K matrix known, we can now find the unknown forces from the d matrix.

$$ \begin{bmatrix} d_{3}\\ d_{4} \end{bmatrix} = \textbf{K}^{-1}\begin{bmatrix} 0\\ P \end{bmatrix} = \begin{bmatrix} 4.352\\ 6.127 \end{bmatrix} $$

Step 5: Compute Reactions
There are two main methods for solving this 2-bar truss system. Method 1 For the first method, we will use the element force displacement relationship: $$ \textbf{k}^{e}\textbf{d}^{e}=\textbf{f}^{e}, where\; e=1,2 $$

We can now separate the truss into each individual bar, and compute the calculations for each bar alone.

Element 1:

$$where\; \textbf{d}^{(1)}= \begin{bmatrix} 0\\ 0\\ 4.352\\ 6.127 \end{bmatrix} = \begin{bmatrix} d_{1}^{(1)}\\ d_{2}^{(1)}\\ d_{3}^{(1)}\\ d_{4}^{(1)} \end{bmatrix} $$

Element 2:

$$ where\; \textbf{d}^{(2)}= \begin{bmatrix} 4.352\\ 6.127\\ 0\\ 0 \end{bmatrix}= \begin{bmatrix} d_{1}^{(2)}\\ d_{2}^{(2)}\\ d_{3}^{(2)}\\ d_{4}^{(2)} \end{bmatrix} since\; d_{3}=d_{1}^{(2)}, d_{4}=d_{2}^{(2)} $$

Step 6: Computation of Reaction Forces
The displacements for elements 1 and 2 are now known, and can be used in order to solve for the reaction forces at the pins. The force-displacement relationship that is shown below will be used to find the forces at the ends of each element.

The element stiffness matrix and the displacement matrix of element 1 can be reduced based on the values of d(1)1=d(2)2=0. These reduced matrices are shown below.

$$k^{(1)}*d^{(1)}=f^{(1)}= \left[ \begin{matrix} -0.5625&-0.32476\\  -0.32476&-0.1875\\  0.5625&0.32476\\   0.32476&0.1875 \end{matrix}\right]* \left\{ \begin{matrix} 4.352\\  6.1271 \end{matrix} \right\}$$

The forces that are induced in element 1 by the applied force P at node 2 are equivalent to:

 * $$f^{(1)}=\begin{Bmatrix} -4.4378 \\ -2.5622 \\ 4.4378 \\ 2.5622 \end{Bmatrix}=\begin{Bmatrix} f_1^{(1)} \\ f_2^{(1)} \\ f_3^{(1)} \\ f_4^{(1)} \end{Bmatrix}$$

The equations for static equilibrium are listed below. It is evident by the values of the forces in the element 1 force matrix that the first two equations are satisfied. The third equation is satisfied by taking the moment about either one of the nodes of element 1.

$$ \begin{array}{lr} \sum F_x=f_1^{(1)}+f_3^{(1)}=0&(1)\\ \sum F_y=f_2^{(1)}+f_4^{(1)}=0&(2)\\ \sum M_{Any\, Node}=0&(3)\\ \end{array} $$

The two elements of the 2-D Plane Truss problem are shown below. The forces that act along the axis of the element can be found by using the Pythagorean Theorem. It can be noted that the force that acts on one end of each element is equal and opposite to the force acting on the other end of the element. The equation to accomplish this is listed after the diagrams of the elements.

$$P_1^{\left(1\right)}=\left[\left(f_1^{\left(1\right)}\right)^2+\left(f_2^{\left(1\right)}\right)^2\right]^{\frac 12}$$

The forces that are found using the method described can be verified by applying the equations of static equilibrium across each element. The global picture can also be divided in two ways, by using the Euler Cut Principle, in order to perform this operation. This analysis is provided in the homework section at the beginning of this article. The methods that this can be cut are shown below. Each cut is denoted by a dashed circle. The first method includes the global node 2 in the main section of element 1, while the second method has node 2 being analyzed separately.

In order to verify the static equilibrium of the whole system at once, the equilibrium of node 2 can be established. The diagram for this is shown below, while the calculation is performed in the homework section at the beginning of the article. The forces shown are P (applied force), P(1)1 (axial force in element 1), P(2)2 (axial force in element 2).

Team Contributors
Iain Specht--Eml 4500.f08.delta 6.specht 14:24, 22 September 2008 (UTC) Micheal Trent Krueger--Eml4500.f08.delta 6.krueger 01:39, 26 September 2008 (UTC) Nicolas Castrillon --Eml4500.f08.delta 6.castrillon 01:40, 26 September 2008 (UTC) Diana Guzman--Eml4500.f08.delta 6.guzman 05:02, 26 September 2008 (UTC) Sean Lopez--Eml4500.f08.delta 6.lopez 05:25, 26 September 2008 (UTC) Eric Ramirez--Eml4500.f08.delta 6.ramirez 12:42, 26 September 2008 (UTC)

title: User:Eml 4500.f08.delta 6.specht/HW2


text:
User:Eas4200c.f08.team12.hepsworth/HW1

=EAS4200c: Aerospace Structures - Class Notes=

Lectures 1, 2, and 3 - 8/25/08 through 8/31/08
Course Information

Website - VQ Wikipage → "teaching" → "my course website" → "EAS 4200c Aerospace Structures" EAS 4200c Course website Password: fall08.wiki

MWF Period 4 (10:40-11:30PM), MAE 303 Office: NEB135

Lectures in week 1 centered around introductions and orientation. This course is focused around collaborative learning, in which students utilize interpersonal relationships to learn, teach, and retain course content. Groups of 5-6 members were organized, and the software (Wikiversity) was introduced.

The purpose of using a domain like Wikiversity is to promote collaboration between students teams, the entire class, and between the professor and the class. In addition the Wikiversity server is more reliable than that of E-learning, which tends to lock up at "peak times". This software also allows students in a group to complete homework assignments and exchange class notes without having to be in the same room, city, or state.

Syllabus[]

Lecture 4 - 9/3/08
Structural Goals for Aircraft: Aerospace structure materials differ from civil engineering materials based on one main characteristic: weight. Desirable aircraft structural goals are for the aircraft to be lightweight, yet have high strength and high stiffness. Stiffness is determined by examining the linear relationship between stress and strain. This relationship follows Hooke's Law, and is as follows: $$\displaystyle \sigma = E \epsilon$$ (where the factor E is known as Young's Modulus or the Modulus of Elasticity, $$\displaystyle \sigma$$ is the stress, and $$\displaystyle \epsilon $$ is the strain). The concepts of Yield Stress ,and  Ultimate Stress both designate the Strength of a material. Another important material property is known as Toughness, which refers to a material's ability to be firm but not brittle in nature, and strong but not flexible (See ).

Structural Materials: Many different materials are used in the construction of any aircraft, with each materials having their pros and cons to usage. Glass is a material with high stiffness, but low toughness. Plastic, Nylon, and Aluminum all have low stiffness, yet high Toughness. Compared to steel alloys, aluminum has low strength and lower fracture toughness. In addition to aluminum and titanium, recently composite materials have made up a significant percent of aircraft. Composite materials exhibit both high stiffness and high toughness. Composite materials can also be reinforced with fibers to increase its overall stiffness and strength. This material is called Composite reinforced plastic.

Structural Design: Changing the aircraft structure from aluminum and titanium to new fiber reinforced composites can save up to 30 to 40% in weight. Aircraft structural designs are always limited by aerodynamic considerations. The new Boeing 787 is made up of more than 50% composite materials.

The shape of structures also affects aircraft weight. Common constructions to maximize usage of components include monocoque (shell-like structures)and semimonocoque(stiffened shells).

Aircraft Loading: Loading on aircraft generally fits into three main categories: axial, bending moment, and torsional loading. It is important to prevent concentrated loads on the main frame, which can lead to deflections. Manufacturers make use of stringers, ribs, and subframes to locally "collect" and distribute the loading along the frame. The wings and fuselage carry torsional and axial loads.

Lecture 5 - 9/5/08
Problem 1.1 - A rectangular thin-walled beam section is designed to carry both torque T and bending moment M. A fixed total wall contour length of L = 2(a+b) is given.

Find the optimum ration of (b/a) to achieve the most efficient M = T, and σ = 2τ. Shear stress due to torsion for a closed thin-walled section is τ = T / (2abt).

Note: t is very small for a rectangular thin-walled section. Since the cross section wall are very thin, we can assume shear stress distribution to be uniform along the wall

Assumptions:

 * 1) L = 2(a+b) = Constant
 * 2) The moment is equal to the torque, M = T
 * 3) σ = 2τ

T = TAB + TBC + TCD + TDA

Case 1: Assume σ reaches σ allowable

 * $$\displaystyle \sigma = \frac{M z}{I}$$

The shear flow in the thin walls can be represented by an equivalent force system or resultant. In this case the resultant, V, is:

V = T²/(2abt)

 * $$\displaystyle \tau = \frac{V}{T}$$

Therefore:

 * $$\displaystyle \tau = \frac{T}{2 a b t}$$

=Contributing Team Members HW 1= The following students contributed to this report:

Victoria Watlington EAS4200C.Fall08.Team12.Watlington.VGEAS4200C.Fall08.Team12.Watlington.VG 18:57, 17 September 2008 (UTC)

Steven Hepsworth Eas4200c.f08.team12.hepsworth 17:37, 17 September 2008 (UTC)

Brian Taylor Eas4200c.f08.team12.taylor 12:01, 19 September 2008 (UTC)

Melisa Gaar Eml4500.f08.group.gaar 00:25, 19 September 2008 (UTC)

title: User:Eas4200c.f08.team12.hepsworth/HW1


text:
User:Hillgentleman/consensus and the zeroth law of robotics

A community like wikiversity would ultimately/often face the problem on the meanings of "community", "consensus" and "community consensus". In Azimov's science fiction series "Foundation", R. Daniel Olivaw has faced a similar problem on the zeroth law of robotics and maintain for millenia a delicate balance in his positronic brain, which ultimately became so complex that it was unstable. Can we learn something from this analogy?


text:
User:Eml4500.f08.gravy.sms/HW1

Text strings, error messages, input
To enter a text string in MATLAB, use single quotes: s = 'This is a test' This will assign the text string ‘This is a test’ to the variable s.

To display a text string, use the function disp: disp('this message is hereby displayed');

To display an error message, use the function error: error('Sorry, the matrix must be symmetric'); This also will exit the M-file upon execution.

To prompt the user for input data, use the function input: iter = input('Enter the number of iterations: '); This will display ‘Enter the number of iterations’ and pause execution while the user inputs the data which is then data assigned to the variable iter.

Managing M-files
To keep MATLAB active while editing a file in order to avoid losing all variables, use the !-feature by inserting a ! before any system command: >> !ed rotate.m This will let you edit rotate.m using the local editor without exiting MATLAB.

See help dbtype and references given there for more concerning debbugging tools.

The following commands will duplicate system commands without the use of a !:

M-files must be in an accessible directory. Storing personal M-files in a subdirectory named Matlab in one’s home directory should work. For further information see the discussion of MATLABPATH in the User's Guide.

Comparing efficiency of algorithms: flops, tic, toc
There are two measure of algorithm efficiency: floating point operations (flops) performed and the elapsed time (tic and toc).

The MATLAB function flops keeps a running total of the flops performed.

To reset the flops count to 0, use the command fops(0), not flops=0. Do this at the beginning of the code, and then use the command fops at the end to get the fops count of the algorithm: fops (0); x=A\b; fops

The MATLAB functions tic and toc give the elapsed time between the two commands: tic; x=A\b; toc

However, on timesharing machines, elapsed time is not as reliable as flops at determining algorithm efficiency because the rate of execution is dependent on how busy the computer is at the time.

Output format
To control the format of the displayed output, use the following commands:

Once invoked, the chosen format remains in effect until changed.

To suppress most blank lines, use the command format compact. To reverse the format compact command, use format loose. These are independent of the other format commands.

title: User:Eml4500.f08.gravy.sms/HW1


text:
User:Boron.merkava

This policy complements Civility by addressing issues concerning respecting people (including both other Wikiversity participants and people you write about).

Respect people
Respect people and their desire for privacy. When discussing individuals or people, discuss their accomplishments or things they have done, rather than what you think of them as human beings. Only divulge or disclose information about other people fairly and responsibly after a notable, respected, responsible and sound public source has legitimately done so, or when legitimately published on Wikiversity by themselves. When in doubt, make sure that you make your intentions known to the people you wish to write about and get their permission before divulging or disclosing information. Be fair and responsible in your depictions of people, and allow other participants to reasonably balance your depictions with their own fair and responsible depictions of facts, opinions and theories. Be prepared to change your approach or what you've written if your sources update or retract information. Be careful to distinguish between what other people have said or done and your own interpretations. The reputation you save might be your own.

If you disrespect people or their privacy, your peers may ask you to be civil, respectful and to change your approach. If you continue to be disrespectful despite receiving sound advice from your peers to stop, you might be disqualified from participating in any Wikiversity activities.

title: User:Boron.merkava


text:
User:Eas4200c.f08.vqcrew.b

HW 2

Stringers
A stringer is a structural member of the airplane frame that provides longitudinal support to the aircraft. Stringers can be placed along the length of the fuselage, through the span of the wings or in the empennage of the airplane and are made of wood or metal. When coupled with ribs, stringers allow for stress to be transmitted evenly through the body of the plane and provide structural support to the aircraft skin. Generally, stringers number from 50 to 100 in the fuselage portion of the aircraft but when used in reduced numbers (less than 10) are sometimes referred to as longerons. Reducing the number of stringers results in a greater number of ribs necessary to provide the same structural support.

title: User:Eas4200c.f08.vqcrew.b


title: File:Arrows1.JPG


title: File:Arrows2.JPG


text: File:Arrowsfinal.jpg

title: File:Arrowsfinal.jpg


text:
User:Eml4500.f08.bike.mcdonald/homework report 1

 Restored after the submission deadline due to the use of a wrong namespace. Eml4500.f08.bike.mcdonald 21:27, 7 November 2008 (UTC)

Class Notes
This section will be used to summarize the class notes from August 25th - September 5, 2008 in EML 4500.

August 25th - 29th, 2008
Lectures are held at the University of Florida on Monday, Wednesday, and Friday from 4:05-4:55 PM in Florida Gym 270.

EML 4500 teaches the fundamentals of the finite element method used in the analysis of truss, beam, and solid structures. This semester, the course is being taught by Professor Loc Vu Quoc from the University of Florida Mechanical and Aerospace Engineering Department. The finite element method is taught through matrix algebra with the derivation of the stiffness matrix. Local and global coordinate systems are emphasized, as well as 3-D truss and beam structures and their linear stability. Coding and plotting is another area of interest in this course, as MATLAB programming will be used in order to solve many of the problems. Applications of the finite element method are discussed, as well as its uses in mechanical, aerospace, and biomedical engineering fields.

The text book that will be used throughout the semester is Finite Element Analysis with Mathematica and MATLAB Computations, written by M. Asghar Bhatti.

Students will be required to work in groups of 5 to 6 under a team name that is 4 to 6 characters long. Cooperative learning techniques will be used, and group member evaluations will be held at the end of the semester. These evaluations will directly impact the homework grade of that individual, approximately 31% of the overall grade. The rest of the student’s individual grade is comprised of 3 exams, each accounting for 23%.

Each group will be required to use Wikiversity in order to submit homework and projects. Each member must create his/her own personal class account where his/her portion of the work will be posted. Each members name and UFID number, as well as his/her Wikiversity class username, is to be submitted to the instructor on hard copy.

Homework and project load will be divided evenly among the team members at their discretion. Once each group member has completed his/her assigned task the assignment will be posted as a whole on the group leader’s user namespace. This should be done close to the homework deadline in order to keep other groups from stealing ideas or plagiarizing. Another safety concern is that users may change information on a students Wikiversity page. In order to prevent this type of fraud from occurring the student must save an archived version of the assignment and email that address, not the address of the updated page, to the TA.

Element Labeling
The class begins with an introduction to the nomenclature of element labeling. The figure is first drawn with all members, forces, and constraints in a global view. Each constraint is then labeled globally by an encircled number. The structure is typically numbered from left to right. Each element of the member is then labeled with a number enclosed in a triangle. The constraints are then removed and replaced with force arrows labeled as Rnx or Rny in the x and y axes respectively. The subscript n denotes the constraint node number of the global member.

Once all of the members, nodes, and reaction forces of the global member are fully labeled, a free body diagram for each member of the structure must then be drawn. The member labeled with its global member number within a triangle. The nodes are then labeled with a local node number inscribed within a square. The local reaction forces are then drawn in the x and y axes at each node. These internal forces are then labeled as fi(e) where the subscript i represents the degree of freedom (dof) of that node and the superscript e represents the element number. The displacement of each node is drawn just like the degree of freedom and labeled as di(e) with i representing the degree of freedom of that node and e represents the element number. The labeling nomenclature is illustrated below in a global (left) and local (right) view of a truss system.

Force-Displacement Relation
A simple 1-D spring element fixed at one end is used to illustrate the force-displacement (FD) relation. This relation is $$f=kd$$, where $$f$$ is the force applied to the spring, $$k$$ is the spring constant, and $$d$$ is the displacement of the spring from its natural position. The spring element can be seen below.

The relation also holds true for a spring with two free ends as seen below.

The FD relation determined by observing the spring in two ways. The first case is where the observer is sitting on node one, which appears to be stationary. The resulting equation is $$f_2=k(d_2-d_1$$). The second case with the observer on node 2 yields the equation $$f_1=k(d_1-d_2$$). The matrix of $$f=kd$$ for the above spring is presented below.

Steps to Solve Simple Truss Systems
1.     Global Picture

 * Structure level

 * Global dofs

 * o      Known part (fixed dof, constraints)

 * o      Unknown part (solved using finite element method)

 * Global forces

 * o      Known part (applied forces)

 * o      Unknown part (reactions)

2.     Element Picture

 * Element dof

 * Element forces

3.     Global FD relations

 * Element stiffness matrices in global coordinates

 * Element force matrices in global coordinates

 * Assembly of element stiffness and force matrices into global FD relation

4.     Elimination of known dofs to reduce the global FD relations

 * Stiffness matrix non-singular→inveritble

 * To be invertible unknown displacement dofs must be less than known dofs

5.     Compute element forces from known element stresses

6.     Compute reactions (unknown forces)

MATLAB Tutorial
This MATLAB tutorial is intended to introduce the basics of MATLAB to novice users. The information given has been adapted from MATLAB Primer, Third Edition, written by the late Professor Kermit Sigmon from the University of Florida Department of Mathematics.

Accessing MATLAB
Depending on the operating system and setup, MATLAB can be started by accessing an icon in a GUI or by typing  into the command line. To close MATLAB, the MATLAB commands  or   can be used.

Entering Matrices
MATLAB works only with matrices. There are a couple special case matrices though. A 1-by-1 matrix is read as a scalar, and any matrix with only one column or one row is read as a vector.

Matrices are entered into MATLAB in several possible ways. The first method is that a user will create a specific matrix. MATLAB has built in commands that will also create matrices. The final way to enter in a matrix is by using external files, using either another application, a data file, or another editor.

Matrices can be entered into MATLAB by the user in two ways: in one row using semicolons and spaces or several rows using line breaks and spaces. Both examples are shown below.

EDU>> A = [1 2 3; 4 5 6; 7 8 9]

A =

1    2     3     4     5     6     7     8     9

EDU>> B = [1 2 3 4 5 6 7 8 9]

B =

1    2     3     4     5     6     7     8     9

Matrix A was created using semicolons and spaces on one line. It is much easier and the most common way to create matrices. Matrix B was created using line breaks and spaces.

MATLAB also allows for the input of exponential and imaginary numbers. Exponential numbers can be entered using  as the power modifier. Matrix C shown below is an example of this. Imaginary numbers are entered in using  or   to indicate the imaginary part of a number. Imaginary numbers can be entered into MATLAB in two ways: creating a real matrix and an imaginary matrix as shown in matrix D or entering each number into the matrix with its real and imaginary parts as shown in matrix E. The examples are shown below. EDU>> C = [1.12e2 -2.23e-3; 4.39e-2 -9.45e3]

C =

1.0e+003 *

0.1120  -0.0000    0.0000   -9.4500

EDU>> D = [1 2; 3 4] + i*[6 7; 8 9]

D =

1.0000 + 6.0000i  2.0000 + 7.0000i 3.0000 + 8.0000i  4.0000 + 9.0000i

EDU>> E = [1+6i 2+7i; 3+8i 4+9i]

E =

1.0000 + 6.0000i  2.0000 + 7.0000i 3.0000 + 8.0000i  4.0000 + 9.0000i Matrices D and E are equal, showing that both methods are effective when entering in imaginary numbers. If variables  and   are overwritten, either imaginary modifier can be reentered using the command   or.

Matrices created in an outside editor or application can be loaded with the  command. If data is in a file named matrix.ext, where .ext is the extension, the data will be loaded into MATLAB using the command. MATLAB will read the file and then create a variable named.

MATLAB has three built-in commands that will create special matrices. The three commands are,  , and.

The  command creates a matrix with numbers randomly generated between 0 and 1. It can be used with a positive integer  to create a square matrix with the command   shown below in Matrix F or with two positive integers   and   to create a   matrix using the command   shown below in Matrix G.

EDU>> F = rand(2)

F =

0.9355   0.4103    0.9169    0.8936

EDU>> G = rand(3,4)

G =

0.0579   0.0099    0.1987    0.1988    0.3529    0.1389    0.6038    0.0153    0.8132    0.2028    0.2722    0.7468

The magic matrix is a special matrix in which each of the rows, columns, and diagonals have the sum. This matrix is required to be a square matrix. This matrix can be generated in MATLAB with the command. An example is shown below in matrix H.

EDU>> H = magic(4)

H =

16    2     3    13     5    11    10     8     9     7     6    12     4    14    15     1

The final special matrix command creates a Hilbert matrix. The Hilbert matrix is a positive and symmetrical matrix and its elements are unit fractions. It can be generated with the command. An example is shown below in matrix I.

EDU>> I = hilb(4)

I =

1.0000   0.5000    0.3333    0.2500    0.5000    0.3333    0.2500    0.2000    0.3333    0.2500    0.2000    0.1667    0.2500    0.2000    0.1667    0.1429

Matrix operations, array operations
The table below shows all the matrix operations available in MATLAB.

These operators can be applied to either scalars or matrices. If the sizes of the matrices are not correct for a certain operation, MATLAB will output the error "" where command is the corresponding operation.

The operations of division, multiplication, and power are not entry-wise operators. These matrix operators are applied to the whole matrix instead of a single entry, unlike addition and subtraction. To use one of the matrix operators in an entry-wise situation a. must be placed in front of the operator. This is shown in the power example shown below.

EDU>> [1 2 3 4].^2

ans =

1    4     9    16

Statements, expressions, variables; saving a session
MATLAB is written in a code that works with expressions. An equal sign,, is not required to carry out a command, but will assign a variable to the data. If the equal sign  is omitted, MATLAB creates a variable named   to save the data. This variable will be overwritten every time a variable is not defined in a command statement.

If a semicolon is placed at the end of a command statement, MATLAB will not display the entered data and just save it to a variable. This is useful when entering large amounts of data that do not need to be displayed after each command.

Variables are case sensitive in MATLAB. The variables  and   are not completely different variables. Since a large amount of variables can be created in MATLAB, the command  or   can be used to see all active variables. If the user wants to remove a variable, the  command can be used. To eliminate the variable  the user would use the command statement.

When a user exits MATLAB all the variables are cleared from memory. If a user wants to save the variables for future use, the command  can be used. This command forces MATLAB to write all the variables to a file named  which can be accessed later. To load the variables back, the command  restores the variables.

If a command statement is in an unending loop or is taking too long to process, the break command can be used to stop all MATLAB activity without exiting MATLAB. This can be done using.

Matrix building functions
The following table lists some built-in commands that can be used to build matrices in MATLAB.

These commands can be combined to build a matrix. Some of the commands can extract data from other matrices, such as the command. This will build a matrix of zeros the size of matrix A. An example of several commands being utilized to build a matrix can be seen below in matrix J.

EDU>> A = magic(3); EDU>> J = [A, zeros(3,2); zeros(2,3), eye(2)]

J =

8    1     6     0     0     3     5     7     0     0     4     9     2     0     0     0     0     0     1     0     0     0     0     0     1

For, while, if — and relations
The basic MATLAB flow control statements,   and   are very similar in operating nature to those in most computer languages.

For
When using  it is possible to produce vectors and matrices of useful information. In the example below, a  is used to produce an  -vector for a given.

x = []; for i = 1:n, x=[x,i^2], end

The example below will also produce an -vector with a given.

x = []; for i = 1:n x= [x,i^2] end

In the next example, the  produces the same  -vector, but in reverse order.

x = []; for i = n:-1:1, x=[x,i^2], end

In a more intricate example, below is a  that produces a  -by-  Hilbert matrix. A -by-  Hilbert matrix is a matrix whose elements are made up the unit fractions

$$ H_{mn} = \frac{1}{m+n-1} $$

The example is shown below. for i = 1:m for j = 1:n H(i,j) = 1/(i+j-1); end end H

This example not only produces the -by-  Hilbert matrix, it prints it to the screen as well. The reason it prints it to the screen is because of the last H. This H at the end of the two  loops will allow the printing of the final result. The statement located in the loops has a semicolon in order for it to not print to the screen. Therefore, instead of every intermediate step being printed to the screen, only the final result is printed.

If it is desired to use any matrix instead of, the next example is used. This example is shown below. s = 0; for c = A     s = s + sum(c); end

This example adds the column sums of  in order to sum all the entries of.

While
The general form of the  loop has two important elements, the relation and the statements. The general form is shown below. while relation statements end

In this general form, the statements will be executed until the relation is no longer true. An example is shown below. n = 0; while 2^n < a     n = n + 1; end n

In this example, given a number a, the  loop will continue to execute the statement   until the relation   is no longer satisfied. This will display the smallest integer n that will satisfy.

If
The general form of an  statement is made up of the same two components as the   loop, the relation and the statements. The general form is shown below. if relation statements end

For the  statement, the statements will be executed only if the relation is true. Multiple branching is possible with the use of different types of  statements such as the   and the   statement. An example with this branching is shown below. if n < 0 parity = 0; elseif rem(n,2) == 0 parity = 2; else parity = 1; end

In this example, if the relation  is satisfied, then it executes the statement. If the relation  is satisfied, then the statement that is executed is. If none of those relations are satisfied, the statement  is executed.

Relations
The relational operators in MATLAB are very important to know. These relational operators are shown below.

It is important to note the difference between an assignment statement and the  relation. In an assignment statement a  is used, while in a relation the   is used. Also, multiple relations can be utilized and either connected or quantified by the logical operators shown below.

Relations can be applied to scalars as well, but in this case the relations themselves are the scalars 1 or 0, depending on whether they are true or false. In the example below, it shows the simple relations between scalars and the corresponding answer.

>> 3 < 5  ans = 1

>> 3 > 5  ans = 0

>> 3 == 5  ans = 0

When applying relations to same size matrices, each element is compared to the other in the same location within the matrix, and a 1 or 0 will appear in that location, depending on whether it is true or false. An example of this is shown below. >> a=rand(5) a = 0.8147   0.0975    0.1576    0.1419    0.6557       0.9058    0.2785    0.9706    0.4218    0.0357       0.1270    0.5469    0.9572    0.9157    0.8491       0.9134    0.9575    0.4854    0.7922    0.9340       0.6324    0.9649    0.8003    0.9595    0.6787

>> b=triu(a) b = 0.8147   0.0975    0.1576    0.1419    0.6557            0    0.2785    0.9706    0.4218    0.0357            0         0    0.9572    0.9157    0.8491            0         0         0    0.7922    0.9340            0         0         0         0    0.6787

>> a==b ans = 1    1     1     1     1        0     1     1     1     1        0     0     1     1     1        0     0     0     1     1        0     0     0     0     1

When using  and , the relation between matrices is interpreted to be true only if the relation between each and every element is true. If it is desired to execute a statement only if matrices A and B are equal, then the it is typed as shown below. if A == B     statement end

On the other hand if it is desired to execute the statement when matrices A and B are not equal, then it is typed as shown below. if any(any(A ~= B)     statement   end

or if A == B else statement end

It is important to note that typing it as shown below if A ~= B     statement end

will not give the desired results because this is saying that every corresponding element of A and B differ from each other. The desired result is if A and B are different, which means that even if only one corresponding element of A and B are different. In the above example, the functions  and in other cases   can be used to reduce matrix relations to certain scalars or vectors.

Scalar functions
When using scalars, there are come MATLAB functions that operate essentially on them. When applied to matrices, however, they operate element-wise. The most commonly used functions are sin              asin               exp               abs               round cos              acos               log (natural log) sqrt              floor tan              atan               rem (remainder)   sign              ceil

Vector functions
When using vectors, there are come MATLAB functions that operate essentially on them. These functions work only on -by-  matrices by acting on each column and thus producing a row vector with the results of each column. By using the transpose of the matrix, the functions would be working row by row. Some of the functions are: Max              sum               median               any min              prod              mean                 all sort             std

An example of how one of these functions work is shown below. With the matrix A, when using the  function, a row vector showing the maximums of every column is shown. The way to get the maximum of matrix, you would have to type. >>A = 1    2     3     4        1     2     3     5        6     1     2     3        7     1     3     4

>> max(A) ans = 7    2     3     5

>> max(max(A)) ans = 7

Matrix functions
MATLAB's most important functions are matrix functions, these are the ones that give MATLAB most of its power. The most practicable are:

MATLAB functions in general may have single or multiple output arguments. In the example below, there are two different output arguments for one function,. A = 1    2     3        3     6     2        2     8     5

EDU>> Y=eig(A) Y = 11.0530               0.4735 + 1.5196i 0.4735 - 1.5196i

EDU>> [U,d]=eig(A) U = 0.3376            0.7002             0.7002                0.5128            -0.3368 - 0.2912i  -0.3368 + 0.2912i 0.7893            0.1016 + 0.5488i   0.1016 - 0.5488i d = 11.0530                 0                  0                     0             0.4735 + 1.5196i        0 0                 0             0.4735 - 1.5196i

Command line editing and recall
The MATLAB command line can be edited in several ways. The cursor is moved with the left and right arrows on the keyboard, and the backspace key deletes the character to the left of the cursor. Characters can also be deleted using the Home, End or Delete keys. The up and down arrows, on the keyboard, are used to scroll through previous commands.

A command line can be changed and rerun by scrolling up to, editing, and then executing the previous command. The plots of y=sin(mx) and y=sin(nx) from the range of 0 to 2π can be compared easily by editing the (mx) to (nx) in the following command line:

""

Submatrices and colon notation
Colon notation is used in MATLAB to generate vectors and reference submatrices. Colon notation also reduces the use of loops and simplifies codes.

The expression 1:4 is a row vector [1 2 3 4]. Neither the vector numbers nor the increment have to be integers. The example,

yields the vector

To count down, a negative sign is used in the vector notation.

yields

Colon notation is also used to recall submatrices within a matrix. An example

is a column vector made up of the first three values in the second column of the matrix.

A lone colon calls an entire row or column:

is the entire second column of the  matrix. Vectors can be used within colon notation to recall multiple columns.

recalls the entire columns two and five of the matrix.

Columns can be replaced in one matrix from another using colon notation for Example,

replaces columns two, three, and five in matrix  with columns two, three, and four from matrix.

M-files: script files, function files
MATLAB can run a sequence of statements that are stored in disk files, called “M-files.” M-files end with “.m” in the filename and are usually created with a local editor. The two types of M-files are script and function files.

Script files
Script files contain normal sequences of MATLAB statements. The file  will be run in MATLAB by imputing the command. Variables in the M-file are global and will replace the values of same named variables in the MATLAB environment.

Script files also allow for large matrices to be entered and corrected easily. A matrix can be input, for example, by entering diskfile data.m

A = [ 1 2 3 4 5 6 ];

Running the MATLAB command data will cause the matrix A to be created and stored in the MATLAB environment. An M-file can call on other M-files, or it can run itself repeatedly.

Function files
Function files allow for the creation of new functions that do not exist in MATLAB already, needed for a specific problem. Function variables are set as local variables by default.

An example of a function file:

function a = (sin(m))^(-1) %INVSIN computes inverse sin. % invsin(m) returns inverse sin
 * A = 10*invsin(m);

This example should be in a diskfile named  due to the function name. The first line declares the function name, input arguments, and output arguments. Without the first line the function file would be a script file. A MATLAB command  will pass the value 45 into the variables m in the function file, and the output will be put into variable A.

The  symbol is used for note making in an M-file. The symbol tells MATLAB to skip the rest of the line. Comments should always be used in M-files to describe the function.

Loops can be made to run faster by preallocating output vectors or matrices. An example of this can be seen in the second line of the for loop where the matrix E is made one column larger for each iteration.

F = fun(6); D = zeros(6,50); For j = 1:50
 * D(:,j) = det(F^i);
 * End

Most of the MATLAB functions are built into the software, but some are M-files. To see a listing of any non built in M-file the MATLAB command type must be run.

Text strings, error messages, input
Text strings are inserted into MATLAB by surrounding the text with single quotes as shown below.

""

Typing this line in the MATLAB command window will assign the text string,, to the variable.

The MATLAB function  can be used to display various text strings. Two equivalent uses of this function are shown below.

disp('This is a text string') disp(a)

Displaying text strings can be used for many purposes, one of which is to display warnings or comments during the execution of M-files. In order to display errors during M-files, the  command is preferable. This is because the  command will abort the execution of the M-file. Proper implementation of the  command is shown below.

error('ERROR: Incorrect value!')

As with the  command, an identical implementation of the   command used above can be performed by assigning the text string to a variable and using that variable as the argument to the   command as shown below.

b = 'ERROR: Incorrect value!' error(b)

By using the  command in an M-file script, the execution of that M-file will pause while the prompting the user to input desired data. An example of a use of the  command is shown below.

""

When this line of code is reached in the M-file, the execution will pause while the prompt message is displayed on the screen. Once the user enters the desired data and presses the return key, the value entered will be assigned to the variable  and the M-file execution will continue.

Managing M-files
When working with an M-file in the local editor of MATLAB, often times it becomes necessary to switch back to the command window. In order to perform this maneuver, the command window must be kept active because if not, all of the variables would be lost in the switching process. A simple method for keeping the MATLAB command window open uses the !-feature. Placing a ! before any system command allows the user to fully execute that command without exiting the command window. An example of the !-feature is shown below.

""

In the above example, the file  will be opened, allowing the user to edit the M-file. Once  is closed, the user will be returned to the MATLAB command window exactly as it was left when the !-feature was used.

It is important to note that many operating systems permit multiple processes. In this case, it is much more efficient and user-friendly to simply open the local editor in a separate window than that of the command window. In this case, both windows can be left active, thus removing the risk of losing data stored in variables.

While editing M-files, debugging is a very important process that ensures code functionality. In order to debug an M-file with a filename of, the following syntax should be used.

dbtype file dbtype file start:end

In this example,  and   are user-specified line numbers in the M-file to debug between.

In order to determine the working directory at any time, use the  command as shown below.

>> pwd

To change the working directory, use the  command as shown below.

>> cd

Typing  or   in the command window as shown below will cause MATLAB to list the contents of the working directory.

>> dir >> ls

If it is desirable to only know which M-files exist in the working directory, the  command can be used as shown below.

>> what

In order to print the text of an M-file named  to the screen of the command window, the   command can be used as shown below.

>> type file.m

To delete an M-file named  from the disk, the   command can be used as shown below.

>> delete file.m

In order to work with M-files in MATLAB, the M-files must be located in a directory accessible to MATLAB. The easiest choice for directories is always the working directory, which is always accessible to MATLAB. To view a list of directories that are accessible to MATLAB, use the  command as shown below.

>> path

To add a new directory (e.g. ) to the list of directories accessible to MATLAB, use the variation of the   command shown below.

>> path(path,'c:\personal\mfiles')

Comparing efficiency of algorithms; flops, tic, toc
There are two ways in MATLAB to determine the efficiency of a given algorithm, the first being the amount of floating point operations (flops) performed and the second being the elapsed time from start to finish. To determine the amount of flops performed during an algorithm, the MATLAB function  can be used. For example, in order to count the number of flops performed in solving the linear system, $$F=ma$$, the proper implementation of the flops function is shown below.

flops(0), F=m*a; flops

is used prior to the start of the algorithm in order to set the count of flops to zero.

In order to determine the amount of time elapsed during the completion of the same algorithm, the functions  and   act as a stopwatch, with   being the start of the timer and   stopping the timer and displaying the elapsed time. The proper implementation of the functions  and   with the linear system, $$F=ma$$ is shown below.

tic, F=m*a; toc

It is important to note that using the elapsed time to determine the efficiency of an algorithm is not always accurate. This is due to the fact that the rate of execution of an algorithm is dependent on how busy the computer is with other processes at the time.

Output format
Although all calculations performed in MATLAB are carried out using double precision, it is possible to modify the format that is output to the command window using the following commands.

Once one of the output format commands are chosen, they remain in place until changed again by the user.

In order to fit more content on a page, the command  will remove most blank lines from the command window. The proper implementation of this command is shown below.

To reverse the compression caused by the command, use the command   as shown below.

Hard copy
Hard copy is a text-only format of the command window. The easiest way to access the hard copy format of the processes run in the MATLAB command window is to use the  command. Two proper usages of the  command are shown below.

>> diary file >> diary

The first example will save the hard copy format of the command window under the filename file in the working directory. The second example will save the hard copy format to the default filename of diary in the working directory. When the  command is invoked, it will record all text in the command window until the user types the   command. If the user would like to continue recording at a later time after the  command has been used, the   command needs to be entered in the command window.

Graphics
With MATLAB, the user can produce plots of planar curves, 3-D curves, 3-D mesh surfaces, and 3-D faceted surfaces. This section deals with each of these different plots, using the commands,  ,  , and  , respectively. The reader is encouraged to try the provided MATLAB to see the plots.

The 2-D Plot
First, the  command is demonstrated by graphing a sine function over the interval -4 to 4 as follows:

>> x = -4:.01:4; >> y = sin(x); >> plot(x,y)

This will produce a sine curve.

For another example, the graph $$y = e^{-x^2}$$ is produced over the interval -1.5 to 1.5 as follows:

>> x = -1.5:.01:1.5; >> y = exp(-x.^2); >> plot(x,y)

The period precedes the ^ in order to perform entry wise operations on the  vector.

The Figure Command
The command  can be used to produce an empty figure if the user desires. The most recently created figure will be considered the current figure by MATLAB, unless the user selects a different figure. This is done by typing the command, with the 1 designating the first created figure to be the one made current. The command  is used to return the number of the current figure.

The Fplot Command
If an M-file of a function has already been created, the command  can be used to quickly plot the graph of that function. As an example, one can create the M-File, with the contents of that function as follows:

function y = expnormal(x) y = exp(-x.^2);

Once this is saved, then typing

>> fplot('expnormal', [-1.5,1.5])

In the workspace will produce the same results as obtained in the  section above.

Parametrically Defined Curves
Plots of parametrically defined curves can be made as follows:

>> t = 0:.001:2*pi; x = cos(3*t); y = sin(2*t); plot(x,y)

Graph Labels
The following is a list of commands which take a string as their argument and the effect the command has on the current plot.

An example is:

>> title('Best Least Squares Fit')

Which will give the title  to the current plot.

To produce grid lines on the graph, the command  is used.

Changing Scales on Axes
While MATLAB auto-scales the axes, sometimes it is desired to customize the scales. This is done by using the following commands:

These commands are only valid after a plot is produced.

Producing Multiple Graphs on One Plot
One way of putting multiple graphs on one plot is as follows:

>> x = 0:.01:2*pi; y1 = sin(x); y2 = sin(2*x); y3 = sin(4*x); plot(x,y1,x,y2,x,y3)

This produces three sine waves on one plot. Another way to produce the same result is:

>> x = 0:.01:2*pi; Y = [sin(x)', sin(2*x)', sin(4*x)']; plot(x,Y)

Also, typing the command  will freeze the current graph so that another one can be entered on top of it, typing   will release the hold.

Line Types and Colors
There are many different line types and colors that can be used in MATLAB. They are as follows:

Line types: solid, dashed , dotted , dashdot Mark types: point, plus , star, circle, x-mark

Colors are chosen as follows:

Colors: yellow, magenta , cyan , red , green , blue , white , black

Thus, if a user wants a plot with a red dashed line, the command,

>> plot(x,y,'r--')

Should be used.

Specialized Commands
The  command will partition the plot screen into several small plots so that they can be seen all at once in the same figure, but on different plots. Other less used 2-D plotting functions are:,  ,  ,  ,  ,  ,  ,.

The 3-D Plot
The command  is used to produce 3-D curves in MATLAB. It works in basically the same way that the  command works for 2-D graphs.

A quick example of producing a 3-D plot follows:

>> t = .01:.01:20*pi; x = cos(t); y = sin(t); z = t.^3; plot3(x,y,z)

This produces a helix whose points are all the elements of x, y, and z. The vectors passed into the  command must all be the same length to work properly.

3-D Mesh and Surface Plots
3-D wire meshes are produced with the command  with   being a 2 dimensional matrix. An example is as follows:

>> mesh(eye(10))

The mesh surface is defined by the elements in the 2 dimensional matrix equaling the  coordinates of the mesh. Surface plots are similarly created with the command  as follows:

>> surf(eye(10))

To draw a mesh over a rectangle such as a graph of $$z = e^{-x^2 - y^2}$$ over the square  x , the following procedure is used:

>> xx = -2:.2:2; >> yy = xx; >> [x,y] = meshgrid(xx,yy); >> z = exp(-x.^2 - y.^2); >> mesh(z)

All 2-D formatting commands work for 3-D plots, so please reference that section.

Color and Shading
Color shading of 3-D plots is done using the  command. These are set by typing either:

,, or

Into the workspace, with a shading of faceted, interpolated, or flat being the result. The user is encouraged to experiment with all three in order to find which fits the graph best.

The color of the surface can be set with the  command, with the input argument being one of:

(default),,  ,  ,  ,  ,  ,  ,

Thus, the command  will result in a pink colormap.

Parametrically Defined Surfaces
The M-File below gives an example of how to plot a parametrically defined 3-D function:

function [x,y,z] = torus(r,n,a) % torus(r,n,a) generates a plot of a torus with a central % radius a and lateral radius r. n controls the number % of facets on the surface. These input variables are optional % with defaults r = .5, n = 30, a = 1. %    % [x,y,z] = torus(r,n,a) generates three (n+1)-by-(n+1) % matrices so that surf(x,y,z) will produce the torus. %    % See also SPHERE, CYLINDER if nargin < 3, a = 1; end if nargin < 2, n = 30; end if nargin < 1, r = .5; end theta = pi*(0:2:n)/n; phi = 2*pi*(0:2:n)'/n; xx = (a + r*cos(phi))*cos(theta); yy = (a + r*cos(phi))*sin(theta); zz = r*sin(phi)*ones(size(theta)); if nargout == 0 surf(xx,yy,zz) ar = (a + r)/sqrt(2); axis([-ar, ar, -ar, ar, -ar,ar]) else x = xx; y = yy; z = zz; end

Sparse Matrix Computations
Matlab has many functions that can speed up computation time if they are used when a matrix is sparse, in other words, many of the entries are zero. To demonstrate the matrix:

>> F = floor(10*rand(6)); F = triu(tril(F,1),-1);

is created. Next the statement:

>> S = sparse(F)

is used to convert  into sparse mode. This statement also returns the nonzero entries of  since the output is not suppressed.

>> F = full(S)

restores  to full storage, and the function   can be used to check whether a matrix is sparse or full.

However, sparse matrices are usually generated directly rather than through the sparse function. For example, a sparse tridiagonal matrix is created as shown below:

>> m = 6; n = 6; e = ones(n,1); d = -2*e; >> T = spdiags([e,d,e],[-1,0,1],m,n)

T =

(1,1)      -2       (2,1)        1       (1,2)        1       (2,2)       -2       (3,2)        1       (2,3)        1       (3,3)       -2       (4,3)        1       (3,4)        1       (4,4)       -2       (5,4)        1       (4,5)        1       (5,5)       -2       (6,5)        1       (5,6)        1       (6,6)       -2

Sparse Analogs
The sparse analogs of full matrix functions are as follows:

Operations With Sparse and Full Matrices
Since MATLAB's default storage is full matrix, if a sparse and full matrix are operated on together (such as in ), MATLAB will return a full matrix.

If the only matrices involved in the operation are sparse, the resulting matrix will be stored as sparse.

Contributing Team Members
The following students contributed to this report:

Andrew McDonald - Eml4500.f08.bike.mcdonald 22:11, 16 September 2008 (UTC)

Samuel Bernal - Eml4500.f08.bike.bernal 22:16, 16 September 2008 (UTC)

Shawn Gravois - Eml4500.f08.bike.gravois 22:22, 16 September 2008 (UTC)

Garrett Pataky - Eml4500.f08.bike.pataky 22:36, 16 September 2008 (UTC)

Eric Viale - Eml4500.f08.bike.viale 23:43, 16 September 2008 (UTC)

Bobby Sweeting - Eml4500.f08.bike.sweeting 19:38, 18 September 2008 (UTC)