User:Egm6341.s10.Team4/HW6

= Problem 1: Arc Length Calculation =

Given
Refer Lecture slide 32-1 for problem statement

The value of $$\displaystyle r(\theta) $$ from Page [[media:Egm6341.s10.mtg30.djvu|30-3]] is given by,


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

$$\displaystyle r(\theta) = \frac{a(1-e^2)}{1-e \, cos(\theta)} $$
 * $$\displaystyle \longrightarrow (1)$$
 * }.
 * }.

Here, $$\displaystyle a=1 $$ and $$\displaystyle e = \sin(\pi/12) $$

Arc Length for an elliptical curve with $$\displaystyle \theta$$ varying from 0 to $$\displaystyle \frac{\pi}{3} $$ is given by,


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

$$\displaystyle I = \int_0^{\frac{\pi}{3}} \sqrt{ {r}^{2}+ {\left( \frac{dr}{d \theta}\right)}^{2}} d\theta $$
 * $$\displaystyle \longrightarrow (2)$$
 * }.
 * }.

The elliptic integral of the second kind is given as:


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

$$\displaystyle E(e^2)=I = \int_0^{\pi/3}\sqrt {1-e^2 \sin^2\theta}\ d\theta\ $$
 * $$\displaystyle \longrightarrow (3)$$
 * }.
 * }.

Find
1. Use error estimate for Composite Trapezoidal Rule to find n, such that the error is to the order of $$\displaystyle O(10^{-10}) $$.

Error estimate is given by,


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

$$
 * $$\displaystyle
 * E_{n}| \leq \frac{(b-a)^3}{12n^2}M_{2}
 * E_{n}| \leq \frac{(b-a)^3}{12n^2}M_{2}
 * $$\displaystyle \longrightarrow (4)$$
 * }.
 * }.

2. Use successive numerical Integration results as a stopping criterion, i.e,


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

$$
 * $$\displaystyle
 * I_{2n} - I_{n}| < 10^{-10}
 * I_{2n} - I_{n}| < 10^{-10}
 * $$\displaystyle \longrightarrow (5)$$
 * }.
 * }.

3. Verify results of Romberg Integration, Clencurt Integration, Chebfun sum Integration with that of Composite Trapezoidal Rule.

Solution
1.

Using the error estimate of Composite Trapezoidal Rule given by Equation (4) for Equation (2), an error tolerance of the order of $$\displaystyle O(10^{-10}) $$ is obtained for,


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

n \le 1.675553588956571 \times 10^{4} \approx 16756 $$
 * $$\displaystyle
 * $$\displaystyle
 * }.
 * }.

Using the error estimate of Composite Trapezoidal Rule given by Equation (4) for Equation (3), an error tolerance of the order of $$\displaystyle O(10^{-10}) $$ is obtained for,


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

n \le 8.006607416431191 \times 10^{3} \approx 8007
 * $$\displaystyle
 * $$\displaystyle

$$  Matlab Code: 
 * }.
 * }.

2. Using Successive Numerical Integration Results to obtain error tolerance of order of $$\displaystyle O(10^{-10}) $$.

For Equation (2), an error tolerance of the order of $$\displaystyle O(10^{-10}) $$ is obtained for,


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

\begin{align} n &= 16384 \\ E &= 2.685143218883468 \times 10^{-10} \\ I_n &= 1.26369048548985 \\ \end{align} $$
 * $$\displaystyle
 * $$\displaystyle
 * }.
 * }.

From above we get $$\displaystyle n < 16756 $$.

For Equation (3), an error tolerance of the order of $$\displaystyle O(10^{-10}) $$ is obtained for,


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

\begin{align} n &= 4096 \\ E &= 4.863667246723935 \times 10^{-10} \\ I_n &= 1.03682664319432 \\ \end{align} $$
 * $$\displaystyle
 * $$\displaystyle
 * }.
 * }.

From above we get $$\displaystyle n < 8007 $$.

 Matlab Code:  .

3. Verifying results with Romberg Integration, Clencurt Integration and Chebfun Sum Integration.

Using Romberg table, the integration results are given by:

For Equation (2), an error tolerance of the order of $$\displaystyle O(10^{-10}) $$ is obtained for,


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

\begin{align} n &= 32 \\ E &= 3.970122008922772 \times 10^{-10} \\ I_n &= 1.26366702185545 \\ \end{align} $$
 * $$\displaystyle
 * $$\displaystyle
 * }.
 * }.

For Equation (3), an error tolerance of the order of $$\displaystyle O(10^{-10}) $$ is obtained for,


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

\begin{align} n &= 32 \\ E &= 9.005374224102525 \times 10^{-11} \\ I_n &= 1.03682398743891 \\ \end{align} $$  Matlab Code:  .
 * $$\displaystyle
 * $$\displaystyle
 * }.
 * }.

