chickadee » sundials » ida-create-solver

(ida-create-solver TSTART TSTOP VARIABLES DERIVATIVES RESIDUAL-MAIN [RESIDUAL-INIT] [RESIDUAL-EVENT] [EVENTS] [ALG-OR-DIFF] [SUPPRESS] [IC] [USER-DATA] [RELTOL] [ABSTOL]) => IDA-SOLVERprocedure

Creates and initializes an object representing a problem to be solved with the IDA solver.

Arguments TSTART and TSTOP must be real numbers that represent the beginning and end of the independent variable range.

Arguments VARIABLES and DERIVATIVES must be SRFI-4 f64vector objects that hold respectively the initial values and derivatives of the system variables.

Argument RESIDUAL-MAIN is used to compute the residual function F and must be a procedure of the following form:

(LAMBDA T YY YP DATA)

or

(LAMBDA T YY YP)

depending on whether the USER-DATA optional argument is set, where

T
real-valued independent variable
YY
SRFI-4 f64vector with current variable values
YP
SRFI-4 f64vector with current variable derivatives
DATA
is a user data object (if set)

This procedure must return a SRFI-4 f64vector containing the residual vector.

Optional keyword argument RESIDUAL-EVENT must be a procedure of the same form as RESIDUAL-MAIN, which computes a rootfinding problem to be solved during the integration of the system. It is set only if argument EVENTS is given.

Optional keyword argument EVENTS is an SRFI-4 s32vector that is used for storage of root finding solutions. It must be given if RESIDUAL-EVENT is given.

Optional keyword argument ALG-OR-DIFF must be an SRFI-4 s32vector which indicates the algebraic and differential variables in the system. A value of 1 indiciates differential variable, and a value of 0 indicates an algebraic one. This is required if the SUPPRESS argument is given and true.

Optional keyword argument SUPPRESS is a boolean flag that indicates whether algebraic variables must be suppressed in the local error test. If it is true (suppress), then the argument ALG-OR-DIFF must be given.

Optional keyword argument IC is a boolean flag that indicates whether the solver must calculate consistent initial conditions, or whether it must use the initial conditions given by VARIABLES.

Optional keyword argument USER-DATA is an object that will be passed as an additional argument to the residual functions.

Optional keyword arguments RELTOL and ABSTOL specify relative and absolute error tolerance, respectively. These both default to 1e-4.