User:Eml4500.f08.gravy.JMT

HW1
19. Sparse Matrix Computations

There are two storage modes in Matlab for a matrix: full and sparse. Full mode stores everything, while sparse only stores nonzero numbers. The default is to store elements of a matrix in full mode. In full mode, the zero elements are taken into account during calculations. Sparse mode will remove these zero elements during calculations, thus reducing time spent performing them. It saves time, but still outputs the same numbers.

Matrices can be converted between sparse and full fairly easily. The command “S=sparse(F)” will convert the full matrix, F, to a sparse matrix, S. It can then be converted back from sparse to full using the command "F=full(S)”.  Usually though, if a sparse matrix is desired, it will be created directly rather than by converting from a full matrix.  There are sparse analogs to many full matrices.  The fuctions speye, sparse, spones, and sprandn are sparse analogs to the full functions eye, zeros, ones and randn respectively.

When performing calculations using both full and sparse matrices, the storage mode of the output will vary. If calculations are performed on only sparse functions, the output will be sparse. If calculations are performed only on full functions, the output will be full. However, if calculations are performed using both full and sparse functions, the output will always come out as full unless the user specifically states otherwise.

HW2
What is K-1?

$$\ det(\underline{K}) = K_{33} * K_{34} - K_{34} * K_{43} $$

$$ \underline{K^{-1}} = \frac{1}{det(\underline{K})} * \begin{bmatrix} K_{44} & -K_{34} \\ -K_{43} & K_{33} \end{bmatrix}$$

Result on 2-Bar Truss System:

$$\begin{Bmatrix} d_3 \\ d_4 \end{Bmatrix} = \underline{K^{-1}} \begin{Bmatrix} 0 \\ P \end{Bmatrix}$$

$$\begin{Bmatrix} d_3 \\ d_4 \end{Bmatrix} = \begin{bmatrix} 0.7681 & -0.6217 \\ -0.6217 & 0.8753 \end{bmatrix} * \begin{Bmatrix} 0 \\ P \end{Bmatrix} = \begin{Bmatrix} 4.352 \\ 6.1271 \end{Bmatrix} $$

Complete Reactions

Methods 1: Force Displacement Relations

$$ k^{(e)}d^{(e)} = f^{(e)}, e = 1,2 $$

Element 1 (e=1)

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

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

Element 2 (e=2)

$$K^{(2)} d^{(2)} = f^{(2)} $$

$$d^{(2)} = \begin{bmatrix} 4.352 \\ 6.1271 \\ 0 \\ 0 \end{bmatrix} $$

Matlab Code for 2 Bar Truss System
A two bar truss system can be modeled using Matlab. The following is an example, as written on Dr L. Vu-Quoc's website.

HW3
Knowing that the angle to find x_b and y_b is 30 degrees, and to find x_c and y_c is 135 degrees, we can use simple trigonometry to solve for the values:

$$ x_i = L*cos(\theta), yi = L*sin(\theta)$$

$$x_b = AC*cos(30)= 6.8324 * cos(30) = 5.9170, y_b = AC*sin(30) = 6.8324 * sin(30) = 3.4162$$

$$x_c = AB*cos(135) = 1.0249 * cos(135) = -.7247, y_c = AB*sin(135) = 1.0249 * sin(135) = .7247$$

(xb,yb) = (5.9170, 3.4162) (xc,yc) = (-0.7247, 0.7247)

To find x_d and y_d, the following equation is used:

$$\vec{AD} = x_d\vec{i}+ y_d\vec{j}$$

From HW2, we know that:

$$\vec{AD} = d_3\vec{i} + d_4\vec{j}$$

Also from HW2, we know that d3=4.352 and d4=6.1271. This means that:

$$\vec{AD} = 4.352\vec{i} + 6.1271\vec{j}$$

hence, (xd,yd) = (4.352, 6.1271).

HW6
Prove $$u*x_{i+1}=d_{i+1}$$

$$ u*x_{i+1}= N_i*x_{i+1}*d_i + N_{i+1}*x_i*d_{i+1} $$

Given: $$ N_i*x_{i+1} = 0 $$ $$ N_{i+1}*x_{i} = 1 $$

So, $$ u*x_{i+1} = (0)*d_i + (1)*d_{i+1} $$

$$ u*x_{i+1} = d_{i+1} $$