Using Clencurt, the integration results are given by:

For Equation (2), an error tolerance of the order of $$\displaystyle O(10^{-10}) $$ is obtained for,


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

\begin{align} n &= 8 \\ E &= 1.575350960791866 \times 10^{-10} \\ I_n &= 1.26369048600540 \\ \end{align} $$
 * $$\displaystyle
 * $$\displaystyle
 * }.
 * }.

For Equation (3), an error tolerance of the order of $$\displaystyle O(10^{-10}) $$ is obtained for,


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

\begin{align} n &= 8 \\ E &= 2.562394740834861 \times 10^{-13} \\ I_n &= 1.03682664384306 \\ \end{align} $$
 * $$\displaystyle
 * $$\displaystyle
 * }.
 * }.

 Matlab Code:  .

Using Chebfun sum, the integration results are given by:

For Equation (2), an error tolerance $$\displaystyle E $$ is obtained as,


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

\begin{align} E &= 5.107025913275720 \times 10^{-15} \\ I_n &= 1.263690485847865 \\ \end{align} $$
 * $$\displaystyle
 * $$\displaystyle
 * }.
 * }.

For Equation (3), an error tolerance $$\displaystyle E $$ is obtained as,


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

\begin{align} E &= 2.220446049250313 \times 10^{-16} \\ I_n &= 1.036826643842808 \\ \end{align} $$
 * $$\displaystyle
 * $$\displaystyle
 * }.
 * }.

 Matlab Code:  .

Author
Solved and typed by - Egm6341.s10.Team4.andy 14:18, 7 April 2010 (UTC)

Reviewed By - Egm6341.s10.Team4.roni 18:31, 7 April 2010 (UTC)

= Problem 2: Rate of momentum change for optimal control problem =

Given
Envisage the below figure as free body diagram of an aircraft:

.

likewise consider the shown axes and vectors, for $$\displaystyle v+dv $$ at $$\displaystyle t+dt $$:

.

Find
Show that $$\displaystyle dp_{\bar y}=mvd\gamma $$.

Solution
According to the above figure, we can survey these two cases at $$\displaystyle t $$ and $$\displaystyle t+dt $$, the velocity of the aircraft after $$\displaystyle dt $$ will reach to $$\displaystyle v+dv $$ and the angle between the aircraft and horizontal axis will reach to the $$\displaystyle \gamma+d\gamma $$. Thus, regarding $$\displaystyle d\gamma $$ generated angle between two velocity vectors, we can write:


 * $$\displaystyle

d\gamma\approxeq sin(d\gamma)=\frac{dv_{\bar y}}{v+dv} $$


 * $$\displaystyle

\Rightarrow dv_{\bar y}=v.d\gamma+dv.d\gamma $$

The amount of $$\displaystyle dv.d\gamma $$ can be neglected in front of $$\displaystyle v.d\gamma $$.


 * $$\displaystyle

\Rightarrow dv_{\bar y}=v.d\gamma $$

On the other hand, momentum is defined as $$\displaystyle p=mv $$. So, we have:



dp_{\bar y}=d(m.v_{\bar y})=v_{\bar y}.dm+m.dv_{\bar y} $$

Assuming the amount of $$\displaystyle dm $$ to be negligible in front of changes in velocity;



dp_{\bar y}=d(m.v_{\bar y})=m.dv_{\bar y} $$

Finally, we can summarize the answer as:



dp_{\bar y}=m.dv_{\bar y}=m.v.d\gamma $$


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

$$\displaystyle dp_{\bar y}=m.v.d\gamma $$
 * style="width:20%; padding:10px; border:2px solid #8888aa" |
 * style="width:20%; padding:10px; border:2px solid #8888aa" |
 * style= |
 * }.
 * }.

Author
Solved and typed by - Egm6341.s10.Team4.nimaa&amp;m 03:08, 3 April 2010 (UTC) Reviewed by- Egm6341.s10.team4.anandankala 13:45, 7 April 2010 (UTC).

= Problem 3: Row verification for the matrix=

Given

 * {| style="width:70%" border="0" align="center"




 * $$\underbrace{\begin{bmatrix}

1 & 0 & 0 & 0 \\ 0 & 1 & 0 & 0 \\ 1 & 1 & 1 & 1 \\ 0 & 1 & 2 & 3 \end{bmatrix}.}_{A} \underbrace{\begin{bmatrix}

C_0 \\ C_1 \\ C_2 \\ C_3 \end{bmatrix}}_{C} = \begin{bmatrix}

z_i \\ z^'_i \\ z_{i+1} \\ z^'_{i+1} \end{bmatrix} $$
 * }.
 * }.

