Completed
Push — dev ( 8582b4...82307e )
by
unknown
30s queued 19s
created

data.datasets.scenario_parameters.parameters.heat()   B

Complexity

Conditions 5

Size

Total Lines 110
Code Lines 57

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
eloc 57
dl 0
loc 110
rs 7.9406
c 0
b 0
f 0
cc 5
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
            "interest_rate": 0.05,  # [p.u.]
120
        }
121
122
    elif scenario == "eGon2021":
123
        parameters = {
124
            "weather_year": 2011,
125
            "population_year": 2021,
126
        }
127
128
    elif scenario == "status2023":
129
        parameters = {
130
            "weather_year": 2023,
131
            "population_year": 2019,  # TODO: check if possible for 2023
132
            "fuel_costs": {
133
                # TYNDP 2020, data for 2023 (https://2020.entsos-tyndp-scenarios.eu/fuel-commodities-and-carbon-prices/)
134
                "oil": 16.4 * 3.6,  # [EUR/MWh]
135
                "gas": 6.1 * 3.6,  # [EUR/MWh]
136
                "coal": 3.4 * 3.6,  # [EUR/MWh]
137
                "lignite": 1.1 * 3.6,  # [EUR/MWh]
138
                "nuclear": 0.47 * 3.6,  # [EUR/MWh]
139
                "biomass": read_costs(read_csv(2020), "biomass", "fuel"),
140
            },
141
            "co2_costs": 83.66,  # [EUR/t_CO2], source:
142
            # https://www.iwr.de/news/co2-emissionshandel-deutschland-erzielt-2023-rekordeinnahmen-von-ueber-18-mrd-euro-news38528
143
            "co2_emissions": {
144
                # Netzentwicklungsplan Strom 2037, Genehmigtr Scenariorahmen, p. 66, table 21
145
                # https://www.netzentwicklungsplan.de/sites/default/files/2023-01/Szenariorahmen_2037_Genehmigung.pdf
146
                "waste": 0.165,  # [t_CO2/MW_th]
147
                "lignite": 0.393,  # [t_CO2/MW_th]
148
                "gas": 0.201,  # [t_CO2/MW_th]
149
                "nuclear": 0.0,  # [t_CO2/MW_th]
150
                "oil": 0.288,  # [t_CO2/MW_th]
151
                "coal": 0.337,  # [t_CO2/MW_th]
152
                "other_non_renewable": 0.268,  # [t_CO2/MW_th]
153
            },
154
            "interest_rate": 0.05,  # [p.u.]
155
        }
156
157
    elif scenario == "status2019":
158
        parameters = {
159
            "weather_year": 2011,
160
            "population_year": 2019,
161
            "fuel_costs": {  # TYNDP 2020, data for 2020 (https://2020.entsos-tyndp-scenarios.eu/fuel-commodities-and-carbon-prices/)
162
                "oil": 12.9*3.6,  # [EUR/MWh]
163
                "gas": 5.6*3.6,  # [EUR/MWh]
164
                "coal": 3.0*3.6,  # [EUR/MWh]
165
                "lignite": 1.1*3.6,  # [EUR/MWh]
166
                "nuclear": 0.47*3.6,  # [EUR/MWh]
167
                "biomass": read_costs(read_csv(2020), "biomass", "fuel"),
168
            },
169
            "co2_costs": 24.7,  # [EUR/t_CO2], source:
170
                #https://de.statista.com/statistik/daten/studie/1304069/umfrage/preisentwicklung-von-co2-emissionsrechten-in-eu/
171
            "co2_emissions": {  # Netzentwicklungsplan Strom 2035, Version 2021, 1. Entwurf, p. 40, table 8
172
                "waste": 0.165,  # [t_CO2/MW_th]
173
                "lignite": 0.393,  # [t_CO2/MW_th]
174
                "gas": 0.201,  # [t_CO2/MW_th]
175
                "nuclear": 0.0,  # [t_CO2/MW_th]
176
                "oil": 0.288,  # [t_CO2/MW_th]
177
                "coal": 0.335,  # [t_CO2/MW_th]
178
                "other_non_renewable": 0.268,  # [t_CO2/MW_th]
179
            },
180
            "interest_rate": 0.05,  # [p.u.]
181
        }
182
183
    else:
184
        print(f"Scenario name {scenario} is not valid.")
185
186
    return parameters
187
188
189
def electricity(scenario):
190
    """Returns paramaters of the electricity sector for the selected scenario.
191
192
    Parameters
193
    ----------
194
    scenario : str
195
        Name of the scenario.
196
197
    Returns
198
    -------
199
    parameters : dict
200
        List of parameters of electricity sector
201
202
    """
203
204
    if scenario == "eGon2035":
205
        costs = read_csv(2035)
206
207
        parameters = {"grid_topology": "Status Quo"}
208
        # Insert effciencies in p.u.
209
        parameters["efficiency"] = {
210
            "oil": read_costs(costs, "oil", "efficiency"),
211
            "battery": {
212
                "store": read_costs(costs, "battery inverter", "efficiency")
213
                ** 0.5,
214
                "dispatch": read_costs(costs, "battery inverter", "efficiency")
215
                ** 0.5,
216
                "standing_loss": 0,
217
                "max_hours": 6,
218
                "cyclic_state_of_charge": True,
219
            },
220
            "pumped_hydro": {
221
                "store": read_costs(costs, "PHS", "efficiency") ** 0.5,
222
                "dispatch": read_costs(costs, "PHS", "efficiency") ** 0.5,
223
                "standing_loss": 0,
224
                "max_hours": 6,
225
                "cyclic_state_of_charge": True,
226
            },
227
        }
228
        # Warning: Electrical parameters are set in osmTGmod, editing these values will not change the data!
229
        parameters["electrical_parameters"] = {
230
            "ac_line_110kV": {
231
                "s_nom": 260,  # [MVA]
232
                "R": 0.109,  # [Ohm/km]
233
                "L": 1.2,  # [mH/km]
234
            },
235
            "ac_cable_110kV": {
236
                "s_nom": 280,  # [MVA]
237
                "R": 0.0177,  # [Ohm/km]
238
                "L": 0.3,  # [mH/km]
239
            },
240
            "ac_line_220kV": {
241
                "s_nom": 520,  # [MVA]
242
                "R": 0.109,  # [Ohm/km]
243
                "L": 1.0,  # [mH/km]
244
            },
245
            "ac_cable_220kV": {
246
                "s_nom": 550,  # [MVA]
247
                "R": 0.0176,  # [Ohm/km]
248
                "L": 0.3,  # [mH/km]
249
            },
250
            "ac_line_380kV": {
251
                "s_nom": 1790,  # [MVA]
252
                "R": 0.028,  # [Ohm/km]
253
                "L": 0.8,  # [mH/km]
254
            },
255
            "ac_cable_380kV": {
256
                "s_nom": 925,  # [MVA]
257
                "R": 0.0175,  # [Ohm/km]
258
                "L": 0.3,  # [mH/km]
259
            },
260
        }
261
262
        # Insert overnight investment costs
263
        # Source for eHV grid costs: Netzentwicklungsplan Strom 2035, Version 2021, 2. Entwurf
264
        # Source for HV lines and cables: Dena Verteilnetzstudie 2021, p. 146
