From ed4fdc9150aeedf1f8da5e28203d561214b59ede Mon Sep 17 00:00:00 2001 From: Chiara Anselmetti <40397544+chiaroo@users.noreply.github.com> Date: Mon, 11 Jan 2021 10:27:27 +0100 Subject: [PATCH] Keep links to store components when using ATK wildcard (#214) * Update prepare_network.py The new ATK wildcard removes all lines + links without further distinction; however, since storage options are now modeled as store components, the links to and from the the storage units for (dis)charge are eliminated as well. Thus, the storage options drop out of the optimisation. Especially when only allowing renewables as generation sources, optimisation may become infeasible for a high temporal resolution (capacity factors = 0 for certain hours; no further options to serve the load). This issue does not arise with the ATKc wildcard, since bus0 and bus1 of the (dis)charge links share the same country code. The proposed change is a very quick fix in the enforce_autarky function, solely removing DC links. * Update scripts/prepare_network.py Co-authored-by: Fabian Neumann * Update prepare_network.py Co-authored-by: Fabian Neumann --- scripts/prepare_network.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/prepare_network.py b/scripts/prepare_network.py index 3b1e09ce..fc5c6e77 100755 --- a/scripts/prepare_network.py +++ b/scripts/prepare_network.py @@ -204,7 +204,7 @@ def enforce_autarky(n, only_crossborder=False): ].index else: lines_rm = n.lines.index - links_rm = n.links.index + links_rm = n.links.loc[n.links.carrier=="DC"].index n.mremove("Line", lines_rm) n.mremove("Link", links_rm)