Skip to content

otf.time_integration.linear_nonlinear

Linear–nonlinear time-integration schemes.

This module implements a set of time-integration schemes that split a system into a linear part (handled analytically or implicitly) and a nonlinear part handled explicitly. Implementations follow Cox & Matthews (2002) where applicable and include exponential time differencing (ETD) and several multistep predictor/corrector hybrids.

References

Cox, S. M. and Matthews, P. C. (2002). Exponential Time Differencing for Stiff Systems. Journal of Computational Physics, 176(2), 430-455. doi:10.1006/jcph.2002.6995

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).

AB2AM2

AB2AM2(
    system: BaseSystem,
    pre_multistep_solver: BaseSolver | None = None,
)

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
def __init__(
    self, system: BaseSystem, pre_multistep_solver: BaseSolver | None = None
):
    """Initialize a multistep solver.

    Parameters
    ----------
    system
        The system to integrate.
    pre_multistep_solver
        An instantiated `BaseSolver` used to generate initial history steps
        until enough values are available to run the multistep method. If
        `None`, callers must supply the necessary initial history when
        invoking `solve`/`solve_true`.
    """
    super().__init__(system)

    self._step_true, self._step_assimilated = self._step_factory()

    self._pre_multistep_solver = pre_multistep_solver

AB2BD2

AB2BD2(
    system: BaseSystem,
    pre_multistep_solver: BaseSolver | None = None,
)

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
def __init__(
    self, system: BaseSystem, pre_multistep_solver: BaseSolver | None = None
):
    """Initialize a multistep solver.

    Parameters
    ----------
    system
        The system to integrate.
    pre_multistep_solver
        An instantiated `BaseSolver` used to generate initial history steps
        until enough values are available to run the multistep method. If
        `None`, callers must supply the necessary initial history when
        invoking `solve`/`solve_true`.
    """
    super().__init__(system)

    self._step_true, self._step_assimilated = self._step_factory()

    self._pre_multistep_solver = pre_multistep_solver

ETD1

ETD1(system: BaseSystem)

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
def __init__(self, system: BaseSystem):
    """Create a single-step solver for `system`.

    Parameters
    ----------
    system
        The system to integrate. For `solve_true`, `system` should be a
        `System_ModelKnown` instance (checked by `solve_true`).
    """

    super().__init__(system)

    self._step_true, self._step_assimilated = self._step_factory()

ETD2

ETD2(
    system: BaseSystem,
    pre_multistep_solver: BaseSolver | None = None,
)

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
def __init__(
    self, system: BaseSystem, pre_multistep_solver: BaseSolver | None = None
):
    """Initialize a multistep solver.

    Parameters
    ----------
    system
        The system to integrate.
    pre_multistep_solver
        An instantiated `BaseSolver` used to generate initial history steps
        until enough values are available to run the multistep method. If
        `None`, callers must supply the necessary initial history when
        invoking `solve`/`solve_true`.
    """
    super().__init__(system)

    self._step_true, self._step_assimilated = self._step_factory()

    self._pre_multistep_solver = pre_multistep_solver