User:Eml5526.s11.team01/Hwk2

=Problem 1=

Given
An elastic bar with a cross section A(x)

Find
Derive heat problem equation from Lecture Slide Mtg.6
 * {| style="width:100%" border="0"

$$ \frac{\partial}{\partial x}\left(A \left(x\right) k\left(x\right) \frac{\partial u}{\partial x}\right) + f \left(x,t \right) = A \left(x \right) \rho c \frac{\partial u}{\partial t} $$


 * $$\displaystyle (Eq. 1.1) $$
 * }
 * }

Solution
Fig. 1 Shows a bar of cross section A(x), with conductivity k(x), density ρ, specific heat c, with an internal heat source (or sink) f(x,t). In the bar the heat is transferred only by conduction in x direction. The temperature has been called u(x,t)





The partial differential equation for this problem can be obtained doing an energy balance in an infinitesimal element of the bar. Fig. 2 shows an infinitesimal element of length dx; heat entering the body on the left hand side is $$q\left(x \right)$$ and heat going out the body on the right hand side is $$q \left(x + dx \right)$$

Doing the energy balance we obtain:
 * {| style="width:100%" border="0"

$$ q \left(x \right) A \left(x \right) - q \left(x + dx \right) A \left(x+dx \right) + fdx = \frac{dE}{dt}$$
 * $$\displaystyle (Eq. 1.2) $$
 * }
 * }

Where $$ \frac{dE}{dt}$$ is the change of energy with respect to time which can be calculated in terms of the temperature as:
 * {| style="width:100%" border="0"



$$ \frac{dE}{dt} = A d x \rho c \frac{\partial u}{\partial t} $$
 * $$\displaystyle (Eq. 1.3) $$
 * }
 * }

The heat flow and the cross area at the right hand side of the element can be approximated by:
 * {| style="width:100%" border="0"



$$ q \left(x + dx \right) = q \left(x \right) + \frac{\partial q}{\partial x} dx $$
 * $$\displaystyle (Eq. 1.4) $$
 * }
 * }


 * {| style="width:100%" border="0"

$$ A \left(x + dx \right) = A \left(x \right) + \frac{\partial A}{\partial x} dx $$
 * $$\displaystyle (Eq. 1.5) $$
 * }
 * }

Replacing on Eq.1.2 we obtain:
 * {| style="width:100%" border="0"

$$ qA - \left(q + \frac{\partial q}{\partial x}dx \right)\left(A + \frac{\partial A}{\partial x} dx \right) + fdx = A d x \rho c \frac{\partial u}{\partial x} $$
 * $$\displaystyle (Eq. 1.6) $$
 * }
 * }

Doing the product we get:
 * {| style="width:100%" border="0"

$$ qA - qA - q \frac{\partial A}{\partial x} dx - A \frac{\partial q}{\partial x} dx - \frac{\partial A}{\partial x} dx \frac{\partial q}{\partial x} dx + fdx = A d x \rho c \frac{\partial u}{\partial x} $$
 * $$\displaystyle (Eq. 1.7) $$
 * }
 * }

Neglecting the second order term we have:
 * {| style="width:100%" border="0"

$$ -q \frac{\partial A}{\partial x} dx - A \frac{\partial q}{\partial x} dx + fdx =Adx \rho c \frac{\partial u}{\partial x}$$
 * $$\displaystyle (Eq. 1.8) $$
 * }
 * }

The first two terms in the latter equation are the derivative of a product; therefore:
 * {| style="width:100%" border="0"

$$ - \frac{\partial}{\partial x} \left(Aq \right) dx + fdx = Adx \rho c \frac{\partial u}{\partial x} $$
 * $$\displaystyle (Eq. 1.9) $$
 * }
 * }

Using the Fourier’s law, the heat flow can be expressed as function of temperature. For an unidirectional case we have:
 * {| style="width:100%" border="0"

$$ q\left (x \right) = -k \left(x \right) \frac{\partial u}{\partial x} $$
 * $$\displaystyle (Eq. 1.10) $$
 * }
 * }

Where k(x) is the conductivity of the material. Replacing equation Eq.1.9 in Eq.1.10 we have:
 * {| style="width:100%" border="0"

$$ \frac{\partial}{\partial x} \left( Ak \frac{\partial u}{\partial x} \right) + f \left(x,t \right) = A \rho c \frac{\partial u}{\partial t} $$
 * style="width:2%; padding:1px; border:2px solid #FF0000" |
 * style="width:2%; padding:1px; border:2px solid #FF0000" |


 * $$\displaystyle ( Eq. 1.11) $$
 * style= |
 * }

=Problem 2=

Given
$$\left [B _{jk} \right ]=\begin{bmatrix} 1 &1 &1 \\ 2 &-1 &3 \\ 3 &2  &6 \end{bmatrix}$$
 * {| style="width:100%" border="0"

$$\overset{v}{\rightarrow}=5\overset{a_{1}}{\rightarrow}-7\overset{a_{2}}{\rightarrow}-4\overset{a_{3}}{\rightarrow}$$


 * $$\displaystyle (Eq. 2.1) $$
 * }
 * }

Find
2.1 $$ Det\left [B _{jk} \right ]$$.

2.2 Find $$\displaystyle \Gamma (b_{1},b_{3},b_{3})=K$$.

2.3 Find $$\overset{F}{\rightarrow}=\left \{ F_{i} \right \}=\left \{ b_{i}.v \right \}$$.

2.4 Solve $$\displaystyle (Eq. 5) $$ on 7-2 for $$\overset{d}{\rightarrow}=\left \{v _{j} \right \}$$

2.5 Use equation 1 on 7-4 to find $$\vec{\overset{k}{\rightarrow}}\overset{d}{\rightarrow}=\vec{\overset{F}{\rightarrow}}$$ What is $$\vec{K}$$ & $$\vec{F}$$?

2.6 Solve for $$\overset{d}{\rightarrow}_{i}$$ compare to $$\overset{d}{\rightarrow}$$ in 4).

2.7 Observe the symmetric properties of $$\overset{K}{\rightarrow}$$ & $$\overset{\vec{K}}{\rightarrow}$$. Further Discuss the Pros & Cons of Bubnov-Galerkin & Petrov-Galerkin Methods.

2.1
$$ Det\left [B _{jk} \right ]$$=
 * {| style="width:100%" border="0"

$$\begin{vmatrix} 1 &1 &1 \\ 2 &-1 &3 \\ 3 &2  &6 \end{vmatrix}=-8.$$.
 * style="width:2%; padding:1px; border:2px solid #FF0000" |
 * style="width:2%; padding:1px; border:2px solid #FF0000" |


 * $$$$
 * style= |
 * }

2.2
Find  $$\Gamma (b_{1},b_{3},b_{3})=\overset{K}{\rightarrow}$$.

According to the $$\displaystyle Eq.4 $$ on 7-1, $$b_{1},b_{3},b_{3}$$ given before we have,

$$\overset{b_{j}}{\rightarrow}.d_{j}=\overset{V}{\rightarrow}$$

Successively performing multiplication by $$b_{1},b_{3},b_{3}$$  we get,
 * {| style="width:100%" border="0"

$$d_{1}\overset{b_{1}}{\rightarrow}+d_{2}\overset{b_{2}}{\rightarrow}+d_{3}\overset{b_{3}}{\rightarrow}=\overset{V}{\rightarrow}$$


 * $$\displaystyle (Eq. 2.2) $$
 * }
 * }

Substituting the given values we get,

$$d_{1}\begin{bmatrix} 1\\ 1\\ 1 \end{bmatrix}+d_{2}\begin{bmatrix} 2\\ -1\\ 3 \end{bmatrix}+d_{3}\begin{bmatrix} 3\\ 2\\ 6 \end{bmatrix}=\begin{bmatrix} 5\\ -7\\ -4 \end{bmatrix}$$

This equation can also be written in the following format,

$$\begin{bmatrix} 1 &2 &3 \\ 1 &-1  &2 \\ 1 & 3 & 6 \end{bmatrix}\begin{pmatrix} d_{1}\\ d_{2}\\ d_{3} \end{pmatrix}=\begin{pmatrix} 5\\ -7\\ 4 \end{pmatrix}$$

