# naginterfaces.library.ode.dae_​dassl_​gen¶

naginterfaces.library.ode.dae_dassl_gen(t, tout, y, ydot, rtol, atol, itask, res, comm, jac=None, data=None)[source]

dae_dassl_gen is a function for integrating stiff systems of implicit ordinary differential equations coupled with algebraic equations.

For full information please refer to the NAG Library document for d02ne

https://www.nag.com/numeric/nl/nagdoc_28.5/flhtml/d02/d02nef.html

Parameters
tfloat

On initial entry: the initial value of the independent variable, .

toutfloat

The next value of at which a computed solution is desired.

On initial entry: is used to determine the direction of integration. Integration is permitted in either direction (see also ).

yfloat, array-like, shape

On initial entry: the vector of initial values of the dependent variables .

ydotfloat, array-like, shape

On initial entry: must contain approximations to the time derivatives of the vector evaluated at the initial value of the independent variable.

rtolfloat, array-like, shape

Note: the required length for this argument is determined as follows: if : ; if : ; otherwise: .

The relative local error tolerance.

atolfloat, array-like, shape

Note: the required length for this argument is determined as follows: if : ; if : ; otherwise: .

The absolute local error tolerance.

On initial entry: need not be set.

rescallable (r, ires) = res(t, y, ydot, ires, data=None)

must evaluate the residual

Parameters
tfloat

, the current value of the independent variable.

yfloat, ndarray, shape

, for , the current solution component.

ydotfloat, ndarray, shape

The derivative of the solution at the current point .

iresint

Is always equal to zero.

dataarbitrary, optional, modifiable in place

User-communication data for callback functions.

Returns
rfloat, array-like, shape

must contain the th component of , for where

iresint

should normally be left unchanged. However, if an illegal value of is encountered, should be set to ; dae_dassl_gen will then attempt to resolve the problem so that illegal values of are not encountered. should be set to if you wish to return control to the calling function; this will cause dae_dassl_gen to exit with = 23.

commdict, communication object, modified in place

Communication structure.

This argument must have been initialized by a prior call to dae_dassl_setup().

jacNone or callable pd = jac(t, y, ydot, pd, cj, data=None), optional

Note: if this argument is None then a NAG-supplied facility will be used.

Evaluates the matrix of partial derivatives, , where

If this option is not required, the actual argument for must be None. You must indicate to the integrator whether this option is to be used by setting the argument appropriately in a call to the setup function dae_dassl_setup().

Parameters
tfloat

, the current value of the independent variable.

yfloat, ndarray, shape

, for , the current solution component.

ydotfloat, ndarray, shape

The derivative of the solution at the current point .

pdfloat, ndarray, shape

is preset to zero before the call to .

cjfloat

is a scalar constant which will be defined in dae_dassl_gen.

dataarbitrary, optional, modifiable in place

User-communication data for callback functions.

Returns
pdfloat, array-like, shape

If the Jacobian is full then , for , for ; if the Jacobian is banded then , for .

dataarbitrary, optional

User-communication data for callback functions.

Returns
tfloat

On intermediate exit: , the current value of the independent variable.

On final exit: the value of the independent variable at which the computed solution is returned (usually at ).

yfloat, ndarray, shape

On intermediate exit: the computed solution vector, , evaluated at .

On final exit: the computed solution vector, evaluated at (usually ).

ydotfloat, ndarray, shape

The time derivatives of the vector at the last integration point.

rtolfloat, ndarray, shape

remains unchanged unless dae_dassl_gen exits with = 16 in which case the values may have been increased to values estimated to be appropriate for continuing the integration.

atolfloat, ndarray, shape

remains unchanged unless dae_dassl_gen exits with = 16 in which case the values may have been increased to values estimated to be appropriate for continuing the integration.

The task performed by the integrator on successful completion or an indicator that a problem occurred during integration.

The integration to was successfully completed () by stepping exactly to .

The integration to was successfully completed () by stepping past . and are obtained by interpolation.

Different negative values of returned correspond to different failure exits. should always be checked in such cases and the corrective action taken where appropriate.

must remain unchanged between calls to dae_dassl_gen.

Raises
NagValueError
(errno )

On entry, .

Constraint: .

(errno )

On entry, .

Constraint: .

(errno )

is too close to to start integration: : .

(errno )

is behind in the direction of : , .

(errno )

Some element of is less than zero.

(errno )

Some element of is less than zero.

(errno )

A previous call to this function returned with and no appropriate action was taken.

(errno )

Either the initialization function has not been called prior to the first call of this function or a communication array has become corrupted.

(errno )

Either the initialization function has not been called prior to the first call of this function or a communication array has become corrupted.

(errno )

[‘com’] array is of insufficient length; length required ; actual length .

(errno )

All elements of and are zero.

(errno )

Maximum number of steps taken on this call before reaching : , maximum number of steps .

(errno )

Too much accuracy requested for precision of machine. and were increased by scale factor . Try running again with these scaled tolerances. , .

(errno )

A solution component has become zero when a purely relative tolerance (zero absolute tolerance) was selected for that component. , for component .

(errno )

The error test failed repeatedly with . . Stepsize .

(errno )

The corrector repeatedly failed to converge with . . Stepsize .

(errno )

The iteration matrix is singular. . Stepsize .

(errno )

The corrector could not converge and the error test failed repeatedly. . Stepsize .

(errno )

was set to during a call to and could not be resolved. . Stepsize .

(errno )

was set to during a call to . . Stepsize .

(errno )

The initial could not be computed. . Stepsize .

(errno )

Repeated occurrences of input constraint violations have been detected. This could result in a potential infinite loop: . Current violation corresponds to exit with .

Notes

dae_dassl_gen is a general purpose function for integrating the initial value problem for a stiff system of implicit ordinary differential equations with coupled algebraic equations written in the form

dae_dassl_gen uses the DASSL implementation of the Backward Differentiation Formulae (BDF) of orders one to five to solve a system of the above form for () and (). Values for and at the initial time must be given as input. These values must be consistent, (i.e., if , , are the given initial values, they must satisfy ). The function solves the system from to .

A typical calling progrm for dae_dassl_gen would involve calling the DASSL implementation of the BDF integrator setup function dae_dassl_setup() and the banded matrix setup function dae_dassl_linalg() (if required), and, if the integration needs to proceed, calls dae_dassl_cont() before continuing the integration.