265
        parameters["overnight_cost"] = {
266
            "ac_ehv_overhead_line": 2.5e6
267
            / (
268
                2
269
                * parameters["electrical_parameters"]["ac_line_380kV"]["s_nom"]
270
            ),  # [EUR/km/MW]
271
            "ac_ehv_cable": 11.5e6
272
            / (
273
                2
274
                * parameters["electrical_parameters"]["ac_cable_380kV"][
275
                    "s_nom"
276
                ]
277
            ),  # [EUR/km/MW]
278
            "ac_hv_overhead_line": 0.06e6
279
            / parameters["electrical_parameters"]["ac_line_110kV"][
280
                "s_nom"
281
            ],  # [EUR/km/MW]
282
            "ac_hv_cable": 0.8e6
283
            / parameters["electrical_parameters"]["ac_cable_110kV"][
284
                "s_nom"
285
            ],  # [EUR/km/MW]
286
            "dc_overhead_line": 0.5e3,  # [EUR/km/MW]
287
            "dc_cable": 3.25e3,  # [EUR/km/MW]
288
            "dc_inverter": 0.3e6,  # [EUR/MW]
289
            "transformer_380_110": 17.33e3,  # [EUR/MVA]
290
            "transformer_380_220": 13.33e3,  # [EUR/MVA]
291
            "transformer_220_110": 17.5e3,  # [EUR/MVA]
292
            "battery inverter": read_costs(
293
                costs, "battery inverter", "investment"
294
            ),
295
            "battery storage": read_costs(
296
                costs, "battery storage", "investment"
297
            ),
298
        }
299
300
        parameters["lifetime"] = {
301
            "ac_ehv_overhead_line": read_costs(
302
                costs, "HVAC overhead", "lifetime"
303
            ),
304
            "ac_ehv_cable": read_costs(costs, "HVAC overhead", "lifetime"),
305
            "ac_hv_overhead_line": read_costs(
306
                costs, "HVAC overhead", "lifetime"
307
            ),
308
            "ac_hv_cable": read_costs(costs, "HVAC overhead", "lifetime"),
309
            "dc_overhead_line": read_costs(costs, "HVDC overhead", "lifetime"),
310
            "dc_cable": read_costs(costs, "HVDC overhead", "lifetime"),
311
            "dc_inverter": read_costs(costs, "HVDC inverter pair", "lifetime"),
312
            "transformer_380_110": read_costs(
313
                costs, "HVAC overhead", "lifetime"
314
            ),
315
            "transformer_380_220": read_costs(
316
                costs, "HVAC overhead", "lifetime"
317
            ),
318
            "transformer_220_110": read_costs(
319
                costs, "HVAC overhead", "lifetime"
320
            ),
321
            "battery inverter": read_costs(
322
                costs, "battery inverter", "lifetime"
323
            ),
324
            "battery storage": read_costs(
325
                costs, "battery storage", "lifetime"
326
            ),
327
        }
328
        # Insert annualized capital costs
329
        # lines in EUR/km/MW/a
330
        # transfermer, inverter, battery in EUR/MW/a
331
        parameters["capital_cost"] = {}
332
333
        for comp in parameters["overnight_cost"].keys():
334
            parameters["capital_cost"][comp] = annualize_capital_costs(
335
                parameters["overnight_cost"][comp],
336
                parameters["lifetime"][comp],
337
                global_settings("eGon2035")["interest_rate"],
338
            )
339
340
        parameters["capital_cost"]["battery"] = (
341
            parameters["capital_cost"]["battery inverter"]
342
            + parameters["efficiency"]["battery"]["max_hours"]
343
            * parameters["capital_cost"]["battery storage"]
344
        )
345
346
        # Insert marginal_costs in EUR/MWh
347
        # marginal cost can include fuel, C02 and operation and maintenance costs
348
        parameters["marginal_cost"] = {
349
            "oil": global_settings(scenario)["fuel_costs"]["oil"]
350
            / read_costs(costs, "oil", "efficiency")
351
            + read_costs(costs, "oil", "VOM")
352
            + global_settings(scenario)["co2_costs"]
353
            * global_settings(scenario)["co2_emissions"]["oil"]
354
            / read_costs(costs, "oil", "efficiency"),
355
            "other_non_renewable": global_settings(scenario)["fuel_costs"][
356
                "gas"
357
            ] / read_costs(costs, "OCGT", "efficiency")
358
            + global_settings(scenario)["co2_costs"]
359
            * global_settings(scenario)["co2_emissions"][
360
                "other_non_renewable"
361
            ] / read_costs(costs, "OCGT", "efficiency"),
362
            "lignite": global_settings(scenario)["fuel_costs"]["lignite"]
363
            / read_costs(costs, "lignite", "efficiency")
364
            + read_costs(costs, "lignite", "VOM")
365
            + global_settings(scenario)["co2_costs"]
366
            * global_settings(scenario)["co2_emissions"]["lignite"]
367
            / read_costs(costs, "lignite", "efficiency"),
368
            "coal": global_settings(scenario)["fuel_costs"]["coal"]
369
            / read_costs(costs, "coal", "efficiency")
370
            + read_costs(costs, "coal", "VOM")
371
            + global_settings(scenario)["co2_costs"]
372
            * global_settings(scenario)["co2_emissions"]["coal"]
373
            / read_costs(costs, "coal", "efficiency"),
374
            "nuclear": global_settings(scenario)["fuel_costs"]["nuclear"]
375
            / read_costs(costs, "nuclear", "efficiency")
376
            + read_costs(costs, "nuclear", "VOM"),
377
            "biomass": global_settings(scenario)["fuel_costs"]["biomass"]
378
            / read_costs(costs, "biomass", "efficiency")
379
            + read_costs(costs, "biomass CHP", "VOM"),
380
            "wind_offshore": read_costs(costs, "offwind", "VOM"),
381
            "wind_onshore": read_costs(costs, "onwind", "VOM"),
382
            "solar": read_costs(costs, "solar", "VOM"),
383
        }
384
385
    elif scenario == "eGon100RE":
386
        costs = read_csv(2050)
387
388
        parameters = {"grid_topology": "Status Quo"}
389
390
        # Insert effciencies in p.u.
391
        parameters["efficiency"] = {
392
            "battery": {
393
                "store": read_costs(costs, "battery inverter", "efficiency")
394
                ** 0.5,
395
                "dispatch": read_costs(costs, "battery inverter", "efficiency")
396
                ** 0.5,
397
                "standing_loss": 0,
398
                "max_hours": 6,
399
                "cyclic_state_of_charge": True,
400
            },
401
            "pumped_hydro": {
402
                "store": read_costs(costs, "PHS", "efficiency") ** 0.5,
403
                "dispatch": read_costs(costs, "PHS", "efficiency") ** 0.5,
404
                "standing_loss": 0,
405
                "max_hours": 6,
406
                "cyclic_state_of_charge": True,
407
            },
408
        }
409
        # Warning: Electrical parameters are set in osmTGmod, editing these values will not change the data!
410
        parameters["electrical_parameters"] = {
411
            "ac_line_110kV": {
412
                "s_nom": 260,  # [MVA]
413
                "R": 0.109,  # [Ohm/km]
414
                "L": 1.2,  # [mH/km]
415
            },
416
            "ac_cable_110kV": {
417
                "s_nom": 280,  # [MVA]
418
                "R": 0.0177,  # [Ohm/km]
419
                "L": 0.3,  # [mH/km]
420
            },
421
            "ac_line_220kV": {
422
                "s_nom": 520,  # [MVA]
423
                "R": 0.109,  # [Ohm/km]
424
                "L": 1.0,  # [mH/km]
425
            },
426
            "ac_cable_220kV": {
427
                "s_nom": 550,  # [MVA]
428
                "R": 0.0176,  # [Ohm/km]
429
                "L": 0.3,  # [mH/km]
430
            },
431
            "ac_line_380kV": {
432
                "s_nom": 1790,  # [MVA]
433
                "R": 0.028,  # [Ohm/km]
434
                "L": 0.8,  # [mH/km]
435
            },
436
            "ac_cable_380kV": {
437
                "s_nom": 925,  # [MVA]
438
                "R": 0.0175,  # [Ohm/km]
439
                "L": 0.3,  # [mH/km]
440
            },
441
        }
442
443
        # Insert overnight investment costs
444
        # Source for transformer costs: Netzentwicklungsplan Strom 2035, Version 2021, 2. Entwurf
445
        # Source for HV lines and cables: Dena Verteilnetzstudie 2021, p. 146
446
        parameters["overnight_cost"] = {
447
            "ac_ehv_overhead_line": read_costs(
448
                costs, "HVAC overhead", "investment"
449
            ),  # [EUR/km/MW]
450
            "ac_hv_overhead_line": 0.06e6
451
            / parameters["electrical_parameters"]["ac_line_110kV"][
452
                "s_nom"
453
            ],  # [EUR/km/MW]
454
            "ac_hv_cable": 0.8e6
455
            / parameters["electrical_parameters"]["ac_cable_110kV"][
456
                "s_nom"
457
            ],  # [EUR/km/MW]
458
            "dc_overhead_line": read_costs(
459
                costs, "HVDC overhead", "investment"
460
            ),
461
            "dc_cable": read_costs(costs, "HVDC overhead", "investment"),
462
            "dc_inverter": read_costs(
463
                costs, "HVDC inverter pair", "investment"
464
            ),
465
            "transformer_380_110": 17.33e3,  # [EUR/MVA]
466
            "transformer_380_220": 13.33e3,  # [EUR/MVA]
467
            "transformer_220_110": 17.5e3,  # [EUR/MVA]
468
            "battery inverter": read_costs(
469
                costs, "battery inverter", "investment"
470
            ),
471
            "battery storage": read_costs(
472
                costs, "battery storage", "investment"
473
            ),
474
        }
475
476
        parameters["lifetime"] = {
477
            "ac_ehv_overhead_line": read_costs(
478
                costs, "HVAC overhead", "lifetime"
479
            ),
480
            "ac_ehv_cable": read_costs(costs, "HVAC overhead", "lifetime"),
481
            "ac_hv_overhead_line": read_costs(
482
                costs, "HVAC overhead", "lifetime"
483
            ),
484
            "ac_hv_cable": read_costs(costs, "HVAC overhead", "lifetime"),
485
            "dc_overhead_line": read_costs(costs, "HVDC overhead", "lifetime"),
486
            "dc_cable": read_costs(costs, "HVDC overhead", "lifetime"),
487
            "dc_inverter": read_costs(costs, "HVDC inverter pair", "lifetime"),
488
            "transformer_380_110": read_costs(
489
                costs, "HVAC overhead", "lifetime"
490
            ),
491
            "transformer_380_220": read_costs(
492
                costs, "HVAC overhead", "lifetime"
493
            ),
494
            "transformer_220_110": read_costs(
495
                costs, "HVAC overhead", "lifetime"
496
            ),
497
            "battery inverter": read_costs(
498
                costs, "battery inverter", "lifetime"
499
            ),
500
            "battery storage": read_costs(
501
                costs, "battery storage", "lifetime"
502
            ),
503
        }
504
        # Insert annualized capital costs
505
        # lines in EUR/km/MW/a
506
        # transfermer, inverter, battery in EUR/MW/a
507
        parameters["capital_cost"] = {}
508
509
        for comp in parameters["overnight_cost"].keys():
510
            parameters["capital_cost"][comp] = annualize_capital_costs(
511
                parameters["overnight_cost"][comp],
512
                parameters["lifetime"][comp],
513
                global_settings("eGon2035")["interest_rate"],
514
            )
515
516
        parameters["capital_cost"]["battery"] = (
517
            parameters["capital_cost"]["battery inverter"]
518
            + parameters["efficiency"]["battery"]["max_hours"]
519
            * parameters["capital_cost"]["battery storage"]
520
        )
521
522
        # Insert marginal_costs in EUR/MWh
523
        # marginal cost can include fuel, C02 and operation and maintenance costs
524
        parameters["marginal_cost"] = {
525
            "wind_offshore": read_costs(costs, "offwind", "VOM"),
526
            "wind_onshore": read_costs(costs, "onwind", "VOM"),
527
            "solar": read_costs(costs, "solar", "VOM"),
528
        }
529
530
    elif scenario == "eGon2021":
531
        parameters = {}
532
533
    elif (scenario == "status2019") or (scenario == "status2023"):
534
        costs = read_csv(2020)
535
536
        parameters = {"grid_topology": "Status Quo"}
537
        # Insert effciencies in p.u.
538
        parameters["efficiency"] = {
539
            "oil": read_costs(costs, "oil", "efficiency"),
540
            "battery": {
541
                "store": read_costs(costs, "battery inverter", "efficiency")
542
                ** 0.5,
543
                "dispatch": read_costs(costs, "battery inverter", "efficiency")
544
                ** 0.5,
545
                "standing_loss": 0,
546
                "max_hours": 6,
547
                "cyclic_state_of_charge": True,
548
            },
549
            "pumped_hydro": {
550
                "store": read_costs(costs, "PHS", "efficiency") ** 0.5,
551
                "dispatch": read_costs(costs, "PHS", "efficiency") ** 0.5,
552
                "standing_loss": 0,
553
                "max_hours": 6,
554
                "cyclic_state_of_charge": True,
555
            },
556
        }
557
        # Warning: Electrical parameters are set in osmTGmod, editing these values will not change the data!
558
        parameters["electrical_parameters"] = {
559
            "ac_line_110kV": {
560
                "s_nom": 260,  # [MVA]
561
                "R": 0.109,  # [Ohm/km]
562
                "L": 1.2,  # [mH/km]
563
            },
564
            "ac_cable_110kV": {
565
                "s_nom": 280,  # [MVA]
566
                "R": 0.0177,  # [Ohm/km]
567
                "L": 0.3,  # [mH/km]
568
            },
569
            "ac_line_220kV": {
570
                "s_nom": 520,  # [MVA]
571
                "R": 0.109,  # [Ohm/km]
572
                "L": 1.0,  # [mH/km]
573
            },
574
            "ac_cable_220kV": {
575
                "s_nom": 550,  # [MVA]
576
                "R": 0.0176,  # [Ohm/km]
577
                "L": 0.3,  # [mH/km]
578
            },
579
            "ac_line_380kV": {
580
                "s_nom": 1790,  # [MVA]
581
                "R": 0.028,  # [Ohm/km]
582
                "L": 0.8,  # [mH/km]
583
            },
584
            "ac_cable_380kV": {
585
                "s_nom": 925,  # [MVA]
586
                "R": 0.0175,  # [Ohm/km]
587
                "L": 0.3,  # [mH/km]
588
            },
589
        }
590
591
        # Insert overnight investment costs
592
        # Source for eHV grid costs: Netzentwicklungsplan Strom 2035, Version 2021, 2. Entwurf
593
        # Source for HV lines and cables: Dena Verteilnetzstudie 2021, p. 146
