User:Eml5526.s11.team3/Homework 2

 Homework 2

=--Problem 2.1--=

Problem Statment
From notes 6-2: Derive heat problem in 1-D, i.e, (1) p.4-2

Where $$m = \rho A$$

Solution
Energy balance for a control volume can be written as: heat generated + heat flow in - heat flow out = 0

Balance of heat: heat flow into a control volume (H1) + heat generated (H2) = heat due to change in temperature (H3)

Heat due to change in temperature: $$H3 = A(x) \rho(x) c\frac{\partial u}{\partial t}$$

Rearranging H1 and H2 we get:

If we take the limit as $$\Delta x$$ → 0, then we get:

Using Fourier's Law,

and also knowing that $$s$$ is a function of $$x$$ and $$t$$:

This becomes:

Problem solved by EML5526.S11.Team3.risher and Eml5526.s11.team3.perry.

Reference
Used wolframalph to do matrix math.

Solution
From balance of heat, we have following:

Where $${{H}_{1}}$$ represent the flow in heat minus the flow out heat, $${{H}_{2}}$$ stands for the heat generated inside the volume, $${{H}_{3}}$$ is the heat due to the change of temperature.

Using Taylor Series to expand above terms, we can get

Hence, we have

Neglect the higher order term, we hence have

By Fourier's Law, We have

Finally, we get the PDE of heat problem in $$ 1-D$$ case.

Problem solved by Hailong Chen.

Reference
1.Taylor Series 2.Fourier's Law

=--Problem 2.2--=

Problem Statement
From notes 7-3 and 7-4:

1.) Find $$det \left[ b_{jk} \right]$$

2.) Find $$ \underline{ \Gamma } (\underline{b}_{1},\underline{b}_{2},\underline{b}_{3}) = \underline{K}, det \underline{ \Gamma }$$

3.) $$ \underline{F} = \left[ F_{i} \right] = \left[ \underline{b}_{i} * \underline{v} \right]   $$

4.) Solve (5) on p. 7-2 for $$ \underline{d} = \left[ v_{j} \right] $$

(5) on p. 7-2 : $$ \underline{K} \underline{d} = \underline{F} $$

5.) Use $$ \underline{w}_{i} * \underline{P} (\underline{v}) = 0 $$, $$ \forall_{i} = 1, ..., n $$ to find $$ \bar { \underline{K}} \underline{d} = \bar{ \underline{F}} $$

What is $$ \bar{ \underline{K} } $$ and $$ \bar{ \underline{F} } $$ ? Note: $$ \underline{d} = \left[ v_{j} \right] $$

6.) Solve for $$ \underline{d} $$; compare to $$ \underline{d} $$ in part 4.)

7.) Observe symetric properties of $$ \underline{K} $$ and $$ \bar{ \underline{K} } $$

Discuss pros and cons of the 2 methods

Note: (5) p. 7-2 → Bubnov-Galerkin

$$ \underline{K} \underline{d} = \underline{F} $$

Note: (2) p. 7-4 → Petrov-Galerkin

$$ \bar { \underline{K}} \underline{d} = \bar{ \underline{F}} $$

Solution
(1)

(2)

$$ \underline{b}_{j} = b_{jk}\underline{a}_{k} $$

$$ \underline{ \Gamma } (\underline{b}_{1},\underline{b}_{2},\underline{b}_{3}) = \underline{K} = K_{ij}=\underline{b}_{i}.\underline{b}_{j}$$

$$ \underline{b}_{i}.\underline{b}_{j}=\underline{b}_{i}.\underline{b}_{i}^T = \left[\begin{matrix} 1 & 1 & 1 \\ 2 & -1 & 3 \\ 3 & 2 & 6 \\ \end{matrix}\right]$$ $$\left[\begin{matrix} 1 & 2 & 3 \\ 1 & -1 & 2 \\ 1 & 3 & 6 \\ \end{matrix}\right]$$ $$=\left[\begin{matrix} 3 & 4 & 11 \\ 4 & 14 & 22 \\ 11 & 22 & 49 \\ \end{matrix}\right]$$

$$ \underline{ \Gamma } (\underline{b}_{1},\underline{b}_{2},\underline{b}_{3}) = \underline{K} = \left[\begin{matrix} 3 & 4 & 11 \\ 4 & 14 & 22 \\ 11 & 22 & 49 \\ \end{matrix}\right]$$

(3)

$$\underline{F}=\underline{b}_{i}*\underline{v}$$

$$\underline{F}= \left[\begin{matrix} 1 & 1 & 1 \\ 2 & -1 & 3 \\ 3 & 2 & 6 \\ \end{matrix}\right]$$ $$ \left[\begin{matrix} 5 \\ -7  \\ -4  \\ \end{matrix}\right]$$

(4)

$$ \underline{K} \underline{d} = \underline{F} $$

$$ \underline{d} = \underline{K}^{-1} \underline{F} $$

$$\underline{d}= \left[\begin{matrix} 3 & 4 & 11 \\ 4 & 14 & 22 \\ 11 & 22 & 49 \\ \end{matrix}\right]^{-1}$$ $$\left[\begin{matrix} -6 \\ 5 \\ -23 \\ \end{matrix}\right]$$ $$=\left[\begin{matrix} 8.375 \\ 5.625 \\ -4.875 \\ \end{matrix}\right]$$

(5)

Using $$\underline{w}_{i}=\underline{a}_{i}$$ where i = 1,2,...,n and $$\underline{a}_{i}$$ is orthonormal basis:

$$\underline{a}_{i}=\left[\begin{matrix} 1 & 0 & 0 \\ 0 & 1 & 0 \\ 0 & 0 & 1 \\ \end{matrix}\right]$$

Looking at

$$ \bar{\underline{K}} \underline{d} = \bar{\underline{F}} $$

We can express this as:

$$ \left[\begin{matrix} 1 & 0 & 0 \\ 0 & 1 & 0 \\ 0 & 0 & 1 \\ \end{matrix}\right]$$ $$\left[\begin{matrix} 1 & 2 & 3 \\ 1 & -1 & 2 \\ 1 & 3 & 6 \\ \end{matrix}\right]\underline{d}$$ $$=\left[\begin{matrix} 1 & 0 & 0 \\ 0 & 1 & 0 \\ 0 & 0 & 1 \\ \end{matrix}\right]$$ $$\left[\begin{matrix} 5 \\ -7 \\ -4 \\ \end{matrix}\right]$$

Which is simplified to:

$$\left[\begin{matrix} 1 & 2 & 3 \\ 1 & -1 & 2 \\ 1 & 3 & 6 \\ \end{matrix}\right]\underline{d}$$ $$=\left[\begin{matrix} 5 \\ -7 \\ -4 \\ \end{matrix}\right]$$

