Solver
felice.solver
Classes
ClipSolver
Bases: Module
Source code in felice/solver.py
Functions
step(terms: PyTree[AbstractTerm], t0: RealScalarLike, t1: RealScalarLike, y0: Y, args: Args, solver_state: _SolverState, made_jump: BoolScalarLike) -> tuple[Y, Optional[Y], DenseInfo, _SolverState, RESULTS]
Make a single step of the solver.
Each step is made over the specified interval \([t_0, t_1]\).
Arguments:
terms: The PyTree of terms representing the vector fields and controls.t0: The start of the interval that the step is made over.t1: The end of the interval that the step is made over.y0: The current value of the solution att0.args: Any extra arguments passed to the vector field.solver_state: Any evolving state for the solver itself, att0.made_jump: Whether there was a discontinuity in the vector field att0. Some solvers (notably FSAL Runge--Kutta solvers) usually assume that there are no jumps and for efficiency re-use information between steps; this indicates that a jump has just occurred and this assumption is not true.
Returns:
A tuple of several objects:
- The value of the solution at
t1. - A local error estimate made during the step. (Used by adaptive step size
controllers to change the step size.) May be
Noneif no estimate was made. - Some dictionary of information that is passed to the solver's interpolation
routine to calculate dense output. (Used with
SaveAt(ts=...)orSaveAt(dense=...).) - The value of the solver state at
t1. - An integer (corresponding to
diffrax.RESULTS) indicating whether the step happened successfully, or if (unusually) it failed for some reason.