NAG Library Routine Document
D02PTF
Note: before using this routine, please read the Users' Note for your implementation to check the interpretation of bold italicised terms and other implementation-dependent details.
1 Purpose
D02PTF provides details about an integration performed by either
D02PEF or
D02PFF.
2 Specification
INTEGER
FEVALS, STEPCOST, STEPSOK, IWSAV(130), IFAIL
REAL (KIND=nag_wp)
WASTE, HNEXT, RWSAV(350)
3 Description
D02PTF and its associated routines (
D02PEF,
D02PFF,
D02PQF,
D02PRF,
D02PSF and
D02PUF) solve the initial value problem for a first-order system of ordinary differential equations. The routines, based on Runge–Kutta methods and derived from RKSUITE (see
Brankin et al. (1991)), integrate
where
is the vector of
solution components and
is the independent variable.
After a call to
D02PEF or
D02PFF, D02PTF can be called to obtain information about the cost of the integration and the size of the next step.
4 References
Brankin R W, Gladwell I and Shampine L F (1991) RKSUITE: A suite of Runge–Kutta codes for the initial value problems for ODEs SoftReport 91-S1 Southern Methodist University
5 Parameters
- 1: FEVALS – INTEGEROutput
-
On exit: the total number of evaluations of
used in the integration so far; this includes evaluations of
required for the secondary integration necessary if
D02PQF had previously been called with
.
- 2: STEPCOST – INTEGEROutput
On exit: the cost in terms of number of evaluations of
of a typical step with the method being used for the integration. The method is specified by the parameter
METHOD in a prior call to
D02PQF.
- 3: WASTE – REAL (KIND=nag_wp)Output
On exit: the number of attempted steps that failed to meet the local error requirement divided by the total number of steps attempted so far in the integration. A ‘large’ fraction indicates that the integrator is having trouble with the problem being solved. This can happen when the problem is ‘stiff’ and also when the solution has discontinuities in a low-order derivative.
- 4: STEPSOK – INTEGEROutput
On exit: the number of accepted steps.
- 5: HNEXT – REAL (KIND=nag_wp)Output
On exit: the step size the integrator will attempt to use for the next step.
- 6: IWSAV() – INTEGER arrayCommunication Array
- 7: RWSAV() – REAL (KIND=nag_wp) arrayCommunication Array
-
Note: the communication
RWSAV used by the other routines in the suite must be used here however, only the first
elements will be referenced.
On entry: these must be the same arrays supplied in a previous call to
D02PEF or
D02PFF. They must remain unchanged between calls.
On exit: information about the integration for use on subsequent calls to
D02PEF or
D02PFF or other associated routines.
- 8: IFAIL – INTEGERInput/Output
-
On entry:
IFAIL must be set to
,
. If you are unfamiliar with this parameter you should refer to
Section 3.3 in the Essential Introduction for details.
For environments where it might be inappropriate to halt program execution when an error is detected, the value
is recommended. If the output of error messages is undesirable, then the value
is recommended. Otherwise, if you are not familiar with this parameter, the recommended value is
.
When the value is used it is essential to test the value of IFAIL on exit.
On exit:
unless the routine detects an error or a warning has been flagged (see
Section 6).
6 Error Indicators and Warnings
If on entry
or
, explanatory error messages are output on the current error message unit (as defined by
X04AAF).
Errors or warnings detected by the routine:
-
On entry, a previous call to the setup routine has not been made or the communication arrays have become corrupted, or a catastrophic error has already been detected elsewhere.
You cannot continue integrating the problem.
You cannot call this routine before you have called the integrator.
You have already made one call to this routine after the integrator could not achieve specified accuracy.
You cannot call this routine again.
7 Accuracy
Not applicable.
When a secondary integration has taken place, that is when global error assessment has been specified using
in a prior call to
D02PQF, then the approximate number of evaluations of
used in this secondary integration is given by
for
or
and
for
.
9 Example