Where:

(6)

$$ \bar{\underline{K}} \underline{d} = \bar{\underline{F}} $$

$$ \underline{d} = \bar{\underline{K}}^{-1} \bar{\underline{F}} $$

$$\underline{d}=\left[\begin{matrix} 1 & 2 & 3 \\ 1 & -1 & 2 \\ 1 & 3 & 6 \\ \end{matrix}\right]^{-1}$$ $$\left[\begin{matrix} 5 \\ -7 \\ -4 \\ \end{matrix}\right]$$ $$=\left[\begin{matrix} 8.375 \\ 5.625 \\ -4.875 \\ \end{matrix}\right]$$

Both $$\underline{d}$$ for each case are equal, which makes since.

(7)

$$\underline{K}$$ is always symmetric while $$\bar{\underline{K}}$$ is not. Due to this symmetry, the Bubnov-Galerkin method may be easier to solve, while the effort for finding $$\underline{K}$$ may be a little more labor intensive. The lack of symmetry in $$\bar{\underline{K}}$$ for the Petrov-Galerkin method may be difficult to solve, but it is very easy to find $$\bar{\underline{K}}$$.

Problem solved by EML5526.S11.Team3.risher and Eml5526.s11.team3.perry.

Reference
Used wolframalph to do matrix math.

=--Problem 2.3--=

Problem Statement
To show that $$ \underline{w} * \underline{P} (\underline{v}) = 0 $$ is equivalent to:

$$ \underline{a}_{i} * \underline{P} (\underline{v}) = 0 $$ $$ \forall_{i} = 1, ..., n $$

where {$$\underline{a_{i}}$$} is an orthonormal basis vector.

and $$ \underline{w} = \Sigma_{i} \beta_{i} \underline{a}_{i} $$ and $$ \forall \left[ \beta_{1}, ..., \beta_{n} \right] \in \mathbb{R}^n$$

Solution
It is given that $$\underline{\omega} = \sum_{i=1}^{n} \beta _{i}\underline{a_{i}}$$, where {$$ \underline{a_{i}} $$} is an orthonormal basis vector.

Then (1) p. 8-1 is equivalent to:
 * {| style="width:100%" border="0" align="left"


 * $$ \underline{w} * \underline{P} (\underline{v}) = 0 $$ $$ \forall $$ $$ \underline{w} = \Sigma_{i} \beta_{i} \underline{a}_{i} $$ $$\in \mathbb{R}^n$$
 * $$ \underline{w} * \underline{P} (\underline{v}) = 0 $$ $$ \forall $$ $$ \underline{w} = \Sigma_{i} \beta_{i} \underline{a}_{i} $$ $$\in \mathbb{R}^n$$


 * 

$$\displaystyle (Eq. 1) $$


 * }
 * }

From Eq.(1) substituting for $$\underline{\omega}$$, we get

$$\sum_{i=1}^{n} \beta _{i}\underline{a_{i}}$$* $$ \underline{P} (\underline{v})$$ = 0

Expanding we can write,
 * {| style="width:100%" border="0" align="left"


 * ($$ \beta _{1}\underline{a_1}+\beta _{2}\underline{a_2}+\beta _{3}\underline{a_3}+....\beta _{n}\underline{a_n}$$)*$$ \underline{P} (\underline{v})$$ = 0
 * ($$ \beta _{1}\underline{a_1}+\beta _{2}\underline{a_2}+\beta _{3}\underline{a_3}+....\beta _{n}\underline{a_n}$$)*$$ \underline{P} (\underline{v})$$ = 0


 * 

$$\displaystyle (Eq. 2) $$


 * }
 * }

Choice 1

Let $$\beta_1 = 1$$ and  $$\beta _2 = \beta _3=...\beta _n=0$$

Therefore, equation (1) can be written as-

$$\underline{a_1}.\underline{P}(\underline{v})=0$$

Choice 2

Let $$\beta_2 = 1$$ and  $$\beta _1 = \beta _3=...\beta _n=0$$

Therefore, equation (1) can be written as-

$$\underline{a_2}.\underline{P}(\underline{v})=0$$

.

.

Choice n

Let $$\beta_n = 1$$ and  $$\beta _1 = \beta _2=...\beta _{n-1}=0$$

Therefore, equation (1) can be written as-

$$\underline{a_n}.\underline{P}(\underline{v})=0$$

Hence we can state that :

$$ \underline{a}_{i} * \underline{P} (\underline{v}) = 0 $$  for $$ \forall_{i} = 1, ..., n $$

Problem solved by ushnish12.

=--Problem 2.4--=

Problem Statement
To solve for a G1DM1.0/D1 given in (3) in P 9-2

Given

An elastic bar of unit length is applied with a distributed load of $$f(x)=5x$$  along the axis of the bar, and linear variation of product of elastic modulus and area of the bar is given as  $$a_{2}(x)=2+3x$$

Boundary conditions

1) Essential boundary condition $$\gamma _{g}={1}, g=4$$ , which implies  $$ u(1)=4$$

2) Natural boundary condition $$\gamma _{h}={1}, h=6$$ , which implies  $$-\frac{\partial u(x=0)}{\partial x} =6 $$

Hence the above problem reduces to finding exact solution to the differential equation given by,

$$ \frac{\partial [(2+3x)\frac{\partial u}{\partial x}]}{\partial x}+5x=0 $$

$$ \forall x \in ] 0,1 [ $$

to solve the above differential equation we first solve the following integrals

1) $$\int lnxdx$$ 2) $$\int xlnxdx$$ 3) $$\int \frac{x^2}{1+cx}$$ 4) $$\int \frac{x^2}{a+bx}$$ 5) Find the exact solution of

$$ \frac{\partial [(2+3x)\frac{\partial u}{\partial x}]}{\partial x}+5x=0 $$

$$ \forall x \in ] 0,1 [ $$

$$ u(1)=4, -\frac{\partial u(x=0)}{\partial x} =6 $$

6) Plot u(x) 7) Show $$ \int_{} \frac{x^2}{1+x}dx = \frac{x^2}{2} - x +log(1+x) + k $$

