User:Egm6341.s11.team2.no one needs to knowHW6

=Problem 6.1: Higher Order Trapezoid Rule Error (HOTRE) = Reference: Problems 2, and 3

''' This problem was solved without referring to S10. '''

A. Finding the Polynomials $$ {p_6}(t) $$ and $$ p_7(t) $$ and $$ E $$
Referring to Lecture 30,$$ \displaystyle P_6(t) $$ and $$ \displaystyle p_7(t) $$ can be written as follows:

$$ \displaystyle {p_6}(t) = \int\limits_{ - 1}^1 {{p_5}(t).dt = } {c_1}\frac + {c_3}\frac + {c_5}\frac + {c_7} $$

$$ \displaystyle  {p_7}(t) = \int\limits_{ - 1}^1 {{p_6}(t).dt = } {c_1}\frac + {c_3}\frac + {c_5}\frac + {c_7}t + {c_8}  $$

Knowing that $$ \displaystyle p_7(t) $$ is an off function and $$ \displaystyle p_7(0)= 0 $$ and $$ \displaystyle p_7(-1)=p_7(-1)=0 $$, the coefficients $$ \displaystyle c_7 $$ and $$ \displaystyle c_8 $$ can be calculated.

$$ \displaystyle p_7(0)=0 \Rightarrow c_8=0 $$

$$ \displaystyle p_7(1)=0 \Rightarrow c_7= 31/15120 $$

where

In order to fine the error, referring to Lecture 30, page 6, Equation (2) :

$$\displaystyle E = \left[ {{p_2}{g^{(1)}} + {p_4}{g^{(3)}}} \right]_{ - 1}^{ + 1} - \int\limits_{ - 1}^1 {{p_5}{g^{(5)}}.dt = } \left[ {{p_2}{g^{(1)}} + {p_4}{g^{(3)}}} \right]_{ - 1}^{ + 1} + \left[ \right]_{ - 1}^{ + 1} - \int\limits_{ - 1}^1 {{p_6}{g^{(6)}}.dt}  $$

$$\displaystyle E = \left[ {{p_2}{g^{(1)}} + {p_4}{g^{(3)}} + {p_6}{g^{(5)}}} \right]_{ - 1}^{ + 1} + \underbrace {\left[ \right]_{ - 1}^{ + 1}}_{ = 0} - \int\limits_{ - 1}^1 {{p_7}{g^{(7)}}.dt} $$

B. Finding $$ t_k(x) $$
Referring to Lecture 30, page 2:

$$ x(t) = t\frac{h}{2} + \frac{2} $$

Therefore:

note that :

$$\displaystyle  {t_k} = \frac{2}{h}[{x_k} - (\frac{2})] = \frac{2}{h}[\frac{2}] = \frac{2}{h}[\frac{2}] =  - 1  $$

and

$$\displaystyle {t_{k + 1}} = \frac{2}{h}[{x_{k + 1}} - (\frac{2})] = \frac{2}{h}[\frac{2}] = \frac{2}{h}[\frac{h}{2}] = 1   $$

C. Finding $$ d_1$$, $$ d_2 $$, and $$ d_3 $$
Referring to Lecture 31, page 2, Equation (2):

$$ {d_r} = \overline  = \frac $$

therefore:

$$ {d_1} = \overline  = \frac $$

and

$$ {d_2} = \overline  = \frac $$

and

$$ {d_3} = \overline  = \frac $$

=Problem 6.2: Proof of Higher Order Trapezoid Rule Error (HOTRE) =

Reference: Problem 5

''' This problem was solved without referring to S10. '''

Given: The Error for the Trapezoid Rule
The error of the trapezoid rule (Referring to Lecture 30, Page 2) is:

$$\displaystyle E^T_n= \sum_{k=0}^{n-1} \left[  \int_{x_{k}}^{x_{k+1}}f(x)dx-\frac{h}{2} \left\{ f(x_k)+f(x_{k+1}) \right\}  \right] $$

Find: The Error in the Higher Order Trapezoid Rule

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

