e2nIEE / pandapower
1
# -*- coding: utf-8 -*-
2

3
# Copyright (c) 2016-2021 by University of Kassel and Fraunhofer Institute for Energy Economics
4
# and Energy System Technology (IEE), Kassel. All rights reserved.
5

6

7 1
import pandas as pd
8 1
import warnings
9

10 1
try:
11 1
    import pplog as logging
12 1
except ImportError:
13 1
    import logging
14

15 1
logger = logging.getLogger(__name__)
16

17

18 1
def create_std_type(net, data, name, element="line", overwrite=True, check_required=True):
19
    """
20
    Creates type data in the type database. The parameters that are used for
21
    the loadflow have to be at least contained in data. These parameters are:
22
        - c_nf_per_km, r_ohm_per_km, x_ohm_per_km and max_i_ka (for lines)
23
        - sn_mva, vn_hv_kv, vn_lv_kv, vk_percent, vkr_percent, pfe_kw, i0_percent, shift_degree* (for transformers)
24
        - sn_hv_mva, sn_mv_mva, sn_lv_mva, vn_hv_kv, vn_mv_kv, vn_lv_kv, vk_hv_percent, vk_mv_percent, vk_lv_percent, vkr_hv_percent, vkr_mv_percent, vkr_lv_percent, pfe_kw, i0_percent, shift_mv_degree*, shift_lv_degree* (for 3-winding-transformers)
25
    additional parameters can be added and later loaded into pandapower with the function
26
    "parameter_from_std_type".
27

28
    ** only considered in loadflow if calculate_voltage_angles = True
29

30
    The standard type is saved into the pandapower library of the given network by default.
31

32
    INPUT:
33
        **net** - The pandapower network
34

35
        **data** - dictionary of standard type parameters
36

37
        **name** - name of the standard type as string
38

39
        **element** - "line", "trafo" or "trafo3w"
40

41
    EXAMPLE:
42

43
    >>> line_data = {"c_nf_per_km": 0, "r_ohm_per_km": 0.642, "x_ohm_per_km": 0.083, "max_i_ka": 0.142, "type": "cs", "q_mm2": 50, "alpha": 4.03e-3}
44
    >>> pandapower.create_std_type(net, line_data, "NAYY 4×50 SE", element='line')
45
    >>> # Three phase line creation:
46
    >>> pandapower.create_std_type(net, {"r_ohm_per_km": 0.1941, "x_ohm_per_km": 0.07476991,
47
                    "c_nf_per_km": 1160., "max_i_ka": 0.421,
48
                    "endtemp_degree": 70.0, "r0_ohm_per_km": 0.7766,
49
                    "x0_ohm_per_km": 0.2990796,
50
                    "c0_nf_per_km":  496.2}, name="unsymmetric_line_type",element = "line")
51
    >>> #Three phase transformer creation
52
    >>> pp.create_std_type(net, {"sn_mva": 1.6,
53
            "vn_hv_kv": 10,
54
            "vn_lv_kv": 0.4,
55
            "vk_percent": 6,
56
            "vkr_percent": 0.78125,
57
            "pfe_kw": 2.7,
58
            "i0_percent": 0.16875,
59
            "shift_degree": 0,
60
            "vector_group": vector_group,
61
            "tap_side": "lv",
62
            "tap_neutral": 0,
63
            "tap_min": -2,
64
            "tap_max": 2,
65
            "tap_step_degree": 0,
66
            "tap_step_percent": 2.5,
67
            "tap_phase_shifter": False,
68
            "vk0_percent": 6, 
69
            "vkr0_percent": 0.78125, 
70
            "mag0_percent": 100,
71
            "mag0_rx": 0.,
72
            "si0_hv_partial": 0.9,}, name='Unsymmetric_trafo_type', element="trafo")
73
    """
74

75 1
    if type(data) != dict:
76 0
        raise UserWarning("type data has to be given as a dictionary of parameters")
77

78 1
    if check_required:
79 1
        if element == "line":
80 1
            required = ["c_nf_per_km", "r_ohm_per_km", "x_ohm_per_km", "max_i_ka"]
81 1
        elif element == "trafo":
82 1
            required = ["sn_mva", "vn_hv_kv", "vn_lv_kv", "vk_percent", "vkr_percent",
83
                        "pfe_kw", "i0_percent", "shift_degree"]
84 1
        elif element == "trafo3w":
85 1
            required = ["sn_hv_mva", "sn_mv_mva", "sn_lv_mva", "vn_hv_kv", "vn_mv_kv", "vn_lv_kv",
86
                        "vk_hv_percent", "vk_mv_percent", "vk_lv_percent", "vkr_hv_percent",
87
                        "vkr_mv_percent", "vkr_lv_percent", "pfe_kw", "i0_percent", "shift_mv_degree",
88
                        "shift_lv_degree"]
89
        else:
90 0
            raise ValueError("Unkown element type %s" % element)
91 1
        for par in required:
92 1
            if par not in data:
93 1
                raise UserWarning("%s is required as %s type parameter" % (par, element))
94 1
    library = net.std_types[element]
95 1
    if overwrite or not (name in library):
96 1
        library.update({name: data})
97

98

99 1
def create_std_types(net, data, element="line", overwrite=True, check_required=True):
100
    """
101
    Creates multiple standard types in the type database.
102

103
    INPUT:
104
        **net** - The pandapower network
105

106
        **data** - dictionary of standard type parameter sets
107

108
        **element** - "line", "trafo" or "trafo3w"
109

110
    EXAMPLE:
111

112
    >>> linetypes = {"typ1": {"r_ohm_per_km": 0.01, "x_ohm_per_km": 0.02, "c_nf_per_km": 10, "max_i_ka": 0.4, "type": "cs"},
113
    >>>              "typ2": {"r_ohm_per_km": 0.015, "x_ohm_per_km": 0.01, "c_nf_per_km": 30, "max_i_ka": 0.3, "type": "cs"}}
114
    >>> pp.create_std_types(net, data=linetypes, element="line")
115

116
    """
