From 7acaa605183145ccf126357d9a798a15ef418956 Mon Sep 17 00:00:00 2001 From: Martin Altenburger Date: Fri, 5 Dec 2025 12:02:59 +0100 Subject: [PATCH] Add the electricity load as a sink in the complex example --- examples/02_Complex/complex_example.py | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/examples/02_Complex/complex_example.py b/examples/02_Complex/complex_example.py index 2913f643f..333dd9089 100644 --- a/examples/02_Complex/complex_example.py +++ b/examples/02_Complex/complex_example.py @@ -156,6 +156,18 @@ ) ], ) + # 5.b) Electricity demand profile + electricity_load = fx.Sink( + 'electricity_load', + inputs=[ + fx.Flow( + 'P_el_Last', # Electricity load + bus='Strom', # Linked bus + size=1, + fixed_relative_profile=electricity_demand, # Fixed demand profile + ) + ], + ) # 5.b) Gas tariff Gasbezug = fx.Source( @@ -184,7 +196,7 @@ # --- Build FlowSystem --- # Select components to be included in the flow system - flow_system.add_elements(Costs, CO2, PE, Gaskessel, Waermelast, Gasbezug, Stromverkauf, speicher) + flow_system.add_elements(Costs, CO2, PE, Gaskessel, Waermelast, electricity_load, Gasbezug, Stromverkauf, speicher) flow_system.add_elements(bhkw_2) if use_chp_with_piecewise_conversion else flow_system.add_elements(bhkw) print(flow_system) # Get a string representation of the FlowSystem