NAG FL Interface
d02pjf (ivp_​rk_​interp_​eval)

Settings help

FL Name Style:


FL Specification Language:


1 Purpose

d02pjf evaluates the interpolant calculated by d02phf, following an integration step performed by d02pgf to solve an initial value problem.

2 Specification

Fortran Interface
Subroutine d02pjf ( icheck, n, nwant, t, ideriv, sol, wcomm, lwcomm, iwsav, rwsav, ifail)
Integer, Intent (In) :: icheck, n, nwant, ideriv, lwcomm
Integer, Intent (Inout) :: iwsav(130), ifail
Real (Kind=nag_wp), Intent (In) :: t
Real (Kind=nag_wp), Intent (Inout) :: wcomm(lwcomm), rwsav(32*n+350)
Real (Kind=nag_wp), Intent (Out) :: sol(nwant)
C Header Interface
#include <nag.h>
void  d02pjf_ (const Integer *icheck, const Integer *n, const Integer *nwant, const double *t, const Integer *ideriv, double sol[], double wcomm[], const Integer *lwcomm, Integer iwsav[], double rwsav[], Integer *ifail)
The routine may be called by the names d02pjf or nagf_ode_ivp_rk_interp_eval.

3 Description

When integrating using the reverse communication Runge–Kutta integrator d02pgf, the solution or its derivatives can be obtained inexpensively between steps by interpolation. d02phf is called after a step by d02pgf from a previous value of t (=tk-1) to its current value, t=tk (i.e., a kth successful time-step has been taken). d02pjf can then be called to evaluate interpolated approximations of the function or its derivatives at any value of t in the interval (tk-1,tk).

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 Arguments

1: icheck Integer Input
On entry: indicates whether consistency checks on input arguments should be performed
icheck1
Don't perform checks on input arguments.
icheck=1
Perform consistency checks on input arguments.
It is recommended to use icheck=1 on the first call following a call to d02phf and to set icheck1 on subsequent calls within the last step to avoid the overhead of argument checking.
2: n Integer Input
On entry: n, the dimension of the system of ODEs being integrated.
Constraint: this must be the same value as supplied in a previous call to d02pqf.
3: nwant Integer Input
On entry: only the first nwant system components to be computed. This should be the same value as passed to d02phf when computing the interpolant.
Constraint: nwant=nwant passed to d02phf.
4: t Real (Kind=nag_wp) Input
On entry: t, the value of the independent variable where a solution is desired. Although any value of t can be supplied, accurate solutions can only be obtained for values in the range of the last time-step taken by d02pgf.
5: ideriv Integer Input
On entry:
ideriv=0
Compute approximations to the first nwant components of the solution y(t).
ideriv=1
Compute approximations to the first nwant components of the first derivatives of the solution y(t).
Constraint: ideriv=0 or 1.
6: sol(nwant) Real (Kind=nag_wp) array Output
On exit:
ideriv=0
The first nwant components of the solution y(t).
ideriv=1
The first nwant components of the first derivatives of the solution y(t).
7: wcomm(lwcomm) Real (Kind=nag_wp) array Communication Array
On entry: this must be the same array supplied in a previous call to d02phf. It must remain unchanged between calls.
8: lwcomm Integer Input
On entry: length of wcomm. This should be the same value as supplied in a previous call to d02phf.
If in a previous call to d02pqf:
  • method=1 or −1, lwcomm must be at least 1.
  • method=2 or −2, lwcomm must be at least n+max(n,5×nwant).
  • method=3 or −3, lwcomm8×nwant.
9: iwsav(130) Integer array Communication Array
10: rwsav(32×n+350) Real (Kind=nag_wp) array Communication Array
On entry: these must be the same arrays supplied in a previous call d02pgf. They must remain unchanged between calls.
On exit: information about the integration for use on subsequent calls to d02pgf, d02phf or other associated routines.
11: 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).

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, 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.
On entry, ideriv=value.
Constraint: ideriv=0 or 1.
On entry, lwcomm=value, n=value and nwant=value.
Constraint: for method=−2 or 2, lwcommn+max(n,5×nwant).
On entry, lwcomm=value.
Constraint: for method=−1 or 1, lwcomm1.
On entry, lwcomm=value and nwant=value.
Constraint: for method=−3 or 3, lwcomm8×nwant.
On entry, n=value, but the value passed to the setup routine was n=value.
On entry, nwant=value, but on interpolation setup nwant=value.
Constraint: nwant must be unchanged from setup.
The previous call to the interpolation setup routine returned an error.
You cannot call this routine before you have called the interpolation setup.
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 computed values will be of a similar accuracy to that computed by d02pgf.

8 Parallelism and Performance

d02pjf is not threaded in any implementation.

9 Further Comments

None.

10 Example

See d02pgf.