117 1
    for name, typdata in data.items():
118 1
        create_std_type(net, data=typdata, name=name, element=element, overwrite=overwrite,
119
                        check_required=check_required)
120

121

122 1
def copy_std_types(to_net, from_net, element="line", overwrite=True):
123
    """
124
    Transfers all standard types of one network to another.
125

126
    INPUT:
127

128
        **to_net** - The pandapower network to which the standard types are copied
129

130
        **from_net** - The pandapower network from which the standard types are taken
131

132
        **element** - "line" or "trafo"
133

134
        **overwrite** - if True, overwrites standard types which already exist in to_net
135

136
    """
137 1
    for name, typdata in from_net.std_types[element].items():
138 1
        create_std_type(to_net, typdata, name, element=element, overwrite=overwrite)
139

140

141 1
def load_std_type(net, name, element="line"):
142
    """
143
    Loads standard type data from the linetypes data base. Issues a warning if
144
    linetype is unknown.
145

146
    INPUT:
147
        **net** - The pandapower network
148

149
        **name** - name of the standard type as string
150

151
        **element** - "line", "trafo" or "trafo3w"
152

153
    OUTPUT:
154
        **typedata** - dictionary containing type data
155
    """
156 1
    library = net.std_types[element]
157 1
    if name in library:
158 1
        return library[name]
159
    else:
160 0
        raise UserWarning("Unknown standard %s type %s" % (element, name))
161

162

163 1
def std_type_exists(net, name, element="line"):
164
    """
165
    Checks if a standard type exists.
166

167
    INPUT:
168
        **net** - pandapower Network
169

170
        **name** - name of the standard type as string
171

172
        **element** - type of element ("line" or "trafo")
173

174
    OUTPUT:
175
        **exists** - True if standard type exists, False otherwise
176
    """
177 1
    library = net.std_types[element]
178 1
    return name in library
179

180

181 1
def delete_std_type(net, name, element="line"):
182
    """
183
    Deletes standard type parameters from database.
184

185
    INPUT:
186
        **net** - pandapower Network
187

188
        **name** - name of the standard type as string
189

190
        **element** - type of element ("line" or "trafo")
191

192
    """
193 0
    library = net.std_types[element]
194 0
    if name in library:
195 0
        del library[name]
196
    else:
197 0
        raise UserWarning("Unknown standard %s type %s" % (element, name))
198

199

200 1
def available_std_types(net, element="line"):
201
    """
202
    Returns all standard types available for this network as a table.
203

204
    INPUT:
205
        **net** - pandapower Network
206

207
        **element** - type of element ("line" or "trafo")
208

209
    OUTPUT:
210
        **typedata** - table of standard type parameters
211

212
    """
213 0
    std_types = pd.DataFrame(net.std_types[element]).T
214 0
    try:
215 0
        return std_types.infer_objects()
216 0
    except AttributeError:
217 0
        with warnings.catch_warnings():
218 0
            warnings.simplefilter("ignore")
219 0
            return std_types.convert_objects()
220

221

222 1
def parameter_from_std_type(net, parameter, element="line", fill=None):
223
    """
224
    Loads standard types data for a parameter, which can be used to add an additional parameter,
225
    that is not included in the original pandapower datastructure but is available in the standard
226
    type database.
227

228
    INPUT:
229
        **net** - pandapower network
230

231
        **parameter** - name of parameter as string
232

233
        **element** - type of element ("line" or "trafo")
234

235
        **fill** - fill-value that is assigned to all lines/trafos without
236
            a value for the parameter, either because the line/trafo has no type or because the
237
            type does not have a value for the parameter
238

239
    EXAMPLE:
240
        import pandapower as pp
241
        import pandapower.networks as pn
242

243
        net = pn.simple_mv_open_ring_net()
244
        pp.parameter_from_std_type(net, "q_mm2")
245
    """
246 1
    if parameter not in net[element]:
247 1
        net[element][parameter] = fill
248 1
    for typ in net[element].std_type.unique():
249 1
        if pd.isnull(typ) or not std_type_exists(net, typ, element):
250 0
            continue
251 1
        typedata = load_std_type(net, name=typ, element=element)
252 1
        if parameter in typedata:
253 1
            util = net[element].loc[net[element].std_type == typ].index
254 1
            net[element].loc[util, parameter] = typedata[parameter]
255 1
    if fill is not None:
256 1
        net[element].loc[pd.isnull(net[element][parameter]).values, parameter] = fill
257

258

259 1
def change_std_type(net, eid, name, element="line"):
260
    """
261
    Changes the type of a given element in pandapower. Changes only parameter that are given
262
    for the type.
263

264
    INPUT:
265
        **net** - pandapower network
266

267
        **eid** - element index (either line or transformer index)
268

269
        **element** - type of element ("line" or "trafo")
270

271
        **name** - name of the new standard type
272

273
    """
274 1
    type_param = load_std_type(net, name, element)
275 1
    table = net[element]
276 1
    for column in table.columns:
277 1
        if column in type_param:
278 1
            table.at[eid, column] = type_param[column]
279 1
    table.at[eid, "std_type"] = name
280

281

282 1
def find_std_type_by_parameter(net, data, element="line", epsilon=0.):
283
    """
284
    Searches for a std_type that fits all values given in the data dictionary with the margin of
285
    epsilon.
286

287
    INPUT:
288
        **net** - pandapower network
289

290
        **data** - dictionary of standard type parameters
291

292
        **element** - type of element ("line" or "trafo")
293

294
        **epsilon** - tolerance margin for parameter comparison
295

296
    OUTPUT:
297
        **fitting_types** - list of fitting types or empty list
298
    """