1
$$\int lnxdx$$ To the solve the above integral we use Integration by parts method: {| style="width:100%" border="0" \int{u}dv =uv-\int{v}du $$ {| style="width:100%" border="0" where,
 * style="width:100%"
 * style="width:100%"
 * style="width:100%" |
 * style="width:100%" |

2
$$\int xlnxdx$$ we again use Integration by parts

here,

3
$$\int \frac{x^2}{1+cx}$$ here,

hence,

$$\int \frac{x^2}{1+cx}= \frac{x^2}{c}ln(1+cx)-\int \frac{2}{c}ln(1+cx)xdx$$

for, $$\int ln(1+cx)xdx$$

hence,

$$= \frac{x^2}{c}ln(1+cx)-\frac{2}{c}[[\frac{x}{c}(1+cx)ln(1+cx)-\frac{x}{c}(1+cx)]-\int \frac{((1+cx)ln(1+cx)-(1+cx))}{c}dx]$$

$$= \frac{x^2}{c}ln(1+cx)-\frac{2x}{c^2}(1+cx)ln(1+cx)+\frac{2x}{c^2}(1+cx)+\frac{2}{c^2}\int (1+cx)ln(1+cx)dx-\frac{2}{c^2}\int (1+cx)dx$$

for, $$\int (1+cx)ln(1+cx)dx$$

hence,

$$= \frac{x^2}{c}ln(1+cx)-\frac{2x}{c^2}(1+cx)ln(1+cx)+\frac{2x}{c^2}(1+cx)+\frac{2}{c^2}[\frac{(1+cx)^2ln(1+cx)}{2c}-\int \frac{(1+cx)^2cdx}{2c(1+cx)}]-\frac{2}{c^2}\int (1+cx)dx$$

$$= \frac{x^2}{c}ln(1+cx)-\frac{2x}{c^2}(1+cx)ln(1+cx)+\frac{2x}{c^2}(1+cx)+\frac{(1+cx)^2}{c^3}ln(1+cx)-\frac{1}{c^2}\int (1+cx)dx-\frac{2}{c^2}\int (1+cx)dx$$

$$=ln(1+cx)[\frac{x^2}{c}-\frac{2x}{c^2}(1+cx)+\frac{(1+cx)^2}{c^3}]+\frac{2x}{c^2}(1+cx)-\frac{3}{c^2}\int (1+cx)dx$$

$$=ln(1+cx)[\frac{x^2}{c}-\frac{2x}{c^2}-\frac{2x^2c}{c^2}+\frac{1}{c^3}+\frac{c^2x^2}{c^3}+\frac{2cx}{c^3}]+\frac{2x}{c^2}(1+cx)-\frac{3}{c^2}[\frac{(1+cx)^2}{2c}]$$

$$=ln(1+cx)[\frac{1}{c^3}]+\frac{2x}{c^2}+\frac{2x^2}{c}-\frac{3}{2c^3}[1+c^2x^2+2cx]$$

$$=ln(1+cx)[\frac{1}{c^3}]+\frac{2x}{c^2}+\frac{2x^2}{c}-\frac{3}{2c^3}-\frac{3x^2}{2c}-\frac{3x}{c^2}$$

$$=\frac{1}{c^3}ln(1+cx)+\frac{x^2}{2c}-\frac{x}{c^2}-\frac{3}{2c^3}$$

$$=\frac{2ln(1+cx)+x^2c^2-2cx}{2c^3}+constant$$

4
$$\int \frac{x^2}{a+bx}$$ here,

hence,

$$\int \frac{x^2}{a+bx}= \frac{x^2}{b}ln(a+bx)-\int \frac{2}{b}ln(a+bx)xdx$$

for, $$\int ln(a+bx)xdx$$

hence,

$$= \frac{x^2}{b}ln(a+bx)-\frac{2}{b}[[\frac{x}{b}(a+bx)ln(a+bx)-\frac{x}{b}(a+bx)]-\int \frac{((a+bx)ln(a+bx)-(a+bx))}{b}dx]$$

$$= \frac{x^2}{b}ln(a+bx)-\frac{2x}{b^2}(a+bx)ln(a+bx)+\frac{2x}{b^2}(a+bx)+\frac{2}{b^2}\int (a+bx)ln(a+bx)dx-\frac{2}{b^2}\int (a+bx)dx$$

for, $$\int (a+bx)ln(a+bx)dx$$

hence,

$$= \frac{x^2}{b}ln(a+bx)-\frac{2x}{b^2}(a+bx)ln(a+bx)+\frac{2x}{b^2}(a+bx)+\frac{2}{b^2}[\frac{(a+bx)^2ln(a+bx)}{2b}-\int \frac{(a+bx)^2bdx}{2b(a+bx)}]-\frac{2}{b^2}\int (a+bx)dx$$

$$= \frac{x^2}{b}ln(a+bx)-\frac{2x}{b^2}(a+bx)ln(a+bx)+\frac{2x}{b^2}(a+bx)+\frac{(a+bx)^2}{b^3}ln(a+bx)-\frac{1}{b^2}\int (a+bx)dx-\frac{2}{b^2}\int (a+bx)dx$$

$$=ln(a+bx)[\frac{x^2}{b}-\frac{2x}{b^2}(a+bx)+\frac{(a+bx)^2}{b^3}]+\frac{2x}{b^2}(a+bx)-\frac{3}{b^2}\int (a+bx)dx$$

$$=ln(a+bx)[\frac{x^2}{b}-\frac{2ax}{b}-\frac{2x^2b}{b^2}+\frac{a^2}{b^3}+\frac{b^2x^2}{b^3}+\frac{2abx}{b^3}]+\frac{2x}{b^2}(a+bx)-\frac{3}{b^2}[\frac{(a+bx)^2}{2b}]$$

$$=ln(a+bx)[\frac{a^2}{b^3}]+\frac{2ax}{b^2}+\frac{2x^2}{b}-\frac{3}{2b^3}[a^2+b^2x^2+2abx]$$

$$=ln(a+bx)[\frac{a^2}{b^3}]+\frac{2ax}{b^2}+\frac{2x^2}{b}-\frac{3a^2}{2b^3}-\frac{3x^2}{2b}-\frac{3ax}{b^2}$$

$$=\frac{a^2}{b^3}ln(a+bx)+\frac{x^2}{2b}-\frac{ax}{b^2}-\frac{3a^2}{2b^3}$$

$$=\frac{2a^2ln(a+bx)+x^2b^2-2bax}{2b^3}+constant$$

5
Find the exact solution of

$$ \frac{\partial [(2+3x)\frac{\partial u}{\partial x}]}{\partial x}+5x=0 $$

$$ \frac{\partial [(2+3x)\frac{\partial u}{\partial x}]}{\partial x}=-5x $$

Integrating the above expression we get,

$$ (2+3x)\frac{\partial u}{\partial x}=\frac{-5x^2}{2}+k1$$

$$\frac{\partial u}{\partial x}=\frac{-5x^2}{2(2+3x)}+\frac{k1}{2+3x}$$

given,

$$-\frac{\partial u(x=0)}{\partial x} =6$$

$$-6= 0+ \frac{k1}{2}$$

hence $$k1=-12$$

$$\frac{\partial u}{\partial x}=\frac{-5x^2}{2(2+3x)}+\frac{-12}{2+3x}$$

$$\partial u=\frac{-5x^2}{2(2+3x)}\partial x+\frac{k1}{2+3x}\partial x$$

Integrating the above equation

$$u=\frac{-5}{2}\int \frac{x^2}{2+3x}dx-12\int \frac{dx}{2+3x}$$

from (Eq.2) $$\int \frac{x^2}{a+bx}dx=\frac{2a^2ln(a+bx)+bx(bx-2a)}{2b^3}$$

hence $$\int \frac{x^2}{2+3x}dx=\frac{8ln(2+3x)+3x(3x-4)}{54}$$

$$u=\frac{-5}{2}[\frac{8ln(2+3x)+3x(3x-4)}{54}]-12[\frac{ln(2+3x)}{3}]+k2$$

$$u=\frac{-118}{27}ln(2+3x)-\frac{5x}{36}(3x-4)+k2$$

given $$ u(1)=4$$

$$4=\frac{-118}{27}ln(5)-\frac{5}{36}(-1)+k2$$

$$k2=10.89495$$

hence the exact solution is

6
Plot of u(x)



7
Show $$ \int_{} \frac{x^2}{1+x}dx = \frac{x^2}{2} - x +log(1+x) + k $$

The above integral is a special case if (Eq.2) where  $$a=b=1$$

hence,

$$\int \frac{x^2}{1+x}= \frac{2*1^2ln(1+x)+x(x-2)}{2*1^3}+constant$$

Problem Solved by akj.

=--Problem 2.5--=

Problem Statement
To show that

$$ \underline{b}_{i} * \underline{P} (\underline{v}) = 0 $$ where i=1, ..., n

is equivalent to

$$ \underline{w} * \underline{P} (\underline{v}) = 0 $$ where $$ \underline{w} = \Sigma_{i} \alpha_{i} \underline{b}_{i} $$

and $$ \forall \left[ \alpha_{1}, ..., \alpha_{n} \right] \in \mathbb{R}^n$$

Solution
It is given that-
 * {| style="width:100%" border="0" align="left"

|$$\displaystyle \underline{b}_{i} * \underline{P} (\underline{v}) = 0 $$  where   i = 1, ..., n $$
 * $$\displaystyle (Eq. 1)


 * }
 * }

Choice 1

Taking i=1, we get

$$ \underline{b}_{1} * \underline{P} (\underline{v}) = 0 $$

Multiplying both sides by $$\alpha _{1}$$ , we get-


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

|$$\displaystyle \alpha _{1}\underline{b}_{1} * \underline{P} (\underline{v}) = 0 $$ $$
 * $$\displaystyle (Eq. 2)


 * }
 * }