Find

 * {| style="width:70%" border="0" align="center"




 * Arrive at the third and fourth rows of the matrix A using the equations,

$$\displaystyle d_3=z_{i+1}=z(s=1).$$

$$\displaystyle d_4=z^'_{i+1}=z^'(s=1).$$


 * }.
 * }.

Solution

 * {| style="width:70%" border="0" align="center"

We have $$\displaystyle z(s)= \sum_{i=0}^{3} C_i s^i= C_0+ C_1s+ C_2s^2+ C_3s^3$$
 * $$\displaystyle \longrightarrow (1)$$
 * }.
 * }.


 * {| style="width:70%" border="0" align="center"

$$\displaystyle z^'(s)= \sum_{i=1}^{3} iC_i s^{i-1}= C_1+ 2C_2s+ 3C_3s^2$$
 * $$\displaystyle \longrightarrow (2)$$
 * }.
 * }.


 * {| style="width:70%" border="0" align="center"

We get the product of the third row of the matrix A and the column vector C by substituting s=1 in the equation(1). $$\displaystyle \Rightarrow z_{i+1}= z(s=1)= C_0+ C_1+ C_2+ C_3$$
 * $$\displaystyle \longrightarrow (3)$$
 * }.
 * }.


 * {| style="width:70%" border="0" align="center"

We get the product of the fourth row of the matrix A and the column vector C by substituting s=1 in the equation(2). $$\displaystyle \Rightarrow z^'_{i+1}= z^'(s=1)= C_1+ 2C_2+ 3C_3$$
 * $$\displaystyle \longrightarrow (4)$$


 * }.
 * }.


 * {| style="width:70%" border="0" align="center"

By looking at the equations (3) and (4), one can say that the third and fourth rows of the matrix A are [1 1 1 1] and [0 1 2 3].
 * }.
 * }.

Author
Solved and typed by - Egm6341.s10.team4.anandankala 13:57, 7 April 2010 (UTC) Reviewed by - Egm6341.s10.Team4.roni 18:33, 7 April 2010 (UTC) .

= Problem 4: Matrix Inversion for Hermite - Simpson Algorithm =

Given
Matrix A [[media:Egm6341.s10.mtg35.djvu|35-3]], which is:


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

$$
 * $$\displaystyle
 * $$\displaystyle

1 & 0 & 0 & 0 \\ 0 & 1 & 0 & 0\\ 1 & 1 & 1 & 1\\ 0 & 1 & 2 & 3 \end{bmatrix}
 * $$\displaystyle A= \begin{bmatrix}

$$
 * style= |
 * }
 * }

Find
Show that the Inversion of this Matrix A Gives the following Matrix: on slide [[media:Egm6341.s10.mtg35.djvu|35-4]]

$$\displaystyle $$

$$\displaystyle Inv( A ) = \begin{bmatrix} 1 & 0 & 0 & 0 \\ 0 & 1 & 0 & 0\\ -3 & -2 & 3 & -1\\ 2 & 1 & -2 & 1 \end{bmatrix}

$$

Solution
Using MatLab:

 Matlab Code: 

Giving Result,

A_Inv =

1    0     0     0     0     1     0     0    -3    -2     3    -1     2     1    -2     1

Author
Solved and typed by - --Egm6341.s10.Team4.roni 01:15, 7 April 2010 (UTC) Reviewed by -

= Problem 5: Identification of basis function $$\displaystyle \overline{N_i}$$ =

Given
Refer Lecture slide 35-2,4 for problem statement

The relationship between $$\displaystyle Z(s)$$ and $$\displaystyle d_i$$(degree of freedom)


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

Z(s)=\sum_{i=0}^{3}c_i s^i = \sum_{i=1}^{4}N_i(s) d_i = \sum_{i=1}^{4} \overline{N_i}(s) \, \overline{d_i} $$ where,
 * $$\displaystyle
 * $$\displaystyle
 * $$\displaystyle \longrightarrow (1)$$
 * }.
 * }.
 * $$\displaystyle N_i(s)$$ = basis function
 * $$\displaystyle d_i(s)$$ = degree of freedom

$$\displaystyle d_1=Z_i $$ $$\displaystyle \,\,\,\,\, ,d_2=\dot{Z_i} $$ $$\displaystyle \,\,\,\,\, ,d_3=Z_{i+1} $$ $$\displaystyle \,\,\,\,\, ,d_4=\dot{Z}_{i+1} $$

Find
Identify the the basis function $$\displaystyle \left\{ N_i(s) \right\}\,\,\, ,i=1,2,3,4 $$, and plot $$\displaystyle \overline{N_i}(s)$$'s

