University of Florida/Egm6341/s10.Team2/HW6

Statement
P.32-1 1. Compute the arc length to O(1e-10), using error analysis of composite trapezoidal rule, and verify the results by Romberg quadrature rule, Clenshaw-Curtis rule and chebfun/sum command.

2. Compute it again by means of the elliptical quadrature formula.

Solution
clear;clc % function Definition syms e x   r=(1-e^2)/(1-e*cos(x)); drdx=diff(r,'x'); %Define dr/dx dl=(r^2+drdx^2)^(1/2); %Define dl   d2ldx2=diff(dl,'x',2); %Define 2nd derivative of dl    format long e=sin(pi/12); x=linspace(0,pi/3,2^14+1); d2l = -(1/4)./((1-e^2).^2./(1-e.*cos(x)).^2+(1-e^2).^2./(1-e.*cos(x)).^4.*e^2.*sin(x).^2).^(3/2).*(-2*(1-e^2).^2./(1-e.*cos(x)).^3.*e.*sin(x)-4*(1-e^2).^2./(1-e.*cos(x)).^5.*e^3.*sin(x).^3+2*(1-e^2).^2./(1-e.*cos(x)).^4.*e^2.*sin(x).*cos(x)).^2+(1/2)./((1-e^2).^2./(1-e.*cos(x)).^2+(1-e^2).^2./(1-e.*cos(x)).^4.*e^2.*sin(x).^2).^(1/2).*(4*(1-e^2).^2./(1-e.*cos(x)).^4.*e^2.*sin(x).^2-2*(1-e^2).^2./(1-e.*cos(x)).^3.*e.*cos(x)+20*(1-e^2).^2./(1-e.*cos(x)).^6.*e^4.*sin(x).^4-20*(1-e^2).^2./(1-e.*cos(x)).^5.*e^3.*sin(x).^2.*cos(x)+2*(1-e^2).^2./(1-e.*cos(x)).^4.*e^2.*cos(x).^2); %plot(x,d2l) M2=max(abs(d2l)); n_theory=ceil((pi^3*M2*1e10./(27*12)).^(1/2)) n_computed=length(x)-1

%Composite Trapezoidal [I,step]=ctrap('((1-sin(pi/12)^2)^2/(1-sin(12/pi)*cos(x))^2+(1-sin(pi/12)^2)^2/(1-sin(pi/12)*cos(x))^4*sin(pi/12)^2*sin(x)^2)^(1/2)',0,pi/3,1e-4)

%Romberg Quadrature e=sin(pi/12); z = @(x) ((1-e.^2).^2./(1-e.*cos(x)).^2+(1-e.^2)^2./(1-e.*cos(x)).^4.*e.^2.*sin(x).^2).^(1/2); I_romb=rombquad(z,0,pi/3,10)

%Clenshaw-Curtis e=sin(pi/12); [xx,w]=fclencurt(2^10+1,0,pi/3); yy=((1-e.^2).^2./(1-e.*cos(xx)).^2+(1-e.^2)^2./(1-e.*cos(xx)).^4.*e.^2.*sin(xx).^2).^(1/2); I_cc=w'*yy

%Chebfun/Sum yy = chebfun('((1-sin(pi/12).^2).^2./(1-sin(pi/12).*cos(x)).^2+(1-sin(pi/12).^2)^2./(1-sin(pi/12).*cos(x)).^4.*sin(pi/12).^2.*sin(x).^2).^(1/2)',[0 pi/3]); II=sum(yy)

%Elliptical Integral of second kind, using the adaptive simpson's rule clear;clc format long e=sin(pi/12); b=@(x) sqrt(1-e.^2.*sin(x).^2); I=quad(b,0,pi/3,1e-10)

%function ctrap function [I,step] = ctrap(f,a,b,eps) n=1; h=(b-a)/2; I1=0; I2=(subs(sym(f),findsym(sym(f)),a) + subs(sym(f),findsym(sym(f)),b))*h; while abs(I2-I1)>eps n=2*n; h=(b-a)/n; I1=I2; I2=0; for i=0:n-1 x=a+h*i; x1=x+h; I2=I2+(h/2)*(subs(sym(f),findsym(sym(f)),x)+...                       subs(sym(f),findsym(sym(f)),x1)); end end I=I2; step=n;