Choice 2

Taking i=2, we get

$$ \underline{b}_{2} * \underline{P} (\underline{v}) = 0 $$

Multiplying both sides by $$\alpha _{2}$$ , we get-


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

|$$\displaystyle \alpha _{2}\underline{b}_{2} * \underline{P} (\underline{v}) = 0 $$ $$
 * $$\displaystyle (Eq. 3)


 * }
 * }

......

......

......

Choice n

Taking i=n, we get

$$ \underline{b}_{n} * \underline{P} (\underline{v}) = 0 $$

Multiplying both sides by $$\alpha _{n}$$ , we get-


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

|$$\displaystyle \alpha _{n}\underline{b}_{n} * \underline{P} (\underline{v}) = 0 $$ $$
 * $$\displaystyle (Eq. 4)


 * }
 * }

Adding Equations 2 to 4, we get


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

|$$\displaystyle(\alpha _{1}\underline{b}_{1} + \alpha _{2}\underline{b}_{2} +\alpha _{n}\underline{b}_{n}$$) $$ *   \underline{P} (\underline{v}) = 0 $$ $$
 * $$\displaystyle (Eq. 5)


 * }
 * }

or we can write Eq(5) as -


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

|$$\displaystyle \sum_{i=1}^{n} \alpha _{i}\underline{b_{i}}$$* $$ \underline{P} (\underline{v}) = 0 $$ $$
 * $$\displaystyle (Eq. 6)


 * }
 * }

Now by definition,

$$\underline{\omega} = \sum_{i=1}^{n} \alpha _{i}\underline{b_{i}}$$ where $$ \forall \left[ \alpha_{1}, ..., \alpha_{n} \right] \in \mathbb{R}^n$$ and {$$\underline{b_{i}}$$} is an orthonormal basis vector.

So Eq.(6) can be written as -

$$ \underline{w} * \underline{P} (\underline{v}) = 0 $$

Problem solved by ushnish12.

=--Problem 2.6--=

Problem Statement
Given

Consider family of functions $$\displaystyle F=\left \{ 1,cosiwx,siniwx \right \} $$ on interval $$\displaystyle \Omega \left [ 0,T \right ]$$ for i =1,2

So


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

\displaystyle F=\left \{ b_{1}(x),b_{2}(x),b_{3}(x),b_{4}(x),b_{5}(x) \right \} $$     (Eq 6.1)
 * style="width:95%"
 * style="width:95%"
 * 
 * }


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

\displaystyle F=\left \{ 1,coswx,cos2wx,sinwx,sin2wx \right \} $$     (Eq 6.2)
 * style="width:95%"
 * style="width:95%"
 * 
 * }

Find
6.1 Construct $$\displaystyle \underline{\Gamma }(F)$$ and observe properties of $$\displaystyle \underline{\Gamma }(F)$$

6.2 Find the determinant of  $$\displaystyle \underline{\Gamma }(F)$$

6.3 Conclude F is orthogonal basis.

6.1

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

\displaystyle \underline{\Gamma }={{[{{\Gamma }_{ij}}]}_{5*5}}=\left( \begin{matrix}  {{\Gamma }_{11}} & \ldots  & {{\Gamma }_{15}}  \\   \vdots  & \ddots  & \vdots   \\   {{\Gamma }_{51}} & \cdots  & {{\Gamma }_{55}}  \\ \end{matrix} \right) $$     (Eq 6.3)
 * style="width:95%"
 * style="width:95%"
 * 
 * }


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

\displaystyle \Gamma _{ij}==\int_{\Omega }b_{i}(x)b_{j}(x)dx $$     (Eq 6.4)
 * style="width:95%"
 * style="width:95%"
 * 
 * }

We need to integrate on interval $$ \Omega \left [ 0,T \right ] $$ and $$T = \frac{w} $$ to find each elements of Gram matrix


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