$$\displaystyle Eq.3 $$ on 7-2 is obtained by multiplying $$\displaystyle Eq.2.2  $$ by each $$\overset{b}{\rightarrow}$$, so we can write,

$$\overset{b_{1}}{\rightarrow}.\overset{b_{1}}{\rightarrow}d_{1}+\overset{b_{1}}{\rightarrow}.\overset{b_{2}}{\rightarrow}d_{2}+\overset{b_{1}}{\rightarrow}.\overset{b_{3}}{\rightarrow}d_{3}=\overset{b_{1}}{\rightarrow}.\overset{V}{\rightarrow}==F_{1}$$

$$\overset{b_{2}}{\rightarrow}.\overset{b_{1}}{\rightarrow}d_{1}+\overset{b_{2}}{\rightarrow}.\overset{b_{2}}{\rightarrow}d_{2}+\overset{b_{2}}{\rightarrow}.\overset{b_{3}}{\rightarrow}d_{3}=\overset{b_{2}}{\rightarrow}.\overset{V}{\rightarrow}==F_{2}$$

$$\overset{b_{3}}{\rightarrow}.\overset{b_{1}}{\rightarrow}d_{1}+\overset{b_{3}}{\rightarrow}.\overset{b_{2}}{\rightarrow}d_{2}+\overset{b_{3}}{\rightarrow}.\overset{b_{3}}{\rightarrow}d_{3}=\overset{b_{2}}{\rightarrow}.\overset{V}{\rightarrow}==F_{3}$$

These 3 equations can be further presented as below in the matrix form,

$$\begin{bmatrix} \overset{b_{1}}{\rightarrow}.\overset{b_{1}}{\rightarrow} & \overset{b_{1}}{\rightarrow}.\overset{b_{2}}{\rightarrow} & \overset{b_{1}}{\rightarrow}.\overset{b_{3}}{\rightarrow}\\ \overset{b_{2}}{\rightarrow}.\overset{b_{1}}{\rightarrow} & \overset{b_{2}}{\rightarrow}.\overset{b_{2}}{\rightarrow} & \overset{b_{2}}{\rightarrow}.\overset{b_{3}}{\rightarrow}\\ \overset{b_{3}}{\rightarrow}.\overset{b_{1}}{\rightarrow} & \overset{b_{3}}{\rightarrow}.\overset{b_{2}}{\rightarrow} & \overset{b_{3}}{\rightarrow}.\overset{b_{3}}{\rightarrow} \end{bmatrix}\begin{pmatrix} d_{1}\\ d_{2}\\ d_{3} \end{pmatrix}=\begin{bmatrix} b_{1}\\ b_{2}\\ b_{3} \end{bmatrix}\begin{pmatrix} V_{1}\\ V_{2}\\ V_{3} \end{pmatrix}$$

Which also can be written as

$$\begin{bmatrix} \overset{b_{1}}{\rightarrow}\\ \overset{b_{2}}{\rightarrow}\\ \overset{b_{3}}{\rightarrow} \end{bmatrix} \begin{bmatrix} \overset{b_{1}}{\rightarrow}\\ \overset{b_{2}}{\rightarrow}\\ \overset{b_{3}}{\rightarrow} \end{bmatrix}^{T}\begin{pmatrix} d_{1}\\ d_{2}\\ d_{3} \end{pmatrix}=\begin{bmatrix} \overset{b_{1}}{\rightarrow}\\ \overset{b_{2}}{\rightarrow}\\ \overset{b_{3}}{\rightarrow} \end{bmatrix}\begin{pmatrix} V_{1}\\ V_{2}\\ V_{3} \end{pmatrix}=\overset{F}{\rightarrow}$$

Substituting the numerical values we get,

$$\begin{bmatrix} 1 &1 &1 \\ 2 &-1 &3 \\ 3 &2  &6 \end{bmatrix}\begin{bmatrix} 1 &2 &3 \\ 1 &-1 &2\\ 1 &3  &6 \end{bmatrix}\begin{pmatrix} d_{1}\\ d_{2}\\ d_{3} \end{pmatrix}=\begin{bmatrix} 1 &1 &1 \\ 2 &-1 &3 \\ 3 &2  &6 \end{bmatrix}\begin{bmatrix} 5\\ -7\\ -4 \end{bmatrix}$$

Performing the product, we get:
 * {| style="width:100%" border="0"

$$\begin{bmatrix} 3 &4 &11\\ 4 &14  &22\\ 11 &22  &49 \end{bmatrix}\begin{pmatrix} d_{1}\\ d_{2}\\ d_{3} \end{pmatrix}=\begin{bmatrix} 1 &1 &1 \\ 2 &-1 &3 \\ 3 &2  &6 \end{bmatrix}\begin{bmatrix} 5\\ -7\\ -4 \end{bmatrix}=\overset{F}{\rightarrow}$$


 * $$\displaystyle (Eq. 2.3 ) $$
 * }
 * }

$$\displaystyle Eq. 2.3 $$ is equivalent to $$\displaystyle Kd=F$$ where
 * {| style="width:100%" border="0"


 * style="width:2%; padding:1px; border:2px solid #FF0000" |
 * style="width:2%; padding:1px; border:2px solid #FF0000" |

$$K=\begin{bmatrix} 3 &4 &11 \\ 4 &14 &22 \\ 11&22 &49 \end{bmatrix}=Stiffness Matrix$$


 * $$$$
 * style= |
 * }

Furthermore,
 * {| style="width:100%" border="0"

$$Det[K]=\begin{vmatrix} 3 &4 &11\\ 4 &14 &22 \\ 11 &22 &49 \end{vmatrix}= 64$$
 * style="width:2%; padding:1px; border:2px solid #FF0000" |
 * style="width:2%; padding:1px; border:2px solid #FF0000" |


 * <p style="text-align:right;">$$$$
 * style= |
 * }

2.3
$$\overset{F}{\rightarrow}=\left \{ F_{i} \right \}=\left \{ b_{i}.v \right \}$$=

From $$\displaystyle Eq. 2.3 $$
 * {| style="width:100%" border="0"


 * style="width:2%; padding:1px; border:2px solid #FF0000" |
 * style="width:2%; padding:1px; border:2px solid #FF0000" |

$$\overset{F}{\rightarrow}=\begin{bmatrix} 1 &1 &1 \\ 2 &-1 &3 \\ 3 &2  &6 \end{bmatrix}\begin{bmatrix} 5\\ -7\\ -4 \end{bmatrix}=\begin{pmatrix} -6\\ 5\\ -23 \end{pmatrix}$$


 * <p style="text-align:right;">$$$$
 * style= |
 * }

2.4
Solve $$\displaystyle Eq. 5 $$ on 7-2 for $$\overset{d}{\rightarrow}=\left \{v _{j} \right \}$$

Rearranging $$\displaystyle Eq. 2.3 $$  We get

$$\displaystyle d=K^{-1}F$$
 * {| style="width:100%" border="0"

$$d=\begin{bmatrix} 3 &4 &11 \\ 4 &14  &22 \\ 11 &22  &49 \end{bmatrix}^{-1}\begin{pmatrix} -6\\ 5\\ -23 \end{pmatrix}=\begin{pmatrix} 8.3750\\ 5.6250\\ -4.875 \end{pmatrix}$$
 * style="width:2%; padding:1px; border:2px solid #FF0000" |
 * style="width:2%; padding:1px; border:2px solid #FF0000" |
 * <p style="text-align:right;">$$$$
 * style= |
 * }

2.5
Use equation 1 on 7-4 to find $$\vec{\overset{k}{\rightarrow}}\overset{d}{\rightarrow}=\vec{\overset{F}{\rightarrow}}$$. Further, What is $$\vec{K}$$ & $$\vec{F}$$?

In this case, $$\displaystyle w_{i}=a_{i}$$, where $$\displaystyle a_{i}$$ is the orthonormal basis.

Starting with Equation 1 on 7-2, we get:

$$d_{1}\overset{b_{1}}{\rightarrow}+d_{2}\overset{b_{2}}{\rightarrow}+d_{3}\overset{b_{3}}{\rightarrow}=\overset{V}{\rightarrow}$$

If we multiply successively by $$\displaystyle a_{i}$$, we get the following equations,