%function rombquad function I_romb = rombquad(f,a,b,m) h = 2.^((1:m)-1)*(b-a)/2^(m-1);            % These are the intervals used. k1 = 2.^((m-2):-1:-1)*2+1;                 % Index into the intervals. f1 = feval(f,a:h(1):b);                    % Function evaluations. R = zeros(1,m);                            % Pre-allocation. % Define the starting vector: for ii = 1:m R(ii) = 0.5*h(ii)*(f1(1)+2*...   sum(f1(k1(end-ii+1):k1(end-ii+1)-1:end-1)) + f1(end)); end % Interpolations: for jj = 2:m jpower = (4^(jj-1)-1); for kk = 1:(m-jj+1) R(kk) = R(kk)+(R(kk)-R(kk+1))/jpower; end end I_romb = R(1);

%function fclencurt function [x,w]=fclencurt(N1,a,b) N=N1-1; bma=b-a; c=zeros(N1,2); c(1:2:N1,1)=(2./[1 1-(2:2:N).^2 ])'; c(2,2)=1; f=real(ifft([c(1:N1,:);c(N:-1:2,:)])); w=bma*([f(1,1); 2*f(2:N,1); f(N1,1)])/2; x=0.5*((b+a)+N*bma*f(1:N1,2));

Results Discussion

1) For error analysis, the n required for O(1e-10) is 16756.

2) For actual performace of trapezoidal rule, n is 16384.

3) For the first method, I = 1.263690485847868, I_romb = 1.263690485847868, I_cc = 1.263690485847865, II = 1.263690485847865.

4) For the second method, I = 1.036826643842352. This is because theta is defined differently in both cases.

Author
Egm6341.s10.team2.lee 20:58, 7 April 2010 (UTC)

Statement
P.33-2

At an instant t+dt, consider v+dv to show that

$$ dP_{y'} = mVd\gamma \quad $$

after neglecting the higher order terms.

Solution


The Above figure represents the original axes and the new axes. It also shows the vector representations of the velocities at time=t and time=t+dt.

Our goal is to identify the following:

$$ dPy' = mV_{y'} $$

The velocity at time t+dt is represented by V+dV. This means an infinitesimally small amount of time has elapsed. With this small change in time the angle $$ d\gamma $$ is considered to be small.

Using trigonometry to express the component of V+dV that is in the direction of Y', we write the following

