NAG FL Interface
d02mzf (ivp_​stiff_​interp)

Settings help

FL Name Style:


FL Specification Language:


1 Purpose

d02mzf interpolates components of the solution of a system of first-order differential equations from information provided by those integrators in Sub-chapter D02M–N using methods set up by calls to d02mvf, d02nvf or d02nwf.

2 Specification

Fortran Interface
Subroutine d02mzf ( tsol, sol, m, ldysav, neq, ysav, sdysav, rwork, ifail)
Integer, Intent (In) :: m, ldysav, neq, sdysav
Integer, Intent (Inout) :: ifail
Real (Kind=nag_wp), Intent (In) :: tsol, ysav(ldysav,sdysav), rwork(50+4*neq)
Real (Kind=nag_wp), Intent (Out) :: sol(m)
C Header Interface
#include <nag.h>
void  d02mzf_ (const double *tsol, double sol[], const Integer *m, const Integer *ldysav, const Integer *neq, const double ysav[], const Integer *sdysav, const double rwork[], Integer *ifail)
The routine may be called by the names d02mzf or nagf_ode_ivp_stiff_interp.

3 Description

d02mzf 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 d02mzf. d02mzf should not normally be used to extrapolate outside the range of values obtained from the above routine.

4 References

See the D02M–N Sub-chapter Introduction.

5 Arguments

1: tsol Real (Kind=nag_wp) Input
On entry: the point at which the first m components of the solution are to be evaluated. tsol should not normally be an extrapolation point. Extrapolation is permitted but not recommended.
2: sol(m) Real (Kind=nag_wp) array Output
On exit: the calculated value of the solution at tsol.
3: m Integer Input
On entry: the number of components of the solution whose values are required.
Constraint: 1mneq.
4: ldysav Integer Input
On entry: the value used for the argument ldysav when calling the integrator.
Constraint: ldysavneq.
5: neq Integer Input
On entry: the value used for the argument neq when calling the integrator.
Constraint: 1neq.
6: ysav(ldysav,sdysav) Real (Kind=nag_wp) array Communication Array
On entry: the values provided in the array ysav on return from the integrator.
7: sdysav Integer Input
On entry: the value used for the argument sdysav when calling the integrator.
8: rwork(50+4×neq) Real (Kind=nag_wp) array Communication Array
On entry: the values provided in the array rwork on return from the integrator.
9: 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, 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.
ifail=2
Either the integrator function has not been called prior to the first call of this function or the array has become corrupted.
ifail=3
On entry, tsol is an extrapolation point.
On entry, d02mzf has been called for extrapolation. Before returning with this error exit, the value of the solution at tsol is calculated and placed in sol.
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

d02mzf is not thread safe and should not be called from a multithreaded user program. Please see Section 1 in FL Interface Multithreading for more information on thread safety.
d02mzf is not threaded in any implementation.

9 Further Comments

None.

10 Example

This example solves the well-known stiff Robertson problem written in implicit form
r1 = -0.04a + 1.0E4bc - a r2 = 0.04a - 1.0E4bc - 3.0E7b2 - b r3 = 3.0E7b2 - c  
with initial conditions a=1.0 and b=c=0.0 over the range [0,0.1] with vector error control (itol=4), the BDF method (setup routine d02nvf) and functional iteration. The Jacobian is calculated numerically if the functional iteration encounters difficulty and the integration is in one-step mode (itask=2), with natural interpolation to calculate the solution at intervals of 0.02 using d02mzf externally. d02nby is used for monitr.

10.1 Program Text

Program Text (d02mzfe.f90)

10.2 Program Data

Program Data (d02mzfe.d)

10.3 Program Results

Program Results (d02mzfe.r)