$$\overset{a_{1}}{\rightarrow}.\overset{b_{1}}{\rightarrow}d_{1}+\overset{a_{1}}{\rightarrow}.\overset{b_{2}}{\rightarrow}d_{2}+\overset{a_{1}}{\rightarrow}.\overset{b_{3}}{\rightarrow}d_{3}=\overset{a_{1}}{\rightarrow}.\overset{V}{\rightarrow}=F_{1}$$

$$\overset{a_{2}}{\rightarrow}.\overset{b_{1}}{\rightarrow}d_{1}+\overset{a_{2}}{\rightarrow}.\overset{b_{2}}{\rightarrow}d_{2}+\overset{a_{2}}{\rightarrow}.\overset{b_{3}}{\rightarrow}d_{3}=\overset{a_{2}}{\rightarrow}.\overset{V}{\rightarrow}=F_{2}$$
 * {| style="width:100%" border="0"

$$\overset{a_{3}}{\rightarrow}.\overset{b_{1}}{\rightarrow}d_{1}+\overset{a_{3}}{\rightarrow}.\overset{b_{2}}{\rightarrow}d_{2}+\overset{a_{3}}{\rightarrow}.\overset{b_{3}}{\rightarrow}d_{3}=\overset{a_{3}}{\rightarrow}.\overset{V}{\rightarrow}=F_{3}$$


 * <p style="text-align:right;">$$\displaystyle (Eq. 2.4) $$
 * }
 * }

Which can be further written as,

$$\begin{bmatrix} \overset{a_{1}}{\rightarrow}\\ \overset{a_{2}}{\rightarrow}\\ \overset{a_{3}}{\rightarrow} \end{bmatrix}\begin{bmatrix} \overset{b_{1}}{\rightarrow}\\ \overset{b_{2}}{\rightarrow}\\ \overset{b_{3}}{\rightarrow} \end{bmatrix}^{T}\begin{pmatrix} d_{1}\\ d_{2}\\ d_{3} \end{pmatrix}=\begin{bmatrix} \overset{a_{1}}{\rightarrow}\\ \overset{a_{2}}{\rightarrow}\\ \overset{a_{3}}{\rightarrow} \end{bmatrix}\begin{pmatrix} V_{1}\\ V_{2}\\ V_{3} \end{pmatrix}=\overset{\vec{F}}{\rightarrow}$$

As $$ a_{i}$$ is orthonormal basis, we can write the following,

$$a_{1}=\begin{bmatrix} 1 & 0 &0 \end{bmatrix};a_{2}=\begin{bmatrix} 0&1&0 \end{bmatrix};a_{3}=\begin{bmatrix} 0& 0 &1 \end{bmatrix}$$

Substituting the respective values we have,

$$\begin{bmatrix} 1 &0 &0 \\ 0 &1  &0 \\ 0 &0  &1 \end{bmatrix}\begin{bmatrix} \overset{b_{1}}{\rightarrow}\\ \overset{b_{2}}{\rightarrow}\\ \overset{b_{3}}{\rightarrow} \end{bmatrix}^{T}\begin{pmatrix} d_{1}\\ d_{2}\\ d_{3} \end{pmatrix}=\begin{bmatrix} 1 & 0 & 0\\ 0 & 1 & 0\\ 0 & 0& 1 \end{bmatrix}\begin{pmatrix} V_{1}\\ V_{2}\\ V_{3} \end{pmatrix}=\overset{\vec{F}}{\rightarrow}$$

Simplifying we obtain that,

$$\begin{bmatrix} \overset{b_{1}}{\rightarrow}\\ \overset{b_{2}}{\rightarrow}\\ \overset{b_{3}}{\rightarrow} \end{bmatrix}^{T}\begin{pmatrix} d_{1}\\ d_{2}\\ d_{3} \end{pmatrix}=\begin{pmatrix} V_{1}\\ V_{2}\\ V_{3} \end{pmatrix}=\overset{\vec{F}}{\rightarrow}$$

Replacing the numerical values we get,
 * {| style="width:100%" border="0"

$$\begin{bmatrix} 1 & 2 & 3\\ 1 &-1 &2 \\ 1 &3  & 6 \end{bmatrix}\begin{pmatrix} d_{1}\\ d_{2}\\ d_{3} \end{pmatrix}=\begin{pmatrix} 5\\ -7\\ -4 \end{pmatrix}$$
 * style="width:2%; padding:1px; border:2px solid #FF0000" |
 * style="width:2%; padding:1px; border:2px solid #FF0000" |


 * <p style="text-align:right;">$$\displaystyle ( Eq. 2.5 ) $$
 * style= |
 * }

This equation is nothing but the system

$$\overset{\vec{K}}{\rightarrow}\overset{d}{\rightarrow}=\overset{\vec{F}}{\rightarrow}$$

From where we can conclude that $$\overset{\vec{K}}{\rightarrow}$$ is a matrix whose columns are the vectors $$\overset{b_{j}}{\rightarrow}$$ and $$\overset{\vec{F}}{\rightarrow}= V$$.

2.6
Solve for $$\overset{d}{\rightarrow}_{i}$$ compare to $$\overset{d}{\rightarrow}$$ in problem 2.4
 * {| style="width:100%" border="0"

$$\begin{pmatrix} d_{1}\\ d_{2}\\ d_{3} \end{pmatrix}=\begin{bmatrix} 1 & 2 & 3\\ 1 &-1 &2 \\ 1 &3  & 6 \end{bmatrix}^{-1}\begin{pmatrix} 5\\ -7\\ -4 \end{pmatrix}=\begin{pmatrix} 8.3750\\ 5.6250\\ -4.875 \end{pmatrix}$$
 * style="width:2%; padding:1px; border:2px solid #FF0000" |
 * style="width:2%; padding:1px; border:2px solid #FF0000" |


 * <p style="text-align:right;">$$$$
 * style= |
 * }

We can see that this result is identical to the result we obtained in problem 2.4

2.7
Observe the symmetric properties of $$\overset{K}{\rightarrow}$$ & $$\overset{\vec{K}}{\rightarrow}$$. Further Discuss the Pros & Cons of Bubnov-Galerkin & Petrov-Galerkin Methods.

We can explicitely see that $$\overset{K}{\rightarrow}$$  is always symmetric because it is obtained from the product of $$\overset{b_{j}}{\rightarrow}.\overset{b_{i}}{\rightarrow}$$; where as $$\overset{\vec{K}}{\rightarrow}$$ is not always symmetric. It will be symmetric only when the vector b is a Orthonormal basis.

The pros of Bubnov-Galerkin method is the symmetry of the stiffness matrix which is generally easy to solve, however more calculations are necessary to get the stiffness matrix. Whereas, in the Petrov-Galerking method, obtaining the stiffness matrix is easier but solving the system on other hand can be more difficult owing to its non-symmetry.

=Problem 3=

Given
Given Equation 1 on 8-1 which states $$\overset{w}{\rightarrow}.\overset{P(v)}{\rightarrow}=0$$
 * {| style="width:100%" border="0"

$$\forall w\in R^{n}$$


 * <p style="text-align:right;">$$\displaystyle (Eq. 3.1) $$
 * }
 * }

and $$\overset{w}{\rightarrow}.\overset{P(v)}{\rightarrow}=0$$ where $$\overset{w}{\rightarrow}=\sum \beta _{i}.a_{i}$$
 * {| style="width:100%" border="0"

$$\forall (\beta _{1},\beta _{2}..\beta _{n})\in R^{n}$$


 * <p style="text-align:right;">$$\displaystyle (Eq. 3.2) $$
 * }
 * }

Find
Show that $$\displaystyle (Eq. 3.1) $$ is equivalent to $$\displaystyle (Eq. 3.2) $$

Solution
For avoiding confusion we are designating the weight function as $$\overset{W}{\rightarrow}$$ in $$\displaystyle (Eq. 3.1)$$ and the weight function as $$\overset{w}{\rightarrow}$$ in $$\displaystyle (Eq. 3.2)$$.

Considering $$\displaystyle (Eq. 3.2) $$ and Substituting for $$\overset{W}{\rightarrow}$$