$$ V_{y'} = \sin (d\gamma)[V+dV] $$

Using Taylor Series expansion to approximate the sine of the small angle (as described in Small-Angle Approximation), we can identify that for small values of the angle:

$$ \sin(d\gamma) = d \gamma $$

Using this approximation the following can be written:

$$ V_{y'} = d\gamma[V+dV] = d \gamma V + d \gamma dV $$

By ignoring the higher order term of the previous result we are able to show:

$$ dPy' = mV_{y'} = m(Vd\gamma) $$

Author
Solved by--Guillermo Varela (GV)

Statement
P.35-3

From the discussion in the above mentioned slides it we have the following equation:

$$\begin{bmatrix}

A_{1,1} &A_{1,2} &A_{1,3}  &A_{1,4} \\ A_{2,1} &A_{2,2} &A_{2,3}  &A_{2,4} \\ A_{3,1} &A_{3,2}  &A_{3,3}   &A_{3,4}  \\ A_{4,1} &A_{4,2}  &A_{4,3}  &A_{4,4} \end{bmatrix}\begin{Bmatrix} c_0\\ c_1\\ c_2\\ c_3 \end{Bmatrix}=\begin{Bmatrix} Z_i\\ Z_i'\\ Z_{i+1}\\ Z_{i+1}' \end{Bmatrix}$$

The first two rows of matrix A, is given. Calculate the rows 3 and 4.So that the co-efficients can be expressed as below:

$$\begin{Bmatrix} c_0\\ c_1\\ c_2\\ c_3 \end{Bmatrix}=\begin{bmatrix}

A_{1,1} &A_{2,1} &A_{3,1}  &A_{4,1} \\ A_{1,2} &A_{2,2} &A_{3,2}  &A_{4,2} \\ A_{1,3} &A_{2,3}  &A_{3,3}   &A_{4,3}  \\ A_{1,4} &A_{2,4}  &A_{3,4}  &A_{4,4} \end{bmatrix}\begin{Bmatrix} Z_i\\ Z_i'\\ Z_{i+1}\\ Z_{i+1}' \end{Bmatrix}$$

Solution
From the discussion in P.35-2 and P.35-3 we have the following equations:
 * {| style="width:100%" border="0"

$$  \displaystyle Z(s)=\sum_{i=0}^{3}c_is^i=\sum_{i=1}^{3}N_i(s)d_i $$   (2 p35-2)
 * style="width:95%" |
 * style="width:95%" |
 * 
 * }
 * {| style="width:100%" border="0"

$$\displaystyle d_1=Z_i$$
 * style="width:95%" |
 * style="width:95%" |

$$\displaystyle d_3=Z_{i+1}$$

$$\displaystyle d_2=\dot{Z_i}$$

$$\displaystyle d_4={\dot{Z}_{i+1}}$$ (3 p35-2)
 * 
 * }
 * {| style="width:100%" border="0"

$$  \displaystyle \dot{Z}=\frac{dZ}{dt}=\underbrace{\frac{dZ}{ds}}_{Z'}.\frac{ds}{dt} $$   (4 p35-2) Using $$\frac{ds}{dt}=\frac{1}{h}$$ and the above equations we have shown the first two rows of the matrix A to be $$\begin{bmatrix} 1 &0 &0  &0 \\ 0&1  &0  &0 \end{bmatrix}$$
 * style="width:95%" |
 * style="width:95%" |
 * 
 * }

Using the equations above we have
 * {| style="width:100%" border="0"

$$  \displaystyle d_3=Z_{i+1}=Z(s=1)=c_0+c_1+c_2+c_3 $$   (1)
 * style="width:95%" |
 * style="width:95%" |
 * 
 * }
 * {| style="width:100%" border="0"

$$  \displaystyle d_4=\dot{Z}_{i+1}=\frac{1}{h}Z'(s=1)=c_1+2c_2+3c_3 $$   (2)
 * style="width:95%" |
 * style="width:95%" |
 * 
 * }

Putting the results in matrix form we have eqn 7 P.35-3.

$$\begin{bmatrix} 1 &0 &0  &0 \\ 0 &1  &0  &0 \\ 1 &1  &1  &1 \\ 0 &1  &2  &3 \end{bmatrix}\begin{Bmatrix} c_0\\ c_1\\

c_2\\

c_3\end{Bmatrix}= \begin{Bmatrix} Z_i\\ Z'_i\\ Z_{i+1}\\ Z'_{i+1} \end{Bmatrix}$$

Author
--Egm6341.s10.team2.niki 21:45, 5 April 2010 (UTC)

--Proofread by Egm6341.s10.team2.lee 00:38, 6 April 2010 (UTC)

Statement
P. 35-4

Solution
The Inverse of the Matrix $$ A=\begin{bmatrix} 1& 0& 0& 0\\ 0& 1& 0& 0\\ 1& 1& 1& 1\\ 0& 1& 2& 3 \end{bmatrix}\;\; $$ can be found out by doing row operations as follows:

The augmented matrix of A and I is represented by

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

By carrying out row transformation: $$R_{3}\rightarrow 3R_{3}-R_{4}$$ on the augmented matrix 'X', it becomes:

$$ X=\begin{bmatrix} 1& 0& 0& 0& |\; 1& 0& 0& 0\\ 0& 1& 0& 0& |\; 0& 1& 0& 0\\ 3& 2& 1& 0& |\; 0& 0& 3& -1\\ 0& 1& 2& 3& |\; 0& 0& 0& 1 \end{bmatrix} $$

By carrying out row transformation: $$R_{3}\rightarrow R_{3}-3R_{1}-2R_{2}$$ on the augmented matrix 'X', it becomes:

$$ X=\begin{bmatrix} 1& 0& 0& 0& |\; +1& 0& 0& 0\\ 0& 1& 0& 0& |\; +0& 1& 0& 0\\ 0& 0& 1& 0& |\; -3& -2& 3& -1\\ 0& 1& 2& 3& |\; +0& 0& 0& 1 \end{bmatrix} $$

By carrying out row transformation: $$R_{4}\rightarrow R_{4}-R_{2}-2R_{3}$$ on the augmented matrix 'X', it becomes:

$$ X=\begin{bmatrix} 1& 0& 0& 0& |\; +1& 0& 0& 0\\ 0& 1& 0& 0& |\; +0& 1& 0& 0\\ 0& 0& 1& 0& |\; -3& -2& 3& -1\\ 0& 0& 0& 3& |\; +6& 3& -6& 3 \end{bmatrix} $$

Finally, by carrying out row transformation: $$R_{4}\rightarrow R_{4}/3$$ on the augmented matrix 'X', it becomes:

$$ X=\begin{bmatrix} 1& 0& 0& 0& |\; +1& 0& 0& 0\\ 0& 1& 0& 0& |\; +0& 1& 0& 0\\ 0& 0& 1& 0& |\; -3& -2& 3& -1\\ 0& 0& 0& 1& |\; +2& 1& -2& 1 \end{bmatrix} $$

Here the Left part of the augmented matrix is reduced to a unit matrix $$\;I_{(4X4)}$$ by carrying out the row operations and as a result we obtained a transformed matrix on the right part of the augmented matrix which is $$\; A^{-1}$$. Therefore,

$$ A^{-1}=\begin{bmatrix} +1& 0& 0& 0\\ +0& 1& 0& 0\\ -3& -2& 3& -1\\ +2& 1& -2& 1 \end{bmatrix} $$

The same result can be verified by using the Matlab code below and 'B' is the value of $$\; A^{-1}$$ in the code.

Matlab code to verify the inverse of matrix- 'A':

Author
Solved by--Srikanth Madala (SM)

Statement
P. 35-4

To identify the set of basis functions: $$\; N_{1}(s),N_{2}(s),N_{3}(s) \; and \; N_{4}(s)$$ and plot them as a function of 's' varying between $$\; s=0 \;and\; s=1$$

Solution
Using the $$\; A^{-1}$$ calculated in the above problem, we can find out the values of the coefficients- $$\; C_{0},C_{1},C_{2} \; and \; C_{3}$$ in terms of $$Z_{i},Z'_{i},Z_{i+1} \; and \; Z'_{i+1}$$ by using the following equation:

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

Therefore, $$ \begin{Bmatrix} C_{0}=Z_{i}\\ C_{1}=Z'_{i}\\ C_{2}=-3Z_{i}-2Z'_{i}+3Z_{i+1}-1Z'_{i+1}\\ C_{3}=2Z_{i}+1Z'_{i}-2Z_{i+1}+1Z'_{i+1} \end{Bmatrix} $$

But, we know that:

$$ Z\left ( s \right )=\sum_{i=1}^{4}N_{i}\left ( s \right )d_{i}=\sum_{i=0}^{3}C_{i}s^{i} $$

$$N_{1}\left ( s \right )d_{1}+N_{2}\left ( s \right )d_{2}+N_{3}\left ( s \right )d_{3}+N_{4}\left ( s \right )d_{4}=C_{0}s^{0}+C_{1}s^{1}+C_{2}s^{2}+C_{3}s^{3}$$

By definition: $$d_{1}:=Z_{i},\; d_{2}:=Z'_{i},\; d_{3}:=Z_{i+1} \;and\; d_{4}:=Z'_{i+1}$$ and also we already know the values of the coefficients- $$\; C_{0},C_{1},C_{2} \; and \; C_{3}$$ in terms of $$Z_{i},Z'_{i},Z_{i+1} \; and \; Z'_{i+1}.$$ Therefore, plugging these values in the above equation, gives us:

$$ N_{1}\left ( s \right )Z_{i}+N_{2}\left ( s \right )Z'_{i}+N_{3}\left ( s \right )Z_{i+1}+N_{4}\left ( s \right )Z'_{i+1}=Z_{i}+Z'_{i}s+\left[-3Z_{i}-2Z'_{i}+3Z_{i+1}-Z'_{i+1} \right ]s^{2}+\left [2Z_{i}+Z'_{i}-2Z_{i+1}+Z'_{i+1}  \right ]s^{3} $$

$$ N_{1}\left ( s \right )Z_{i}+N_{2}\left ( s \right )Z'_{i}+N_{3}\left ( s \right )Z_{i+1}+N_{4}\left ( s \right )Z'_{i+1}=Z_{i}\left ( 1-3s^{2}+2s^{3} \right)+Z'_{i}\left ( s-2s^{2}+s^{3} \right )+Z_{i+1}\left (3s^{2}-2s^{3} \right)+ Z'_{i+1} \left (-s^{2}+s^{3}\right ) $$

By comparing LHS and RHS, we can deduce the following:


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

$$N_{1}\left ( s \right )=\left ( 1-3s^{2}+2s^{3} \right)$$
 * style="width:92%; padding:10px; border:2px solid #8888aa" |
 * style="width:92%; padding:10px; border:2px solid #8888aa" |

$$N_{2}\left ( s \right )=\left ( s-2s^{2}+s^{3} \right )$$

$$N_{3}\left ( s \right )=\left (3s^{2}-2s^{3} \right)$$

$$N_{4}\left ( s \right )=\left (-s^{2}+s^{3}\right )$$ Matlab code to generate the following plots:
 * 
 * }



Author
Solved by--Srikanth Madala (SM) Proofread by--Egm6341.s10.team2.lee 02:13, 8 April 2010 (UTC)

Statement
P.36-1 Express s in terms of t

Solution
Since

$$ t(s) = t_{i} + \frac{t_{i+1}-t_{i}}{1-0}S = t_{i} + hS $$

Solving for S,

$$ s(t) = \frac{t-t_{i}}{h} $$

Verify:

$$ s(t_{i}) = 0 \quad and \quad s(t_{i+1}) = 1 $$

Author
Egm6341.s10.team2.lee 00:10, 5 April 2010 (UTC)

Statement
P. 36-2 By enforcing compliance with the DE at the point $$Z_{i+1}=Z(s=1/2)$$ show that
 * {| style="width:60%" border="0"

$$  \displaystyle Z_{i+1/2}=Z(s=1/2)=\frac{1}{2}[Z_i+Z_{i+1}]+\frac{h}{8}[f_i-f_{i+1}] $$
 * style="width:92%; padding:10px; border:2px solid #8888aa" |
 * style="width:92%; padding:10px; border:2px solid #8888aa" |
 * 
 * }

Solution
We have from eqn 1 P. 35-4 and Prob 4 of HW6 the following
 * {| style="width:100%" border="0"

$$  \displaystyle \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}$$ (1 p 35-4)
 * style="width:95%" |
 * style="width:95%" |
 * 
 * }