Solution
From the equation (1) of 35-4(lecture slide)


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

\begin{Bmatrix} c_0 \\ c _1 \\ c _2 \\ c_3 \end{Bmatrix} = \begin{bmatrix} 1 & 0 & 0 & 0 \\ 0 & 1 & 0 & 0 \\ -3 & -2 & 3 & -1 \\ 2 & 1 & -2 & 1 \end{bmatrix} \begin{Bmatrix} Z_i \\ Z_i^' \\ Z_{i+1} \\ Z_{i+1}^' \end{Bmatrix} =\begin{bmatrix} 1 & 0 & 0 & 0 \\ 0 & 1 & 0 & 0 \\ -3 & -2 & 3 & -1 \\ 2 & 1 & -2 & 1 \end{bmatrix} \begin{Bmatrix} \overline{d}_1 \\ \overline{d}_2 \\ \overline{d}_3 \\ \overline{d}_4 \\ \end{Bmatrix} $$
 * $$\displaystyle
 * $$\displaystyle
 * }.
 * }.

where,

$$\displaystyle \overline{d}_2= h \, d_2$$ $$\displaystyle, \,\,\,\,\, \overline{d}_4= h \, d_4$$ $$\displaystyle, \,\,\,\,\, \overline{d}_1=d_1$$ $$\displaystyle, \,\,\,\,\, \overline{d}_3=d_3$$

Expand the matrix equation.


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

\begin{align} &c_0= \overline{d}_1 \\ &c_1= \overline{d}_2 \\ &c_2= -3\overline{d}_1 -2\overline{d}_2+3\overline{d}_3-\overline{d}_4 \\ &c_3= 2\overline{d}_1 +1\overline{d}_2-2\overline{d}_3+\overline{d}_4 \\ \end{align} $$
 * $$\displaystyle
 * $$\displaystyle
 * }.
 * }.

plug in $$\displaystyle c_i$$ to equation (1)


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

\begin{align} Z(s)&=\sum_{i=0}^{3}c_i s^i = c_0 + c_1 s^1 + c_2 s^2 + c_3 s^3 \\ &= \overline{d}_1 + \overline{d}_2 s^1 + (-3\overline{d}_1 -2\overline{d}_2+3\overline{d}_3-\overline{d}_4) s^2 + (2\overline{d}_1 +1\overline{d}_2-2\overline{d}_3+\overline{d}_4) s^3 \end{align} $$
 * $$\displaystyle
 * $$\displaystyle
 * }.
 * }.

arrange in terms of $$\displaystyle \overline{d}_i $$


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

\begin{align} & = (2s^3-3s^2+1)\overline{d}_1+(s^3-2s^2+s)\overline{d}_2+(-2s^3+3s^2)\overline{d}_3+(s^3-s^2)\overline{d}_4 \\ &=\overline{N}_1(s) \, \overline{d}_1+\overline{N}_2(s) \, \overline{d}_2+\overline{N}_3(s) \, \overline{d}_3+\overline{N}_4(s) \, \overline{d}_4 \end{align} $$
 * $$\displaystyle
 * $$\displaystyle
 * }.
 * }.

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

\begin{align} & \overline{N}_1= 2s^3-3s^2+1 \\ & \overline{N}_2= s^3-2s^2+s \Rightarrow N_2= h(s^3-2s^2+s)\\ & \overline{N}_3= -2s^3+3s^2 \\ & \overline{N}_4= s^3-s^2 \Rightarrow N_4= h(s^3-s^2) \end{align} $$
 * $$\displaystyle
 * $$\displaystyle
 * }.
 * }.

Plot of $$\displaystyle N_i $$
 * [[File:basis_function.png]]

.

Author
Solved and typed by - Egm6341.s10.Team4.yunseok 14:55, 7 April 2010 (UTC) Reviewed by - Egm6341.s10.Team4.riherd 14:46, 7 April 2010 (UTC)

= Problem 6 - Inversion of Local Domain Transformation=

Given
In using our Hermit interpolation we use the transformation from $$ \displaystyle t \epsilon [t_i,t_{i+1}]$$ to $$ \displaystyle s  \epsilon [0,1]$$ using the transformation $$ \displaystyle t(s)=(1-s)t_i+st_{i+1}$$

Find
We are asked to invert this transformation from the form of $$ \displaystyle t=t(s)$$ to $$ \displaystyle s=s(t)$$

Solution
Inverting this transformation to find s in terms of t is a simple algebra problem.

$$ \displaystyle t=(1-s)t_i+st_{i+1} $$

$$ \displaystyle t=t_i+s(t_{i+1}-t_{i}) $$

$$ \displaystyle s=\frac{t-t_{i}}{t_{i+1}-t_{i}} $$

