User:EGM6341.s11.TEAM1.Sujin.HW6

Problem 6: Reproduce Kessler's Results using $$ (p_{2i}, p_{2i+1}) \ $$, where $$ i=1,2,3 \ $$. Start with the best of S10 to understand Kessler's code and reproduce its result
 Referenced from S10,Egm6341 Team1 HW5 Problem#10 to understand Kessler's Matlab code:|S10,Team1(HW5), but revised it to obtain correct P's and C's with s11 values 

Given
 Kessler's Matlab code: 

Reproduce Kessler's results
From eqn.6.1, 6.2 and 6.3, we can have following table;

By using the Kessler's Matlab code, n=3, following is obtained;

In problem.5, we obtained $$C_3, C_5 \ $$ and $$ C_7 \ $$ using eqn.6.1, 6.2, and 6.3;

And also, we can compute $$ p_2(1) \ $$ through $$ p_7(1) \ $$ using equations in the first above table, and from lecture note [[media:Nm1.s11.mtg32.djvu|(3) 32-1]], we know that $$ p_{2i+1}(1)=0 \ $$;

Let's compare these c's and p(1)'s with that from Kessler's code in the above second and third table.

$$\Rightarrow \;$$ c's are totally same with each result, but p(1)'s are different. So, it is needed to revise Kessler's code in order to generate correct p(1)'s. To be more specific, function [nsum, dsum]=fracsum(n,d) works correctly for updating cn and cd variables with proper values, but has flaws to generate correct coefficients, p(1)'s, which is considered as a sum of input vectors in this function.

Followings are (1) new function, [nsum, dsum]=re_fracsum(n,d) for newpn and newpd variables and (2) partially changed function, [c,p]=traperror(n).;

Finally, correct coefficients, p(1)'s are obtained from changed Kessler's code as following; , $$\begin{align}\;p_1(1)=p_3(1)=p_5(1)=p_7(1)=0\end{align}$$

Show that $$ z_{i+\frac{1}{2}} = z \left ( s=\frac{1}{2} \right ) = \frac{1}{2}(z_i+z_{i+1})+\frac{h}{8}(f_i-f_{i+1}) $$
From lecture note [[media:Nm1.s11.mtg37.djvu|p.37-3]], we know coefficients, $$\displaystyle\begin{align}c_i's\end{align}$$.

From eqn.6.4, each $$\displaystyle C_i $$ term can be replaced with $$\displaystyle Z $$ term.

From lecture note, [[media:Nm1.s11.mtg37.djvu|(6) p.37-1]] and [[media:Nm1.s11.mtg38.djvu|(4) p.38-1]], we know $$\displaystyle\dot{Z_i}=Z_i'\frac{1}{h}=f_i$$.

Thus,

Show that $$ Z'_{i+1/2}=Z'(s=1/2)=-\frac{3}{2}(Z_i-Z_{i+1})-\frac{1}{4}(Z'_i+Z'_{i+1}) $$
From lecture note [[media:Nm1.s11.mtg37.djvu|(1) p.37-2]], we know that

Using eqn.6.4, matrix, each $$\displaystyle C $$ can be represented in $$\displaystyle Z $$ term.

Thus,

Problem 9: Prove matrix $$ \underline{A} \ $$ multiplied with matrix $$ \left \{ c_j \right \} \ $$ gives the matrix $$ \begin{Bmatrix} z_i \\ z_i' \\ z_{i+1} \\ z_{i+1}' \end{Bmatrix} \ $$
 Solved without assistance 

Verify Matrix $$ A^{-1} $$
In lecture note [[media:Nm1.s11.mtg37.djvu|p.37-2]], A matrix is defined as following;

By using matlab command 'inv', we can easily obtain inverse matrix

Matlabcode:

Identify basis functions $$ \overline{N} \ _i(s) $$ for $$ i=1,2,3,4 $$
In lecture note [[media:Nm1.s11.mtg38.djvu|(2) p.38-1]] and [[media:Nm1.s11.mtg37.djvu|(1) p.37-1]], $$\displaystyle Z(s)$$ is defined as following ; for i=1, 2, 3, and 5 and from lecture note [[media:Nm1.s11.mtg37.djvu|(2) p.37-3]], we know

From eqn.6.4 matrix, we have following equations;

Now, we can expand eqn.9.2, and find $$ \overline{N}_i,$$, for i=1,2,3,4, in terms of s

Thus,

Plot $$\displaystyle N_i(s) $$ for i=1,2,3,4

Matlab Code: