4 | | The following example shows how ICSolver can be used to find |
5 | | consistent initial conditions where just applying the standard |
6 | | IDA solver throws an exception: |
| 4 | {{{ |
| 5 | #!html |
| 6 | <table border="0" width="50%" align="center"> |
| 7 | <tr> |
| 8 | <td align = "center" fontsize ="50%" width="90%"> |
| 9 | dx<sub>1</sub>/dt = f<sub>1</sub>(x<sub>1</sub>, x<sub>2</sub>, ..., x<sub>n</sub>, t)<br> |
| 10 | dx<sub>2</sub>/dt = f<sub>2</sub>(x<sub>1</sub>, x<sub>2</sub>, ..., x<sub>n</sub>, t)<br> |
| 11 | ... <br> |
| 12 | dx<sub>n</sub>/dt = f<sub>n</sub>(x<sub>1</sub>, x<sub>2</sub>, ..., x<sub>n</sub>, t) |
| 13 | </td> |
| 14 | <td align="center">(1) |
| 15 | </td> |
| 16 | </tr> |
| 17 | </table> |
| 18 | }}} |
8 | | * Adsorption column[[BR]] |
9 | | [attachment:AdsColumn.py "script"] [attachment:AdsColumn.tar "script + model + results"] |
| 20 | But in case of non-homogeneous differential algebraic equations systems of the type |
| 21 | |
| 22 | {{{ |
| 23 | #!html |
| 24 | <table border="0" width="50%" align="center"> |
| 25 | <tr> |
| 26 | <td align = "center" fontsize ="50%" width="90%"> |
| 27 | F<sub>1</sub>(dx<sub>1</sub>/dt, dx<sub>2</sub>/dt, ..., dx<sub>n</sub>/dt) = f<sub>1</sub>(x<sub>1</sub>, x<sub>2</sub>, ..., x<sub>n</sub>, t)<br> |
| 28 | F<sub>2</sub>(dx<sub>1</sub>/dt, dx<sub>2</sub>/dt, ..., dx<sub>n</sub>/dt) = f<sub>2</sub>(x<sub>1</sub>, x<sub>2</sub>, ..., x<sub>n</sub>, t)<br> |
| 29 | ... <br> |
| 30 | F<sub>n</sub>(dx<sub>1</sub>/dt, dx<sub>2</sub>/dt, ..., dx<sub>n</sub>/dt) = f<sub>n</sub>(x<sub>1</sub>, x<sub>2</sub>, ..., x<sub>n</sub>, t) |
| 31 | </td> |
| 32 | <td align="center">(2) |
| 33 | </td> |
| 34 | </tr> |
| 35 | </table> |
| 36 | }}} |
| 37 | |
| 38 | {{{IDACalcIC()}}} generates the exception |
| 39 | {{{ |
| 40 | ECapeUnknown in IDASolver (Diana) startIntegrator, IDACalcIC failed |
| 41 | }}} |
| 42 | |
| 43 | 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]] |
| 44 | '''''ICSolver''''' can calculate initial conditions for systems of the type (2) without any conversions of the system. |
| 45 | |
| 46 | = Example = |
| 47 | |
| 48 | Adsorption column model contains the equations system of type (2) example[[BR]] |
| 49 | Python script with calling standard IDACalcIC() method generates the exception[[BR]] |
| 50 | Python script with using ICSolver and nonzero output verbosity level shows the initial state vector and message |
| 51 | |
| 52 | {{{ |
| 53 | ICSolver: Consistent initial conditions have been found |
| 54 | }}} |
| 55 | |
| 56 | == Additional information == |
| 57 | |
| 58 | {{{ eso.GetAllVariables() }}} returns state vector values of model[[BR]] |
| 59 | {{{ eso.GetAllResiduals() }}} returns vector of right hand side values of equations system[[BR]] |
| 60 | With correct initial values of state vector for model equations all residuals should be equal to zeros. |