594
        parameters["overnight_cost"] = {
595
            "ac_ehv_overhead_line": 2.5e6
596
            / (
597
                2
598
                * parameters["electrical_parameters"]["ac_line_380kV"]["s_nom"]
599
            ),  # [EUR/km/MW]
600
            "ac_ehv_cable": 11.5e6
601
            / (
602
                2
603
                * parameters["electrical_parameters"]["ac_cable_380kV"][
604
                    "s_nom"
605
                ]
606
            ),  # [EUR/km/MW]
607
            "ac_hv_overhead_line": 0.06e6
608
            / parameters["electrical_parameters"]["ac_line_110kV"][
609
                "s_nom"
610
            ],  # [EUR/km/MW]
611
            "ac_hv_cable": 0.8e6
612
            / parameters["electrical_parameters"]["ac_cable_110kV"][
613
                "s_nom"
614
            ],  # [EUR/km/MW]
615
            "dc_overhead_line": 0.5e3,  # [EUR/km/MW]
616
            "dc_cable": 3.25e3,  # [EUR/km/MW]
617
            "dc_inverter": 0.3e6,  # [EUR/MW]
618
            "transformer_380_110": 17.33e3,  # [EUR/MVA]
619
            "transformer_380_220": 13.33e3,  # [EUR/MVA]
620
            "transformer_220_110": 17.5e3,  # [EUR/MVA]
621
            "battery inverter": read_costs(
622
                costs, "battery inverter", "investment"
623
            ),
624
            "battery storage": read_costs(
625
                costs, "battery storage", "investment"
626
            ),
627
        }
628
629
        parameters["lifetime"] = {
630
            "ac_ehv_overhead_line": read_costs(
631
                costs, "HVAC overhead", "lifetime"
632
            ),
633
            "ac_ehv_cable": read_costs(costs, "HVAC overhead", "lifetime"),
634
            "ac_hv_overhead_line": read_costs(
635
                costs, "HVAC overhead", "lifetime"
636
            ),
637
            "ac_hv_cable": read_costs(costs, "HVAC overhead", "lifetime"),
638
            "dc_overhead_line": read_costs(costs, "HVDC overhead", "lifetime"),
639
            "dc_cable": read_costs(costs, "HVDC overhead", "lifetime"),
640
            "dc_inverter": read_costs(costs, "HVDC inverter pair", "lifetime"),
641
            "transformer_380_110": read_costs(
642
                costs, "HVAC overhead", "lifetime"
643
            ),
644
            "transformer_380_220": read_costs(
645
                costs, "HVAC overhead", "lifetime"
646
            ),
647
            "transformer_220_110": read_costs(
648
                costs, "HVAC overhead", "lifetime"
649
            ),
650
            "battery inverter": read_costs(
651
                costs, "battery inverter", "lifetime"
652
            ),
653
            "battery storage": read_costs(
654
                costs, "battery storage", "lifetime"
655
            ),
656
        }
657
        # Insert annualized capital costs
658
        # lines in EUR/km/MW/a
659
        # transfermer, inverter, battery in EUR/MW/a
660
        parameters["capital_cost"] = {}
661
662
        for comp in parameters["overnight_cost"].keys():
663
            parameters["capital_cost"][comp] = annualize_capital_costs(
664
                parameters["overnight_cost"][comp],
665
                parameters["lifetime"][comp],
666
                global_settings("status2019")["interest_rate"],
667
            )
668
669
        parameters["capital_cost"]["battery"] = (
670
            parameters["capital_cost"]["battery inverter"]
671
            + parameters["efficiency"]["battery"]["max_hours"]
672
            * parameters["capital_cost"]["battery storage"]
673
        )
674
675
        parameters["marginal_cost"] = {
676
            "oil": global_settings(scenario)["fuel_costs"]["oil"]
677
            / read_costs(costs, "oil", "efficiency")
678
            + read_costs(costs, "oil", "VOM")
679
            + global_settings(scenario)["co2_costs"]
680
            * global_settings(scenario)["co2_emissions"]["oil"]
681
            / read_costs(costs, "oil", "efficiency"),
682
            "other_non_renewable": global_settings(scenario)["fuel_costs"][
683
                "gas"
684
            ] / read_costs(costs, "OCGT", "efficiency")
685
            + global_settings(scenario)["co2_costs"]
686
            * global_settings(scenario)["co2_emissions"][
687
                "other_non_renewable"
688
            ] / read_costs(costs, "OCGT", "efficiency"),
689
            "lignite": global_settings(scenario)["fuel_costs"]["lignite"]
690
            / read_costs(costs, "lignite", "efficiency")
691
            + read_costs(costs, "lignite", "VOM")
692
            + global_settings(scenario)["co2_costs"]
693
            * global_settings(scenario)["co2_emissions"]["lignite"]
694
            / read_costs(costs, "lignite", "efficiency"),
695
            "coal": global_settings(scenario)["fuel_costs"]["coal"]
696
            / read_costs(costs, "coal", "efficiency")
697
            + read_costs(costs, "coal", "VOM")
698
            + global_settings(scenario)["co2_costs"]
699
            * global_settings(scenario)["co2_emissions"]["coal"]
700
            / read_costs(costs, "coal", "efficiency"),
701
            "OCGT": global_settings(scenario)["fuel_costs"]["gas"]
702
            / read_costs(costs, "OCGT", "efficiency")
703
            + read_costs(costs, "OCGT", "VOM")
704
            + global_settings(scenario)["co2_costs"]
705
            * global_settings(scenario)["co2_emissions"]["gas"]
706
            / read_costs(costs, "OCGT", "efficiency"),
707
            "nuclear": global_settings(scenario)["fuel_costs"]["nuclear"]
708
            / read_costs(costs, "nuclear", "efficiency")
709
            + read_costs(costs, "nuclear", "VOM"),
710
            "biomass": global_settings(scenario)["fuel_costs"]["biomass"]
711
            / read_costs(costs, "biomass CHP", "efficiency")
712
            + read_costs(costs, "biomass CHP", "VOM"),
713
            "wind_offshore": read_costs(costs, "offwind", "VOM"),
714
            "wind_onshore": read_costs(costs, "onwind", "VOM"),
715
            "solar": read_costs(costs, "solar", "VOM"),
716
        }
717
718
    else:
719
        print(f"Scenario name {scenario} is not valid.")
720
721
    return parameters
722
723
724
def gas(scenario):
725
    """Returns paramaters of the gas sector for the selected scenario.
726
727
    Parameters
728
    ----------
729
    scenario : str
730
        Name of the scenario.
731
732
    Returns
733
    -------
734
    parameters : dict
735
        List of parameters of gas sector
736
737
    """
738
739
    if scenario == "eGon2035":
740
        costs = read_csv(2035)
741
742
        parameters = {
743
            "main_gas_carrier": "CH4",
744
            "H2_feedin_volumetric_fraction": 0.15,
745
        }
746
        
747
        # Insert effciencies in p.u.
748
        parameters["efficiency"] = {
749
            "power_to_H2": 0.6805,      #source: project internal assumption Fraunhofer ISE
750
            "H2_to_power": read_costs(costs, "fuel cell", "efficiency"),
751
            "CH4_to_H2": read_costs(costs, "SMR", "efficiency"),
752
            "H2_feedin": 1,
753
            "H2_to_CH4": read_costs(costs, "methanation", "efficiency"),
754
            "OCGT": read_costs(costs, "OCGT", "efficiency"),
755
            "power_to_Heat": 0.2,     #overall efficiency (20% electrical Input converted into waste-heat); source: project internal assumption Fraunhofer ISE
756
            "power_to_O2": 0.04,          #O2-transfer efficiency; source:  Sayed Sadat, Modeling Regional Utilization of the electrolysers Co-Products Oxygen and Heat in Germany, 2024
757
        }
