User:Eml5526.s11.team4.rhee/HW5

= Problem 5.2 - G1DM1.0/D1 using WF =

Problem Statement
Solve G1DM1.0/D1 using WF with appropriate basis function (Poly, Fourier, Exp), until convergence of $$u^h(0.5)$$ to $$O(10^{-6})$$.

Boundary Conditions
The boundary conditions are

Solution
Starting with the differential equation 3 from page 9-2 in the notes

Applying the boundary condition, $$-2du/dx(x=0)=12$$

Applying the boundary condition $$u(1)=4$$

Plot


Using Discrete WF, find $$ \left\{\mathbf{d_j}\right\} $$ st $$u^h(\beta)=\sum_{j}\mathbf{d_j}(t)\mathbf{b_j}(\beta)=g \quad $$ and

where




 * $$\mathbf{K_{ij}}=\int_{0}^{1}\mathbf{b_i}'a_2\mathbf{b_j}'dx$$
 * $$\mathbf{F_i}=\mathbf{b_i(\alpha)}h+\int_{0}^{1}\mathbf{b_i}fdx$$
 * }
 * $$\mathbf{F_i}=\mathbf{b_i(\alpha)}h+\int_{0}^{1}\mathbf{b_i}fdx$$
 * }

Polynomial basis function

 * $$\mathfrak{F}_{p}=\left\{(x-1)^i,i=0,1,2,...,n\right\}$$

When n = 8, $$ Error \approx 0.1\times 10^{-6} $$


 * $$K_{ij}\approx \begin{bmatrix}

3.5 & -3 & 2.75 & -2.6 & 2.5 & -2.42 & 2.37 & -2.33\\ -3 & 3.66 & -3.9 & 4 & -4.04 & 4.07 & -4.08 & 4.08\\ 2.75 & -3.9 & 4.5 & -4.85 & 5.08 & -5.25 & 5.36 & -5.45\\ -2.6 & 4 & -4.85 & 5.42 & -5.83 & 6.13 & -6.36 & 6.54\\ 2.5 & -4.04 & 5.08 & -5.83 & 6.38 & -6.81 & 7.15 & -7.43\\ -2.42 & 4.07 & -5.25 & 6.13 & -6.81 & 7.36 & -7.80 & 8.17\\ 2.37 & -4.08 & 5.36 & -6.36 & 7.15 & -7.8 & 8.34 & -8.8\\ -2.33 & 4.08 & -5.45 & 6.54 & -7.43 & 8.17 & -8.8 & 9.33 \end{bmatrix}, \quad for \quad i,j=1,2,...,8 $$


 * $$F_{i}\approx \begin{bmatrix}

-12.83\\ 12.41\\ -12.25\\ 12.16\\ -12.11\\ 12.08\\ -12.06\\ 12.05 \end{bmatrix}

\qquad d_{j}\approx\begin{bmatrix} -2.89\\ 0.37\\ -0.27\\ 0.32\\ 0.43\\ 0.81\\ 0.61\\ 0.22 \end{bmatrix}, \quad d_0=4$$

Therefore,

Plot
The following figure shows $$ u^h(x)$$ The following figure shows the error vs n.


 * $$ Error\approx \begin{bmatrix}

-0.239809504267762\\ -0.008831243398196\\ 0.007978831249932\\ 0.000140951761964\\ -0.000263703709527\\ -0.000003409109291\\ 0.000009890451250\\ 0.000000100788939 \end{bmatrix}$$



Fourier basis function

 * $$\mathfrak{F}_{f}=\left\{1, cos\frac{(2j-1)\pi x}{2}, sin(k\pi x) ,j,k=1,2,...\right\}$$

Likewise, the following figure shows the error vs n.



When n=9, the error is $$0.000004240676477$$.

The following figure is $$ u^h(x) $$

Exponential basis function

 * $$\mathfrak{F}_{e}=\left\{1, e^{i(x-1)}-1 ,i=1,2,...\right\}$$

When n = 12, $$ Error \approx 0.63\times 10^{-6} $$ and that is,


 * $$ Error\approx \begin{bmatrix}

-0.297066776970831\\ -0.114733443435346\\ 0.0165040777664232\\ 0.012641225491135\\ 0.000082171723276\\ -0.001243314977745\\ -0.000190989291357\\ 0.000100445865361\\ 0.000035683793041\\ -0.000005235050710\\ -0.000004723596919\\ -0.000000063082541 \end{bmatrix}$$

Plot
The following figure shows the error vs n. The following figure shows $$ u^h(x)$$

I will show 4 figures when n=1,2,3,4 to see how $$ u^h(x)$$ change.