299 1
    assert epsilon >= 0
300 1
    fitting_types = []
301 1
    for name, stp in net.std_types[element].items():
302 1
        for p, v in list(data.items()):
303 1
            if isinstance(v, float):
304 1
                if abs(v - stp[p]) > epsilon:
305 1
                    break
306 1
            elif stp[p] != v:
307 1
                break
308
        else:
309 1
            fitting_types.append(name)
310 1
    return fitting_types
311

312

313 1
def add_zero_impedance_parameters(net):
314
    """
315
    Adds all parameters required for zero sequence impedance calculations
316
    INPUT:
317
        **net** - pandapower network
318
        
319
        zero sequence parameters of lines and transformers in pandapower networks
320
        are entered using std_type. 
321
        
322
        This function adds them to the pandas dataframe
323

324

325
    OUTPUT:
326
        Now, net has all the zero sequence  parameters
327
    """
328 1
    parameter_from_std_type(net, "vector_group", element="trafo")
329 1
    parameter_from_std_type(net, "vk0_percent", element="trafo")
330 1
    parameter_from_std_type(net, "vkr0_percent", element="trafo")
331 1
    parameter_from_std_type(net, "mag0_percent", element="trafo")
332 1
    parameter_from_std_type(net, "mag0_rx", element="trafo")
333 1
    parameter_from_std_type(net, "si0_hv_partial", element="trafo")
334 1
    parameter_from_std_type(net, "c0_nf_per_km")
335 1
    parameter_from_std_type(net, "r0_ohm_per_km")
336 1
    parameter_from_std_type(net, "x0_ohm_per_km")
337 1
    parameter_from_std_type(net, "endtemp_degree")
338

339

340 1
def add_temperature_coefficient(net, fill=None):
341
    """
342
    Adds alpha paarameter for calculations of line temperature
343
    Args:
344
        fill: fill value for when the parameter in std_type is missing, e.g. 4.03e-3 for aluminum
345
                or  3.93e-3 for copper
346

347
    """
348 1
    parameter_from_std_type(net, "alpha", fill=fill)
349

350

351 1
def add_basic_std_types(net):
352 1
    if "std_types" not in net:
353 1
        net.std_types = {"line": {}, "trafo": {}, "trafo3w": {}}
354

355 1
    alpha_al = 4.03e-3
356 1
    alpha_cu = 3.93e-3
357

