cideMOD.numerics.triggers
Classes
|
An event that fires a change in the cell input. |
Exceptions
Exception indicating that the solver has crashed due to non-convergence or NaN values |
|
|
|
|
- exception cideMOD.numerics.triggers.SolverCrashed[source]
Bases:
ExceptionException 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:
objectAn 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']
- 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.
- 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'}}