D02NVF (PDF version)
D02 Chapter Contents
D02 Chapter Introduction
NAG Library Manual

NAG Library Routine Document


Note:  before using this routine, please read the Users' Note for your implementation to check the interpretation of bold italicised terms and other implementation-dependent details.

+ Contents

    1  Purpose
    7  Accuracy
    9  Example

1  Purpose

D02NVF is a setup routine which must be called prior to linear algebra setup routines and integrators from the SPRINT suite of routines, if Backward Differentiation Formulae (BDF) are to be used.

2  Specification


3  Description

An integrator setup routine must be called before the call to any linear algebra setup routine or integrator from the SPRINT suite of routines in this sub-chapter. This setup routine, D02NVF, makes the choice of the BDF integrator and permits you to define options appropriate to this choice. Alternative choices of integrator from this suite are the BLEND method and the DASSL implementation of the BDF method which can be chosen by initial calls to D02NWF or D02MVF respectively.

4  References

See the D02M–N sub-chapter Introduction.

5  Parameters

1:     NEQMAX – INTEGERInput
On entry: a bound on the maximum number of differential equations to be solved.
Constraint: NEQMAX1.
2:     SDYSAV – INTEGERInput
On entry: the second dimension of the array YSAV that will be supplied to the integrator, as declared in the (sub)program from which the integrator is called.
Constraint: SDYSAVMAXORD+1.
3:     MAXORD – INTEGERInput
On entry: the maximum order to be used for the BDF method.
Constraint: 0<MAXORD5.
4:     METHOD – CHARACTER(1)Input
On entry: specifies the method to be used to solve the system of nonlinear equations arising on each step of the BDF code.
A modified Newton iteration is used.
Functional iteration is used.
A modified Newton iteration is used.
Note:  a linear algebra setup routine must be called even when using functional iteration, since if difficulty is encountered a switch is made to a modified Newton method.
Only the first character of the actual parameter METHOD is passed to D02NVF; hence it is permissible for the actual argument to be more descriptive e.g., ‘Newton’, ‘Functional iteration’ or ‘Default’ in a call to D02NVF.
Constraint: METHOD='N', 'F' or 'D'.
5:     PETZLD – LOGICALInput
On entry: specifies whether the Petzold local error test is to be used. If PETZLD is set to .TRUE. on entry, then the Petzold local error test is used, otherwise a conventional test is used. The Petzold test results in extra overhead cost but is more stable and reliable for differential/algebraic equations.
6:     CON(6) – REAL (KIND=nag_wp) arrayInput/Output
On entry: values to be used to control step size choice during integration. If any CONi=0.0 on entry, it is replaced by its default value described below. In most cases this is the recommended setting.
CON1, CON2, and CON3 are factors used to bound step size changes. If the current step size h fails, then the modulus of the next step size is bounded by CON1×h. The default value of CON1 is 2.0. Note that the new step size may be used with a method of different order to the failed step. If the initial step size is h, then the modulus of the step size on the second step is bounded by CON3×h. At any other stage in the integration, if the current step size is h, then the modulus of the next step size is bounded by CON2×h. The default values are 10.0 for CON2 and 1000.0 for CON3.
CON4, CON5 and CON6 are ‘tuning’ constants used in determining the next order and step size. They are used to scale the error estimates used in determining whether to keep the same order of the BDF method, decrease the order or increase the order respectively. The larger the value of CONi, for i=4,5,6, the less likely the choice of the corresponding order. The default values are: CON4=1.2, CON5=1.3, CON6=1.4.
These constraints must be satisfied after any zero values have been replaced by their default values.
  • 0.0<CON1CON2CON3;
  • CONi1.0, for i=2,3,,6.
On exit: the values actually used by D02NVF.
7:     TCRIT – REAL (KIND=nag_wp)Input
On entry: a point beyond which integration must not be attempted. The use of TCRIT is described under the parameter ITASK in the specification for the integrator (e.g., see D02NBF). A value, 0.0 say, must be specified even if ITASK subsequently specifies that TCRIT will not be used.
8:     HMIN – REAL (KIND=nag_wp)Input
On entry: the minimum absolute step size to be allowed. Set HMIN=0.0 if this option is not required.
9:     HMAX – REAL (KIND=nag_wp)Input
On entry: the maximum absolute step size to be allowed. Set HMAX=0.0 if this option is not required.
10:   H0 – REAL (KIND=nag_wp)Input
On entry: the step size to be attempted on the first step. Set H0=0.0 if the initial step size is calculated internally.
On entry: the maximum number of steps to be attempted during one call to the integrator after which it will return with IFAIL=2. Set MAXSTP=0 if no limit is to be imposed.
On entry: the maximum number of warnings printed (if ITRACE0) per problem when t+h=t on a step (h= current step size). If MXHNIL0, a default value of 10 is assumed.
13:   NORM – CHARACTER(1)Input
On entry: indicates the type of norm to be used.
Maximum norm.
Averaged L2 norm.
Is the same as NORM='A'.
If vnorm denotes the norm of the vector v of length n, then for the averaged L2 norm
while for the maximum norm
If you wish to weight the maximum norm or the L2 norm, then RTOL and ATOL should be scaled appropriately on input to the integrator (see under ITOL in the specification of the integrator for the formulation of the weight vector wi from RTOL and ATOL, e.g., see D02NBF).
Only the first character to the actual parameter NORM is passed to D02NVF; hence it is permissible for the actual argument to be more descriptive e.g., ‘Maximum’, ‘Average L2’ or ‘Default’ in a call to D02NVF.
Constraint: NORM='M', 'A' or 'D'.
14:   RWORK(50+4×NEQMAX) – REAL (KIND=nag_wp) arrayCommunication Array
This must be the same workspace array as the array RWORK supplied to the integrator. It is used to pass information from the setup routine to the integrator and therefore the contents of this array must not be changed before calling the integrator.
15:   IFAIL – INTEGERInput/Output
On entry: IFAIL must be set to 0, -1​ or ​1. If you are unfamiliar with this parameter you should refer to Section 3.3 in the Essential Introduction 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 parameter, 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:
On entry, an illegal input was detected.

7  Accuracy

Not applicable.

8  Further Comments


9  Example

See Section 9 in D02NBF.

D02NVF (PDF version)
D02 Chapter Contents
D02 Chapter Introduction
NAG Library Manual

© The Numerical Algorithms Group Ltd, Oxford, UK. 2012