Water Values for Long-Duration Storage Operation¶
This example demonstrates how the concept of water values (known from hydroelectric power plants, aka future cost function) can be used to capture seasonal behaviour of long-duration storage in a rolling horizon optimisation with limited operational foresight. Applying the concept of water values helps internalise the future value of stored energy beyond the optimisation horizon when making short-term operational decisions.
import logging
import matplotlib.pyplot as plt
import pandas as pd
import pypsa
pypsa.options.params.optimize.solver_name = "gurobi"
logging.getLogger("gurobipy").setLevel(logging.ERROR)
logging.getLogger("linopy").setLevel(logging.ERROR)
For this example, we consider a simple energy system with a single bus and 3-hourly time steps over one year (8760 hours in 2920 3-hour blocks). We have time-varying load, wind and solar generation at zero marginal cost, a gas generator with marginal cost function $C'(g) = 80 + 0.01 g$ €/MWh, and hydrogen storage consisting of electrolysis, turbine, and a non-cyclic storage tank with a set initial energy. All components have fixed capacities; investments are not optimised here.
n = pypsa.examples.model_energy()
n.remove("Generator", "load shedding")
n.remove("StorageUnit", "battery storage")
n.generators.loc[["solar", "wind"], "p_nom"] = 30_000, 20_000
n.generators.p_nom_extendable = False
n.links.loc[["electrolysis", "turbine"], "p_nom"] = 10_000, 20_000
n.links.p_nom_extendable = False
n.stores.loc["hydrogen storage", ["e_nom", "e_initial"]] = 2_000_000, 500_000
n.stores.e_nom_extendable = False
n.stores.e_cyclic = False
n.add("Carrier", "gas", color="darkorange")
n.add(
"Generator",
"gas",
bus="electricity",
p_nom=40_000,
marginal_cost=80,
marginal_cost_quadratic=0.01,
carrier="gas",
)
INFO:pypsa.network.io:Imported network 'Model-Energy' has buses, carriers, generators, links, loads, storage_units, stores
Case 1: Perfect Foresight¶
Let's first solve the problem with perfect foresight over the whole year to obtain a benchmark solution that captures the optimal seasonal operation of the hydrogen storage.
n.optimize(assign_all_duals=True, log_to_console=False)
/tmp/ipykernel_8625/2699410999.py:1: FutureWarning: The default value of `include_objective_constant` will change from True to False in version 2.0. Set `include_objective_constant` explicitly to suppress this warning. Using False improves LP numerical conditioning by not including the objective constant as a variable. n.optimize(assign_all_duals=True, log_to_console=False)
Writing constraints.: 0%| | 0/8 [00:00<?, ?it/s]
Writing constraints.: 100%|██████████| 8/8 [00:00<00:00, 156.76it/s]
Writing continuous variables.: 0%| | 0/4 [00:00<?, ?it/s]
Writing continuous variables.: 100%|██████████| 4/4 [00:00<00:00, 306.00it/s]
Set parameter WLSAccessID
Set parameter WLSSecret
Set parameter LicenseID to value 2537914
Academic license 2537914 - for non-commercial use only - registered to l.___@tu-berlin.de
Read LP format model from file /tmp/linopy-problem-lbj1cdx9.lp
Reading time = 0.04 seconds
obj: 43800 rows, 20440 columns, 67159 nonzeros
Set parameter LogToConsole to value 0
Warning: environment still referenced so free is deferred (Continue to use WLS)
('ok', 'optimal')
Here, we get following fuel costs (in M€/a):
obj = n.statistics.opex(components="Generator").sum() / 1e6
obj
np.float64(1160.08127876753)
Electricity prices tend to be slightly higher in the winter months.
n.buses_t.marginal_price["electricity"].resample("D").mean().plot(
figsize=(6, 2), ylabel="€/MWh", xlabel=""
);
pdc = (
n.buses_t.marginal_price["electricity"]
.sort_values(ascending=False)
.reset_index(drop=True)
)
pdc.plot(figsize=(5, 3), ylabel="€/MWh", xlabel="snapshots", xlim=(0, 8760 / 3));
The price at the hydrogen bus reflects the marginal storage value (MSV) of hydrogen. The MSV indicates the willingness to pay for an additional unit of hydrogen stored at that time and, thereby, reflects its future value. This is the equivalent of water values in hydro storage.
msv = n.buses_t.marginal_price["hydrogen"]
msv.plot(figsize=(6, 2), ylim=(0, 100), ylabel="€/MWh", xlabel="");
As in this case with perfect foresight, the model foresees future scarcity periods in electricity supply, the storage is operated seasonally, retaining high storage levels over the summer to cover scarcity periods in winter.
soc = n.stores_t.e.div(1e3).squeeze()
soc.plot(figsize=(6, 2), ylabel="GWh", xlabel="", legend=False);
Case 2: Myopic Foresight¶
Now, we solve the same dispatch problem, but with myopic foresight of 15 days (120 snapshots at 3-hourly resolution). This means that at each optimisation step, the model only considers the next 15 days when making operational decisions, without knowledge of future periods beyond this horizon.
n.model.solver_model = None
n2 = n.copy()
n2.optimize.optimize_with_rolling_horizon(
assign_all_duals=True,
horizon=120,
overlap=0,
log_to_console=False,
)
INFO:pypsa.optimization.abstract:Optimizing network for snapshot horizon [2019-01-01 00:00:00:2019-01-15 21:00:00] (1/25).
/home/docs/checkouts/readthedocs.org/user_builds/pypsa/checkouts/latest/pypsa/optimization/abstract.py:545: FutureWarning: The default value of `include_objective_constant` will change from True to False in version 2.0. Set `include_objective_constant` explicitly to suppress this warning. Using False improves LP numerical conditioning by not including the objective constant as a variable. status, condition = n.optimize(sns, **kwargs)
Set parameter WLSAccessID
Set parameter WLSSecret
Set parameter LicenseID to value 2537914
Academic license 2537914 - for non-commercial use only - registered to l.___@tu-berlin.de
Read LP format model from file /tmp/linopy-problem-iu9vdnwz.lp
Reading time = 0.00 seconds
obj: 1800 rows, 840 columns, 2759 nonzeros
Set parameter LogToConsole to value 0
Warning: environment still referenced so free is deferred (Continue to use WLS)
INFO:pypsa.optimization.abstract:Optimizing network for snapshot horizon [2019-01-16 00:00:00:2019-01-30 21:00:00] (2/25).
/home/docs/checkouts/readthedocs.org/user_builds/pypsa/checkouts/latest/pypsa/optimization/abstract.py:545: FutureWarning: The default value of `include_objective_constant` will change from True to False in version 2.0. Set `include_objective_constant` explicitly to suppress this warning. Using False improves LP numerical conditioning by not including the objective constant as a variable. status, condition = n.optimize(sns, **kwargs)
Set parameter WLSAccessID
Set parameter WLSSecret
Set parameter LicenseID to value 2537914
Academic license 2537914 - for non-commercial use only - registered to l.___@tu-berlin.de
Read LP format model from file /tmp/linopy-problem-my0r_hr8.lp
Reading time = 0.00 seconds
obj: 1800 rows, 840 columns, 2759 nonzeros
Set parameter LogToConsole to value 0
Warning: environment still referenced so free is deferred (Continue to use WLS)
INFO:pypsa.optimization.abstract:Optimizing network for snapshot horizon [2019-01-31 00:00:00:2019-02-14 21:00:00] (3/25).
/home/docs/checkouts/readthedocs.org/user_builds/pypsa/checkouts/latest/pypsa/optimization/abstract.py:545: FutureWarning: The default value of `include_objective_constant` will change from True to False in version 2.0. Set `include_objective_constant` explicitly to suppress this warning. Using False improves LP numerical conditioning by not including the objective constant as a variable. status, condition = n.optimize(sns, **kwargs)
Set parameter WLSAccessID
Set parameter WLSSecret
Set parameter LicenseID to value 2537914
Academic license 2537914 - for non-commercial use only - registered to l.___@tu-berlin.de
Read LP format model from file /tmp/linopy-problem-tm7wcqwo.lp
Reading time = 0.00 seconds
obj: 1800 rows, 840 columns, 2759 nonzeros
Set parameter LogToConsole to value 0
Warning: environment still referenced so free is deferred (Continue to use WLS)
INFO:pypsa.optimization.abstract:Optimizing network for snapshot horizon [2019-02-15 00:00:00:2019-03-01 21:00:00] (4/25).
/home/docs/checkouts/readthedocs.org/user_builds/pypsa/checkouts/latest/pypsa/optimization/abstract.py:545: FutureWarning: The default value of `include_objective_constant` will change from True to False in version 2.0. Set `include_objective_constant` explicitly to suppress this warning. Using False improves LP numerical conditioning by not including the objective constant as a variable. status, condition = n.optimize(sns, **kwargs)
Set parameter WLSAccessID
Set parameter WLSSecret
Set parameter LicenseID to value 2537914
Academic license 2537914 - for non-commercial use only - registered to l.___@tu-berlin.de
Read LP format model from file /tmp/linopy-problem-3w0nggwc.lp
Reading time = 0.00 seconds
obj: 1800 rows, 840 columns, 2759 nonzeros
Set parameter LogToConsole to value 0
Warning: environment still referenced so free is deferred (Continue to use WLS)
INFO:pypsa.optimization.abstract:Optimizing network for snapshot horizon [2019-03-02 00:00:00:2019-03-16 21:00:00] (5/25).
/home/docs/checkouts/readthedocs.org/user_builds/pypsa/checkouts/latest/pypsa/optimization/abstract.py:545: FutureWarning: The default value of `include_objective_constant` will change from True to False in version 2.0. Set `include_objective_constant` explicitly to suppress this warning. Using False improves LP numerical conditioning by not including the objective constant as a variable. status, condition = n.optimize(sns, **kwargs)
Set parameter WLSAccessID
Set parameter WLSSecret
Set parameter LicenseID to value 2537914
Academic license 2537914 - for non-commercial use only - registered to l.___@tu-berlin.de
Read LP format model from file /tmp/linopy-problem-ofkp2oi_.lp
Reading time = 0.00 seconds
obj: 1800 rows, 840 columns, 2759 nonzeros
Set parameter LogToConsole to value 0
Warning: environment still referenced so free is deferred (Continue to use WLS)
INFO:pypsa.optimization.abstract:Optimizing network for snapshot horizon [2019-03-17 00:00:00:2019-03-31 21:00:00] (6/25).
/home/docs/checkouts/readthedocs.org/user_builds/pypsa/checkouts/latest/pypsa/optimization/abstract.py:545: FutureWarning: The default value of `include_objective_constant` will change from True to False in version 2.0. Set `include_objective_constant` explicitly to suppress this warning. Using False improves LP numerical conditioning by not including the objective constant as a variable. status, condition = n.optimize(sns, **kwargs)
Set parameter WLSAccessID
Set parameter WLSSecret
Set parameter LicenseID to value 2537914
Academic license 2537914 - for non-commercial use only - registered to l.___@tu-berlin.de
Read LP format model from file /tmp/linopy-problem-pa4pgonp.lp
Reading time = 0.00 seconds
obj: 1800 rows, 840 columns, 2759 nonzeros
Set parameter LogToConsole to value 0
Warning: environment still referenced so free is deferred (Continue to use WLS)
INFO:pypsa.optimization.abstract:Optimizing network for snapshot horizon [2019-04-01 00:00:00:2019-04-15 21:00:00] (7/25).
/home/docs/checkouts/readthedocs.org/user_builds/pypsa/checkouts/latest/pypsa/optimization/abstract.py:545: FutureWarning: The default value of `include_objective_constant` will change from True to False in version 2.0. Set `include_objective_constant` explicitly to suppress this warning. Using False improves LP numerical conditioning by not including the objective constant as a variable. status, condition = n.optimize(sns, **kwargs)
Set parameter WLSAccessID
Set parameter WLSSecret
Set parameter LicenseID to value 2537914
Academic license 2537914 - for non-commercial use only - registered to l.___@tu-berlin.de
Read LP format model from file /tmp/linopy-problem-4hsq627m.lp
Reading time = 0.00 seconds
obj: 1800 rows, 840 columns, 2759 nonzeros
Set parameter LogToConsole to value 0
Warning: environment still referenced so free is deferred (Continue to use WLS)
INFO:pypsa.optimization.abstract:Optimizing network for snapshot horizon [2019-04-16 00:00:00:2019-04-30 21:00:00] (8/25).
/home/docs/checkouts/readthedocs.org/user_builds/pypsa/checkouts/latest/pypsa/optimization/abstract.py:545: FutureWarning: The default value of `include_objective_constant` will change from True to False in version 2.0. Set `include_objective_constant` explicitly to suppress this warning. Using False improves LP numerical conditioning by not including the objective constant as a variable. status, condition = n.optimize(sns, **kwargs)
Set parameter WLSAccessID
Set parameter WLSSecret
Set parameter LicenseID to value 2537914
Academic license 2537914 - for non-commercial use only - registered to l.___@tu-berlin.de
Read LP format model from file /tmp/linopy-problem-wziadk5e.lp
Reading time = 0.00 seconds
obj: 1800 rows, 840 columns, 2759 nonzeros
Set parameter LogToConsole to value 0
Warning: environment still referenced so free is deferred (Continue to use WLS)
INFO:pypsa.optimization.abstract:Optimizing network for snapshot horizon [2019-05-01 00:00:00:2019-05-15 21:00:00] (9/25).
/home/docs/checkouts/readthedocs.org/user_builds/pypsa/checkouts/latest/pypsa/optimization/abstract.py:545: FutureWarning: The default value of `include_objective_constant` will change from True to False in version 2.0. Set `include_objective_constant` explicitly to suppress this warning. Using False improves LP numerical conditioning by not including the objective constant as a variable. status, condition = n.optimize(sns, **kwargs)
Set parameter WLSAccessID
Set parameter WLSSecret
Set parameter LicenseID to value 2537914
Academic license 2537914 - for non-commercial use only - registered to l.___@tu-berlin.de
Read LP format model from file /tmp/linopy-problem-nutaznv2.lp
Reading time = 0.00 seconds
obj: 1800 rows, 840 columns, 2759 nonzeros
Set parameter LogToConsole to value 0
Warning: environment still referenced so free is deferred (Continue to use WLS)
INFO:pypsa.optimization.abstract:Optimizing network for snapshot horizon [2019-05-16 00:00:00:2019-05-30 21:00:00] (10/25).
/home/docs/checkouts/readthedocs.org/user_builds/pypsa/checkouts/latest/pypsa/optimization/abstract.py:545: FutureWarning: The default value of `include_objective_constant` will change from True to False in version 2.0. Set `include_objective_constant` explicitly to suppress this warning. Using False improves LP numerical conditioning by not including the objective constant as a variable. status, condition = n.optimize(sns, **kwargs)
Set parameter WLSAccessID
Set parameter WLSSecret
Set parameter LicenseID to value 2537914
Academic license 2537914 - for non-commercial use only - registered to l.___@tu-berlin.de
Read LP format model from file /tmp/linopy-problem-x81qx4w4.lp
Reading time = 0.00 seconds
obj: 1800 rows, 840 columns, 2759 nonzeros
Set parameter LogToConsole to value 0
Warning: environment still referenced so free is deferred (Continue to use WLS)
INFO:pypsa.optimization.abstract:Optimizing network for snapshot horizon [2019-05-31 00:00:00:2019-06-14 21:00:00] (11/25).
/home/docs/checkouts/readthedocs.org/user_builds/pypsa/checkouts/latest/pypsa/optimization/abstract.py:545: FutureWarning: The default value of `include_objective_constant` will change from True to False in version 2.0. Set `include_objective_constant` explicitly to suppress this warning. Using False improves LP numerical conditioning by not including the objective constant as a variable. status, condition = n.optimize(sns, **kwargs)
Set parameter WLSAccessID
Set parameter WLSSecret
Set parameter LicenseID to value 2537914
Academic license 2537914 - for non-commercial use only - registered to l.___@tu-berlin.de
Read LP format model from file /tmp/linopy-problem-xwb4qotw.lp
Reading time = 0.00 seconds
obj: 1800 rows, 840 columns, 2759 nonzeros
Set parameter LogToConsole to value 0
Warning: environment still referenced so free is deferred (Continue to use WLS)
INFO:pypsa.optimization.abstract:Optimizing network for snapshot horizon [2019-06-15 00:00:00:2019-06-29 21:00:00] (12/25).
/home/docs/checkouts/readthedocs.org/user_builds/pypsa/checkouts/latest/pypsa/optimization/abstract.py:545: FutureWarning: The default value of `include_objective_constant` will change from True to False in version 2.0. Set `include_objective_constant` explicitly to suppress this warning. Using False improves LP numerical conditioning by not including the objective constant as a variable. status, condition = n.optimize(sns, **kwargs)
Set parameter WLSAccessID
Set parameter WLSSecret
Set parameter LicenseID to value 2537914
Academic license 2537914 - for non-commercial use only - registered to l.___@tu-berlin.de
Read LP format model from file /tmp/linopy-problem-e2ujbc3_.lp
Reading time = 0.00 seconds
obj: 1800 rows, 840 columns, 2759 nonzeros
Set parameter LogToConsole to value 0
Warning: environment still referenced so free is deferred (Continue to use WLS)
INFO:pypsa.optimization.abstract:Optimizing network for snapshot horizon [2019-06-30 00:00:00:2019-07-14 21:00:00] (13/25).
/home/docs/checkouts/readthedocs.org/user_builds/pypsa/checkouts/latest/pypsa/optimization/abstract.py:545: FutureWarning: The default value of `include_objective_constant` will change from True to False in version 2.0. Set `include_objective_constant` explicitly to suppress this warning. Using False improves LP numerical conditioning by not including the objective constant as a variable. status, condition = n.optimize(sns, **kwargs)
Set parameter WLSAccessID
Set parameter WLSSecret
Set parameter LicenseID to value 2537914
Academic license 2537914 - for non-commercial use only - registered to l.___@tu-berlin.de
Read LP format model from file /tmp/linopy-problem-l0wul_1j.lp
Reading time = 0.00 seconds
obj: 1800 rows, 840 columns, 2759 nonzeros
Set parameter LogToConsole to value 0
Warning: environment still referenced so free is deferred (Continue to use WLS)
INFO:pypsa.optimization.abstract:Optimizing network for snapshot horizon [2019-07-15 00:00:00:2019-07-29 21:00:00] (14/25).
/home/docs/checkouts/readthedocs.org/user_builds/pypsa/checkouts/latest/pypsa/optimization/abstract.py:545: FutureWarning: The default value of `include_objective_constant` will change from True to False in version 2.0. Set `include_objective_constant` explicitly to suppress this warning. Using False improves LP numerical conditioning by not including the objective constant as a variable. status, condition = n.optimize(sns, **kwargs)
Set parameter WLSAccessID
Set parameter WLSSecret
Set parameter LicenseID to value 2537914
Academic license 2537914 - for non-commercial use only - registered to l.___@tu-berlin.de
Read LP format model from file /tmp/linopy-problem-2j0hmyqu.lp
Reading time = 0.00 seconds
obj: 1800 rows, 840 columns, 2759 nonzeros
Set parameter LogToConsole to value 0
Warning: environment still referenced so free is deferred (Continue to use WLS)
INFO:pypsa.optimization.abstract:Optimizing network for snapshot horizon [2019-07-30 00:00:00:2019-08-13 21:00:00] (15/25).
/home/docs/checkouts/readthedocs.org/user_builds/pypsa/checkouts/latest/pypsa/optimization/abstract.py:545: FutureWarning: The default value of `include_objective_constant` will change from True to False in version 2.0. Set `include_objective_constant` explicitly to suppress this warning. Using False improves LP numerical conditioning by not including the objective constant as a variable. status, condition = n.optimize(sns, **kwargs)
Set parameter WLSAccessID
Set parameter WLSSecret
Set parameter LicenseID to value 2537914
Academic license 2537914 - for non-commercial use only - registered to l.___@tu-berlin.de
Read LP format model from file /tmp/linopy-problem-1fzu7jud.lp
Reading time = 0.00 seconds
obj: 1800 rows, 840 columns, 2759 nonzeros
Set parameter LogToConsole to value 0
Warning: environment still referenced so free is deferred (Continue to use WLS)
INFO:pypsa.optimization.abstract:Optimizing network for snapshot horizon [2019-08-14 00:00:00:2019-08-28 21:00:00] (16/25).
/home/docs/checkouts/readthedocs.org/user_builds/pypsa/checkouts/latest/pypsa/optimization/abstract.py:545: FutureWarning: The default value of `include_objective_constant` will change from True to False in version 2.0. Set `include_objective_constant` explicitly to suppress this warning. Using False improves LP numerical conditioning by not including the objective constant as a variable. status, condition = n.optimize(sns, **kwargs)
Set parameter WLSAccessID
Set parameter WLSSecret
Set parameter LicenseID to value 2537914
Academic license 2537914 - for non-commercial use only - registered to l.___@tu-berlin.de
Read LP format model from file /tmp/linopy-problem-w9hr5owh.lp
Reading time = 0.00 seconds
obj: 1800 rows, 840 columns, 2759 nonzeros
Set parameter LogToConsole to value 0
Warning: environment still referenced so free is deferred (Continue to use WLS)
INFO:pypsa.optimization.abstract:Optimizing network for snapshot horizon [2019-08-29 00:00:00:2019-09-12 21:00:00] (17/25).
/home/docs/checkouts/readthedocs.org/user_builds/pypsa/checkouts/latest/pypsa/optimization/abstract.py:545: FutureWarning: The default value of `include_objective_constant` will change from True to False in version 2.0. Set `include_objective_constant` explicitly to suppress this warning. Using False improves LP numerical conditioning by not including the objective constant as a variable. status, condition = n.optimize(sns, **kwargs)
Set parameter WLSAccessID
Set parameter WLSSecret
Set parameter LicenseID to value 2537914
Academic license 2537914 - for non-commercial use only - registered to l.___@tu-berlin.de
Read LP format model from file /tmp/linopy-problem-vhuczyck.lp
Reading time = 0.00 seconds
obj: 1800 rows, 840 columns, 2759 nonzeros
Set parameter LogToConsole to value 0
Warning: environment still referenced so free is deferred (Continue to use WLS)
INFO:pypsa.optimization.abstract:Optimizing network for snapshot horizon [2019-09-13 00:00:00:2019-09-27 21:00:00] (18/25).
/home/docs/checkouts/readthedocs.org/user_builds/pypsa/checkouts/latest/pypsa/optimization/abstract.py:545: FutureWarning: The default value of `include_objective_constant` will change from True to False in version 2.0. Set `include_objective_constant` explicitly to suppress this warning. Using False improves LP numerical conditioning by not including the objective constant as a variable. status, condition = n.optimize(sns, **kwargs)
Set parameter WLSAccessID
Set parameter WLSSecret
Set parameter LicenseID to value 2537914
Academic license 2537914 - for non-commercial use only - registered to l.___@tu-berlin.de
Read LP format model from file /tmp/linopy-problem-3yjn0uze.lp
Reading time = 0.00 seconds
obj: 1800 rows, 840 columns, 2759 nonzeros
Set parameter LogToConsole to value 0
Warning: environment still referenced so free is deferred (Continue to use WLS)
INFO:pypsa.optimization.abstract:Optimizing network for snapshot horizon [2019-09-28 00:00:00:2019-10-12 21:00:00] (19/25).
/home/docs/checkouts/readthedocs.org/user_builds/pypsa/checkouts/latest/pypsa/optimization/abstract.py:545: FutureWarning: The default value of `include_objective_constant` will change from True to False in version 2.0. Set `include_objective_constant` explicitly to suppress this warning. Using False improves LP numerical conditioning by not including the objective constant as a variable. status, condition = n.optimize(sns, **kwargs)
Set parameter WLSAccessID
Set parameter WLSSecret
Set parameter LicenseID to value 2537914
Academic license 2537914 - for non-commercial use only - registered to l.___@tu-berlin.de
Read LP format model from file /tmp/linopy-problem-nlito_ti.lp
Reading time = 0.00 seconds
obj: 1800 rows, 840 columns, 2759 nonzeros
Set parameter LogToConsole to value 0
Warning: environment still referenced so free is deferred (Continue to use WLS)
INFO:pypsa.optimization.abstract:Optimizing network for snapshot horizon [2019-10-13 00:00:00:2019-10-27 21:00:00] (20/25).
/home/docs/checkouts/readthedocs.org/user_builds/pypsa/checkouts/latest/pypsa/optimization/abstract.py:545: FutureWarning: The default value of `include_objective_constant` will change from True to False in version 2.0. Set `include_objective_constant` explicitly to suppress this warning. Using False improves LP numerical conditioning by not including the objective constant as a variable. status, condition = n.optimize(sns, **kwargs)
Set parameter WLSAccessID
Set parameter WLSSecret
Set parameter LicenseID to value 2537914
Academic license 2537914 - for non-commercial use only - registered to l.___@tu-berlin.de
Read LP format model from file /tmp/linopy-problem-gpkuvq5r.lp
Reading time = 0.00 seconds
obj: 1800 rows, 840 columns, 2759 nonzeros
Set parameter LogToConsole to value 0
Warning: environment still referenced so free is deferred (Continue to use WLS)
INFO:pypsa.optimization.abstract:Optimizing network for snapshot horizon [2019-10-28 00:00:00:2019-11-11 21:00:00] (21/25).
/home/docs/checkouts/readthedocs.org/user_builds/pypsa/checkouts/latest/pypsa/optimization/abstract.py:545: FutureWarning: The default value of `include_objective_constant` will change from True to False in version 2.0. Set `include_objective_constant` explicitly to suppress this warning. Using False improves LP numerical conditioning by not including the objective constant as a variable. status, condition = n.optimize(sns, **kwargs)
Set parameter WLSAccessID
Set parameter WLSSecret
Set parameter LicenseID to value 2537914
Academic license 2537914 - for non-commercial use only - registered to l.___@tu-berlin.de
Read LP format model from file /tmp/linopy-problem-697eo1e7.lp
Reading time = 0.00 seconds
obj: 1800 rows, 840 columns, 2759 nonzeros
Set parameter LogToConsole to value 0
Warning: environment still referenced so free is deferred (Continue to use WLS)
INFO:pypsa.optimization.abstract:Optimizing network for snapshot horizon [2019-11-12 00:00:00:2019-11-26 21:00:00] (22/25).
/home/docs/checkouts/readthedocs.org/user_builds/pypsa/checkouts/latest/pypsa/optimization/abstract.py:545: FutureWarning: The default value of `include_objective_constant` will change from True to False in version 2.0. Set `include_objective_constant` explicitly to suppress this warning. Using False improves LP numerical conditioning by not including the objective constant as a variable. status, condition = n.optimize(sns, **kwargs)
Set parameter WLSAccessID
Set parameter WLSSecret
Set parameter LicenseID to value 2537914
Academic license 2537914 - for non-commercial use only - registered to l.___@tu-berlin.de
Read LP format model from file /tmp/linopy-problem-krsabyog.lp
Reading time = 0.00 seconds
obj: 1800 rows, 840 columns, 2759 nonzeros
Set parameter LogToConsole to value 0
Warning: environment still referenced so free is deferred (Continue to use WLS)
INFO:pypsa.optimization.abstract:Optimizing network for snapshot horizon [2019-11-27 00:00:00:2019-12-11 21:00:00] (23/25).
/home/docs/checkouts/readthedocs.org/user_builds/pypsa/checkouts/latest/pypsa/optimization/abstract.py:545: FutureWarning: The default value of `include_objective_constant` will change from True to False in version 2.0. Set `include_objective_constant` explicitly to suppress this warning. Using False improves LP numerical conditioning by not including the objective constant as a variable. status, condition = n.optimize(sns, **kwargs)
Set parameter WLSAccessID
Set parameter WLSSecret
Set parameter LicenseID to value 2537914
Academic license 2537914 - for non-commercial use only - registered to l.___@tu-berlin.de
Read LP format model from file /tmp/linopy-problem-_95uvj8o.lp
Reading time = 0.00 seconds
obj: 1800 rows, 840 columns, 2759 nonzeros
Set parameter LogToConsole to value 0
Warning: environment still referenced so free is deferred (Continue to use WLS)
INFO:pypsa.optimization.abstract:Optimizing network for snapshot horizon [2019-12-12 00:00:00:2019-12-26 21:00:00] (24/25).
/home/docs/checkouts/readthedocs.org/user_builds/pypsa/checkouts/latest/pypsa/optimization/abstract.py:545: FutureWarning: The default value of `include_objective_constant` will change from True to False in version 2.0. Set `include_objective_constant` explicitly to suppress this warning. Using False improves LP numerical conditioning by not including the objective constant as a variable. status, condition = n.optimize(sns, **kwargs)
Set parameter WLSAccessID
Set parameter WLSSecret
Set parameter LicenseID to value 2537914
Academic license 2537914 - for non-commercial use only - registered to l.___@tu-berlin.de
Read LP format model from file /tmp/linopy-problem-4fsbqadw.lp
Reading time = 0.00 seconds
obj: 1800 rows, 840 columns, 2759 nonzeros
Set parameter LogToConsole to value 0
Warning: environment still referenced so free is deferred (Continue to use WLS)
INFO:pypsa.optimization.abstract:Optimizing network for snapshot horizon [2019-12-27 00:00:00:2019-12-31 21:00:00] (25/25).
/home/docs/checkouts/readthedocs.org/user_builds/pypsa/checkouts/latest/pypsa/optimization/abstract.py:545: FutureWarning: The default value of `include_objective_constant` will change from True to False in version 2.0. Set `include_objective_constant` explicitly to suppress this warning. Using False improves LP numerical conditioning by not including the objective constant as a variable. status, condition = n.optimize(sns, **kwargs)
Set parameter WLSAccessID
Set parameter WLSSecret
Set parameter LicenseID to value 2537914
Academic license 2537914 - for non-commercial use only - registered to l.___@tu-berlin.de
Read LP format model from file /tmp/linopy-problem-2wnjplsr.lp
Reading time = 0.00 seconds
obj: 600 rows, 280 columns, 919 nonzeros
Set parameter LogToConsole to value 0
Warning: environment still referenced so free is deferred (Continue to use WLS)
PyPSA Network 'Model-Energy' ---------------------------- Components: - Bus: 2 - Carrier: 10 - Generator: 3 - Link: 2 - Load: 1 - Store: 1 - SubNetwork: 2 Snapshots: 2920
This leads to higher fuel costs, as the storage is not optimally utilised for seasonal shifting and the gas generator must step in.
obj2 = n2.statistics.opex(components="Generator").sum() / 1e6
obj2
np.float64(1337.338405401)
The price duration curve now has more periods with higher prices where the gas generator is dispatched, and more periods with lower prices where renewable generation may be curtailed and the value of storage is not seen.
pdc2 = (
n2.buses_t.marginal_price["electricity"]
.sort_values(ascending=False)
.reset_index(drop=True)
)
pdc2.plot(figsize=(5, 3), ylabel="€/MWh", xlabel="snapshots", xlim=(0, 8760 / 3));
The consequence of myopic operation is that the storage has no incentive to retain energy for future scarcity periods beyond the 15-day horizon. This leads to the absence of a seasonal storage pattern.
soc2 = n2.stores_t.e.div(1e3).squeeze()
soc2.plot(figsize=(6, 2), ylabel="GWh", xlabel="", legend=False);
Case 3: Myopic Foresight with Water Values¶
Now, we amend the myopic foresight dispatch optimisation over 15 days at a time by providing information about the marginal storage value from the perfect foresight case.
We do this by setting the marginal_cost attribute of the hydrogen Store component to the MSV time series we obtained previously. In this way, we tell the model for each time step at what price the hydrogen storage should buy or sell hydrogen. From the angle of the electricity bus, the hydrogen storage would be willing to buy/charge when the electricity price is below the MSV (multiplied by the electrolysis efficiency) and sell/discharge when the electricity price is above the MSV (divided by the turbine efficiency).
n3 = n.copy()
n3.stores_t.marginal_cost["hydrogen storage"] = msv
n3.optimize.optimize_with_rolling_horizon(
assign_all_duals=True,
horizon=120,
overlap=0,
log_to_console=False,
)
INFO:pypsa.optimization.abstract:Optimizing network for snapshot horizon [2019-01-01 00:00:00:2019-01-15 21:00:00] (1/25).
/home/docs/checkouts/readthedocs.org/user_builds/pypsa/checkouts/latest/pypsa/optimization/abstract.py:545: FutureWarning: The default value of `include_objective_constant` will change from True to False in version 2.0. Set `include_objective_constant` explicitly to suppress this warning. Using False improves LP numerical conditioning by not including the objective constant as a variable. status, condition = n.optimize(sns, **kwargs)
Set parameter WLSAccessID
Set parameter WLSSecret
Set parameter LicenseID to value 2537914
Academic license 2537914 - for non-commercial use only - registered to l.___@tu-berlin.de
Read LP format model from file /tmp/linopy-problem-6a9jv3y2.lp
Reading time = 0.00 seconds
obj: 1800 rows, 840 columns, 2759 nonzeros
Set parameter LogToConsole to value 0
Warning: environment still referenced so free is deferred (Continue to use WLS)
INFO:pypsa.optimization.abstract:Optimizing network for snapshot horizon [2019-01-16 00:00:00:2019-01-30 21:00:00] (2/25).
/home/docs/checkouts/readthedocs.org/user_builds/pypsa/checkouts/latest/pypsa/optimization/abstract.py:545: FutureWarning: The default value of `include_objective_constant` will change from True to False in version 2.0. Set `include_objective_constant` explicitly to suppress this warning. Using False improves LP numerical conditioning by not including the objective constant as a variable. status, condition = n.optimize(sns, **kwargs)
Set parameter WLSAccessID
Set parameter WLSSecret
Set parameter LicenseID to value 2537914
Academic license 2537914 - for non-commercial use only - registered to l.___@tu-berlin.de
Read LP format model from file /tmp/linopy-problem-mevjd8sv.lp
Reading time = 0.00 seconds
obj: 1800 rows, 840 columns, 2759 nonzeros
Set parameter LogToConsole to value 0
Warning: environment still referenced so free is deferred (Continue to use WLS)
INFO:pypsa.optimization.abstract:Optimizing network for snapshot horizon [2019-01-31 00:00:00:2019-02-14 21:00:00] (3/25).
/home/docs/checkouts/readthedocs.org/user_builds/pypsa/checkouts/latest/pypsa/optimization/abstract.py:545: FutureWarning: The default value of `include_objective_constant` will change from True to False in version 2.0. Set `include_objective_constant` explicitly to suppress this warning. Using False improves LP numerical conditioning by not including the objective constant as a variable. status, condition = n.optimize(sns, **kwargs)
Set parameter WLSAccessID
Set parameter WLSSecret
Set parameter LicenseID to value 2537914
Academic license 2537914 - for non-commercial use only - registered to l.___@tu-berlin.de
Read LP format model from file /tmp/linopy-problem-c2b1kygm.lp
Reading time = 0.00 seconds
obj: 1800 rows, 840 columns, 2759 nonzeros
Set parameter LogToConsole to value 0
Warning: environment still referenced so free is deferred (Continue to use WLS)
INFO:pypsa.optimization.abstract:Optimizing network for snapshot horizon [2019-02-15 00:00:00:2019-03-01 21:00:00] (4/25).
/home/docs/checkouts/readthedocs.org/user_builds/pypsa/checkouts/latest/pypsa/optimization/abstract.py:545: FutureWarning: The default value of `include_objective_constant` will change from True to False in version 2.0. Set `include_objective_constant` explicitly to suppress this warning. Using False improves LP numerical conditioning by not including the objective constant as a variable. status, condition = n.optimize(sns, **kwargs)
Set parameter WLSAccessID
Set parameter WLSSecret
Set parameter LicenseID to value 2537914
Academic license 2537914 - for non-commercial use only - registered to l.___@tu-berlin.de
Read LP format model from file /tmp/linopy-problem-jfycs78_.lp
Reading time = 0.00 seconds
obj: 1800 rows, 840 columns, 2759 nonzeros
Set parameter LogToConsole to value 0
Warning: environment still referenced so free is deferred (Continue to use WLS)
INFO:pypsa.optimization.abstract:Optimizing network for snapshot horizon [2019-03-02 00:00:00:2019-03-16 21:00:00] (5/25).
/home/docs/checkouts/readthedocs.org/user_builds/pypsa/checkouts/latest/pypsa/optimization/abstract.py:545: FutureWarning: The default value of `include_objective_constant` will change from True to False in version 2.0. Set `include_objective_constant` explicitly to suppress this warning. Using False improves LP numerical conditioning by not including the objective constant as a variable. status, condition = n.optimize(sns, **kwargs)
Set parameter WLSAccessID
Set parameter WLSSecret
Set parameter LicenseID to value 2537914
Academic license 2537914 - for non-commercial use only - registered to l.___@tu-berlin.de
Read LP format model from file /tmp/linopy-problem-vqe75ac8.lp
Reading time = 0.00 seconds
obj: 1800 rows, 840 columns, 2759 nonzeros
Set parameter LogToConsole to value 0
Warning: environment still referenced so free is deferred (Continue to use WLS)
INFO:pypsa.optimization.abstract:Optimizing network for snapshot horizon [2019-03-17 00:00:00:2019-03-31 21:00:00] (6/25).
/home/docs/checkouts/readthedocs.org/user_builds/pypsa/checkouts/latest/pypsa/optimization/abstract.py:545: FutureWarning: The default value of `include_objective_constant` will change from True to False in version 2.0. Set `include_objective_constant` explicitly to suppress this warning. Using False improves LP numerical conditioning by not including the objective constant as a variable. status, condition = n.optimize(sns, **kwargs)
Set parameter WLSAccessID
Set parameter WLSSecret
Set parameter LicenseID to value 2537914
Academic license 2537914 - for non-commercial use only - registered to l.___@tu-berlin.de
Read LP format model from file /tmp/linopy-problem-47o0vv0z.lp
Reading time = 0.00 seconds
obj: 1800 rows, 840 columns, 2759 nonzeros
Set parameter LogToConsole to value 0
Warning: environment still referenced so free is deferred (Continue to use WLS)
INFO:pypsa.optimization.abstract:Optimizing network for snapshot horizon [2019-04-01 00:00:00:2019-04-15 21:00:00] (7/25).
/home/docs/checkouts/readthedocs.org/user_builds/pypsa/checkouts/latest/pypsa/optimization/abstract.py:545: FutureWarning: The default value of `include_objective_constant` will change from True to False in version 2.0. Set `include_objective_constant` explicitly to suppress this warning. Using False improves LP numerical conditioning by not including the objective constant as a variable. status, condition = n.optimize(sns, **kwargs)
Set parameter WLSAccessID
Set parameter WLSSecret
Set parameter LicenseID to value 2537914
Academic license 2537914 - for non-commercial use only - registered to l.___@tu-berlin.de
Read LP format model from file /tmp/linopy-problem-h34ibr3r.lp
Reading time = 0.00 seconds
obj: 1800 rows, 840 columns, 2759 nonzeros
Set parameter LogToConsole to value 0
Warning: environment still referenced so free is deferred (Continue to use WLS)
INFO:pypsa.optimization.abstract:Optimizing network for snapshot horizon [2019-04-16 00:00:00:2019-04-30 21:00:00] (8/25).
/home/docs/checkouts/readthedocs.org/user_builds/pypsa/checkouts/latest/pypsa/optimization/abstract.py:545: FutureWarning: The default value of `include_objective_constant` will change from True to False in version 2.0. Set `include_objective_constant` explicitly to suppress this warning. Using False improves LP numerical conditioning by not including the objective constant as a variable. status, condition = n.optimize(sns, **kwargs)
Set parameter WLSAccessID
Set parameter WLSSecret
Set parameter LicenseID to value 2537914
Academic license 2537914 - for non-commercial use only - registered to l.___@tu-berlin.de
Read LP format model from file /tmp/linopy-problem-wx8x7qhq.lp
Reading time = 0.00 seconds
obj: 1800 rows, 840 columns, 2759 nonzeros
Set parameter LogToConsole to value 0
Warning: environment still referenced so free is deferred (Continue to use WLS)
INFO:pypsa.optimization.abstract:Optimizing network for snapshot horizon [2019-05-01 00:00:00:2019-05-15 21:00:00] (9/25).
/home/docs/checkouts/readthedocs.org/user_builds/pypsa/checkouts/latest/pypsa/optimization/abstract.py:545: FutureWarning: The default value of `include_objective_constant` will change from True to False in version 2.0. Set `include_objective_constant` explicitly to suppress this warning. Using False improves LP numerical conditioning by not including the objective constant as a variable. status, condition = n.optimize(sns, **kwargs)
Set parameter WLSAccessID
Set parameter WLSSecret
Set parameter LicenseID to value 2537914
Academic license 2537914 - for non-commercial use only - registered to l.___@tu-berlin.de
Read LP format model from file /tmp/linopy-problem-l6ko2ffj.lp
Reading time = 0.00 seconds
obj: 1800 rows, 840 columns, 2759 nonzeros
Set parameter LogToConsole to value 0
Warning: environment still referenced so free is deferred (Continue to use WLS)
INFO:pypsa.optimization.abstract:Optimizing network for snapshot horizon [2019-05-16 00:00:00:2019-05-30 21:00:00] (10/25).
/home/docs/checkouts/readthedocs.org/user_builds/pypsa/checkouts/latest/pypsa/optimization/abstract.py:545: FutureWarning: The default value of `include_objective_constant` will change from True to False in version 2.0. Set `include_objective_constant` explicitly to suppress this warning. Using False improves LP numerical conditioning by not including the objective constant as a variable. status, condition = n.optimize(sns, **kwargs)
Set parameter WLSAccessID
Set parameter WLSSecret
Set parameter LicenseID to value 2537914
Academic license 2537914 - for non-commercial use only - registered to l.___@tu-berlin.de
Read LP format model from file /tmp/linopy-problem-383p46el.lp
Reading time = 0.00 seconds
obj: 1800 rows, 840 columns, 2759 nonzeros
Set parameter LogToConsole to value 0
Warning: environment still referenced so free is deferred (Continue to use WLS)
INFO:pypsa.optimization.abstract:Optimizing network for snapshot horizon [2019-05-31 00:00:00:2019-06-14 21:00:00] (11/25).
/home/docs/checkouts/readthedocs.org/user_builds/pypsa/checkouts/latest/pypsa/optimization/abstract.py:545: FutureWarning: The default value of `include_objective_constant` will change from True to False in version 2.0. Set `include_objective_constant` explicitly to suppress this warning. Using False improves LP numerical conditioning by not including the objective constant as a variable. status, condition = n.optimize(sns, **kwargs)
Set parameter WLSAccessID
Set parameter WLSSecret
Set parameter LicenseID to value 2537914
Academic license 2537914 - for non-commercial use only - registered to l.___@tu-berlin.de
Read LP format model from file /tmp/linopy-problem-nw23olhl.lp
Reading time = 0.00 seconds
obj: 1800 rows, 840 columns, 2759 nonzeros
Set parameter LogToConsole to value 0
Warning: environment still referenced so free is deferred (Continue to use WLS)
INFO:pypsa.optimization.abstract:Optimizing network for snapshot horizon [2019-06-15 00:00:00:2019-06-29 21:00:00] (12/25).
/home/docs/checkouts/readthedocs.org/user_builds/pypsa/checkouts/latest/pypsa/optimization/abstract.py:545: FutureWarning: The default value of `include_objective_constant` will change from True to False in version 2.0. Set `include_objective_constant` explicitly to suppress this warning. Using False improves LP numerical conditioning by not including the objective constant as a variable. status, condition = n.optimize(sns, **kwargs)
Set parameter WLSAccessID
Set parameter WLSSecret
Set parameter LicenseID to value 2537914
Academic license 2537914 - for non-commercial use only - registered to l.___@tu-berlin.de
Read LP format model from file /tmp/linopy-problem-fq2ixou_.lp
Reading time = 0.00 seconds
obj: 1800 rows, 840 columns, 2759 nonzeros
Set parameter LogToConsole to value 0
Warning: environment still referenced so free is deferred (Continue to use WLS)
INFO:pypsa.optimization.abstract:Optimizing network for snapshot horizon [2019-06-30 00:00:00:2019-07-14 21:00:00] (13/25).
/home/docs/checkouts/readthedocs.org/user_builds/pypsa/checkouts/latest/pypsa/optimization/abstract.py:545: FutureWarning: The default value of `include_objective_constant` will change from True to False in version 2.0. Set `include_objective_constant` explicitly to suppress this warning. Using False improves LP numerical conditioning by not including the objective constant as a variable. status, condition = n.optimize(sns, **kwargs)
Set parameter WLSAccessID
Set parameter WLSSecret
Set parameter LicenseID to value 2537914
Academic license 2537914 - for non-commercial use only - registered to l.___@tu-berlin.de
Read LP format model from file /tmp/linopy-problem-ss0a405c.lp
Reading time = 0.00 seconds
obj: 1800 rows, 840 columns, 2759 nonzeros
Set parameter LogToConsole to value 0
Warning: environment still referenced so free is deferred (Continue to use WLS)
INFO:pypsa.optimization.abstract:Optimizing network for snapshot horizon [2019-07-15 00:00:00:2019-07-29 21:00:00] (14/25).
/home/docs/checkouts/readthedocs.org/user_builds/pypsa/checkouts/latest/pypsa/optimization/abstract.py:545: FutureWarning: The default value of `include_objective_constant` will change from True to False in version 2.0. Set `include_objective_constant` explicitly to suppress this warning. Using False improves LP numerical conditioning by not including the objective constant as a variable. status, condition = n.optimize(sns, **kwargs)
Set parameter WLSAccessID
Set parameter WLSSecret
Set parameter LicenseID to value 2537914
Academic license 2537914 - for non-commercial use only - registered to l.___@tu-berlin.de
Read LP format model from file /tmp/linopy-problem-qw1zt7tu.lp
Reading time = 0.00 seconds
obj: 1800 rows, 840 columns, 2759 nonzeros
Set parameter LogToConsole to value 0
Warning: environment still referenced so free is deferred (Continue to use WLS)
INFO:pypsa.optimization.abstract:Optimizing network for snapshot horizon [2019-07-30 00:00:00:2019-08-13 21:00:00] (15/25).
/home/docs/checkouts/readthedocs.org/user_builds/pypsa/checkouts/latest/pypsa/optimization/abstract.py:545: FutureWarning: The default value of `include_objective_constant` will change from True to False in version 2.0. Set `include_objective_constant` explicitly to suppress this warning. Using False improves LP numerical conditioning by not including the objective constant as a variable. status, condition = n.optimize(sns, **kwargs)
Set parameter WLSAccessID
Set parameter WLSSecret
Set parameter LicenseID to value 2537914
Academic license 2537914 - for non-commercial use only - registered to l.___@tu-berlin.de
Read LP format model from file /tmp/linopy-problem-8axbaosd.lp
Reading time = 0.00 seconds
obj: 1800 rows, 840 columns, 2759 nonzeros
Set parameter LogToConsole to value 0
Warning: environment still referenced so free is deferred (Continue to use WLS)
INFO:pypsa.optimization.abstract:Optimizing network for snapshot horizon [2019-08-14 00:00:00:2019-08-28 21:00:00] (16/25).
/home/docs/checkouts/readthedocs.org/user_builds/pypsa/checkouts/latest/pypsa/optimization/abstract.py:545: FutureWarning: The default value of `include_objective_constant` will change from True to False in version 2.0. Set `include_objective_constant` explicitly to suppress this warning. Using False improves LP numerical conditioning by not including the objective constant as a variable. status, condition = n.optimize(sns, **kwargs)
Set parameter WLSAccessID
Set parameter WLSSecret
Set parameter LicenseID to value 2537914
Academic license 2537914 - for non-commercial use only - registered to l.___@tu-berlin.de
Read LP format model from file /tmp/linopy-problem-y6c1cxw6.lp
Reading time = 0.00 seconds
obj: 1800 rows, 840 columns, 2759 nonzeros
Set parameter LogToConsole to value 0
Warning: environment still referenced so free is deferred (Continue to use WLS)
INFO:pypsa.optimization.abstract:Optimizing network for snapshot horizon [2019-08-29 00:00:00:2019-09-12 21:00:00] (17/25).
/home/docs/checkouts/readthedocs.org/user_builds/pypsa/checkouts/latest/pypsa/optimization/abstract.py:545: FutureWarning: The default value of `include_objective_constant` will change from True to False in version 2.0. Set `include_objective_constant` explicitly to suppress this warning. Using False improves LP numerical conditioning by not including the objective constant as a variable. status, condition = n.optimize(sns, **kwargs)
Set parameter WLSAccessID
Set parameter WLSSecret
Set parameter LicenseID to value 2537914
Academic license 2537914 - for non-commercial use only - registered to l.___@tu-berlin.de
Read LP format model from file /tmp/linopy-problem-difigzdf.lp
Reading time = 0.00 seconds
obj: 1800 rows, 840 columns, 2759 nonzeros
Set parameter LogToConsole to value 0
Warning: environment still referenced so free is deferred (Continue to use WLS)
INFO:pypsa.optimization.abstract:Optimizing network for snapshot horizon [2019-09-13 00:00:00:2019-09-27 21:00:00] (18/25).
/home/docs/checkouts/readthedocs.org/user_builds/pypsa/checkouts/latest/pypsa/optimization/abstract.py:545: FutureWarning: The default value of `include_objective_constant` will change from True to False in version 2.0. Set `include_objective_constant` explicitly to suppress this warning. Using False improves LP numerical conditioning by not including the objective constant as a variable. status, condition = n.optimize(sns, **kwargs)
Set parameter WLSAccessID
Set parameter WLSSecret
Set parameter LicenseID to value 2537914
Academic license 2537914 - for non-commercial use only - registered to l.___@tu-berlin.de
Read LP format model from file /tmp/linopy-problem-u44ricr5.lp
Reading time = 0.00 seconds
obj: 1800 rows, 840 columns, 2759 nonzeros
Set parameter LogToConsole to value 0
Warning: environment still referenced so free is deferred (Continue to use WLS)
INFO:pypsa.optimization.abstract:Optimizing network for snapshot horizon [2019-09-28 00:00:00:2019-10-12 21:00:00] (19/25).
/home/docs/checkouts/readthedocs.org/user_builds/pypsa/checkouts/latest/pypsa/optimization/abstract.py:545: FutureWarning: The default value of `include_objective_constant` will change from True to False in version 2.0. Set `include_objective_constant` explicitly to suppress this warning. Using False improves LP numerical conditioning by not including the objective constant as a variable. status, condition = n.optimize(sns, **kwargs)
Set parameter WLSAccessID
Set parameter WLSSecret
Set parameter LicenseID to value 2537914
Academic license 2537914 - for non-commercial use only - registered to l.___@tu-berlin.de
Read LP format model from file /tmp/linopy-problem-9ztdj4ln.lp
Reading time = 0.00 seconds
obj: 1800 rows, 840 columns, 2759 nonzeros
Set parameter LogToConsole to value 0
Warning: environment still referenced so free is deferred (Continue to use WLS)
INFO:pypsa.optimization.abstract:Optimizing network for snapshot horizon [2019-10-13 00:00:00:2019-10-27 21:00:00] (20/25).
/home/docs/checkouts/readthedocs.org/user_builds/pypsa/checkouts/latest/pypsa/optimization/abstract.py:545: FutureWarning: The default value of `include_objective_constant` will change from True to False in version 2.0. Set `include_objective_constant` explicitly to suppress this warning. Using False improves LP numerical conditioning by not including the objective constant as a variable. status, condition = n.optimize(sns, **kwargs)
Set parameter WLSAccessID
Set parameter WLSSecret
Set parameter LicenseID to value 2537914
Academic license 2537914 - for non-commercial use only - registered to l.___@tu-berlin.de
Read LP format model from file /tmp/linopy-problem-ec8tv6wl.lp
Reading time = 0.00 seconds
obj: 1800 rows, 840 columns, 2759 nonzeros
Set parameter LogToConsole to value 0
Warning: environment still referenced so free is deferred (Continue to use WLS)
INFO:pypsa.optimization.abstract:Optimizing network for snapshot horizon [2019-10-28 00:00:00:2019-11-11 21:00:00] (21/25).
/home/docs/checkouts/readthedocs.org/user_builds/pypsa/checkouts/latest/pypsa/optimization/abstract.py:545: FutureWarning: The default value of `include_objective_constant` will change from True to False in version 2.0. Set `include_objective_constant` explicitly to suppress this warning. Using False improves LP numerical conditioning by not including the objective constant as a variable. status, condition = n.optimize(sns, **kwargs)
Set parameter WLSAccessID
Set parameter WLSSecret
Set parameter LicenseID to value 2537914
Academic license 2537914 - for non-commercial use only - registered to l.___@tu-berlin.de
Read LP format model from file /tmp/linopy-problem-ebrwd8xm.lp
Reading time = 0.00 seconds
obj: 1800 rows, 840 columns, 2759 nonzeros
Set parameter LogToConsole to value 0
Warning: environment still referenced so free is deferred (Continue to use WLS)
INFO:pypsa.optimization.abstract:Optimizing network for snapshot horizon [2019-11-12 00:00:00:2019-11-26 21:00:00] (22/25).
/home/docs/checkouts/readthedocs.org/user_builds/pypsa/checkouts/latest/pypsa/optimization/abstract.py:545: FutureWarning: The default value of `include_objective_constant` will change from True to False in version 2.0. Set `include_objective_constant` explicitly to suppress this warning. Using False improves LP numerical conditioning by not including the objective constant as a variable. status, condition = n.optimize(sns, **kwargs)
Set parameter WLSAccessID
Set parameter WLSSecret
Set parameter LicenseID to value 2537914
Academic license 2537914 - for non-commercial use only - registered to l.___@tu-berlin.de
Read LP format model from file /tmp/linopy-problem-4pzc0ylq.lp
Reading time = 0.00 seconds
obj: 1800 rows, 840 columns, 2759 nonzeros
Set parameter LogToConsole to value 0
Warning: environment still referenced so free is deferred (Continue to use WLS)
INFO:pypsa.optimization.abstract:Optimizing network for snapshot horizon [2019-11-27 00:00:00:2019-12-11 21:00:00] (23/25).
/home/docs/checkouts/readthedocs.org/user_builds/pypsa/checkouts/latest/pypsa/optimization/abstract.py:545: FutureWarning: The default value of `include_objective_constant` will change from True to False in version 2.0. Set `include_objective_constant` explicitly to suppress this warning. Using False improves LP numerical conditioning by not including the objective constant as a variable. status, condition = n.optimize(sns, **kwargs)
Set parameter WLSAccessID
Set parameter WLSSecret
Set parameter LicenseID to value 2537914
Academic license 2537914 - for non-commercial use only - registered to l.___@tu-berlin.de
Read LP format model from file /tmp/linopy-problem-dswcb2gp.lp
Reading time = 0.00 seconds
obj: 1800 rows, 840 columns, 2759 nonzeros
Set parameter LogToConsole to value 0
Warning: environment still referenced so free is deferred (Continue to use WLS)
INFO:pypsa.optimization.abstract:Optimizing network for snapshot horizon [2019-12-12 00:00:00:2019-12-26 21:00:00] (24/25).
/home/docs/checkouts/readthedocs.org/user_builds/pypsa/checkouts/latest/pypsa/optimization/abstract.py:545: FutureWarning: The default value of `include_objective_constant` will change from True to False in version 2.0. Set `include_objective_constant` explicitly to suppress this warning. Using False improves LP numerical conditioning by not including the objective constant as a variable. status, condition = n.optimize(sns, **kwargs)
Set parameter WLSAccessID
Set parameter WLSSecret
Set parameter LicenseID to value 2537914
Academic license 2537914 - for non-commercial use only - registered to l.___@tu-berlin.de
Read LP format model from file /tmp/linopy-problem-rpagi5j9.lp
Reading time = 0.00 seconds
obj: 1800 rows, 840 columns, 2759 nonzeros
Set parameter LogToConsole to value 0
Warning: environment still referenced so free is deferred (Continue to use WLS)
INFO:pypsa.optimization.abstract:Optimizing network for snapshot horizon [2019-12-27 00:00:00:2019-12-31 21:00:00] (25/25).
/home/docs/checkouts/readthedocs.org/user_builds/pypsa/checkouts/latest/pypsa/optimization/abstract.py:545: FutureWarning: The default value of `include_objective_constant` will change from True to False in version 2.0. Set `include_objective_constant` explicitly to suppress this warning. Using False improves LP numerical conditioning by not including the objective constant as a variable. status, condition = n.optimize(sns, **kwargs)
Set parameter WLSAccessID
Set parameter WLSSecret
Set parameter LicenseID to value 2537914
Academic license 2537914 - for non-commercial use only - registered to l.___@tu-berlin.de
Read LP format model from file /tmp/linopy-problem-_wjvxzr3.lp
Reading time = 0.00 seconds
obj: 600 rows, 280 columns, 919 nonzeros
Set parameter LogToConsole to value 0
Warning: environment still referenced so free is deferred (Continue to use WLS)
PyPSA Network 'Model-Energy' ---------------------------- Components: - Bus: 2 - Carrier: 10 - Generator: 3 - Link: 2 - Load: 1 - Store: 1 - SubNetwork: 2 Snapshots: 2920
When we take exactly the same MSV time series from the perfect foresight case, we recover the exactly same optimal seasonal operation, price duration curve and fuel costs. From a theoretical perspective, this applies the concept of Lagrangian relaxation, where the MSV act as shadow prices that internalise the inter-temporal coupling of the optimal storage operation across the full year, even when optimising only over a limited horizon at a time.
obj3 = n3.statistics.opex(components="Generator").sum() / 1e6
obj3
np.float64(1160.0813050627)
pdc3 = (
n3.buses_t.marginal_price["electricity"]
.sort_values(ascending=False)
.reset_index(drop=True)
)
pdc3.plot(figsize=(5, 3), ylabel="€/MWh", xlabel="snapshots", xlim=(0, 8760 / 3));
soc3 = n3.stores_t.e.div(1e3).squeeze()
soc3.plot(figsize=(6, 2), ylabel="GWh", xlabel="", legend=False);
Case 4: Myopic Foresight with Approximate Water Values¶
In practice, we may not have access to the exact MSV time series from a perfect foresight case. Instead, we can use approximate water values derived from historical data, forecasts, or simplified models, such as a model with lower temporal resolution. In the example below, we just use the annual average MSV as a constant value over the year, which works reasonably well for a storage medium with modest variation in water values over time.
n4 = n.copy()
n4.stores_t.marginal_cost["hydrogen storage"] = msv.mean()
n4.optimize.optimize_with_rolling_horizon(
assign_all_duals=True,
horizon=120,
overlap=0,
log_to_console=False,
)
INFO:pypsa.optimization.abstract:Optimizing network for snapshot horizon [2019-01-01 00:00:00:2019-01-15 21:00:00] (1/25).
/home/docs/checkouts/readthedocs.org/user_builds/pypsa/checkouts/latest/pypsa/optimization/abstract.py:545: FutureWarning: The default value of `include_objective_constant` will change from True to False in version 2.0. Set `include_objective_constant` explicitly to suppress this warning. Using False improves LP numerical conditioning by not including the objective constant as a variable. status, condition = n.optimize(sns, **kwargs)
Set parameter WLSAccessID
Set parameter WLSSecret
Set parameter LicenseID to value 2537914
Academic license 2537914 - for non-commercial use only - registered to l.___@tu-berlin.de
Read LP format model from file /tmp/linopy-problem-e9v84g48.lp
Reading time = 0.00 seconds
obj: 1800 rows, 840 columns, 2759 nonzeros
Set parameter LogToConsole to value 0
Warning: environment still referenced so free is deferred (Continue to use WLS)
INFO:pypsa.optimization.abstract:Optimizing network for snapshot horizon [2019-01-16 00:00:00:2019-01-30 21:00:00] (2/25).
/home/docs/checkouts/readthedocs.org/user_builds/pypsa/checkouts/latest/pypsa/optimization/abstract.py:545: FutureWarning: The default value of `include_objective_constant` will change from True to False in version 2.0. Set `include_objective_constant` explicitly to suppress this warning. Using False improves LP numerical conditioning by not including the objective constant as a variable. status, condition = n.optimize(sns, **kwargs)
Set parameter WLSAccessID
Set parameter WLSSecret
Set parameter LicenseID to value 2537914
Academic license 2537914 - for non-commercial use only - registered to l.___@tu-berlin.de
Read LP format model from file /tmp/linopy-problem-i6gouayt.lp
Reading time = 0.00 seconds
obj: 1800 rows, 840 columns, 2759 nonzeros
Set parameter LogToConsole to value 0
Warning: environment still referenced so free is deferred (Continue to use WLS)
INFO:pypsa.optimization.abstract:Optimizing network for snapshot horizon [2019-01-31 00:00:00:2019-02-14 21:00:00] (3/25).
/home/docs/checkouts/readthedocs.org/user_builds/pypsa/checkouts/latest/pypsa/optimization/abstract.py:545: FutureWarning: The default value of `include_objective_constant` will change from True to False in version 2.0. Set `include_objective_constant` explicitly to suppress this warning. Using False improves LP numerical conditioning by not including the objective constant as a variable. status, condition = n.optimize(sns, **kwargs)
Set parameter WLSAccessID
Set parameter WLSSecret
Set parameter LicenseID to value 2537914
Academic license 2537914 - for non-commercial use only - registered to l.___@tu-berlin.de
Read LP format model from file /tmp/linopy-problem-u9_4fmkm.lp
Reading time = 0.00 seconds
obj: 1800 rows, 840 columns, 2759 nonzeros
Set parameter LogToConsole to value 0
Warning: environment still referenced so free is deferred (Continue to use WLS)
INFO:pypsa.optimization.abstract:Optimizing network for snapshot horizon [2019-02-15 00:00:00:2019-03-01 21:00:00] (4/25).
/home/docs/checkouts/readthedocs.org/user_builds/pypsa/checkouts/latest/pypsa/optimization/abstract.py:545: FutureWarning: The default value of `include_objective_constant` will change from True to False in version 2.0. Set `include_objective_constant` explicitly to suppress this warning. Using False improves LP numerical conditioning by not including the objective constant as a variable. status, condition = n.optimize(sns, **kwargs)
Set parameter WLSAccessID
Set parameter WLSSecret
Set parameter LicenseID to value 2537914
Academic license 2537914 - for non-commercial use only - registered to l.___@tu-berlin.de
Read LP format model from file /tmp/linopy-problem-gas07_1_.lp
Reading time = 0.00 seconds
obj: 1800 rows, 840 columns, 2759 nonzeros
Set parameter LogToConsole to value 0
Warning: environment still referenced so free is deferred (Continue to use WLS)
INFO:pypsa.optimization.abstract:Optimizing network for snapshot horizon [2019-03-02 00:00:00:2019-03-16 21:00:00] (5/25).
/home/docs/checkouts/readthedocs.org/user_builds/pypsa/checkouts/latest/pypsa/optimization/abstract.py:545: FutureWarning: The default value of `include_objective_constant` will change from True to False in version 2.0. Set `include_objective_constant` explicitly to suppress this warning. Using False improves LP numerical conditioning by not including the objective constant as a variable. status, condition = n.optimize(sns, **kwargs)
Set parameter WLSAccessID
Set parameter WLSSecret
Set parameter LicenseID to value 2537914
Academic license 2537914 - for non-commercial use only - registered to l.___@tu-berlin.de
Read LP format model from file /tmp/linopy-problem-nj5bunns.lp
Reading time = 0.00 seconds
obj: 1800 rows, 840 columns, 2759 nonzeros
Set parameter LogToConsole to value 0
Warning: environment still referenced so free is deferred (Continue to use WLS)
INFO:pypsa.optimization.abstract:Optimizing network for snapshot horizon [2019-03-17 00:00:00:2019-03-31 21:00:00] (6/25).
/home/docs/checkouts/readthedocs.org/user_builds/pypsa/checkouts/latest/pypsa/optimization/abstract.py:545: FutureWarning: The default value of `include_objective_constant` will change from True to False in version 2.0. Set `include_objective_constant` explicitly to suppress this warning. Using False improves LP numerical conditioning by not including the objective constant as a variable. status, condition = n.optimize(sns, **kwargs)
Set parameter WLSAccessID
Set parameter WLSSecret
Set parameter LicenseID to value 2537914
Academic license 2537914 - for non-commercial use only - registered to l.___@tu-berlin.de
Read LP format model from file /tmp/linopy-problem-y0sxswz3.lp
Reading time = 0.00 seconds
obj: 1800 rows, 840 columns, 2759 nonzeros
Set parameter LogToConsole to value 0
Warning: environment still referenced so free is deferred (Continue to use WLS)
INFO:pypsa.optimization.abstract:Optimizing network for snapshot horizon [2019-04-01 00:00:00:2019-04-15 21:00:00] (7/25).
/home/docs/checkouts/readthedocs.org/user_builds/pypsa/checkouts/latest/pypsa/optimization/abstract.py:545: FutureWarning: The default value of `include_objective_constant` will change from True to False in version 2.0. Set `include_objective_constant` explicitly to suppress this warning. Using False improves LP numerical conditioning by not including the objective constant as a variable. status, condition = n.optimize(sns, **kwargs)
Set parameter WLSAccessID
Set parameter WLSSecret
Set parameter LicenseID to value 2537914
Academic license 2537914 - for non-commercial use only - registered to l.___@tu-berlin.de
Read LP format model from file /tmp/linopy-problem-bn0u2q9n.lp
Reading time = 0.00 seconds
obj: 1800 rows, 840 columns, 2759 nonzeros
Set parameter LogToConsole to value 0
Warning: environment still referenced so free is deferred (Continue to use WLS)
INFO:pypsa.optimization.abstract:Optimizing network for snapshot horizon [2019-04-16 00:00:00:2019-04-30 21:00:00] (8/25).
/home/docs/checkouts/readthedocs.org/user_builds/pypsa/checkouts/latest/pypsa/optimization/abstract.py:545: FutureWarning: The default value of `include_objective_constant` will change from True to False in version 2.0. Set `include_objective_constant` explicitly to suppress this warning. Using False improves LP numerical conditioning by not including the objective constant as a variable. status, condition = n.optimize(sns, **kwargs)
Set parameter WLSAccessID
Set parameter WLSSecret
Set parameter LicenseID to value 2537914
Academic license 2537914 - for non-commercial use only - registered to l.___@tu-berlin.de
Read LP format model from file /tmp/linopy-problem-1p6lg1m1.lp
Reading time = 0.00 seconds
obj: 1800 rows, 840 columns, 2759 nonzeros
Set parameter LogToConsole to value 0
Warning: environment still referenced so free is deferred (Continue to use WLS)
INFO:pypsa.optimization.abstract:Optimizing network for snapshot horizon [2019-05-01 00:00:00:2019-05-15 21:00:00] (9/25).
/home/docs/checkouts/readthedocs.org/user_builds/pypsa/checkouts/latest/pypsa/optimization/abstract.py:545: FutureWarning: The default value of `include_objective_constant` will change from True to False in version 2.0. Set `include_objective_constant` explicitly to suppress this warning. Using False improves LP numerical conditioning by not including the objective constant as a variable. status, condition = n.optimize(sns, **kwargs)
Set parameter WLSAccessID
Set parameter WLSSecret
Set parameter LicenseID to value 2537914
Academic license 2537914 - for non-commercial use only - registered to l.___@tu-berlin.de
Read LP format model from file /tmp/linopy-problem-ngyik7mc.lp
Reading time = 0.00 seconds
obj: 1800 rows, 840 columns, 2759 nonzeros
Set parameter LogToConsole to value 0
Warning: environment still referenced so free is deferred (Continue to use WLS)
INFO:pypsa.optimization.abstract:Optimizing network for snapshot horizon [2019-05-16 00:00:00:2019-05-30 21:00:00] (10/25).
/home/docs/checkouts/readthedocs.org/user_builds/pypsa/checkouts/latest/pypsa/optimization/abstract.py:545: FutureWarning: The default value of `include_objective_constant` will change from True to False in version 2.0. Set `include_objective_constant` explicitly to suppress this warning. Using False improves LP numerical conditioning by not including the objective constant as a variable. status, condition = n.optimize(sns, **kwargs)
Set parameter WLSAccessID
Set parameter WLSSecret
Set parameter LicenseID to value 2537914
Academic license 2537914 - for non-commercial use only - registered to l.___@tu-berlin.de
Read LP format model from file /tmp/linopy-problem-fbqqljab.lp
Reading time = 0.00 seconds
obj: 1800 rows, 840 columns, 2759 nonzeros
Set parameter LogToConsole to value 0
Warning: environment still referenced so free is deferred (Continue to use WLS)
INFO:pypsa.optimization.abstract:Optimizing network for snapshot horizon [2019-05-31 00:00:00:2019-06-14 21:00:00] (11/25).
/home/docs/checkouts/readthedocs.org/user_builds/pypsa/checkouts/latest/pypsa/optimization/abstract.py:545: FutureWarning: The default value of `include_objective_constant` will change from True to False in version 2.0. Set `include_objective_constant` explicitly to suppress this warning. Using False improves LP numerical conditioning by not including the objective constant as a variable. status, condition = n.optimize(sns, **kwargs)
Set parameter WLSAccessID
Set parameter WLSSecret
Set parameter LicenseID to value 2537914
Academic license 2537914 - for non-commercial use only - registered to l.___@tu-berlin.de
Read LP format model from file /tmp/linopy-problem-ufojo2bp.lp
Reading time = 0.00 seconds
obj: 1800 rows, 840 columns, 2759 nonzeros
Set parameter LogToConsole to value 0
Warning: environment still referenced so free is deferred (Continue to use WLS)
INFO:pypsa.optimization.abstract:Optimizing network for snapshot horizon [2019-06-15 00:00:00:2019-06-29 21:00:00] (12/25).
/home/docs/checkouts/readthedocs.org/user_builds/pypsa/checkouts/latest/pypsa/optimization/abstract.py:545: FutureWarning: The default value of `include_objective_constant` will change from True to False in version 2.0. Set `include_objective_constant` explicitly to suppress this warning. Using False improves LP numerical conditioning by not including the objective constant as a variable. status, condition = n.optimize(sns, **kwargs)
Set parameter WLSAccessID
Set parameter WLSSecret
Set parameter LicenseID to value 2537914
Academic license 2537914 - for non-commercial use only - registered to l.___@tu-berlin.de
Read LP format model from file /tmp/linopy-problem-lcvcmrbp.lp
Reading time = 0.00 seconds
obj: 1800 rows, 840 columns, 2759 nonzeros
Set parameter LogToConsole to value 0
Warning: environment still referenced so free is deferred (Continue to use WLS)
INFO:pypsa.optimization.abstract:Optimizing network for snapshot horizon [2019-06-30 00:00:00:2019-07-14 21:00:00] (13/25).
/home/docs/checkouts/readthedocs.org/user_builds/pypsa/checkouts/latest/pypsa/optimization/abstract.py:545: FutureWarning: The default value of `include_objective_constant` will change from True to False in version 2.0. Set `include_objective_constant` explicitly to suppress this warning. Using False improves LP numerical conditioning by not including the objective constant as a variable. status, condition = n.optimize(sns, **kwargs)
Set parameter WLSAccessID
Set parameter WLSSecret
Set parameter LicenseID to value 2537914
Academic license 2537914 - for non-commercial use only - registered to l.___@tu-berlin.de
Read LP format model from file /tmp/linopy-problem-d2lt8nr2.lp
Reading time = 0.00 seconds
obj: 1800 rows, 840 columns, 2759 nonzeros
Set parameter LogToConsole to value 0
Warning: environment still referenced so free is deferred (Continue to use WLS)
INFO:pypsa.optimization.abstract:Optimizing network for snapshot horizon [2019-07-15 00:00:00:2019-07-29 21:00:00] (14/25).
/home/docs/checkouts/readthedocs.org/user_builds/pypsa/checkouts/latest/pypsa/optimization/abstract.py:545: FutureWarning: The default value of `include_objective_constant` will change from True to False in version 2.0. Set `include_objective_constant` explicitly to suppress this warning. Using False improves LP numerical conditioning by not including the objective constant as a variable. status, condition = n.optimize(sns, **kwargs)
Set parameter WLSAccessID
Set parameter WLSSecret
Set parameter LicenseID to value 2537914
Academic license 2537914 - for non-commercial use only - registered to l.___@tu-berlin.de
Read LP format model from file /tmp/linopy-problem-78emjdsi.lp
Reading time = 0.00 seconds
obj: 1800 rows, 840 columns, 2759 nonzeros
Set parameter LogToConsole to value 0
Warning: environment still referenced so free is deferred (Continue to use WLS)
INFO:pypsa.optimization.abstract:Optimizing network for snapshot horizon [2019-07-30 00:00:00:2019-08-13 21:00:00] (15/25).
/home/docs/checkouts/readthedocs.org/user_builds/pypsa/checkouts/latest/pypsa/optimization/abstract.py:545: FutureWarning: The default value of `include_objective_constant` will change from True to False in version 2.0. Set `include_objective_constant` explicitly to suppress this warning. Using False improves LP numerical conditioning by not including the objective constant as a variable. status, condition = n.optimize(sns, **kwargs)
Set parameter WLSAccessID
Set parameter WLSSecret
Set parameter LicenseID to value 2537914
Academic license 2537914 - for non-commercial use only - registered to l.___@tu-berlin.de
Read LP format model from file /tmp/linopy-problem-tu25pwha.lp
Reading time = 0.00 seconds
obj: 1800 rows, 840 columns, 2759 nonzeros
Set parameter LogToConsole to value 0
Warning: environment still referenced so free is deferred (Continue to use WLS)
INFO:pypsa.optimization.abstract:Optimizing network for snapshot horizon [2019-08-14 00:00:00:2019-08-28 21:00:00] (16/25).
/home/docs/checkouts/readthedocs.org/user_builds/pypsa/checkouts/latest/pypsa/optimization/abstract.py:545: FutureWarning: The default value of `include_objective_constant` will change from True to False in version 2.0. Set `include_objective_constant` explicitly to suppress this warning. Using False improves LP numerical conditioning by not including the objective constant as a variable. status, condition = n.optimize(sns, **kwargs)
Set parameter WLSAccessID
Set parameter WLSSecret
Set parameter LicenseID to value 2537914
Academic license 2537914 - for non-commercial use only - registered to l.___@tu-berlin.de
Read LP format model from file /tmp/linopy-problem-61p11wuw.lp
Reading time = 0.00 seconds
obj: 1800 rows, 840 columns, 2759 nonzeros
Set parameter LogToConsole to value 0
Warning: environment still referenced so free is deferred (Continue to use WLS)
INFO:pypsa.optimization.abstract:Optimizing network for snapshot horizon [2019-08-29 00:00:00:2019-09-12 21:00:00] (17/25).
/home/docs/checkouts/readthedocs.org/user_builds/pypsa/checkouts/latest/pypsa/optimization/abstract.py:545: FutureWarning: The default value of `include_objective_constant` will change from True to False in version 2.0. Set `include_objective_constant` explicitly to suppress this warning. Using False improves LP numerical conditioning by not including the objective constant as a variable. status, condition = n.optimize(sns, **kwargs)
Set parameter WLSAccessID
Set parameter WLSSecret
Set parameter LicenseID to value 2537914
Academic license 2537914 - for non-commercial use only - registered to l.___@tu-berlin.de
Read LP format model from file /tmp/linopy-problem-d3uy4mft.lp
Reading time = 0.00 seconds
obj: 1800 rows, 840 columns, 2759 nonzeros
Set parameter LogToConsole to value 0
Warning: environment still referenced so free is deferred (Continue to use WLS)
INFO:pypsa.optimization.abstract:Optimizing network for snapshot horizon [2019-09-13 00:00:00:2019-09-27 21:00:00] (18/25).
/home/docs/checkouts/readthedocs.org/user_builds/pypsa/checkouts/latest/pypsa/optimization/abstract.py:545: FutureWarning: The default value of `include_objective_constant` will change from True to False in version 2.0. Set `include_objective_constant` explicitly to suppress this warning. Using False improves LP numerical conditioning by not including the objective constant as a variable. status, condition = n.optimize(sns, **kwargs)
Set parameter WLSAccessID
Set parameter WLSSecret
Set parameter LicenseID to value 2537914
Academic license 2537914 - for non-commercial use only - registered to l.___@tu-berlin.de
Read LP format model from file /tmp/linopy-problem-lud6stwd.lp
Reading time = 0.00 seconds
obj: 1800 rows, 840 columns, 2759 nonzeros
Set parameter LogToConsole to value 0
Warning: environment still referenced so free is deferred (Continue to use WLS)
INFO:pypsa.optimization.abstract:Optimizing network for snapshot horizon [2019-09-28 00:00:00:2019-10-12 21:00:00] (19/25).
/home/docs/checkouts/readthedocs.org/user_builds/pypsa/checkouts/latest/pypsa/optimization/abstract.py:545: FutureWarning: The default value of `include_objective_constant` will change from True to False in version 2.0. Set `include_objective_constant` explicitly to suppress this warning. Using False improves LP numerical conditioning by not including the objective constant as a variable. status, condition = n.optimize(sns, **kwargs)
Set parameter WLSAccessID
Set parameter WLSSecret
Set parameter LicenseID to value 2537914
Academic license 2537914 - for non-commercial use only - registered to l.___@tu-berlin.de
Read LP format model from file /tmp/linopy-problem-jbzeu7q5.lp
Reading time = 0.00 seconds
obj: 1800 rows, 840 columns, 2759 nonzeros
Set parameter LogToConsole to value 0
Warning: environment still referenced so free is deferred (Continue to use WLS)
INFO:pypsa.optimization.abstract:Optimizing network for snapshot horizon [2019-10-13 00:00:00:2019-10-27 21:00:00] (20/25).
/home/docs/checkouts/readthedocs.org/user_builds/pypsa/checkouts/latest/pypsa/optimization/abstract.py:545: FutureWarning: The default value of `include_objective_constant` will change from True to False in version 2.0. Set `include_objective_constant` explicitly to suppress this warning. Using False improves LP numerical conditioning by not including the objective constant as a variable. status, condition = n.optimize(sns, **kwargs)
Set parameter WLSAccessID
Set parameter WLSSecret
Set parameter LicenseID to value 2537914
Academic license 2537914 - for non-commercial use only - registered to l.___@tu-berlin.de
Read LP format model from file /tmp/linopy-problem-thf4b392.lp
Reading time = 0.00 seconds
obj: 1800 rows, 840 columns, 2759 nonzeros
Set parameter LogToConsole to value 0
Warning: environment still referenced so free is deferred (Continue to use WLS)
INFO:pypsa.optimization.abstract:Optimizing network for snapshot horizon [2019-10-28 00:00:00:2019-11-11 21:00:00] (21/25).
/home/docs/checkouts/readthedocs.org/user_builds/pypsa/checkouts/latest/pypsa/optimization/abstract.py:545: FutureWarning: The default value of `include_objective_constant` will change from True to False in version 2.0. Set `include_objective_constant` explicitly to suppress this warning. Using False improves LP numerical conditioning by not including the objective constant as a variable. status, condition = n.optimize(sns, **kwargs)
Set parameter WLSAccessID
Set parameter WLSSecret
Set parameter LicenseID to value 2537914
Academic license 2537914 - for non-commercial use only - registered to l.___@tu-berlin.de
Read LP format model from file /tmp/linopy-problem-0mu6_8zl.lp
Reading time = 0.00 seconds
obj: 1800 rows, 840 columns, 2759 nonzeros
Set parameter LogToConsole to value 0
Warning: environment still referenced so free is deferred (Continue to use WLS)
INFO:pypsa.optimization.abstract:Optimizing network for snapshot horizon [2019-11-12 00:00:00:2019-11-26 21:00:00] (22/25).
/home/docs/checkouts/readthedocs.org/user_builds/pypsa/checkouts/latest/pypsa/optimization/abstract.py:545: FutureWarning: The default value of `include_objective_constant` will change from True to False in version 2.0. Set `include_objective_constant` explicitly to suppress this warning. Using False improves LP numerical conditioning by not including the objective constant as a variable. status, condition = n.optimize(sns, **kwargs)
Set parameter WLSAccessID
Set parameter WLSSecret
Set parameter LicenseID to value 2537914
Academic license 2537914 - for non-commercial use only - registered to l.___@tu-berlin.de
Read LP format model from file /tmp/linopy-problem-s_auz4qx.lp
Reading time = 0.00 seconds
obj: 1800 rows, 840 columns, 2759 nonzeros
Set parameter LogToConsole to value 0
Warning: environment still referenced so free is deferred (Continue to use WLS)
INFO:pypsa.optimization.abstract:Optimizing network for snapshot horizon [2019-11-27 00:00:00:2019-12-11 21:00:00] (23/25).
/home/docs/checkouts/readthedocs.org/user_builds/pypsa/checkouts/latest/pypsa/optimization/abstract.py:545: FutureWarning: The default value of `include_objective_constant` will change from True to False in version 2.0. Set `include_objective_constant` explicitly to suppress this warning. Using False improves LP numerical conditioning by not including the objective constant as a variable. status, condition = n.optimize(sns, **kwargs)
Set parameter WLSAccessID
Set parameter WLSSecret
Set parameter LicenseID to value 2537914
Academic license 2537914 - for non-commercial use only - registered to l.___@tu-berlin.de
Read LP format model from file /tmp/linopy-problem-64swv189.lp
Reading time = 0.00 seconds
obj: 1800 rows, 840 columns, 2759 nonzeros
Set parameter LogToConsole to value 0
Warning: environment still referenced so free is deferred (Continue to use WLS)
INFO:pypsa.optimization.abstract:Optimizing network for snapshot horizon [2019-12-12 00:00:00:2019-12-26 21:00:00] (24/25).
/home/docs/checkouts/readthedocs.org/user_builds/pypsa/checkouts/latest/pypsa/optimization/abstract.py:545: FutureWarning: The default value of `include_objective_constant` will change from True to False in version 2.0. Set `include_objective_constant` explicitly to suppress this warning. Using False improves LP numerical conditioning by not including the objective constant as a variable. status, condition = n.optimize(sns, **kwargs)
Set parameter WLSAccessID
Set parameter WLSSecret
Set parameter LicenseID to value 2537914
Academic license 2537914 - for non-commercial use only - registered to l.___@tu-berlin.de
Read LP format model from file /tmp/linopy-problem-v506d0a4.lp
Reading time = 0.00 seconds
obj: 1800 rows, 840 columns, 2759 nonzeros
Set parameter LogToConsole to value 0
Warning: environment still referenced so free is deferred (Continue to use WLS)
INFO:pypsa.optimization.abstract:Optimizing network for snapshot horizon [2019-12-27 00:00:00:2019-12-31 21:00:00] (25/25).
/home/docs/checkouts/readthedocs.org/user_builds/pypsa/checkouts/latest/pypsa/optimization/abstract.py:545: FutureWarning: The default value of `include_objective_constant` will change from True to False in version 2.0. Set `include_objective_constant` explicitly to suppress this warning. Using False improves LP numerical conditioning by not including the objective constant as a variable. status, condition = n.optimize(sns, **kwargs)
Set parameter WLSAccessID
Set parameter WLSSecret
Set parameter LicenseID to value 2537914
Academic license 2537914 - for non-commercial use only - registered to l.___@tu-berlin.de
Read LP format model from file /tmp/linopy-problem-h614bqoz.lp
Reading time = 0.00 seconds
obj: 600 rows, 280 columns, 919 nonzeros
Set parameter LogToConsole to value 0
Warning: environment still referenced so free is deferred (Continue to use WLS)
PyPSA Network 'Model-Energy' ---------------------------- Components: - Bus: 2 - Carrier: 10 - Generator: 3 - Link: 2 - Load: 1 - Store: 1 - SubNetwork: 2 Snapshots: 2920
Now, we do not exactly reproduce the perfect foresight solution, but still do not deviate too far from it. The fuel costs is only slightly different, and the general seasonal storage operation is retained, albeit with some deviations compared to the perfect foresight case.
obj4 = n4.statistics.opex(components="Generator").sum() / 1e6
obj4
np.float64(1179.3842910491098)
pdc4 = (
n4.buses_t.marginal_price["electricity"]
.sort_values(ascending=False)
.reset_index(drop=True)
)
soc4 = n4.stores_t.e.div(1e3).squeeze()
soc4.plot(figsize=(6, 2), ylabel="GWh", xlabel="", legend=False);
Summary¶
The cases above demonstrate that even approximate water values can significantly improve the operation of long-duration storage under myopic foresight.
The tables and figures below summarise the differences between the four cases in terms of fuel costs, price duration curves, and storage operation.
Fuel costs:
pd.Series(
{
"perfect foresight": obj,
"rolling horizon": obj2,
"rolling horizon + water values": obj3,
"rolling horizon + avg. water values": obj4,
}
).round(3)
perfect foresight 1160.081 rolling horizon 1337.338 rolling horizon + water values 1160.081 rolling horizon + avg. water values 1179.384 dtype: float64
Price duration curves:
ax = pd.concat(
{
"perfect foresight": pdc,
"rolling horizon": pdc2,
"rolling horizon + water values": pdc3,
"rolling horizon + avg. water values": pdc4,
},
axis=1,
).plot(figsize=(5, 3), ylabel="€/MWh", xlabel="snapshots", xlim=(0, 8760 / 3))
for line in ax.lines[-3:]:
line.set_linestyle(":")
Storage operation:
ax = pd.concat(
{
"perfect foresight": soc,
"rolling horizon": soc2,
"rolling horizon + water values": soc3,
"rolling horizon + avg. water values": soc4,
},
axis=1,
).plot(figsize=(6, 2), ylabel="GWh", xlabel="")
for line in ax.lines[-3:]:
line.set_linestyle(":")
plt.legend(bbox_to_anchor=(1.02, 1), loc="upper left")
<matplotlib.legend.Legend at 0x73dd380f8550>