pymgrid.modules.battery.transition_models.BatteryTransitionModel#

class pymgrid.modules.battery.transition_models.BatteryTransitionModel[source]#

A simple battery transition model.

In this model, the amount of energy retained is given by efficiency.

For example, if a microgrid requests 100 kWh of energy and efficiency=0.5, the battery must use 200 kWh of energy. Alternatively, if a microgrid sends a battery 100 kWh of energy and efficiency=0.5, the battery’s charge will increase by 50 kWh.

Parameters#

external_energy_changefloat

Amount of energy that is being requested externally. If energy > 0, it is energy that is absorbed by the battery – a charge. If energy < 0, it is energy provided by the battery: a discharge.

min_capacityfloat

Minimum energy that must be contained in the battery.

max_capacityfloat

Maximum energy that can be contained in the battery. If soc=1, capacity is at this maximum.

max_chargefloat

Maximum amount the battery can be charged in one step.

max_dischargefloat

Maximum amount the battery can be discharged in one step.

efficiencyfloat

Efficiency of the battery.

battery_cost_cyclefloat

Marginal cost of charging and discharging.

state_dictdict

State dictionary, with state of charge and current capacity information.

Returns#

internal_energyfloat

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

Methods

from_yaml(loader, node)

Convert a representation node to a Python object.

new_kwargs()

to_yaml(dumper, data)

Convert a Python object to a representation node.

transition(external_energy_change, ...)

Attributes

yaml_tag