In eqn 2 P. 35-2 at the point $$s=\frac{1}{2}$$ we get
 * {| style="width:100%" border="0"

$$  \displaystyle Z(s=\frac{1}{2})=Z_i+Z'_i(\frac{1}{2})+[-3Z_i-2Z'_i+3Z_{i+1}-Z_{i+1}](\frac{1}{4})+[2Z_i+Z'_i-2Z_{i+1}+Z'_{i+1}](\frac{1}{8}) $$   (1)
 * style="width:95%" |
 * style="width:95%" |
 * 
 * }


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

$$  \displaystyle Z(s=\frac{1}{2})=Z_i[1-\frac{3}{4}+\frac{1}{4}]+Z'_i[\frac{1}{2}-\frac{1}{2}+\frac{1}{8}]+Z_{i+1}[\frac{3}{4}-\frac{1}{4}]+Z'_{i+1}[\frac{-1}{4}+\frac{1}{8}] $$   (2)
 * style="width:95%" |
 * style="width:95%" |
 * 
 * }
 * {| style="width:100%" border="0"

$$  \displaystyle Z(s=\frac{1}{2})=Z_i[\frac{1}{2}]+Z'_i[\frac{1}{8}]+Z_{i+1}[\frac{1}{2}]+Z'_{i+1}[-\frac{1}{8}] $$   (3)
 * style="width:95%" |
 * style="width:95%" |
 * 
 * }
 * {| style="width:100%" border="0"

$$  \displaystyle Z(s=\frac{1}{2})=\frac{1}{2}[Z_i+Z_{i+1}]+\frac{1}{8}[Z'_i-Z'_{i+1}] $$   (4)
 * style="width:95%" |
 * style="width:95%" |
 * 
 * }

