DiscreteCallback¶
- class probnum.diffeq.callbacks.DiscreteCallback(replace, condition)¶
Bases:
ODESolverCallback
Handle discrete events in an ODE solver.
A discrete event can be any event for which it is possible to write down a condition that evaluates to True or False. If a condition evaluates to True, the current state can be modified/replaced.
Methods Summary
__call__
(state)Modify a state whenever a condition dictates doing so.
Methods Documentation
- Parameters
replace (Callable[[probnum.diffeq.ODESolverState], probnum.diffeq.ODESolverState]) –
condition (Callable[[probnum.diffeq.ODESolverState], bool]) –
- __call__(state)[source]¶
Modify a state whenever a condition dictates doing so.
- Parameters
state (ODESolverState) –
- Return type