NAG Library Routine Document

d02nyf  (ivp_stiff_integ_diag)

 Contents

    1  Purpose
    7  Accuracy
    10  Example

1
Purpose

d02nyf is a diagnostic routine which you may call either after any user-specified exit or after a mid-integration error exit from any of those integrators in Sub-chapter D02M–N that use methods set up by calls to d02mvf, d02nvf or d02nwf.

2
Specification

Fortran Interface
Subroutine d02nyf ( neq, neqmax, hu, h, tcur, tolsf, rwork, nst, nre, nje, nqu, nq, niter, imxer, algequ, inform, ifail)
Integer, Intent (In):: neq, neqmax, inform(23)
Integer, Intent (Inout):: ifail
Integer, Intent (Out):: nst, nre, nje, nqu, nq, niter, imxer
Real (Kind=nag_wp), Intent (In):: rwork(50+4*neq)
Real (Kind=nag_wp), Intent (Out):: hu, h, tcur, tolsf
Logical, Intent (Out):: algequ(neq)
C Header Interface
#include nagmk26.h
void  d02nyf_ ( const Integer *neq, const Integer *neqmax, double *hu, double *h, double *tcur, double *tolsf, const double rwork[], Integer *nst, Integer *nre, Integer *nje, Integer *nqu, Integer *nq, Integer *niter, Integer *imxer, logical algequ[], const Integer inform[], Integer *ifail)

3
Description

d02nyf permits you to inspect statistics produced by any integrator in this sub-chapter that has been set up a call to one of d02mvf, d02nvf or d02nwf. These statistics concern the integration only.

4
References

See the D02M–N Sub-chapter Introduction.

5
Arguments

1:     neq – IntegerInput
On entry: the value used for the argument neq when calling the integrator.
Constraint: neq1.
2:     neqmax – IntegerInput
On entry: the value used for the argument neqmax when calling the integrator.
Constraint: neqmaxneq.
3:     hu – Real (Kind=nag_wp)Output
On exit: the last successful step size.
4:     h – Real (Kind=nag_wp)Output
On exit: the proposed next step size for continuing the integration.
5:     tcur – Real (Kind=nag_wp)Output
On exit: t, the value of the independent variable which the integrator has actually reached. tcur will always be at least as far as the output value of the argument t in the direction of integration, but may be further (if overshooting and interpolation at tout was specified, e.g., see d02nbf).
6:     tolsf – Real (Kind=nag_wp)Output
On exit: a tolerance scale factor, tolsf1.0, which is computed when a request for too much accuracy is detected by the integrator (indicated by a return with ifail=3 or 14). If itol is left unaltered but rtol and atol are uniformly scaled up by a factor of tolsf the next call to the integrator is deemed likely to succeed.
7:     rwork50+4×neq – Real (Kind=nag_wp) arrayCommunication Array
On entry: contains information supplied by the integrator.
8:     nst – IntegerOutput
On exit: the number of steps taken in the integration so far.
9:     nre – IntegerOutput
On exit: the number of function or residual evaluations (fcn (e.g., see d02nbf) or resid (e.g., see d02ngf) calls) used in the integration so far.
10:   nje – IntegerOutput
On exit: the number of Jacobian evaluations used in the integration so far. This equals the number of matrix LU decompositions.
11:   nqu – IntegerOutput
On exit: the order of the method last used (successfully) in the integration.
12:   nq – IntegerOutput
On exit: the proposed order of the method for continuing the integration.
13:   niter – IntegerOutput
On exit: the number of iterations performed in the integration so far by the nonlinear equation solver.
14:   imxer – IntegerOutput
On exit: the index of the component of largest magnitude in the weighted local error vector ei/wi, for i=1,2,,neq.
15:   algequneq – Logical arrayOutput
On exit: algequi=.TRUE. if the ith equation integrated was detected to be algebraic, otherwise algequi=.FALSE.. Note that when the integrators for explicit equations are being used, then algequi=.FALSE., for i=1,2,,neq.
16:   inform23 – Integer arrayCommunication Array
On entry: contains information supplied by the integrator.
17:   ifail – IntegerInput/Output
On entry: ifail must be set to 0, -1​ or ​1. 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 -1​ or ​1 is recommended. If the output of error messages is undesirable, then the value 1 is recommended. Otherwise, if you are not familiar with this argument, the recommended value is 0. 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,neq<1,
orneqmax<1,
orneq>neqmax.
ifail=-99
An unexpected error has been triggered by this routine. Please contact NAG.
See Section 3.9 in How to Use the NAG Library and its Documentation for further information.
ifail=-399
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.
ifail=-999
Dynamic memory allocation failed.
See Section 3.7 in How to Use the NAG Library and its Documentation for further information.

7
Accuracy

Not applicable.

8
Parallelism and Performance

d02nyf is not threaded in any implementation.

9
Further Comments

Statistics for sparse matrix linear algebra calls (if appropriate) may be determined by a call to d02nxf.

10
Example

See Section 10 in d02nbf.
© The Numerical Algorithms Group Ltd, Oxford, UK. 2017