Passed
Pull Request — dev (#1170)
by
unknown
05:05
created

electricity()   D

Complexity

Conditions 9

Size

Total Lines 533
Code Lines 375

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
eloc 375
dl 0
loc 533
rs 4.6666
c 0
b 0
f 0
cc 9
nop 1

How to fix   Long Method   

Long Method

Small methods make your code easier to understand, in particular if combined with a good name. Besides, if your method is small, finding a good name is usually much easier.

For example, if you find yourself adding comments to a method's body, this is usually a good sign to extract the commented part to a new method, and use the comment as a starting point when coming up with a good name for this new method.

Commonly applied refactorings include:

1
"""The module containing all parameters for the scenario table
2
"""
3
4
import pandas as pd
5
6
import egon.data.config
7
8
9
def read_csv(year):
10
    source = egon.data.config.datasets()["pypsa-technology-data"]["targets"][
11
        "data_dir"
12
    ]
13
14
    return pd.read_csv(f"{source}costs_{year}.csv")
15
16
17
def read_costs(df, technology, parameter, value_only=True):
18
    result = df.loc[
19
        (df.technology == technology) & (df.parameter == parameter)
20
    ].squeeze()
21
22
    # Rescale costs to EUR/MW
23
    if "EUR/kW" in result.unit:
24
        result.value *= 1e3
25
        result.unit = result.unit.replace("kW", "MW")
26
27
    if value_only:
28
        return result.value
29
    else:
30
        return result
31
32
33
def annualize_capital_costs(overnight_costs, lifetime, p):
34
    """
35
36
    Parameters
37
    ----------
38
    overnight_costs : float
39
        Overnight investment costs in EUR/MW or EUR/MW/km
40
    lifetime : int
41
        Number of years in which payments will be made
42
    p : float
43
        Interest rate in p.u.
44
45
    Returns
46
    -------
47
    float
48
        Annualized capital costs in EUR/MW/a or EUR/MW/km/a
49
50
    """
51
52
    # Calculate present value of an annuity (PVA)
53
    PVA = (1 / p) - (1 / (p * (1 + p) ** lifetime))
54
55
    return overnight_costs / PVA
56
57
58
def global_settings(scenario):
59
    """Returns global paramaters for the selected scenario.
60
61
    Parameters
62
    ----------
63
    scenario : str
64
        Name of the scenario.
65
66
    Returns
67
    -------
68
    parameters : dict
69
        List of global parameters
70
71
    """
72
73
    if scenario == "eGon2035":
74
        parameters = {
75
            "weather_year": 2011,
76
            "population_year": 2035,
77
            "fuel_costs": {  # Netzentwicklungsplan Strom 2035, Version 2021, 1. Entwurf, p. 39, table 6
78
                "oil": 73.8,  # [EUR/MWh]
79
                "gas": 25.6,  # [EUR/MWh]
80
                "coal": 20.2,  # [EUR/MWh]
81
                "lignite": 4.0,  # [EUR/MWh]
82
                "nuclear": 1.7,  # [EUR/MWh]
83
                "biomass": 40,  # Dummyvalue, ToDo: Find a suitable source
84
            },
85
            "co2_costs": 76.5,  # [EUR/t_CO2]
86
            "co2_emissions": {  # Netzentwicklungsplan Strom 2035, Version 2021, 1. Entwurf, p. 40, table 8
87
                "waste": 0.165,  # [t_CO2/MW_th]
88
                "lignite": 0.393,  # [t_CO2/MW_th]
89
                "gas": 0.201,  # [t_CO2/MW_th]
90
                "nuclear": 0.0,  # [t_CO2/MW_th]
91
                "oil": 0.288,  # [t_CO2/MW_th]
92
                "coal": 0.335,  # [t_CO2/MW_th]
93
                "other_non_renewable": 0.268,  # [t_CO2/MW_th]
94
            },
95
            "interest_rate": 0.05,  # [p.u.]
96
        }
97
98
    elif scenario == "eGon100RE":
99
        parameters = {
100
            "weather_year": 2011,
101
            "population_year": 2050,
102
            "fuel_costs": {  # Netzentwicklungsplan Strom 2035, Version 2021, 1. Entwurf, p. 39, table 6
103
                "oil": 73.8,  # [EUR/MWh]
104
                "gas": 25.6,  # [EUR/MWh]
105
                "coal": 20.2,  # [EUR/MWh]
106
                "lignite": 4.0,  # [EUR/MWh]
107
                "nuclear": 1.7,  # [EUR/MWh]
108
            },
109
            "co2_costs": 76.5,  # [EUR/t_CO2]
110
            "co2_emissions": {  # Netzentwicklungsplan Strom 2035, Version 2021, 1. Entwurf, p. 40, table 8
111
                "waste": 0.165,  # [t_CO2/MW_th]
112
                "lignite": 0.393,  # [t_CO2/MW_th]
113
                "gas": 0.201,  # [t_CO2/MW_th]
114
                "nuclear": 0.0,  # [t_CO2/MW_th]
115
                "oil": 0.288,  # [t_CO2/MW_th]
116
                "coal": 0.335,  # [t_CO2/MW_th]
117
                "other_non_renewable": 0.268,  # [t_CO2/MW_th]
118
            },
119
        }
120
121
    elif scenario == "eGon2021":
122
        parameters = {
123
            "weather_year": 2011,
124
            "population_year": 2021,
125
        }
126
127
    elif scenario == "status2023":
128
        parameters = {
129
            "weather_year": 2023,
130
            "population_year": 2019,  # TODO: check if possible for 2023
131
            "fuel_costs": {
132
                # TYNDP 2020, data for 2023 (https://2020.entsos-tyndp-scenarios.eu/fuel-commodities-and-carbon-prices/)
133
                "oil": 16.4 * 3.6,  # [EUR/MWh]
134
                "gas": 6.1 * 3.6,  # [EUR/MWh]
135
                "coal": 3.4 * 3.6,  # [EUR/MWh]
136
                "lignite": 1.1 * 3.6,  # [EUR/MWh]
137
                "nuclear": 0.47 * 3.6,  # [EUR/MWh]
138
                "biomass": read_costs(read_csv(2020), "biomass", "fuel"),
139
            },
140
            "co2_costs": 83.66,  # [EUR/t_CO2], source:
141
            # https://www.iwr.de/news/co2-emissionshandel-deutschland-erzielt-2023-rekordeinnahmen-von-ueber-18-mrd-euro-news38528
142
            "co2_emissions": {
143
                # Netzentwicklungsplan Strom 2037, Genehmigtr Scenariorahmen, p. 66, table 21
144
                # https://www.netzentwicklungsplan.de/sites/default/files/2023-01/Szenariorahmen_2037_Genehmigung.pdf
145
                "waste": 0.165,  # [t_CO2/MW_th]
146
                "lignite": 0.393,  # [t_CO2/MW_th]
147
                "gas": 0.201,  # [t_CO2/MW_th]
148
                "nuclear": 0.0,  # [t_CO2/MW_th]
149
                "oil": 0.288,  # [t_CO2/MW_th]
150
                "coal": 0.337,  # [t_CO2/MW_th]
151
                "other_non_renewable": 0.268,  # [t_CO2/MW_th]
152
            },
153
            "interest_rate": 0.05,  # [p.u.]
154
        }
155
156
    elif scenario == "status2019":
157
        parameters = {
158
            "weather_year": 2019,
159
            "population_year": 2019,
160
            "fuel_costs": {  # TYNDP 2020, data for 2020 (https://2020.entsos-tyndp-scenarios.eu/fuel-commodities-and-carbon-prices/)
161
                "oil": 12.9*3.6,  # [EUR/MWh]
162
                "gas": 5.6*3.6,  # [EUR/MWh]
163
                "coal": 3.0*3.6,  # [EUR/MWh]
164
                "lignite": 1.1*3.6,  # [EUR/MWh]
165
                "nuclear": 0.47*3.6,  # [EUR/MWh]
166
                "biomass": read_costs(read_csv(2020), "biomass", "fuel"),
167
            },
168
            "co2_costs": 24.7,  # [EUR/t_CO2], source:
169
                #https://de.statista.com/statistik/daten/studie/1304069/umfrage/preisentwicklung-von-co2-emissionsrechten-in-eu/
170
            "co2_emissions": {  # Netzentwicklungsplan Strom 2035, Version 2021, 1. Entwurf, p. 40, table 8
171
                "waste": 0.165,  # [t_CO2/MW_th]
172
                "lignite": 0.393,  # [t_CO2/MW_th]
173
                "gas": 0.201,  # [t_CO2/MW_th]
174
                "nuclear": 0.0,  # [t_CO2/MW_th]
175
                "oil": 0.288,  # [t_CO2/MW_th]
176
                "coal": 0.335,  # [t_CO2/MW_th]
177
                "other_non_renewable": 0.268,  # [t_CO2/MW_th]
178
            },
179
            "interest_rate": 0.05,  # [p.u.]
180
        }
181
182
    else:
183
        print(f"Scenario name {scenario} is not valid.")
184
185
    return parameters
0 ignored issues
show
introduced by
The variable parameters does not seem to be defined for all execution paths.
Loading history...
186
187
188
def electricity(scenario):
189
    """Returns paramaters of the electricity sector for the selected scenario.
190
191
    Parameters
192
    ----------
193
    scenario : str
194
        Name of the scenario.
195
196
    Returns
197
    -------
198
    parameters : dict
199
        List of parameters of electricity sector
200
201
    """
202
203
    if scenario == "eGon2035":
204
        costs = read_csv(2035)
205
206
        parameters = {"grid_topology": "Status Quo"}
207
        # Insert effciencies in p.u.
208
        parameters["efficiency"] = {
209
            "oil": read_costs(costs, "oil", "efficiency"),
210
            "battery": {
211
                "store": read_costs(costs, "battery inverter", "efficiency")
212
                ** 0.5,
213
                "dispatch": read_costs(costs, "battery inverter", "efficiency")
214
                ** 0.5,
215
                "standing_loss": 0,
216
                "max_hours": 6,
217
                "cyclic_state_of_charge": True,
218
            },
219
            "pumped_hydro": {
220
                "store": read_costs(costs, "PHS", "efficiency") ** 0.5,
221
                "dispatch": read_costs(costs, "PHS", "efficiency") ** 0.5,
222
                "standing_loss": 0,
223
                "max_hours": 6,
224
                "cyclic_state_of_charge": True,
225
            },
226
        }
227
        # Warning: Electrical parameters are set in osmTGmod, editing these values will not change the data!
228
        parameters["electrical_parameters"] = {
229
            "ac_line_110kV": {
230
                "s_nom": 260,  # [MVA]
231
                "R": 0.109,  # [Ohm/km]
232
                "L": 1.2,  # [mH/km]
233
            },
234
            "ac_cable_110kV": {
235
                "s_nom": 280,  # [MVA]
236
                "R": 0.0177,  # [Ohm/km]
237
                "L": 0.3,  # [mH/km]
238
            },
239
            "ac_line_220kV": {
240
                "s_nom": 520,  # [MVA]
241
                "R": 0.109,  # [Ohm/km]
242
                "L": 1.0,  # [mH/km]
243
            },
244
            "ac_cable_220kV": {
245
                "s_nom": 550,  # [MVA]
246
                "R": 0.0176,  # [Ohm/km]
247
                "L": 0.3,  # [mH/km]
248
            },
249
            "ac_line_380kV": {
250
                "s_nom": 1790,  # [MVA]
251
                "R": 0.028,  # [Ohm/km]
252
                "L": 0.8,  # [mH/km]
253
            },
254
            "ac_cable_380kV": {
255
                "s_nom": 925,  # [MVA]
256
                "R": 0.0175,  # [Ohm/km]
257
                "L": 0.3,  # [mH/km]
258
            },
259
        }
260
261
        # Insert overnight investment costs
262
        # Source for eHV grid costs: Netzentwicklungsplan Strom 2035, Version 2021, 2. Entwurf
263
        # Source for HV lines and cables: Dena Verteilnetzstudie 2021, p. 146
264
        parameters["overnight_cost"] = {
265
            "ac_ehv_overhead_line": 2.5e6
266
            / (
267
                2
268
                * parameters["electrical_parameters"]["ac_line_380kV"]["s_nom"]
269
            ),  # [EUR/km/MW]
270
            "ac_ehv_cable": 11.5e6
271
            / (
272
                2
273
                * parameters["electrical_parameters"]["ac_cable_380kV"][
274
                    "s_nom"
275
                ]
276
            ),  # [EUR/km/MW]
277
            "ac_hv_overhead_line": 0.06e6
278
            / parameters["electrical_parameters"]["ac_line_110kV"][
279
                "s_nom"
280
            ],  # [EUR/km/MW]
281
            "ac_hv_cable": 0.8e6
282
            / parameters["electrical_parameters"]["ac_cable_110kV"][
283
                "s_nom"
284
            ],  # [EUR/km/MW]
285
            "dc_overhead_line": 0.5e3,  # [EUR/km/MW]
286
            "dc_cable": 3.25e3,  # [EUR/km/MW]
287
            "dc_inverter": 0.3e6,  # [EUR/MW]
288
            "transformer_380_110": 17.33e3,  # [EUR/MVA]
289
            "transformer_380_220": 13.33e3,  # [EUR/MVA]
290
            "transformer_220_110": 17.5e3,  # [EUR/MVA]
291
            "battery inverter": read_costs(
292
                costs, "battery inverter", "investment"
293
            ),
294
            "battery storage": read_costs(
295
                costs, "battery storage", "investment"
296
            ),
297
        }
298
299
        parameters["lifetime"] = {
300
            "ac_ehv_overhead_line": read_costs(
301
                costs, "HVAC overhead", "lifetime"
302
            ),
303
            "ac_ehv_cable": read_costs(costs, "HVAC overhead", "lifetime"),
304
            "ac_hv_overhead_line": read_costs(
305
                costs, "HVAC overhead", "lifetime"
306
            ),
307
            "ac_hv_cable": read_costs(costs, "HVAC overhead", "lifetime"),
308
            "dc_overhead_line": read_costs(costs, "HVDC overhead", "lifetime"),
309
            "dc_cable": read_costs(costs, "HVDC overhead", "lifetime"),
310
            "dc_inverter": read_costs(costs, "HVDC inverter pair", "lifetime"),
311
            "transformer_380_110": read_costs(
312
                costs, "HVAC overhead", "lifetime"
313
            ),
314
            "transformer_380_220": read_costs(
315
                costs, "HVAC overhead", "lifetime"
316
            ),
317
            "transformer_220_110": read_costs(
318
                costs, "HVAC overhead", "lifetime"
319
            ),
320
            "battery inverter": read_costs(
321
                costs, "battery inverter", "lifetime"
322
            ),
323
            "battery storage": read_costs(
324
                costs, "battery storage", "lifetime"
325
            ),
326
        }
327
        # Insert annualized capital costs
328
        # lines in EUR/km/MW/a
329
        # transfermer, inverter, battery in EUR/MW/a
330
        parameters["capital_cost"] = {}
331
332
        for comp in parameters["overnight_cost"].keys():
333
            parameters["capital_cost"][comp] = annualize_capital_costs(
334
                parameters["overnight_cost"][comp],
335
                parameters["lifetime"][comp],
336
                global_settings("eGon2035")["interest_rate"],
337
            )
338
339
        parameters["capital_cost"]["battery"] = (
340
            parameters["capital_cost"]["battery inverter"]
341
            + parameters["efficiency"]["battery"]["max_hours"]
342
            * parameters["capital_cost"]["battery storage"]
343
        )
344
345
        # Insert marginal_costs in EUR/MWh
346
        # marginal cost can include fuel, C02 and operation and maintenance costs
347
        parameters["marginal_cost"] = {
348
            "oil": global_settings(scenario)["fuel_costs"]["oil"]
349
            / read_costs(costs, "oil", "efficiency")
350
            + read_costs(costs, "oil", "VOM")
351
            + global_settings(scenario)["co2_costs"]
352
            * global_settings(scenario)["co2_emissions"]["oil"]
353
            / read_costs(costs, "oil", "efficiency"),
354
            "other_non_renewable": global_settings(scenario)["fuel_costs"][
355
                "gas"
356
            ] / read_costs(costs, "OCGT", "efficiency")
357
            + global_settings(scenario)["co2_costs"]
358
            * global_settings(scenario)["co2_emissions"][
359
                "other_non_renewable"
360
            ] / read_costs(costs, "OCGT", "efficiency"),
361
            "lignite": global_settings(scenario)["fuel_costs"]["lignite"]
362
            / read_costs(costs, "lignite", "efficiency")
363
            + read_costs(costs, "lignite", "VOM")
364
            + global_settings(scenario)["co2_costs"]
365
            * global_settings(scenario)["co2_emissions"]["lignite"]
366
            / read_costs(costs, "lignite", "efficiency"),
367
            "coal": global_settings(scenario)["fuel_costs"]["coal"]
368
            / read_costs(costs, "coal", "efficiency")
369
            + read_costs(costs, "coal", "VOM")
370
            + global_settings(scenario)["co2_costs"]
371
            * global_settings(scenario)["co2_emissions"]["coal"]
372
            / read_costs(costs, "coal", "efficiency"),
373
            "nuclear": global_settings(scenario)["fuel_costs"]["nuclear"]
374
            / read_costs(costs, "nuclear", "efficiency")
375
            + read_costs(costs, "nuclear", "VOM"),
376
            "biomass": global_settings(scenario)["fuel_costs"]["biomass"]
377
            / read_costs(costs, "biomass", "efficiency")
378
            + read_costs(costs, "biomass CHP", "VOM"),
379
            "wind_offshore": read_costs(costs, "offwind", "VOM"),
380
            "wind_onshore": read_costs(costs, "onwind", "VOM"),
381
            "solar": read_costs(costs, "solar", "VOM"),
382
        }
383
384
    elif scenario == "eGon100RE":
385
        costs = read_csv(2050)
386
387
        parameters = {"grid_topology": "Status Quo"}
388
389
        # Insert effciencies in p.u.
390
        parameters["efficiency"] = {
391
            "battery": {
392
                "store": read_costs(costs, "battery inverter", "efficiency")
393
                ** 0.5,
394
                "dispatch": read_costs(costs, "battery inverter", "efficiency")
395
                ** 0.5,
396
                "standing_loss": 0,
397
                "max_hours": 6,
398
                "cyclic_state_of_charge": True,
399
            },
400
            "pumped_hydro": {
401
                "store": read_costs(costs, "PHS", "efficiency") ** 0.5,
402
                "dispatch": read_costs(costs, "PHS", "efficiency") ** 0.5,
403
                "standing_loss": 0,
404
                "max_hours": 6,
405
                "cyclic_state_of_charge": True,
406
            },
407
        }
408
        # Warning: Electrical parameters are set in osmTGmod, editing these values will not change the data!
409
        parameters["electrical_parameters"] = {
410
            "ac_line_110kV": {
411
                "s_nom": 260,  # [MVA]
412
                "R": 0.109,  # [Ohm/km]
413
                "L": 1.2,  # [mH/km]
414
            },
415
            "ac_cable_110kV": {
416
                "s_nom": 280,  # [MVA]
417
                "R": 0.0177,  # [Ohm/km]
418
                "L": 0.3,  # [mH/km]
419
            },
420
            "ac_line_220kV": {
421
                "s_nom": 520,  # [MVA]
422
                "R": 0.109,  # [Ohm/km]
423
                "L": 1.0,  # [mH/km]
424
            },
425
            "ac_cable_220kV": {
426
                "s_nom": 550,  # [MVA]
427
                "R": 0.0176,  # [Ohm/km]
428
                "L": 0.3,  # [mH/km]
429
            },
430
            "ac_line_380kV": {
431
                "s_nom": 1790,  # [MVA]
432
                "R": 0.028,  # [Ohm/km]
433
                "L": 0.8,  # [mH/km]
434
            },
435
            "ac_cable_380kV": {
436
                "s_nom": 925,  # [MVA]
437
                "R": 0.0175,  # [Ohm/km]
438
                "L": 0.3,  # [mH/km]
439
            },
440
        }
441
442
        # Insert overnight investment costs
443
        # Source for transformer costs: Netzentwicklungsplan Strom 2035, Version 2021, 2. Entwurf
444
        # Source for HV lines and cables: Dena Verteilnetzstudie 2021, p. 146
445
        parameters["overnight_cost"] = {
446
            "ac_ehv_overhead_line": read_costs(
447
                costs, "HVAC overhead", "investment"
448
            ),  # [EUR/km/MW]
449
            "ac_hv_overhead_line": 0.06e6
450
            / parameters["electrical_parameters"]["ac_line_110kV"][
451
                "s_nom"
452
            ],  # [EUR/km/MW]
453
            "ac_hv_cable": 0.8e6
454
            / parameters["electrical_parameters"]["ac_cable_110kV"][
455
                "s_nom"
456
            ],  # [EUR/km/MW]
457
            "dc_overhead_line": read_costs(
458
                costs, "HVDC overhead", "investment"
459
            ),
460
            "dc_cable": read_costs(costs, "HVDC overhead", "investment"),
461
            "dc_inverter": read_costs(
462
                costs, "HVDC inverter pair", "investment"
463
            ),
464
            "transformer_380_110": 17.33e3,  # [EUR/MVA]
465
            "transformer_380_220": 13.33e3,  # [EUR/MVA]
466
            "transformer_220_110": 17.5e3,  # [EUR/MVA]
467
            "battery inverter": read_costs(
468
                costs, "battery inverter", "investment"
469
            ),
470
            "battery storage": read_costs(
471
                costs, "battery storage", "investment"
472
            ),
473
        }
474
475
        parameters["lifetime"] = {
476
            "ac_ehv_overhead_line": read_costs(
477
                costs, "HVAC overhead", "lifetime"
478
            ),
479
            "ac_ehv_cable": read_costs(costs, "HVAC overhead", "lifetime"),
480
            "ac_hv_overhead_line": read_costs(
481
                costs, "HVAC overhead", "lifetime"
482
            ),
483
            "ac_hv_cable": read_costs(costs, "HVAC overhead", "lifetime"),
484
            "dc_overhead_line": read_costs(costs, "HVDC overhead", "lifetime"),
485
            "dc_cable": read_costs(costs, "HVDC overhead", "lifetime"),
486
            "dc_inverter": read_costs(costs, "HVDC inverter pair", "lifetime"),
487
            "transformer_380_110": read_costs(
488
                costs, "HVAC overhead", "lifetime"
489
            ),
490
            "transformer_380_220": read_costs(
491
                costs, "HVAC overhead", "lifetime"
492
            ),
493
            "transformer_220_110": read_costs(
494
                costs, "HVAC overhead", "lifetime"
495
            ),
496
            "battery inverter": read_costs(
497
                costs, "battery inverter", "lifetime"
498
            ),
499
            "battery storage": read_costs(
500
                costs, "battery storage", "lifetime"
501
            ),
502
        }
503
        # Insert annualized capital costs
504
        # lines in EUR/km/MW/a
505
        # transfermer, inverter, battery in EUR/MW/a
506
        parameters["capital_cost"] = {}
507
508
        for comp in parameters["overnight_cost"].keys():
509
            parameters["capital_cost"][comp] = annualize_capital_costs(
510
                parameters["overnight_cost"][comp],
511
                parameters["lifetime"][comp],
512
                global_settings("eGon2035")["interest_rate"],
513
            )
514
515
        parameters["capital_cost"]["battery"] = (
516
            parameters["capital_cost"]["battery inverter"]
517
            + parameters["efficiency"]["battery"]["max_hours"]
518
            * parameters["capital_cost"]["battery storage"]
519
        )
520
521
        # Insert marginal_costs in EUR/MWh
522
        # marginal cost can include fuel, C02 and operation and maintenance costs
523
        parameters["marginal_cost"] = {
524
            "wind_offshore": read_costs(costs, "offwind", "VOM"),
525
            "wind_onshore": read_costs(costs, "onwind", "VOM"),
526
            "solar": read_costs(costs, "solar", "VOM"),
527
        }
528
529
    elif scenario == "eGon2021":
530
        parameters = {}
531
532
    elif (scenario == "status2019") or (scenario == "status2023"):
533
        costs = read_csv(2020)
534
535
        parameters = {"grid_topology": "Status Quo"}
536
        # Insert effciencies in p.u.
537
        parameters["efficiency"] = {
538
            "oil": read_costs(costs, "oil", "efficiency"),
539
            "battery": {
540
                "store": read_costs(costs, "battery inverter", "efficiency")
541
                ** 0.5,
542
                "dispatch": read_costs(costs, "battery inverter", "efficiency")
543
                ** 0.5,
544
                "standing_loss": 0,
545
                "max_hours": 6,
546
                "cyclic_state_of_charge": True,
547
            },
548
            "pumped_hydro": {
549
                "store": read_costs(costs, "PHS", "efficiency") ** 0.5,
550
                "dispatch": read_costs(costs, "PHS", "efficiency") ** 0.5,
551
                "standing_loss": 0,
552
                "max_hours": 6,
553
                "cyclic_state_of_charge": True,
554
            },
555
        }
556
        # Warning: Electrical parameters are set in osmTGmod, editing these values will not change the data!
557
        parameters["electrical_parameters"] = {
558
            "ac_line_110kV": {
559
                "s_nom": 260,  # [MVA]
560
                "R": 0.109,  # [Ohm/km]
561
                "L": 1.2,  # [mH/km]
562
            },
563
            "ac_cable_110kV": {
564
                "s_nom": 280,  # [MVA]
565
                "R": 0.0177,  # [Ohm/km]
566
                "L": 0.3,  # [mH/km]
567
            },
568
            "ac_line_220kV": {
569
                "s_nom": 520,  # [MVA]
570
                "R": 0.109,  # [Ohm/km]
571
                "L": 1.0,  # [mH/km]
572
            },
573
            "ac_cable_220kV": {
574
                "s_nom": 550,  # [MVA]
575
                "R": 0.0176,  # [Ohm/km]
576
                "L": 0.3,  # [mH/km]
577
            },
578
            "ac_line_380kV": {
579
                "s_nom": 1790,  # [MVA]
580
                "R": 0.028,  # [Ohm/km]
581
                "L": 0.8,  # [mH/km]
582
            },
583
            "ac_cable_380kV": {
584
                "s_nom": 925,  # [MVA]
585
                "R": 0.0175,  # [Ohm/km]
586
                "L": 0.3,  # [mH/km]
587
            },
588
        }
589
590
        # Insert overnight investment costs
591
        # Source for eHV grid costs: Netzentwicklungsplan Strom 2035, Version 2021, 2. Entwurf
592
        # Source for HV lines and cables: Dena Verteilnetzstudie 2021, p. 146
593
        parameters["overnight_cost"] = {
594
            "ac_ehv_overhead_line": 2.5e6
595
            / (
596
                2
597
                * parameters["electrical_parameters"]["ac_line_380kV"]["s_nom"]
598
            ),  # [EUR/km/MW]
599
            "ac_ehv_cable": 11.5e6
600
            / (
601
                2
602
                * parameters["electrical_parameters"]["ac_cable_380kV"][
603
                    "s_nom"
604
                ]
605
            ),  # [EUR/km/MW]
606
            "ac_hv_overhead_line": 0.06e6
607
            / parameters["electrical_parameters"]["ac_line_110kV"][
608
                "s_nom"
609
            ],  # [EUR/km/MW]
610
            "ac_hv_cable": 0.8e6
611
            / parameters["electrical_parameters"]["ac_cable_110kV"][
612
                "s_nom"
613
            ],  # [EUR/km/MW]
614
            "dc_overhead_line": 0.5e3,  # [EUR/km/MW]
615
            "dc_cable": 3.25e3,  # [EUR/km/MW]
616
            "dc_inverter": 0.3e6,  # [EUR/MW]
617
            "transformer_380_110": 17.33e3,  # [EUR/MVA]
618
            "transformer_380_220": 13.33e3,  # [EUR/MVA]
619
            "transformer_220_110": 17.5e3,  # [EUR/MVA]
620
            "battery inverter": read_costs(
621
                costs, "battery inverter", "investment"
622
            ),
623
            "battery storage": read_costs(
624
                costs, "battery storage", "investment"
625
            ),
626
        }
627
628
        parameters["lifetime"] = {
629
            "ac_ehv_overhead_line": read_costs(
630
                costs, "HVAC overhead", "lifetime"
631
            ),
632
            "ac_ehv_cable": read_costs(costs, "HVAC overhead", "lifetime"),
633
            "ac_hv_overhead_line": read_costs(
634
                costs, "HVAC overhead", "lifetime"
635
            ),
636
            "ac_hv_cable": read_costs(costs, "HVAC overhead", "lifetime"),
637
            "dc_overhead_line": read_costs(costs, "HVDC overhead", "lifetime"),
638
            "dc_cable": read_costs(costs, "HVDC overhead", "lifetime"),
639
            "dc_inverter": read_costs(costs, "HVDC inverter pair", "lifetime"),
640
            "transformer_380_110": read_costs(
641
                costs, "HVAC overhead", "lifetime"
642
            ),
643
            "transformer_380_220": read_costs(
644
                costs, "HVAC overhead", "lifetime"
645
            ),
646
            "transformer_220_110": read_costs(
647
                costs, "HVAC overhead", "lifetime"
648
            ),
649
            "battery inverter": read_costs(
650
                costs, "battery inverter", "lifetime"
651
            ),
652
            "battery storage": read_costs(
653
                costs, "battery storage", "lifetime"
654
            ),
655
        }
656
        # Insert annualized capital costs
657
        # lines in EUR/km/MW/a
658
        # transfermer, inverter, battery in EUR/MW/a
659
        parameters["capital_cost"] = {}
660
661
        for comp in parameters["overnight_cost"].keys():
662
            parameters["capital_cost"][comp] = annualize_capital_costs(
663
                parameters["overnight_cost"][comp],
664
                parameters["lifetime"][comp],
665
                global_settings("status2019")["interest_rate"],
666
            )
667
668
        parameters["capital_cost"]["battery"] = (
669
            parameters["capital_cost"]["battery inverter"]
670
            + parameters["efficiency"]["battery"]["max_hours"]
671
            * parameters["capital_cost"]["battery storage"]
672
        )
673
674
        parameters["marginal_cost"] = {
675
            "oil": global_settings(scenario)["fuel_costs"]["oil"]
676
            / read_costs(costs, "oil", "efficiency")
677
            + read_costs(costs, "oil", "VOM")
678
            + global_settings(scenario)["co2_costs"]
679
            * global_settings(scenario)["co2_emissions"]["oil"]
680
            / read_costs(costs, "oil", "efficiency"),
681
            "other_non_renewable": global_settings(scenario)["fuel_costs"][
682
                "gas"
683
            ] / read_costs(costs, "OCGT", "efficiency")
684
            + global_settings(scenario)["co2_costs"]
685
            * global_settings(scenario)["co2_emissions"][
686
                "other_non_renewable"
687
            ] / read_costs(costs, "OCGT", "efficiency"),
688
            "lignite": global_settings(scenario)["fuel_costs"]["lignite"]
689
            / read_costs(costs, "lignite", "efficiency")
690
            + read_costs(costs, "lignite", "VOM")
691
            + global_settings(scenario)["co2_costs"]
692
            * global_settings(scenario)["co2_emissions"]["lignite"]
693
            / read_costs(costs, "lignite", "efficiency"),
694
            "coal": global_settings(scenario)["fuel_costs"]["coal"]
695
            / read_costs(costs, "coal", "efficiency")
696
            + read_costs(costs, "coal", "VOM")
697
            + global_settings(scenario)["co2_costs"]
698
            * global_settings(scenario)["co2_emissions"]["coal"]
699
            / read_costs(costs, "coal", "efficiency"),
700
            "OCGT": global_settings(scenario)["fuel_costs"]["gas"]
701
            / read_costs(costs, "OCGT", "efficiency")
702
            + read_costs(costs, "OCGT", "VOM")
703
            + global_settings(scenario)["co2_costs"]
704
            * global_settings(scenario)["co2_emissions"]["gas"]
705
            / read_costs(costs, "OCGT", "efficiency"),
706
            "nuclear": global_settings(scenario)["fuel_costs"]["nuclear"]
707
            / read_costs(costs, "nuclear", "efficiency")
708
            + read_costs(costs, "nuclear", "VOM"),
709
            "biomass": global_settings(scenario)["fuel_costs"]["biomass"]
710
            / read_costs(costs, "biomass CHP", "efficiency")
711
            + read_costs(costs, "biomass CHP", "VOM"),
712
            "wind_offshore": read_costs(costs, "offwind", "VOM"),
713
            "wind_onshore": read_costs(costs, "onwind", "VOM"),
714
            "solar": read_costs(costs, "solar", "VOM"),
715
        }
716
717
    else:
718
        print(f"Scenario name {scenario} is not valid.")
719
720
    return parameters
0 ignored issues
show
introduced by
The variable parameters does not seem to be defined for all execution paths.
Loading history...
721
722
723
def gas(scenario):
724
    """Returns paramaters of the gas sector for the selected scenario.
725
726
    Parameters
727
    ----------
728
    scenario : str
729
        Name of the scenario.
730
731
    Returns
732
    -------
733
    parameters : dict
734
        List of parameters of gas sector
735
736
    """
737
738
    if scenario == "eGon2035":
739
        costs = read_csv(2035)
740
741
        parameters = {
742
            "main_gas_carrier": "CH4",
743
            "H2_feedin_volumetric_fraction": 0.15,
744
        }
745
        # Insert effciencies in p.u.
746
        parameters["efficiency"] = {
747
            "power_to_H2": read_costs(costs, "electrolysis", "efficiency"),
748
            "H2_to_power": read_costs(costs, "fuel cell", "efficiency"),
749
            "CH4_to_H2": read_costs(costs, "SMR", "efficiency"),
750
            "H2_feedin": 1,
751
            "H2_to_CH4": read_costs(costs, "methanation", "efficiency"),
752
            "OCGT": read_costs(costs, "OCGT", "efficiency"),
753
        }
754
        # Insert overnight investment costs
755
        parameters["overnight_cost"] = {
756
            "power_to_H2": read_costs(costs, "electrolysis", "investment"),
757
            "H2_to_power": read_costs(costs, "fuel cell", "investment"),
758
            "CH4_to_H2": read_costs(costs, "SMR", "investment"),
759
            "H2_to_CH4": read_costs(costs, "methanation", "investment"),
760
            "H2_feedin": 0,
761
            "H2_underground": read_costs(
762
                costs, "hydrogen storage underground", "investment"
763
            ),
764
            "H2_overground": read_costs(
765
                costs, "hydrogen storage tank incl. compressor", "investment"
766
            ),
767
            "H2_pipeline": read_costs(
768
                costs, "H2 (g) pipeline", "investment"
769
            ),  # [EUR/MW/km]
770
        }
771
772
        # Insert lifetime
773
        parameters["lifetime"] = {
774
            "power_to_H2": read_costs(costs, "electrolysis", "lifetime"),
775
            "H2_to_power": read_costs(costs, "fuel cell", "lifetime"),
776
            "CH4_to_H2": read_costs(costs, "SMR", "lifetime"),
777
            "H2_to_CH4": read_costs(costs, "methanation", "lifetime"),
778
            "H2_underground": read_costs(
779
                costs, "hydrogen storage underground", "lifetime"
780
            ),
781
            "H2_overground": read_costs(
782
                costs, "hydrogen storage tank incl. compressor", "lifetime"
783
            ),
784
            "H2_pipeline": read_costs(costs, "H2 (g) pipeline", "lifetime"),
785
            "H2_feedin": read_costs(costs, "CH4 (g) pipeline", "lifetime"),
786
        }
787
788
        # Insert annualized capital costs
789
        parameters["capital_cost"] = {}
790
791
        for comp in parameters["overnight_cost"].keys():
792
            parameters["capital_cost"][comp] = annualize_capital_costs(
793
                parameters["overnight_cost"][comp],
794
                parameters["lifetime"][comp],
795
                global_settings("eGon2035")["interest_rate"],
796
            )
797
798
        parameters["marginal_cost"] = {
799
            "CH4": global_settings(scenario)["fuel_costs"]["gas"]
800
            + global_settings(scenario)["co2_costs"]
801
            * global_settings(scenario)["co2_emissions"]["gas"],
802
            "OCGT": read_costs(costs, "OCGT", "VOM"),
803
            "biogas": global_settings(scenario)["fuel_costs"]["gas"],
804
            "chp_gas": read_costs(costs, "central gas CHP", "VOM"),
805
        }
806
807
        # Insert max gas production (generator) over the year
808
        parameters["max_gas_generation_overtheyear"] = {
809
            "CH4": 36000000,  # [MWh] Netzentwicklungsplan Gas 2020–2030
810
            "biogas": 10000000,  # [MWh] Netzentwicklungsplan Gas 2020–2030
811
        }
812
813
    elif scenario == "eGon100RE":
814
        costs = read_csv(2050)
815
        interest_rate = 0.07  # [p.u.]
816
817
        parameters = {
818
            "main_gas_carrier": "H2",
819
            "retrofitted_CH4pipeline-to-H2pipeline_share": 0.23,
820
            # p-e-s result, this value is overwritten if p-e-s is run
821
        }
822
        # Insert effciencies in p.u.
823
        parameters["efficiency"] = {
824
            "power_to_H2": read_costs(costs, "electrolysis", "efficiency"),
825
            "H2_to_power": read_costs(costs, "fuel cell", "efficiency"),
826
            "CH4_to_H2": read_costs(costs, "SMR", "efficiency"),
827
            "H2_to_CH4": read_costs(costs, "methanation", "efficiency"),
828
            "OCGT": read_costs(costs, "OCGT", "efficiency"),
829
        }
830
831
        # Insert FOM in %
832
        parameters["FOM"] = {
833
            "H2_underground": read_costs(
834
                costs, "hydrogen storage underground", "FOM"
835
            ),
836
            "H2_overground": read_costs(
837
                costs, "hydrogen storage tank incl. compressor", "FOM"
838
            ),
839
            "power_to_H2": read_costs(costs, "electrolysis", "FOM"),
840
            "H2_to_power": read_costs(costs, "fuel cell", "FOM"),
841
            "CH4_to_H2": read_costs(costs, "SMR", "FOM"),
842
            "H2_to_CH4": read_costs(costs, "methanation", "FOM"),
843
            "H2_pipeline": read_costs(costs, "H2 (g) pipeline", "FOM"),
844
            "H2_pipeline_retrofit": read_costs(
845
                costs, "H2 (g) pipeline repurposed", "FOM"
846
            ),
847
        }
848
849
        # Insert overnight investment costs
850
        parameters["overnight_cost"] = {
851
            "power_to_H2": read_costs(costs, "electrolysis", "investment"),
852
            "H2_to_power": read_costs(costs, "fuel cell", "investment"),
853
            "CH4_to_H2": read_costs(costs, "SMR", "investment"),
854
            "H2_to_CH4": read_costs(costs, "methanation", "investment"),
855
            "H2_underground": read_costs(
856
                costs, "hydrogen storage underground", "investment"
857
            ),
858
            "H2_overground": read_costs(
859
                costs, "hydrogen storage tank incl. compressor", "investment"
860
            ),
861
            "H2_pipeline": read_costs(
862
                costs, "H2 (g) pipeline", "investment"
863
            ),  # [EUR/MW/km]
864
            "H2_pipeline_retrofit": read_costs(
865
                costs, "H2 (g) pipeline repurposed", "investment"
866
            ),  # [EUR/MW/km]
867
        }
868
869
        # Insert lifetime
870
        parameters["lifetime"] = {
871
            "power_to_H2": read_costs(costs, "electrolysis", "lifetime"),
872
            "H2_to_power": read_costs(costs, "fuel cell", "lifetime"),
873
            "CH4_to_H2": read_costs(costs, "SMR", "lifetime"),
874
            "H2_to_CH4": read_costs(costs, "methanation", "lifetime"),
875
            "H2_underground": read_costs(
876
                costs, "hydrogen storage underground", "lifetime"
877
            ),
878
            "H2_overground": read_costs(
879
                costs, "hydrogen storage tank incl. compressor", "lifetime"
880
            ),
881
            "H2_pipeline": read_costs(costs, "H2 (g) pipeline", "lifetime"),
882
            "H2_pipeline_retrofit": read_costs(
883
                costs, "H2 (g) pipeline repurposed", "lifetime"
884
            ),
885
        }
886
887
        # Insert costs
888
        parameters["capital_cost"] = {}
889
890
        for comp in parameters["overnight_cost"].keys():
891
            parameters["capital_cost"][comp] = annualize_capital_costs(
892
                parameters["overnight_cost"][comp],
893
                parameters["lifetime"][comp],
894
                interest_rate,
895
            ) + parameters["overnight_cost"][comp] * (
896
                parameters["FOM"][comp] / 100
897
            )
898
899
        for comp in ["H2_to_power", "H2_to_CH4"]:
900
            parameters["capital_cost"][comp] = (
901
                annualize_capital_costs(
902
                    parameters["overnight_cost"][comp],
903
                    parameters["lifetime"][comp],
904
                    interest_rate,
905
                )
906
                + parameters["overnight_cost"][comp]
907
                * (parameters["FOM"][comp] / 100)
908
            ) * parameters["efficiency"][comp]
909
910
        parameters["marginal_cost"] = {
911
            "OCGT": read_costs(costs, "OCGT", "VOM"),
912
            "biogas": read_costs(costs, "biogas", "fuel"),
913
            "chp_gas": read_costs(costs, "central gas CHP", "VOM"),
914
        }
915
916
    elif scenario == "eGon2021":
917
        parameters = {}
918
919
    elif scenario == "status2019":
920
        costs = read_csv(2020)
921
        parameters = {
922
            "main_gas_carrier": "CH4",
923
        }
924
925
        parameters["marginal_cost"] = {
926
            "CH4": global_settings(scenario)["fuel_costs"]["gas"]
927
            + global_settings(scenario)["co2_costs"]
928
            * global_settings(scenario)["co2_emissions"]["gas"],
929
            "OCGT": read_costs(costs, "OCGT", "VOM"),
930
            "biogas": global_settings(scenario)["fuel_costs"]["gas"],
931
            "chp_gas": read_costs(costs, "central gas CHP", "VOM"),
932
        }
933
        # Insert effciencies in p.u.
934
        parameters["efficiency"] = {
935
            "OCGT": read_costs(costs, "OCGT", "efficiency"),
936
        }
937
938
    else:
939
        print(f"Scenario name {scenario} is not valid.")
940
941
    return parameters
0 ignored issues
show
introduced by
The variable parameters does not seem to be defined for all execution paths.
Loading history...
942
943
944
def mobility(scenario):
945
    """Returns parameters of the mobility sector for the selected scenario.
946
947
    Parameters
948
    ----------
949
    scenario : str
950
        Name of the scenario.
951
952
    Returns
953
    -------
954
    parameters : dict
955
        List of parameters of mobility sector
956
957
    Notes
958
    -----
959
    For a detailed description of the parameters see module
960
    :mod:`egon.data.datasets.emobility.motorized_individual_travel`.
961
    """
962
963
    if scenario == "eGon2035":
964
        parameters = {
965
            "motorized_individual_travel": {
966
                "NEP C 2035": {
967
                    "ev_count": 15100000,
968
                    "bev_mini_share": 0.1589,
969
                    "bev_medium_share": 0.3533,
970
                    "bev_luxury_share": 0.1053,
971
                    "phev_mini_share": 0.0984,
972
                    "phev_medium_share": 0.2189,
973
                    "phev_luxury_share": 0.0652,
974
                    "model_parameters": {},
975
                }
976
            }
977
        }
978
979
    elif scenario == "eGon100RE":
980
        # eGon100RE has 3 Scenario variations
981
        #   * allocation will always be done for all scenarios
982
        #   * model data will be written to tables `egon_etrago_*` only
983
        #     for the variation as speciefied in `datasets.yml`
984
        parameters = {
985
            "motorized_individual_travel": {
986
                "Reference 2050": {
987
                    "ev_count": 25065000,
988
                    "bev_mini_share": 0.1589,
989
                    "bev_medium_share": 0.3533,
990
                    "bev_luxury_share": 0.1053,
991
                    "phev_mini_share": 0.0984,
992
                    "phev_medium_share": 0.2189,
993
                    "phev_luxury_share": 0.0652,
994
                    "model_parameters": {},
995
                },
996
                "Mobility Transition 2050": {
997
                    "ev_count": 37745000,
998
                    "bev_mini_share": 0.1589,
999
                    "bev_medium_share": 0.3533,
1000
                    "bev_luxury_share": 0.1053,
1001
                    "phev_mini_share": 0.0984,
1002
                    "phev_medium_share": 0.2189,
1003
                    "phev_luxury_share": 0.0652,
1004
                    "model_parameters": {},
1005
                },
1006
                "Electrification 2050": {
1007
                    "ev_count": 47700000,
1008
                    "bev_mini_share": 0.1589,
1009
                    "bev_medium_share": 0.3533,
1010
                    "bev_luxury_share": 0.1053,
1011
                    "phev_mini_share": 0.0984,
1012
                    "phev_medium_share": 0.2189,
1013
                    "phev_luxury_share": 0.0652,
1014
                    "model_parameters": {},
1015
                },
1016
            }
1017
        }
1018
1019
    elif scenario == "eGon2021":
1020
        parameters = {}
1021
1022
    elif scenario == "status2019":
1023
        parameters = {
1024
            "motorized_individual_travel": {
1025
                "status2019": {
1026
                    "ev_count": 200000,
1027
                    "bev_mini_share": 0.1589,
1028
                    "bev_medium_share": 0.3533,
1029
                    "bev_luxury_share": 0.1053,
1030
                    "phev_mini_share": 0.0984,
1031
                    "phev_medium_share": 0.2189,
1032
                    "phev_luxury_share": 0.0652,
1033
                    "model_parameters": {},
1034
                }
1035
            }
1036
        }
1037
1038
    elif scenario == "status2023":
1039
        parameters = {
1040
            "motorized_individual_travel": {
1041
                "status2023": {
1042
                    "ev_count": 2577664,
1043
                    "bev_mini_share": 0.1535,
1044
                    "bev_medium_share": 0.3412,
1045
                    "bev_luxury_share": 0.1017,
1046
                    "phev_mini_share": 0.1038,
1047
                    "phev_medium_share": 0.2310,
1048
                    "phev_luxury_share": 0.0688,
1049
                    "model_parameters": {},
1050
                }
1051
            }
1052
        }
1053
1054
    else:
1055
        print(f"Scenario name {scenario} is not valid.")
1056
        parameters = dict()
1057
1058
    return parameters
1059
1060
1061
def heat(scenario):
1062
    """Returns paramaters of the heat sector for the selected scenario.
1063
1064
    Parameters
1065
    ----------
1066
    scenario : str
1067
        Name of the scenario.
1068
1069
    Returns
1070
    -------
1071
    parameters : dict
1072
        List of parameters of heat sector
1073
1074
    """
1075
1076
    if scenario == "eGon2035":
1077
        costs = read_csv(2035)
1078
1079
        parameters = {
1080
            "DE_demand_reduction_residential": 0.854314018923104,
1081
            "DE_demand_reduction_service": 0.498286864771128,
1082
            "DE_district_heating_share": 0.14,
1083
        }
1084
1085
        # Insert efficiency in p.u.
1086
        parameters["efficiency"] = {
1087
            "water_tank_charger": read_costs(
1088
                costs, "water tank charger", "efficiency"
1089
            ),
1090
            "water_tank_discharger": read_costs(
1091
                costs, "water tank discharger", "efficiency"
1092
            ),
1093
            "central_resistive_heater": read_costs(
1094
                costs, "central resistive heater", "efficiency"
1095
            ),
1096
            "central_gas_boiler": read_costs(
1097
                costs, "central gas boiler", "efficiency"
1098
            ),
1099
            "rural_resistive_heater": read_costs(
1100
                costs, "decentral resistive heater", "efficiency"
1101
            ),
1102
            "rural_gas_boiler": read_costs(
1103
                costs, "decentral gas boiler", "efficiency"
1104
            ),
1105
        }
1106
1107
        # Insert overnight investment costs, in EUR/MWh
1108
        parameters["overnight_cost"] = {
1109
            "central_water_tank": read_costs(
1110
                costs, "central water tank storage", "investment"
1111
            ),
1112
            "rural_water_tank": read_costs(
1113
                costs, "decentral water tank storage", "investment"
1114
            ),
1115
        }
1116
1117
        # Insert lifetime
1118
        parameters["lifetime"] = {
1119
            "central_water_tank": read_costs(
1120
                costs, "central water tank storage", "lifetime"
1121
            ),
1122
            "rural_water_tank": read_costs(
1123
                costs, "decentral water tank storage", "lifetime"
1124
            ),
1125
        }
1126
1127
        # Insert annualized capital costs
1128
        parameters["capital_cost"] = {}
1129
1130
        for comp in parameters["overnight_cost"].keys():
1131
            parameters["capital_cost"][comp] = annualize_capital_costs(
1132
                parameters["overnight_cost"][comp],
1133
                parameters["lifetime"][comp],
1134
                global_settings("eGon2035")["interest_rate"],
1135
            )
1136
1137
        # Insert marginal_costs in EUR/MWh
1138
        # marginal cost can include fuel, C02 and operation and maintenance costs
1139
        parameters["marginal_cost"] = {
1140
            "central_heat_pump": read_costs(
1141
                costs, "central air-sourced heat pump", "VOM"
1142
            ),
1143
            "central_gas_chp": read_costs(costs, "central gas CHP", "VOM"),
1144
            "central_gas_boiler": read_costs(
1145
                costs, "central gas boiler", "VOM"
1146
            ),
1147
            "central_resistive_heater": read_costs(
1148
                costs, "central resistive heater", "VOM"
1149
            ),
1150
            "geo_thermal": 2.9,  # Danish Energy Agency
1151
            "water_tank_charger": 0,  # Danish Energy Agency
1152
            "water_tank_discharger": 0,  # Danish Energy Agency
1153
            "rural_heat_pump": 0,  # Danish Energy Agency, Technology Data for Individual Heating Plants
1154
        }
1155
1156
    elif scenario == "eGon100RE":
1157
        parameters = {
1158
            "DE_demand_reduction_residential": 0.640720648501849,
1159
            "DE_demand_reduction_service": 0.390895195300713,
1160
            "DE_district_heating_share": 0.19,
1161
        }
1162
1163
    elif scenario == "eGon2021":
1164
        parameters = {}
1165
1166
    elif scenario == "status2019":
1167
        parameters = {
1168
            "DE_demand_residential_TJ": 1658400
1169
            + 383300,  # [TJ], space heating + hot water, source: AG Energiebilanzen 2019 (https://ag-energiebilanzen.de/wp-content/uploads/2020/10/ageb_20v_v1.pdf)
1170
            "DE_demand_service_TJ": 567300
1171
            + 71500,  # [TJ], space heating + hot water, source: AG Energiebilanzen 2019 (https://ag-energiebilanzen.de/wp-content/uploads/2020/10/ageb_20v_v1.pdf)
1172
            "DE_district_heating_share": (189760 + 38248)
1173
            / (
1174
                1658400 + 383300 + 567300 + 71500
1175
            ),  # [TJ], source: AG Energiebilanzen 2019 (https://ag-energiebilanzen.de/wp-content/uploads/2021/11/bilanz19d.xlsx)
1176
        }
1177
1178
        costs = read_csv(2020)
1179
1180
        # Insert marginal_costs in EUR/MWh
1181
        # marginal cost can include fuel, C02 and operation and maintenance costs
1182
        parameters["marginal_cost"] = {
1183
            "central_heat_pump": read_costs(
1184
                costs, "central air-sourced heat pump", "VOM"
1185
            ),
1186
            "central_gas_chp": read_costs(costs, "central gas CHP", "VOM"),
1187
            "central_gas_boiler": read_costs(
1188
                costs, "central gas boiler", "VOM"
1189
            ),
1190
            "central_resistive_heater": read_costs(
1191
                costs, "central resistive heater", "VOM"
1192
            ),
1193
            "rural_heat_pump": 0,  # Danish Energy Agency, Technology Data for Individual Heating Plants
1194
        }
1195
1196
        # Insert efficiency in p.u.
1197
        parameters["efficiency"] = {
1198
            "central_gas_boiler": read_costs(
1199
                costs, "central gas boiler", "efficiency"
1200
            ),
1201
        }
1202
1203
    # elif scenario == "status2023":
1204
    #     parameters = {
1205
    #         #  source: AG Energiebilanzen 2022  https://ag-energiebilanzen.de/wp-content/uploads/2023/01/AGEB_22p2_rev-1.pdf
1206
    #         "DE_demand_residential_TJ": 1754.2 * 1e3
1207
    #         + 407.5 * 1e3,  # [TJ], Endenergieverbrauch Haushalte 2.1 Raumwärme + Warmwasser
1208
    #         "DE_demand_service_TJ": 668.4 * 1e3
1209
    #         + 44.3 * 1e3 ,  # [TJ], Endenergieverbrauch GHD 3.1 Raumwärme + Warmwasser
1210
    #         "DE_district_heating_share": (189760 + 38248)
1211
    #         / (
1212
    #             1658400 + 383300 + 567300 + 71500
1213
    #         ),  # [TJ], source: AG Energiebilanzen 2019 (https://ag-energiebilanzen.de/wp-content/uploads/2021/11/bilanz19d.xlsx)
1214
    #     } # TODO status2023 needs update
1215
    #
1216
    #     costs = read_csv(2020)
1217
    #
1218
    #     # Insert marginal_costs in EUR/MWh
1219
    #     # marginal cost can include fuel, C02 and operation and maintenance costs
1220
    #     parameters["marginal_cost"] = {
1221
    #         "central_heat_pump": read_costs(
1222
    #             costs, "central air-sourced heat pump", "VOM"
1223
    #         ),
1224
    #         "central_gas_chp": read_costs(costs, "central gas CHP", "VOM"),
1225
    #         "central_gas_boiler": read_costs(
1226
    #             costs, "central gas boiler", "VOM"
1227
    #         ),
1228
    #         "central_resistive_heater": read_costs(
1229
    #             costs, "central resistive heater", "VOM"
1230
    #         ),
1231
    #         "rural_heat_pump": 0,  # Danish Energy Agency, Technology Data for Individual Heating Plants
1232
    #     }
1233
    #
1234
    #     # Insert efficiency in p.u.
1235
    #     parameters["efficiency"] = {
1236
    #         "central_gas_boiler": read_costs(
1237
    #             costs, "central gas boiler", "efficiency"
1238
    #         ),
1239
    #     }
1240
1241
    else:
1242
        print(f"Scenario name {scenario} is not valid.")
1243
1244
    return parameters
0 ignored issues
show
introduced by
The variable parameters does not seem to be defined for all execution paths.
Loading history...
1245