Skip to main content

Notice: this Wiki will be going read only early in 2024 and edits will no longer be possible. Please see: https://gitlab.eclipse.org/eclipsefdn/helpdesk/-/wikis/Wiki-shutdown-plan for the plan.

Jump to: navigation, search

Difference between revisions of "STEM Solvers"

Line 32: Line 32:
  
 
==== Dormand Prince 853 ====
 
==== Dormand Prince 853 ====
The Dormand Prince 853 solver also belongs to the Runge Kutta family of ordinary differential equation integrator and adapts the step size to ensure the error is kept within acceptable bounds. It is described in the Apache documentation (http://commons.apache.org/math/apidocs/org/apache/commons/math/ode/nonstiff/DormandPrince853Integrator.html) as well as in the original article
+
The Dormand Prince 853 solver also belongs to the Runge Kutta family of ordinary differential equation integrator and adapts the step size to ensure the error is kept within acceptable bounds. It is described in the Apache documentation (http://commons.apache.org/math/apidocs/org/apache/commons/math/ode/nonstiff/DormandPrince853Integrator.html) as well as in the original article:
  
A family of embedded Runge-Kutta formulae
+
<code>A family of embedded Runge-Kutta formulae
 
J. R. Dormand and P. J. Prince
 
J. R. Dormand and P. J. Prince
 
Journal of Computational and Applied Mathematics
 
Journal of Computational and Applied Mathematics
 
volume 6, no 1, 1980, pp. 19-26
 
volume 6, no 1, 1980, pp. 19-26
 +
</code>
  
 
Since the 1.4.1 release, this solver is able to take advantage of multi-core CPUs to increase performance.
 
Since the 1.4.1 release, this solver is able to take advantage of multi-core CPUs to increase performance.
  
 
==== Dormand Prince 54 ====
 
==== Dormand Prince 54 ====
Another solver from the Dormand Prince family, originally published
+
Another solver from the Dormand Prince family, originally described in:
 +
 
 +
<code>
 
A family of embedded Runge-Kutta formulae
 
A family of embedded Runge-Kutta formulae
 
J. R. Dormand and P. J. Prince
 
J. R. Dormand and P. J. Prince
 
Journal of Computational and Applied Mathematics
 
Journal of Computational and Applied Mathematics
 
volume 6, no 1, 1980, pp. 19-26
 
volume 6, no 1, 1980, pp. 19-26
 +
</code>
 +
This integrator is an embedded Runge-Kutta integrator of order 5(4) used in local extrapolation mode (i.e. the solution is computed using the high order formula) with step size control. This method uses 7 functions evaluations per step but since the last evaluation of a time step is the same as the first evaluation in the next time step, one evaluation can be avoided.
 +
  
  

Revision as of 17:29, 13 November 2012

STEM TOP BAR.gif

When you create a new scenario in STEM, you need to specify which solver to use. A solver is simply the method used to determine how the state of a simulation changes from one time step to the next. Models for populations and diseases in STEM are all designed to carry out this change or derivative calculation given a current state. How the derivative is applied to determine the next state is where solvers differ.

Available solvers

STEM Native Solvers

Finite Difference

The finite difference solver is the most straightforward (and fastest) solver available. It's using Euler's method and simply estimates the next value from the current value plus the derivative:

y(t+h) = y(t) +h*y'(t)

where h is the step size (default 1 day in STEM as defined by the sequencer). Label values in STEM are often constrained to a positive value. For instance, the count of a population can never go negative, and this is also true for any population assigned to a particular compartment state. When a constrained value goes negative, the finite difference solvers does a partial step to avoid this as illustrated in this figure:

FiniteDifferenceFigure.png

(the figure assumes h = 1). The next value is thus calculated as:

y(t+h) = y(t) + x*y'(t)+(1-x)*y'(t+x)

The algorithm finds the smallest x among all differential equations solved and rescales all label values accordingly. If necessary, multiple partial steps are carried out.

The finite difference solver is able to take advance of multi-core CPUs; each CPU is assigned a sub-set of the graph to work on.

Runge Kutta Cash-Karp

The Runge Kutta Cash-Karp solver is an adaptive step size ordinary differential equation integrator that calculates six function evaluations for each time step and estimates two solutions (of 4th and 5th order). The difference between the two solutions is the estimated error, and the solver can be calibrated to any desired degree of accuracy. If the error exceeds the tolerance the step size is reduced. The Runge Kutta Cash-Karp solver can take advantage of multi-core CPUs, and each CPU is assigned a sub-set of the graphs to work on. The algorithm perform "fine-grained" CPUs synchronization to establish the step size to use, ensuring that the same solution is reached no matter how many CPUs are running concurrently or whichever way the graph is split up among the CPU cores.

Apache Commons Math solver

These solvers are using the Apache Commons Math library and its classes for solving ordinary differential equations (http://commons.apache.org/math/, http://commons.apache.org/math/userguide/ode.html).

Dormand Prince 853

The Dormand Prince 853 solver also belongs to the Runge Kutta family of ordinary differential equation integrator and adapts the step size to ensure the error is kept within acceptable bounds. It is described in the Apache documentation (http://commons.apache.org/math/apidocs/org/apache/commons/math/ode/nonstiff/DormandPrince853Integrator.html) as well as in the original article:

A family of embedded Runge-Kutta formulae J. R. Dormand and P. J. Prince Journal of Computational and Applied Mathematics volume 6, no 1, 1980, pp. 19-26

Since the 1.4.1 release, this solver is able to take advantage of multi-core CPUs to increase performance.

Dormand Prince 54

Another solver from the Dormand Prince family, originally described in:

A family of embedded Runge-Kutta formulae J. R. Dormand and P. J. Prince Journal of Computational and Applied Mathematics volume 6, no 1, 1980, pp. 19-26 This integrator is an embedded Runge-Kutta integrator of order 5(4) used in local extrapolation mode (i.e. the solution is computed using the high order formula) with step size control. This method uses 7 functions evaluations per step but since the last evaluation of a time step is the same as the first evaluation in the next time step, one evaluation can be avoided.


Gregg Bulirsch Stoer

Highman Hall 54

Back to the top