758
        
759
        # Insert overnight investment costs
760
        parameters["overnight_cost"] = {
761
            "power_to_H2_system": 452_000, #[EUR/MW]  source: project internal assumption Fraunhofer ISE
762
            "power_to_H2_stack": 0.21 * 452_000, #[EUR/MW] source: project internal assumption Fraunhofer ISE
763
            "power_to_H2_OPEX": 0.03 * 452_000, #[EUR/MW/a]  3% of CAPEX, source: project internal assumption Fraunhofer ISE
764
            "H2_to_power": read_costs(costs, "fuel cell", "investment"),
765
            "CH4_to_H2": read_costs(costs, "SMR", "investment"),
766
            "H2_to_CH4": read_costs(costs, "methanation", "investment"),
767
            "H2_feedin": 0,
768
            "H2_underground": read_costs(
769
                costs, "hydrogen storage underground", "investment"
770
            ),
771
            "H2_overground": read_costs(
772
                costs, "hydrogen storage tank incl. compressor", "investment"
773
            ),
774
            "H2_pipeline": read_costs(costs, "H2 (g) pipeline", "investment"), # [EUR/MW/km] 
775
            "Heat_exchanger": 25_000, # [EUR/MW_th] cost assumption for one additional heat_exchanger; source: project internal cost assumption by Fraunhofer ISE
776
            "Heat_pipeline": 400_000, # [EUR/MW/km]; average value for DN100-pipeline; source: L. Zimmermann, MODELLIERUNG DER ABWÄRMENUTZUNG VON ELEKTROLYSEUREN IN DEUTSCHLAND FÜR EINE TECHNO - ÖKONOMISCHE OPTIMIERUNG EINES SEKTOR - GEKOPPELTEN ENERGIESYSTEM, 2024
777
            "O2_components": 5000, # [EUR] ; source: Sayed Sadat, Modeling Regional Utilization of the electrolysers Co-Products Oxygen and Heat in Germany, 2024 
778
        }
779
        
780
        #overnight_costs for O2_pipeinecosts related to pipeline_diameter
781
        parameters["O2_pipeline_costs"] = {
782
            0.5: 500_000,  # EUR/km
783
            0.4: 450_000,  # EUR/km
784
            0.3: 400_000,  # EUR/km
785
            0.2: 350_000,  # EUR/km
786
            0.0: 300_000,  # EUR/km   (costs for any other pipeline diameter)
787
        }
788
        
789
        # Insert lifetime
790
        parameters["lifetime"] = {
791
            "power_to_H2_system": 25,  # source: project internal assumption Fraunhofer ISE
792
            "power_to_H2_stack": 15,  #85000 hours ~ 15 years; source: project internal assumption Fraunhofer ISE
793
            "power_to_H2_OPEX": 1, #given as OPEX/year
794
            "H2_to_power": read_costs(costs, "fuel cell", "lifetime"),
795
            "CH4_to_H2": read_costs(costs, "SMR", "lifetime"),
796
            "H2_to_CH4": read_costs(costs, "methanation", "lifetime"),
797
            "H2_feedin": read_costs(costs, "CH4 (g) pipeline", "lifetime"),
798
            "H2_underground": read_costs(
799
                costs, "hydrogen storage underground", "lifetime"
800
            ),
801
            "H2_overground": read_costs(
802
                costs, "hydrogen storage tank incl. compressor", "lifetime"
803
            ),
804
            "H2_pipeline": read_costs(costs, "H2 (g) pipeline", "lifetime"),  
805
            "Heat_exchanger": 20, # assumption based on lifetime heat_exchanger; source: E. van der Roest, R. Bol, T. Fens und A. van Wijk, „Utilisation of waste heat from PEM electrolysers - Unlocking local optimisation, 2023
806
            "Heat_pipeline": 20,
807
            "O2_components": 25,  # source: Sayed Sadat, Modeling Regional Utilization of the electrolysers Co-Products Oxygen and Heat in Germany, 2024 
808
        }
809
810
        # Insert annualized capital costs
811
        parameters["capital_cost"] = {}
812
        parameters["O2_capital_cost"]= {}
813
814
        for comp in parameters["overnight_cost"].keys():
815
            parameters["capital_cost"][comp] = annualize_capital_costs(
816
                parameters["overnight_cost"][comp],
817
                parameters["lifetime"][comp],
818
                global_settings("eGon2035")["interest_rate"],
819
            )
820
        
821
        for diameter in parameters["O2_pipeline_costs"].keys():
822
            parameters["O2_capital_cost"][diameter] = annualize_capital_costs(
823
                parameters["O2_pipeline_costs"][diameter],
824
                parameters["lifetime"]["O2_components"],
825
                global_settings("eGon2035")["interest_rate"],
826
            )
827
            
828
        parameters["marginal_cost"] = {
829
            "CH4": global_settings(scenario)["fuel_costs"]["gas"]
830
            + global_settings(scenario)["co2_costs"]
831
            * global_settings(scenario)["co2_emissions"]["gas"],
832
            "OCGT": read_costs(costs, "OCGT", "VOM"),
833
            "biogas": global_settings(scenario)["fuel_costs"]["gas"],
834
            "chp_gas": read_costs(costs, "central gas CHP", "VOM"),
835
        }
836
837
        # Insert max gas production (generator) over the year
838
        parameters["max_gas_generation_overtheyear"] = {
839
            "CH4": 36000000,  # [MWh] Netzentwicklungsplan Gas 2020–2030
840
            "biogas": 10000000,  # [MWh] Netzentwicklungsplan Gas 2020–2030
841
        }
842
843
    elif scenario == "eGon100RE":
844
        costs = read_csv(2050)
845
        interest_rate = 0.07  # [p.u.]
846
847
        parameters = {
848
            "main_gas_carrier": "H2",
849
            "retrofitted_CH4pipeline-to-H2pipeline_share": 0.23,
850
            # p-e-s result, this value is overwritten if p-e-s is run
851
        }
852
        # Insert effciencies in p.u.
853
        parameters["efficiency"] = {
854
            "power_to_H2": 0.709,
855
            "H2_to_power": read_costs(costs, "fuel cell", "efficiency"),
856
            "CH4_to_H2": read_costs(costs, "SMR", "efficiency"),
857
            "H2_to_CH4": read_costs(costs, "methanation", "efficiency"),
858
            "OCGT": read_costs(costs, "OCGT", "efficiency"),
859
            "power_to_Heat": 0.2,   # source: project internal assumption Fraunhofer ISE
860
            "power_to_O2": 0.015,   # source:  Sayed Sadat, Modeling Regional Utilization of the electrolysers Co-Products Oxygen and Heat in Germany, 2024
861
        }
862
863
        # Insert FOM in %
864
        parameters["FOM"] = {
865
            "H2_underground": read_costs(
866
                costs, "hydrogen storage underground", "FOM"
867
            ),
868
            "H2_overground": read_costs(
869
                costs, "hydrogen storage tank incl. compressor", "FOM"
870
            ),
871
            "power_to_H2_system": 3,  #3% of CAPEX, source: project internal assumption Fraunhofer ISE
872
            "power_to_H2_stack": 3, #3% of CAPEX source: project internal assumption Fraunhofer ISE
873
            "H2_to_power": read_costs(costs, "fuel cell", "FOM"),
874
            "CH4_to_H2": read_costs(costs, "SMR", "FOM"),
875
            "H2_to_CH4": read_costs(costs, "methanation", "FOM"),
876
            "H2_pipeline": 3, # 3% of CAPEX
877
            "Heat_exchanger": 3, # 3% of CAPEX
878
            "Heat_pipeline": 3, # 3% of CAPEX 
879
            "O2_components": 3, # 3% of CAPEX  
880
            "H2_pipeline_retrofit": read_costs(
881
                costs, "H2 (g) pipeline repurposed", "FOM"
882
            ),
883
        }
