User:EGM6341.s11.TEAM1.HW6

Problem 1: The Theorem of Higher Order Trapezoidal Rule Error (HOTRE) continued
 Solved without assistance 

Perform steps 4ab to find $$ (p_6,p_7) \ $$ and $$ E \ $$
Given: Steps 3ab:

Step 4b - Find $$ p_7(t) \ $$ by integration by parts
Next, we want $$ (c_7,c_8) \ $$ to cancel terms with $$ q^{(5)} \ $$ even order derivative of q. Set $$ p_7(t) = 0 \ $$, such that $$ p_7(0) = 0 \ $$ and $$ p_7( \pm \ 1) = 0 \ $$ Using given values for $$ c_1, c_3, c_5 \ $$ and solving for $$ p_7(0) = 0 \ $$ gives: Which results in $$ c_8=0 \ $$ Using given values for $$ c_1, c_3, c_5 \ $$ and solution of $$ c_8 \ $$, now solve for $$ p_7(1) = 0 \ $$ gives: Which results in $$ c_7 = \frac{31}{15120} \ $$, verify for $$ p_7(-1) = 0 \ $$: Again results in $$ c_7 = \frac{31}{15120} \ $$

$$ \therefore p_6(t) = -\frac{t^6}{6!}+ \frac{1}{6}\frac{t^4}{4!}- \frac{7}{360}\frac{t^2}{2!}+\frac{31}{15120} \ $$ $$ \therefore p_7(t) = -\frac{t^7}{7!}+ \frac{1}{6}\frac{t^5}{5!}- \frac{7}{360}\frac{t^3}{3!}+\frac{31}{15120} \ $$

Find $$ t_k(x) \ $$ from Eq(3) p30-2
 Referenced from User:Egm6341.s10.Team4/HW5: in order to understand re-arrangement of terms 

From p30-2 Eq(3): for $$ t \in \left [ -1,+1 \right ] \ $$

Now substitute $$ x=x_k \ $$

Knowing that $$ x_{k+1}-x_k=h \ $$

Now substitute $$ x=x_{k+1} \ $$

Knowing that $$ x_{k+1}-x_k=h \ $$

$$ \therefore \ $$ When $$ x=x_k \ $$, $$ t_k(x)=-1 \ $$ and $$ \therefore \ $$ When $$ x=x_{k+1} \ $$, $$ t_k(x)=1 \ $$

Problem 2: Derive Eq(1) p31-1 and Eq(2) p31-1
 Solved without assistance 

Derive Eq(1) p31-1 $$ E_n^T \ $$
Derive the Composite Trapezoidal Rule Error Equation

The error of Comp. Trap. Rule

Transfer $$ \int_{x_{k}}^{x_{k+1}}f(x)dx \ $$ to $$ \int_{-1}^{+1}g_{k}(t)dt \ $$

Hence,

Applying successive integration by parts, the following equation will be obtained:

Since $$ p_{2r} \ $$ is an even function, Take higher derivation of $$ g_k(t) \ $$, Substitute (2.5) and (2.6) into (2.4), $$ E \ $$ can be rewritten as follows: Let $$ x_k=a, x_{k+1}=b \ $$and rearrange the equation, Setting $$ \bar{d_{2r}}=\frac{p_{2r}(+1)}{2^{2r}} \ $$, $$ E \ $$ can be obtained as the following equation.

Derive Eq(2) p31-1 $$ \bar d \ _{2r} \ $$
Shown in the above, $$ \bar{d}_{2r} \ $$ can be obtained from (2.8).

Problem 3: Given Bernoulli's Numbers $$ x \coth x= \sum_{r=0}^{ \infty } \frac{B_{2r}}{(2r)!} x^{2r} \ $$
 Solved without assistance 

Verify $$ \bar d \ _2,\bar d \ _4, \bar d \ _6 \ $$
Above result is exactly same with $$\displaystyle \bar{d_{2r}} = \frac{P_{2r}(1)}{2^{2r}}$$

Result table

