//////////////////////////////////////////////////////////////////////////////
// Copyright (c) 2010, 2026 Contributors to the Eclipse Foundation
//
// See the NOTICE file(s) distributed with this work for additional
// information regarding copyright ownership.
//
// This program and the accompanying materials are made available
// under the terms of the MIT License which is available at
// https://opensource.org/licenses/MIT
//
// SPDX-License-Identifier: MIT
//////////////////////////////////////////////////////////////////////////////

include::../../_part_attributes.asciidoc[]

:leveloffset: -2

[[tools-cifsim-solver-chapter-options]]
== ODE solver integrator options

indexterm:[ODE,integrator options]
indexterm:[integrator options]
The <<tools-cifsim-solver-chapter-basics-int,integrator>> used by the ODE solver of the CIF simulator, can be configured using several options.

indexterm:[integrator options,algorithm]

[[tools-cifsim-solver-options-int-algo]]
=== Integration algorithm

The _ODE solver integrator algorithm_ option (_ODE solver: ODE integrator_ category) can be used to configure the integrator algorithm to use.
The following algorithms are available:

* Higham and Hall 5(4)

* link:https://en.wikipedia.org/wiki/Dormand-Prince[Dormand-Prince 5(4)]

* link:https://en.wikipedia.org/wiki/Dormand-Prince[Dormand-Prince 8(5,3)] (default)

* link:https://en.wikipedia.org/wiki/Bulirsch-Stoer_algorithm[Gragg-Bulirsch-Stoer]

* link:https://en.wikipedia.org/wiki/Adams_method[Adams-Bashforth] (experimental)

* link:https://en.wikipedia.org/wiki/Adams_method[Adams-Moulton] (experimental)

The algorithms differ in the complexity of the systems of ODEs that they can handle, their performance, the precision of their results, etc.
All these algorithms use an link:https://en.wikipedia.org/wiki/Adaptive_stepsize[adaptive step size].

indexterm:[integrator options,tolerances]

[[tools-cifsim-solver-options-int-tol]]
=== Absolute and relative tolerance

The _ODE solver integrator absolute tolerance_ option (_ODE solver: ODE integrator_ category) and the _ODE solver integrator relative tolerance_ option (_ODE solver: ODE integrator_ category), can be used to configure how precise the results of the integrator should be.
The lower the tolerance (or error), the higher the precision of the results, but also the more computing time it costs to get to that precision.
The absolute precision is the difference between the prediction and the actual value, while the relative precision is that same difference, as a fraction of the actual value.
In the latter case, precision reduces with increasing values.

indexterm:[integrator options,step sizes]

[[tools-cifsim-solver-options-int-step]]
=== Minimum and maximum step size

The interval between two consecutive time points calculated by the integrator can be configured using the _ODE solver integrator minimum step size_ option (_ODE solver: ODE integrator_ category) and the _ODE solver integrator maximum step size_ option (_ODE solver: ODE integrator_ category).

The default minimum step size is `1e-15` and the default maximum step size is `0.5`.
Note however that the last step can be smaller than the value specified for the minimum step size option.

indexterm:[performance,integrator step sizes]
Increasing the maximum default step size may lead to better performance, but can also lead to less precision, and <<tools-cifsim-solver-chapter-root-problems,root finding problems>>.

indexterm:[integrator options,number of steps]

[[tools-cifsim-solver-options-int-numstep]]
=== Number of steps

The _ODE solver integrator number of steps_ option (_ODE solver: ODE integrator_ category) can be used to configure the number of steps to use for the experimental link:https://en.wikipedia.org/wiki/Adams_method[Adams-Bashforth] and link:https://en.wikipedia.org/wiki/Adams_method[Adams-Moulton] integrators.
The number of steps must be greater or equal to two.