$$\sum \beta _{i}a_{i}.\overset{P(v)}{\rightarrow}=0$$
 * {| style="width:100%" border="0"

$$\forall (\beta _{1},\beta _{2}..\beta _{n})\in R^{n}$$


 * <p style="text-align:right;">$$\displaystyle (Eq. 3.3) $$
 * }
 * }

As $$a_{i}$$ is an orthonormal basis, performing a successive product by $$a_{i}$$ in the $$\displaystyle (Eq. 3.3) $$, we get

$$\begin{bmatrix} 1 &0 &0  &....0 \end{bmatrix}\beta _{1}.\overset{P(v)}{\rightarrow}=0$$

In the similar way

$$\begin{bmatrix} 0 &1 &0  &....0 \end{bmatrix}\beta _{2}.\overset{P(v)}{\rightarrow}=0$$

.

.

.

$$\begin{bmatrix} 0 &0 &0  &....1 \end{bmatrix}\beta _{n}.\overset{P(v)}{\rightarrow}=0$$;

Furthermore all the equations can be combined and written as
 * {| style="width:100%" border="0"

$$ \begin{bmatrix} 1 &0 &...0 \\ 0 &1  &...0 \\ 0 &0  &...1 \end{bmatrix}\bigl(\begin{smallmatrix} \beta_{1}\\ .\\ .\\ \beta_{n} \end{smallmatrix}\bigr).\overset{P(v)}{\rightarrow}=\bigl(\begin{smallmatrix} 0\\ .\\ .\\ 0 \end{smallmatrix}\bigr) ... \forall (\beta _{1},\beta _{2}..\beta _{n})\in R^{n}$$


 * <p style="text-align:right;">$$\displaystyle (Eq. 3.4) $$
 * }
 * }

We can cleraly observe that the Matrix on the left hand side is the identity matrix $$\begin{bmatrix} I \end{bmatrix}$$; Moreover we have also written $$(\beta _{1},\beta _{2}..\beta _{n})$$ as a vector which further can be called as $$\overset{\beta}{\rightarrow}$$. and $$\displaystyle (Eq. 3.4) $$ becomes
 * {| style="width:100%" border="0"

$$\overset{\beta}{\rightarrow}.\overset{P(v)}{\rightarrow}=0; \forall \overset{\beta}{\rightarrow} \in R^{n}$$
 * style="width:2%; padding:1px; border:2px solid #FF0000" |
 * style="width:2%; padding:1px; border:2px solid #FF0000" |


 * <p style="text-align:right;">$$\displaystyle (Eq. 3.5) $$
 * style= |
 * }

Which is identical to $$\displaystyle Eq. 3.1 $$.

=Problem 4= Show that
 * {| style="width:100%" border="0"

$$ \int \frac{x^2}{1+x} dx = \frac{x^2}{2} - x + ln \left(1+x \right) + k $$
 * <p style="text-align:right;">$$\displaystyle (Eq. 4.1) $$
 * }
 * }

Find
From Lecture 9

4.1$$ \int lnxdx = xlnx -x $$

4.2$$ \int xlnxdx = \frac{1}{2} x^2 \left[lnx - \frac{1}{2} \right] $$

4.3$$ \int \frac{x^2}{1+cx} dx $$

4.4$$ \int \frac{x^2}{a+bx} dx $$

From Lecture 10

4.5 Find the exact solution $$ u \left(x \right) $$ for the problem (3) on 9-2

4.6 Plot $$ u \left(x \right) $$

4.1
Prove that
 * {| style="width:100%" border="0"

$$ \int lnxdx = xlnx -x $$
 * <p style="text-align:right;">$$\displaystyle (Eq. 4.2) $$
 * }
 * }

In order to integrate by parts we choose $$ f \left(x \right) = lnx $$ and $$ g' \left(x \right) = 1 $$

Now we apply the formulae for integration by parts which is:


 * {| style="width:100%" border="0"

$$ \int f \left( x \right) g' \left( x \right)dx = f \left(x \right) g \left(x \right) - \int g \left(x \right) f' \left(x \right)dx $$
 * <p style="text-align:right;">$$\displaystyle (Eq. 4.3) $$
 * }
 * }

Where $$ f' \left(x \right) = \frac{1}{x}, g \left(x \right) = x $$

Substituting these values into Eq.4.3 we get:
 * {| style="width:100%" border="0"

$$ \int lnxdx = xlnx - \int \frac{x}{x} dx = xlnx -x $$
 * style="width:2%; padding:1px; border:2px solid #FF0000" |
 * style="width:2%; padding:1px; border:2px solid #FF0000" |


 * <p style="text-align:right;">$$\displaystyle (Eq. 4.4) $$
 * style= |
 * }

4.2
Prove that
 * {| style="width:100%" border="0"

$$ \int xlnxdx = \frac{1}{2} x^2 \left[lnx - \frac{1}{2} \right] $$
 * <p style="text-align:right;">$$\displaystyle (Eq. 4.5) $$
 * }
 * }

In order to integrate by parts we choose: $$ f \left(x \right) = lnx $$ and $$ g' \left(x \right) = x $$

Where $$ f' \left(x \right) = \frac{1}{x}, g \left(x \right) = \frac{x^2}{2} $$

Substituting these values into Eq.4.3 we get:


 * {| style="width:100%" border="0"

$$ \int xlnxdx = \frac{x^2}{2} lnx - \int \frac{x^2}{2} \frac{1}{x} dx = \frac{x^2}{2} lnx - \int \frac{x}{2}dx = \frac{x^2}{2} lnx - \frac{x^2}{4} $$
 * <p style="text-align:right;">$$\displaystyle (Eq. 4.6) $$
 * }
 * }

Factoring out $$ \frac{1}{2} x^2 $$ we get:
 * {| style="width:100%" border="0"

$$ \int xlnxdx = \frac{1}{2} x^2 \left[lnx - \frac{1}{2} \right] $$
 * style="width:2%; padding:1px; border:2px solid #FF0000" |
 * style="width:2%; padding:1px; border:2px solid #FF0000" |


 * <p style="text-align:right;">$$\displaystyle (Eq. 4.5) $$
 * style= |
 * }

4.3
Find
 * {| style="width:100%" border="0"

$$ \int \frac{x^2}{1+cx} dx $$
 * <p style="text-align:right;">$$\displaystyle (Eq. 4.7) $$
 * }
 * }

The integral can also be written as follows:


 * {| style="width:100%" border="0"

$$ \int \frac{x^2}{1+cx} dx = \frac{1}{c} \int \left[x - \frac{x}{1+cx} \right]dx = \frac{1}{c} \left[\int xdx - \int \frac{x}{1+cx} dx \right] $$
 * <p style="text-align:right;">$$\displaystyle (Eq. 4.8) $$
 * }
 * }

To solve this integral, we made the next change of variables:
 * {| style="width:100%" border="0"

$$ y = 1+cx \Rightarrow  x = \frac{y-1}{c}  \Rightarrow  dy = cdx $$
 * <p style="text-align:right;">$$\displaystyle (Eq. 4.9) $$
 * }
 * }

Substituting these values into Eq.4.8 we get:
 * {| style="width:100%" border="0"

$$ \int \frac{ \left(y -1 \right)^2}{c^2 y} \frac{dy}{c} $$
 * <p style="text-align:right;">$$\displaystyle (Eq. 4.10) $$
 * }
 * }

Which can be expanded to:
 * {| style="width:100%" border="0"

$$ \frac{1}{c^3} \int \frac{y^2 - 2y +1}{y} dy = \frac{1}{c^3} \int \left(y -2+ \frac{1}{y} \right) dy = \frac{1}{c^3} \left( \frac{y^2}{2} -2y+lny \right) $$
 * <p style="text-align:right;">$$\displaystyle (Eq. 4.11) $$
 * }
 * }

Finally, replacing y as a function of x we have:
 * {| style="width:100%" border="0"

$$ \frac{1}{c^3} \left[ \frac{ \left(1+cx \right)^2}{2} - 2 \left(1+cx \right) + ln \left(1+cx \right) \right] $$
 * <p style="text-align:right;">$$\displaystyle (Eq. 4.12) $$
 * }
 * }