E=\sum_{r=1}^{\ell} 2 \, \overline{d}_{2r} \, h^{2r-1}\Bigg[f^{(2r-1)}(b)-f^{(2r-1)}(a)\Bigg]-\frac{h^{2\ell}}{2^{2\ell}} \sum_{k=0}^{n-1} \int_{x_k}^{x_{k+1}} \, p_{2\ell}(t_{k}(x)) \, f^{(2\ell)}(x)dx $$
 * $$\displaystyle
 * $$\displaystyle
 * }.
 * }.

where,


 * $$\displaystyle \overline{d}_{2r} = \frac{p_{2r}(1)}{2^{2r}} $$
 * $$\displaystyle x \in [a,b] $$

Solution
Referring to Referring to Lecture 30, Page 2, the error can be written as:


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

$$\displaystyle E^T_n= \frac{h}{2}\sum_{k=0}^{n-1} \left[  \int_{-1}^{+1}g_k(t)dt- \left\{ g_k(-1)+g_k(+1) \right\}  \right] $$     (6.2.1)
 * style="width:95%" |
 * style="width:95%" |
 * 
 * }

where


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

$$\displaystyle g_k(t) = f(x(t)) $$     (6.2.2)
 * style="width:95%" |
 * style="width:95%" |
 * 
 * }

Please see Lecture 30, Page 2 for the more information on the transformation.

Using successive steps of integration by part method, the error can be written as:


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

$$\displaystyle \begin{align} E^T_n & = \frac{h}{2} \left[ \sum_{k=0}^{n-1}\Big[p_2(t)g_k^{(1)}(t)+p_4(t)g_k^{(3)}(t_k)+p_6(t)g_k^{(5)}(t)+......+p_{2\ell}(t)g_k^{(2\ell-1)}(t)\Big]_{-1}^{+1}- \sum_{k=0}^{n-1} \left[ \int_{-1}^{1}p_{2\ell}(t)g_k^{(2\ell)}(t) dt \right]\right]\\ &= \frac{h}{2} \left[ \sum_{r=1}^{\ell}\sum_{k=0}^{n-1}\Big[p_{2r}(t)g_k^{(2r-1)}(t)\Big]_{-1}^{+1} - \sum_{k=0}^{n-1} \left[    \int_{-1}^{1}p_{2\ell}(t)g_k^{(2\ell)}(t) dt \right]\right] \end{align} $$     (6.2.3)
 * style="width:95%" |
 * style="width:95%" |
 * 
 * }

note that $$\displaystyle p_{2r}(1)=p_{2r}(-1) $$, therefore:


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

$$\displaystyle \begin{align} E^T_n &= \frac{h}{2} \left[ \sum_{r=1}^{\ell}\sum_{k=0}^{n-1}\Big[p_{2r}(+1)g_k^{(2r-1)}(+1)-p_{2r}(-1)g_k^{(2r-1)}(-1)\Big]- \sum_{k=0}^{n-1} \left[   \int_{-1}^{1}p_{2l}(t)g_k^{(2\ell)}(t) dt \right]\right]\\ & \\ &= \frac{h}{2} \left[ \sum_{r=1}^{\ell}\sum_{k=0}^{n-1} p_{2r}(+1) \Big[g_k^{(2r-1)}(+1)-g_k^{(2r-1)}(-1)\Big]- \sum_{k=0}^{n-1} \left[   \int_{-1}^{1}p_{2l}(t)g_k^{(2\ell)}(t) dt\right]\right] \end{align} $$     (6.2.4)
 * style="width:95%" |
 * style="width:95%" |
 * 
 * }

Referring to Lecture 30, Page 3, Equation 2:


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

$$\displaystyle g_k^{(i)}(t)=\left(\frac{h}{2}\right)^if^{(i)}(x(t)),\,\,\,\,\ x \in [x_k,x_{k+1}] $$     (6.2.5)
 * style="width:95%" |
 * style="width:95%" |
 * 
 * }

which results in:


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

$$\displaystyle \begin{align} &g_k^{(2r-1)}(+1)=\left(\frac{h}{2}\right)^{2r-1}f^{(2r-1)}(x_{k+1}),\\ &g_k^{(2r-1)}(-1)=\left(\frac{h}{2}\right)^{2r-1}f^{(2r-1)}(x_{k}),\\ &g_k^{(2\ell)}(t)=\left(\frac{h}{2}\right)^{2\ell}f^{(2\ell)}(x_{t}) \end{align} $$     (6.2.6)
 * style="width:95%" |
 * style="width:95%" |
 * 
 * }

