The routine may be called by the names d02zaf or nagf_ode_ivp_stiff_errest.
d02zaf is for use with the direct communication integrators d02nbf,d02ncf,d02ndf,d02ngf,d02nhfandd02njf and the reverse communication integrators d02nmfandd02nnf. It must be used only inside monitr (if this option is selected) for the direct communication routines or on the equivalent return for the reverse communication routines. It may be used to evaluate the norm of the scaled local error estimate, , where the weights used are contained in and the norm used is as defined by an earlier call to the integrator setup routine (d02mvf,d02nvford02nwf). Its use is described under the description of monitr in the specifications for the direct communication integrators mentioned above.
1: – IntegerInput
On entry: the number of differential equations, as defined for the integrator being used.
2: – Real (Kind=nag_wp) arrayInput
On entry: the vector, the weighted norm of which is to be evaluated by d02zaf. v is calculated internally by the integrator being used.
3: – Real (Kind=nag_wp) arrayInput
On entry: the weights, calculated internally by the integrator, to be used in the norm evaluation.
4: – IntegerInput/Output
On entry: ifail must be set to , or to set behaviour on detection of an error; these values have no effect when no error is detected.
A value of causes the printing of an error message and program execution will be halted; otherwise program execution continues. A value of means that an error message is printed while a value of means that it is not.
If halting is not appropriate, the value or is recommended. If message printing is undesirable, then the value is recommended. Otherwise, the value is recommended since useful values can be provided in some output arguments even when on exit. When the value or 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).
6Error 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:
Note: in some cases d02zaf may return useful information.
The value of the norm would either overflow or is close to overflowing.
An unexpected error has been triggered by this routine. Please
See Section 7 in the Introduction to the NAG Library FL Interface for further information.
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.
Dynamic memory allocation failed.
See Section 9 in the Introduction to the NAG Library FL Interface for further information.
The result is calculated close to machine precision except in the case when the routine exits with .
8Parallelism and Performance
d02zaf 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.
d02zaf is not threaded in any implementation.
d02zaf should only be used within monitr associated with the integrators in Sub-chapter D02M–N (e.g., see d02nbf). Its use and only valid calling sequence are fully documented in the description of monitr in the routine documents for the integrators.
This example solves the well-known stiff Robertson problem
over the range with initial conditions and using scalar error control () and computation of the solution at with tcrit (e.g., see d02mvf) set to (). A BDF integrator (setup routine d02nvf) is used and a modified Newton method is selected. This example illustrates the use of d02zaf within a monitor routine monitr to output intermediate results during the integration. The same problem is solved in the example program for d02nbf where no monitoring was performed and so no intermediate solution information is output.