D02mn (Ode)

Ordinary Differential EquationsIntegrators for Stiff Ordinary Differential Systems

This sub-chapter contains the specifications of the integrators, the setup routines and diagnostic routines which have been developed from the
SPRINT package, Berzins and Furzeland (1985), and from the
DASSL package, Brenan et al. (1996).

The SPRINT explicit integrators d02nbf, d02ncf and d02ndf are designed for solving stiff systems of explicitly defined ordinary differential equations,

$${y}^{\prime}=g(t,y)\text{.}$$ |

The SPRINT implicit integrators d02ngf, d02nhf and d02njf are designed for solving stiff systems of implicitly defined ordinary differential equations,

$$A(t,y){y}^{\prime}=g(t,y)\text{.}$$ |

The DASSL integrator d02nef is designed for solving systems of the form, $F(t,y,y\prime )=0$. These formulations permit solution of differential/algebraic systems
(DAEs). The facilities provided are essentially those of the explicit solvers.

The SPRINT integrator routines have almost identical calling sequences but each is designed to solve a problem where the Jacobian is of a particular structure: full matrix (d02nbf and d02ngf), banded matrix (d02ncf and d02nhf) or sparse matrix (d02ndf and d02njf). Each of these structures has associated with it a linear algebra setup routine: d02nsf, d02ntf and d02nuf respectively. A linear algebra setup routine must be called before the first call to the appropriate integrator. These linear algebra setup routines check various arguments of the corresponding integrator routine and set certain arguments for the linear algebra computations. A routine, d02nxf, is supplied which permits extraction of diagnostic information after a call to either of the sparse linear algebra solvers d02ndf and d02njf.

With the SPRINT integrators are also associated three integrator setup routines d02mvf, d02nvf and d02nwf, one of which must be called before the first call to any integrator routine. They provide input to the Backward Differentiation Formulae (BDF), the Blend Formulae and the special fixed leading coefficient BDF codes respectively. On return from an integrator, if it is feasible to continue the integration, d02nzf may be called to reset various integration arguments. It is often of considerable interest to determine statistics concerning the integration process. d02nyf is provided with this aim in mind. It should prove especially useful to those who wish to integrate many similar problems as it provides suitable values for many of the input arguments and indications of the difficulties encountered when solving the problem.

Hence, the general form of a program calling one of the integrator routines
d02nbf, d02ncf, d02ndf, d02ngf, d02nhf or d02njf
will be

Declarations . . Call linear algebra setup routine Call integrator setup routine Call integrator Call integrator diagnostic routine (if required) Call linear algebra diagnostic routine (if appropriate and if required) . . Stop End

The DASSL integrator, d02nef, has an associated setup routine d02mwf which must be called first. On return from the integrator, if it is feasible to continue the integration, the associated continuation call routine is d02mcf may be called to rest various integration parameters. The structure of the Jacobian is assumed to be full unless d02npf is called following a call to the setup routine to specify that the Jacobian is banded and to supply its bandwidths.

The required calling sequence for different Jacobian structures and system types is represented diagrammatically in Figure 1.

The integrators d02nmf and d02nnf are reverse communication routines designed for solving explicit and implicit stiff ordinary differential systems respectively. You are warned that you should use these routines only when the integrators mentioned above are inadequate for their application. For example, if it is difficult to write one or more of the user-supplied routine **fcn** (**resid**) or **jac** (or **monitr**) or if the integrators are to be embedded in a package, it may be advisable to consider these routines.

Since these routines use reverse communication you do not need to define any routines with a prescribed argument list. This makes them especially suitable for large scale computations where encapsulation of the definition of the differential system or its Jacobian matrix in a prescribed routine form may be particularly difficult to achieve.

d02nmf is the reverse communication counterpart of the direct communication routines d02nbf, d02ncf and d02ndf whereas d02nnf is the reverse communication counterpart of the direct communication routines d02ngf, d02nhf and d02njf. When using these reverse communication routines it is necessary to call the same linear algebra and integrator setup routines as for the direct communication counterpart. All the other continuation and interrogation routines available for use with the direct communication routines are also available to you when calling the reverse communication routines.

There is also a routine, d02nrf, to tell you how to supply the Jacobian when the sparse linear algebra option is being employed with either of d02nmf and d02nnf. Hence, the general form of a program calling one of the integrator routines d02nmf or d02nnf will be

```
Declarations
Call linear algebra setup routine
Call integrator setup routine
irevcm = 0
1000 Call integrator( ..., irevcm, ...)
If (irevcm.gt.0) Then
evaluate residual and Jacobian (including a call to d02nrf if
sparse linear algebra is being used), call the MONITR routine etc.
Go To 1000
Endif
Call integrator diagnostic routine (if required)
Call linear algebra diagnostic routine (if appropriate and if required)
Stop
End
```

The required calling sequence in the case of reverse communication, is represented diagramatically in Figure 2.

In the example programs for the eight SPRINT integrators d02nbf, d02ncf, d02ndf, d02ngf, d02nhf, d02njf, d02nmf and d02nnf we attempt to illustrate the various options available. Many of these options are available in all the routines and you are invited to scan all the example programs for illustrations of their use. In each case we use as an example the stiff Robertson problem

despite the fact that it is not a sensible choice to use either the banded or the sparse linear algebra for this problem. Their use here serves for illustration of the techniques involved. For the implicit integrators
d02ngf, d02nhf and d02njf
we write the Robertson problem in residual form, as an implicit differential system and as a differential/algebraic system respectively. Here we are exploiting the fact that $a+b+c$ is constant and hence one of the equations may be replaced by ${(a+b+c)}^{\prime}=0.0$ or $a+b+c=1.0$ (for our particular choice of initial conditions). For the reverse communication routines d02nmf and d02nnf our examples are intended only to illustrate the reverse communication technique.

$$\begin{array}{llrlll}{a}^{\prime}& =& -0.04a& +& {10}^{4}bc& \\ & & & & & & \\ {b}^{\prime}& =& 0.04a& -& {10}^{4}bc& -& 3\times {10}^{7}{b}^{2}\\ & & & & & & \\ {c}^{\prime}& =& & & & & 3\times {10}^{7}{b}^{2}\end{array}$$ |

The DASSL integrator d02nef can solve DAEs of the fully implicit form $F(t,y,y\prime )=0$ and, therefore, has increased functionality over the SPRINT integrators. Additionally
d02nef can be used to solve difficult algebraic problems by continuation; for example, the nonlinear algebraic problem

can be solved by integrating solutions of

where the solution to $f\left(x\right)+g\left(x\right)=0$ is known. The solution of this type of problem is illustrated in Section 10 in **d02nef**.

$$f\left(x\right)=0$$ |

$$f\left(x\right)+(1-t)g\left(x\right)=0$$ |

Berzins M and Furzeland R M (1985) A user's manual for SPRINT – A versatile software package for solving systems of algebraic, ordinary and partial differential equations: Part 1 – Algebraic and ordinary differential equations *Report TNER.85.085* Shell Research Limited

Brenan K, Campbell S and Petzold L (1996) *Numerical Solution of Initial-Value Problems in Differential-Algebraic Equations* SIAM, Philadelphia