otf.time_integration
Public solver implementations and convenience exports for time integration.
This package exposes a small set of concrete time-integration algorithms used by
otf including single-step, multistep, multistage methods and a
scipy.integrate.solve_ivp adapter. Import the classes below for common
integration workflows.
Modules:
| Name | Description |
|---|---|
base |
Abstract base classes to simulate |
linear_nonlinear |
Linear–nonlinear time-integration schemes. |
solver |
Explicit and wrapped ODE solvers for time integration. |
Classes:
| Name | Description |
|---|---|
AB2AM2 |
Adams–Bashforth 2 predictor with Adams–Moulton 2 corrector (AB2-AM2). |
AB2BD2 |
Adams–Bashforth 2 predictor combined with a BDF/Backward-Differentiation |
ETD1 |
First-order exponential time-differencing (ETD1) single-step solver. |
ETD2 |
Second-order exponential time-differencing multistep solver (ETD2). |
ForwardEuler |
Forward Euler solver. |
FourStepAdamsBashforth |
Four-step Adams–Bashforth explicit multistep integrator. |
RK4 |
4th-order Runge–Kutta solver. |
SolveIvp |
|
TwoStepAdamsBashforth |
Two-step explicit Adams–Bashforth multistep integrator. |
AB2AM2
Bases: MultistepSolver
Adams–Bashforth 2 predictor with Adams–Moulton 2 corrector (AB2-AM2).
A two-step predictor/corrector hybrid that treats the linear part implicitly (AM2 corrector) and the nonlinear part explicitly (AB2 predictor).
Source code in src/otf/time_integration/base.py
AB2BD2
Bases: MultistepSolver
Adams–Bashforth 2 predictor combined with a BDF/Backward-Differentiation style second-order corrector (AB2-BD2).
A two-step hybrid that uses an explicit AB2 prediction and a stabilized second-order corrector for stiff linear components.
Source code in src/otf/time_integration/base.py
ETD1
Bases: SinglestepSolver
First-order exponential time-differencing (ETD1) single-step solver.
Uses an analytic integration of the linear part and a first-order update for the nonlinear contribution. Suitable for problems where the linear operator can be diagonalized/represented elementwise.
Source code in src/otf/time_integration/base.py
ETD2
Bases: MultistepSolver
Second-order exponential time-differencing multistep solver (ETD2).
A two-step ETD method that combines exact linear evolution with a second-order treatment of nonlinear terms.
Source code in src/otf/time_integration/base.py
ForwardEuler
Bases: SinglestepSolver
Forward Euler solver.
See documentation of SinglestepSolver.
Source code in src/otf/time_integration/base.py
FourStepAdamsBashforth
Bases: MultistepSolver
Four-step Adams–Bashforth explicit multistep integrator.
Requires a pre_multistep_solver to generate the first three steps when
beginning integration, or callers must supply the initial history of
four states. pre_multistep_solver may be passed as None in which case
the caller is responsible for providing the required initial history when
invoking solve/solve_true.
Initialize the four-step Adams–Bashforth solver.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
system
|
BaseSystem
|
The system to integrate. |
required |
pre_multistep_solver
|
BaseSolver | None
|
Optional solver used to produce initial steps until four history
values are available. If |
None
|
Source code in src/otf/time_integration/solver.py
RK4
Bases: MultistageSolver
4th-order Runge–Kutta solver.
See documentation of base_solver.SinglestepSolver.
See https://en.wikipedia.org/wiki/Runge%E2%80%93Kutta_methods
Source code in src/otf/time_integration/base.py
SolveIvp
Bases: MultistageSolver
scipy.integrate.solve_ivp wrapper matching the solver interface.
This adapter lets users employ SciPy's solve_ivp while keeping the same
external solve/solve_true signatures used across other solvers in this
package. Note that integration is performed in NumPy/SciPy (not JAX).
Initialize the SolveIvp adapter.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
system
|
BaseSystem
|
An instance of |
required |
options
|
dict
|
Optional keyword arguments that are passed directly to
|
dict()
|
Notes
Integration is performed by SciPy (NumPy), not JAX. The options
dictionary may be modified after initialization.
Source code in src/otf/time_integration/solver.py
TwoStepAdamsBashforth
Bases: MultistepSolver
Two-step explicit Adams–Bashforth multistep integrator.
This class implements the classical two-step Adams–Bashforth method for
explicit integration of the nonlinear terms. A pre_multistep_solver may
be provided to generate initial steps when starting the integration. If
pre_multistep_solver is None, callers must supply the required two
initial history states when invoking solve/solve_true.
Initialize the two-step Adams–Bashforth solver.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
system
|
BaseSystem
|
The system to integrate. |
required |
pre_multistep_solver
|
BaseSolver | None
|
Optional solver used to produce initial steps until two history
values are available. If |
None
|