Author
Solved and typed by - Egm6341.s10.Team4.riherd 14:45, 7 April 2010 (UTC) Reviewed by - Egm6341.s10.team4.anandankala 15:57, 7 April 2010 (UTC)

= Problem 7: Expression for Hermitian interpolation at $$ t_{i+\frac{1}{2}} $$ =

Given
Consider the Hermitian interpolation by the following equation (on slide [[media:Egm6341.s10.mtg35.djvu|35-2]]):
 * {| style="width:100%" border="0" align="left"

$$ $$
 * $$\displaystyle
 * $$\displaystyle
 * $$\displaystyle z(s)=\sum_{i=0}^3 c_is^i


 * }
 * }

Find
Show the following expression can be obtained for $$\displaystyle z'_{i+\frac{1}{2}} $$:


 * $$\displaystyle

z_{i+\frac{1}{2}}=z(s=\frac{1}{2})=\frac{1}{2}(z_i+z_{i+1})+\frac{h}{8}(f_i-f_{i+1}) $$

Solution
By differentiating from the equation for $$\displaystyle z(s) $$, we will attain:


 * $$\displaystyle

z'(s)=\sum_{i=1}^3 ic_is^{i-1} $$

Now, we can compute the followings:


 * $$\displaystyle

z_i=z(s=0)=\sum_{i=0}^3 c_i(0)^i=c_0+0+0+0=c_0 $$


 * $$\displaystyle

z_{i+1}=z(s=1)=\sum_{i=0}^3 c_i(1)^i=c_0+c_1+c_2+c_3 $$


 * $$\displaystyle

z'_i=z'(s=0)=\sum_{i=1}^3 ic_i(0)^{i-1}=c_1+0+0=c_1 $$


 * $$\displaystyle

z'_{i+1}=z'(s=1)=\sum_{i=1}^3 ic_i(1)^{i-1}=c_1+2c_2+3c_3 $$


 * $$\displaystyle

\dot{z}=\frac{dz}{dt}=\frac{dz}{ds}\times\frac{ds}{dt}=z'\times\frac{1}{h} $$


 * $$\displaystyle

\Rightarrow h(f_i-f_{i+1})=h(\dot{z}_i-\dot{z}_{i+1})=(z'_i-z'_{i+1}) $$


 * $$\displaystyle

\Rightarrow \frac{h}{8}(f_i-f_{i+1})=\frac{h}{8}(\dot{z}_i-\dot{z}_{i+1})=\frac{1}{8}(z'_i-z'_{i+1}) $$


 * $$\displaystyle

\Rightarrow\begin{cases} z_i+z_{i+1}=2c_0+c_1+c_2+c_3 \\ f_i-f_{i+1}=-2c_2-3c_3 \end{cases} $$


 * $$\displaystyle

\Rightarrow\begin{cases} \frac{1}{2}(z_i+z_{i+1})=c_0+\frac{1}{2}c_1+\frac{1}{2}c_2+\frac{1}{2}c_3 \\ \frac{h}{8}(f_i-f_{i+1})=-\frac{1}{4}c_2-\frac{3}{8}c_3 \end{cases} $$


 * $$\displaystyle

\Rightarrow\frac{1}{2}(z_i+z_{i+1})+\frac{h}{8}(f_i-f_{i+1})=c_0+\frac{1}{2}c_1+\frac{1}{2}c_2+\frac{1}{2}c_3-\frac{1}{4}c_2-\frac{3}{8}c_3=c_0+\frac{1}{2}c_1+\frac{1}{4}c_2+\frac{1}{8}c_3 $$

The acquired foregoing equation is equal to RHS of the expression. Now, we can compute the LHS of it as:


 * $$\displaystyle

LHS=z_{i+\frac{1}{2}}=z(s=\frac{1}{2})=\sum_{i=0}^3 c_i(\frac{1}{2})^i=c_0\times 1+c_1\times\frac{1}{2}+c_2\times\frac{1}{4}+c_3\times\frac{1}{8}=c_0+\frac{1}{2}c_1+\frac{1}{4}c_2+\frac{1}{8}c_3 $$


 * $$\displaystyle

\Rightarrow LHS=RHS $$


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

$$\displaystyle z_{i+\frac{1}{2}}=z(s=\frac{1}{2})=\frac{1}{2}(z_i+z_{i+1})+\frac{h}{8}(f_i-f_{i+1}) $$
 * style="width:20%; padding:10px; border:2px solid #8888aa" |
 * style="width:20%; padding:10px; border:2px solid #8888aa" |
 * style= |
 * }.
 * }.

Author
Solved and typed by - Egm6341.s10.Team4.nimaa&amp;m 04:15, 3 April 2010 (UTC) .