Choosing $$ c = 1 $$
 * {| style="width:100%" border="0"

$$ \int \frac{x^2}{1+x} dx = \frac{x^2}{2} - x - \frac{3}{2} + ln \left(1+x \right) $$
 * style="width:2%; padding:1px; border:2px solid #FF0000" |
 * style="width:2%; padding:1px; border:2px solid #FF0000" |


 * <p style="text-align:right;">$$\displaystyle (Eq. 4.13) $$
 * style= |
 * }


 * Wolfram Alpha Proof for Part 3

4.4
Find
 * {| style="width:100%" border="0"

$$ \int \frac{x^2}{a+bx} dx $$
 * <p style="text-align:right;">$$\displaystyle (Eq. 4.14) $$
 * }
 * }

We start by changing the variables with:


 * {| style="width:100%" border="0"

$$ y = a +bx \Rightarrow  x = \frac{y - a}{b}  \Rightarrow  dx = \frac{dy}{b}$$
 * <p style="text-align:right;">$$\displaystyle (Eq. 4.15) $$
 * }
 * }

Replacing these values into Eq.4.14 we get:


 * {| style="width:100%" border="0"

$$ \int \frac{ \left( y-a \right)^2}{b^2 y} \frac{dy}{b} = \frac{1}{b^3} \int \left(y -2a+ \frac{a^2}{y} \right) dy = \frac{1}{b^3} \left( \frac{y^2}{2} - 2ay+ a^2 ln y \right) $$
 * <p style="text-align:right;">$$\displaystyle (Eq. 4.16) $$
 * }
 * }

Changing the variables we get:


 * {| style="width:100%" border="0"

$$ \frac{1}{b^3} \left( \frac{ \left(a+bx \right)^2}{2} - 2a \left( a+bx \right) + a^2 ln \left(a+bx \right) \right) $$
 * <p style="text-align:right;">$$\displaystyle (Eq. 4.17) $$
 * }
 * }

Choosing $$ a = b =1 $$ we have:
 * {| style="width:100%" border="0"

$$ \int \frac{x^2}{1+x} dx = \frac{ \left(1+x \right)^2}{2} - 2 \left(1+x \right) + ln \left(1+x \right) $$
 * style="width:2%; padding:1px; border:2px solid #FF0000" |
 * style="width:2%; padding:1px; border:2px solid #FF0000" |


 * <p style="text-align:right;">$$\displaystyle (Eq. 4.18) $$
 * style= |
 * }

The result is the same as Eq.4.13


 * Wolfram Alpha Proof for Part 4

4.5
The problem is solving the differential equation:


 * {| style="width:100%" border="0"

$$ \frac{d}{dx} \left[ \left( 2+3x \right) \frac{du}{dx} \right] +5x = 0  \forall x \in \left]0,1 \right[  $$
 * <p style="text-align:right;">$$\displaystyle (Eq. 4.19) $$
 * }
 * }

With the boundary conditions:


 * {| style="width:100%" border="0"

$$ u \left(1 \right) = 4 ~,~ - \frac{du}{dx} \left(x = 0 \right) = 6 $$
 * <p style="text-align:right;">$$\displaystyle (Eq. 4.20) $$
 * }
 * }

The differential equation can be written:
 * {| style="width:100%" border="0"

$$ \frac{d}{dx} \left[ \left( 2+3x \right) \frac{du}{dx} \right] = -5x $$
 * <p style="text-align:right;">$$\displaystyle (Eq. 4.21) $$
 * }
 * }

Now integrate:


 * {| style="width:100%" border="0"

$$ \left[ \left( 2+3x \right) \frac{du}{dx} \right] = -5 \frac{x^2}{2} + k $$
 * <p style="text-align:right;">$$\displaystyle (Eq. 4.22) $$
 * }
 * }


 * {| style="width:100%" border="0"

$$ \frac{du}{dx}= -2.5 \frac{x^2}{\left(2 +3x \right)} + \frac{k}{\left( 2+3x \right)} $$
 * <p style="text-align:right;">$$\displaystyle (Eq. 4.23) $$
 * }
 * }

Now the solution of $$ u \left( x \right) $$ is:


 * {| style="width:100%" border="0"

$$ u \left( x \right) = -2.5 \int \frac{x^2}{ \left(2+3x \right)} dx + k \int \frac{dx}{ \left(2+3x \right)} $$
 * <p style="text-align:right;">$$\displaystyle (Eq. 4.24) $$
 * }
 * }

The first integral can be solved using Eq.4.17 with  $$  a = 2 ~,~ b=3 $$   and the second integral can be solved


 * {| style="width:100%" border="0"

$$ \int \frac{dx}{ \left(2+3x \right)} = \frac{1}{3} ln \left(2+3x \right) + q $$
 * <p style="text-align:right;">$$\displaystyle (Eq. 4.25) $$
 * }
 * }

Therefore the total solution is:
 * {| style="width:100%" border="0"

$$ u \left(x \right) = -2.5 \frac{1}{3^3} \left[ \frac{ \left(2+ 3x \right)^2}{2} - 2 \times 2 \left(2+3x \right) + 2^2 ln \left( 2+3x \right) \right] + \frac{k}{3} ln \left(2+3x \right) +q $$
 * <p style="text-align:right;">$$\displaystyle (Eq. 4.26) $$
 * }
 * }

After simplifying everything we obtain:


 * {| style="width:100%" border="0"

$$ u \left(x \right) = \frac{-5}{12}x^2 + \frac{30}{54}x + pln \left(2+3x \right) + r $$
 * <p style="text-align:right;">$$\displaystyle (Eq. 4.27) $$
 * }
 * }

Where $$ p $$ and $$ r $$ are constants and can be solved using the boundary conditions (Eq.4.20)


 * {| style="width:100%" border="0"

$$ u \left(1 \right) = 4 = \frac{-5}{12} + \frac{30}{54} + pln \left(5 \right) + r $$
 * <p style="text-align:right;">$$\displaystyle (Eq. 4.28) $$
 * }
 * }

The derivative of u is:


 * {| style="width:100%" border="0"

$$ \frac{du}{dx} = \frac{-10}{12}x + \frac{30}{54} + \frac{3p}{\left(2+3x \right)} $$
 * <p style="text-align:right;">$$\displaystyle (Eq. 4.29) $$
 * }
 * }

Therefore:


 * {| style="width:100%" border="0"

$$ \frac{du}{dx} \left(x=0 \right) = \frac{30}{54} + \frac{3p}{2} = -6  $$
 * <p style="text-align:right;">$$\displaystyle (Eq. 4.30) $$
 * }
 * }

Solving for $$ p $$ then gives:
 * {| style="width:100%" border="0"

$$ p = - \frac{118}{27} $$
 * <p style="text-align:right;">$$\displaystyle (Eq. 4.31) $$
 * }
 * }

Replacing $$ p $$ into Eq.4.28 gives:


 * {| style="width:100%" border="0"

$$\displaystyle r = 10.895 $$
 * <p style="text-align:right;">$$\displaystyle (Eq. 4.32) $$
 * }
 * }

The complete solution is:
 * {| style="width:100%" border="0"

$$ u \left(x \right) = \frac{-5}{12}x^2 + \frac{30}{54}x - \frac{118}{27} ln \left(2+3x \right) + 10.895  $$
 * style="width:2%; padding:1px; border:2px solid #FF0000" |
 * style="width:2%; padding:1px; border:2px solid #FF0000" |


 * <p style="text-align:right;">$$\displaystyle (Eq. 4.33) $$
 * style= |
 * }

4.6
Plot $$ u \left( x \right) $$

=Problem 5=

Given

 * {| style="width:100%" border="0"

$$ \overset{b _{i}}{\rightarrow}  .\overset{P(v)}{\rightarrow}=0 ,  i=1,2,...,n $$


 * <p style="text-align:right;">$$\displaystyle (Eq. 5.1) $$
 * }
 * }

Find
Show that
 * {| style="width:100%" border="0"

$$ \overset{w}{\rightarrow}  .\overset{P(v)}{\rightarrow}=0 $$ where $$  \overset{w}{\rightarrow} = \sum_{i=1}^{n}\alpha_{i} \overset{b _{i}}{\rightarrow} $$ ,
 * <p style="text-align:right;">$$\displaystyle (Eq. 5.2) $$
 * }
 * }

with $$ \forall (\alpha _{1},\alpha _{2},...,\alpha _{n})\in R^{n} $$

