Event#
- class pybamm.Event(name, expression, event_type=EventType.TERMINATION)[source]#
Defines an event for use within a pybamm model
- expression#
An expression that defines when the event occurs.
- Type:
- event_type#
An enum defining the type of event. By default it is set to TERMINATION.
- Type:
pybamm.EventType
(optional)
- class pybamm.EventType(value, names=<not given>, *values, module=None, qualname=None, type=None, start=1, boundary=None)[source]#
Defines the type of event, see
pybamm.Event
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.
Extends:
enum.Enum