= Problem 8: Expression for derivative of Hermitian interpolation at $$\displaystyle t_{i+\frac{1}{2}} $$ =

Given
Consider the Hermitian interpolation by the following equation (on slide [[media:Egm6341.s10.mtg35.djvu|35-2]]):
 * {| style="width:100%" border="0" align="left"

$$ $$
 * $$\displaystyle
 * $$\displaystyle
 * $$\displaystyle z(s)=\sum_{i=0}^3 c_is^i


 * }
 * }

Find
Show the following expression can be obtained for $$\displaystyle z'_{i+\frac{1}{2}} $$:


 * $$\displaystyle

z'_{i+\frac{1}{2}}=z'(s=\frac{1}{2})=-\frac{3}{2}(z_i-z_{i+1})-\frac{1}{4}(z'_i+z'_{i+1}) $$

Solution
By differentiating from the equation for $$\displaystyle z(s) $$, we will attain:


 * $$\displaystyle

z'(s)=\sum_{i=1}^3 ic_is^{i-1} $$

Now, we can compute the followings:


 * $$\displaystyle

z_i=z(s=0)=\sum_{i=0}^3 c_i(0)^i=c_0+0+0+0=c_0 $$


 * $$\displaystyle

z_{i+1}=z(s=1)=\sum_{i=0}^3 c_i(1)^i=c_0+c_1+c_2+c_3 $$


 * $$\displaystyle

z'_i=z'(s=0)=\sum_{i=1}^3 ic_i(0)^{i-1}=c_1+0+0=c_1 $$


 * $$\displaystyle

z'_{i+1}=z'(s=1)=\sum_{i=1}^3 ic_i(1)^{i-1}=c_1+2c_2+3c_3 $$


 * $$\displaystyle

\Rightarrow\begin{cases} z_i-z_{i+1}=c_0-(c_0+c_1+c_2+c_3)=-c_1-c_2-c_3 \\ z'_i+z'_{i+1}=2c_1+2c_2+3c_3 \end{cases} $$


 * $$\displaystyle

\Rightarrow\begin{cases} -\frac{3}{2}(z_i-z_{i+1})=\frac{3}{2}c_1+\frac{3}{2}c_2+\frac{3}{2}c_3\\ -\frac{1}{4}(z'_i+z'_{i+1})=-\frac{1}{2}c_1-\frac{1}{2}c_2-\frac{3}{4}c_3 \end{cases} $$


 * $$\displaystyle

\Rightarrow -\frac{3}{2}(z_i-z_{i+1})-\frac{1}{4}(z'_i+z'_{i+1})=(\frac{3}{2}-\frac{1}{2})c_1+(\frac{3}{2}-\frac{1}{2})c_2+(\frac{3}{2}-\frac{3}{4})c_3=c_1+c_2+\frac{3}{4}c_3 $$

The acquired foregoing equation is equal to RHS of the expression. Now, we can compute the LHS of it as:


 * $$\displaystyle

LHS=z'_{i+\frac{1}{2}}=z'(s=\frac{1}{2})=\sum_{i=1}^3 ic_i(\frac{1}{2})^{i-1}=1\times c_1\times (\frac{1}{2})^{1-1}+2\times c_2\times (\frac{1}{2})^{2-1}+3\times c_3\times (\frac{1}{2})^{3-1}=c_1+c_2+\frac {3}{4}c_3 $$


 * $$\displaystyle

\Rightarrow LHS=RHS $$


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

$$\displaystyle z'_{i+\frac{1}{2}}=z'(s=\frac{1}{2})=-\frac{3}{2}(z_i-z_{i+1})-\frac{1}{4}(z'_i+z'_{i+1}) $$
 * style="width:20%; padding:10px; border:2px solid #8888aa" |
 * style="width:20%; padding:10px; border:2px solid #8888aa" |
 * style= |
 * }.
 * }.

Author
Solved and typed by - Egm6341.s10.Team4.nimaa&amp;m 04:23, 3 April 2010 (UTC) .

=Problem 9: Expression for Hermitian interpolation at $$\displaystyle t_{i+1}$$ =

Find
Prove That
 * {| style="width:70%" border="0" align="center"




 * $$z_{i+1}=z_i+ \dfrac {h/2}{3}[f_i+ 4f_{i+1/2}+ f_{i+1}]$$


 * }.
 * }.