\displaystyle \Gamma _{11}=\int_{0}^{T}1dx=\frac{2\Pi }{w} $$     (Eq 6.5)
 * style="width:95%"
 * style="width:95%"
 * 
 * }


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

\displaystyle \Gamma _{21}=\Gamma _{12}=\int_{0}^{T}coswxdx=0 $$     (Eq 6.6)
 * style="width:95%"
 * style="width:95%"
 * 
 * }
 * {| style="width:100%" border="0"

\displaystyle \Gamma _{31}=\Gamma _{13}=\int_{0}^{T}cos2wxdx=0 $$     (Eq 6.7)
 * style="width:95%"
 * style="width:95%"
 * <p style="text-align:right">
 * }


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

\displaystyle \Gamma _{41}=\Gamma _{14}=\int_{0}^{T}sinwxdx=0 $$     (Eq 6.8)
 * style="width:95%"
 * style="width:95%"
 * <p style="text-align:right">
 * }
 * {| style="width:100%" border="0"

\displaystyle \Gamma _{51}=\Gamma _{15}=\int_{0}^{T}sin2wxdx=0 $$     (Eq 6.9)
 * style="width:95%"
 * style="width:95%"
 * <p style="text-align:right">
 * }
 * {| style="width:100%" border="0"

\displaystyle \Gamma _{22}=\int_{0}^{T}coswx.coswxdx=\frac{\Pi }{w} $$     (Eq 6.10)
 * style="width:95%"
 * style="width:95%"
 * <p style="text-align:right">
 * }
 * {| style="width:100%" border="0"

\displaystyle \Gamma _{23}=\Gamma _{32}=\int_{0}^{T}coswx.cos2wxdx=0 $$     (Eq 6.11)
 * style="width:95%"
 * style="width:95%"
 * <p style="text-align:right">
 * }
 * {| style="width:100%" border="0"

\displaystyle \Gamma _{24}=\Gamma _{42}=\int_{0}^{T}coswx.sinwxdx=0 $$     (Eq 6.12)
 * style="width:95%"
 * style="width:95%"
 * <p style="text-align:right">
 * }
 * {| style="width:100%" border="0"

\displaystyle \Gamma _{25}=\Gamma _{52}=\int_{0}^{T}coswx.sin2wxdx=0 $$     (Eq 6.13)
 * style="width:95%"
 * style="width:95%"
 * <p style="text-align:right">
 * }
 * {| style="width:100%" border="0"

\displaystyle \Gamma _{33}=\int_{0}^{T}cos2wx.cos2wxdx=\frac{\Pi }{w} $$     (Eq 6.14)
 * style="width:95%"
 * style="width:95%"
 * <p style="text-align:right">
 * }
 * {| style="width:100%" border="0"

\displaystyle \Gamma _{34}=\Gamma _{43}=\int_{0}^{T}cos2wx.sinwxdx=0 $$     (Eq 6.15)
 * style="width:95%"
 * style="width:95%"
 * <p style="text-align:right">
 * }
 * {| style="width:100%" border="0"

\displaystyle \Gamma _{35}=\Gamma _{53}=\int_{0}^{T}cos2wx.sin2wxdx=0 $$     (Eq 6.16)
 * style="width:95%"
 * style="width:95%"
 * <p style="text-align:right">
 * }
 * {| style="width:100%" border="0"

\displaystyle \Gamma _{44}=\int_{0}^{T}sinwx.sinwxdx=\frac{\Pi }{w} $$     (Eq 6.17)
 * style="width:95%"
 * style="width:95%"
 * <p style="text-align:right">
 * }
 * {| style="width:100%" border="0"

\displaystyle \Gamma _{45}=\Gamma _{45}=\int_{0}^{T}sinwx.sin2wxdx=0 $$     (Eq 6.18)
 * style="width:95%"
 * style="width:95%"
 * <p style="text-align:right">
 * }
 * {| style="width:100%" border="0"

\displaystyle \Gamma _{55}=\int_{0}^{T}sin2wx.sin2wxdx=\frac{\Pi }{w} $$     (Eq 6.19)
 * style="width:95%"
 * style="width:95%"
 * <p style="text-align:right">
 * }
 * {| style="width:100%" border="0"

\displaystyle \underline{\Gamma }(F)=\left[ \begin{matrix} \begin{matrix} \begin{matrix} \begin{matrix} \frac{2\Pi }{w} & 0 \\ \end{matrix} & 0 & 0 & 0 \\ \end{matrix} \\ \begin{matrix} \begin{matrix} 0 & \frac{\Pi }{w} \\ \end{matrix} & 0 & 0 & 0 \\ \end{matrix} \\ \end{matrix} \\ \begin{matrix} \begin{matrix} 0 & 0 \\ \end{matrix} & \frac{\Pi }{w} & 0 & 0  \\ \end{matrix} \\ \begin{matrix} \begin{matrix} 0 & 0 \\ \end{matrix} & 0 & \frac{\Pi }{w} & 0  \\ \end{matrix} \\ \begin{matrix} \begin{matrix} 0 & 0 \\ \end{matrix} & 0 & 0 & \frac{\Pi }{w}  \\ \end{matrix} \\ \end{matrix} \right]
 * style="width:95%"
 * style="width:95%"

$$     (Eq 6.20)
 * <p style="text-align:right">
 * }

It is shown that gram matrix is diagonal matrix.

6.2
Determinant of gram matrix has been calculated by wolframalpha.


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

\displaystyle \det \underline{\Gamma }(F)=\frac{2{{\Pi }^{5}}} $$     (Eq 6.21) According to theorem on lecture note meeting 10-2
 * style="width:95%"
 * style="width:95%"
 * <p style="text-align:right">
 * }
 * {| style="width:100%" border="0"


 * style="width:95%" |
 * style="width:95%" |

It is $$\displaystyle \det \underline{\Gamma }(F)\neq 0$$, so the family of functions are linearly independent. Also they are basis functions.
 * }

6.3
From the lecture note Eq.(2) meeting 7-1


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

\displaystyle {{\delta }_{ij}}=\left\{ \begin{matrix} \begin{matrix} 1 & for & i=j \\ \end{matrix} \\ \begin{matrix} 0 & for & i\ne j \\ \end{matrix} \\ \end{matrix} \right.
 * style="width:95%"
 * style="width:95%"

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

\displaystyle {{\Gamma }_{ij}}=<{{b}_{i}},{{b}_{j}}>={{\delta }_{ij}} $$     (Eq 6.23)
 * style="width:95%"
 * style="width:95%"
 * <p style="text-align:right">
 * }
 * {| style="width:100%" border="0"

For $$\ i = j$$   Kronecker $$\ {\delta } = 1 $$      (diagonal elements of Gram matrix in Eq 6.20)
 * style="width:95%" |
 * style="width:95%" |

For $$ i \ne j$$  Kronecker $$\ {\delta } = 0 $$      (off-diagonal elements of Gram matrix in Eq 6.20)
 * }

