= 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. [[BR]] Standard {{{ IDACalcIC() }}} method of Sundials package can calculate consistent initial conditions for homogeneous differential algebraic equations systems of the type {{{ #!html
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 {{{ #!html
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.[[BR]] '''''ICSolver''''' can calculate initial conditions for systems of the type (2) without any conversions of the system. = Example = [attachment:AdsColumn.mdl "Adsorption column model"] contains the equations system of type (2) example[[BR]] [attachment:AdsColumn_error.py "Python script with calling standard IDACalcIC() method"] generates the exception[[BR]] [attachment:AdsColumn.py "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 equation set object[[BR]] {{{ eso.GetAllResiduals() }}} returns vector of right hand side values of equations system with current values of state vector[[BR]] ''Note: With correct state vector initial values all residuals of equation set object should be equal to zeros'' == Additional examples == * Hafke reactor[[BR]] [attachment:HafkeReactor.py "script"] [attachment:HafkeReactor.tar "script + model + results"] * Cstr model[[BR]] [attachment:Cstr.py "script"] [attachment:Cstr.tar "script + model + results"] * MATLAB example[[BR]] [attachment:matlab.tar "files"]