next up previous
Next: About this document ...

Name: Math 428
Exam 3 solution guide
7 May 2002




Always the beautiful answer who asks a more beautiful question.
-E. E. Cummings




Instructions: Show all work to receive full or partial credit. You may use a scientific calculator, your notes and your textbook on this exam. All University rules and guidelines for student conduct are applicable.

1.
[20 pts] Prove that the backward Euler method is A-stable.


To prove that backward Euler is A-stable, we must show that the region of absolute stability includes the entire right half-plane when $\Re(\lambda) > 0$ for the ODE $y' = - \lambda y$. We found the region of absolute stability for backward Euler in class, and used it many times. I would not fault anyone for referring to this, but just the same, we can find it again here.

Substituting the ODE into backward Euler, we find that

\begin{displaymath}u_{k+1} = u_k - \lambda h u_{k+1},
\end{displaymath}

or

\begin{displaymath}u_{k+1} = \frac{1}{1+\lambda h} u_k
\end{displaymath}

If we solve the recurrence relation, we see that uk = C rk where $r=\frac{1}{1+\lambda h}$. If we do a little bit of algebra, we see that

\begin{displaymath}\lambda h = r - 1 = e^{i \theta} -1.
\end{displaymath}

where $0 \leq \theta \leq 2 \pi$. Thus, the region of absolute stability is everything except a disk of radius one centered at -1 + 0 i in the complex plane, so the method is A-stable.

2.
[20 pts] Derive a second order finite difference approximation for yk''', the third derivative of y at x=hk. You may use as values of yi as you need, but you must show that your approximation has second order accuracy.


Here, you could use a lot of things. I had hoped you would use building blocks from your homework. For instance, we can use the second order finite difference for yk'' for HW6.

\begin{displaymath}y_k'' - \frac{y_{k+1}-2 y_k+y_{k-1}}{h^2} = O(h^2)
\end{displaymath}

If we substitute y' for y, we have

\begin{displaymath}y_k''' - \frac{y'_{k+1}-2 y'_k+y'_{k-1}}{h^2} = O(h^2).
\end{displaymath}

Then, we have to find a way to approximate y'k. The simplest is using centered differences:

\begin{displaymath}y_k' - \frac{y_{k+1}-y_{k-1}}{2h} = -\frac{1}{6} h^2 y_k''+ O(h^3)
\end{displaymath}

I am including the remainder (from your homework) because they will cancel when you perform the second order finite difference.

\begin{eqnarray*}y_k''' - \frac{y'_{k+1}-2 y'_k+y'_{k-1}}{h^2} & = &
O(h^2) \\
...
...rac{-\frac{1}{6} h^4 y_{k+1}''''}{h^2} + O(h^2) \\
& = & O(h^2)
\end{eqnarray*}


3.
[15 pts] Explicitly design a shooting algorithm using the secant method that will solve the boundary value problem,
\begin{gather*}y'' = f(y,y',x), \\
y(0)+y'(0) = 1, \\
y(1)-y'(1) = 1.
\end{gather*}


The secant method had already been discussed in some detail in class. The key is to find an initial value problem (IVP) to shoot with, and a function for which has a root for the appropriate boundary conditions.

To find an appropriate IVP, we can set y(0)=z where z is our shooting parameter. Then, we see that we meet the BC on the left by setting y'(0) = 1-z. That's all you have to do. So, our IVP is
\begin{gather*}y_z'' = f(y,y',x), \\
y_z(0) = z, \\
y_z'(0) = 1-z.
\end{gather*}

Let uz be a numerical solution to this problem. What must we do to satisfy the BC's on the right? Well, we want y(1)-y'(1) = 1. So, our function should be something like

\begin{displaymath}\phi(z) = u_z(1)-u'_z(1)-1.
\end{displaymath}

If we use the secant method to find a root of $\phi(z)$, we will solved the original boundary value problem.

I have not yet described the secant method. While it was given in class, I'll describe it here. We begin with two values of z called z1 and z1 such that $\phi(z_1) \phi(z_2) < 0$.

(a)
Compute

\begin{displaymath}z_* = z_1 -\phi(z_1) \frac{z_2-z_1}{\phi(z_2) - \phi(z_1)}.
\end{displaymath}

(b)
If $\phi(z_*) \phi(z_1) > 0$, let z1 = z*. If $\phi(z_*) \phi(z_2) > 0$, let z2 = z*.

(c)
If $\phi(z_*)$ is close to some tolerance, bail out of the algorithm and return z. Otherwise, return to step 1.

4.
[20 pts] Explicitly design a shooting algorithm using the Newton's method that will solve the boundary value problem,
\begin{gather*}y'' = f(y,y',x), \\
y(0)+y'(0) = 1, \\
y(1)-y'(1) = 1.
\end{gather*}


Here, we begin with the same IVP as in the previous problem, we need an auxiliary IVP so that we can find $\frac{d\phi}{dz}(z)$.
\begin{gather*}y_z'' = f(y,y',x), \\
y_z(0) = z, \\
y_z'(0) = 1-z.
\end{gather*}
We need to differentiate the whole IVP by
z to find $\frac{d\phi}{dz}(z)$, so
\begin{gather*}w_z'' = f_y(y,y',x)w + f_{y'}(y,y',x)w', \\
w_z(0) = 1, \\
w_z'(0) = -1.
\end{gather*}
where
$w = \frac{dy}{dz}$ based on the solution of yz. Let vzbe a numerical solution for wz. Now, we can see that

\begin{displaymath}\frac{d\phi}{dz}(z) = v_z(1)-v'_z(1)
\end{displaymath}

which comes from the solution of our auxiliary equation.

Everyone recalls that Newton's method is

\begin{displaymath}z_{k+1} = z_k - \frac{\phi(z_k)}{\frac{d \phi}{d z} (z_k)}.
\end{displaymath}

5.
[15 pts] Explicitly design a shooting algorithm using the secant method that will solve the boundary value problem,
\begin{gather*}y''' = f(y,y',y'',x), \\
y(0) = \alpha, \\
y'(0) = \beta, \\
y(1) = \gamma.
\end{gather*}


This is very similar to the example given in class. In this case, the IVP is
\begin{gather*}y''' = f(y,y',y'',x), \\
y(0) = \alpha, \\
y'(0) = \beta, \\
y''(0) = z,
\end{gather*}
and the objective function would be
$\phi(z) = y(1)-\gamma$.

6.
[10 pts] Explicitly design a shooting algorithm using the secant method that will solve the boundary value problem,
\begin{gather*}y''' = f(y,y',y'',x), \\
y(0) = \alpha, \\
y(1) = \beta, \\
y'(1) = \gamma.
\end{gather*}


The key to this problem is to realize that one must take advantage of the fact that two of the BC's are on the right rather than the left. One can reverse the IVP by changing variables, s = 1-x. Then, an appropriate IVP would be
\begin{gather*}y''' = -f(y,-y',y'',1-s), \\
y(0) = \beta, \\
y'(0) = \gamma, \\
y''(0) = z
\end{gather*}
where
$' = \frac{d}{ds}$. Not everyone was this rigorous, but I accepted reasonable detail about solving the problem in reverse. The objective function would be $\phi(1) = y(1) - \alpha$.



 
next up previous
Next: About this document ...
Louis F Rossi
2002-05-17