As it is seen on above, both elements of Gram matrix are satisfying the orthogonal condition. Therefore, $$\displaystyle F $$ is a family of orthogonal basis functions.

Reference
Used wolframalpha to do integrates.

Problem solved byEml5526.s11.team3.sahin.

=--Problem 2.7--=

Problem Statement
Consider F = {$$1,x,x^{2},x^{3},x^{4}$$} in the interval $$ \Omega=[0,1]$$ (2.7.1) Construct $$\underline{\Gamma }$$(F) (2.7.2) Find the determinant of $$\underline{\Gamma }$$(F) (2.7.3) Is F Orthogonal Family?

Solution
2.7.1 F = {$$1,x,x^2,x^3,x^4$$} = {$$b_{1}(x),b_{2}(x),b_{3}(x),b_{4}(x),b_{5}(x)$$} $$\Gamma = \begin{bmatrix} \Gamma_{11}&\Gamma_{12}&\Gamma_{13} &\Gamma_{14}  &\Gamma_{15} \\ \Gamma_{21}&\Gamma_{22}&\Gamma_{23} &\Gamma_{24}  &\Gamma_{25} \\ \Gamma_{31}&\Gamma_{32}&\Gamma_{33} &\Gamma_{34}  &\Gamma_{35} \\ \Gamma_{41}&\Gamma_{42}&\Gamma_{43} &\Gamma_{44}  &\Gamma_{45} \\ \Gamma_{51}&\Gamma_{52}&\Gamma_{53} &\Gamma_{54}  &\Gamma_{55} \end{bmatrix}$$

$$\;\Gamma_{ij}=\int_{\Omega}b_{i}(x)b_{j}(x)dx$$ $$\Gamma_{11} = <b_{1}(x),b_{1}(x)> = \int_{0}^{1}1 dx = 1$$ $$\Gamma_{12} = <b_{1}(x),b_{2}(x)> = \int_{0}^{1}1.x dx =\frac{1}{2} $$ $$\Gamma_{13} = <b_{1}(x),b_{3}(x)> = \int_{0}^{1}1.x^2 dx =\frac{1}{3} $$ $$\Gamma_{14} = <b_{1}(x),b_{4}(x)> = \int_{0}^{1}1.x^3 dx =\frac{1}{4} $$ $$\Gamma_{15} = <b_{1}(x),b_{5}(x)> = \int_{0}^{1}1.x^4 dx =\frac{1}{5} $$ $$\Gamma_{21} = <b_{2}(x),b_{1}(x)> = \int_{0}^{1}x.1 dx =\frac{1}{2} $$ $$\Gamma_{22} = <b_{2}(x),b_{2}(x)> = \int_{0}^{1}x.x dx =\frac{1}{3} $$ $$\Gamma_{23} = <b_{2}(x),b_{3}(x)> = \int_{0}^{1}x.x^2 dx =\frac{1}{4}$$ $$\Gamma_{24} = <b_{2}(x),b_{4}(x)> = \int_{0}^{1}x.x^3dx =\frac{1}{5} $$ $$\Gamma_{25} = <b_{2}(x),b_{5}(x)> = \int_{0}^{1}x.x^4dx =\frac{1}{6} $$ $$\Gamma_{31} = <b_{3}(x),b_{1}(x)> = \int_{0}^{1}x^2.1 dx =\frac{1}{3}$$ $$\Gamma_{32} = <b_{3}(x),b_{2}(x)> = \int_{0}^{1}x^2.x dx =\frac{1}{4}$$ $$\Gamma_{33} = <b_{3}(x),b_{3}(x)> = \int_{0}^{1}x^2.x^2 dx =\frac{1}{5} $$ $$\Gamma_{34} = <b_{3}(x),b_{4}(x)> = \int_{0}^{1}x^2.x^3 dx =\frac{1}{6} $$ $$\Gamma_{35} = <b_{3}(x),b_{5}(x)> = \int_{0}^{1}x^2.x^4 dx =\frac{1}{7} $$ $$\Gamma_{41} = <b_{4}(x),b_{1}(x)> = \int_{0}^{1}x^3.1 dx =\frac{1}{4} $$ $$\Gamma_{42} = <b_{4}(x),b_{2}(x)> = \int_{0}^{1}x^3.x dx =\frac{1}{5} $$ $$\Gamma_{43} = <b_{4}(x),b_{3}(x)> = \int_{0}^{1}x^3.x^2 dx =\frac{1}{6}$$ $$\Gamma_{44} = <b_{4}(x),b_{4}(x)> = \int_{0}^{1}x^3.x^3 dx =\frac{1}{7} $$ $$\Gamma_{45} = <b_{4}(x),b_{5}(x)> = \int_{0}^{1}x^3.x^4 dx =\frac{1}{8} $$ $$\Gamma_{51} = <b_{5}(x),b_{1}(x)> = \int_{0}^{1}x^4.1 dx =\frac{1}{5} $$ $$\Gamma_{52} = <b_{5}(x),b_{2}(x)> = \int_{0}^{1}x^4.x dx =\frac{1}{6} $$ $$\Gamma_{53} = <b_{5}(x),b_{3}(x)> = \int_{0}^{1}x^4.x^2 dx =\frac{1}{7} $$ $$\Gamma_{54} = <b_{5}(x),b_{4}(x)> = \int_{0}^{1}x^4.x^3 dx =\frac{1}{8} $$ $$\Gamma_{55} = <b_{5}(x),b_{5}(x)> = \int_{0}^{1}x^4.x^4 dx =\frac{1}{9} $$

$$ \underline{\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}$$

2.7.2 The determinant of $$\underline{\Gamma}(F)\;\;$$ is

$$\left | \underline{\Gamma}(F) \right | = 3.74\times 10^{-12}$$

2.7.3 Consider any two basis functions. Say, $$ b_{i}$$ and $$b_{j}$$. If $$\Gamma_{ij} = <b_{i},b_{j}> = \delta_{ij} $$, then F is a family of orthogonal basis of functions. In other words, if $$\;\;\;\delta_{ij} = 1 \;for\; i=j\;$$  or if $$\;\;\; \delta_{ij} = 0\; for\; i\neq j$$, then F is a family of orthogonal basis of functions.

But in the $$\underline{\Gamma}(F)$$ matrix of Solution (2.7.1) , we find none of the elements satisfying the above condition. Hence, F is not a family of orthogonal basis of functions. Problem solved by vnarayanan.

