Events allow for interrupting a differential equation solve, and changing its internal state, or terminating the solve before
t1 is reached.
At the moment a single kind of event is supported: discrete events which are checked at the end of every step, and which halt the integration once they become true.
Evaluated at the end of each integration step. If true then the solve is stopped at that time.
__call__(self, state, **kwargs)
state: a dataclass of the evolving state of the system, including in particular the solution
**kwargs: the integration options held constant throughout the solve are passed as keyword arguments:
A boolean. If true then the solve is terminated.
Terminates the solve if its condition is ever active.
__init__(self, cond_fn: Callable[..., bool])
cond_fn: A function
(state, **kwargs) -> boolthat is evaluated on every step of the differential equation solve. If it returns
Truethen the solve is finished at that timestep.
stateis a dataclass of the evolving state of the system, including in particular the solution
state.tprev. Passed as keyword arguments are the
argsetc. that are constant throughout the solve.
Terminates the solve once it reaches a steady state.
__init__(self, rtol: Optional[float] = None, atol: Optional[float] = None, norm: Callable[[PyTree], Scalar] = <function rms_norm>)
rtol: The relative tolerance for determining convergence. Defaults to the same
rtolas passed to an adaptive step controller if one is used.
atol: The absolute tolerance for determining convergence. Defaults to the same
atolas passed to an adaptive step controller if one is used.
norm: A function
PyTree -> Scalar, which is called to determine whether the vector field is close to zero.