D202: First-order Differential Equations (Runge-Kutta-Merson)

Author(s): K.S. Kölbig Library: MATHLIB
Submitter: Submitted: 15.02.1989
Language: Fortran Revised: 01.12.1994

Subroutine subprograms RDEQMR and DDEQMR advance the solution of the system of tex2html_wrap_inline106 simultaneous first-order differential equations

displaymath108

from a specified value tex2html_wrap_inline110 to a specified value tex2html_wrap_inline112 of the independent variable x. The integration step-length is automatically adjusted to keep the estimated error per step less than a specified value.

On computers other than CDC and Cray, only the double-precision version DDEQBS is available. On CDC and Cray computers, only the single-precision version RDEQBS is available.

Structure:

SUBROUTINE subprograms
User Entry Names : RDEQMR, DDEQMR
Obsolete User Entry Names: DEQMR tex2html_wrap_inline116 RDEQMR
Files Referenced : Unit 6
External References: MTLMTR, ABEND, User-supplied SUBROUTINE subprogram

Usage:

For tex2html_wrap_inline118 (type REAL), tex2html_wrap_inline120 (type DOUBLE PRECISION),

    CALL tDEQMR(N,X1,X2,Y,H0,EPS,SUB,W)
N
(INTEGER) Number n of equations.
X1
(type according to t) Initial value tex2html_wrap_inline124 of the independent variable x.
X2
(type according to t) Final value tex2html_wrap_inline128 of the independent variable x.
Y
(type according to t) One-dimensional array of length tex2html_wrap_inline132 N. On entry, tex2html_wrap_inline134 , must contain tex2html_wrap_inline136 . On exit, tex2html_wrap_inline138 , contains approximate values tex2html_wrap_inline140 .
H0
(type according to t) On entry, H0 must contain the proposed initial step-length tex2html_wrap_inline142 . On exit, H0 contains the last computed step-length (See also Method and Notes).
EPS
(type according to t) The requested absolute accuracy tex2html_wrap_inline144 . (EPS should not be smaller than approximately tex2html_wrap_inline146 times the machine precision).
SUB
Name of a user-supplied SUBROUTINE subprogram, declared EXTERNAL in the calling program.
W
(type according to t) Array containing at least 6*N elements required as working-space.
The user-supplied subroutine SUB should be of the form
    SUBROUTINE SUB(X,Y,F)
where the variable X and the one-dimensional arrays Y(*) and F(*) are of type t. This subroutine must set

displaymath148

Method:

The method is a modification by Merson of the Runge-Kutta method. The initial value of the step-length h is taken to be the first of the numbers tex2html_wrap_inline152 for which the estimated relative error at the end of the step is less than tex2html_wrap_inline154 . At each susequent step, an estimate of the integration error for that step (proportional to tex2html_wrap_inline156 ) is computed. If the corresponding relative error exceeds tex2html_wrap_inline158 , the current step-length is halfed; if it is less than tex2html_wrap_inline160 the step-length is doubled. This process is continued until tex2html_wrap_inline162 is reached. (For details, see Ref. 1).

Error handling:

Error D202.1: If the requestec accuracy cannot obtained, a message is written on Unit 6, unless subroutine MTLSET (N002) has been called.
For tex2html_wrap_inline164 , or tex2html_wrap_inline166 or tex2html_wrap_inline168 , control is returned to the calling program without any change in Y.

Notes:

For well-conditioned systems of equations any reasonable value of the initial step length tex2html_wrap_inline170 may be chosen. For ill-conditioned systems, the initial value of tex2html_wrap_inline172 may be important, and tests with different values are advised. An inappropriate choice may lead to wrong results in such cases.

References:

  1. G.N. Lance, Numerical methods for high-speed computers, (Iliffe & Sons, London 1960) 56
tex2html_wrap_inline174

Michel Goossens Wed Jun 5 00:20:47 METDST 1996