358 1
    linetypes = {
359
        # Cables, all from S.744, Heuck: Elektrische Energieversorgung - Vierweg+Teubner 2013
360
        # additional MV cables from Werth: Netzberechnung mit Erzeugungsporfilen (Dreiecksverlegung)
361
        # Low Voltage
362
        "NAYY 4x50 SE":
363
        {"c_nf_per_km": 210,
364
            "r_ohm_per_km": 0.642,
365
            "x_ohm_per_km": 0.083,
366
            "max_i_ka": 0.142,
367
            "type": "cs",
368
            "q_mm2": 50,
369
            "alpha": alpha_al},
370
        "NAYY 4x120 SE":
371
        {"c_nf_per_km": 264,
372
            "r_ohm_per_km": 0.225,
373
            "x_ohm_per_km": 0.080,
374
            "max_i_ka": 0.242,
375
            "type": "cs",
376
            "q_mm2": 120,
377
            "alpha": alpha_al},
378
        "NAYY 4x150 SE":
379
        {"c_nf_per_km": 261,
380
            "r_ohm_per_km": 0.208,
381
            "x_ohm_per_km": 0.080,
382
            "max_i_ka": 0.270,
383
            "type": "cs",
384
            "q_mm2": 150,
385
            "alpha": alpha_al},
386

387
        # Medium Voltage
388
        "NA2XS2Y 1x95 RM/25 12/20 kV":
389
        {"c_nf_per_km": 216,
390
            "r_ohm_per_km": 0.313,
391
            "x_ohm_per_km": 0.132,
392
            "max_i_ka": 0.252,
393
            "type": "cs",
394
            "q_mm2": 95,
395
            "alpha": alpha_al},
396
        "NA2XS2Y 1x185 RM/25 12/20 kV":
397
        {"c_nf_per_km": 273,
398
            "r_ohm_per_km": 0.161,
399
            "x_ohm_per_km": 0.117,
400
            "max_i_ka": 0.362,
401
            "type": "cs",
402
            "q_mm2": 185,
403
            "alpha": alpha_al},
404
        "NA2XS2Y 1x240 RM/25 12/20 kV":
405
        {"c_nf_per_km": 304,
406
            "r_ohm_per_km": 0.122,
407
            "x_ohm_per_km": 0.112,
408
            "max_i_ka": 0.421,
409
            "type": "cs",
410
            "q_mm2": 240,
411
            "alpha": alpha_al},
412
        "NA2XS2Y 1x95 RM/25 6/10 kV":
413
        {"c_nf_per_km": 315,
414
            "r_ohm_per_km": 0.313,
415
            "x_ohm_per_km": 0.123,
416
            "max_i_ka": 0.249,
417
            "type": "cs",
418
            "q_mm2": 95,
419
            "alpha": alpha_al},
420
        "NA2XS2Y 1x185 RM/25 6/10 kV":
421
        {"c_nf_per_km": 406,
422
            "r_ohm_per_km": 0.161,
423
            "x_ohm_per_km": 0.110,
424
            "max_i_ka": 0.358,
425
            "type": "cs",
426
            "q_mm2": 185,
427
            "alpha": alpha_al},
428
        "NA2XS2Y 1x240 RM/25 6/10 kV":
429
        {"c_nf_per_km": 456,
430
            "r_ohm_per_km": 0.122,
431
            "x_ohm_per_km": 0.105,
432
            "max_i_ka": 0.416,
433
            "type": "cs",
434
            "q_mm2": 240,
435
            "alpha": alpha_al},
436
        # additional MV cables
437
        "NA2XS2Y 1x150 RM/25 12/20 kV":
438
        {"c_nf_per_km": 250,
439
            "r_ohm_per_km": 0.206,
440
            "x_ohm_per_km": 0.116,
441
            "max_i_ka": 0.319,
442
            "type": "cs",
443
            "q_mm2": 150,
444
            "alpha": alpha_al},
445
        "NA2XS2Y 1x120 RM/25 12/20 kV":
446
        {"c_nf_per_km": 230,
447
            "r_ohm_per_km": 0.253,
448
            "x_ohm_per_km": 0.119,
449
            "max_i_ka": 0.283,
450
            "type": "cs",
451
            "q_mm2": 120,
452
            "alpha": alpha_al},
453
        "NA2XS2Y 1x70 RM/25 12/20 kV":
454
        {"c_nf_per_km": 190,
455
            "r_ohm_per_km": 0.443,
456
            "x_ohm_per_km": 0.132,
457
            "max_i_ka": 0.220,
458
            "type": "cs",
459
            "q_mm2": 70,
460
            "alpha": alpha_al},
461
        "NA2XS2Y 1x150 RM/25 6/10 kV":
462
        {"c_nf_per_km": 360,
463
            "r_ohm_per_km": 0.206,
464
            "x_ohm_per_km": 0.110,
465
            "max_i_ka": 0.315,
466
            "type": "cs",
467
            "q_mm2": 150,
468
            "alpha": alpha_al},
469
        "NA2XS2Y 1x120 RM/25 6/10 kV":
470
        {"c_nf_per_km": 340,
471
            "r_ohm_per_km": 0.253,
472
            "x_ohm_per_km": 0.113,
473
            "max_i_ka": 0.280,
474
            "type": "cs",
475
            "q_mm2": 120,
476
            "alpha": alpha_al},
477
        "NA2XS2Y 1x70 RM/25 6/10 kV":
478
        {"c_nf_per_km": 280,
479
            "r_ohm_per_km": 0.443,
480
            "x_ohm_per_km": 0.123,
481
            "max_i_ka": 0.217,
482
            "type": "cs",
483
            "q_mm2": 70,
484
            "alpha": alpha_al},
485

486
        # High Voltage
487
        "N2XS(FL)2Y 1x120 RM/35 64/110 kV":
488
        {"c_nf_per_km": 112,
489
            "r_ohm_per_km": 0.153,
490
            "x_ohm_per_km": 0.166,
491
            "max_i_ka": 0.366,
492
            "type": "cs",
493
            "q_mm2": 120,
494
            "alpha": alpha_cu},
495
        "N2XS(FL)2Y 1x185 RM/35 64/110 kV":
496
        {"c_nf_per_km": 125,
497
            "r_ohm_per_km": 0.099,
498
            "x_ohm_per_km": 0.156,
499
            "max_i_ka": 0.457,
500
            "type": "cs",
501
            "q_mm2": 185,
502
            "alpha": alpha_cu},
503
        "N2XS(FL)2Y 1x240 RM/35 64/110 kV":
504
        {"c_nf_per_km": 135,
505
            "r_ohm_per_km": 0.075,
506
            "x_ohm_per_km": 0.149,
507
            "max_i_ka": 0.526,
508
            "type": "cs",
509
            "q_mm2": 240,
510
            "alpha": alpha_cu},
511
        "N2XS(FL)2Y 1x300 RM/35 64/110 kV":
512
        {"c_nf_per_km": 144,
513
            "r_ohm_per_km": 0.060,
514
            "x_ohm_per_km": 0.144,
515
            "max_i_ka": 0.588,
516
            "type": "cs",
517
            "q_mm2": 300,
518
            "alpha": alpha_cu},
519

520
        # Overhead Lines, all from S.742f, Heuck: Elektrische Energieversorgung -
521
        # Vierweg+Teubner 2013
522
        # 679/86 110 from S. 362, Flosdorff, Hilgarth: Elektrische Energieverteilung - Teubner 2005
523

524
        # Low Voltage
525
        "15-AL1/3-ST1A 0.4":
526
        {"c_nf_per_km": 11,
527
            "r_ohm_per_km": 1.8769,
528
            "x_ohm_per_km": 0.35,
529
            "max_i_ka": 0.105,
530
            "type": "ol",
531
            "q_mm2": 16,
532
            "alpha": alpha_al},
533
        "24-AL1/4-ST1A 0.4":
534
        {"c_nf_per_km": 11.25,
535
            "r_ohm_per_km": 1.2012,
536
            "x_ohm_per_km": 0.335,
537
            "max_i_ka": 0.140,
538
            "type": "ol",
539
            "q_mm2": 24,
540
            "alpha": alpha_al},
541
        "48-AL1/8-ST1A 0.4":
542
        {"c_nf_per_km": 12.2,
543
            "r_ohm_per_km": 0.5939,
544
            "x_ohm_per_km": 0.3,
545
            "max_i_ka": .210,
546
            "type": "ol",
547
            "q_mm2": 48,
548
            "alpha": alpha_al},
549
        "94-AL1/15-ST1A 0.4":
550
        {"c_nf_per_km": 13.2,
551
            "r_ohm_per_km": 0.3060,
552
            "x_ohm_per_km": 0.29,
553
            "max_i_ka": 0.350,
554
            "type": "ol",
555
            "q_mm2": 94,
556
            "alpha": alpha_al},
557

558
        # Medium Voltage
559
        "34-AL1/6-ST1A 10.0":
560
        {"c_nf_per_km": 9.7,
561
            "r_ohm_per_km": 0.8342,
562
            "x_ohm_per_km": 0.36,
563
            "max_i_ka": 0.170,
564
            "type": "ol",
565
            "q_mm2": 34,
566
            "alpha": alpha_al},
567
        "48-AL1/8-ST1A 10.0":
568
        {"c_nf_per_km": 10.1,
569
            "r_ohm_per_km": 0.5939,
570
            "x_ohm_per_km": 0.35,
571
            "max_i_ka": 0.210,
572
            "type": "ol",
573
            "q_mm2": 48,
574
            "alpha": alpha_al},
575
        "70-AL1/11-ST1A 10.0":
576
        {"c_nf_per_km": 10.4,
577
            "r_ohm_per_km": 0.4132,
578
            "x_ohm_per_km": 0.339,
579
            "max_i_ka": 0.290,
580
            "type": "ol",
581
            "q_mm2": 70,
582
            "alpha": alpha_al},
583
        "94-AL1/15-ST1A 10.0":
584
        {"c_nf_per_km": 10.75,
585
            "r_ohm_per_km": 0.3060,
586
            "x_ohm_per_km": 0.33,
587
            "max_i_ka": 0.350,
588
            "type": "ol",
589
            "q_mm2": 94,
590
            "alpha": alpha_al},
591
        "122-AL1/20-ST1A 10.0":
592
        {"c_nf_per_km": 11.1,
593
            "r_ohm_per_km": 0.2376,
594
            "x_ohm_per_km": 0.323,
595
            "max_i_ka": 0.410,
596
            "type": "ol",
597
            "q_mm2": 122,
598
            "alpha": alpha_al},
599
        "149-AL1/24-ST1A 10.0":
600
        {"c_nf_per_km": 11.25,
601
            "r_ohm_per_km": 0.1940,
602
            "x_ohm_per_km": 0.315,
603
            "max_i_ka": 0.470,
604
            "type": "ol",
605
            "q_mm2": 149,
606
            "alpha": alpha_al},
607
        "34-AL1/6-ST1A 20.0":
608
        {"c_nf_per_km": 9.15,
609
            "r_ohm_per_km": 0.8342,
610
            "x_ohm_per_km": 0.382,
611
            "max_i_ka": 0.170,
612
            "type": "ol",
613
            "q_mm2": 34,
614
            "alpha": alpha_al},
615
        "48-AL1/8-ST1A 20.0":
616
        {"c_nf_per_km": 9.5,
617
            "r_ohm_per_km": 0.5939,
618
            "x_ohm_per_km": 0.372,
619
            "max_i_ka": 0.210,
620
            "type": "ol",
621
            "q_mm2": 48,
622
            "alpha": alpha_al},
623
        "70-AL1/11-ST1A 20.0":
624
        {"c_nf_per_km": 9.7,
625
            "r_ohm_per_km": 0.4132,
626
            "x_ohm_per_km": 0.36,
627
            "max_i_ka": 0.290,
628
            "type": "ol",
629
            "q_mm2": 70,
630
            "alpha": alpha_al},
631
        "94-AL1/15-ST1A 20.0":
632
        {"c_nf_per_km": 10,
633
            "r_ohm_per_km": 0.3060,
634
            "x_ohm_per_km": 0.35,
635
            "max_i_ka": 0.350,
636
            "type": "ol",
637
            "q_mm2": 94,
638
            "alpha": alpha_al},
639
        "122-AL1/20-ST1A 20.0":
640
        {"c_nf_per_km": 10.3,
641
            "r_ohm_per_km": 0.2376,
642
            "x_ohm_per_km": 0.344,
643
            "max_i_ka": 0.410,
644
            "type": "ol",
645
            "q_mm2": 122,
646
            "alpha": alpha_al},
647
        "149-AL1/24-ST1A 20.0":
648
        {"c_nf_per_km": 10.5,
649
            "r_ohm_per_km": 0.1940,
650
            "x_ohm_per_km": 0.337,
651
            "max_i_ka": 0.470,
652
            "type": "ol",
653
            "q_mm2": 149,
654
            "alpha": alpha_al},
655
        "184-AL1/30-ST1A 20.0":
656
        {"c_nf_per_km": 10.75,
657
            "r_ohm_per_km": 0.1571,
658
            "x_ohm_per_km": 0.33,
659
            "max_i_ka": 0.535,
660
            "type": "ol",
661
            "q_mm2": 184,
662
            "alpha": alpha_al},
663
        "243-AL1/39-ST1A 20.0":
664
        {"c_nf_per_km": 11,
665
            "r_ohm_per_km": 0.1188,
666
            "x_ohm_per_km": 0.32,
667
            "max_i_ka": 0.645,
668
            "type": "ol",
669
            "q_mm2": 243,
670
            "alpha": alpha_al},
671

672
        # High Voltage
673
        # c acd x values are estimated for 4 m conductor distance, single bundle and "Donaumast"
674
        "48-AL1/8-ST1A 110.0":
675
        {"c_nf_per_km": 8,
676
            "r_ohm_per_km": 0.5939,
677
            "x_ohm_per_km": 0.46,
678
            "max_i_ka": 0.210,
679
            "type": "ol",
680
            "q_mm2": 48,
681
            "alpha": alpha_al},
682
        "70-AL1/11-ST1A 110.0":
683
        {"c_nf_per_km": 8.4,
684
            "r_ohm_per_km": 0.4132,
685
            "x_ohm_per_km": 0.45,
686
            "max_i_ka": 0.290,
687
            "type": "ol",
688
            "q_mm2": 70,
689
            "alpha": alpha_al},
690
        "94-AL1/15-ST1A 110.0":
691
        {"c_nf_per_km": 8.65,
692
            "r_ohm_per_km": 0.3060,
693
            "x_ohm_per_km": 0.44,
694
            "max_i_ka": 0.350,
695
            "type": "ol",
696
            "q_mm2": 94,
697
            "alpha": alpha_al},
698
        "122-AL1/20-ST1A 110.0":
699
        {"c_nf_per_km": 8.5,
700
            "r_ohm_per_km": 0.2376,
701
            "x_ohm_per_km": 0.43,
702
            "max_i_ka": 0.410,
703
            "type": "ol",
704
            "q_mm2": 122,
705
            "alpha": alpha_al},
706
        "149-AL1/24-ST1A 110.0":
707
        {"c_nf_per_km": 8.75,
708
            "r_ohm_per_km": 0.1940,
709
            "x_ohm_per_km": 0.41,
710
            "max_i_ka": 0.470,
711
            "type": "ol",
712
            "q_mm2": 149,
713
            "alpha": alpha_al},
714
        "184-AL1/30-ST1A 110.0":
715
        {"c_nf_per_km": 8.8,
716
            "r_ohm_per_km": 0.1571,
717
            "x_ohm_per_km": 0.4,
718
            "max_i_ka": 0.535,
719
            "type": "ol",
720
            "q_mm2": 184,
721
            "alpha": alpha_al},
722
        "243-AL1/39-ST1A 110.0":
723
        {"c_nf_per_km": 9,
724
            "r_ohm_per_km": 0.1188,
725
            "x_ohm_per_km": 0.39,
726
            "max_i_ka": 0.645,
727
            "type": "ol",
728
            "q_mm2": 243,
729
            "alpha": alpha_al},
730
        "305-AL1/39-ST1A 110.0":
731
        {"c_nf_per_km": 9.2,
732
            "r_ohm_per_km": 0.0949,
733
            "x_ohm_per_km": 0.38,
734
            "max_i_ka": 0.74,
735
            "type": "ol",
736
            "q_mm2": 305,
737
            "alpha": alpha_al},
738
        "490-AL1/64-ST1A 110.0":
739
        {"c_nf_per_km": 9.75,
740
            "r_ohm_per_km": 0.059,
741
            "x_ohm_per_km": 0.37,
742
            "max_i_ka": 0.960,
743
            "type": "ol",
744
            "q_mm2": 490,
745
            "alpha": alpha_al},
746
        "679-AL1/86-ST1A 110.0":
747
        {"c_nf_per_km": 9.95,
748
            "r_ohm_per_km": 0.042,
749
            "x_ohm_per_km": 0.36,
750
            "max_i_ka": 1.150,
751
            "type": "ol",
752
            "q_mm2": 679,
753
            "alpha": alpha_al},
754

755
        # Transmission System
756
        # The following values of c and x depend on the geometries of the  overhead line
757
        # Here it is assumed that for x the 220kV line uses twin conductors and the 380kV line uses
758
        # quad bundle conductor. The c values are estimated.
759
        "490-AL1/64-ST1A 220.0":
760
        {"c_nf_per_km": 10,
761
             "r_ohm_per_km": 0.059,
762
             "x_ohm_per_km": 0.285,
763
             "max_i_ka": 0.96,
764
             "type": "ol",
765
             "q_mm2": 490,
766
             "alpha": alpha_al},
767
        "679-AL1/86-ST1A 220.0":
768
        {"c_nf_per_km": 11.7,
769
             "r_ohm_per_km": 0.042,
770
             "x_ohm_per_km": 0.275,
771
             "max_i_ka": 1.150,
772
             "type": "ol",
773
             "q_mm2": 679,
774
             "alpha": alpha_al},
775
        "490-AL1/64-ST1A 380.0":
776
        {"c_nf_per_km": 11,
777
             "r_ohm_per_km": 0.059,
778
             "x_ohm_per_km": 0.253,
779
             "max_i_ka": 0.96,
780
             "type": "ol",
781
             "q_mm2": 490,
782
             "alpha": alpha_al},
783
        "679-AL1/86-ST1A 380.0":
784
        {"c_nf_per_km": 14.6,
785
             "r_ohm_per_km": 0.042,
786
             "x_ohm_per_km": 0.25,
787
             "max_i_ka": 1.150,
788
             "type": "ol",
789
             "q_mm2": 679,
790
             "alpha": alpha_al}
791
    }
