2.7: Euler's Method
( \newcommand{\kernel}{\mathrm{null}\,}\)
If an initial value problem
cannot be solved analytically, it is necessary to resort to numerical methods to obtain useful approximations to a solution of Equation
We’re interested in computing approximate values of the solution of Equation
where
we will denote the approximate values of the solution at these points by
the error at the
We encounter two sources of error in applying a numerical method to solve an initial value problem:
- The formulas defining the method are based on some sort of approximation. Errors due to the inaccuracy of the approximation are called truncation errors.
- Computers do arithmetic with a fixed number of digits, and therefore make errors in evaluating the formulas defining the numerical methods. Errors due to the computer’s inability to do exact arithmetic are called roundoff errors.
Since a careful analysis of roundoff error is beyond the scope of this book, we will consider only truncation errors.
Euler’s Method
The simplest numerical method for solving Equation
as an approximation to
However, setting
which isn’t useful, since we don’t know
Having computed
In general, Euler’s method starts with the known value
The next example illustrates the computational procedure indicated in Euler’s method.
Example
Use Euler’s method with
at
Solution
which is of the form Equation
Euler’s method yields
We’ve written the details of these computations to ensure that you understand the procedure. However, in the rest of the examples as well as the exercises in this chapter, we will assume that you can use a programmable calculator or a computer to carry out the necessary computations.
Examples Illustrating The Error in Euler’s Method
Example
Use Euler’s method with step sizes
at
which can be obtained by the method of Section 2.1. (Verify.)
Table
Exact | ||||
---|---|---|---|---|
0.0 | 1.000000000 | 1.000000000 | 1.000000000 | 1.000000000 |
0.1 | 0.800000000 | 0.810005655 | 0.814518349 | 0.818751221 |
0.2 | 0.640081873 | 0.656266437 | 0.663635953 | 0.670588174 |
0.3 | 0.512601754 | 0.532290981 | 0.541339495 | 0.549922980 |
0.4 | 0.411563195 | 0.432887056 | 0.442774766 | 0.452204669 |
0.5 | 0.332126261 | 0.353785015 | 0.363915597 | 0.373627557 |
0.6 | 0.270299502 | 0.291404256 | 0.301359885 | 0.310952904 |
0.7 | 0.222745397 | 0.242707257 | 0.252202935 | 0.261398947 |
0.8 | 0.186654593 | 0.205105754 | 0.213956311 | 0.222570721 |
0.9 | 0.159660776 | 0.176396883 | 0.184492463 | 0.192412038 |
1.0 | 0.139778910 | 0.154715925 | 0.162003293 | 0.169169104 |
Table
You can see from Table
Based on this scanty evidence, you might guess that the error in approximating the exact solution at a fixed value of
0.1 | 0.0187 | 0.0087 | 0.0042 |
0.2 | 0.0305 | 0.0143 | 0.0069 |
0.3 | 0.0373 | 0.0176 | 0.0085 |
0.4 | 0.0406 | 0.0193 | 0.0094 |
0.5 | 0.0415 | 0.0198 | 0.0097 |
0.6 | 0.0406 | 0.0195 | 0.0095 |
0.7 | 0.0386 | 0.0186 | 0.0091 |
0.8 | 0.0359 | 0.0174 | 0.0086 |
0.9 | 0.0327 | 0.0160 | 0.0079 |
1.0 | 0.0293 | 0.0144 | 0.0071 |
Table
Example
Tables
except in this case we cannot solve Equation
Exact | ||||
---|---|---|---|---|
0.0 | 1.000000000 | 1.000000000 | 1.000000000 | 1.000000000 |
0.1 | 0.800000000 | 0.821375000 | 0.829977007 | 0.837584494 |
0.2 | 0.681000000 | 0.707795377 | 0.719226253 | 0.729641890 |
0.3 | 0.605867800 | 0.633776590 | 0.646115227 | 0.657580377 |
0.4 | 0.559628676 | 0.587454526 | 0.600045701 | 0.611901791 |
0.5 | 0.535376972 | 0.562906169 | 0.575556391 | 0.587575491 |
0.6 | 0.529820120 | 0.557143535 | 0.569824171 | 0.581942225 |
0.7 | 0.541467455 | 0.568716935 | 0.581435423 | 0.593629526 |
0.8 | 0.569732776 | 0.596951988 | 0.609684903 | 0.621907458 |
0.9 | 0.614392311 | 0.641457729 | 0.654110862 | 0.666250842 |
1.0 | 0.675192037 | 0.701764495 | 0.714151626 | 0.726015790 |
Table
Since we think it is important in evaluating the accuracy of the numerical methods that we will be studying in this chapter, we often include a column listing values of the exact solution of the initial value problem, even if the directions in the example or exercise don’t specifically call for it. If quotation marks are included in the heading, the values were obtained by applying the Runge-Kutta method in a way that’s explained in Section 3.3. If quotation marks are not included, the values were obtained from a known formula for the solution. In either case, the values are exact to eight places to the right of the decimal point.
0.1 | 0.0376 | 0.0162 | 0.0076 |
0.2 | 0.0486 | 0.0218 | 0.0104 |
0.3 | 0.0517 | 0.0238 | 0.0115 |
0.4 | 0.0523 | 0.0244 | 0.0119 |
0.5 | 0.0522 | 0.0247 | 0.0121 |
0.6 | 0.0521 | 0.0248 | 0.0121 |
0.7 | 0.0522 | 0.0249 | 0.0122 |
0.8 | 0.0522 | 0.0250 | 0.0122 |
0.9 | 0.0519 | 0.0248 | 0.0121 |
1.0 | 0.0508 | 0.0243 | 0.0119 |
Table
Truncation Error in Euler’s Method
Consistent with the results indicated in Tables
at a given point
where
There are two sources of error (not counting roundoff) in Euler’s method:
- The error committed in approximating the integral curve by the tangent line Equation
over the interval . - The error committed in replacing
by in Equation and using Equation rather than Equation to compute .
Euler’s method assumes that
we will now use Taylor’s theorem to estimate
to obtain
Since we assumed that
which implies that
Since
where
or, equivalently,
Comparing this with Equation
Recalling Equation
Although it may be difficult to determine the constant
Note that the magnitude of the local truncation error in Euler’s method is determined by the second derivative
Since the local truncation error for Euler’s method is
To this end, recall that
and
Subtracting Equation
The last term on the right is the local truncation error at the
Since we assumed that
where
for some constant
For convenience, let
Recalling the formula for the sum of a geometric series, we see that
(since
Since Taylor’s theorem implies that
(verify),
with
Because of Equation