User:Egm6321.f10.team2.oztekin/Neww

=Problem 2.9=

Given
Problem statement is given as :


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

$$  \displaystyle \Omega =\left] 0,1 \right[ $$     (9.1)
 * style="width:95%" |
 * style="width:95%" |
 * 
 * }


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

$$  \displaystyle a_{2}=2 $$     (9.2)
 * style="width:95%" |
 * style="width:95%" |
 * 
 * }
 * {| style="width:100%" border="0"

$$  \displaystyle f=3 $$     (9.3)
 * style="width:95%" |
 * style="width:95%" |
 * 
 * }
 * {| style="width:100%" border="0"

$$  \displaystyle \frac{\partial^2 u(x,t)}{\partial x^2}=0 $$     (9.4)
 * style="width:95%" |
 * style="width:95%" |
 * 
 * }
 * {| style="width:100%" border="0"

$$  \displaystyle \Gamma _{g}={1},g=0 $$     (9.5)
 * style="width:95%" |
 * style="width:95%" |
 * 
 * }
 * {| style="width:100%" border="0"

$$  \displaystyle \Gamma _{h}={0},h=4 $$     (9.6)
 * style="width:95%" |
 * style="width:95%" |
 * 
 * }

Find

 * Let n=2 and ndof=2+1=3


 * Find 2 equations that enforce boundry conditions.


 * Find one more equation


 * Display three equations in matrix form


 * Solve for $$\displaystyle \underline{d} $$


 * Construct $$\displaystyle u_{n}^{h}(x) $$ and plot approximate and exact solutions.


 * Repeat n=4,n=6

Exact Solution

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

$$  \displaystyle P(u):=\frac{\partial }{\partial x}\left[ {{a}_{2}}(x)\frac{\partial u}{\partial x} \right]+f(x,t)-m\frac{{{\partial }^{2}}u}{{{\partial }^{2}}x} $$     (9.7)
 * style="width:95%" |
 * style="width:95%" |
 * 
 * }
 * {| style="width:100%" border="0"

$$  \displaystyle P(u)=\frac{\partial u}{\partial x}\left[ 2\frac{\partial u}{\partial x} \right]+3-0=0 $$     (9.8)
 * style="width:95%" |
 * style="width:95%" |
 * 
 * }
 * {| style="width:100%" border="0"

$$  \displaystyle 2\frac{\partial u}{\partial x}=-\int 3dx $$     (9.9)
 * style="width:95%" |
 * style="width:95%" |
 * 
 * }
 * {| style="width:100%" border="0"

$$  \displaystyle \frac{\mathrm{d} u}{\mathrm{d} x}=-\frac{3}{2}x+c $$     (9.10)
 * style="width:95%" |
 * style="width:95%" |
 * 
 * }
 * {| style="width:100%" border="0"

$$  \displaystyle -\frac{du(x=0)}{dx}=4 $$     (9.11)
 * style="width:95%" |
 * style="width:95%" |
 * 
 * }
 * {| style="width:100%" border="0"

$$  \displaystyle \frac{\mathrm{d} u}{\mathrm{d} x}=-\frac{3}{2}x-4 $$     (9.12)
 * style="width:95%" |
 * style="width:95%" |
 * 
 * }
 * {| style="width:100%" border="0"

$$  \displaystyle u(x)=-\frac{3x^2}{4}-4x+c_{2} $$     (9.13)
 * style="width:95%" |
 * style="width:95%" |
 * 
 * }
 * {| style="width:100%" border="0"

$$  \displaystyle u(x=1)=0 $$     (9.14)
 * style="width:95%" |
 * style="width:95%" |
 * 
 * }
 * {| style="width:100%" border="0"

$$  \displaystyle u(x)=-\frac{3x^2}{4}-4x+\frac{19}{4} $$     (9.15)
 * style="width:95%" |
 * style="width:95%" |
 * 
 * }

Approximate Solution

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

$$  \displaystyle {{u}^{h}}(x)=\sum\limits_{j=0}^{2}{{{d}_{j}}{{b}_{j}}(x)} $$     (9.16)
 * style="width:95%" |
 * style="width:95%" |
 * 
 * }
 * {| style="width:100%" border="0"

$$  \displaystyle u^{h}(x)=d_{0}cos(\Phi )+d_{1}cos(x+\Phi )+d_{2}cos(2x+\Phi ) $$     (9.17)
 * style="width:95%" |
 * style="width:95%" |
 * <p style="text-align:right">
 * }


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

