ORDINARY DIFFERENTIAL EQUATIONS POWERTOOL
Lesson 15 -- Improved Euler's Method
Prof. Douglas B. Meade
Industrial Mathematics Institute
Department of Mathematics
University of South Carolina
Columbia, SC 29208
URL: http://www.math.sc.edu/~meade/
E-mail: meade@math.sc.edu
Copyright 2001 by Douglas B. MeadeAll rights reserved
-------------------------------------------------------------------
Outline of Lesson 15
15.A Explicit Implementation of Improved Euler's Method
15.A-1 Example 1
15.A-2 Example 2
15.B dsolve and Improved Euler's Method
15.B-1 Example 1 (revisited)
15.B-2 Example 2 (revisited)
15.C Example 3
Initialization
Warning, the name changecoords has been redefined
There is some inconsistency in the use of the names Improved Euler's Method and Modified Euler's Method. Typically, the Improved Euler's Method is the method also known as the Trapezoid Method or Heun's Method.
The Improved Euler's method for the solution of a first-order IVP
,
can be summarized by the formulae
( )
where h is the stepsize.
By comparison, the Modified Euler's Method is typically defined to be
A simple implementation of the Improved Euler's method that accepts the function F, initial time , initial position , stepsize , and number of steps as input would be
As a test, compute the Improved Euler's Method solution to the IVP
on the interval with = 0.1.
A more sophisticated implementation of the Improved Euler's method would accept as input the ODE, the initial condition, the interval on which the solution should be computed, and the number of steps. In this case, the implementation could appear as
On the interval , the approximate solution to the IVP
by the Improved Euler's Method with 10 subdivisions would be obtained with the command
For a second example, use the Improved Euler's Method with = 2, 4, and 8 subdivisions to find an approximate value for where is the solution of the IVP
The parameters for the numeric solution are
and the list of the three decreasing stepsizes is
Then, the three approximate values for are
Alternatively, these results are summarized in the following table.
Implementations of the Improved Euler's Method for a first-order system are not significantly different or more difficult, but will not be considered at this time.
To request the use of the Improved Euler's Method in Maple's numerical computations, use method=classical[heunform] . The Modified Euler Method, or Improved Polygon Method, is implemented with method=classical[impoly] .
To illustrate, revisit the two examples considered in the previous section.
When an explicit table of values is needed, it is necessary to provide a list of values of the independent variable at which the approximate solution should be reported. Such a list would be
Then, the table of approximate solution values computed using the Improved Euler's Method is
If the results are to be plotted, then the dsolve and odeplot commands can be used as follows to create Figure 15.1.
The table of results can be constructed using three calls to dsolve as follows. The for-loop reduces the amount of typing needed with three separate executions of the statements.
The resulting table is
The final example illustrates the use of the full range of Maple tools to obtain, visualize, and analyze an approximate solution to an IVP obtained by the Improved Euler's Method.
Consider the problem of obtaining a solution to the IVP
on the interval .
The Improved Euler's Method with = 4 subdivisions yields Figure 15.2.
To determine if this approximation is reasonable, superimpose this solution on the slope field as done in Figure 15.3.
On the interval the Improved Euler solution does not look too bad. However, on the Improved Euler solution does not follow the slope field and is a much poorer approximation to the true solution. Unlike the Euler Method solution in Lesson 14, which crossed the equilibrium solution, the Improved Euler's Method solution does not approach the equilibrium solution fast enough. To obtain a reasonable approximation on the entire interval using the Improved Euler's Method, a smaller stepsize is required. The result of computing with stepsize = 0.8 appears in Figure 15.4
To complete the evaluation of this approximate solution, the DEplot command is used to include the (Maple-generated approximate) solution curve for this initial condition. Figure 15.5 shows the Improved Euler solution with stepsize 2 as the blue curve, the Improved Euler solution with stepsize 0.8 as the cyan curve, and the default (adaptive) numeric solution as the brown curve.
[Back to ODE Powertool Table of Contents]