MATH/APPM 4650
Class notes, March 13
Euler's method
Today's notes will mostly be on the board.
Definition: A problem is called well-posed if 1) a solution exists, 2) the solution is unique, and 3) the solution is stable with respect to small changes in the data.
If we have a differential equation
with f continuous in both variables and Lipschitz in y (for example, if f has continuous derivatives), then we know about existence and uniqueness.
We also need stability, since often f will not be computable exactly and the initial condition y0 may not be known exactly.
Fortunately this is also true.
We saw last time that Picard iteration could in principle be used to generate approximate solutions.
However, it has several problems.
- The integrals quickly become very difficult to compute symbolically.
- If we wanted to compute them numerically, we'd have to compute a bunch of numerical integrals of the same function with many different bounds.
- It converges slowly (like a geometric series).
Euler's method is much older than Picard's method, and consists of solving a difference equation instead of a differential equation.
It's the basis of almost every numerical method for ODEs, as well as many methods for PDEs.
Simple idea: let h be some small number. Then y'(t) ≈ [y(t+h)-y(t)]/h, and that means
y(t+h) ≈ y(t) + f(t, y(t)).
If wi is an approximation for y(ti), then
wi+1 = wi + f(ti, wi).
If T = hn is some time, then we should have y(T) ≈ wn.
We can derive an error formula for this.
If wi were exactly equal to y(ti), then the error at the next step would be
Or more simply just O(h2).
Being a little more careful, one can get a more precise estimate (without assuming anything except that w0 = y(t0)).
If L is the Lipschitz constant of f, i.e.,
|f(t, w) - f(t, y)| ≤ L |w - y| for all t, w, y,
and if y''(t) ≤ M for all t, then
In particular Euler's method will converge to the true solution as h approaches zero, ,in the absence of roundoff error.
Unfortunately, there is roundoff error.
The smaller h is, the more computations you need to do to get to a fixed time.
Each computation has some small roundoff error. This error propagates.
So the total error at some fixed final time T = nh will be proportional to n.
In other words, proportional to 1/h.
So we get the same type of roundoff error as when computing derivatives numerically, though for different reasons.
Thus we can't choose h too small.
For Euler's method, the optimal h is roughly the square root of the precision: if we have eight significant digits in the computation, h = 10-4 will be about the best one could use.