D02NCF is a forward communication routine for integrating stiff systems of explicit ordinary differential equations when the Jacobian is a banded matrix.
D02NCF is a general purpose routine for integrating the initial value problem for a stiff system of explicit ordinary differential equations,
It is designed specifically for the case where the Jacobian
$\frac{\partial g}{\partial y}$ is a banded matrix.
Both interval and step oriented modes of operation are available and also modes designed to permit intermediate output within an interval oriented mode.
An outline of a typical calling program for D02NCF is given below. It calls the banded matrix linear algebra setup routine
D02NTF, the Backward Differentiation Formula (BDF) integrator setup routine
D02NVF, and its diagnostic counterpart
D02NYF.
! Declarations
EXTERNAL FCN, JAC, MONITR
.
.
.
IFAIL = 0
CALL D02NVF(...,IFAIL)
CALL D02NTF(NEQ, NEQMAX, JCEVAL, ML, MU, NWKJAC, NJCPVT, &
RWORK, IFAIL)
IFAIL = -1
CALL D02NCF(NEQ, NEQMAX, T, TOUT, Y, YDOT, RWORK, RTOL, &
ATOL, ITOL, INFORM, FCN, YSAVE, NY2DIM, JAC, &
WKJAC, NWKJAC,JACPVT, NJCPVT, MONITR, ITASK, &
ITRACE, IFAIL)
IF (IFAIL.EQ.1 .OR. IFAIL.GE.14) STOP
IFAIL = 0
CALL D02NYF(...)
.
.
.
STOP
END
The linear algebra setup routine
D02NTF and one of the integrator setup routines,
D02NVF or
D02NWF, must be called prior to the call of D02NCF. The integrator diagnostic routine
D02NYF may be called after the call to D02NCF. There is also a routine,
D02NZF, designed to permit you to change step size on a continuation call to D02NCF without restarting the integration process.
If on entry
${\mathbf{IFAIL}}={\mathbf{0}}$ or
${-{\mathbf{1}}}$, explanatory error messages are output on the current error message unit (as defined by
X04AAF).
The accuracy of the numerical solution may be controlled by a careful choice of the parameters
RTOL and
ATOL, and to a much lesser extent by the choice of norm. You are advised to use scalar error control unless the components of the solution are expected to be poorly scaled. For the type of decaying solution typical of many stiff problems, relative error control with a small absolute error threshold will be most appropriate (that is, you are advised to choose
${\mathbf{ITOL}}=1$ with
${\mathbf{ATOL}}\left(1\right)$ small but positive).
The cost of computing a solution depends critically on the size of the differential system and to a lesser extent on the degree of stiffness of the problem. For D02NCF the cost is proportional to ${\mathbf{NEQ}}\times {\left({\mathbf{ML}}+{\mathbf{MU}}+1\right)}^{2}$ though for problems which are only mildly nonlinear the cost may be dominated by factors proportional to ${\mathbf{NEQ}}\times \left({\mathbf{ML}}+{\mathbf{MU}}+1\right)$ except for very large problems.
In general, you are advised to choose the Backward Differentiation Formula option (setup routine
D02NVF) but if efficiency is of great importance and especially if it is suspected that
$\frac{\partial g}{\partial y}$ has complex eigenvalues near the imaginary axis for some part of the integration, you should try the BLEND option (setup routine
D02NWF).
This example solves the well-known stiff Robertson problem
over the range
$\left[0,10\right]$ with initial conditions
$a=1.0$ and
$b=c=0.0$ using scalar relative error control and vector absolute error control
$\left({\mathbf{ITOL}}=2\right)$. The solution is obtained at
${\mathbf{TOUT}}=5.0$ and
${\mathbf{TOUT}}=10.0$ by overshooting and internal
${C}^{0}$ interpolation
$\left({\mathbf{ITASK}}=1\right)$. D02NBY is used for
MONITR, the BLEND integrator (setup routine
D02NWF) is used and the option of an analytical Jacobian is chosen.