Simulator (moirae.simulator)#

Utility for running physics models for large numbers of steps

class moirae.simulator.Simulator(cell_model: ~moirae.models.base.CellModel, asoh: ~moirae.models.base.HealthVariable, transient_state: ~moirae.models.base.GeneralContainer, initial_input: ~moirae.models.base.InputQuantities, degradation_model: ~moirae.models.base.DegradationModel = <moirae.models.utils.NoDegradation object>, keep_history: bool = False)#

Bases: object

Run a CellModel and track results

The current states of a batch of systems are stored as attributes of the class, such as transient for the transient states. The history of the states and outputs are stored as lists, such as transient_history, if keep_history is True.

Parameters:
  • cell_model – Model used to simulate the battery system

  • asoh – Advanced State of Health (A-SOH) of the system. Used to parametrize the dynamics of the system.

  • transient_state – Initial transient state of the system

  • initial_input – Initial input of the ECM

  • degradation_model – Degradation model to be used for degrading the A-SOH; defaults to no degradation

  • keep_history – Whether to keep history of the system.

asoh: HealthVariable#

Health variables for each of the cells being simulated

evolve(inputs: List[InputQuantities]) List[OutputQuantities]#

Evolves the simulator given a list of inputs.

Args

inputs: List of ECMInput objects

Returns

measurements: List of corresponding ECMMeasurements

input_history: List[InputQuantities] | None#

History of inputs into the system

measurement: OutputQuantities#

Last measurement from the system

measurement_history: List[OutputQuantities] | None#

History of the outputs from the system

previous_input: InputQuantities#

Last inputs to the system

step(new_inputs: InputQuantities) Tuple[GeneralContainer, OutputQuantities]#

Function to step the transient state of the system.

Parameters:

new_inputs – New ECM input to the system

Returns:

Tuple of the new transient state and corresponding measurement

to_batdata(extra_columns: bool = False) List[BatteryDataset]#

Compile the cycling history as a Battery Data Toolkit dataset.

Parameters:

extra_columns – Whether to return columns whose names are not yet in the schema

Returns:

A battery dataset for each batch of the data

to_dataframe() DataFrame#

Compile the history of the simulator as a Pandas dataframe

Returns:

Dataframe with the columns ordered by inputs, states, and outputs

transient_history: List[GeneralContainer] | None#

History of observed transient states