BuildingSimulation

class building_energy_storage_simulation.BuildingSimulation(electricity_load_profile: ~typing.Iterable = 0        9.89 1        9.08 2        8.22 3        8.57 4        8.93         ...   8755     9.37 8756    10.13 8757    10.17 8758     9.51 8759     9.48 Name: Load [kWh], Length: 8760, dtype: float64, solar_generation_profile: ~typing.Iterable = 0       0.0 1       0.0 2       0.0 3       0.0 4       0.0        ...  8755    0.0 8756    0.0 8757    0.0 8758    0.0 8759    0.0 Name: Generation [kWh], Length: 8760, dtype: float64, electricity_price: ~typing.Union[~typing.Iterable, float] = 0       5.005 1       4.133 2       4.322 3       4.546 4       3.767         ...   8755   -0.101 8756   -0.139 8757   -0.104 8758   -0.107 8759   -0.068 Name: Day Ahead Auction, Length: 8760, dtype: float64, battery_capacity: float = 100, max_battery_charge_per_timestep: float = 20)

Represents the simulation of the building and wires the data profiles and the usage of the battery together.

Parameters:
  • electricity_load_profile (Iterable) – Load profile in kWh per time step.

  • solar_generation_profile (Iterable) – Generation profile in kWh per time step.

  • electricity_price (Iterable or float) – Electricity price in € cent per kWh.

  • battery_capacity (float) – The capacity 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()
  1. Resetting the state of the building by calling reset() method from the battery class.

  2. Resetting the step_count to 0. The step_count is used for temporal orientation in the electricity load and solar generation profile.

simulate_one_step(action: float) Tuple[float, float]
Performs one simulation step by:
  1. Charging or discharging the battery depending on the amount.

  2. Calculating the amount of energy consumed by the building in this time step.

  3. Trimming the amount of energy to 0, in case it is negative.

  4. Increasing the step counter.

Parameters:

action (float) – Fraction of energy to be stored or retrieved from the battery. The action lies in [-1;1]. The action represents the fraction of max_battery_charge_per_timestep which should be used to charge or discharge the battery. 1 represents the maximum possible amount of energy which can be used to charge the battery per time step.

Returns:

Tuple of:
  1. Amount of energy consumed in this time step. This is calculated by: battery_energy + electricity_load - solar_generation. Note that negative values are trimmed to 0. This means, no energy can be fed into the grid. Excess energy from the solar energy system which is not used to charge the battery is considered lost. Better use it to charge the battery ;-)

  2. Electricity price in € cent per kWh.

Return type:

(float, float)