wiki:DianaICSolver

Version 6 (modified by miroshkin, 14 years ago) (diff)

--

Description

To simulate chemical or biological process in Diana the Initial Value Problem should be solved at first. A guess for initial conditions can be set in model file.
Standard IDACalcIC() method of Sundials package can calculate consistent initial conditions for homogeneous differential algebraic equations systems of the type

dx1/dt = f1(x1, x2, ..., xn, t)
dx2/dt = f2(x1, x2, ..., xn, t)
...
dxn/dt = fn(x1, x2, ..., xn, t)
(1)

But in case of non-homogeneous differential algebraic equations systems of the type

F1(dx1/dt, dx2/dt, ..., dxn/dt) = f1(x1, x2, ..., xn, t)
F2(dx1/dt, dx2/dt, ..., dxn/dt) = f2(x1, x2, ..., xn, t)
...
Fn(dx1/dt, dx2/dt, ..., dxn/dt) = fn(x1, x2, ..., xn, t)
(2)

IDACalcIC() generates the exception

   ECapeUnknown in IDASolver (Diana) startIntegrator, IDACalcIC failed

Consistent initial conditions for differential algebraic equations system of type (2) can be found with IDACalcIC() method, but the system should be manually changed to form (1) before.
ICSolver can calculate initial conditions for systems of the type (2) without any conversions of the system.

Example

Adsorption column model contains the equations system of type (2) example
Python script with calling standard IDACalcIC() method generates the exception
Python script with using ICSolver and nonzero output verbosity level shows the initial state vector and message

   ICSolver: Consistent initial conditions have been found

Additional information

eso.GetAllVariables() returns state vector values of model
eso.GetAllResiduals() returns vector of right hand side values of equations system
With correct initial values of state vector for model equations all residuals should be equal to zeros.

Additional examples

Mathematical background

Attachments (11)