Find $$ \bar d \ _8,\bar d \ _{10} $$ using $$ x \coth x= \sum_{r=0}^{ \infty } \frac{B_{2r}}{(2r)!} x^{2r} \ $$
Since $$\displaystyle \bar{d_{2r}} = \frac{P_{2r}(1)}{2^{2r}}$$,

Result table

Find $$ \bar d \ _8,\bar d \ _{10} $$ using Bernoulli nos. and compare to solution found in 3.2
Then, based on the relation between $$\displaystyle \bar{d_{2r}} $$ and Bernoulli numbers, we can obtain $$\displaystyle \bar{d_{2}}, \,\bar{d_{4}}, \,\bar{d_{6}}$$ as follows.

Since $$\displaystyle B_{2}=\frac{1}{6}, \, B_{4}=-\frac{1}{30}, \, B_{6}=\frac{1}{42}, B_{8}=-\frac{1}{30}, \, B_{10}=\frac{5}{66}$$,

Result table

Problem 4: Redo proof of Higher Order Trapezoidal Rule Error(HOTRE) (ref: HW5, p8) by trying to cancel terms with odd order of derivative of g
 Solved without assistance 

Problem objective
Redo proof of Higher Order Trapezoidal Rule Error(HOTRE) (ref: HW5, p8) by trying to cancel terms with odd order of derivative of g

The composite trap error is given as:

Integrate E using integration by part we have:

Solution
At $$\displaystyle t = \pm 1$$, we get $$ c_3, c_4, c_5 \ $$

Expanding the error eqn with integration by parts,

We can cancel odd order derivatives of g and find the general expression of E as below
 * {| style="width:100%" border="0"

Note:Characteristic of odd func. $$\begin{align} \left[ P_{2l+1}(t)g^{(2l)}(t) \right]_{-1}^{+1} &= \underbrace{P_{2l+1}(+1)}_{\text{odd func.}}g^{(2l)}(+1)-\underbrace{P_{2l+1}(-1)}_{\text{odd func.}}g^{(2l)}(-1)\\ &=- P_{2l+1}(-1)\left[(g^{(2l)}(+1)+g^{(2l)}(-1))\right]\\ \end{align}$$ (4.9)
 * style="width:95%" |
 * style="width:95%" |
 * 
 * }

We get,

Using the given relation,

We get,

Plug the above eqns into the general form,

Problem 5: Given $$ p_1(t)=-t \ $$, use $$ \frac{c_1}{(2i+1)!}+\frac{c_3}{(2i-1)!}+\frac{c_5}{(2i-3)!}+...+\frac{c_{2i-1}}{3!}+c_{2i+1}=0 \ $$ to find 5.1, 5.2, 5.3 and 5.4
 Solved without assistance 

Using problem statement Find $$ (p_2, p_3) \ $$
Using the Recurrence formula on p.32-2(1) to obtain the pairs of polynomials $$ (p_2, p_3),(p_4, p_5),(p_6,p_7),(p_8,p_9) \ $$. The Recurrence formula are as follows,

We know $$ p_1(t)=-t \ $$ for $$ p_1 \ $$, we can get $$ i=0 \ $$

$$ C_1=-1 \ $$ for $$ (p_2,p_3) \ $$, we can get $$ i=1 \ $$

Using problem statement Find $$ (p_4, p_5) \ $$
Similarly, for $$ (p_4,p_5) \ $$, we can get $$ i=2 \ $$,

Using problem statement Find $$ (p_6, p_7) \ $$
for $$ (p_6, p_7) \ $$, we can get $$ i=3 \ $$

Using problem statement Find $$ (p_8, p_9) \ $$
for $$ (p_8, p_9) \ $$, we can get $$ i=4 \ $$,

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 

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 two tables are 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 second and third above 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 are 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 7: Methods of computing cicumferences
Use Wolfram Alpha for reference Provide elapsed time of you code in your solutions Use MATLAB command tic and tac

 Solved without assistance   Referenced [link here], but solved with s11 values 

bifolium
solution here

