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 os
8

9 1
import numpy as np
10

11 1
import pandapower as pp
12 1
import pandapower.topology as top
13 1
from pandapower import pp_dir
14

15

16 1
def mv_oberrhein(scenario="load", cosphi_load=0.98, cosphi_pv=1.0, include_substations=False, separation_by_sub=False):
17
    """
18
    Loads the Oberrhein network, a generic 20 kV network serviced by two 25 MVA HV/MV transformer
19
    stations. The network supplies 141 MV/LV substations and 6 MV loads through four MV feeders.
20
    The network layout is meshed, but the network is operated as a radial network with 6 open
21
    sectioning points.
22

23
    The network can be loaded with two different worst case scenarios for load and generation,
24
    which are defined by scaling factors for loads / generators as well as tap positions of the
25
    HV/MV transformers. These worst case scenarios are a good starting point for working with this
26
    network, but you are of course free to parametrize the network for your use case.
27

28
    The network also includes geographical information of lines and buses for plotting.
29

30
    OPTIONAL:
31
        **scenario** - (str, "load"): defines the scaling for load and generation
32

33
                - "load": high load scenario, load = 0.6 / sgen = 0, trafo taps [-2, -3]
34
                - "generation": high feed-in scenario: load = 0.1, generation = 0.8, trafo taps [0, 0]
35

36
        **cosphi_load** - (str, 0.98): cosine(phi) of the loads
37

38
        **cosphi_sgen** - (str, 1.0): cosine(phi) of the static generators
39

40
        **include_substations** - (bool, False): if True, the transformers of the MV/LV level are
41
        modelled, otherwise the loads representing the LV networks are connected directly to the
42
        MV node
43
        
44
        **separation_by_sub** - (bool, False): if True, the network gets separated into two 
45
        sections, referring to both substations
46

47
    OUTPUT:
48
         **net** - pandapower network
49
         
50
         **net0, net1** - both sections of the pandapower network
51

52
    EXAMPLE:
53

54
        ``import pandapower.networks``
55
    
56
        ``net = pandapower.networks.mv_oberrhein("generation")``
57
    
58
        or with separation
59
    
60
        ``net0, net1 = pandapower.networks.mv_oberrhein(separation_by_sub=True)``
61
    """
62 1
    if include_substations:
63 1
        net = pp.from_json(os.path.join(pp_dir, "networks", "mv_oberrhein_substations.json"))
64
    else:
65 1
        net = pp.from_json(os.path.join(pp_dir, "networks", "mv_oberrhein.json"))
66 1
    net.load.q_mvar = np.tan(np.arccos(cosphi_load)) * net.load.p_mw
67 1
    net.sgen.q_mvar = np.tan(np.arccos(cosphi_pv)) * net.sgen.p_mw
68

69 1
    hv_trafos = net.trafo[net.trafo.sn_mva > 1].index
70 1
    if scenario == "load":
71 1
        net.load.scaling = 0.6
72 1
        net.sgen.scaling = 0.0
73 1
        net.trafo.tap_pos.loc[hv_trafos] = [-2, -3]
74 1
    elif scenario == "generation":
75 1
        net.load.scaling = 0.1
76 1
        net.sgen.scaling = 0.8
77 1
        net.trafo.tap_pos.loc[hv_trafos] = [0, 0]
78
    else:
79 0
        raise ValueError("Unknown scenario %s - chose 'load' or 'generation'" % scenario)
80
        
81 1
    if separation_by_sub == True:
82
        # creating multigraph
83 1
        mg = top.create_nxgraph(net)
84
        # clustering connected buses
85 1
        zones = [list(area) for area in top.connected_components(mg)]
86 1
        net1 = pp.select_subnet(net, buses=zones[0], include_switch_buses=False, 
87
                                include_results=True, keep_everything_else=True)
88 1
        net0 = pp.select_subnet(net, buses=zones[1], include_switch_buses=False, 
89
                                include_results=True, keep_everything_else=True)
90
        
91 1
        pp.runpp(net0); pp.runpp(net1)
92 1
        return net0, net1
93

94

95 1
    pp.runpp(net)
96 1
    return net

Read our documentation on viewing source code .

Loading