=--Problem 2.8--=
 * {| style="width:100%" border="0" align="left"

|$$\displaystyle \int_{\Omega}w^{h}(x)P(u^{h}(x))dx = 0 \;\; \forall\; w^{h}(x)\;\;$$ where $$\;w^{h}(x) = \sum_{i=1}^{n}c_{i}b_{i}(x)\;$$ $$
 * <p style="text-align:right;">$$\displaystyle (Eq. 1)


 * }
 * }


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

|$$\displaystyle \int_{\Omega}b_{i}(x)P(u^{h}(x))dx = 0 \;\; for\;\; i = 1,2,...,n$$ $$
 * <p style="text-align:right;">$$\displaystyle (Eq. 2)


 * }
 * }

Show that Eq.1 $$\;\Leftrightarrow\; $$ Eq.2

Solution
Part 1

Eq.1 $$\;\Rightarrow\;\;\int_{\Omega}w^{h}(x)P(u^{h}(x))dx = 0 \;\; \forall\;\; w^{h}(x)$$ where $$\;\;w^{h}(x) = \sum_{i=1}^{n}c_{i}b_{i}(x)$$

Case (1) : $$\;\; c_{1} = 1, c_{2}=c_{3}=...=c_{n} = 0$$

$$\therefore\;\; w^{h}(x) = b_{1}(x) $$

Hence, Eq.1 becomes
 * {| style="width:100%" border="0" align="left"

|$$\displaystyle \;\;\int_{\Omega}b_{1}(x)P(u^{h}(x))dx = 0$$ $$
 * <p style="text-align:right;">$$\displaystyle (Eq. 3)


 * }
 * }

Case (2) : $$\;\; c_{2}=1,c_{1} = c_{3}=...=c_{n} = 0$$

$$\therefore\;\; w^{h}(x) = b_{2}(x) $$

Hence, Eq.1 becomes
 * {| style="width:100%" border="0" align="left"

|$$\displaystyle \;\;\int_{\Omega}b_{2}(x)P(u^{h}(x))dx = 0$$ $$
 * <p style="text-align:right;">$$\displaystyle (Eq. 4)


 * }
 * }

Case (3) : $$\;\; c_{1} =c_{2}= c_{3}=...=c_{n-1} = 0,c_{n}=1,$$

$$\therefore\;\; w^{h}(x) = b_{n}(x) $$

Hence, Eq.1 becomes
 * {| style="width:100%" border="0" align="left"

|$$\displaystyle \;\;\int_{\Omega}b_{n}(x)P(u^{h}(x))dx = 0$$ $$
 * <p style="text-align:right;">$$\displaystyle (Eq. 5)


 * }
 * }

Hence, from Eq.(3), Eq.(4) and Eq.(5) it can be concluded that

Part 2

Eq.(2) $$\; \Rightarrow\;\int_{\Omega}b_{i}(x)P(u^{h}(x))dx = 0 \;\; for\;\; i = 1,2,...,n $$

Multiply $$\;\;c_{i}\;\;$$ on both sides of the Eq.(2). We get, $$\;\int_{\Omega}c_{i}b_{i}(x)P(u^{h}(x))dx = 0 \;\; for\;\; i = 1,2,...,n$$

For, $$\; i = 1\;$$ $$\;\int_{\Omega}c_{1}b_{1}(x)P(u^{h}(x))dx = 0 $$

For, $$\; i = 2\;$$ $$\;\int_{\Omega}c_{2}b_{2}(x)P(u^{h}(x))dx = 0 $$

For, $$\; i = n\;$$ $$\;\int_{\Omega}c_{n}b_{n}(x)P(u^{h}(x))dx = 0 $$

Since, $$\;\int_{\Omega}c_{i}b_{i}(x)P(u^{h}(x))dx = 0 \;\; for\;\; i = 1,2,...,n\;\;$$ individually, the sum of all terms should also be equal to 0 $$\therefore\;\;\int_{\Omega}c_{1}b_{1}(x)P(u^{h}(x))dx + \int_{\Omega}c_{2}b_{2}(x)P(u^{h}(x))dx + .\; .\;. + \int_{\Omega}c_{n}b_{n}(x)P(u^{h}(x))dx = 0$$

$$\Rightarrow\;\;\int_{\Omega}\left [ (c_{1}b_{1}(x)P(u^{h}(x))) + (c_{2}b_{2}(x)P(u^{h}(x)))+ .\; .\;. + (c_{n}b_{n}(x)P(u^{h}(x)))\right ]dx = 0$$

$$\Rightarrow\;\;\int_{\Omega}\left [ c_{1}b_{1}(x) + c_{2}b_{2}(x)+ .\; .\;. + c_{n}b_{n}(x)\right ]P(u^{h}(x))dx = 0$$
 * {| style="width:100%" border="0" align="left"

|$$\displaystyle \Rightarrow\;\;\int_{\Omega}\sum_{i=1}^{n}c_{i}b_{i}(x)P(u^{h}(x))dx = 0$$ $$
 * <p style="text-align:right;">$$\displaystyle (Eq. 7)


 * }
 * }

We know that, $$\;w^{h}(x) = \sum_{i=1}^{n}c_{i}b_{i}(x)\;$$

$$\therefore\; Eq.(7) $$ becomes,

Problem solved by vnarayanan.

=--Problem2.9--=

Problem Statement
Given $$\left\{ {{b}_{i}}(x)=\cos (ix+\phi ),i=0,1,2,\cdots ,n \right\}$$. $$1).$$ Find two equations that enforce boundary conditions for $${{u}^{h}}(x)=\sum\limits_{j=0}^{n}{{{d}_{j}}{{b}_{j}}(x)}$$. Natural boundary condition: $$-\frac{d{{u}^{h}}(x=0)}{dx}=4$$; essential boundary condition: $${{u}^{h}}(x=1)=0$$ . $$2).$$ Find one more equation to solve for $$\underline{d}=\left\{ {{d}_{j}} \right\} (j=0,1,2)$$by project the residue $$P({{u}^{h}})$$ on a basis function $${{b}_{k}}(x)$$ with $$k=0,1,2 $$, such that the additional equation is linear independent from the above two equations in $$(1)$$. $$3).$$ Display three equations in matrix form $$\underline{K}\underline{d}=\underline{F}$$, observe symmetric property of $$\underline{K}$$. $$4).$$ Solve for $$\underline{d}$$. $$5).$$ Construct $$u_{2}^{h}(x)$$ and plot $$u_{2}^{h}(x)$$ vs. $$u_{2}^ – (x)$$. $$6).$$Compute $$u_{2}^{h}(x=0.5)$$ and Error $${{e}_{2}}(x=0.5)=u(x=0.5)-{{u}^{h}}(x=0.5)$$. $$7).$$ Repeat $$1)-6)$$ for $$n=4,n=6$$. $$8).$$ Plot $${{e}_{2}}(x=0.5)$$ vs. $$n$$ Refer to lecture slide [[media:fe1.s11.mtg12.djvu|12-1]] for more information.