Plug equation 2.6 in equation 2.4:


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

$$\displaystyle \begin{align} E^T_n & = \left(\frac{h}{2}\right) \left[ \sum_{r=1}^{\ell} p_{2r}(+1) \left(\frac{h}{2}\right)^{2r-1} \sum_{k=0}^{n-1} \Big[f^{(2r-1)}(x_{k+1})-f^{(2r-1)}(x_k)\Big]- \sum_{k=0}^{n-1} \left[   \int_{x_k}^{x_{k+1}}p_{2\ell}(t_k(x))\left(\frac{h}{2}\right)^{2\ell}f^{(2\ell)}(x) dx \right] \right]\\ &= \sum_{r=1}^{\ell} h^{2r} \frac{p_{2r}(+1)}{2^{2r}} \Big[f^{(2r-1)}(x_{n})-f^{(2r-1)}(x_0)\Big]-  \left(\frac{h}{2}\right)^{2\ell+1} \sum_{k=0}^{n-1} \left[ \int_{x_k}^{x_{k+1}}p_{2\ell}(t_k(x))f^{(2\ell)}(x) dx \right] \end{align} $$     (6.2.7)
 * style="width:95%" |
 * style="width:95%" |
 * 
 * }

where we may define:


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

$$\displaystyle \overline{d}_{2r} = \frac{p_{2r}(+1)}{2^{2r}} $$ (6.2.8)
 * style="width:95%" |
 * style="width:95%" |
 * 
 * }


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

$$\displaystyle x_n=b, x_0=a $$ (6.2.7)
 * style="width:95%" |
 * style="width:95%" |
 * 
 * }

 Please check the final answer since the factor for the second summation has a different power than the given equation ( in the problem statement, I could not figure where is the problem 

=Problem 6.3 Verify and compare coefficients in HOTRE(Higher order trapezoidal rule error) from Bernoulli numbers=

''' This problem was solved without referring to S10. '''

Given: The Bernoulli Number in the Following Series
$$\displaystyle {B_{2r}}$$ are the Bernoulli numbers with even index, which can be determined from the Taylor series expansion

Where the coefficients can be determined using the following equation:

1. The Bernoulli Coefficients for 2n = 2,4,6
$$\displaystyle \bar{d_{2}}, \; \bar{d_{4}}, \; \bar{d_{6}}$$

1. Determine the Bernoulli Coefficients for 2n = 8,10
$$\displaystyle \bar{d_{8}}, \; \bar{d_{10}}$$ using Eq.6.3.1 and compare the results with Eq.6.3.2

Solution
1) We can obtain the Taylor series of $$x\,coth(x)$$ using wolframalpha:

Compare Eq.6.3.3 and Eq.6.3.1, we can obtain that

The above results are identical with what we have using Eq.6.3.2 in Problem 6.1.

2) From Eq.6.3.3 and compare it to Eq.6.3.1, we have

Comment: The Eq.6.3.1 is slightly different from the equation given in Mtg31-3, however this equation should be correct after our comparison.

=Problem 6.4 Redo Proof of HOTRE=

From the lecture slide Mtg 31-4

''' This problem was solved without referring to S10 homework. '''

Problem Statement:Using a Different Approach
Redo the proof of the HOTRE by another approach: cancel all the odd order derivative of $$\displaystyle g$$, and try to find where this approach collapse.

Solution: Proof of HOTRE Using a Different Approach
We have known form the class that the error at the panel $$\displaystyle k$$ can be expressed as:

If we keep on this integration by part and using $$\displaystyle p(t)$$ to cancel all the odd order derivative of $$\displaystyle {{g}_{k}}(t)$$, we have,

