NAG FL Interface
d02xjf (ivp_​stiff_​nat_​interp)

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 D02MN.

2 Specification

Fortran Interface
Subroutine d02xjf ( xsol, sol, m, ysav, ldysav, sdysav, neq, x, nqu, hu, h, ifail)
Integer, Intent (In) :: m, ldysav, sdysav, neq, nqu
Integer, Intent (Inout) :: ifail
Real (Kind=nag_wp), Intent (In) :: xsol, ysav(ldysav,sdysav), x, hu, h
Real (Kind=nag_wp), Intent (Out) :: sol(m)
C Header Interface
#include <nag.h>
void  d02xjf_ (const double *xsol, double sol[], const Integer *m, const double ysav[], const Integer *ldysav, const Integer *sdysav, const Integer *neq, const double *x, const Integer *nqu, const double *hu, const double *h, Integer *ifail)
The routine may be called by the names d02xjf or nagf_ode_ivp_stiff_nat_interp.

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 Arguments

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) array Output
On exit: the calculated value of the ith component of the solution at xsol, for i=1,2,,m.
3: m Integer Input
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) array Communication Array
On entry: the values provided in the argument ysav on return from the integrator.
5: ldysav Integer Input
On entry: the value used for the argument ldysav when calling the integrator.
Constraint: ldysavneq.
6: sdysav Integer Input
On entry: the value used for the argument sdysav when calling the integrator.
Constraint: sdysavnqu+1.
7: neq Integer Input
On entry: the value used for the argument neq when calling the integrator.
Constraint: 1neq.
8: x Real (Kind=nag_wp) Input
On entry: the latest value at which the solution has been computed, as provided in the argument tcur on return from the optional output d02nyf.
9: nqu Integer Input
On entry: the order of the method used up to the latest value at which the solution has been computed, as provided in the argument 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 argument 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 argument h on return from the optional output d02nyf.
12: ifail Integer Input/Output
On entry: ifail must be set to 0, -1 or 1 to set behaviour on detection of an error; these values have no effect when no error is detected.
A value of 0 causes the printing of an error message and program execution will be halted; otherwise program execution continues. A value of -1 means that an error message is printed while a value of 1 means that it is not.
If halting is not appropriate, the value -1 or 1 is recommended. If message printing is undesirable, then the value 1 is recommended. Otherwise, the value 0 is recommended. 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, ldysav=value.
Constraint: ldysav1.
On entry, m=value.
Constraint: m1.
On entry, m=value and neq=value.
Constraint: mneq.
On entry, neq=value.
Constraint: neq1.
On entry, neq=value and ldysav=value.
Constraint: neqldysav.
On entry, nqu=value.
Constraint: nqu1.
On entry, sdysav=value and nqu=value.
Constraint: sdysavnqu+1.
ifail=2
On entry, h=0.0.
On entry, hu=0.0.
ifail=3
On entry, xsol=value, x=value and h=value.
Constraint: xsol should not be an extrapolation point.
ifail=-99
An unexpected error has been triggered by this routine. Please contact NAG.
See Section 7 in the Introduction to the NAG Library FL Interface for further information.
ifail=-399
Your licence key may have expired or may not have been installed correctly.
See Section 8 in the Introduction to the NAG Library FL Interface for further information.
ifail=-999
Dynamic memory allocation failed.
See Section 9 in the Introduction to the NAG Library FL Interface 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

d02xjf is not threaded in any implementation.

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.