Module

for

Runge-Kutta-Fehlberg Method for O.D.E.'s

Runge-Kutta-Fehlberg Method (RKF45)

One way to guarantee accuracy in the solution of an I.V.P. is to solve the problem twice using step sizes
h and and compare answers at the mesh points corresponding to the larger step size.  But this requires a significant amount of computation for the smaller step size and must be repeated if it is determined that the agreement is not good enough. The Runge-Kutta-Fehlberg method (denoted RKF45) is one way to try to resolve this problem.  It has a procedure to determine if the proper step size h is being used.  At each step, two different approximations for the solution are made and compared.  If the two answers are in close agreement, the approximation is accepted. If the two answers do not agree to a specified accuracy, the step size is reduced.  If the answers agree to more significant digits than required, the step size is increased.

Each Runge-Kutta-Fehlberg step requires the use of the following six values:

Then an approximation to the solution of the I.V.P. is made using a Runge-Kutta method of order 4:

And a better value for the solution is determined using a Runge-Kutta method of order 5:

The optimal step size
sh can be determined by multiplying the scalar s times the current step size h. The scalar s is

where
is the specified error control tolerance.

Computer Programs  Runge-Kutta-Fehlberg Method  Runge-Kutta-Fehlberg Method

Mathematica Subroutine (Runge-Kutta-Fehlberg Method RFK45)  To compute a numerical approximation for the solution of the initial value problem with over at a discrete set of points with an error control  .  Start with the initial point    and generate the sequence of approximations  .  The step size is automatically adjusted.  Thus the number is determined by the subroutine.  At each step the final answer is computed using the formula   .

Remark.  The formula for adjusting the step size is a popular choice for numerical analysis textbooks.

Remark.  Some textbooks are now promoting the use of the RK order five formula    as the accepted value instead of    from the order four formula.  The following subroutine includes these adjustments.

Mathematica Subroutine (Runge-Kutta-Fehlberg Method RFK54)  To compute a numerical approximation for the solution of the initial value problem with over at a discrete set of points with an error control  .  Start with the initial point    and generate the sequence of approximations  .  The step size is automatically adjusted.   Thus the number is determined by the subroutine.  At each step the final answer is computed using the formula   .

Remark.  One might question the wisdom of using the RKF54 instead of the RKF45, it is still being debated.  In some sense the "guarantee" of accuracy is diminished.  The RKF54 is given for you to explore.

Example 1.  Solve    with    over  .  Use the Runge Kutta methods.
Solution 1.

Example 2.  Solve    with    over  .  Use Mathematica's NDSolve procedure.
Solution 2.

Example 3.  Solve    with    over  .  Use Mathematica's DSolve procedure.
Solution 3.

Example 4.  Determine the error for the RKF45 solution that was found in Example 1.
Solution 4.

Example 5.  Determine the error for the RKF54 solution that was found in Example 1.
Solution 5.

Example 6.  Solve    with    over  .   Use the Runge Kutta methods.
Solution 6.

Example 7.  Given    with    over  .  This D.E. is known to be a Riccati equation.
The analytic solution is known to be  ;  compare it with the solutions that were found in Example 6.
Solution 7.

Example 8.  Solve    with  .   Use Mathematica's DSolve procedure.
Solution 8.

Runge-Kutta-Fehlberg Method  Runge-Kutta-Fehlberg Method  Internet hyperlinks to web sites and a bibliography of articles.

(c) John H. Mathews 2004