Similar to the process in step 2ab and step 3ab on the lecture, when we use $$\displaystyle p(t)$$ to cancel all the odd order derivative of $$\displaystyle {{g}_{k}}(t)$$, i.e. using $$\displaystyle {{p}_{2r}}$$ to cancel all $$\displaystyle {{g}_{2r-1}}(t)$$ by letting $$\displaystyle {{p}_{2r}}(1)={{p}_{2r}}(-1)=0$$, we are actually ensuring that all $$\displaystyle {{p}_{2r+1}}$$ are odd functions.

Hence,

Then Eq (6.4.2) becomes,

And the total error is a summation of $$\displaystyle {{E}_{k}}$$,

Reason why this approach fail
Then we can see the critical weakness of the approach of cancelling odd order derivative of $$\displaystyle {{g}_{k}}(t)$$ lies in the summation $$\displaystyle \sum\limits_{k=0}^{n-1}{\left[ g_{k}^{(2r)}(1){\color{red}+}g_{k}^{(2r)}(-1) \right]}$$.

Because the sign between $$\displaystyle g_{k}^{(2r)}(1)$$ and $$\displaystyle g_{k}^{(2r)}(-1)$$ is "plus" rather than "minus" then it can ‘ t cancel terms when sum according to $$\displaystyle k$$ making the final expression too complex compared to the approach stated in the lecture and also making the computation time enlongated.

Note that the corresponding summation in the preferred approach is with a "minus" sign reducing the summation symbol from 2 to 1.

=Problem 6.5 Calculation using Recurrence Formula=

''' This problem was solved by referencing Team 2, S10 homework 5, Problem8. '''

From the lecture slide Mtg 32-3

Given: The Recurrence Relation and Coefficience
For $$\displaystyle {{p}_{2i}}$$ and $$\displaystyle {{p}_{2i+1}}$$:

And the relation for the coefficient $$\displaystyle {{c}_{2i+1}}$$:

Solution:
From the S10 work we have known,

Then by Eq(6.5.3) we have,

Then by the recurrence formula Eq(6.5.1) and (6.5.2) we have:

and also,

=Problem 6.6 - Understanding Kessler's Code=

''' This problem was solved without referring to S10. '''

Given: Kessler's Code
Kessler's code, given in his paper :

Find: The Results Given by Kessler's Code and Develop a Better Understanding of HORTE
In order to better understand Kessler's code and the HOTRE, improve upon the work of s10 and explain the code line by line. Then, run Kessler's code for $$i=1,2,3$$ to reproduce his results. The collective work of s10 is referenced here under HW5, Problem 10.

Solution: A Line-by-Line Synopsis
The following box presents Kessler's code commented line-by-line to describe the algorithm for using the HOTRE. Running Kessler's code with n = 3 results in the following output:

These with the additional last line written into the code, the output matches the tables presented in Kessler's paper:

=Problem 6.7: Determination of Ellipse and Bifolium Arc Lengths =

''' This problem was solved with reference to S10 Matlab code. '''

Given: Definition of an Ellipse and Bifolium
The equation defining an ellipse,
 * {| style="width:100%" border="0"

$$\displaystyle \left( \frac{x}{a} \right)^2 + \left( \frac{y}{b} \right)^2 = 1 $$     (6.7.1)
 * style="width:95%" |
 * style="width:95%" |
 * 
 * }

Where the eccentricity is given by,
 * {| style="width:100%" border="0"

$$\displaystyle e=\left(1- \frac{b^2}{a^2} \right)^{1/2} $$     (6.7.2)
 * style="width:95%" |
 * style="width:95%" |
 * 
 * }

The parameterized form of the ellipse can be rewritten in terms of $$ r(\theta) $$ and the eccentricity as follows,
 * {| style="width:100%" border="0"

$$\displaystyle \begin{align} r(\theta ) &= \frac\\ a&=10\\ b&=3 \end{align} $$     (6.7.3)
 * style="width:95%" |
 * style="width:95%" |
 * 
 * }

Furthermore the circumference of the Ellipse, often referred to as the Elliptic Integral of the 2nd Kind, is shown here,
 * {| style="width:100%" border="0"

$$\displaystyle \begin{align} & i) \quad C = \int_0^{2\pi } {dl} = 4aE(e)\\ & ii) \quad dl = \left[1-e^2cos^2 t \right]^{1/2} dt \\ \implies \quad &iii) \quad E(e) = {\int_0^{\frac{\pi }{2}} {\left[ {1 - {e^2}\sin (\theta )} \right]} ^{\frac{1}{2}}}d\theta \end{align} $$     (6.7.4)
 * style="width:95%" |
 * style="width:95%" |
 * 
 * }