Solution

 * {| style="width:70%" border="0" align="center"




 * $$z^'_{i+1/2}= z^'(s=1/2)= \dfrac {-3}{2}(z_i-z_{i+1})- \dfrac{1}{4}(z^'_i +z^'_{i+1})$$


 * }.
 * }.


 * {| style="width:70%" border="0" align="center"




 * We have $$\displaystyle z^'= hz^.$$


 * }.
 * }.


 * {| style="width:70%" border="0" align="center"




 * Applying collocation at $$\displaystyle t_i$$ and $$\displaystyle t_{i+1}$$, we have $$z^._i= f_i$$ and $$z^._{i+1}=f_{i+1}$$


 * }.
 * }.


 * {| style="width:70%" border="0" align="center"




 * $$\displaystyle \Rightarrow z^._{i+1/2}= -\dfrac {3}{2h}(z_i-z_{i+1})- \dfrac {1}{4}(f_i+ f_{i+1}) $$


 * }.
 * }.


 * {| style="width:70%" border="0" align="center"




 * $$\displaystyle \bigtriangleup := z^._{i+1/2}- f_{i+1/2} $$


 * }.
 * }.


 * {| style="width:70%" border="0" align="center"




 * Applying collocation at $$\displaystyle t_{i+1/2}$$, we have $$\displaystyle \bigtriangleup= 0$$ and $$\displaystyle z^._{i+1/2}= f_{i+1/2}$$


 * }.
 * }.


 * {| style="width:70%" border="0" align="center"




 * $$\displaystyle \Rightarrow f_{i+1/2}= -\dfrac {3}{2h}(z_i-z_{i+1})- \dfrac {1}{4}(f_i+ f_{i+1}) $$


 * }.
 * }.


 * {| style="width:70%" border="0" align="center"




 * $$\displaystyle \Rightarrow \dfrac {1}{4}(f_i+ 4f_{i+1/2}+ f_{i+1})= -\dfrac {3}{2h}(z_i-z_{i+1})= \dfrac {3}{2h}(z_{i+1}-z_i) $$


 * }.
 * }.


 * {| style="width:70%" border="0" align="center"




 * $$\displaystyle \Rightarrow z_{i+1}-z_i= \dfrac {h}{6} (f_i+ 4f_{i+1/2}+ f_{i+1}) $$


 * }.
 * }.


 * {| style="width:70%" border="0" align="center"



$$
 * $$\displaystyle \Rightarrow z_{i+1}= z_i+ \underbrace{\dfrac {(h/2)}{3} (f_i+ 4f_{i+1/2}+ f_{i+1})}_{Simpson's Rule}


 * }.
 * }.

Author
Solved and typed by - Egm6341.s10.team4.anandankala 13:57, 7 April 2010 (UTC) .

= Problem 10: Trapezoidal Rule Error Computation =

Given
Kessler's Paper, MatLab code and Result Table.

Patch Kessler Code for Trapezoidal Rule Error 5-9 problem given in Page [[media:Egm6341.s10.mtg30.djvu|30-2]]

 Matlab Code: 

Find
Run Kessler's Code line by line to reproduce his table. Complete HW 5-9 Refer Lecture slide [[media:Egm6341.s10.mtg30.djvu|30-2]] Produce (P2,P3) (P4,P5) (P6,P7)and put comments in his code

Solution
Table 1 shows the results from running Kessler's Code



Table 2 shows the results from running Team4 Code



Team4 Trapezoidal rule Error (alternative to to Kessler code)

 Matlab Code: 

Discussion:

Under Kessler's code, the program computes P(2k) for n=1 to any n number selected. From the paper we can see that (P3=P5=P7=0 at t=1). So we can use this equality to compute the C coefficients.

Kessler's code results for C coefficients and P terms are shown in Table 1. Team4 algorithm is based on decimal calculation of the C coefficients and therefore all coefficients are accurate to C9. Team4 algorithm allows the user to convert the decimal to fraction after the computation of the coefficients. The loss of accuracy in the fraction calculation from C7 in Team4 code is due to numerical errors of using single precision variables and functions.

Kessler's code in the paper took 0.102152 seconds to compute coefficients for n=1 to 8. The code developed by Team4 is much faster.021921 seconds for n=2 to 9 and does the work accurately for the decimal terms. Fraction terms are accurate up to C6 and P10. Those are shown in table 2 and could be improved if Double Precision is used to find the C coefficients and the factorial terms.

Author
Solved and typed by - --Egm6341.s10.Team4.roni 04:08, 7 April 2010 (UTC)

= Problem 11: Verification and comaprision of Problem 10 of HW5 =

Given
The given condition of No 10 problem of HW5


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

Refer Lecture slide 30-4 for problem statement
 * style="width:100%; padding:10px; border:2px solid #8888aa" |
 * style="width:100%; padding:10px; border:2px solid #8888aa" |

Polar form relative to focus
 * {| style="width:100%" border="0" align="left"


 * [[Image:Ellipse Polar.svg|200px]]
 * }.
 * }.
 * }.

