Version 7 (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 equation set object
eso.GetAllResiduals() returns vector of right hand side values of equations system with current values of state vector
Note: With correct state vector initial values all residuals of equation set object should be equal to zeros
Additional examples
- Hafke reactor
script script + model + results
- Cstr model
script script + model + results
Attachments (11)
-
HafkeReactor.tar
(830.0 KB) -
added by miroshkin 14 years ago.
Hafke Reactor: model + python script + modeling results
-
HafkeReactor.py
(1.6 KB) -
added by miroshkin 14 years ago.
Hafke Reactor: python script
-
matlab.tar
(10.0 KB) -
added by miroshkin 14 years ago.
Matlab example of consistent initial conditions searching
-
AdsColumn.mdl
(6.1 KB) -
added by miroshkin 14 years ago.
Adsorption column model
-
AdsColumn_error.py
(1.9 KB) -
added by miroshkin 14 years ago.
Adsorption column python script with calling standard IDACalcIC() method
- AdsColumn.2.tar (790.0 KB) - added by miroshkin 14 years ago.
-
Cstr.tar
(120.0 KB) -
added by miroshkin 14 years ago.
Cstr: model + python script + modeling results
-
Cstr.py
(1.3 KB) -
added by miroshkin 14 years ago.
Cstr: python script
-
AdsColumn.tar
(790.0 KB) -
added by miroshkin 14 years ago.
Adsorption column: model + python script + modeling results
-
AdsColumn.py
(2.3 KB) -
added by miroshkin 14 years ago.
Adsorption column: python script
-
ICSolver.pdf
(785.1 KB) -
added by miroshkin 14 years ago.
Mathematical and programming explanation of consistent Initial Conditions Solver implementation