Skip to content

Commit 656ccdd

Browse files
Willi Braunadeas31
authored andcommitted
rewritten the section on integration methods
1 parent 5fb2ee3 commit 656ccdd

File tree

4 files changed

+180
-166
lines changed

4 files changed

+180
-166
lines changed

UsersGuide/source/extrarefs.bib

Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,3 +16,61 @@ @BOOK{mathematicbook:third
1616
year = 1996
1717
}
1818

19+
@book{Cellier:2006,
20+
author = {Cellier, Francois E. and Kofman, Ernesto},
21+
title = {Continuous System Simulation},
22+
year = {2006},
23+
isbn = {0387261028},
24+
publisher = {Springer-Verlag New York, Inc.},
25+
address = {Secaucus, NJ, USA},
26+
}
27+
28+
@book{Hairer:1993,
29+
author = {Hairer, E. and N{\o}rsett, S. P. and Wanner, G.},
30+
title = {Solving Ordinary Differential Equations I: Nonstiff Problems},
31+
edition={2nd rev. ed. 1993. Corr. 3rd printing 2008},
32+
year = {1993},
33+
isbn = {978-3-540-56670-0},
34+
doi = {10.1007/978-3-540-78862-1},
35+
publisher = {Springer-Verlag Berlin Heidelberg},
36+
}
37+
38+
@article{PetzoldDASSL:1982,
39+
title = {Description of DASSL: a differential/algebraic system solver},
40+
author = {Petzold, L.R.},
41+
journal = {},
42+
place = {United States},
43+
year = 1982,
44+
}
45+
46+
@article{Hindmarsh:2005,
47+
title={{SUNDIALS}: Suite of nonlinear and differential/algebraic equation solvers},
48+
author={A.~C.~Hindmarsh and P.~N.~Brown and K.~E.~Grant and S.~L.~Lee and R.~Serban and D.~E.~Shumaker and C.~S.~Woodward},
49+
journal={ACM Transactions on Mathematical Software (TOMS)},
50+
volume={31},
51+
number={3},
52+
pages={363--396},
53+
year={2005},
54+
publisher={ACM}
55+
}
56+
57+
@article{Davis:2010,
58+
author = {T.~A.~Davis and E.~Palamadai Natarajan},
59+
title = {Algorithm 907: KLU, A Direct Sparse Solver for Circuit Simulation Problems},
60+
journal = {ACM Trans. Math. Softw.},
61+
issue_date = {September 2010},
62+
volume = {37},
63+
number = {3},
64+
month = sep,
65+
year = {2010},
66+
issn = {0098-3500},
67+
pages = {36:1--36:17},
68+
articleno = {36},
69+
numpages = {17},
70+
url = {http://doi.acm.org/10.1145/1824801.1824814},
71+
doi = {10.1145/1824801.1824814},
72+
acmid = {1824814},
73+
publisher = {ACM},
74+
address = {New York, NY, USA},
75+
keywords = {LU factorization, circuit simulation, sparse matrices},
76+
}

UsersGuide/source/index.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ Generated on |date| at |time|
2020
introduction
2121
omedit
2222
plotting
23+
solving
2324
debugger
2425
graphs
2526
fmi

UsersGuide/source/simulationflags.rst

Lines changed: 0 additions & 166 deletions
Original file line numberDiff line numberDiff line change
@@ -11,169 +11,3 @@ OpenModelica (C-runtime) Simulation Flags
1111

1212
.. include :: simoptions.inc
1313
14-
.. _cruntime-integration-methods :
15-
16-
Integration Methods
17-
-------------------
18-
19-
This section contains additional information about the different
20-
integration methods in OpenModelica, selected by the method flag
21-
of the :ref:`simulate` command or the :ref:`-s simflag <simflag-s>`.
22-
23-
dassl
24-
~~~~~
25-
26-
Default integration method in OpenModelica.
27-
Adams Moulton; the default uses a colored numerical Jacobian and interval root finding.
28-
To change settings, use simulation flags such as
29-
:ref:`dasslJacobian <simflag-dassljacobian>`,
30-
:ref:`dasslNoRootFinding <simflag-dasslnorootfinding>`,
31-
:ref:`dasslNoRestart <simflag-dasslnorestart>`,
32-
:ref:`initialStepSize <simflag-initialstepsize>`,
33-
:ref:`maxStepSize <simflag-maxstepsize>`,
34-
:ref:`maxIntegrationOrder <simflag-maxintegrationorder>`,
35-
:ref:`noEquidistantTimeGrid <simflag-noequidistanttimegrid>`.
36-
37-
+----------------------+-----------------------------+
38-
| Order: | 1-5 |
39-
+----------------------+-----------------------------+
40-
| Step Size Control: | true |
41-
+----------------------+-----------------------------+
42-
| Order Control: | true |
43-
+----------------------+-----------------------------+
44-
| Stability Region: | variable; depend from order |
45-
+----------------------+-----------------------------+
46-
47-
euler
48-
~~~~~
49-
50-
Explicit Euler.
51-
52-
+----------------------+---------------------+
53-
| Order: | 1 |
54-
+----------------------+---------------------+
55-
| Step Size Control: | false |
56-
+----------------------+---------------------+
57-
| Order Control: | false |
58-
+----------------------+---------------------+
59-
| Stability Region: | \|(1,0) Padé \| ≤ 1 |
60-
+----------------------+---------------------+
61-
62-
rungekutta
63-
~~~~~~~~~~
64-
65-
Classical Runge-Kutta method.
66-
67-
+----------------------+---------------------+
68-
| Order: | 4 |
69-
+----------------------+---------------------+
70-
| Step Size Control: | false |
71-
+----------------------+---------------------+
72-
| Order Control: | false |
73-
+----------------------+---------------------+
74-
| Stability Region: | \|(4,0) Padé \| ≤ 1 |
75-
+----------------------+---------------------+
76-
77-
radau1
78-
~~~~~~
79-
80-
Radau IIA with one point.
81-
82-
+----------------------+---------------------+
83-
| Order: | 1 |
84-
+----------------------+---------------------+
85-
| Step Size Control: | false |
86-
+----------------------+---------------------+
87-
| Order Control: | false |
88-
+----------------------+---------------------+
89-
| Stability Region: | \|(0,1) Padé \| ≤ 1 |
90-
+----------------------+---------------------+
91-
92-
radau3
93-
~~~~~~
94-
95-
Radau IIA with two points.
96-
97-
+----------------------+---------------------+
98-
| Order: | 3 |
99-
+----------------------+---------------------+
100-
| Step Size Control: | false |
101-
+----------------------+---------------------+
102-
| Order Control: | false |
103-
+----------------------+---------------------+
104-
| Stability Region: | \|(1,2) Padé \| ≤ 1 |
105-
+----------------------+---------------------+
106-
107-
radau5
108-
~~~~~~
109-
110-
Radau IIA with three points.
111-
112-
+----------------------+---------------------+
113-
| Order: | 5 |
114-
+----------------------+---------------------+
115-
| Step Size Control: | false |
116-
+----------------------+---------------------+
117-
| Order Control: | false |
118-
+----------------------+---------------------+
119-
| Stability Region: | \|(2,3) Padé \| ≤ 1 |
120-
+----------------------+---------------------+
121-
122-
lobatto2
123-
~~~~~~~~
124-
125-
Lobatto IIIA with two points.
126-
127-
+----------------------+---------------------+
128-
| Order: | 2 |
129-
+----------------------+---------------------+
130-
| Step Size Control: | false |
131-
+----------------------+---------------------+
132-
| Order Control: | false |
133-
+----------------------+---------------------+
134-
| Stability Region: | \|(2,2) Padé \| ≤ 1 |
135-
+----------------------+---------------------+
136-
137-
lobatto4
138-
~~~~~~~~
139-
140-
Lobatto IIIA with three points.
141-
142-
+----------------------+---------------------+
143-
| Order: | 4 |
144-
+----------------------+---------------------+
145-
| Step Size Control: | false |
146-
+----------------------+---------------------+
147-
| Order Control: | false |
148-
+----------------------+---------------------+
149-
| Stability Region: | \|(3,3) Padé \| ≤ 1 |
150-
+----------------------+---------------------+
151-
152-
lobatto6
153-
~~~~~~~~
154-
155-
Lobatto IIIA with four points.
156-
157-
+----------------------+---------------------+
158-
| Order: | 6 |
159-
+----------------------+---------------------+
160-
| Step Size Control: | false |
161-
+----------------------+---------------------+
162-
| Order Control: | false |
163-
+----------------------+---------------------+
164-
| Stability Region: | \|(4,4) Padé \| ≤ 1 |
165-
+----------------------+---------------------+
166-
167-
Notes
168-
~~~~~
169-
170-
Simulation flags
171-
:ref:`maxStepSize <simflag-maxstepsize>` and
172-
:ref:`maxIntegrationOrder <simflag-maxintegrationorder>`
173-
specifiy maximum absolute step size and maximum integration order used by
174-
the dassl solver.
175-
176-
General step size without control :math:`\approx \cfrac{\mbox{stopTime} - \mbox{startTime}}{\mbox{numberOfIntervals}}`.
177-
Events change the step size (see `Modelica spec 3.3 p. 88 <https://www.modelica.org/documents/ModelicaSpec33.pdf>`__).
178-
179-
For (a,b) Padé see `wikipedia <http://en.wikipedia.org/wiki/Pad%C3%A9_table>`__.

UsersGuide/source/solving.rst

Lines changed: 121 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,121 @@
1+
.. _solving :
2+
3+
Solving Modelica Models
4+
=======================
5+
6+
.. TODO: Describe the Backend related modules.
7+
8+
.. _cruntime-integration-methods :
9+
10+
Integration Methods
11+
-------------------
12+
13+
By default OpenModelica transforms a Modelica model into an ODE
14+
representation to perform a simulation by using numerical integration
15+
methods. This section contains additional information about the different
16+
integration methods in OpenModelica. They can be selected by the method
17+
parameter of the :ref:`simulate` command or the :ref:`-s simflag <simflag-s>`.
18+
19+
The different methods are also called solver and can be distinguished by
20+
their characteristic:
21+
22+
- explicit vs. implicit
23+
- order
24+
- step size control
25+
- multi step
26+
27+
A good introduction on this topic may be found in :cite:`Cellier:2006`
28+
and a more mathematical approach can be found in :cite:`Hairer:1993`.
29+
30+
.. _dassl :
31+
32+
DASSL
33+
~~~~~
34+
35+
DASSL is the default solver in OpenModelica, because of a severals reasons.
36+
It is an implicit, higher order, multi-step solver with a step-size control
37+
and with these properties it is quite stable for a wide range of models.
38+
Furthermore it has a mature source code, which was originally developed
39+
in the eighties an initial description may be found in :cite:`PetzoldDASSL:1982`.
40+
41+
This solver is based on backward differentiation formula (BDF), which is
42+
a family of implicit methods for numerical integration. The used implementation
43+
is called DASPK2.0 (see [#f3]_) and it is translated automatically to C
44+
by f2c (see [#f4]_).
45+
46+
The following simulation flags can be used to adjust the behavior of the
47+
solver for specific simulation problems:
48+
:ref:`jacobian <simflag-jacobian>`,
49+
:ref:`noRootFinding <simflag-norootfinding>`,
50+
:ref:`noRestart <simflag-norestart>`,
51+
:ref:`initialStepSize <simflag-initialstepsize>`,
52+
:ref:`maxStepSize <simflag-maxstepsize>`,
53+
:ref:`maxIntegrationOrder <simflag-maxintegrationorder>`,
54+
:ref:`noEquidistantTimeGrid <simflag-noequidistanttimegrid>`.
55+
56+
IDA
57+
~~~
58+
59+
The IDA solver is part of a software family called sundials: SUite of
60+
Nonlinear and DIfferential/ALgebraic equation Solvers :cite:`Hindmarsh:2005`.
61+
The implementation is based on DASPK with an extended linear solver
62+
interface, which includes an interface to the high performance sparse
63+
linear solver KLU :cite:`Davis:2010`.
64+
65+
The simulation flags of :ref:`dassl` are also valid for the IDA
66+
solver and furthermore it has the following IDA specific flags:
67+
:ref:`idaLS <simflag-idaLS>`,
68+
:ref:`idaMaxNonLinIters <simflag-idaMaxNonLinIters>`,
69+
:ref:`idaMaxConvFails <simflag-idaMaxConvFails>`,
70+
:ref:`idaNonLinConvCoef <simflag-idaNonLinConvCoef>`,
71+
:ref:`idaMaxErrorTestFails <simflag-idaMaxErrorTestFails>`.
72+
73+
Basic Explicit Solvers
74+
~~~~~~~~~~~~~~~~~~~~~~
75+
76+
The basic explicit solvers are performing with a fixed step-size and
77+
differ only in the integration order. The step-size is based on the
78+
numberOfIntervals, the startTime and stopTime parameters in the
79+
:ref:`simulate` command:
80+
:math:`\mbox{stepSize} \approx \cfrac{\mbox{stopTime} - \mbox{startTime}}{\mbox{numberOfIntervals}}`
81+
82+
- euler - order 1
83+
- heun - order 2
84+
- rungekutta - order 4
85+
86+
Basic Implicit Solvers
87+
~~~~~~~~~~~~~~~~~~~~~~
88+
89+
The basic implicit solvers are all based on the non-linear solver KINSOL
90+
from the SUNDIALS suite. The underlining linear solver can be modified
91+
with the simflag :ref:`-impRKLS <simflag-imprkls>`. The step-size is
92+
determined as for the basic explicit solvers.
93+
94+
- impeuler - order 1
95+
- trapezoid - order 2
96+
- imprungekutta - Based on Radau IIA and Lobatto IIIA defined by its
97+
Butcher tableau where the order can be adjusted by :ref:`-impRKorder <simflag-imprkorder>`.
98+
99+
100+
Experimental Solvers
101+
~~~~~~~~~~~~~~~~~~~~
102+
103+
The following solvers are marked as experimental, mostly because they
104+
are till now not tested very well.
105+
106+
- rungekuttaSsc - Runge-Kutta based on Novikov (2016) - explicit, step-size control, order 4-5
107+
- irksco - Own developed Runge-Kutta solver - implicit, step-size control, order 1-2
108+
- symSolver - Symbolic inline solver (requires :ref:`--symSolver <omcflag-symSolver>`) - fixed step-size, order 1
109+
- symSolverSsc - Symbolic implicit inline Euler with step-size control (requires :ref:`--symSolver<omcflag-symSolver>`) - step-size control, order 1-2
110+
- qss - A QSS solver
111+
112+
References
113+
~~~~~~~~~~
114+
.. bibliography:: openmodelica.bib extrarefs.bib
115+
:cited:
116+
:filter: docname in docnames
117+
118+
.. rubric:: Footnotes
119+
.. [#f2] `Sundials Webpage <http://computation.llnl.gov/projects/sundials-suite-nonlinear-differential-algebraic-equation-solvers>`__
120+
.. [#f3] `DASPK Webpage <https://cse.cs.ucsb.edu/software>`__
121+
.. [#f4] 'Cdaskr source <https://github.com/wibraun/Cdaskr>`__

0 commit comments

Comments
 (0)