But we know from eqn 1P. 36-1 that $$Z'=h\dot{Z}$$. By imposing collocation we have $$Z_i=f_i$$ and $$Z_{i+1}=f_{i+1}$$. Using these results in the above equation we get


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

$$  \displaystyle Z_{i+1/2}=Z(s=1/2)=\frac{1}{2}[Z_i+Z_{i+1}]+\frac{h}{8}[f_i-f_{i+1}] $$
 * style="width:92%; padding:10px; border:2px solid #8888aa" |
 * style="width:92%; padding:10px; border:2px solid #8888aa" |
 * 
 * }

Author
--Egm6341.s10.team2.niki 23:03, 5 April 2010 (UTC)

--Proofread by Egm6341.s10.team2.lee 00:37, 6 April 2010 (UTC)

Statement
P.36-2 By enforcing compliance with the DE at the point $$Z_{i+1}=Z(s=1/2)$$ show that
 * {| style="width:60%" border="0"

$$  \displaystyle Z'_{i+1/2}=Z'(s=1/2)=-\frac{3}{2}[Z_i-Z_{i+1}]-\frac{1}{2}[Z'_i+Z'_{i+1}] $$
 * style="width:92%; padding:10px; border:2px solid #8888aa" |
 * style="width:92%; padding:10px; border:2px solid #8888aa" |
 * 
 * }