792 1
    create_std_types(net, data=linetypes, element="line")
793

794 1
    trafotypes = {
795
        # derived from Oswald - Transformatoren - Vorlesungsskript Elektrische Energieversorgung I
796
        # another recommendable references for distribution transformers is Werth:
797
        # Netzberechnung mit Erzeugungsprofilen
798
        "160 MVA 380/110 kV":
799
        {"i0_percent": 0.06,
800
            "pfe_kw": 60,
801
            "vkr_percent": 0.25,
802
            "sn_mva": 160,
803
            "vn_lv_kv": 110.0,
804
            "vn_hv_kv": 380.0,
805
            "vk_percent": 12.2,
806
            "shift_degree": 0,
807
            "vector_group": "Yy0",
808
            "tap_side": "hv",
809
            "tap_neutral": 0,
810
            "tap_min": -9,
811
            "tap_max": 9,
812
            "tap_step_degree": 0,
813
            "tap_step_percent": 1.5,
814
            "tap_phase_shifter": False},
815
        "100 MVA 220/110 kV":
816
        {"i0_percent": 0.06,
817
            "pfe_kw": 55,
818
            "vkr_percent": 0.26,
819
            "sn_mva": 100,
820
            "vn_lv_kv": 110.0,
821
            "vn_hv_kv": 220.0,
822
            "vk_percent": 12.0,
823
            "shift_degree": 0,
824
            "vector_group": "Yy0",
825
            "tap_side": "hv",
826
            "tap_neutral": 0,
827
            "tap_min": -9,
828
            "tap_max": 9,
829
            "tap_step_degree": 0,
830
            "tap_step_percent": 1.5,
831
            "tap_phase_shifter": False},
832

833
        # compare to IFT Ingenieurbüro data and Schlabbach book
834
        "63 MVA 110/20 kV":
835
        {"i0_percent": 0.04,
836
            "pfe_kw": 22,
837
            "vkr_percent": 0.32,
838
            "sn_mva": 63,
839
            "vn_lv_kv": 20.0,
840
            "vn_hv_kv": 110.0,
841
            "vk_percent": 18,
842
            "shift_degree": 150,
843
            "vector_group": "YNd5",
844
            "tap_side": "hv",
845
            "tap_neutral": 0,
846
            "tap_min": -9,
847
            "tap_max": 9,
848
            "tap_step_degree": 0,
849
            "tap_step_percent": 1.5,
850
            "tap_phase_shifter": False},
851
        "40 MVA 110/20 kV":
852
        {"i0_percent": 0.05,
853
            "pfe_kw": 18,
854
            "vkr_percent": 0.34,
855
            "sn_mva": 40,
856
            "vn_lv_kv": 20.0,
857
            "vn_hv_kv": 110.0,
858
            "vk_percent": 16.2,
859
            "shift_degree": 150,
860
            "vector_group": "YNd5",
861
            "tap_side": "hv",
862
            "tap_neutral": 0,
863
            "tap_min": -9,
864
            "tap_max": 9,
865
            "tap_step_degree": 0,
866
            "tap_step_percent": 1.5,
867
            "tap_phase_shifter": False},
868
        "25 MVA 110/20 kV":
869
        {"i0_percent": 0.07,
870
            "pfe_kw": 14,
871
            "vkr_percent": 0.41,
872
            "sn_mva": 25,
873
            "vn_lv_kv": 20.0,
874
            "vn_hv_kv": 110.0,
875
            "vk_percent": 12,
876
            "shift_degree": 150,
877
            "vector_group": "YNd5",
878
            "tap_side": "hv",
879
            "tap_neutral": 0,
880
            "tap_min": -9,
881
            "tap_max": 9,
882
            "tap_step_degree": 0,
883
            "tap_step_percent": 1.5,
884
            "tap_phase_shifter": False},
885
        "63 MVA 110/10 kV":
886
        {"sn_mva": 63,
887
            "vn_hv_kv": 110,
888
            "vn_lv_kv": 10,
889
            "vk_percent": 18,
890
            "vkr_percent": 0.32,
891
            "pfe_kw": 22,
892
            "i0_percent": 0.04,
893
            "shift_degree": 150,
894
            "vector_group": "YNd5",
895
            "tap_side": "hv",
896
            "tap_neutral": 0,
897
            "tap_min": -9,
898
            "tap_max": 9,
899
            "tap_step_degree": 0,
900
            "tap_step_percent": 1.5,
901
            "tap_phase_shifter": False},
902
        "40 MVA 110/10 kV":
903
        {"sn_mva": 40,
904
            "vn_hv_kv": 110,
905
            "vn_lv_kv": 10,
906
            "vk_percent": 16.2,
907
            "vkr_percent": 0.34,
908
            "pfe_kw": 18,
909
            "i0_percent": 0.05,
910
            "shift_degree": 150,
911
            "vector_group": "YNd5",
912
            "tap_side": "hv",
913
            "tap_neutral": 0,
914
            "tap_min": -9,
915
            "tap_max": 9,
916
            "tap_step_degree": 0,
917
            "tap_step_percent": 1.5,
918
            "tap_phase_shifter": False},
919
        "25 MVA 110/10 kV":
920
        {"sn_mva": 25,
921
            "vn_hv_kv": 110,
922
            "vn_lv_kv": 10,
923
            "vk_percent": 12,
924
            "vkr_percent": 0.41,
925
            "pfe_kw": 14,
926
            "i0_percent": 0.07,
927
            "shift_degree": 150,
928
            "vector_group": "YNd5",
929
            "tap_side": "hv",
930
            "tap_neutral": 0,
931
            "tap_min": -9,
932
            "tap_max": 9,
933
            "tap_step_degree": 0,
934
            "tap_step_percent": 1.5,
935
            "tap_phase_shifter": False},
936
        # Tafo20/0.4
937
        # 0.25 MVA 20/0.4 kV 0.45 Trafo Union
938
        "0.25 MVA 20/0.4 kV":
939
        {"sn_mva": 0.25,
940
            "vn_hv_kv": 20,
941
            "vn_lv_kv": 0.4,
942
            "vk_percent": 6,
943
            "vkr_percent": 1.44,
944
            "pfe_kw": 0.8,
945
            "i0_percent": 0.32,
946
            "shift_degree": 150,
947
            "vector_group": "Yzn5",
948
            "tap_side": "hv",
949
            "tap_neutral": 0,
950
            "tap_min": -2,
951
            "tap_max": 2,
952
            "tap_step_degree": 0,
953
            "tap_step_percent": 2.5,
954
            "tap_phase_shifter": False},
955
        # 0.4 MVA 20/0.4 kV Trafo Union
956
        "0.4 MVA 20/0.4 kV":
957
        {"sn_mva": 0.4, "vn_hv_kv": 20, "vn_lv_kv": 0.4,
958
            "vk_percent": 6,
959
            "vkr_percent": 1.425,
960
            "pfe_kw": 1.35,
961
            "i0_percent": 0.3375,
962
            "shift_degree": 150,
963
            "vector_group": "Dyn5",
964
            "tap_side": "hv",
965
            "tap_neutral": 0,
966
            "tap_min": -2,
967
            "tap_max": 2,
968
            "tap_step_degree": 0,
969
            "tap_step_percent": 2.5,
970
            "tap_phase_shifter": False},
971
        # 0.63 MVA 20/0.4 kV Trafo Union
972
        "0.63 MVA 20/0.4 kV":
973
        {"sn_mva": 0.63,
974
            "vn_hv_kv": 20,
975
            "vn_lv_kv": 0.4,
976
            "vk_percent": 6,
977
            "vkr_percent": 1.206,
978
            "pfe_kw": 1.65,
979
            "i0_percent": 0.2619,
980
            "shift_degree": 150,
981
            "vector_group": "Dyn5",
982
            "tap_side": "hv",
983
            "tap_neutral": 0,
984
            "tap_min": -2,
985
            "tap_max": 2,
986
            "tap_step_degree": 0,
987
            "tap_step_percent": 2.5,
988
            "tap_phase_shifter": False},
989
        # Tafo10/0.4:
990
        # 0.25 MVA 10/0.4 kV 0.4 Trafo Union wnr
991
        "0.25 MVA 10/0.4 kV":
992
        {"sn_mva": 0.25,
993
            "vn_hv_kv": 10,
994
            "vn_lv_kv": 0.4,
995
            "vk_percent": 4,
996
            "vkr_percent": 1.2,
997
            "pfe_kw": 0.6,
998
            "i0_percent": 0.24,
999
            "shift_degree": 150,
1000
            "vector_group": "Dyn5",
1001
            "tap_side": "hv",
1002
            "tap_neutral": 0,
1003
            "tap_min": -2,
1004
            "tap_max": 2,
1005
            "tap_step_degree": 0,
1006
            "tap_step_percent": 2.5,
1007
            "tap_phase_shifter": False},
1008
        # 0.4 MVA 10/0.4 kV Trafo Union wnr
1009
        "0.4 MVA 10/0.4 kV":
1010
        {"sn_mva": 0.4,
1011
            "vn_hv_kv": 10,
1012
            "vn_lv_kv": 0.4,
1013
            "vk_percent": 4,
1014
            "vkr_percent": 1.325,
1015
            "pfe_kw": 0.95,
1016
            "i0_percent": 0.2375,
1017
            "shift_degree": 150,
1018
            "vector_group": "Dyn5",
1019
            "tap_side": "hv",
1020
            "tap_neutral": 0,
1021
            "tap_min": -2,
1022
            "tap_max": 2,
1023
            "tap_step_degree": 0,
1024
            "tap_step_percent": 2.5,
1025
            "tap_phase_shifter": False},
1026
        # 0.63 MVA 10/0.4 kV Trafo Union wnr
1027
        "0.63 MVA 10/0.4 kV":
1028
        {"sn_mva": 0.63,
1029
            "vn_hv_kv": 10,
1030
            "vn_lv_kv": 0.4,
1031
            "vk_percent": 4,
1032
            "vkr_percent": 1.0794,
1033
            "pfe_kw": 1.18,
1034
            "i0_percent": 0.1873,
1035
            "shift_degree": 150,
1036
            "vector_group": "Dyn5",
1037
            "tap_side": "hv",
1038
            "tap_neutral": 0,
1039
            "tap_min": -2,
1040
            "tap_max": 2,
1041
            "tap_step_degree": 0,
1042
            "tap_step_percent": 2.5,
1043
            "tap_phase_shifter": False},
1044
    }
