NAG Library Routine Document

d02qyf  (ivp_adams_rootdiag)

 Contents

    1  Purpose
    7  Accuracy
    10  Example

1
Purpose

d02qyf is a diagnostic routine which may be called after a call to the integrator routines d02qff or d02qgf.

2
Specification

Fortran Interface
Subroutine d02qyf ( neqg, index, itype, events, resids, rwork, lrwork, iwork, liwork, ifail)
Integer, Intent (In):: neqg, lrwork, iwork(liwork), liwork
Integer, Intent (Inout):: ifail
Integer, Intent (Out):: index, itype, events(neqg)
Real (Kind=nag_wp), Intent (In):: rwork(lrwork)
Real (Kind=nag_wp), Intent (Out):: resids(neqg)
C Header Interface
#include nagmk26.h
void  d02qyf_ ( const Integer *neqg, Integer *index, Integer *itype, Integer events[], double resids[], const double rwork[], const Integer *lrwork, const Integer iwork[], const Integer *liwork, Integer *ifail)

3
Description

d02qyf should be called only after a call to d02qff or d02qgf results in the output value root=.TRUE., indicating that a root has been detected. d02qyf permits you to examine information about the root detected, such as the indices of the event equations for which there is a root, the type of root (odd or even) and the residuals of the event equations.

4
References

None.

5
Arguments

1:     neqg – IntegerInput
On entry: the number of event functions defined for the integration routine. It must be the same argument neqg supplied to the setup routine d02qwf and to the integration routine (d02qff or d02qgf).
2:     index – IntegerOutput
On exit: the index k of the event equation gkx,y,y=0 for which the root has been detected.
3:     itype – IntegerOutput
On exit: information about the root detected for the event equation defined by index. The possible values of itype with their interpretations are as follows:
itype=1
A simple root, or lack of distinguishing information available.
itype=2
A root of even multiplicity is believed to have been detected, that is no change in sign of the event function was found.
itype=3
A high-order root of odd multiplicity.
itype=4
A possible root, but due to high multiplicity or a clustering of roots accurate evaluation of the event function was prohibited by round-off error and/or cancellation.
In general, the accuracy of the root is less reliable for values of itype>1.
4:     eventsneqg – Integer arrayOutput
On exit: information about the kth event function on a very small interval containing the root, t (see d02qff and d02qgf), as output from the integration routine. All roots lying in this interval are considered indistinguishable numerically and therefore should be regarded as defining a root at t. The possible values of eventsk with their interpretations are as follows:
eventsk=0
The kth event function did not have a root.
eventsk=-1
The kth event function changed sign from positive to negative about a root, in the direction of integration.
eventsk=1
The kth event function changed sign from negative to positive about a root, in the direction of integration.
eventsk=2
A root was identified, but no change in sign was observed.
5:     residsneqg – Real (Kind=nag_wp) arrayOutput
On exit: the value of the kth event function computed at the root, t (see d02qff and d02qgf).
6:     rworklrwork – Real (Kind=nag_wp) arrayCommunication Array
On entry: this must be the same argument rwork as supplied to d02qff or d02qgf. It is used to pass information from the integration routine to d02qyf and therefore the contents of this array must not be changed before calling d02qyf.
7:     lrwork – IntegerInput
On entry: the dimension of the array rwork as declared in the (sub)program from which d02qyf is called.
This must be the same argument lrwork as supplied to d02qwf.
8:     iworkliwork – Integer arrayCommunication Array
On entry: this must be the same argument iwork as supplied to d02qff or d02qgf. It is used to pass information from the integration routine to d02qyf and therefore the contents of this array must not be changed before calling d02qyf.
9:     liwork – IntegerInput
On entry: the dimension of the array iwork as declared in the (sub)program from which d02qyf is called.
This must be the same argument liwork as supplied to d02qwf.
10:   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
An integration routine (d02qff or d02qgf) has not been called, no root was detected or one or more of the arguments lrwork, liwork and neqg does not match the corresponding values supplied to d02qwf. Values for the arguments index, itype, events and resids will not have been set.
This error exit may be caused by overwriting elements of iwork.
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

d02qyf 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.
d02qyf is not threaded in any implementation.

9
Further Comments

None.

10
Example

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