884
        
885
        # Insert overnight investment costs
886
        parameters["overnight_cost"] = {
887
            "power_to_H2_system": 357_000,  #[EUR/MW] source: project internal assumption Fraunhofer ISE
888
            "power_to_H2_stack": 0.21 * 357_000, #[EUR/MW] source: project internal assumption Fraunhofer ISE
889
            "H2_to_power": read_costs(costs, "fuel cell", "investment"),
890
            "CH4_to_H2": read_costs(costs, "SMR", "investment"),
891
            "H2_to_CH4": read_costs(costs, "methanation", "investment"),
892
            "H2_underground": read_costs(
893
                costs, "hydrogen storage underground", "investment"
894
            ),
895
            "H2_overground": read_costs(
896
                costs, "hydrogen storage tank incl. compressor", "investment"
897
            ),
898
            "H2_pipeline": read_costs(costs, "H2 (g) pipeline", "investment"), # [EUR/MW/km] 
899
            "H2_pipeline_retrofit": read_costs(
900
                costs, "H2 (g) pipeline repurposed", "FOM"
901
            ),
902
            "Heat_exchanger": 25_000, # [EUR/MW_th] cost assumption for one additional heat_exchanger; source: project internal cost assumption by Fraunhofer ISE
903
            "Heat_pipeline": 400_000, # [EUR/MW/km]; average value for DN100-pipeline; source: L. Zimmermann, MODELLIERUNG DER ABWÄRMENUTZUNG VON ELEKTROLYSEUREN IN DEUTSCHLAND FÜR EINE TECHNO - ÖKONOMISCHE OPTIMIERUNG EINES SEKTOR - GEKOPPELTEN ENERGIESYSTEM, 2024
904
            "O2_components": 5000, # [EUR] ; source toDO: ask sayed 
905
        }
906
       
907
        #overnight_costs for O2_pipeinecosts related to pipeline_diameter
908
        parameters["O2_pipeline_costs"] = {
909
            0.5: 500_000,  # EUR/km
910
            0.4: 450_000,  # EUR/km
911
            0.3: 400_000,  # EUR/km
912
            0.2: 350_000,  # EUR/km
913
            0: 300_000,  # EUR/km   (costs for any other pipeline diameter)
914
        }
915
916
        # Insert lifetime
917
        parameters["lifetime"] = {
918
            "power_to_H2_system": 30,  # source: project internal assumption Fraunhofer ISE
919
            "power_to_H2_stack": 20,  #110_000 hours ~ 20 years; source: project internal assumption Fraunhofer ISE
920
            "H2_to_power": read_costs(costs, "fuel cell", "lifetime"),
921
            "CH4_to_H2": read_costs(costs, "SMR", "lifetime"),
922
            "H2_to_CH4": read_costs(costs, "methanation", "lifetime"),
923
            "H2_feedin": read_costs(costs, "CH4 (g) pipeline", "lifetime"),
924
            "H2_underground": read_costs(
925
                costs, "hydrogen storage underground", "lifetime"
926
            ),
927
            "H2_overground": read_costs(
928
                costs, "hydrogen storage tank incl. compressor", "lifetime"
929
            ),
930
            "H2_pipeline": read_costs(costs, "H2 (g) pipeline", "lifetime"),  
931
            "H2_pipeline_retrofit": read_costs(
932
                costs, "H2 (g) pipeline repurposed", "lifetime"
933
            ),
934
            "Heat_exchanger": 20, # assumption based on lifetime heat_exchanger; source: E. van der Roest, R. Bol, T. Fens und A. van Wijk, „Utilisation of waste heat from PEM electrolysers - Unlocking local optimisation, 2023
935
            "Heat_pipeline": 20,
936
            "O2_components": 25,  # source toDO: ask sayed 
937
        }
938
939
        # Insert costs
940
        parameters["capital_cost"] = {}
941
        parameters["O2_capital_cost"] = {}
942
        
943
        for comp in parameters["overnight_cost"].keys():
944
            parameters["capital_cost"][comp] = annualize_capital_costs(
945
                parameters["overnight_cost"][comp],
946
                parameters["lifetime"][comp],
947
                interest_rate,
948
            ) + parameters["overnight_cost"][comp] * (
949
                parameters["FOM"][comp] / 100
950
            )
951
                
952
        for comp in ["H2_to_power", "H2_to_CH4"]:
953
            parameters["capital_cost"][comp] = (
954
                annualize_capital_costs(
955
                    parameters["overnight_cost"][comp],
956
                    parameters["lifetime"][comp],
957
                    interest_rate,
958
                )
959
                + parameters["overnight_cost"][comp]
960
                * (parameters["FOM"][comp] / 100)
961
            ) * parameters["efficiency"][comp]
962
963
        for diameter in parameters["O2_pipeline_costs"].keys():
964
            parameters["O2_capital_cost"][diameter] = annualize_capital_costs(
965
                parameters["O2_pipeline_costs"][diameter],
966
                parameters["lifetime"]["O2_components"],
967
                interest_rate,
968
            )
969
                    
970
        parameters["marginal_cost"] = {
971
            "OCGT": read_costs(costs, "OCGT", "VOM"),
972
            "biogas": read_costs(costs, "biogas", "fuel"),
973
            "chp_gas": read_costs(costs, "central gas CHP", "VOM"),
974
        }
975
976
    elif scenario == "eGon2021":
977
        parameters = {}
978
979
    elif scenario == "status2019":
980
        costs = read_csv(2020)
981
        parameters = {
982
            "main_gas_carrier": "CH4",
983
        }
984
985
        parameters["marginal_cost"] = {
986
            "CH4": global_settings(scenario)["fuel_costs"]["gas"]
987
            + global_settings(scenario)["co2_costs"]
988
            * global_settings(scenario)["co2_emissions"]["gas"],
989
            "OCGT": read_costs(costs, "OCGT", "VOM"),
990
            "biogas": global_settings(scenario)["fuel_costs"]["gas"],
991
            "chp_gas": read_costs(costs, "central gas CHP", "VOM"),
992
        }
993
        # Insert effciencies in p.u.
994
        parameters["efficiency"] = {
995
            "OCGT": read_costs(costs, "OCGT", "efficiency"),
996
        }
997
998
    else:
999
        print(f"Scenario name {scenario} is not valid.")
1000
1001
    return parameters
1002
1003
1004
def mobility(scenario):
1005
    """Returns parameters of the mobility sector for the selected scenario.
1006
1007
    Parameters
1008
    ----------
1009
    scenario : str
1010
        Name of the scenario.
1011
1012
    Returns
1013
    -------
1014
    parameters : dict
1015
        List of parameters of mobility sector
1016
1017
    Notes
1018
    -----
1019
    For a detailed description of the parameters see module
1020
    :mod:`egon.data.datasets.emobility.motorized_individual_travel`.
1021
    """
1022
1023
    if scenario == "eGon2035":
1024
        parameters = {
1025
            "motorized_individual_travel": {
1026
                "NEP C 2035": {
1027
                    "ev_count": 15100000,
1028
                    "bev_mini_share": 0.1589,
1029
                    "bev_medium_share": 0.3533,
1030
                    "bev_luxury_share": 0.1053,
1031
                    "phev_mini_share": 0.0984,
1032
                    "phev_medium_share": 0.2189,
1033
                    "phev_luxury_share": 0.0652,
1034
                    "model_parameters": {},
1035
                }
1036
            }
1037
        }