Solution
We have $$ \overset{b _{i}}{\rightarrow}  .\overset{P(v)}{\rightarrow}=0 $$

which means

$$ \overset{b _{1}}{\rightarrow}  .\overset{P(v)}{\rightarrow}=0 $$ , $$ \overset{b _{2}}{\rightarrow}  .\overset{P(v)}{\rightarrow}=0 $$ ,..., $$ \overset{b _{n}}{\rightarrow}  .\overset{P(v)}{\rightarrow}=0 $$.

So there exist arbitrary numbers $$ ( \alpha _{1}, \alpha _{2} ,..., \alpha _{n} ) $$ that

$$ \alpha _{1} \overset{b _{1}}{\rightarrow}  .\overset{P(v)}{\rightarrow}+ $$ $$ \alpha _{2} \overset{b _{2}}{\rightarrow}  .\overset{P(v)}{\rightarrow}+...+ $$ $$ \alpha _{n} \overset{b _{n}}{\rightarrow}  .\overset{P(v)}{\rightarrow}=0 $$

which is equivalent to the following:
 * {| style="width:100%" border="0"

$$ \overset{w}{\rightarrow}  .\overset{P(v)}{\rightarrow}=0 $$
 * style="width:2%; padding:1px; border:2px solid #FF0000" |
 * style="width:2%; padding:1px; border:2px solid #FF0000" |


 * <p style="text-align:right;">$$\displaystyle (Eq. 5.3) $$
 * style= |
 * }

=Problem 6=

Given
Consider $$F= \left\{ 1, cos \left(iwx \right), sin \left(iwx \right)\right\} $$, where $$ i=1,2  $$ on interval $$  \left[0,T \right] $$,

i.e. $$\left\{1, cos \left(wx \right), cos \left(2wx \right), sin \left(wx \right), sin \left( 2wx\right) \right\} $$

Find
6.1 Construct $$\overset{\Gamma}{\rightarrow}$$ (F); Observe the properties of $$\overset{\Gamma}{\rightarrow}$$

6.2 Find det $$\overset{\Gamma}{\rightarrow}$$ (F)

6.3 Conclude that F is orthogonal

6.1
Construct $$\overset{\Gamma}{\rightarrow} (F) = \int _{0}^{T} b_i b_j dx   ,   i,j = 1,2,3,4,5   $$

So
 * {| style="width:100%" border="0"

$$\overset{\Gamma}{\rightarrow} (F) = \int _{0}^{T} \begin{bmatrix} 1 &coswx &cos2wx &sinwx &sin2wx \\ coswx &coswxcoswx &coswxcos2wx &coswxsinwx &coswxsin2wx \\ cos2wx &cos2wxcoswx &cos2wxcos2wx &cos2wxsinwx &cos2wxsin2wx \\ sinwx &sinwxcoswx &sinwxcos2wx &sinwxsinwx &sinwxsin2wx \\ sin2wx &sin2wxcoswx &sin2wxcos2wx &sin2wxsinwx &sin2wxsin2wx \end{bmatrix} dx $$


 * <p style="text-align:right;">$$\displaystyle (Eq 6.1) $$
 * }
 * }

First we solve the integral:
 * {| style="width:100%" border="0"

$$ I = \int _{0}^{T} cos(\frac{2m\pi}{T}x) cos(\frac{2n\pi}{T}x) dx$$
 * <p style="text-align:right;">$$\displaystyle (Eq. 6.2) $$
 * }
 * }


 * with $$\displaystyle m,n=0,1,2 $$

Then we can write:
 * {| style="width:100%" border="0"

$$ I= \frac{1}{2} (I+b+I-b)     $$


 * <p style="text-align:right;">$$\displaystyle (Eq. 6.3) $$
 * }
 * }

where we add and subtract the quantity
 * {| style="width:100%" border="0"



$$ b= \int_0^T sin(\frac{2m\pi}{T}x) sin(\frac{2n\pi}{T}x) dx$$


 * <p style="text-align:right;">$$\displaystyle (Eq. 6.4) $$
 * }
 * }

So
 * {| style="width:100%" border="0"

$$ I= \frac{1}{2} \int_0^T (cos(\frac{2m\pi}{T}x) cos(\frac{2n\pi}{T}x) + sin(\frac{2m\pi}{T}x) sin(\frac{2n\pi}{T}x) + cos(\frac{2m\pi}{T}x) cos(\frac{2n\pi}{T}x) - sin(\frac{2m\pi}{T}x) sin(\frac{2n\pi}{T}x))dx $$


 * <p style="text-align:right;">$$\displaystyle (Eq. 6.5) $$
 * }
 * }

And the identity: $$ cos(A \pm B)=cosAcosB \mp sinAsinB  $$,   can be used to have the following result:
 * {| style="width:100%" border="0"

$$ I= \frac{1}{2} \int_0^T (cos(\frac{2(m-n)\pi}{T} x)+cos(\frac{2(m+n)\pi}{T} x) )dx $$


 * <p style="text-align:right;">$$\displaystyle (Eq. 6.6) $$
 * }
 * }

Performing the integration we have:
 * {| style="width:100%" border="0"

$$ I=\frac{1}{2} [ \frac{T}{2(m-n)\pi} sin(\frac{2(m-n)\pi}{T} x) + \frac{T}{2(m+n)\pi} sin(\frac{2(m+n)\pi}{T} x) ] \mid_0^T $$


 * <p style="text-align:right;">$$\displaystyle (Eq. 6.7) $$
 * }
 * }

The parameters 2(m-n) and 2(m+n) are integers because n and m are integers; therefore, when the sine is evaluated at T it becomes $$sink\pi$$ where k is integer and therefore $$sink\pi=0 $$. When the function is evaluated at 0, clearly the sine is 0 too. However when m=n, the parameter 2(m-n) becomes 0 and the first term of the last equation is indeterminate. But when m=n the integral can be calculated as:

$$ \int_0^T (cos(\frac{2m\pi}{T}x ))^2 dx$$

$$=\frac{1}{2} \int_0^T (1+cos(\frac{4m\pi}{T}x )) dx$$

$$=\frac{1}{2} [x+ \frac{T}{4m\pi} sin(\frac{4m\pi}{T}x )]\mid_0^T$$

$$=\frac{T}{2} $$

We conclude that the integral is $$\displaystyle T/2 $$ when $$\displaystyle m=n $$ and 0 otherwise.

Following identical procedure, the other integrals can be calculated to obtain:


 * {| style="width:100%" border="0"

$$\overset{\Gamma}{\rightarrow} (F) = \frac{T}{2} \begin{bmatrix} 2 &0 &0  &0  &0 \\ 0 &1  &0  &0  &0 \\ 0 &0  &1  &0  &0 \\ 0 &0  &0  &1  &0 \\ 0 &0  &0  &0  &1 \end{bmatrix}$$
 * style="width:2%; padding:1px; border:2px solid #FF0000" |
 * style="width:2%; padding:1px; border:2px solid #FF0000" |


 * <p style="text-align:right;">$$\displaystyle (Eq. 6.8) $$
 * style= |
 * }

and it can be seen that $$\overset{\Gamma}{\rightarrow} (F)$$ is diagonal.

6.2
Because $$\overset{\Gamma}{\rightarrow} (F)$$ is diagonal, the determinant can be easily calculated as the following:
 * {| style="width:100%" border="0"

$$Det(\overset{\Gamma}{\rightarrow} (F)) = T \frac{T}{2}\frac{T}{2}\frac{T}{2}\frac{T}{2} = \frac{T^5}{16} $$
 * style="width:2%; padding:1px; border:2px solid #FF0000" |
 * style="width:2%; padding:1px; border:2px solid #FF0000" |


 * <p style="text-align:right;">$$\displaystyle (Eq. 6.9) $$
 * style= |
 * }

6.3
Conclude that $$\overset{\Gamma}{\rightarrow} (F)$$ is orthogonal.

Although $$\overset{\Gamma}{\rightarrow} (F)$$ is diagonal, and orthogonal, it is not equal to the identity matrix, therefore it is not equal to $$\delta_ij$$.

=Problem 7= Consider the family $$F=\begin{bmatrix}x,x^2,x^3,x^4 \end{bmatrix} $$

