D02XJF (PDF version)
D02 Chapter Contents
D02 Chapter Introduction
NAG Library Manual

NAG Library Routine Document

D02XJF

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.

 Contents

    1  Purpose
    7  Accuracy
    10  Example

1  Purpose

D02XJF interpolates components of the solution of a system of first-order ordinary differential equations from information provided by the integrators in sub-chapter D02M–N.

2  Specification

SUBROUTINE D02XJF ( XSOL, SOL, M, YSAV, LDYSAV, SDYSAV, NEQ, X, NQU, HU, H, IFAIL)
INTEGER  M, LDYSAV, SDYSAV, NEQ, NQU, IFAIL
REAL (KIND=nag_wp)  XSOL, SOL(M), YSAV(LDYSAV,SDYSAV), X, HU, H

3  Description

D02XJF evaluates the first m components of the solution of a system of ordinary differential equations at any point using natural polynomial interpolation based on information generated by the integrator. This information must be passed unchanged to D02XJF. D02XJF should not normally be used to extrapolate outside the range of values obtained from the above routines.

4  References

None.

5  Parameters

1:     XSOL – REAL (KIND=nag_wp)Input
On entry: the point at which the first m components of the solution are to be evaluated. XSOL should not be an extrapolation point, that is XSOL should satisfy XSOL-X×HU0.0. Extrapolation is permitted but not recommended.
2:     SOLM – REAL (KIND=nag_wp) arrayOutput
On exit: the calculated value of the ith component of the solution at XSOL, for i=1,2,,m.
3:     M – INTEGERInput
On entry: m, the number of components of the solution whose values at XSOL are required. The first M components are evaluated.
Constraint: 1MNEQ.
4:     YSAVLDYSAVSDYSAV – REAL (KIND=nag_wp) arrayInput
On entry: the values provided in the parameter YSAV on return from the integrator.
5:     LDYSAV – INTEGERInput
On entry: the value used for the parameter LDYSAV when calling the integrator.
Constraint: LDYSAV1.
6:     SDYSAV – INTEGERInput
On entry: the value used for the parameter SDYSAV when calling the integrator.
Constraint: SDYSAVNQU+1.
7:     NEQ – INTEGERInput
On entry: the value used for the parameter NEQ when calling the integrator.
Constraint: 1NEQLDYSAV.
8:     X – REAL (KIND=nag_wp)Input
On entry: the latest value at which the solution has been computed, as provided in the parameter TCUR on return from the optional output D02NYF.
9:     NQU – INTEGERInput
On entry: the order of the method used up to the latest value at which the solution has been computed, as provided in the parameter NQU on return from the optional output D02NYF.
Constraint: NQU1.
10:   HU – REAL (KIND=nag_wp)Input
On entry: the last successful step used, that is the step used in the integration to get to X, as provided in the parameter HU on return from the optional output D02NYF.
11:   H – REAL (KIND=nag_wp)Input
On entry: the next step size to be attempted in the integration, as provided in the parameter H on return from the optional output D02NYF.
12:   IFAIL – INTEGERInput/Output
On entry: IFAIL must be set to 0, -1​ or ​1. 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 -1​ or ​1 is recommended. If the output of error messages is undesirable, then the value 1 is recommended. Otherwise, if you are not familiar with this parameter, the recommended value is 0. When the value -1​ or ​1 is used it is essential to test the value of IFAIL on exit.
On exit: IFAIL=0 unless the routine detects an error or a warning has been flagged (see Section 6).
If D02XJF is to be used for extrapolation, IFAIL must be set to 1 before entry. It is then essential to test the value of IFAIL on exit for IFAIL=1 or 2.

6  Error Indicators and Warnings

If on entry IFAIL=0 or -1, explanatory error messages are output on the current error message unit (as defined by X04AAF).
Errors or warnings detected by the routine:
IFAIL=1
On entry,M<1,
orNEQ<1,
orLDYSAV<1,
orNEQ>LDYSAV,
orM>NEQ,
orNQU<1,
orSDYSAV<NQU+1.
IFAIL=2
On entry, HU=0.0 or H=0.0. This error can only occur if H and HU have been changed by you or possibly if the integrator has failed before calling D02XJF.
IFAIL=3
D02XJF has been called for extrapolation. Before returning with this error exit, the value of the solution at XSOL is calculated and placed in SOL.
IFAIL=-99
An unexpected error has been triggered by this routine. Please contact NAG.
See Section 3.8 in the Essential Introduction for further information.
IFAIL=-399
Your licence key may have expired or may not have been installed correctly.
See Section 3.7 in the Essential Introduction for further information.
IFAIL=-999
Dynamic memory allocation failed.
See Section 3.6 in the Essential Introduction for further information.

7  Accuracy

The solution values returned will be of a similar accuracy to those computed by the integrator.

8  Parallelism and Performance

Not applicable.

9  Further Comments

D02XJF is that employed for prediction purposes internally by the integrator. It is supplied for purposes of consistency only. You are recommended to employ the C1 interpolant provided by D02XKF wherever possible.

10  Example

See Section 10 in D02NGF.

D02XJF (PDF version)
D02 Chapter Contents
D02 Chapter Introduction
NAG Library Manual

© The Numerical Algorithms Group Ltd, Oxford, UK. 2015