1038
1039
    elif scenario == "eGon100RE":
1040
        # eGon100RE has 3 Scenario variations
1041
        #   * allocation will always be done for all scenarios
1042
        #   * model data will be written to tables `egon_etrago_*` only
1043
        #     for the variation as speciefied in `datasets.yml`
1044
        parameters = {
1045
            "motorized_individual_travel": {
1046
                "Reference 2050": {
1047
                    "ev_count": 25065000,
1048
                    "bev_mini_share": 0.1589,
1049
                    "bev_medium_share": 0.3533,
1050
                    "bev_luxury_share": 0.1053,
1051
                    "phev_mini_share": 0.0984,
1052
                    "phev_medium_share": 0.2189,
1053
                    "phev_luxury_share": 0.0652,
1054
                    "model_parameters": {},
1055
                },
1056
                "Mobility Transition 2050": {
1057
                    "ev_count": 37745000,
1058
                    "bev_mini_share": 0.1589,
1059
                    "bev_medium_share": 0.3533,
1060
                    "bev_luxury_share": 0.1053,
1061
                    "phev_mini_share": 0.0984,
1062
                    "phev_medium_share": 0.2189,
1063
                    "phev_luxury_share": 0.0652,
1064
                    "model_parameters": {},
1065
                },
1066
                "Electrification 2050": {
1067
                    "ev_count": 47700000,
1068
                    "bev_mini_share": 0.1589,
1069
                    "bev_medium_share": 0.3533,
1070
                    "bev_luxury_share": 0.1053,
1071
                    "phev_mini_share": 0.0984,
1072
                    "phev_medium_share": 0.2189,
1073
                    "phev_luxury_share": 0.0652,
1074
                    "model_parameters": {},
1075
                },
1076
            }
1077
        }
1078
1079
    elif scenario == "eGon2021":
1080
        parameters = {}
1081
1082
    elif scenario == "status2019":
1083
        parameters = {
1084
            "motorized_individual_travel": {
1085
                "status2019": {
1086
                    "ev_count": 200000,
1087
                    "bev_mini_share": 0.1589,
1088
                    "bev_medium_share": 0.3533,
1089
                    "bev_luxury_share": 0.1053,
1090
                    "phev_mini_share": 0.0984,
1091
                    "phev_medium_share": 0.2189,
1092
                    "phev_luxury_share": 0.0652,
1093
                    "model_parameters": {},
1094
                }
1095
            }
1096
        }
1097
1098
    elif scenario == "status2023":
1099
        parameters = {
1100
            "motorized_individual_travel": {
1101
                "status2023": {
1102
                    "ev_count": 2577664,
1103
                    "bev_mini_share": 0.1535,
1104
                    "bev_medium_share": 0.3412,
1105
                    "bev_luxury_share": 0.1017,
1106
                    "phev_mini_share": 0.1038,
1107
                    "phev_medium_share": 0.2310,
1108
                    "phev_luxury_share": 0.0688,
1109
                    "model_parameters": {},
1110
                }
1111
            }
1112
        }
1113
1114
    else:
1115
        print(f"Scenario name {scenario} is not valid.")
1116
        parameters = dict()
1117
1118
    return parameters
1119
1120
1121
def heat(scenario):
1122
    """Returns paramaters of the heat sector for the selected scenario.
1123
1124
    Parameters
1125
    ----------
1126
    scenario : str
1127
        Name of the scenario.
1128
1129
    Returns
1130
    -------
1131
    parameters : dict
1132
        List of parameters of heat sector
1133
1134
    """
1135
1136
    if scenario == "eGon2035":
1137
        costs = read_csv(2035)
1138
1139
        parameters = {
1140
            "DE_demand_reduction_residential": 0.854314018923104,
1141
            "DE_demand_reduction_service": 0.498286864771128,
1142
            "DE_district_heating_share": 0.14,
1143
        }
1144
1145
        # Insert efficiency in p.u.
1146
        parameters["efficiency"] = {
1147
            "water_tank_charger": read_costs(
1148
                costs, "water tank charger", "efficiency"
1149
            ),
1150
            "water_tank_discharger": read_costs(
1151
                costs, "water tank discharger", "efficiency"
1152
            ),
1153
            "central_resistive_heater": read_costs(
1154
                costs, "central resistive heater", "efficiency"
1155
            ),
1156
            "central_gas_boiler": read_costs(
1157
                costs, "central gas boiler", "efficiency"
1158
            ),
1159
            "rural_resistive_heater": read_costs(
1160
                costs, "decentral resistive heater", "efficiency"
1161
            ),
1162
            "rural_gas_boiler": read_costs(
1163
                costs, "decentral gas boiler", "efficiency"
1164
            ),
1165
        }
1166
1167
        # Insert overnight investment costs, in EUR/MWh
1168
        parameters["overnight_cost"] = {
1169
            "central_water_tank": read_costs(
1170
                costs, "central water tank storage", "investment"
1171
            ),
1172
            "rural_water_tank": read_costs(
1173
                costs, "decentral water tank storage", "investment"
1174
            ),
1175
        }
1176
1177
        # Insert lifetime
1178
        parameters["lifetime"] = {
1179
            "central_water_tank": read_costs(
1180
                costs, "central water tank storage", "lifetime"
1181
            ),
1182
            "rural_water_tank": read_costs(
1183
                costs, "decentral water tank storage", "lifetime"
1184
            ),
1185
        }
1186
1187
        # Insert annualized capital costs
1188
        parameters["capital_cost"] = {}
1189
1190
        for comp in parameters["overnight_cost"].keys():
1191
            parameters["capital_cost"][comp] = annualize_capital_costs(
1192
                parameters["overnight_cost"][comp],
1193
                parameters["lifetime"][comp],
1194
                global_settings("eGon2035")["interest_rate"],
1195
            )
1196
1197
        # Insert marginal_costs in EUR/MWh
1198
        # marginal cost can include fuel, C02 and operation and maintenance costs
1199
        parameters["marginal_cost"] = {
1200
            "central_heat_pump": read_costs(
1201
                costs, "central air-sourced heat pump", "VOM"
1202
            ),
1203
            "central_gas_chp": read_costs(costs, "central gas CHP", "VOM"),
1204
            "central_gas_boiler": read_costs(
1205
                costs, "central gas boiler", "VOM"
1206
            ),
1207
            "central_resistive_heater": read_costs(
1208
                costs, "central resistive heater", "VOM"
1209
            ),
1210
            "geo_thermal": 2.9,  # Danish Energy Agency
1211
            "water_tank_charger": 0,  # Danish Energy Agency
1212
            "water_tank_discharger": 0,  # Danish Energy Agency
1213
            "rural_heat_pump": 0,  # Danish Energy Agency, Technology Data for Individual Heating Plants
1214
        }
1215
1216
    elif scenario == "eGon100RE":
1217
        costs = read_csv(2050)
1218
1219
        parameters = {
1220
            "DE_demand_residential_MWh": 536692489.8152325 * 0.71542,
1221
            # [MWh], source: pypsa-eur run from 2024/12/23:
1222
            # total heat demand muliplied by residential share from resources/pop_weighted_heat_totals
1223
            "DE_demand_service_MWh": 536692489.8152325 * (1-0.71542),
1224
            # [MWh], source: pypsa-eur run from 2024/12/23:
1225
            # total heat demand muliplied by service share from resources/pop_weighted_heat_totals
1226
            "DE_district_heating_share": 0.42311285313808533,
1227
             # [%], source: pypsa-eur run from 2024/12/23
1228
        }