$$  \displaystyle P(u^{h}(x))\neq 0 $$     (9.18) To observe 2 equations we can apply boundry conditions to our approximate solution
 * style="width:95%" |
 * style="width:95%" |
 * <p style="text-align:right">
 * }
 * {| style="width:100%" border="0"

$$  \displaystyle u(x=1)=0 $$     (9.19)
 * style="width:95%" |
 * style="width:95%" |
 * <p style="text-align:right">
 * }
 * {| style="width:100%" border="0"

$$  \displaystyle d_{0}cos(\Phi )+d_{1}cos(1+\Phi )+d_{2}cos(2+\Phi )=0 $$     (9.20)
 * style="width:95%" |
 * style="width:95%" |
 * <p style="text-align:right">
 * }
 * {| style="width:100%" border="0"

$$  \displaystyle \frac{du^{h}(x=0)}{dx}=-4 $$     (9.21)
 * style="width:95%" |
 * style="width:95%" |
 * <p style="text-align:right">
 * }
 * {| style="width:100%" border="0"

$$  \displaystyle \frac{du^{h}}{dx}=-d_{1}sin(x+\Phi )-2d_{2}sin(2x+\Phi ) $$     (9.22)
 * style="width:95%" |
 * style="width:95%" |
 * <p style="text-align:right">
 * }
 * {| style="width:100%" border="0"

$$  \displaystyle -4=-d_{1}sin(\Phi )-2d_{2}sin(\Phi ) $$     (9.23) Now we have to need one more equation for our three unknowns. This can be gained by projecting the residue on a basis function. We can take $$\displaystyle b_{0}$$ for our convenience.
 * style="width:95%" |
 * style="width:95%" |
 * <p style="text-align:right">
 * }
 * {| style="width:100%" border="0"

$$  \displaystyle \int_{\Omega }b_{k}(x).P(u^{h}(x))dx=0,k=0,1,2 $$     (9.24) Lets take k=0 and
 * style="width:95%" |
 * style="width:95%" |
 * <p style="text-align:right">
 * }
 * {| style="width:100%" border="0"

$$  \displaystyle P(u^{h}(x))=\frac{d}{dx}\left [ 2\frac{d}{dx}\left ( d_{0}cos(\Phi )+d_{1}cos(x+\Phi )+d_{2}cos(2x+\Phi ) \right ) \right ]+3 $$     (9.25)
 * style="width:95%" |
 * style="width:95%" |
 * <p style="text-align:right">
 * }
 * {| style="width:100%" border="0"

$$  \displaystyle =-2d_{1}cos(x+\Phi )-8d_{2}cos(2x+\Phi )+3 $$     (9.26) Projection:
 * style="width:95%" |
 * style="width:95%" |
 * <p style="text-align:right">
 * }
 * {| style="width:100%" border="0"

$$  \displaystyle \int_{0}^{1}(cos(\Phi ))(-2d_{1}cos(x+\Phi )-8d_{2}cos(2x+\Phi )+3)dx=0 $$     (9.27)
 * style="width:95%" |
 * style="width:95%" |
 * <p style="text-align:right">
 * }
 * {| style="width:100%" border="0"

$$  \displaystyle =[-2d_{1}cos(\Phi )sin(x+\Phi )-4d_{2}cos(\Phi )sin(2x+\Phi )+3cos(\Phi )]|_{0}^{1} $$     (9.28)
 * style="width:95%" |
 * style="width:95%" |
 * <p style="text-align:right">
 * }
 * {| style="width:100%" border="0"

$$  \displaystyle =2d_{1}cos\Phi \left [ sin\Phi -sin(\Phi +1) \right ]+4d_{2}\left [ sin\Phi -sin(2+\Phi ) \right ]+3cos\Phi $$     (9.29) If we consider what we get so far, we have three equations for three unknowns. Now we can construct matrix form and solve for unknowns.
 * style="width:95%" |
 * style="width:95%" |
 * <p style="text-align:right">
 * }


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