The equation for the bifolium is,
 * {| style="width:100%" border="0"

$$\displaystyle r(\theta ) = 2\sin (\theta ){\cos ^2}(\theta ) $$     (6.7.5)
 * style="width:95%" |
 * style="width:95%" |
 * 
 * }

1. The Parameterized Form of the Ellipse
Using the trigonometric relationships
 * {| style="width:100%" border="0"

$$\displaystyle \begin{align} x &= acos(t)\\ y &= bsin(t) \end{align} $$     (6.7.6) Determine $$ \displaystyle dl $$ and show equation (6.7.4.iii) holds.
 * style="width:95%" |
 * style="width:95%" |
 * 
 * }

A) For an Ellipse

 * Elliptical Integral of the 1st Kind Integrating (6.7.3)
 * Then with the following parametrized definitions determine the arc length $$ \displaystyle \overset{\frown}{PQ}$$ using:
 * Composite Trapezoid
 * Romberg Quadrature Rule
 * Clenshaw-Curtis Rule
 * chebfun/sum command


 * Elliptical Integral of the 2nd Kind Using (6.7.4iii)
 * Using the error for the composite trapezoid rule find $$ \displaystyle n $$ such that
 * {| style="width:100%" border="0"

$$\displaystyle $$     (6.7.7)
 * style="width:95%" |
 * style="width:95%" |
 * E_{n}| \leq h^2\frac{(b-a)}{12}M_{2}
 * 
 * }


 * Then with the following parametrized definitions determine the arc length $$ \displaystyle \overset{\frown}{PQ}$$ using:
 * Composite Trapezoid
 * Romberg Quadrature Rule
 * Clenshaw-Curtis Rule
 * chebfun/sum command

B) For the Bifolium

 * Determine the folium length using the following numerical integration methods:
 * Composite Trapezoid
 * Romberg Quadrature Rule
 * Clenshaw-Curtis Rule
 * chebfun/sum command

1. The Parameterized Form of the Ellipse
Using the trigonometric relationships
 * {| style="width:100%" border="0"

$$\displaystyle \begin{align} x &= acos(t)\quad \implies \quad dx=-acos(t)\\ y &= bsin(t)\quad \implies \quad dy=bcos(t) \end{align} $$     (6.7.8)
 * style="width:95%" |
 * style="width:95%" |
 * <p style="text-align:right">
 * }

An infinitesimal change in $$ \displaystyle l $$ written as $$ \displaystyle dl $$ can be described in terms of the infinitesimal change in $$ \displaystyle x $$ and $$ \displaystyle y $$ as,
 * {| style="width:100%" border="0"

$$\displaystyle dl = {\left[ {d{x^2} + d{y^2}} \right]^{\frac{1}{2}}} $$     (6.7.9)
 * style="width:95%" |
 * style="width:95%" |
 * <p style="text-align:right">
 * }

Substituting the relations shown in (6.7.8) into (6.7.9) we get,
 * {| style="width:100%" border="0"

$$\displaystyle dl = {\left[ {{a^2}{{\sin }^2}(\theta ) + {b^2}{{\cos }^2}(\theta )} \right]^{\frac{1}{2}}}d\theta $$    (6.7.10) Next we will do some algebra and arrive a the desired result,
 * style="width:95%" |
 * style="width:95%" |
 * <p style="text-align:right">
 * }
 * {| style="width:100%" border="0"

$$\displaystyle \begin{align} dl &= a{\left[ {{{\sin }^2}(\theta ) + \frac{{\cos }^2}(\theta )} \right]^{\frac{1}{2}}}d\theta \\ &= a{\left[ {1 - {{\cos }^2}(\theta ) + \frac{{\cos }^2}(\theta )} \right]^{\frac{1}{2}}}d\theta\\ &= a{\left[ {1 - \underbrace {\left( {1 - \frac} \right)}_{{\cos }^2}(\theta )} \right]^{\frac{1}{2}}}d\theta\\ &= a{\left[ {1 - {e^2}{{\cos }^2}(\theta )} \right]^{\frac{1}{2}}}d\theta \end{align} $$     (6.7.11)
 * style="width:95%" |
 * style="width:95%" |
 * <p style="text-align:right">
 * }

