As Fig. 2.5.2 shows, Euler’s method is rather unsymmetrical. It uses the predicted slope of the graph of the solution at the left-hand endpoint of the interval as if it were the actual slope of the solution over that entire interval. We now turn our attention to a way in which increased accuracy can easily be obtained; it is known as the improved Euler method.
Given the initial value problem
suppose that after carrying out n steps with step size h we have computed the approximation to the actual value of the solution at We can use the Euler method to obtain a first estimate—which we now call rather than —of the value of the solution at Thus
Now that has been computed, we can take
as a second estimate of the slope of the solution curve at .
Of course, the approximate slope at has already been calculated. Why not average these two slopes to obtain a more accurate estimate of the average slope of the solution curve over the entire subinterval This idea is the essence of the improved Euler method. Figure 2.5.3 shows the geometry behind this method.
The final formula in (5) takes the “Euler form”
if we write
for the approximate average slope on the interval .
The improved Euler method is one of a class of numerical techniques known as predictor-corrector methods. First a predictor of the next y-value is computed; then it is used to correct itself. Thus the improved Euler method with step size h consists of using the predictor
and the corrector
iteratively to compute successive approximations to the values of the actual solution of the initial value problem in (4).
Each improved Euler step requires two evaluations of the function f(x, y), as compared with the single function evaluation required for an ordinary Euler step. We naturally wonder whether this doubled computational labor is worth the trouble.
Under the assumption that the exact solution of the initial value problem in (4) has a continuous third derivative, it can be proved—see Chapter 7 of Birkhoff and Rota—that the error in the improved Euler method is of order This means that on a given bounded interval [a, b], each approximate value satisfies the inequality
where the constant C does not depend on h. Because is much smaller than h if h itself is small, this means that the improved Euler method is more accurate than Euler’s method itself. This advantage is offset by the fact that about twice as many computations are required. But the factor in (8) means that halving the step size results in 1/4 the maximum error, and with step size h/10 we get 100 times the accuracy (that is, 1/100 the maximum error) as with step size h.
Figure 2.4.8 shows results of applying Euler’s method to the initial value problem
with exact solution With in Eqs. (6) and (7), the predictor-corrector formulas for the improved Euler method are
With step size we calculate
and so forth. The table in Fig. 2.5.4 compares the results obtained using the improved Euler method with those obtained previously using the “unimproved” Euler method. When the same step size is used, the error in the Euler approximation to y(1) is 7.25%, but the error in the improved Euler approximation is only 0.24%.
x | Euler Method, Values of y | Euler Method, Values of y | Improved Euler, Values of y | Actual y |
---|---|---|---|---|
0.1 | 1.1000 | 1.1098 | 1.1100 | 1.1103 |
0.2 | 1.2200 | 1.2416 | 1.2421 | 1.2428 |
0.3 | 1.3620 | 1.3977 | 1.3985 | 1.3997 |
0.4 | 1.5282 | 1.5807 | 1.5818 | 1.5836 |
0.5 | 1.7210 | 1.7933 | 1.7949 | 1.7974 |
0.6 | 1.9431 | 2.0388 | 2.0409 | 2.0442 |
0.7 | 2.1974 | 2.3205 | 2.3231 | 2.3275 |
0.8 | 2.4872 | 2.6422 | 2.6456 | 2.6511 |
0.9 | 2.8159 | 3.0082 | 3.0124 | 3.0192 |
1.0 | 3.1875 | 3.4230 | 3.4282 | 3.4366 |
x | Improved Euler, Approximate y | Actual y |
---|---|---|
0.0 | 1.00000 | 1.00000 |
0.1 | 1.11034 | 1.11034 |
0.2 | 1.24280 | 1.24281 |
0.3 | 1.39971 | 1.39972 |
0.4 | 1.58364 | 1.58365 |
0.5 | 1.79744 | 1.79744 |
0.6 | 2.04423 | 2.04424 |
0.7 | 2.32749 | 2.32751 |
0.8 | 2.65107 | 2.65108 |
0.9 | 3.01919 | 3.01921 |
1.0 | 3.43654 | 3.43656 |
Indeed, the improved Euler method with is more accurate (in this example) than the original Euler method with The latter requires 200 evaluations of the function f(x, y), but the former requires only 20 such evaluations, so in this case the improved Euler method yields greater accuracy with only about one-tenth the work.
Figure 2.5.5 shows the results obtained when the improved Euler method is applied to the initial value problem in (9) using step size Accuracy of five significant figures is apparent in the table. This suggests that, in contrast with the original Euler method, the improved Euler method is sufficiently accurate for certain practical applications—such as plotting solution curves.
h | Improved Euler Approximation to y(1) | Error | |
---|---|---|---|
0.04 | 0.500195903 | 0.12 | |
0.02 | 0.500049494 | 0.12 | |
0.01 | 0.500012437 | 0.12 | |
0.005 | 0.500003117 | 0.12 | |
0.0025 | 0.500000780 | 0.12 | |
0.00125 | 0.500000195 | 0.12 | |
0.000625 | 0.500000049 | 0.12 | |
0.0003125 | 0.500000012 | 0.12 |
An improved Euler program (similar to the ones listed in the project material for this section) was used to compute approximations to the exact value of the solution of the initial value problem
of Example 1. The results obtained by successively halving the step size appear in the table in Fig. 2.5.6. Note that the final column of this table impressively corroborates the form of the error bound in (8), and that each halving of the step size reduces the error by a factor of almost exactly 4, as should happen if the error is proportional to
In the following two examples we exhibit graphical results obtained by employing this strategy of successively halving the step size, and thus doubling the number of subintervals of a fixed interval on which we are approximating a solution.
In Example 3 of Section 2.4 we applied Euler’s method to the logistic initial value problem
Figure 2.4.9 shows an obvious difference between the exact solution and the Euler approximation on using subintervals. Figure 2.5.7 shows approximate solution curves plotted using the improved Euler’s method.
The approximation with five subintervals is still bad—perhaps worse! It appears to level off considerably short of the actual limiting population You should carry out at least the first two improved Euler steps manually to see for yourself how it happens that, after increasing appropriately during the first step, the approximate solution decreases in the second step rather than continuing to increase (as it should). In the project for this section we ask you to show empirically that the improved Euler approximate solution with step size levels off at .
In contrast, the approximate solution curve with subintervals tracks the exact solution curve rather closely, and with subintervals the exact and approximate solution curves are indistinguishable in Fig. 2.5.7. The table in Fig. 2.5.8 indicates that the improved Euler approximation with subintervals is accurate rounded to three decimal places (that is, four significant digits) on the interval Because discrepancies in the fourth significant digit are not visually apparent at the resolution of an ordinary computer screen, the improved Euler method (using several hundred subintervals) is considered adequate for many graphical purposes.
x | Actual y(x) | Improved Euler with |
---|---|---|
0 | 1.0000 | 1.0000 |
1 | 5.3822 | 5.3809 |
2 | 7.7385 | 7.7379 |
3 | 7.9813 | 7.9812 |
4 | 7.9987 | 7.9987 |
5 | 7.9999 | 7.9999 |
In Example 4 of Section 2.4 we applied Euler’s method to the initial value problem
Figure 2.4.10 shows obvious visual differences between the periodic exact solution and the Euler approximations on with as many as subintervals.
Figure 2.5.9 shows the exact solution curve and approximate solution curves plotted using the improved Euler method with and subintervals. The approximation obtained with is indistinguishable from the exact solution curve, and the approximation with is only barely distinguishable from it.
Although Figs. 2.5.7 and 2.5.9 indicate that the improved Euler method can provide accuracy that suffices for many graphical purposes, it does not provide the higher-precision numerical accuracy that sometimes is needed for more careful investigations. For instance, consider again the initial value problem
of Example 1. The final column of the table in Fig. 2.5.6 suggests that, if the improved Euler method is used on the interval with n subintervals and step size then the resulting error E in the final approximation is given by
If so, then 12-place accuracy (for instance) in the value y(1) would require that which means that Thus, roughly half a million steps of length would be required. Aside from the possible impracticality of this many steps (using available computational resources), the roundoff error resulting from so many successive steps might well overwhelm the cumulative error predicted by theory (which assumes exact computations in each separate step). Consequently, still more accurate methods than the improved Euler method are needed for such high-precision computations. Such a method is presented in Section 2.6.
A hand-held calculator will suffice for Problems 1 through 10, where an initial value problem and its exact solution are given. Apply the improved Euler method to approximate this solution on the interval [0, 0.5] with step size Construct a table showing four-decimal-place values of the approximate solution and actual solution at the points .
Note: The application following this problem set lists illustrative calculator/computer programs that can be used in Problems 11 through 24.
A programmable calculator or a computer will be useful for Problems 11 through 16. In each problem find the exact solution of the given initial value problem. Then apply the improved Euler method twice to approximate (to five decimal places) this solution on the given interval, first with step size then with step size Make a table showing the approximate values and the actual value, together with the percentage error in the more accurate approximations, for x an integral multiple of 0.2. Throughout, primes denote derivatives with respect to x.
A computer with a printer is required for Problems 17 through 24. In these initial value problems, use the improved Euler method with step sizes and 0.0008 to approximate to five decimal places the values of the solution at ten equally spaced points of the given interval. Print the results in tabular form with appropriate headings to make it easy to gauge the effect of varying the step size h. Throughout, primes denote derivatives with respect to x.
Falling parachutist As in Problem 25 of Section 2.4, you bail out of a helicopter and immediately open your parachute, so your downward velocity satisfies the initial value problem
(with t in seconds and v in ft/s). Use the improved Euler method with a programmable calculator or computer to approximate the solution for first with step size and then with rounding off approximate v-values to three decimal places. What percentage of the limiting velocity 20 ft/s has been attained after 1 second? After 2 seconds?
Deer population As in Problem 26 of Section 2.4, suppose the deer population P(t) in a small forest initially numbers 25 and satisfies the logistic equation
(with t in months). Use the improved Euler method with a programmable calculator or computer to approximate the solution for 10 years, first with step size and then with rounding off approximate P-values to three decimal places. What percentage of the limiting population of 75 deer has been attained after 5 years? After 10 years?
Use the improved Euler method with a computer system to find the desired solution values in Problems 27 and 28. Start with step size and then use successively smaller step sizes until successive approximate solution values at agree rounded off to four decimal places.
Velocity-proportional resistance Consider the crossbow bolt of Example 2 in Section 2.3, shot straight upward from the ground with an initial velocity of 49 m/s. Because of linear air resistance, its velocity function v(t) satisfies the initial value problem
with exact solution Use a calculator or computer implementation of the improved Euler method to approximate v(t) for using both and subintervals. Display the results at intervals of 1 second. Do the two approximations—each rounded to two decimal places—agree both with each other and with the exact solution? If the exact solution were unavailable, explain how you could use the improved Euler method to approximate closely (a) the bolt’s time of ascent to its apex (given in Section 2.3 as 4.56 s) and (b) its impact velocity after 9.41 s in the air.
Square-proportional resistance Consider now the crossbow bolt of Example 3 in Section 2.3. It still is shot straight upward from the ground with an initial velocity of 49 m/s, but because of air resistance proportional to the square of its velocity, its velocity function v(t) satisfies the initial value problem
The symbolic solution discussed in Section 2.3 required separate investigations of the bolt’s ascent and its descent, with v(t) given by a tangent function during ascent and by a hyperbolic tangent function during descent. But the improved Euler method requires no such distinction. Use a calculator or computer implementation of the improved Euler method to approximate v(t) for using both and subintervals. Display the results at intervals of 1 second. Do the two approximations—each rounded to two decimal places—agree with each other? If an exact solution were unavailable, explain how you could use the improved Euler method to approximate closely (a) the bolt’s time of ascent to its apex (given in Section 2.3 as 4.61 s) and (b) its impact velocity after 9.41 s in the air.
Figure 2.5.10 lists TI-84 Plus and Python programs implementing the improved Euler method to approximate the solution of the initial value problem
considered in Example 2 of this section. The comments provided in the final column should make these programs intelligible even if you have little familiarity with the Python and TI programming languages.
To apply the improved Euler method to a differential equation one need only replace x+y
throughout with the desired expression. To increase the number of steps (and thereby decrease the step size) one need only change the value of N
specified in the second line of the program.
TI-84 Plus | Python | Comment |
---|---|---|
PROGRAM: IMPEULER |
# Program IMPEULER |
Program title |
|
def F(X,Y): return X + Y |
Define function f |
:10→N |
N = 10 |
No. of steps |
:0→X |
X = 0.0 |
Initial x |
:1→Y |
Y = 1.0 |
Initial y |
:1→T |
X1 = 1.0 |
Final x |
:(T-X)/N→H |
H = (X1-X)/N |
Step size |
:For(I,1,N) |
for I in range(N): |
Begin loop |
:Y→Z |
Y0 = Y |
Save previous y |
:X+Y→K |
K1 = F(X,Y) |
First slope |
:Z+H*K→Y |
Y = Y0 + H*K1 |
Predictor |
:X+H→X |
X = X + H |
New x |
:X+Y→L |
K2 = F(X,Y) |
Second slope |
:(K+L)/2→K |
K = (K1 + K2)/2 |
Average slope |
:Z+H*K→Y |
Y = Y0 + H*K |
Corrector |
:Disp X,Y |
print (X,Y) |
Display results |
:End |
# END |
End loop |
Figure 2.5.11 exhibits one Matlab implementation of the improved Euler method. The impeuler
function takes as input the initial value x
, the initial value y
, the final value x1
of x, and the desired number n
of subintervals. As output it produces the resulting column vectors x
and y
of x- and y-values. For instance, the Matlab command
[X, Y] = impeuler(0, 1, 1, 10)
then generates the first and fourth columns of data shown in Fig. 2.5.4.
You should begin this project by implementing the improved Euler method with your own calculator or computer system. Test your program by applying it first to the initial value problem of Example 1, then to some of the problems for this section.
The following problems describe the numbers and as specific values of certain initial value problems. In each case, apply the improved Euler method with subintervals (doubling n each time). How many subintervals are needed to obtain—twice in succession—the correct value of the target number rounded to five decimal places?
The number where y(x) is the solution of the initial value problem .
The number where y(x) is the solution of the initial value problem .
The number where y(x) is the solution of the initial value problem .
Apply your improved Euler program to the initial value problem of Example 3. In particular, verify (as claimed) that the approximate solution with step size levels off at rather than at the limiting value of the exact solution. Perhaps a table of values for will make this apparent.
For your own logistic population to investigate, consider the initial value problem
where m and n are (for instance) the largest and smallest nonzero digits in your student ID number. Does the improved Euler approximation with step size level off at the “correct” limiting value of the exact solution? If not, find a smaller value of h so that it does.
The differential equation
models a logistic population that is periodically harvested and restocked with period P and maximal harvesting/restocking rate h. A numerical approximation program was used to plot the typical solution curves for the case that are shown in Fig. 2.5.12. This figure suggests—although it does not prove—the existence of a threshold initial population such that
Beginning with an initial population above this threshold, the population oscillates (perhaps with period P?) around the (unharvested) stable limiting population whereas
The population dies out if it begins with an initial population below this threshold.
Use an appropriate plotting utility to investigate your own logistic population with periodic harvesting and restocking (selecting typical values of the parameters k, M, h, and P). Do the observations indicated here appear to hold for your population?
18.117.152.251