Previous topic

Base Battery Model

Next topic

Lithium-ion Models

This Page

Event

class pybamm.Event(name, expression, event_type=<EventType.TERMINATION: 0>)[source]

Defines an event for use within a pybamm model

name

A string giving the name of the event

Type:str
event_type

An enum defining the type of event

Type:pybamm.EventType
expression

An expression that defines when the event occurs

Type:pybamm.Symbol
evaluate(t=None, y=None, y_dot=None, inputs=None, known_evals=None)[source]

Acts as a drop-in replacement for pybamm.Symbol.evaluate()

class pybamm.EventType[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.