A flexible YAML-based language for defining battery cycling experiments.
global
key.
temperature
: The ambient temperature for the experiment in Celsius. Defaults to 25
.initial_soc
: The initial State of Charge in percent (e.g., 100
).initial_voltage
: The initial voltage for the experiment.resolution
: The time resolution for the simulation output in seconds. Defaults to 60
.initial_soc
and initial_voltage
are mutually exclusive. If neither is
provided, initial_soc
defaults to 100%.safety_limit
, the safety limit takes precedence.Rest
: The cell is at rest.Charge
: The cell is being charged.Discharge
: The cell is being discharged.Drive
: A drive cycle step (see below).EIS
: An Electrochemical Impedance Spectroscopy step (see below).mode
: The control mode for the step (e.g., C-rate
, Current
, Power
, Voltage
). Required unless the step is Rest
.value
: The setpoint for the control mode. This can be a fixed number or a dynamic expression.duration
: The maximum duration of the step in seconds.ends
: A list of one or more cut-off conditions. A step must have either a duration
or at least one ends
condition.temperature
: (Optional) The ambient temperature for this specific step in Celsius, overriding the global setting.resolution
: (Optional) The time resolution for this specific step, overriding the global setting.set_variable
: (Optional) A list of variables to calculate and set after the step completes.note
: (Optional) A string for informational purposes.ends
)ends
conditions define when a step should terminate.
Voltage
, Current
, C-rate
, Capacity
, Temperature
(case-insensitive).<
and >
.Current
, C-rate
, and Capacity
terminations, always provide a positive value. The engine automatically handles the internal sign convention (e.g., negative current for charge). For Voltage
and Temperature
, signs are respected as written."d/dt(Type) operator value"
.goto
transitions on that termination condition will not be executed.EIS
step performs an Electrochemical Impedance Spectroscopy measurement at the current state of the cell.
lower_frequency
: The lower frequency bound for the EIS sweep in Hz.upper_frequency
: The upper frequency bound for the EIS sweep in Hz.goto
.
"Increment cycle number"
: Increments the internal cycle counter."End"
or "Pause"
: Terminates the entire simulation.set_variable
and use them to create dynamic, responsive protocols.
name
: The name of the variable. Must start with VAR_
.eval
: A Python expression to be evaluated. The result must be a number.eval
expression can use:
input['...']
VAR_
variable already defined.t
(step-relative time in seconds).Voltage
, Current
, etc. from the previous step.first()
, last()
, mean()
, abs()
, ifelse()
, etc.ifelse
helper to create conditional logic. This example defines a subsequent step’s direction based on the final voltage of the previous step.
goto
targets and for repeating a sequence of steps using the repeat
keyword.
Charge
,
Discharge
, Rest
, Control
, etc.).solve_protocol
function in your Python code and referencing it in the YAML.
drive_cycles
dictionary where values are 2-column NumPy arrays (time, value).Drive
direction. The value
is the name of the drive cycle from the dictionary. The duration is defined by the time column in the data.subroutines
dictionary to solve_protocol
. The values are lists of steps.Subroutine
step type with the name of the subroutine to execute.set_variable
.