Is $$ F $$ an othogonal family evaluated at $$\Omega=\begin{bmatrix}0,1 \end{bmatrix} $$?

From Lecture 10

Given

 * {| style="width:100%" border="0"

$$F=\begin{bmatrix}x,x^2,x^3,x^4 \end{bmatrix} $$


 * <p style="text-align:right;">$$\displaystyle (Eq. 7.1) $$
 * }
 * }

Find
Is $$ F $$ an othogonal family evaluated at $$\Omega=\begin{bmatrix}0,1 \end{bmatrix} $$?

Solution
Let's start by calculating $$\Gamma (F)$$

$$\Gamma(F)=\int_{0}^{1} \begin{bmatrix} 1,x,x^2,x^3,x^4\\ x,x^2,x^3,x^4,x^5\\ x^2,x^3,x^4,x^5,x^6\\ x^3,x^4,x^5,x^6,x^7\\ x^4,x^5,x^6,x^7,x^8\\ \end{bmatrix}dx $$

Performing the integration we obtain:
 * {| style="width:100%" border="0"

$$\Gamma(F)= \begin{bmatrix} x,\frac{x^2}{2},\frac{x^3}{3},\frac{x^4}{4},\frac{x^5}{5}\\ \frac{x^2}{2},\frac{x^3}{3},\frac{x^4}{4},\frac{x^5}{5},\frac{x^6}{6}\\ \frac{x^3}{3},\frac{x^4}{4},\frac{x^5}{5},\frac{x^6}{6},\frac{x^7}{7}\\ \frac{x^4}{4},\frac{x^5}{5},\frac{x^6}{6},\frac{x^7}{7},\frac{x^8}{8}\\ \frac{x^5}{5},\frac{x^6}{6},\frac{x^7}{7},\frac{x^8}{8},\frac{x^9}{9}\\ \end{bmatrix}$$


 * <p style="text-align:right;">$$\displaystyle (Eq. 7.2) $$
 * }
 * }

When equation 7.2 is evaluated at (0,1) we obtain:
 * {| style="width:100%" border="0"

$$\Gamma(F)= \begin{bmatrix} 1,\frac{1}{2},\frac{1}{3},\frac{1}{4},\frac{1}{5}\\ \frac{1}{2},\frac{1}{3},\frac{1}{4},\frac{1}{5},\frac{1}{6}\\ \frac{1}{3},\frac{1}{4},\frac{1}{5},\frac{1}{6},\frac{1}{7}\\ \frac{1}{4},\frac{1}{5},\frac{1}{6},\frac{1}{7},\frac{1}{8}\\ \frac{1}{5},\frac{1}{6},\frac{1}{7},\frac{1}{8},\frac{1}{9}\\ \end{bmatrix}$$
 * style="width:2%; padding:1px; border:2px solid #FF0000" |
 * style="width:2%; padding:1px; border:2px solid #FF0000" |


 * <p style="text-align:right;">$$\displaystyle (Eq. 7.3) $$
 * style= |
 * }

Where it can clearly be observed that $$\Gamma(F)$$ is not orthogonal

=Problem 8= Show that equation 1 and equation 2 on 10-4 are equivalent.

From Lecture 11

Given
Let's define our equations:

Equation 1 on 10-4


 * {| style="width:100%" border="0"

$$\int_{\Omega }{}w^{h}(x)P(U^{h}(x))dx=0;\forall w^{h}(x)$$
 * <p style="text-align:right;">$$\displaystyle (Eq.8.1) $$
 * }
 * }

and Equation 2 on 10-4


 * {| style="width:100%" border="0"

$${\int}_{\Omega}{} b_{i}(x)P(U^{h}(x))dx=0 $$
 * <p style="text-align:right;">$$\displaystyle (Eq.8.2) $$
 * }
 * }

With
 * {| style="width:100%" border="0"

$$w^{h}(x)=\sum_{i=1}^{n}c_{i}b_{i}(x)$$
 * <p style="text-align:right;">$$\displaystyle (Eq.8.3) $$
 * }
 * }

Find
Show that $$eq.8.1$$ and $$eq.8.2$$ are equivalent.

Solution
If we chose $$c_{i}$$ to be orthogonal, we have:

$$c_{1}=\begin{bmatrix}1,0,...,0 \end{bmatrix} $$

$$c_{2}=\begin{bmatrix}0,1,...,0 \end{bmatrix} $$

$$c_{3}=\begin{bmatrix}0,0,...,1 \end{bmatrix} $$

When we multiply $$c_{i}$$ times $$b_{i}$$ we observe that multiply by $$c$$ is equivalent to multiplying by the identity matrix, therefore replacing $$w^{f}(x)$$ in $$\displaystyle Eq. 8.1$$ we have:


 * {| style="width:100%" border="0"

$$\int_{\Omega}^{ }w^{h}(x)P(U^{h}(x))dx=\int_{\Omega}^{ }\sum_{i=1}^{n}c_{i}b_{i}(x)P(U^{h}(x))dx=\int_{\Omega}^{ }I.b.P(U^{h}(x))dx=\int_{\Omega}^{ }b_{i}P(U^{h}(x))dx$$
 * style="width:2%; padding:1px; border:2px solid #FF0000" |
 * style="width:2%; padding:1px; border:2px solid #FF0000" |


 * <p style="text-align:right;">$$\displaystyle (Eq. 8.4) $$
 * style= |
 * }

=Problem 9=

Given
Solving a differential equation using Weight Residual Form. From lecture 12

The partial differential equation is:


 * {| style="width:100%" border="0"

$$ \frac{\partial}{\partial x}\left(2\frac{\partial u}{\partial x}\right) + 3 = 0 $$
 * <p style="text-align:right;">$$\displaystyle (Eq.9.1) $$
 * }
 * }

The boundary conditions are:

$$ u\left(1\right) = 0$$

$$\frac{du}{dx}\left(0\right) = -4 $$

As weighting funtion should be used:


 * {| style="width:100%" border="0"

$$ b_{i} = \cos\left ( ix+\phi \right ) $$
 * <p style="text-align:right;">$$\displaystyle (Eq.9.2) $$
 * }
 * }

We will use $$\phi = \frac{\pi}{4}$$

Find

 * 9.1 Find an approximate solution of the form $$U^{h}=\sum_{i=0}^{n}d_{i}b_{i}$$ for n=2
 * 9.2 Find two equations that enforce the boundary conditions
 * 9.3 Project the weight residues
 * 9.4 Display the equations in matrix form
 * 9.5 Solve for $$\displaystyle d $$
 * 9.6 Construct $$U^{h}$$ and plot $$U^{h}$$ and $$u$$
 * 9.7 Repeat 9.1 to 9.6 for n = 4 and n = 6

9.1 Find an approximate solution with n=2
When n = 2 we have:
 * {| style="width:100%" border="0"

$$ d_{i}=\begin{bmatrix} d0 & d1 & d2 \end{bmatrix} $$
 * <p style="text-align:right;">$$\displaystyle (Eq.9.3) $$
 * }
 * }

and


 * {| style="width:100%" border="0"

$$ b_{i}=\begin{bmatrix} \cos \left (  \frac{\pi}{4}\right )& \cos  \left ( x+ \frac{\pi}{4}\right ) & \cos  \left ( 2x+ \frac{\pi}{4}\right ) \end{bmatrix} $$
 * <p style="text-align:right;">$$\displaystyle (Eq.9.4) $$
 * }
 * }

Therefore:
 * {| style="width:100%" border="0"

$$ U^{h}=d0\cos \left (\frac{\pi }{4} \right )+d1\cos \left ( x+\frac{\pi }{4} \right )+d2\cos \left ( 2x+\frac{\pi }{4} \right ) $$
 * style="width:2%; padding:1px; border:2px solid #FF0000" |
 * style="width:2%; padding:1px; border:2px solid #FF0000" |


 * <p style="text-align:right;">$$\displaystyle (Eq. 9.5) $$
 * style= |
 * }

