cideMOD.numerics.triggers

Classes

Trigger(value, variable[, atol, rtol, ...])

An event that fires a change in the cell input.

Exceptions

SolverCrashed

Exception indicating that the solver has crashed due to non-convergence or NaN values

TriggerDetected(trigger)

TriggerSurpassed(time_slope, trigger)

exception cideMOD.numerics.triggers.SolverCrashed[source]

Bases: Exception

Exception indicating that the solver has crashed due to non-convergence or NaN values

class cideMOD.numerics.triggers.Trigger(value, variable: str, atol=None, rtol=None, action='Next', mode=None)[source]

Bases: object

An event that fires a change in the cell input. It is evaluated during cell cycling at each timestep.

Parameters:
  • value (Union[float, int]) – Value that fires the trigger.

  • variable (str) – Variable of the state of the cell to compare. To know the available ones type Trigger.print_available_variables.

  • atol (float, optional) – Absolute tolerance for the trigger to fire. Default to 1e-3.

  • rtol (float, optional) – Relative tolerance for the trigger to fire. Default to 1e-3.

  • action (str, optional) – Event to trigger. Default to ‘Next’.

  • mode (str, optional) – Can be ‘min’, ‘max’ or None to specify total triggers or relative to current state. Default to None.

available_variables: list = ['time', 't', 'voltage', 'v', 'current', 'i']
check(state)[source]
classmethod print_available_variables()[source]
classmethod register_variable(name, label, units, need_abs=False, atol=1e-06)[source]

Register a new trigger variable.

Parameters:
  • name (str) – Name of the variable

  • label (str) – Label of the variable. It is used as an alias.

  • units (str) – Units of the trigger variable.

  • need_abs (bool) – Whether or not to check the absolute value of the trigger variable. Default to False.

reset()[source]
start_record(state)[source]
variables: dict = {'current': {'abs': True, 'atol': 1e-06, 'label': 'i', 'units': 'A'}, 'time': {'abs': False, 'atol': 1e-06, 'label': 't', 'units': 's'}, 'voltage': {'abs': False, 'atol': 0.0001, 'label': 'v', 'units': 'V'}}
exception cideMOD.numerics.triggers.TriggerDetected(trigger)[source]

Bases: Exception

action()[source]
exception cideMOD.numerics.triggers.TriggerSurpassed(time_slope, trigger)[source]

Bases: Exception

new_tstep(old_tstep)[source]