Simulation¶
- class building_energy_storage_simulation.Simulation(electricity_load_profile_file_name: str = 'electricity_load_profile.csv', solar_generation_profile_file_name: str = 'solar_generation_profile.csv', battery_capacity: float = 100, solar_power_installed: float = 240, max_battery_charge_per_timestep: float = 20)¶
Simulation which wires the building, electricity load and solar generation profile together.
- Parameters
electricity_load_profile_file_name (str) – Path to csv file containing electric load profile.
solar_generation_profile_file_name (str) – Path to csv file containing solar energy generation profile. Note that the profile is in W per kWp of solar power installed. The actual solar generetion is determined by multiplication with the solar_power_installed
solar_power_installed (float) – The installed peak photovoltaic power in kWp.
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()¶
Resetting the state of the building by calling reset() method from the building class.
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(amount: float) float¶
- Performs one simulation step by:
Charging or discharging the battery depending on the amount.
Calculating the amount of energy consumed by the building in this time step.
Trimming the amount of energy to 0, in case it is negative.
Calculating the amount of excess energy which is considered lost.
Increasing the step counter.
- Parameters
amount (float) – Amount of energy to be stored or retrieved from the battery. In kWh.
- Returns
- Tuple of:
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, that energy can not be “gained”. 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 ;-)
Amount of excess energy which is considered lost.
- Return type
(float, float)