Solution
For $$n=2$$ : $$1).$$ Since $$\left\{ {{b}_{i}}(x)=\cos (ix+\phi ),i=0,1,2,\cdots ,n \right\}$$, then $${{b}_{0}}(x)=\cos (\phi ),{{b}_{1}}(x)=\cos (x+\phi ),{{b}_{2}}(x)=\cos (2x+\phi )$$  . In order to make sure that $$b_{i}^{'}(x=0)\ne 0$$,we choose $$\phi =\frac{\pi }{4}$$. Hence we have From natural boundary condition: $$-\frac{d{{u}^{h}}(x=0)}{dx}=4$$, we can obtain Hence we have

From essential boundary condition: $${{u}^{h}}(x=1)=0$$, we can have We also have Hence we can get the second equation, that

$$2).$$ Projecting the residue $$P({{u}^{h}})$$ on the $${{b}_{i}}(x)$$,$$i=0,1,2$$, we have For static form, we know that $$P({{u}^{h}})=\frac{\partial }{\partial x}[{{a}_{2}}(x)\frac{\partial {{u}^{h}}}{\partial x}]+f(x)$$. And it’s already given that $${{a}_{2}}(x)=2, f(x)=3$$. Thus, So we can get one more equation

$$3).$$ Till now, we obtain three equations as follow: Display them in matrix form, yields

Hence,

non-symmetric. $$4).$$ Using Matlab, we can easily get

$$5).$$

Since $$2\frac{{{\partial }^{2}}u}{\partial {{x}^{2}}}+3=0$$, $$u(x=1)=0$$ and $${{u}^{'}}(x=0)=-4$$, we can obtain

Plot

Matlab Code: $$6).$$ We have already got $$u_{2}^{h}(x)=3.803\cos (\frac{\pi }{4})-0.1495\cos (x+\frac{\pi }{4})+2.9032\cos (2x+\frac{\pi }{4})$$ and $$u(x)=-\frac{3}{4}{{x}^{2}}-4x+\frac{19}{4}$$. Hence

For $$n=4$$ : $$1).$$ We also choose $$\phi =\frac{\pi }{4}$$ here. Since $$\left\{ {{b}_{i}}(x)=\cos (ix+\phi ),i=0,1,2,\cdots ,n \right\}$$, then Hence we have

From natural boundary condition:$$ -\frac{d{{u}^{h}}(x=0)}{dx}=4$$, we can obtain

Hence, we have

From essential boundary condition: $${{u}^{h}}(x=1)=0$$, we can have We get that Hence we can get the second equation, that

$$2).$$ Projecting the residue $$P({{u}^{h}})$$ on the $${{b}_{i}}(x)$$,$$i=0,1,2,3,4$$, we have $$\int\limits_{0}^{1}{{{b}_{i}}(x)P({{u}^{h}})}dx=0$$. For static form, we know that $$P({{u}^{h}})=\frac{\partial }{\partial x}[{{a}_{2}}(x)\frac{\partial {{u}^{h}}}{\partial x}]+f(x)$$. And it’s already given that $${{a}_{2}}(x)=2,f(x)=3$$. Thus, $$\int\limits_{0}^{1}{{{b}_{i}}(x)\{\frac{\partial }{\partial x}[{{a}_{2}}(x)\frac{\partial {{u}^{h}}}{\partial x}]+f(x)}\}dx=\int\limits_{0}^{1}{{{b}_{i}}(x)[2{{d}_{j}}{{b}_{j}}^{(2)}(x)+3}]dx=0$$. We can have three more equations here,

$$3).$$ Till now, we obtain five equations as follow: Display them in matrix form, yields

Hence,

non-symmetric. $$4).$$ Using Matlab, we can easily get

$$5).$$

We have already obtained

Plot

Matlab Code: $$6).$$ We have already got $$u_{4}^{h}(x)=14.1214\cos (\frac{\pi }{4})-22.8534\cos (x+\frac{\pi }{4})+26.5637\cos (2x+\frac{\pi }{4})-12.2778\cos (3x+\frac{\pi }{4})+3.0541\cos (4x+\frac{\pi }{4})$$ and $$u(x)=-\frac{3}{4}{{x}^{2}}-4x+\frac{19}{4}$$. Hence

For $$n=6$$ : $$1).$$ We also choose $$\phi =\frac{\pi }{4}$$ here. Since $$\left\{ {{b}_{i}}(x)=\cos (ix+\phi ),i=0,1,2,\cdots ,n \right\}$$, then

Hence we have From natural boundary condition: $$-\frac{d{{u}^{h}}(x=0)}{dx}=4$$, we can obtain

Hence, we have

From essential boundary condition: $${{u}^{h}}(x=1)=0$$, we can have

We get that

Hence we can get the second equation, that

$$2).$$ Projecting the residue $$P({{u}^{h}})$$ on the $${{b}_{i}}(x)$$,$$i=0,1,2,3,4,5,6$$, we have For static form, we know that $$P({{u}^{h}})=\frac{\partial }{\partial x}[{{a}_{2}}(x)\frac{\partial {{u}^{h}}}{\partial x}]+f(x)$$. And it’s already given that $${{a}_{2}}(x)=2,f(x)=3$$. Thus,

We can have five more equations here,

$$3).$$ Till now, we obtain seven equations as follow:

Display them in matrix form, yields

Hence,

is non-symmetric. $$4).$$ Using Matlab, we can easily get

$$5).$$

We have already obtained

Plot

Matlab Code: $$6).$$ We have already got $$u_{6}^{h}(x)=0.6678\cos (\frac{\pi }{4})+5.2048\cos (x+\frac{\pi }{4})+6.9757\cos (2x+\frac{\pi }{4})-10.7753\cos (3x+\frac{\pi }{4})+7.5430\cos (4x+\frac{\pi }{4})-2.2711\cos (5x+\frac{\pi }{4})+0.0017\cos (6x+\frac{\pi }{4}) $$ and $$u(x)=-\frac{3}{4}{{x}^{2}}-4x+\frac{19}{4}$$. Hence

Plot $${{e}_{n}}(x=0.5)$$ vs. $$n$$:

Problem solved by Hailong Chen.

Reference
All matrix operations and integrations are solved using Matlab.