Determination of $$ n $$
To determine $$\displaystyle n $$ let us examine the error for the composite trapezoid rule.
 * {| style="width:100%" border="0"

$$\displaystyle $$
 * style="width:95%" |
 * style="width:95%" |
 * E_{n}| \leq \frac{(b-a)h^2}{12}M_{2}
 * <p style="text-align:right">
 * }

The above error for can be rewritten using
 * {| style="width:100%" border="0"

$$\displaystyle \begin{align} h &= \frac{b-a}{n} \\ M_{2} &= \max_{\zeta \in [a,b]}|f^{(2)}(\zeta)| \\ \end{align} $$     (6.7.13)
 * style="width:95%" |
 * style="width:95%" |
 * <p style="text-align:right">
 * }

And after substitution we get,
 * {| style="width:100%" border="0"

$$\displaystyle n^2 \leq \frac{(b-a)^3}{12}\frac{1}{|E_{n}|} \max_{\zeta \in [a,b]}|f^{(2)}(\zeta)| $$     (6.7.14)
 * style="width:95%" |
 * style="width:95%" |
 * <p style="text-align:right">
 * }

A) For an Ellipse
Where $$ \displaystyle a=10 $$ and $$ \displaystyle b=3 $$ using,
 * Composite Trapezoid
 * Romberg Quadrature Rule
 * Clenshaw-Curtis Rule
 * chebfun/sum command

Elliptical Integral of the 1st Kind
The elliptical integral of the 1st kind is described by the following equations,
 * {| style="width:100%" border="0"

$$\displaystyle \begin{align} I &= \int_{0}^{2\pi }{\sqrt{{{r}^{2}}+{{\left( \frac{dr}{d\theta } \right)}^{2}}}}d\theta \\ r(\theta) &= \frac{a(1-e^2)}{1-e \, cos(\theta)} \\ e &= \sqrt{1-{{\left( \frac{b}{a} \right)}^{2}}} \end{align} $$     (6.7.15)
 * style="width:95%" |
 * style="width:95%" |
 * <p style="text-align:right">
 * }

Elliptical Integral of the 2nd Kind
The elliptical integral of the 2nd kind is described by the following equation,
 * {| style="width:100%" border="0"

$$\displaystyle I=4a\int_{0}^{\pi /2}{\sqrt{1-{{e}^{2}}{{\sin }^{2}}\theta }}\ d\theta =4aE(e) $$     (6.7.16)
 * style="width:95%" |
 * style="width:95%" |
 * <p style="text-align:right">
 * }

B) For the Bifolium

 * Determine the folium length using the following numerical integration methods:
 * Composite Trapezoid
 * Romberg Quadrature Rule
 * Clenshaw-Curtis Rule
 * chebfun/sum command

Numerical Results
The table below summarizes the numerical results for four methods of numerical integration discussed above:
 * The elliptical integral of the 1st kind
 * We obtained the fastest convergence using the Romberg Tables with an elapsed time of 0.701108 seconds.
 * The composite trapezoid method performed the worst taking 2.886114 seconds with the number of iterations/nodes $$ n=385 $$.
 * Both the fast and standard Clenshaw Curtis methods took just over 1 second, however the fast Clenshaw Curtis method required 22 more iterations until convergence was achieved.
 * The elliptical integral of the 2nd kind
 * All four methods performed well for the elliptical integral of the 2nd kind.
 * Convergence was best for the Romberg and Composite Trapezoid methods requiring an elapsed time of about 0.60 seconds.
 * Not far behind were both the Clenshaw Curtis methods which took about 0.65-0.66 seconds to achieve convergence.
 * The Bifolium
 * For the bifolium numerical integration the results among the four methods varied the most.
 * Romberg significantly out performed all other methods only taking 0.73 seconds for convergence.
 * The second fastest convergence was for the trapezoid method and took 7.01 seconds and n=1097 to converge.
 * Unlike the trend observed for the elliptical integrations, the bifolium had faster convergence using the fast Clenshaw Curtis method than the standard, taking 13.53 and 40.79 seconds respectively.