9.2 Find two equations that enforce the boundary conditions
The boundary conditions are:
 * {| style="width:100%" border="0"

$$u(1)= 0 =d0\cos \left (\frac{\pi }{4} \right )+d1\cos \left ( 1+\frac{\pi }{4} \right )+d2\cos \left ( 2+\frac{\pi }{4} \right ) $$
 * style="width:2%; padding:1px; border:2px solid #FF0000" |
 * style="width:2%; padding:1px; border:2px solid #FF0000" |


 * <p style="text-align:right;">$$\displaystyle (Eq. 9.6) $$
 * style= |
 * }

And
 * {| style="width:100%" border="0"

$$ \frac{du}{dx}(0)=-4 = -d1\sin \left ( \frac{\pi }{4} \right )-2d2\sin \left ( \frac{\pi }{4} \right ) $$
 * style="width:2%; padding:1px; border:2px solid #FF0000" |
 * style="width:2%; padding:1px; border:2px solid #FF0000" |


 * <p style="text-align:right;">$$\displaystyle (Eq. 9.7) $$
 * style= |
 * }

9.3 Project the weight residues
In this case changing the function u(x) by the approximated function $$U^{h}$$ in the PDE (Eq.9.1), we found that P(u) is:


 * {| style="width:100%" border="0"

$$ P\left ( U^{h} \right )=2\frac{\partial^2 U^{h}}{\partial x^2}+3=-2\left ( d1\cos \left (x+ \frac{\pi }{4} \right ) +4d2\cos \left (2x+ \frac{\pi }{4} \right )\right )+3 $$
 * <p style="text-align:right;">$$\displaystyle (Eq.9.8) $$
 * }
 * }

The equation 9.8 can be written as:


 * {| style="width:100%" border="0"

$$ P\left ( U^{h} \right )= -2\begin{bmatrix}0 & \cos \left (x+ \frac{\pi }{4} \right ) & 4\cos \left (2x+ \frac{\pi }{4} \right ) \end{bmatrix}\begin{bmatrix} d0\\ d1\\

d2\end{bmatrix}+3 $$
 * <p style="text-align:right;">$$\displaystyle (Eq.9.9) $$
 * }
 * }

Projecting the residue we have:


 * {| style="width:100%" border="0"

$$ \int_{a}^{b}b(x)P\left ( U^{h} \right )= 0 $$ After substitution of (Eq.9.4) and (Eq.9.9) in (Eq.9.10) the following equation is obtained
 * <p style="text-align:right;">$$\displaystyle (Eq. 9.10) $$
 * }
 * }
 * {| style="width:100%" border="0"

$$ 2\int_{0}^{1}\begin{bmatrix} \cos\left ( \frac{\pi }{4} \right ) \\\cos \left (x+ \frac{\pi }{4} \right ) \\ \cos \left ( 2x+\frac{\pi }{4} \right )
 * style="width:2%; padding:1px; border:2px solid #FF0000" |
 * style="width:2%; padding:1px; border:2px solid #FF0000" |

\end{bmatrix}\begin{bmatrix} 0 &\cos \left (  x+\frac{\pi }{4}\right ) & 4\cos \left ( 2x+\frac{\pi }{4} \right )\end{bmatrix}dx\begin{bmatrix} d0\\ d1\\

d2\end{bmatrix}=3\int_{0}^{1} \begin{bmatrix} \cos \left ( \frac{\pi }{4} \right )\\ \cos\left ( x+\frac{\pi }{4} \right ) \\

\cos \left ( 2x+\frac{\pi }{4} \right )\end{bmatrix}dx $$


 * <p style="text-align:right;">$$\displaystyle (Eq. 9.11) $$
 * style= |
 * }

9.4 Display the equations in matrix form
Performing the product and then the integration indicated in (Eq.9.11) we have:
 * {| style="width:100%" border="0"

$$ \begin{bmatrix} 0 & \cos\left ( 1 \right )+\sin\left (1 \right )  -1 & 2\cos\left (2  \right )+2\sin \left (2  \right )-2 \\ 0 & -\frac{1}{2} -\frac{1}{2}\sin \left (1 \right )^{2} +\frac{1}{2}\cos \left (1  \right )^{2}& -\frac{4}{3}+4\sin \left ( 1 \right )+\frac{4}{3}\cos\left ( 3 \right ) \\ 0 & -\frac{1}{3}+\sin \left ( 1\right ) +\frac{1}{3}\cos\left ( 3 \right )& 3-\sin \left ( 2 \right )^{2}+\cos \left ( 2 \right )^{2} \end{bmatrix}\begin{bmatrix} d0\\ d1\\
 * style="width:2%; padding:1px; border:2px solid #FF0000" |
 * style="width:2%; padding:1px; border:2px solid #FF0000" |

d2\end{bmatrix}=\begin{bmatrix} 2.121\\ 0.809\\

-0.537\end{bmatrix} $$


 * <p style="text-align:right;">$$\displaystyle (Eq. 9.12) $$
 * style= |
 * }

The latter equation is clearly of the form $$\displaystyle Kd=F$$. We can observe that K is not symmetric.

9.5 Solve for $$ d $$
In (Eq.9.12) we have three equations; but, as we need to enforce the boundary conditions we take the only one of them and solve it together with (Eq.9.6) and (Eq.9.7). From these equations we now have the system:


 * {| style="width:100%" border="0"

$$ \begin{bmatrix} \cos\left (\frac{\pi }{4} \right )  &\cos\left (1+\frac{\pi }{4}  \right )   & \cos\left (2+\frac{\pi}{4}  \right ) \\ 0 &\sin \left (\frac{\pi}{4} \right )  &2\sin \left (\frac{\pi}{4}  \right ) \\ 0 & 0.3818 & -1.0137 \end{bmatrix}\begin{bmatrix} d0\\ d1\\

d2\end{bmatrix}=\begin{bmatrix} 0\\ 4\\

2.12\end{bmatrix}$$
 * <p style="text-align:right;">$$\displaystyle (Eq.9.13) $$
 * }
 * }

After solving the system in (Eq.9.13) we obtain d:
 * {| style="width:100%" border="0"

$$\begin{bmatrix} d0\\ d1\\
 * style="width:2%; padding:1px; border:2px solid #FF0000" |
 * style="width:2%; padding:1px; border:2px solid #FF0000" |

d2\end{bmatrix}=\begin{bmatrix} 1.71\\ 5.61\\ 0.02 \end{bmatrix}$$


 * <p style="text-align:right;">$$$$
 * style= |
 * }

9.6 Construct $$U^{h}$$ and plot $$U^{h}$$ and $$u$$
Replacing d in (Eq.9.5) we obtain the approximated solution:


 * {| style="width:100%" border="0"

$$ U^{h}=1.71\cos \left (\frac{\pi }{4} \right )+5.61\cos \left ( x+\frac{\pi }{4} \right )+0.02\cos \left ( 2x+\frac{\pi }{4} \right ) $$
 * <p style="text-align:right;">$$\displaystyle (Eq.9.14) $$
 * }
 * }

On the other hand, the exact solution of the PDE (Eq.9.1) with the given boundary condition is:


 * {| style="width:100%" border="0"

$$ u\left ( x \right )=-\frac{3}{4}x^{2}-4x+\frac{19}{4} $$
 * <p style="text-align:right;">$$\displaystyle (Eq.9.15) $$
 * }
 * }

In Fig.9.1 we show the exact and the approximated solution.



9.7 Repeat 9.1 to 9.6) for i = 4 and i = 6
Now we repeat the procedure using i = 4 and i=6 in Eq.9.4

As the procedure is the same shown before, we develop a routine using Matlab to perform the products, the integration and to solve the system of equations. The routine is show in the appendix.

Fig.9.2 and Fig.9.3 shown the numerical solution for i = 4 and i = 6 respectively. It can be clearly seen that as the number of terms used in (Eq.9.4) the agreement between the analytical and numerical solution is better.

Fig.9.4 Show the error at x = 0.5 as funtion of the number of terms used in Eq.9.4. Clearly the error tends to be 0 as the number of terms increases. The error shown in Fig.9.4 was calculated as the absolute value of the difference between the analytical and the numerical solution at x = 0.5

 Plots: 



=Appendix=

 Matlab Code: 

=Team Member's Contributions=


 * Abhijeet Bhalerao
 * James Roark
 * Cedric Adam
 * Harrison Sheffield
 * Yu Hao
 * Fernando Casanova