Eq (3) from Page [[media:Egm6341.s10.mtg30.djvu|30-3]]

$$\displaystyle \ \ r(\theta) = \frac{a(1-e^2)}{1-e \, cos(\theta)} $$

In our problem, a=1

where, eccentricity $$\displaystyle e = \sin(\frac{\pi}{12}) $$

First Method to compute the Arc Length for an elliptical curve is using Eq (4) from Page [[media:Egm6341.s10.mtg30.djvu|30-3]] Since for the Ellipse $$\displaystyle \theta$$ range is from 0 to 2 $$\displaystyle\pi $$

Circumference $$\displaystyle I( \theta) = \int_0^{2\pi} dl$$

Where Eq (1) $$\displaystyle dl= \sqrt{ {r}^{2}+ {\left(  \frac{dr}{d \theta}\right)}^{2}} d\theta $$.

The second method uses the elliptic integral of the second kind which is defined as:

$$E(e^2) = \int_0^{\pi/2}\sqrt {1-e^2 \sin^2\theta}\ d\theta\ $$    Eq(6)    in page     [[media:Egm6341.s10.mtg30.djvu|30-4]]

The circumference of an ellipse is $$\displaystyle C = 4 a E(e^2)$$    Eq(5)   in page   [[media:Egm6341.s10.mtg30.djvu|30-4]],

Giving the integral:


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

$$\displaystyle I= 4 E(e^2) = 4\int_0^{\pi/2}\sqrt {1-e^2 \sin^2\theta}\ d\theta $$
 * }

Find Arc length of ellipse using the two Integrals and the integration methods below.

compute $$\displaystyle I_n$$ to the error $$\displaystyle 10^{-10}$$ ,

compute time using tic/toc matlab command and error estimate

1) Composit Trapozoidal rule

2) Romberg Table

3) Clencurt


 * style= |
 * }.
 * }.

Find
verify the result of pb10 of HW5(Team3) and compare with the own code.

Solution
first method $$\displaystyle I( \theta) = \int_0^{2\pi} \sqrt{ {r}^{2}+ {\left( \frac{dr}{d \theta}\right)}^{2}} d\theta$$



When run the Team 3's clencult code, they does'nt porvide answer(while loop continuously run.) the reason is that they use the I_exact value as Quad's solution(6.17660193898874),

but this value is not correct. when they calculate the Quad solution, they didn't designate the Toll error level(e.g. $$\displaystyle 10^{-10}$$). However their clencult code itself is correct,so when I change the I_exact value correctly, they provide correct answer.



Team3



Own work



Romberg Table is correct.

Second method $$\displaystyle I= 4 E(e^2) = 4\int_0^{\pi/2}\sqrt {1-e^2 \sin^2\theta}\ d\theta $$

Team 3 only calculated the quad method.



 Own work



In conclusion, Team 3's work is almost correct except for

1. quad function -- the error order$$\displaystyle (10^{-8}) $$ was bigger than criterion $$\displaystyle 10^{-10} $$ because of not designating error tolerance level in the function

2. seconde method was not calculated except for quad function.

Also, when compare the result bwtween first and second mehtod, the results were same. and in the Romberg table, the second method was faster than first method.(see the upper table)

 Matlab Code:  method 1-Quad

 Matlab Code:  method 1-Composit Trap.Rule

 subfunction ff5_10 

 Matlab Code:  method 1 - clencult

 Matlab Code:  method 1 - Romberg Table

 subfuntion ff: 

 Matlab Code:  method 2 - Quad

 Matlab Code:  method 2 - Compsit Trap. rule

 subfunction ff 

 Matlab Code:  method 2 - Clencurt

 Matlab Code:  method 2 - RombergTable .

Author
Solved and typed by - Egm6341.s10.Team4.yunseok 14:50, 7 April 2010 (UTC)

= Contributing Members = Egm6341.s10.Team4.andy 14:39, 7 April 2010 (UTC) - Author of Problems: 1 ; Proof read: 2,3,4.

Egm6341.s10.Team4.riherd 14:47, 7 April 2010 (UTC) Author of Problems: 6 ; Proof read: 5.

Egm6341.s10.Team4.nimaa&amp;m 14:54, 7 April 2010 (UTC) - Author of Problems: 2, 7, 8 ; Proof read: 5.

Egm6341.s10.Team4.yunseok 14:57, 7 April 2010 (UTC) - Author of Problems: 5, 11 ;

Egm6341.s10.team4.anandankala 13:57, 7 April 2010 (UTC)- Author of problems: 3,9; Proof read: 2,6

Egm6341.s10.Team4.roni 18:35, 7 April 2010 (UTC) - Author of problems 4,10; Proof read: 1,3