1045 1
    create_std_types(net, data=trafotypes, element="trafo")
1046

1047 1
    trafo3wtypes = {
1048
        # generic trafo3w
1049
        "63/25/38 MVA 110/20/10 kV":
1050
        {"sn_hv_mva": 63,
1051
            "sn_mv_mva": 25,
1052
            "sn_lv_mva": 38,
1053
            "vn_hv_kv": 110,
1054
            "vn_mv_kv": 20,
1055
            "vn_lv_kv": 10,
1056
            "vk_hv_percent": 10.4,
1057
            "vk_mv_percent": 10.4,
1058
            "vk_lv_percent": 10.4,
1059
            "vkr_hv_percent": 0.28,
1060
            "vkr_mv_percent": 0.32,
1061
            "vkr_lv_percent": 0.35,
1062
            "pfe_kw": 35,
1063
            "i0_percent": 0.89,
1064
            "shift_mv_degree": 0,
1065
            "shift_lv_degree": 0,
1066
            "vector_group": "YN0yn0yn0",
1067
            "tap_side": "hv",
1068
            "tap_neutral": 0,
1069
            "tap_min": -10,
1070
            "tap_max": 10,
1071
            "tap_step_percent": 1.2},
1072
        "63/25/38 MVA 110/10/10 kV":
1073
        {"sn_hv_mva": 63,
1074
            "sn_mv_mva": 25,
1075
            "sn_lv_mva": 38,
1076
            "vn_hv_kv": 110,
1077
            "vn_mv_kv": 10,
1078
            "vn_lv_kv": 10,
1079
            "vk_hv_percent": 10.4,
1080
            "vk_mv_percent": 10.4,
1081
            "vk_lv_percent": 10.4,
1082
            "vkr_hv_percent": 0.28,
1083
            "vkr_mv_percent": 0.32,
1084
            "vkr_lv_percent": 0.35,
1085
            "pfe_kw": 35,
1086
            "i0_percent": 0.89,
1087
            "shift_mv_degree": 0,
1088
            "shift_lv_degree": 0,
1089
            "vector_group": "YN0yn0yn0",
1090
            "tap_side": "hv",
1091
            "tap_neutral": 0,
1092
            "tap_min": -10,
1093
            "tap_max": 10,
1094
            "tap_step_percent": 1.2}
1095
    }
1096 1
    create_std_types(net, data=trafo3wtypes, element="trafo3w")
1097 1
    return linetypes, trafotypes, trafo3wtypes

Read our documentation on viewing source code .

Loading