BatteryModule.model_transition#

BatteryModule.model_transition(energy)[source]#

Convert an external energy request to a change in internal energy.

This function uses the class argument battery_transition_model if one was passed.

battery_transition_model must use the following api:

internal_energy_change = battery_transition_model(
    external_energy_change,
    min_capacity,
    max_capacity,
    max_charge,
    max_discharge,
    efficiency,
    battery_cost_cycle,
    current_step,
    state_dict
)

The return value internal_energy_change must be a float. See transition_kwargs() and battery_transition_model() for details on these parameters; all parameters are passed as keyword arguments.

Parameters#

energyfloat

External energy change.

Returns#

internal_energyfloat

Amount of energy that the battery must use or will retain given the external amount of energy.