Solution
We have from eqn 1 P.35-4 and Prob 4 of HW6 the following
 * {| style="width:100%" border="0"

$$  \displaystyle \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}$$  (1 p 35-4)
 * style="width:95%" |
 * style="width:95%" |
 * }

We know from eqn 3 P.35-3
 * {| style="width:100%" border="0"

$$  \displaystyle Z'(s)=\sum_{i=1}^{3}ic_is^{i-1} $$
 * style="width:95%" |
 * style="width:95%" |
 * 
 * }

Expanding and substituting for the constants we get:


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

$$  \displaystyle Z'(s=1/2)=c_1+2c_2(\frac{1}{2})+3c_3(\frac{1}{4}) $$   (1)
 * style="width:95%" |
 * style="width:95%" |
 * <p style="text-align:right">
 * }


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

$$  \displaystyle Z'(s=1/2)=Z_i+2[-3Z_i-2Z'_i+3Z_{i+1}-Z'_{i+1}](\frac{1}{2})+3[2Z_i+Z'_i-2Z_{i+1}+Z'_{1+1}](\frac{1}{4}) $$   (2) Rearranging terms we get
 * style="width:95%" |
 * style="width:95%" |
 * <p style="text-align:right">
 * }
 * {| style="width:100%" border="0"

$$  \displaystyle Z'(s=1/2)=Z_i[-3+\frac{3}{2}]+Z'_i[1-2+\frac{3}{4}]+Z_{i+1}[3-\frac{3}{2}]+Z'_{i+1}[-1+\frac{3}{4}] $$   (3)
 * style="width:95%" |
 * style="width:95%" |
 * <p style="text-align:right">
 * }
 * {| style="width:60%" border="0"

$$  \displaystyle Z'_{i+1/2}=Z'(s=1/2)=-\frac{3}{2}[Z_i-Z_{i+1}]-\frac{1}{2}[Z'_i+Z'_{i+1}] $$ which is the required result.
 * style="width:92%; padding:10px; border:2px solid #8888aa" |
 * style="width:92%; padding:10px; border:2px solid #8888aa" |
 * <p style="text-align:right">
 * }

Author
--Egm6341.s10.team2.niki 23:29, 5 April 2010 (UTC)

--Proofread by Egm6341.s10.team2.lee 00:37, 6 April 2010 (UTC)

Statement
P. 36-3 To prove that the condition for collocation at $$\; t_{i+1/2}$$ is:

$$Z_{i+1}=Z_{i}+\frac{\frac{h}{2}}{3}\left [ f_{i}+4f_{i+\frac{1}{2}}+ f_{i+1}\right ]$$

Solution
From P.36-2 we know that:

$$Z'_{i+\frac{1}{2}}=\frac{-3}{2}\left ( Z_{i}-Z_{i+1} \right )-\frac{1}{4}\left ( Z'_{i}+Z'_{i+1} \right )$$

using $$\dot{Z}=\frac{1}{h}Z' \;$$, we get:

$$\dot{Z}_{i+\frac{1}{2}}=\frac{-3}{2h}\left ( Z_{i}-Z_{i+1} \right )-\frac{1}{4}\left ( \dot{Z}_{i}+\dot{Z}_{i+1} \right )$$

$$\dot{Z}_{i+\frac{1}{2}}=\frac{-3}{2h}\left ( Z_{i}-Z_{i+1} \right )-\frac{1}{4}\left ( f_{i}+f_{i+1} \right )$$

Subtracting $$\; f_{i+\frac{1}{2}}$$ from both sides:

$$\dot{Z}_{i+\frac{1}{2}}-f_{i+\frac{1}{2}}=\frac{-3}{2h}\left ( Z_{i}-Z_{i+1} \right )-\frac{1}{4}\left ( f_{i}+f_{i+1} \right )-f_{i+\frac{1}{2}}$$

We know that in order for the collocation to be satisfied at point $$t_{i+1/2}$$, $$\; \dot{Z}_{i+\frac{1}{2}}-f_{i+\frac{1}{2}}=0$$

$$\therefore \frac{-3}{2h}\left ( Z_{i}-Z_{i+1} \right )-\frac{1}{4}\left ( f_{i}+f_{i+1}+4f_{i+\frac{1}{2}}\right )=0$$

$$\left ( Z_{i+1}-Z_{i} \right )= \frac{2h}{3*4}\left [f_{i}+f_{i+1}+4f_{i+\frac{1}{2}} \right ]$$


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


 * style="width:92%; padding:10px; border:2px solid #8888aa" |
 * style="width:92%; padding:10px; border:2px solid #8888aa" |

$$\therefore \; Z_{i+1}=Z_{i}+ \frac{\frac{h}{2}}{3}\left [f_{i}+4f_{i+\frac{1}{2}}+f_{i+1} \right ]$$


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

Author
Solved by-Srikanth Madala (SM)

==Problem 10: Commentary on the matlab code available on Kessler's paper for the evaluation of polynomials and their coefficients in the trapezoidal rule error==

Statement
P. 37-1

Run Kessler's code to reproduce his table, and complete the HW of P.30-2, i.e., follow Kessler's code line by line to produce the pairs $$\; [P_{2}(x),P_{3}(x)],\; [P_{4}(x),P_{5}(x)],\; [P_{6}(x),P_{7}(x)]$$ and write comments on his code.

Solution
Matlab code

Author
Solved by-Srikanth Madala (SM)

Statement
P. 37-1

An Ellipse was given:

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

where:

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

$$ a=1 $$

Calculate the Circumference of the elipse as follows:

Method 1:

$$ C= \int_{0}^{ 2 \pi } \left[r^{2} + (\frac{dr}{d\theta})^{2} \right] ^{\frac{1}{2}} $$

Method 2:

$$ C = 4aE(e^{2}) $$

$$ E(e^{2}) = \int_{0}^{\frac{\pi}{2}} \left[1 - e^{2}\sin(\theta) \right] ^{\frac{1}{2}}d\theta $$

Use Team 4's Solution to debug own code and compare results.

Composite Trapezoidal Rule
After looking at Team 4's codes I was able to gain knowledge into checking for the error of the numerical integration. Like our team, they also used the 'Quad' command as the theoretical answer to compare their results to. In addition they used an extra argument to the 'Quad' command which provides for more accurate results by providing the order of the error.

In addition the way the derivative of the radius relative to the angle is calculated differently. We used Matlab's Symbolic toolbox to find the integration results while team 4 used the theoretical results then plugged in values for their respective variables.

Regarding Method 2, the same applies.

Below are our results

Method 1

Method 2

Matlab Code Used
Modified Matlab code for composite Trapezoidal calculation

Clencurt Command
Comparing the two codes used for using the 'clencurt' command were different. Our approach took a simple way to just use the weights to calculate our results with no error bounding, as it was done by Team 4.

Method 1

Method 2

Modified Matlab Code For Clencurt
Matlab code

Romberg Table
The solution approaches to creating the Romberg Table were different from both teams. Team 4's approach uses the simple trapezoidal rule formula as compared to Our team's approach of using the matlab 'trapz' command. In addition the method used to calculate row by row of the Romberg Table were different.

When running Team 4's code I'm not able to get all of the Romberg Table to be completed. At the moment Team 2 is continiously working on figuring out the cause for the difference of the solutions as shown below:

Method 1

Method 2

Author
Solved by--Guillermo Varela (GV)

Signatures
Solved problems 3,7,8 and proofread --Niki Nachappa (NN) 23:31, 5 April 2010 (UTC)

Solved problems 4,5,9,10 --Srikanth Madala (SM)

Solved problems 2, 11 and Proofread 4, 8  --Guillermo Varela (GV) 20:50, 7 April 2010 (UTC)

Solved problems 1,6 and Proofread 3,7,8 --Egm6341.s10.team2.lee 02:12, 8 April 2010 (UTC)

Proofread problems 4,9,5,10 --Patrick O'Donoughue(PO)