User:Eml5526.s11.team4.rhee/HW2

= Problem 2.2 =

Problem Statement
Consider

Orthonormal basis

Repeated index


 * 1. Find $$ det[b_{jk}] $$


 * 2. Find $$ \mathbf{\Gamma(b_{1},b_{2},b_{3})}=\mathbf{K},\quad det(\mathbf{\Gamma}) $$


 * 3. Find $$ \mathbf{F}=\left\{F_{i}\right\}=\left\{\mathbf{b}_{i}\cdot \mathbf{v}\right\} $$


 * 4. Solve (2-4) for $$ \mathbf{d}=\left\{ v_{j} \right\} $$


 * 5. Use $$ \mathbf{w}_{i}\cdot \mathbf{\mathbb{P}(v)}=0 $$ to find (2-5). What is $$ \vec{\mathbf{K}} $$ and $$ \vec{\mathbf{F}}? \quad \mathbf{d}=\left\{ v_{j} \right\} $$


 * 6. Solve for $$ \mathbf{d} $$ ; Compare to $$ \mathbf{d} $$ in problem 4.


 * 7. Observe symmetry property of $$ \mathbf{K} $$ and $$ \vec{\mathbf{K}}. $$ Discuss pros and cons of 2 methods.(2-4 & 2-5)

Question 1
The determinant of a 3 x 3 matrix using MATLAB ($$\textbf{Ans:} det[b_{jk}]=-8$$)

 Matlab Code 

 Result 

Question 2
From lecture slide 7-2,

Gram matrix $$ \mathbf{\Gamma(b_{1},b_{2},b_{3})}=\mathbf{K}_{ij}=\mathbf{b_{i} \cdot b_{j}}, \quad i,j=1,2,3 $$

where


 * $$ \mathbf{b_{1}}=\begin{bmatrix}1 & 1 & 1\end{bmatrix}, \mathbf{b_{2}}=\begin{bmatrix}2 & -1 & 3\end{bmatrix}, \mathbf{b_{3}}=\begin{bmatrix}3 & 2 & 6\end{bmatrix} $$
 * }
 * }

Therefore,

And the determinant of $$ \mathbf{\Gamma} $$ is 64.

 Matlab Code 

 Result 

Question 3
$$ \mathbf{F}=\left\{F_{i}\right\}=\left\{\mathbf{b}_{i}\cdot \mathbf{v}\right\} $$

where
 * $$ \mathbf{v}=5\mathbf{a}_{1}-7\mathbf{a}_{2}-4\mathbf{a}_{3} $$

$$ F_{1}=\mathbf{b}_{1}\cdot \mathbf{v}=(\mathbf{a}_{1}+\mathbf{a}_{2}+\mathbf{a}_{3})\cdot (5\mathbf{a}_{1}-7\mathbf{a}_{2}-4\mathbf{a}_{3}) $$

Likewise, we can obtain a $$ \mathbf{F} $$.

Question 4
Now, we know $$ \mathbf{K} $$ and $$ \mathbf{F} $$ according to problem 2 & 3. So, we can get a $$ \mathbf{d} $$

 Matlab Code 

 Result 

Now, we can obtain $$ \vec{\mathbf{K}}, \vec{\mathbf{F}} $$ and $$ \mathbf{d} $$ the same as above procedure.

Question 5
From lecture slide 7-2,4,

$$ \vec{\mathbf{K}}=\left[K_{ij}\right]=\mathbf{w}_{i}\cdot \mathbf{b}_{j} = \mathbf{a}_{i}\cdot \mathbf{b}_{j} $$

where
 * $$ \mathbf{w}_{i}=\mathbf{a}_{i}, \qquad \mathbf{b}_{1}=\mathbf{a}_{1}+\mathbf{a}_{2}+\mathbf{a}_{3}, \quad \mathbf{b}_{2}=2\mathbf{a}_{1}-\mathbf{a}_{2}+3\mathbf{a}_{3}, \quad \mathbf{b}_{3}=3\mathbf{a}_{1}+2\mathbf{a}_{2}+6\mathbf{a}_{3} $$

From equ(2-5) and using equ(2-1)

$$ \vec{\mathbf{F}}=\left\{F_{i}\right\}=\left\{\mathbf{a}_{i}\cdot \mathbf{v}\right\} $$ So,

Question 6
$$ \mathbf{d}=\vec{\mathbf{K}}^{-1}\vec{\mathbf{F}} $$

 Matlab Code 

 Result 

Question 7
We can observe that $$ \mathbf{K} $$ is Symmetric and $$ \vec{\mathbf{K}} $$is Nonsymmetric.

= Problem 2.9 =

Solution
From lecture slide

1. $$ \mathbf{b}=\left\{b_{j}, j=0,1,2\right\}=cos(jx+\phi) $$


 * $$ \mathbf{d}=\left\{d_{j}, j=0,1,2\right\} $$

2. Ess. b.c.:


 * $$ u^{h}(x)|_{\Gamma _{g}}=g \Rightarrow \sum_{j=1}^{n}d_{j}b_{j}(x)|_{\Gamma _{g}}=g $$

Nat. b.c.:


 * $$ \frac{\partial u^{h}(x)}{\partial x}n(x)|_{\Gamma _{h}}=h \Rightarrow \sum_{j=1}^{n}d_{j}{b}'_{j}(x)|_{\Gamma _{h}}=-hn(x) $$

3. From lecture slide

4. $$ \mathbf{K}\mathbf{d}=\mathbf{F} $$ From lecture slide 10-4 & 10-5,


 * $$\mathbf{K}_{ij}=\int_{\Omega }b_{i}(x)\left[\frac{\mathrm{d} }{\mathrm{d} x}\left(a_{2}(x)\frac{\mathrm{d} }{\mathrm{d} x}b_{j}(x)\right)\right]dx $$


 * $$ \mathbf{F}_{i}=-\int_{\Omega}b_{i}(x)f(x)dx$$

where
 * $$ a_{2}=2, \quad f=3 $$

= Cont'd (team wiki) =

Matrix Form
There are now three equations for three unknowns which can be expressed in matrix form.

$$ \begin{align} \begin{bmatrix} cos(\phi) & \cos(\phi+1) & \cos(\phi+2)\\ 0 & \sin(\phi) & 2\sin(\phi)\\ 0 & 2\left\{sin(\phi+1)-sin(\phi)\right\}cos(\phi) & 8(\phi+1)cos(\phi) \end{bmatrix}\begin{bmatrix}d_0\\d_1\\d_2\end{bmatrix}=\begin{bmatrix}0\\4\\3cos(\phi) \end{bmatrix} \end{align} $$

$$ \mathbf{K} $$ is not symmetric.

$$ \phi = \pi/4 $$
Solving the system for $$ \phi = \pi/4 $$

$$ \begin{bmatrix}d_0\\d_1\\d_2\end{bmatrix}=\begin{bmatrix}1.7007\\ 5.6651\\ -0.0041\end{bmatrix} $$


 * Exact solution: $$ u(x) = \frac{-3}{4}x^2-4x+\frac{19}{4} $$