Battery

class building_energy_storage_simulation.Battery(capacity: float = 100, initial_state_of_charge: float = 0, max_battery_charge_per_timestep: float = 20)

The Battery class.

Parameters
  • capacity (float) – The capacity of the battery in kWh.

  • initial_state_of_charge (float) – The initial charging state of the battery in kWh.

  • max_battery_charge_per_timestep (float) – Maximum amount of energy (kWh) which can be obtained from the battery or which can be used to charge the battery in one time step.

reset()

Resetting the state_of_charge of the battery to the initial_state_of_charge.

use(amount: float)

Using means charging or discharging the battery.

Parameters

amount (float) – Amount of energy to be stored or retrieved from the battery in kWh. Note that the amount is set to the value of max_battery_charge_per_timestep if it exceeds it.

Returns

Amount of energy consumed to charge or amount of energy gained by discharging the battery in kWh.

Return type

float