Skip to content
Open
Show file tree
Hide file tree
Changes from 2 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
1 change: 1 addition & 0 deletions edisgo/edisgo.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@
from edisgo.tools.geo import find_nearest_bus
from edisgo.tools.spatial_complexity_reduction import spatial_complexity_reduction
from edisgo.tools.tools import determine_grid_integration_voltage_level
from edisgo.io.db import engine as toep_engine

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

remove second import


if "READTHEDOCS" not in os.environ:
from shapely.geometry import Point
Expand Down
28 changes: 28 additions & 0 deletions edisgo/flex_opt/heat_pump_operation.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
import logging
import copy
import warnings

import pandas as pd

Expand Down Expand Up @@ -31,11 +33,37 @@ def operating_strategy(
if heat_pump_names is None:
heat_pump_names = edisgo_obj.heat_pump.cop_df.columns

# if heat_pump is not in topology -> exception
# heat_pumps_in_topology_check = heat_pump_names.isin(edisgo_obj.topology.loads_df.index)
# for x in range(len(heat_pump_names)):
# if not heat_pumps_in_topology_check[x]:
# warnings.warn(f"Warning: Heat pump {heat_pump_names[x]} has not been inserted into the grid topology.")
# heat_pump_names = heat_pump_names.drop[heat_pump_names[x]]

if strategy == "uncontrolled":
ts = (
edisgo_obj.heat_pump.heat_demand_df.loc[:, heat_pump_names]
/ edisgo_obj.heat_pump.cop_df.loc[:, heat_pump_names]
)

# clips heat pump load at maximum level
ts_prev = copy.deepcopy(ts)
for heat_pump_name in heat_pump_names:
ts[heat_pump_name] = [min(x,edisgo_obj.topology.loads_df.p_set[heat_pump_name]) for x in ts[heat_pump_name]]
if not ts[heat_pump_name].equals(ts_prev[heat_pump_name]):
warnings.warn(
# Extension possible: print heat pumps that were clipped
f"Warning: Heat pump active power at {edisgo_obj.topology.loads_df.bus[heat_pump_name]} was limited to its maximum."
f"Heat demand at bus {edisgo_obj.topology.loads_df.bus[heat_pump_name]} should be covered by additional heat sources."
)

if not ts.equals(ts_prev):
warnings.warn(
# Extension possible: print heat pumps that were clipped
"Warning: Heat pump active power was clipped at maximum level."
"Heat demand at bus should be covered by additional heat sources."
)

edisgo_obj.timeseries.add_component_time_series(
"loads_active_power",
ts,
Expand Down
1 change: 0 additions & 1 deletion edisgo/network/timeseries.py
Original file line number Diff line number Diff line change
Expand Up @@ -2120,7 +2120,6 @@ def add_component_time_series(self, df_name, ts_new):
:attr:`~.network.timeseries.TimeSeries.generators_active_power`.
ts_new : :pandas:`pandas.DataFrame<DataFrame>`
Dataframe with new time series to add to existing time series dataframe.

"""
# drop possibly already existing time series
self.drop_component_time_series(df_name, ts_new.columns)
Expand Down
2,492 changes: 2,368 additions & 124 deletions examples/edisgo_simple_example.ipynb

Large diffs are not rendered by default.

874 changes: 829 additions & 45 deletions examples/electromobility_example.ipynb

Large diffs are not rendered by default.