D02QZF evaluates the first NWANT components of the solution of a non-stiff system of first-order ordinary differential equations at any point using the method of Watts and Shampine (1986) and information generated by D02QFF or D02QGF. D02QZF should not normally be used to extrapolate outside the current range of the values produced by the integration routine.
Watts H A and Shampine L F (1986) Smoother interpolants for Adams codes SIAM J. Sci. Statist. Comput.7 334–345
1: – INTEGERInput
On entry: the number of first-order ordinary differential equations being solved by the integration routine. It must contain the same value as the argument NEQF in a prior call to the setup routine D02QWF.
2: – REAL (KIND=nag_wp)Input
On entry: the point at which components of the solution and derivative are to be evaluated. TWANT should not normally be an extrapolation point, that is TWANT should satisfy
or if integration is proceeding in the negative direction
where is the previous integration point and is, to within rounding, TCURR – HLAST (see D02QXF). Extrapolation is permitted but not recommended and is returned whenever extrapolation is attempted.
3: – INTEGERInput
On entry: the number of components of the solution and derivative whose values at TWANT are required. The first NWANT components are evaluated.
4: – REAL (KIND=nag_wp) arrayOutput
On exit: the calculated value of the
th component of the solution at TWANT, for .
5: – REAL (KIND=nag_wp) arrayOutput
On exit: the calculated value of the
th component of the derivative at TWANT, for .
6: – REAL (KIND=nag_wp) arrayCommunication Array
On entry: this must be the same argument RWORK as supplied to D02QWF and to D02QFF or D02QGF. It is used to pass information from these routines to D02QZF. Therefore its contents must not be changed before a call to D02QZF.
7: – INTEGERInput
On entry: the dimension of the array RWORK as declared in the (sub)program from which D02QZF is called.
This must be the same argument LRWORK as supplied to D02QWF.
8: – INTEGER arrayCommunication Array
On entry: this must be the same argument IWORK as supplied to D02QWF and to D02QFF or D02QGF. It is used to pass information from these routines to D02QZF. Therefore its contents must not be changed before a call to D02QZF.
9: – INTEGERInput
On entry: the dimension of the array IWORK as declared in the (sub)program from which D02QZF is called.
This must be the same argument LIWORK as supplied to D02QWF.
10: – INTEGERInput/Output
On entry: IFAIL must be set to , . If you are unfamiliar with this argument you should refer to Section 3.4 in How to Use the NAG Library and its Documentation 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 argument, 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:
An integration routine (D02QFF or D02QGF) has not been called, no integration steps have been taken since the last call to D02QWF with , one or more of the arguments LRWORK, LIWORK and NEQF does not match the same argument supplied to D02QWF, or NWANT does not satisfy .
D02QZF has been called for extrapolation. The values of the solution and its derivative at TWANT have been calculated and placed in YWANT and YPWANT before returning with this warning (see Section 7).
An unexpected error has been triggered by this routine. Please
See Section 3.9 in How to Use the NAG Library and its Documentation for further information.
Your licence key may have expired or may not have been installed correctly.
See Section 3.8 in How to Use the NAG Library and its Documentation for further information.
Dynamic memory allocation failed.
See Section 3.7 in How to Use the NAG Library and its Documentation for further information.
These error exits may be caused by overwriting elements of RWORK and IWORK.
The error in interpolation is of a similar order to the error arising from the integration. The same order of accuracy can be expected when extrapolating using D02QZF. However, the actual error in extrapolation will, in general, be much larger than for interpolation.
8 Parallelism and Performance
D02QZF is not thread safe and should not be called from a multithreaded user program. Please see Section 3.12.1 in How to Use the NAG Library and its Documentation for more information on thread safety.
D02QZF is not threaded in any implementation.
9 Further Comments
When interpolation for only a few components is required then it is more efficient to order the components of interest so that they are numbered first.
This example solves the equation
over the range with initial conditions and using vector error control () and D02QFF in one-step mode (). D02QZF is used to provide solution values at intervals of .