Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@ results_dataframe = results.to_dataframe()

**4. Plot the resulting timeseries:**

The resulting timeseries (storage charging / discharging, state of charge, solar generation, grid usage, ...) can be easily plotted:
The resulting timeseries (storage charging / discharging, state of charge, PV generation, grid usage, ...) can be easily plotted:

```python
results = psa.optimize()
Expand Down
10 changes: 5 additions & 5 deletions docker_configs/dashboard-definitions/PSA.json
Original file line number Diff line number Diff line change
Expand Up @@ -300,7 +300,7 @@
"editorMode": "code",
"format": "table",
"rawQuery": true,
"rawSql": "SELECT\n timestamp,\n grid_usage_kw AS \"Grid\",\n storage_discharge_kw AS \"Storage discharge\",\n solar_generation_kw AS \"Solar generation\",\n consumption_kw AS \"Load\"\nFROM output.timeseries WHERE name = '$opti_name'",
"rawSql": "SELECT\n timestamp,\n grid_usage_kw AS \"Grid\",\n storage_discharge_kw AS \"Storage discharge\",\n pv_generation_kw AS \"pv generation\",\n consumption_kw AS \"Load\"\nFROM output.timeseries WHERE name = '$opti_name'",
"refId": "A",
"sql": {
"columns": [
Expand Down Expand Up @@ -392,7 +392,7 @@
"options": {
"mode": "exclude",
"names": [
"Solar generation"
"pv generation"
],
"prefix": "All except:",
"readOnly": true
Expand Down Expand Up @@ -437,7 +437,7 @@
"editorMode": "code",
"format": "table",
"rawQuery": true,
"rawSql": "SELECT\n timestamp,\n solar_generation_kw AS \"Solar generation\"\nFROM output.timeseries WHERE name = '$opti_name'",
"rawSql": "SELECT\n timestamp,\n pv_generation_kw AS \"pv generation\"\nFROM output.timeseries WHERE name = '$opti_name'",
"refId": "A",
"sql": {
"columns": [
Expand Down Expand Up @@ -826,7 +826,7 @@
"editorMode": "code",
"format": "table",
"rawQuery": true,
"rawSql": "SELECT \n solar_invest_eur AS \"Solar investment\"\nFROM output.overview\nWHERE name = '$opti_name'",
"rawSql": "SELECT \n pv_invest_eur AS \"pv investment\"\nFROM output.overview\nWHERE name = '$opti_name'",
"refId": "A",
"sql": {
"columns": [
Expand Down Expand Up @@ -911,7 +911,7 @@
"editorMode": "code",
"format": "table",
"rawQuery": true,
"rawSql": "SELECT \n solar_capacity_kwp AS \"PV system size\"\nFROM output.overview\nWHERE name = '$opti_name'",
"rawSql": "SELECT \n pv_capacity_kwp AS \"PV system size\"\nFROM output.overview\nWHERE name = '$opti_name'",
"refId": "A",
"sql": {
"columns": [
Expand Down
91 changes: 49 additions & 42 deletions examples/storage_hourly_fixed_price/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ name: storage_hourly_fixed_price # name of the optimization
hours_per_timestep: 1 # 1 hour timesteps

add_storage: True # wether to add storage to optimization or not
add_solar: False # wether to add pv system to optimization or not
allow_additional_pv: False # wether to add pv system to optimization or not

auto_opt: False # Wether to automatically start optizmization or not
solver: "gurobi"
Expand All @@ -26,42 +26,15 @@ consumption_value_column: consumption # name of the column
price_file_path: # file path where prices are stored as .csv
price_value_column: # name of the column where prices are provided

postal_code: # postal code for automtic solar generation calculation, leave empty for own timeseries
# if not provided, solar generation will be calculated with the following parameters
# value column needs to contain values from 0 (no solar generation) to 1 (max solar generation)
solar_file_path: # file path where solar generation is stored as .csv
solar_value_column: # name of the column where solar generation is provided

#######################
# economic parameters #
#######################
overwrite_price_timeseries: True # Wether to overwrite price timeseries or not
producer_energy_price: 0.15 # €/kWh # energy price if sourced from supplier
# value for 2024 taken from:
# https://www.bdew.de/service/daten-und-grafiken/bdew-strompreisanalyse/
# https://de.statista.com/statistik/daten/studie/252029/umfrage/industriestrompreise-inkl-stromsteuer-in-deutschland/

grid_capacity_price: 130 # capacity price in euro to be paid yearly
grid_energy_price: 0.0460 # energy price in euro per kwh to be paid per kwh source from grid
# mean updated with historical inflation of cumulative 26.24% from:
# https://zenodo.org/records/13734730

pv_system_lifetime: 30 # pv system lifetime in years
# taken from:
# https://www.mdpi.com/1996-1073/14/14/4278

pv_system_cost_per_kwp: 1250 # pv system cost in euro per kWpeak
# taken from:
# https://www.ise.fraunhofer.de/de/veroeffentlichungen/studien/studie-stromgestehungskosten-erneuerbare-energien.html

inverter_lifetime: 15 # storage inverter lifetime in years
# taken from:
# 10.4229/WCPEC-82022-3DV.1.46 Bucher Joss

inverter_cost_per_kw: 180 # storage inverter cost in euro per kw
# taken from:
# https://www.sciencedirect.com/science/article/pii/S1876610216310736
postal_code: # postal code for automtic pv generation calculation, leave empty for own timeseries
# if not provided, pv generation will be calculated with the following parameters
# value column needs to contain values from 0 (no pv generation) to 1 (max pv generation)
new_pv_file_path: # file path where pv generation is stored as .csv
new_pv_value_column: # name of the column where pv generation is provided

################################
# storage (battery) parameters #
################################
storage_lifetime: 15 # storage lifetime in years
# taken from:
# "Energiespeicher - Bedarf, Technologien, Integration", Stadler Sterner 2017
Expand All @@ -70,13 +43,7 @@ storage_cost_per_kwh: 145 # storage capacity cost in euro per kwh capacity
# taken from:
# https://www.pem.rwth-aachen.de/cms/pem/der-lehrstuhl/presse-medien/aktuelle-meldungen/~bexlow/battery-monitor-2023-nachfrage-waechst/

interest_rate: 3 # interes rate in %

########################
# technical parameters #
########################
max_storage_size_kwh: # maximum available storage size in kWh (leave empty for infinite size)
max_pv_system_size_kwp: # maximum available pv system size in kWpeak (leave empty for infinite size)

storage_charge_efficiency: 0.9 # efficiency for charging storage
storage_discharge_efficiency: 0.9 # efficiency for discharging storage
Expand All @@ -89,8 +56,48 @@ storage_discharge_rate: 1 #
# taken from:
# https://www.sciencedirect.com/science/article/pii/S2590116819300116

#################################
# storage (inverter) parameters #
#################################
inverter_efficiency: 0.95 # efficiency of the storage inverter
# taken from:
# https://www.sciencedirect.com/science/article/pii/S1364032116306712

inverter_lifetime: 15 # storage inverter lifetime in years
# taken from:
# 10.4229/WCPEC-82022-3DV.1.46 Bucher Joss

inverter_cost_per_kw: 180 # storage inverter cost in euro per kw
# taken from:
# https://www.sciencedirect.com/science/article/pii/S1876610216310736


########################
# PV system parameters #
########################
pv_system_lifetime: 30 # pv system lifetime in years
# taken from:
# https://www.mdpi.com/1996-1073/14/14/4278

pv_system_cost_per_kwp: 1250 # pv system cost in euro per kWpeak
# taken from:
# https://www.ise.fraunhofer.de/de/veroeffentlichungen/studien/studie-stromgestehungskosten-erneuerbare-energien.html

pv_system_kwp_per_m2: 0.4 # energy obtainable per area in kWpeak per m²
max_pv_system_size_kwp: # maximum available pv system size in kWpeak (leave empty for infinite size)

#######################
# economic parameters #
#######################
overwrite_price_timeseries: True # Wether to overwrite price timeseries or not
producer_energy_price: 0.15 # €/kWh # energy price if sourced from supplier
# value for 2024 taken from:
# https://www.bdew.de/service/daten-und-grafiken/bdew-strompreisanalyse/
# https://de.statista.com/statistik/daten/studie/252029/umfrage/industriestrompreise-inkl-stromsteuer-in-deutschland/

grid_capacity_price: 130 # capacity price in euro to be paid yearly
grid_energy_price: 0.0460 # energy price in euro per kwh to be paid per kwh source from grid
# mean updated with historical inflation of cumulative 26.24% from:
# https://zenodo.org/records/13734730

interest_rate: 3 # interes rate in %
5 changes: 5 additions & 0 deletions examples/storage_hourly_fixed_price/main.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
import logging

from peakshaving_analyzer import PeakShavingAnalyzer, load_yaml_config

if __name__ == "__main__":
logging.basicConfig(level=logging.INFO)

config = load_yaml_config("./examples/storage_hourly_fixed_price/config.yml")
psa = PeakShavingAnalyzer(config=config)
results = psa.optimize()
results.print()
94 changes: 50 additions & 44 deletions examples/storage_only_quarterhourly_fixed_price/config.yml
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
optimization_parameters:
name: storage_only_quarterhourly_fixed_price # name of the optimization

hours_per_timestep: 0.25 # 1 hour timesteps
hours_per_timestep: 0.25 # quarter hour timesteps

add_storage: True # wether to add storage to optimization or not
add_solar: False # wether to add pv system to optimization or not
allow_additional_pv: False # wether to add pv system to optimization or not

auto_opt: False # Wether to automatically start optizmization or not
solver: "gurobi"
Expand All @@ -24,42 +23,15 @@ consumption_value_column: consumption # name of the column
price_file_path: # file path where prices are stored as .csv
price_value_column: # name of the column where prices are provided

postal_code: # postal code for automtic solar generation calculation, leave empty for own timeseries
# if not provided, solar generation will be calculated with the following parameters
# value column needs to contain values from 0 (no solar generation) to 1 (max solar generation)
solar_file_path: # file path where solar generation is stored as .csv
solar_value_column: # name of the column where solar generation is provided

#######################
# economic parameters #
#######################
overwrite_price_timeseries: True # Wether to overwrite price timeseries or not
producer_energy_price: 0.15 # €/kWh # energy price if sourced from supplier
# value for 2024 taken from:
# https://www.bdew.de/service/daten-und-grafiken/bdew-strompreisanalyse/
# https://de.statista.com/statistik/daten/studie/252029/umfrage/industriestrompreise-inkl-stromsteuer-in-deutschland/

grid_capacity_price: 130 # capacity price in euro to be paid yearly
grid_energy_price: 0.0460 # energy price in euro per kwh to be paid per kwh source from grid
# mean updated with historical inflation of cumulative 26.24% from:
# https://zenodo.org/records/13734730

pv_system_lifetime: 30 # pv system lifetime in years
# taken from:
# https://www.mdpi.com/1996-1073/14/14/4278

pv_system_cost_per_kwp: 1250 # pv system cost in euro per kWpeak
# taken from:
# https://www.ise.fraunhofer.de/de/veroeffentlichungen/studien/studie-stromgestehungskosten-erneuerbare-energien.html

inverter_lifetime: 15 # storage inverter lifetime in years
# taken from:
# 10.4229/WCPEC-82022-3DV.1.46 Bucher Joss

inverter_cost_per_kw: 180 # storage inverter cost in euro per kw
# taken from:
# https://www.sciencedirect.com/science/article/pii/S1876610216310736
postal_code: # postal code for automtic pv generation calculation, leave empty for own timeseries
# if not provided, pv generation will be calculated with the following parameters
# value column needs to contain values from 0 (no pv generation) to 1 (max pv generation)
new_pv_file_path: # file path where pv generation is stored as .csv
new_pv_value_column: # name of the column where pv generation is provided

################################
# storage (battery) parameters #
################################
storage_lifetime: 15 # storage lifetime in years
# taken from:
# "Energiespeicher - Bedarf, Technologien, Integration", Stadler Sterner 2017
Expand All @@ -68,13 +40,7 @@ storage_cost_per_kwh: 145 # storage capacity cost in euro per kwh capacity
# taken from:
# https://www.pem.rwth-aachen.de/cms/pem/der-lehrstuhl/presse-medien/aktuelle-meldungen/~bexlow/battery-monitor-2023-nachfrage-waechst/

interest_rate: 3 # interes rate in %

########################
# technical parameters #
########################
max_storage_size_kwh: # maximum available storage size in kWh (leave empty for infinite size)
max_pv_system_size_kwp: # maximum available pv system size in kWpeak (leave empty for infinite size)

storage_charge_efficiency: 0.9 # efficiency for charging storage
storage_discharge_efficiency: 0.9 # efficiency for discharging storage
Expand All @@ -87,8 +53,48 @@ storage_discharge_rate: 1 #
# taken from:
# https://www.sciencedirect.com/science/article/pii/S2590116819300116

#################################
# storage (inverter) parameters #
#################################
inverter_efficiency: 0.95 # efficiency of the storage inverter
# taken from:
# https://www.sciencedirect.com/science/article/pii/S1364032116306712

inverter_lifetime: 15 # storage inverter lifetime in years
# taken from:
# 10.4229/WCPEC-82022-3DV.1.46 Bucher Joss

inverter_cost_per_kw: 180 # storage inverter cost in euro per kw
# taken from:
# https://www.sciencedirect.com/science/article/pii/S1876610216310736


########################
# PV system parameters #
########################
pv_system_lifetime: 30 # pv system lifetime in years
# taken from:
# https://www.mdpi.com/1996-1073/14/14/4278

pv_system_cost_per_kwp: 1250 # pv system cost in euro per kWpeak
# taken from:
# https://www.ise.fraunhofer.de/de/veroeffentlichungen/studien/studie-stromgestehungskosten-erneuerbare-energien.html

pv_system_kwp_per_m2: 0.4 # energy obtainable per area in kWpeak per m²
max_pv_system_size_kwp: # maximum available pv system size in kWpeak (leave empty for infinite size)

#######################
# economic parameters #
#######################
overwrite_price_timeseries: True # Wether to overwrite price timeseries or not
producer_energy_price: 0.15 # €/kWh # energy price if sourced from supplier
# value for 2024 taken from:
# https://www.bdew.de/service/daten-und-grafiken/bdew-strompreisanalyse/
# https://de.statista.com/statistik/daten/studie/252029/umfrage/industriestrompreise-inkl-stromsteuer-in-deutschland/

grid_capacity_price: 130 # capacity price in euro to be paid yearly
grid_energy_price: 0.0460 # energy price in euro per kwh to be paid per kwh source from grid
# mean updated with historical inflation of cumulative 26.24% from:
# https://zenodo.org/records/13734730

interest_rate: 3 # interes rate in %
5 changes: 5 additions & 0 deletions examples/storage_only_quarterhourly_fixed_price/main.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
import logging

from peakshaving_analyzer import PeakShavingAnalyzer, load_yaml_config

if __name__ == "__main__":
logging.basicConfig(level=logging.INFO)

config = load_yaml_config("./examples/storage_only_quarterhourly_fixed_price/config.yml")
psa = PeakShavingAnalyzer(config=config)
results = psa.optimize()
results.print()
Loading