ellipse, where $$ a=10 \ $$ and $$ b=3 \ $$ using $$ r( \theta\ )=\frac{a(1-e^2)}{1-e \cos \theta\ } \ $$ and $$ C = \int_{ \theta\ =0}^{2 \pi\ } dl \ $$
solution here

ellipse where $$ a=10 \ $$ and $$ b=3 \ $$ using $$ E(e) = \int_{0}^{\frac{ \pi\ }{2}} \left [ 1-e^2 \sin \theta\ \right ] ^{\frac{1}{2}}, d \theta\ \ \ $$ and $$ C = 4AE(e) \ $$
solution here

bifolium
solution here

ellipse, where $$ a=10 \ $$ and $$ b=3 \ $$ using $$ r( \theta\ )=\frac{a(1-e^2)}{1-e \cos \theta\ } \ $$ and $$ C = \int_{ \theta\ =0}^{2 \pi\ } dl \ $$
solution here

ellipse where $$ a=10 \ $$ and $$ b=3 \ $$ using $$ E(e) = \int_{0}^{\frac{ \pi\ }{2}} \left [ 1-e^2 \sin \theta\ \right ] ^{\frac{1}{2}}, d \theta\ \ \ $$ and $$ C = 4AE(e) \ $$
solution here

bifolium
solution here

ellipse, where $$ a=10 \ $$ and $$ b=3 \ $$ using $$ r( \theta\ )=\frac{a(1-e^2)}{1-e \cos \theta\ } \ $$ and $$ C = \int_{ \theta\ =0}^{2 \pi\ } dl \ $$
solution here

ellipse where $$ a=10 \ $$ and $$ b=3 \ $$ using $$ E(e) = \int_{0}^{\frac{ \pi\ }{2}} \left [ 1-e^2 \sin \theta\ \right ] ^{\frac{1}{2}}, d \theta\ \ \ $$ and $$ C = 4AE(e) \ $$
solution here

bifolium
solution here

ellipse, where $$ a=10 \ $$ and $$ b=3 \ $$ using $$ r( \theta\ )=\frac{a(1-e^2)}{1-e \cos \theta\ } \ $$ and $$ C = \int_{ \theta\ =0}^{2 \pi\ } dl \ $$
solution here

ellipse where $$ a=10 \ $$ and $$ b=3 \ $$ using $$ E(e) = \int_{0}^{\frac{ \pi\ }{2}} \left [ 1-e^2 \sin \theta\ \right ] ^{\frac{1}{2}}, d \theta\ \ \ $$ and $$ C = 4AE(e) \ $$
solution here

===Problem 8: Derive $$ \widehat{PQ} = \int_{ \theta\ _P}^{ \theta\ _Q} \left [ r^2+ \left ( \frac{dr}{d \theta\ } \right ) ^2 \right ] ^{\frac{1}{2}}\, d \theta\ \ $$ using triangle OAB and the law of cosines===

 Referenced, to understand Taylor series implementation 



From http://www.wolframalpha.com/, the law of cosines is defined as:

Where $$ a= r \ $$ length of first side, Where $$ b= r+dr \ $$ length of second side, Where $$ c= dl \ $$ length of third side, Where $$ \alpha\ = d \theta\ \ $$ angle opposite third side, The law of cosines can be applied to the triangle OAB with the sides defined as $$ r \ $$, $$ r+dr \ $$, and inner angle $$ d\theta\ \ $$ as shown above to find the segment $$ AB=dl \ $$.

Assume angle $$ d \theta\ \ $$ is small and substitute $$ \cos d \theta = 1-\frac{d \theta\ ^2}{2} \ $$

The Taylor series expansion of $$ \cos x \ $$ is,

Taking the first two terms of the expansion and applying them to the Eq(8.2) yields:

Since the differential portion $$ drd \theta\ ^2 \ $$ in Eq(8.4) goes to zero more rapidly than $$ dr^2 \ $$ and $$ d \theta\ ^2 \ $$, it is set to zero. The remainder is:

Integrating from $$ \theta\ _P \ $$ to $$ \theta\ _Q \ $$ yields:

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 4 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:



=Contributing Members & Referenced Lecture=