Variable Step Size Integration Algorithms Output
Dymosim provides a number of variable step size integration algorithms. The most important characteristics of these algorithms are given in the following table:
Algorithm |
Order | Stiff |
A-stable |
Dense Output |
Root Finder |
Method |
LSODAR |
1-12, 1-5 | Both | No |
Yes |
Yes | Multiple step / Adams methods |
DASSL |
1-5 | Yes |
No | Yes |
Yes | Multiple step / BDF |
Radau Ila | 5 |
Yes | Yes | Yes |
Yes | Single step / Runge Kutta |
Esdirk23a | 3 |
Yes | Yes | Yes |
Yes | Single step / Runge Kutta |
Esdirk34a | 4 | Yes | Yes | Yes |
Yes | Single step / Runge Kutta |
Esdirk45a | 5 |
Yes | Yes | Yes | Yes | Single step / Runge Kutta |
Dopri45 | 5 | No | N/A | Yes |
Yes | Single step / Runge Kutta |
Dopri853 | 8 |
No | N/A | Yes | Yes | Single step / Runge Kutta |
Sdirk34hw | 4 | Yes | Yes | Yes |
Yes | Single step / Runge Kutta |
Cerk23 | 3 |
No | N/A | Yes | Yes | Single step / Runge Kutta |
Cerk34 | 4 | No | N/A | Yes |
Yes | Single step / Runge Kutta |
Cerk45 | 5 |
No | N/A | Yes | Yes | Single step / Runge Kutta |
Cvode | Variable | Yes | No | Yes | Yes | Multistep |
Fixed Step Size Integration Algorithms Output
There are four different fixed step size integration algorithms, intended for real-time simulations:
Algorithm | Order | Stiff |
Dense Output | Root Finder | Method |
---|
Euler |
1 | No |
No | Yes |
Euler |
Rkfix2 |
2 | No | No | No |
Single step / Runge Kutta |
Rkfix3 |
3 | No | No | No |
Single step / Runge Kutta |
Rkfix4 |
4 | No | No | No |
Single step / Runge Kutta |
Advanced Algorithms
A number of algorithms are available for an advanced use.
- Few Events
- If the model contains few events:
- and is stiff: use LSODAR.
- and is non-stiff: use DASSL.
- Many Events
- If the model contains many events:
- and is stiff: use Radau Il or Esdirk (use higher order if stricter tolerance is wanted).
- and is non-stiff: use Cerk or Dopri can (use higher order if stricter tolerance is wanted).
- Sparse Solvers
- If the model is suitable for sparse solvers, a message about this appears in the Messages Reporting window, the Simulation tab, the Translation part of the message tree when simulating the model.
Note:
The message line is Sparse solver handling possible: false. Click the line to see the full message.
If this message appears, you can do the following to select to use sparse solvers:
- Set the flag
Advanced.SparseActivate=true;
.This flag is by default false.
- Select any of the following algorithms that supports sparse solvers:
- LSODAR
- DASSL
- Cvode
- RadauIIa
- Esdirk23a, 34a, or 45a
- Sdirk34hw
For more information, see Integration Tab.Note:
You can store the selection of algorithm in the model, but not the value of the flag.
The sparse solvers use a multithreaded (OpenMP) variant of SuperLU. The flags defining if the model is suitable for sparse solvers are already tuned to suitable values (the last one in percentage):
Advanced.SparseMinimumStates=90;
Advanced.SparseMaximumDensity=5;
The number of cores used by the multithreaded (OpenMP) variant of SuperLU can be set using the flag Advanced.NumberOfCores
. If the value of the flag is set to 0
(default value) the number of cores is set to 1
.
- Analytic ODE Jacobians
- To improve the simulation speed, you can use analytic ODE Jacobians during simulation and also during linearization.. You can activate the use of analytic ODE Jacobians by the option Generate Analytic Jacobians for the ODE problem. For more information where to find this option, see Translation Tab.
Notes:
- This option generates a large amount of C code that needs to be compiled. The speed improvement may not be as large as assumed since the case where the option is not used is also optimized.
- There is a corresponding flag
Advanced.GenerateAnalyticJacobian
available for scripting. - If sparse solvers are used (see previous section) these Jacobians are stored in sparse matrix format during simulation, and is subject to sparse linear algebra.
Inline Integration Algorithms
Inline integration is provided to increase the
simulation speed, in particular for real-time simulation.
Inline integration is a combined symbolic and numeric
approach to solve differential-algebraic
equations systems. Discretization expressions
representing the numerical integration
algorithm are symbolically inserted into the differential
algebraic equation model. The equations are then transformed into a
representation that is efficient for numeric simulation.
You need the Export for HILS license (HIS) to use inline integration.
The following inline integration algorithms are provided:
- Inline Explicit Euler
- Inline Implicit Euler
- Inline Trapezoidal Method
- Inline Mixed Implicit/Explicit Euler
- Inline Explicit Runge Kutta
- Inline Implicit Runge Kutta.
- Rosenbrock