\magnification = \magstep1
\overfullrule=0pt
\centerline{Mathematics 172 -- Numerical Analysis 2}
\centerline{Discussion 1 -- First Numerical Methods for First Order IVP's}
\centerline{February 2, 1999}
\bigskip
\noindent
{\bf Background}
\bigskip
A {\it numerical\/} approach to solving 
the standard first order initial value problem:
$$\cases{y' = f(t,y)&\cr
        y(t_0) = \alpha&\cr}$$
produces as {\it output\/} a {\it table of 
(approximate) function values\/} $y_j$ for the solution function of the 
IVP, for instance at a collection of equally-spaced $t$-values
$t_1 = t_0 + h$, $t_2 = t_0 + 2h$:
$$y_j \doteq y(t_j) = y(t_0 + jh),$$
where $y_j$ are the approximate values, and $y(t_j)$ are the 
exact values of the solution function at $t = t_j = t_0 + jh$, $j = 1,\ldots, n$.

In class last Thursday, we recalled a very basic method of this
type called Euler's Method:  Starting from $y_0 = \alpha$, $t_0$, 
we construct a sequence $y_k$ (one step at a time) by the rule
$$y_j = y_{j-1} + f(t_{j-1},y_{j-1})h\leqno(1)$$
Today we will consider some of the properties of this method, and
related methods.
\bigskip
\noindent
{\bf Discussion Questions}

\bigskip
\item{A)} Consider the Exponential Growth/Decay equation
$y' = ky$, and the initial condition $y(0) = \alpha$.  
\itemitem{1)} With step size
fixed at $h$, what do you get after $n$ steps of Euler's Method?
(what is $y_n$?)    
\itemitem{2)}  Next, consider a fixed $\tilde{t}$
and let $h = \tilde{t}/n$ (so that for all $n \ge 1$, 
$n$ steps take you to the same final value $t_n = \tilde{t}$).
What happens as you let $n \to \infty$ (so $h \to 0$).  Does
$$\lim_{n\to \infty} y_n$$
agree with the value of the exact solution of the IVP at $t = \tilde{t}$?

\bigskip
\item{B)}  What is the error after {\it one step of Euler's 
method\/} on the general equation $y' = f(t,y)$? 
That is, what is $|y(t_1) - y_1|$?  Can you 
give a $O(h^\ell)$ estimate for the one-step error?  (Hint: think
Taylor!)   

\bigskip
\item{C)}  Euler's method is hardly the ``last word'' in numerical
methods for ODE's.  In fact it is a rather {\it poor\/} (i.e. inaccurate)
method.  Thinking in terms of the slope field of the equation $y' = f(t,y)$, 
we can see one reason immediately.   Note that $f(t,y)$ will usually
be changing continuously as we move from $t = t_{j-1}$ to $t = t_j$.  Hence
using the {\it constant\/} slope $f(t_{j-1}, y_{j-1})$ everywhere
between $t = t_{j-1}$ and $t = t_j$ may not do a very good job
of ``going with the flow'' of the slope field.  Here is an idea for 
a first way to try to improve the situation:
\medskip
\itemitem{$\bullet$}  First we can find 
$$y_j^{\rm (Euler)} = y_{j-1} + f(t_{j-1}, y_{j-1})h$$
as in Euler's Method. 
\itemitem{$\bullet$}  Next, we can ``sample'' the slope field
again at the point $(t_j,y_j^{\rm (Euler)})$
\itemitem{$\bullet$}  If $h$ is relatively small, then there is 
a good chance $f$ is either strictly increasing or strictly decreasing
along the exact solution curve between $t = t_{j-1}$ and $t = t_j$.
So it is at least plausible to suppose that the {\it average rate of change\/}
of $y$ between $t = t_{j-1}$ and $t = t_j$ is {\it somewhere between\/}
$f(t_{j-1}, y_{j-1})$ and $f(t_j,y_j^{\rm (Euler)})$.
\medskip
\item{} Use the idea above to devise a {\it modification\/} to Euler's
method, using the {\it two slope field values\/}
$$f(t_{j-1}, y_{j-1}),\ f(t_j,y_j^{\rm (Euler)})$$
that should be more accurate than Euler's method itself.  Give an iteration
formula for your method like (1) above.  

\bigskip
\item{D)}  One test for whether your method is really better than Euler's method
is to find a $O(h^\ell)$ estimate for its one-step error.  Do this for
your method.  Is your method really superior?  Why?  In working 
on this problem, the following facts may be useful:
\medskip
\itemitem{$\bullet$} Taylor expansions for functions of two variables:
$$\eqalign{f(t_0 + h,y_0 + k) &= f(t_0,y_0) + {\partial f\over \partial t}(t_0,y_0)\cdot h
+{\partial f\over \partial y}(t_0,y_0)\cdot k + \cr
&\ {1\over 2}\left(
{\partial^2 f\over \partial t^2}(t_0,y_0)\cdot h^2 + 
2 {\partial^2 f\over \partial t \partial y}(t_0,y_0)\cdot hk + 
{\partial^2 f\over \partial y^2}(t_0,y_0)\cdot k^2 \right) + \cdots \cr}$$
(these are the first and second degree terms -- the expansion keeps going, but the 
higher terms are not relevant here).
\itemitem{$\bullet$}  If $y(t)$ is a solution of the differential equation
$y' = f(t,y)$, then $y''(t)$ can be computed by differentiating both sides:
$$y''(t) = {d\over dt}y'(t) = {d \over dt} f(t,y(t)).$$
\itemitem{$\bullet$}  Chain rule:  If $f(x,y)$ is a function of two variables,
and a vector function of one variable $(u(t),v(t))$ is substituted into 
$f$, then the derivative of the resulting function of $t$ is:
$${d \over dt} f(u(t),v(t)) = {\partial f\over \partial x}(u(t),v(t))\cdot u'(t) + 
{\partial f\over \partial y}(u(t),v(t))\cdot v'(t) $$
\bigskip
\noindent
{\bf Assignment}
\bigskip
Group writeups due Tuesday, February 9.
\bye    

