0402 Motivation and Implementation of Euler's Method
What Would One Use Numerical Methods For?
The graphical methods described in the previous session give one a quick feel for how the solutions to a differential equation behave; they can also be very accurate at predicting long-term behaviour, e.g. in the presence of funnels. However, when the 'medium range' solutions must be known accurately, and the equation cannot be solved exactly, numerical methods are usually the best option. Also, even when an equation can be solved with an exact formula, it still might not be straightforward to compute values of a solution. For example, the equation with initial condition can be solved exactly: . The number is the value . But how do you find out that in fact ? Here, too, you would use some kind of numerical methods. For ODE's the simplest numerical method is called Euler's method.
Review: The Tangent Line Approximation
Consider a function , and a point on its graph. Call the function describing the tangent line to the graph at this point, The slope of the tangent line is and it satisfies the equation
Suppose we are given a differential equation , with initial condition . One simple way to approximate near is to use the tangent line at :
For example, consider the differential equation , with initial condition . The tangent line approximation gives:
Of course, we know , so . So, our estimate of 2 is rather crude. Suppose instead we were trying to approximate . We get
a better estimate. Graphically, we can see the tangent line separates from the curve. The bigger the step in the direction the farther away the tangent line is from the curve.
The point is that the tangent line approximation works best for small . The idea behind Euler's method is to use a sequence of successive tangent line approximations, each of them with a fairly 'small' .
Euler's method
We want to estimate the solution (integral curve) to passing through . It is shown as a curve in the picture. We first choose a step size, denoted . Starting at we approximate the integral curve over the interval by the tangent line, which has slope . (This is the slope of the integral curve, since .) This takes us as far as the point , which is calculated by the equations (see the picture)
Now we are at . We repeat the process, using as the new approximation to the integral curve the line segment having slope . This takes us as far as the next point , where
We continue in the same way. The general formulas telling us how to get from the -st point to the -th point are
In this way, we get an approximation to the integral curve consisting of line segments joining the points as shown in the figure below.
We will call the line segments "Euler struts", and their union the Euler polygon. It is an approximation to the integral curve .
In doing a few steps of Euler's method by hand, as you are asked to do in some of the exercises to get a feel for the method, it's best to arrange the work systematically in a table.
Example. For the IVP: , use Euler's method with step size 0.1 to find .
Solution. We use , and above to find xn and .
|n|||||
|---|---|---|---|---|
|0|1|0|1|0.1|
|1|1.1|0.1|1.20|0.12|
|2|1.2|0.22|||