- class pybamm.Event(name, expression, event_type=EventType.TERMINATION)[source]#
Defines an event for use within a pybamm model
An expression that defines when the event occurs.
An enum defining the type of event. By default it is set to TERMINATION.
- evaluate(t=None, y=None, y_dot=None, inputs=None)[source]#
Acts as a drop-in replacement for
- class pybamm.EventType(value)[source]#
Defines the type of event, see
TERMINATION indicates an event that will terminate the solver, the expression should return 0 when the event is triggered
DISCONTINUITY indicates an expected discontinuity in the solution, the expression should return the time that the discontinuity occurs. The solver will integrate up to the discontinuity and then restart just after the discontinuity.
INTERPOLANT_EXTRAPOLATION indicates that a pybamm.Interpolant object has been evaluated outside of the range.
SWITCH indicates an event switch that is used in CasADI “fast with events” model.