Base Experiment Class#

class pybamm.Experiment(operating_conditions: list[str], period: str = '1 minute', temperature: float | None = None, termination: list[str] | None = None, drive_cycles=None, cccv_handling=None)[source]#

Base class for experimental conditions under which to run the model. In general, a list of operating conditions should be passed in. Each operating condition should be either a pybamm.step._Step class, created using one of the methods pybamm.step.current, pybamm.step.c_rate, pybamm.step.voltage , pybamm.step.power, pybamm.step.resistance, or pybamm.step.string, or a string, in which case the string is passed to pybamm.step.string.

Parameters:
  • operating_conditions (list[str]) – List of strings representing the operating conditions.

  • period (string, optional) – Period (1/frequency) at which to record outputs. Default is 1 minute. Can be overwritten by individual operating conditions.

  • temperature (float, optional) – The ambient air temperature in degrees Celsius at which to run the experiment. Default is None whereby the ambient temperature is taken from the parameter set. This value is overwritten if the temperature is specified in a step.

  • termination (list[str], optional) – List of strings representing the conditions to terminate the experiment. Default is None. This is different from the termination for individual steps. Termination for individual steps is specified in the step itself, and the simulation moves to the next step when the termination condition is met (e.g. 2.5V discharge cut-off). Termination for the experiment as a whole is specified here, and the simulation stops when the termination condition is met (e.g. 80% capacity).

read_termination(termination)[source]#

Read the termination reason. If this condition is hit, the experiment will stop.

search_tag(tag)[source]#

Search for a tag in the experiment and return the cycles in which it appears.

Parameters:

tag (str) – The tag to search for

Returns:

A list of cycles in which the tag appears

Return type:

list