NAG Library Function Document
nag_dae_ivp_dassl_setup (d02mwc) is a setup function which must be called prior to the integrator nag_dae_ivp_dassl_gen (d02nec)
, if the DASSL implementation of Backward Differentiation Formulae (BDF) is to be used.
||nag_dae_ivp_dassl_setup (Integer neq,
This integrator setup function must be called before the first call to the integrator nag_dae_ivp_dassl_gen (d02nec)
. nag_dae_ivp_dassl_setup (d02mwc) permits you to define options for the DASSL integrator, such as: whether the Jacobian is to be provided or is to be approximated numerically by the integrator; the initial and maximum step-sizes for the integration; whether relative and absolute tolerances are system wide or per system equation; and the maximum order of BDF method permitted.
neq – IntegerInput
On entry: the number of differential-algebraic equations to be solved.
maxord – IntegerInput
On entry: the maximum order to be used for the BDF method. Orders up to 5th order are available; setting means that the maximum order used will be .
jceval – Nag_EvaluateJacobianInput
: specifies the technique to be used to compute the Jacobian.
- The Jacobian is to be evaluated numerically by the integrator.
- You must supply a function to evaluate the Jacobian on a call to the integrator.
hmax – doubleInput
On entry: the maximum absolute step size to be allowed. Set if this option is not required.
h0 – doubleInput
On entry: the step size to be attempted on the first step. Set if the initial step size is calculated internally.
vector_tol – Nag_BooleanInput
: a value to indicate the form of the local error test.
- rtol and atol are single element vectors.
- rtol and atol are vectors. This should be chosen if you want to apply different tolerances to each equation in the system.
the tolerances must either both be single element vectors or both be vectors of length neq
icom[licom] – IntegerCommunication Array
: used to communicate details of the task to be carried out to the integration function nag_dae_ivp_dassl_gen (d02nec)
licom – IntegerInput
: the dimension of the array icom
com[lcom] – doubleCommunication Array
: used to communicate problem parameters to the integration function nag_dae_ivp_dassl_gen (d02nec)
. This must be the same communication array as the array com
supplied to nag_dae_ivp_dassl_gen (d02nec)
. In particular, the values of hmax
are contained in com
lcom – IntegerInput
: the dimension of the array com
the array com
must be large enough for the requirements of nag_dae_ivp_dassl_gen (d02nec)
. That is:
- if the system Jacobian is dense, ;
- if the system Jacobian is banded, .
are the lower and upper bandwidths respectively that are to be specified in a subsequent call to nag_dae_ivp_dassl_linalg (d02npc)
fail – NagError *Input/Output
The NAG error argument (see Section 3.6
in the Essential Introduction).
6 Error Indicators and Warnings
On entry, argument had an illegal value.
On entry, and .
On entry, .
On entry, .
An internal error has occurred in this function. Check the function call and any array sizes. If the call is correct then please contact NAG
On entry, .
This example solves the plane pendulum problem, defined by the following equations:
Differentiating the algebraic constraint once, a new algebraic constraint is obtained
Differentiating the algebraic constraint one more time, substituting for
, the corresponding DAE system includes the differential equations and the algebraic equation in
We solve the reformulated DAE system
For our experiments, we take consistent initial values
9.1 Program Text
Program Text (d02mwce.c)
9.2 Program Data
9.3 Program Results
Program Results (d02mwce.r)