NAG FL Interface
d02mvf (ivp_​stiff_​dassl)

Settings help

FL Name Style:


FL Specification Language:


1 Purpose

d02mvf is an integration method specific setup routine which must be called prior to linear algebra setup routines and integrators from the SPRINT suite of routines, if the DASSL implementation of Backward Differentiation Formulae (BDF) is to be used. Note that this method is also available, independent from the SPRINT suite, using d02nef

2 Specification

Fortran Interface
Subroutine d02mvf ( neqmax, sdysav, maxord, con, tcrit, hmin, hmax, h0, maxstp, mxhnil, norm, rwork, ifail)
Integer, Intent (In) :: neqmax, sdysav, maxord, maxstp, mxhnil
Integer, Intent (Inout) :: ifail
Real (Kind=nag_wp), Intent (In) :: tcrit, hmin, hmax, h0
Real (Kind=nag_wp), Intent (Inout) :: con(3), rwork(50+4*neqmax)
Character (1), Intent (In) :: norm
C Header Interface
#include <nag.h>
void  d02mvf_ (const Integer *neqmax, const Integer *sdysav, const Integer *maxord, double con[], const double *tcrit, const double *hmin, const double *hmax, const double *h0, const Integer *maxstp, const Integer *mxhnil, const char *norm, double rwork[], Integer *ifail, const Charlen length_norm)
The routine may be called by the names d02mvf or nagf_ode_ivp_stiff_dassl.

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, d02mvf, makes the choice of the DASSL integrator and permits you to define options appropriate to this choice. Alternative choices of integrator from this suite are the BDF method and the BLEND method which can be chosen by initial calls to d02nvf or d02nwf respectively.

4 References

See the D02M–N Sub-chapter Introduction.

5 Arguments

1: neqmax Integer Input
On entry: a bound on the maximum number of differential equations to be solved.
Constraint: neqmax1.
2: sdysav Integer Input
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 (e.g., see d02nbf).
Constraint: sdysavmaxord+3.
3: maxord Integer Input
On entry: the maximum order to be used for the BDF method. If maxord=0 or maxord>5, maxord=5 is assumed.
Constraint: maxord0.
4: con(3) Real (Kind=nag_wp) array Input/Output
On entry: values to be used to control step size choice during integration. If any con(i)=0.0 on entry, it is replaced by its default value described below. In most cases this is the recommended setting.
con(1), con(2), and con(3) are factors used to bound step size changes. If the current step size h fails, the modulus of the next step size is bounded by con(1)×|h|. The default value of con(1) 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, the modulus of the step size on the second step is bounded by con(3)×|h|. At any other stage in the integration, if the current step size is h, the modulus of the next step size is bounded by con(2)×|h|. The default values are 10.0 for con(2) and 1000.0 for con(3).
Constraints:
These constraints must be satisfied after any zero values have been replaced by default values.
  • 0.0<con(1)<con(2)<con(3);
  • con(2)>1.0;
  • con(3)>1.0.
On exit: the values actually to be used by the integration routine.
5: 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 argument 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.
6: 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.
7: 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.
8: 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.
9: maxstp Integer Input
On entry: the maximum number of steps to be attempted during one call to the integrator after which it will return with ifail=2 (e.g., see d02nbf). Set maxstp=0 if no limit is to be imposed.
10: mxhnil Integer Input
On entry: the maximum number of warnings printed (if itrace0, e.g., see d02nbf) per problem when t+h=t on a step (h=​ current step size). If mxhnil0, a default value of 10 is assumed.
11: norm Character(1) Input
On entry: indicates the type of norm to be used.
norm='M'
Maximum norm.
norm='A'
Averaged L2 norm.
norm='D'
Is the same as 'A'.
If vnorm denotes the norm of the vector v of length n, for the averaged L2 norm
vnormB=1ni=1n (viwi) 2,  
while for the maximum norm
vnorm=max1in |viwi| .  
If you wish to weight the maximum norm or the L2 norm, 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 argument norm is passed to d02mvf; hence it is permissible for the actual argument to be more descriptive, e.g., ‘Maximum’, ‘Average L2’ or ‘Default’ in a call to d02mvf.
Constraint: norm='M', 'A' or 'D'.
12: rwork(50+4×neqmax) Real (Kind=nag_wp) array Communication 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.
13: ifail Integer Input/Output
On entry: ifail must be set to 0, −1 or 1 to set behaviour on detection of an error; these values have no effect when no error is detected.
A value of 0 causes the printing of an error message and program execution will be halted; otherwise program execution continues. A value of −1 means that an error message is printed while a value of 1 means that it is not.
If halting is not appropriate, the value −1 or 1 is recommended. If message printing is undesirable, then the value 1 is recommended. Otherwise, the value 0 is recommended. 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, con(value)=value.
Constraint: con(value)0.0.
On entry, con(value)=value.
Constraint: con(value)1.0.
On entry, maxord=value.
Constraint: maxord0.
On entry, maxord>5. maxord=5 assumed.
On entry, neqmax=value.
Constraint: neqmax1.
On entry, norm was not valid: norm=value.
Constraint: norm='M', 'A' or 'D'.
On entry, sdysav=value and maxord+3=value.
Constraint: sdysavmaxord+3.
The sequence con is not strictly increasing: con(1)<con(2)<con(3) is required.
ifail=-99
An unexpected error has been triggered by this routine. Please contact NAG.
See Section 7 in the Introduction to the NAG Library FL Interface for further information.
ifail=-399
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.
ifail=-999
Dynamic memory allocation failed.
See Section 9 in the Introduction to the NAG Library FL Interface for further information.

7 Accuracy

Not applicable.

8 Parallelism and Performance

Background information to multithreading can be found in the Multithreading documentation.
d02mvf is not threaded in any implementation.

9 Further Comments

None.

10 Example

This example solves the plane pendulum problem defined by the equations:
x = u y = v u = -λx v = -λy-1 x2+y2 = 1  
The additional algebraic constraint xu+yv=0 can be derived, and after appropriate substitution and manipulation to avoid a singular Jacobian solves the equations:
y1 = y3-y6y1 y2 = y4-y6y2 y3 = -y5y1 y4 = -y5y2-1 0 = y1y3+y2y4 0 = y12+y22-1  
with given initial conditions and derivatives.

10.1 Program Text

Program Text (d02mvfe.f90)

10.2 Program Data

Program Data (d02mvfe.d)

10.3 Program Results

Program Results (d02mvfe.r)
GnuplotProduced by GNUPLOT 4.6 patchlevel 3 −1 −0.9 −0.8 −0.7 −0.6 −0.5 −0.4 −0.3 −0.2 −0.1 0 −1 −0.8 −0.6 −0.4 −0.2 0 0.2 0.4 0.6 0.8 1 Pendulum Displacement x Example Program DASSL Implementation of BDF Method for Stiff ODE Plane Pendulum Problem gnuplot_plot_1