ABSTRACT

The data set used to illustrate subroutine rk is taken from Example 7.11. The output generated by the fourth-order Runge-Kutta program is presented in Output 7.1.

Output 7.1 Solution by the fourth-order Runge-Kutta method

7.15.2 The Extrapolated Modified Midpoint Method The general algorithm for the extrapolated modified midpoint method is given by Eqs. (7.210) to (7.212):

Z, = Zo + hf(tn' zo) Zi = Zi-2 + 2hf(tn + (i - I)h, zi_l) (i = 2, ... , M) Yn+' = ![ZM_I + zM + h!(tn + M, zM)]

MAY - LAY 2nMAY - LAY IY=MAY+ 22n _ I n - I

(7.355a) (7.355b) (7.355c) (7.356)

(7.357)

A FORTRAN subroutine, subroutine midpt, for implementing the extrapolated modified midpoint method is presented in Program 7.2. Subroutine midpt works essentially like subroutine rk discussed in Section 7.15.1, except the extrapolated modified midpoint method is used instead of the fourth-order Runge-Kutta method. Program main defines the data set and prints it, calls subroutine midpt to implement the extrapolated modified midpoint method, and prints the solution. Only the statements in program main which are different from the statements in program main in Section 7.15.1 are presented.