=Problem 6.8: Derive Arc Length Equation=

''' This problem was solved without referring to S10. '''

From the lecture slide Mtg 33-3

Given: The Definition of an Arc Length
The formula for arc length from lecture 32-4:


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

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

\widehat{PQ} = \int_{\theta_{P}}^{\theta_{Q}}d\theta\left[r^2+\left(\frac{dr}{d\theta}\right)^{2}\right]^{\frac{1}{2}}. $$     (6.8.1)
 * <p style="text-align:right">
 * }

The law of cosines:

Triangle OAB:


 * HWK6 P8.jpg

where

Find: The Formula for the Arc Length of an Ellipse
Derive the formula for arc length of ellipse using triangle OAB and the law of cosines.

Solution
Applying the law of cosines formula to the OAB triangle case gives:

Substituting in Eqs 8.3-5 into Eq 8.6 gives

Taylor series expansion of $$\displaystyle \cos (d\theta) $$ is

Because theta is assumed to be small, we only need to take the first two terms of the Taylor series expansion of $$\displaystyle \cos (d\theta) $$ and sub into Eq 8.8.

The last term in Eq 8.11 $$\displaystyle rdrd\theta^2$$ is zero because the three derivatives shrink faster than the two derivative elements $$\displaystyle dr^2$$ and $$\displaystyle d\theta^2$$.

The remainder is

Taking the square root of both sides of Eq 8.12 then integrating from $$\displaystyle\theta_P$$ to $$\displaystyle\theta_Q$$ gives,

= Problem 6.9: Identification of Basis Functions $$\displaystyle \overline{N_i}$$ =

''' This problem was solved without referring to S10. '''

Given: $$ Z(s) $$ Expressed as a Linear Combination with its Basis
The relationship between $$\displaystyle Z(s)$$ and $$\displaystyle d_i$$(degree of freedom):


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

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

\begin{align} Z(s)&=\sum_{i=0}^{3}c_i s^i \\ &= \sum_{i=1}^{4} \overline{N_i}(s) \, d_i\\ \end{align}

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

where,


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

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

\begin{align} \overline{N_i}(s) &= basis\,\, function\\ d_i(s) &= degrees\,\, of\,\, freedom\\ d_1&=Z_i \\ d_2&=\dot{Z_i} \\ d_3&=Z_{i+1} \\ d_4&=\dot{Z}_{i+1}\\ \end{align}

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

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

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

\dot{Z}=\frac{dZ}{dt} = \frac{dZ}{ds} \frac{ds}{dt}

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

Find: The Basis Function for $$ i=1,2,3,4$$
Identify and plot the the basis function $$\displaystyle \left\{\overline{N_i}(s) \right\}\,\, ,i=1,2,3,4 $$.

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


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

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

\begin{align} \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} d_1 \\ hd_2 \\ d_3 \\ hd_4 \\ \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}. \\

\end{align}

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

where,


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

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

\begin{align} \overline{d}_1&=d_1 \\ \overline{d}_2&= h \, d_2 \\ \overline{d}_3&=d_3 \\ \overline{d}_4&= h \, d_4 \\ \end{align}

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

Expand the matrix equation.


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

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

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

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

Substitute $$\displaystyle c_i$$ to Eq 9.1


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

$$\displaystyle \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}
 * style="width:95%" |
 * style="width:95%" |

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

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


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

$$\displaystyle \begin{align} Z(s)& = (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} $$     (6.9.13-14)
 * style="width:95%" |
 * style="width:95%" |
 * <p style="text-align:right">
 * }

Comparing the LHS and RHS of the equation gives
 * {| style="width:100%" border="0" cellpadding="5" cellspacing="0"

(6.9.15-18)
 * style="width:10%" |
 * style="width:80%" |
 * style="width:80%" | <p style="text-align:right">
 * style="width:80%" | <p style="text-align:right">
 * }

Plot of $$\displaystyle \overline{N_i} $$.

=References=

=Contributing Members & Referenced Lecture=