1229
1230
1231
        parameters["marginal_cost"] = {
1232
            "central_heat_pump": read_costs(
1233
                costs, "central air-sourced heat pump", "VOM"
1234
            ),
1235
            "central_gas_chp": read_costs(costs, "central gas CHP", "VOM"),
1236
            "central_gas_boiler": read_costs(
1237
                costs, "central gas boiler", "VOM"
1238
            ),
1239
            "central_resistive_heater": read_costs(
1240
                costs, "central resistive heater", "VOM"
1241
            ),
1242
            "geo_thermal": 2.7,  # Danish Energy Agency
1243
            "water_tank_charger": 0,  # Danish Energy Agency
1244
            "water_tank_discharger": 0,  # Danish Energy Agency
1245
            "rural_heat_pump": 0,  # Danish Energy Agency, Technology Data for Individual Heating Plants
1246
        }
1247
1248
        # Insert efficiency in p.u.
1249
        parameters["efficiency"] = {
1250
            "water_tank_charger": read_costs(
1251
                costs, "water tank charger", "efficiency"
1252
            ),
1253
            "water_tank_discharger": read_costs(
1254
                costs, "water tank discharger", "efficiency"
1255
            ),
1256
            "central_resistive_heater": read_costs(
1257
                costs, "central resistive heater", "efficiency"
1258
            ),
1259
            "central_gas_boiler": read_costs(
1260
                costs, "central gas boiler", "efficiency"
1261
            ),
1262
            "rural_resistive_heater": read_costs(
1263
                costs, "decentral resistive heater", "efficiency"
1264
            ),
1265
            "rural_gas_boiler": read_costs(
1266
                costs, "decentral gas boiler", "efficiency"
1267
            ),
1268
        }
1269
1270
        # Insert overnight investment costs, in EUR/MWh
1271
        parameters["overnight_cost"] = {
1272
            "central_water_tank": read_costs(
1273
                costs, "central water tank storage", "investment"
1274
            ),
1275
            "rural_water_tank": read_costs(
1276
                costs, "decentral water tank storage", "investment"
1277
            ),
1278
        }
1279
1280
        # Insert lifetime
1281
        parameters["lifetime"] = {
1282
            "central_water_tank": read_costs(
1283
                costs, "central water tank storage", "lifetime"
1284
            ),
1285
            "rural_water_tank": read_costs(
1286
                costs, "decentral water tank storage", "lifetime"
1287
            ),
1288
        }
1289
1290
        # Insert annualized capital costs
1291
        parameters["capital_cost"] = {}
1292
1293
        for comp in parameters["overnight_cost"].keys():
1294
            parameters["capital_cost"][comp] = annualize_capital_costs(
1295
                parameters["overnight_cost"][comp],
1296
                parameters["lifetime"][comp],
1297
                global_settings("eGon100RE")["interest_rate"],
1298
            )
1299
1300
    elif scenario == "eGon2021":
1301
        parameters = {}
1302
1303
    elif scenario == "status2019":
1304
        parameters = {
1305
            "DE_demand_residential_TJ": 1658400
1306
            + 383300,  # [TJ], space heating + hot water, source: AG Energiebilanzen 2019 (https://ag-energiebilanzen.de/wp-content/uploads/2020/10/ageb_20v_v1.pdf)
1307
            "DE_demand_service_TJ": 567300
1308
            + 71500,  # [TJ], space heating + hot water, source: AG Energiebilanzen 2019 (https://ag-energiebilanzen.de/wp-content/uploads/2020/10/ageb_20v_v1.pdf)
1309
            "DE_district_heating_share": (189760 + 38248)
1310
            / (
1311
                1658400 + 383300 + 567300 + 71500
1312
            ),  # [TJ], source: AG Energiebilanzen 2019 (https://ag-energiebilanzen.de/wp-content/uploads/2021/11/bilanz19d.xlsx)
1313
        }
1314
1315
        costs = read_csv(2020)
1316
1317
        # Insert marginal_costs in EUR/MWh
1318
        # marginal cost can include fuel, C02 and operation and maintenance costs
1319
        parameters["marginal_cost"] = {
1320
            "central_heat_pump": read_costs(
1321
                costs, "central air-sourced heat pump", "VOM"
1322
            ),
1323
            "central_gas_chp": read_costs(costs, "central gas CHP", "VOM"),
1324
            "central_gas_boiler": read_costs(
1325
                costs, "central gas boiler", "VOM"
1326
            ),
1327
            "central_resistive_heater": read_costs(
1328
                costs, "central resistive heater", "VOM"
1329
            ),
1330
            "rural_heat_pump": 0,  # Danish Energy Agency, Technology Data for Individual Heating Plants
1331
        }
1332
1333
        # Insert efficiency in p.u.
1334
        parameters["efficiency"] = {
1335
            "central_gas_boiler": read_costs(
1336
                costs, "central gas boiler", "efficiency"
1337
            ),
1338
        }
1339
1340
    # elif scenario == "status2023":
1341
    #     parameters = {
1342
    #         #  source: AG Energiebilanzen 2022  https://ag-energiebilanzen.de/wp-content/uploads/2023/01/AGEB_22p2_rev-1.pdf
1343
    #         "DE_demand_residential_TJ": 1754.2 * 1e3
1344
    #         + 407.5 * 1e3,  # [TJ], Endenergieverbrauch Haushalte 2.1 Raumwärme + Warmwasser
1345
    #         "DE_demand_service_TJ": 668.4 * 1e3
1346
    #         + 44.3 * 1e3 ,  # [TJ], Endenergieverbrauch GHD 3.1 Raumwärme + Warmwasser
1347
    #         "DE_district_heating_share": (189760 + 38248)
1348
    #         / (
1349
    #             1658400 + 383300 + 567300 + 71500
1350
    #         ),  # [TJ], source: AG Energiebilanzen 2019 (https://ag-energiebilanzen.de/wp-content/uploads/2021/11/bilanz19d.xlsx)
1351
    #     } # TODO status2023 needs update
1352
    #
1353
    #     costs = read_csv(2020)
1354
    #
1355
    #     # Insert marginal_costs in EUR/MWh
1356
    #     # marginal cost can include fuel, C02 and operation and maintenance costs
1357
    #     parameters["marginal_cost"] = {
1358
    #         "central_heat_pump": read_costs(
1359
    #             costs, "central air-sourced heat pump", "VOM"
1360
    #         ),
1361
    #         "central_gas_chp": read_costs(costs, "central gas CHP", "VOM"),
1362
    #         "central_gas_boiler": read_costs(
1363
    #             costs, "central gas boiler", "VOM"
1364
    #         ),
1365
    #         "central_resistive_heater": read_costs(
1366
    #             costs, "central resistive heater", "VOM"
1367
    #         ),
1368
    #         "rural_heat_pump": 0,  # Danish Energy Agency, Technology Data for Individual Heating Plants
1369
    #     }
1370
    #
1371
    #     # Insert efficiency in p.u.
1372
    #     parameters["efficiency"] = {
1373
    #         "central_gas_boiler": read_costs(
1374
    #             costs, "central gas boiler", "efficiency"
1375
    #         ),
1376
    #     }
1377
1378
    else:
1379
        print(f"Scenario name {scenario} is not valid.")
1380
1381
    return parameters
1382