$$  \displaystyle \left[ \begin{matrix} \begin{matrix} \cos \phi & \cos (1+\phi ) & \cos (2+\phi )  \\ \end{matrix} \\ \begin{matrix} 0 & -\sin \phi & -2\sin \phi   \\ \end{matrix} \\ \begin{matrix} 0 & 2\cos \phi [\sin \phi -\sin (\phi +1)] & 4[\sin \phi -\sin (2+\phi )] \\ \end{matrix} \\ \end{matrix} \right]\left[ \begin{matrix} {{d}_{0}} \\ {{d}_{1}} \\ {{d}_{2}} \\ \end{matrix} \right]=\left[ \begin{matrix} 0 \\   -4  \\   -3\cos \phi   \\ \end{matrix} \right]
 * style="width:95%" |
 * style="width:95%" |

$$     (9.30) Case 1:$$\displaystyle \Phi =\Pi /4$$
 * <p style="text-align:right">
 * }
 * {| style="width:100%" border="0"

$$  \displaystyle \underline{d}=\left[ \begin{matrix} 1.7163 \\   5.622  \\   0.0174  \\ \end{matrix} \right] $$     (9.31)
 * style="width:95%" |
 * style="width:95%" |
 * <p style="text-align:right">
 * }
 * {| style="width:100%" border="0"

$$  \displaystyle u^{h}(x)=1.7163cos(\Pi /4)+5.622cos(x+\Pi /4)+0.0174cos(2x+\Pi /4) $$     (9.32)
 * style="width:95%" |
 * style="width:95%" |
 * <p style="text-align:right">
 * }



Case 2:$$\displaystyle \Phi =\Pi /2$$


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

$$  \displaystyle \underline{d}=\left[ \begin{matrix} 549.69 \\   -18.1334  \\   18.25  \\ \end{matrix} \right]
 * style="width:95%" |
 * style="width:95%" |

$$     (9.33)
 * <p style="text-align:right">
 * }
 * {| style="width:100%" border="0"

$$  \displaystyle u^{h}(x)=5.4969cos(\Pi /4)+18.1334cos(x+\Pi /4)-6.9867cos(2x+\Pi /4) $$     (9.34)
 * style="width:95%" |
 * style="width:95%" |
 * <p style="text-align:right">
 * }

n=4

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

$$  \displaystyle u^{h}(x)=d_{o}cos\Phi +d_{1}cos(x+\Phi )+d_{2}cos(2x+\Phi )+d_{3}cos(3x+\Phi )+d_{4}cos(4x+\Phi ) $$     (N)
 * style="width:95%" |
 * style="width:95%" |
 * <p style="text-align:right">
 * }
 * {| style="width:100%" border="0"

$$  \displaystyle 0=d_{o}cos\Phi +d_{1}cos(1+\Phi )+d_{2}cos(2+\Phi )+d_{3}cos(3+\Phi )+d_{4}cos(4+\Phi ) $$     (N)
 * style="width:95%" |
 * style="width:95%" |
 * <p style="text-align:right">
 * }
 * {| style="width:100%" border="0"

$$  \displaystyle \frac{du^{h}}{dx}=-4 $$     (N)
 * style="width:95%" |
 * style="width:95%" |
 * <p style="text-align:right">
 * }
 * {| style="width:100%" border="0"

$$  \displaystyle 4=d_{1}sin\Phi +2d_{2}sin\Phi +3d_{3}sin\Phi +4d_{4}sin\Phi $$     (N)
 * style="width:95%" |
 * style="width:95%" |
 * <p style="text-align:right">
 * }


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

$$  \displaystyle P(u)=\frac{d}{dx}\left [ 2\frac{d}{dx}\left ( d_{0}cos\Phi +d_{1}cos(x+\Phi )+d_{2}cos(2x+\Phi )+d_{3}cos(3x+\Phi )+d_{4}cos(4x+\Phi ) \right ) \right ]+3 $$     (N)
 * style="width:95%" |
 * style="width:95%" |
 * <p style="text-align:right">
 * }
 * {| style="width:100%" border="0"

$$  \displaystyle =-2d_{1}cos(x+\Phi )-8d_{2}cos(2x+\Phi )-18d_{3}cos(3x+\Phi )-32d_{4}cos(4x+\Phi ) $$     (N)
 * style="width:95%" |
 * style="width:95%" |
 * <p style="text-align:right">
 * }