Skip to content
This repository was archived by the owner on Mar 27, 2025. It is now read-only.

Commit 9193691

Browse files
Config Adjustments (#195)
* NEP 2021 costs and maximum renewable capacity config * add constraints not only to linopy but also pypsa model * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --------- Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
1 parent e7cb060 commit 9193691

File tree

3 files changed

+32
-14
lines changed

3 files changed

+32
-14
lines changed

config/config.yaml

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
# docs in https://pypsa-eur.readthedocs.io/en/latest/configuration.html#run
66
run:
7-
prefix: 240918_nep_DC
7+
prefix: 240919_nep_2021_costs
88
name:
99
# - CurrentPolicies
1010
- KN2045_Bal_v4
@@ -413,10 +413,10 @@ solving:
413413
DE:
414414
2020: 54.5
415415
2025: 69
416-
2030: 160
417-
2035: 160
418-
2040: 160
419-
2045: 160
416+
2030: 250
417+
2035: 250
418+
2040: 250
419+
2045: 250
420420
offwind:
421421
DE:
422422
2020: 7.8
@@ -430,9 +430,9 @@ solving:
430430
2020: 53.7
431431
2025: 110 # EEG2023; assumes for 2026: 128 GW, assuming a fair share reached by end of 2025
432432
2030: 400
433-
2035: 400
434-
2040: 400
435-
2045: 400
433+
2035: 1000
434+
2040: 1000
435+
2045: 1000
436436
Store:
437437
co2 sequestered:
438438
DE:

config/scenarios.manual.yaml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ CurrentPolicies:
2828

2929
costs:
3030
horizon: "mean"
31-
NEP: 2023
31+
NEP: 2021
3232
transmission: "underground" # either overhead line ("overhead") or underground cable ("underground")
3333
solving:
3434
constraints:
@@ -125,7 +125,7 @@ KN2045_Bal_v4:
125125

126126
costs:
127127
horizon: "mean"
128-
NEP: 2023
128+
NEP: 2021
129129
transmission: "overhead" # either overhead line ("overhead") or underground cable ("underground")
130130
solving:
131131
constraints:
@@ -192,7 +192,7 @@ KN2045_Elec_v4:
192192

193193
costs:
194194
horizon: "mean"
195-
NEP: 2023
195+
NEP: 2021
196196
transmission: "overhead" # either overhead line ("overhead") or underground cable ("underground")
197197
solving:
198198
constraints:
@@ -258,7 +258,7 @@ KN2045_H2_v4:
258258

259259
costs:
260260
horizon: "mean"
261-
NEP: 2023
261+
NEP: 2021
262262
transmission: "overhead" # either overhead line ("overhead") or underground cable ("underground")
263263
solving:
264264
constraints:
@@ -327,7 +327,7 @@ KN2045plus_EasyRide:
327327

328328
costs:
329329
horizon: "optimist"
330-
NEP: 2023
330+
NEP: 2021
331331
transmission: "overhead" # either overhead line ("overhead") or underground cable ("underground")
332332
solving:
333333
constraints:
@@ -392,7 +392,7 @@ KN2045plus_LowDemand:
392392

393393
costs:
394394
horizon: "optimist"
395-
NEP: 2023
395+
NEP: 2021
396396
transmission: "overhead" # either overhead line ("overhead") or underground cable ("underground")
397397
solving:
398398
constraints:

workflow/scripts/additional_functionality.py

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,11 +73,29 @@ def add_capacity_limits(n, investment_year, limits_capacity, sense="maximum"):
7373
lhs <= limit - existing_capacity,
7474
name=f"GlobalConstraint-{cname}",
7575
)
76+
if cname not in n.global_constraints.index:
77+
n.add(
78+
"GlobalConstraint",
79+
cname,
80+
constant=limit - existing_capacity,
81+
sense="<=",
82+
type="",
83+
carrier_attribute="",
84+
)
7685
elif sense == "minimum":
7786
n.model.add_constraints(
7887
lhs >= limit - existing_capacity,
7988
name=f"GlobalConstraint-{cname}",
8089
)
90+
if cname not in n.global_constraints.index:
91+
n.add(
92+
"GlobalConstraint",
93+
cname,
94+
constant=limit - existing_capacity,
95+
sense=">=",
96+
type="",
97+
carrier_attribute="",
98+
)
8199
else:
82100
logger.error("sense {sense} not recognised")
83101
sys.exit()

0 commit comments

Comments
 (0)