File size: 11,473 Bytes
27bea43
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
"""Power System Case: 33bw

Data Source: MATPOWER case file
Base MVA: 100.0 MVA
Base kV: 12.66 kV

Unit conversions applied:
  - Pd/Qd converted from kW/kVar to MW/MVAr (divided by 1000)
  - r/x converted from Ohms to p.u. (Z_pu = Z_ohm * Sbase / Vbase^2)


Nodes (bus) columns:
    id, type, Pd, Qd, Gs, Bs, Vm, Va, baseKV, Vmax, Vmin
    - type: 1=PQ, 2=PV, 3=Slack
    - Pd/Qd: Active/Reactive power demand (MW/MVAr)
    - Gs/Bs: Shunt conductance/susceptance (MW/MVAr at V=1.0 p.u.)
    - Vm: Voltage magnitude (p.u.)
    - Va: Voltage angle (degrees)
    - baseKV: Base voltage (kV)
    - Vmax/Vmin: Voltage limits (p.u.)

Units (generators) columns:
    id, bus_id, Pg, Qg, Qmax, Qmin, Vg, mBase, status, Pmax, Pmin, mc_a, mc_b, mc_c
    - Pg/Qg: Active/Reactive power output (MW/MVAr)
    - Qmax/Qmin: Reactive power limits (MVAr)
    - Vg: Voltage setpoint (p.u.)
    - mBase: Machine base (MVA)
    - status: >0 in-service, <=0 out-of-service
    - Pmax/Pmin: Active power limits (MW)
    - mc_a/mc_b/mc_c: Marginal cost coefficients (quadratic)

Lines (branches) columns:
    id, from, to, r, x, b, rateA, ratio, angle, status, floor, cap
    - r/x: Resistance/Reactance (p.u.)
    - b: Line charging susceptance (p.u.)
    - rateA: Long-term rating (MVA)
    - ratio: Transformer tap ratio (0 for line)
    - angle: Transformer phase shift (degrees)
    - status: 1=in-service, 0=out-of-service
    - floor/cap: Power flow limits (MW)

Loads columns:
    id, bus_id, Pd, Qd, mc_a, mc_b, mc_c, d_max, d_min
    - Pd/Qd: Active/Reactive power demand (MW/MVAr)
    - mc_a/mc_b/mc_c: Marginal utility coefficients
    - d_max/d_min: Demand limits (MW)
"""
from powerzoo.case.CaseBase import ClearCase, DataFrame


class Case33bw(ClearCase):
    GRID_TYPE = "distribution"
    BUS_COUNT = 33
    VOLTAGE_LEVEL = "MV"
    SOURCE = "MATPOWER"
    DESCRIPTION = "IEEE 33-bus Baran & Wu radial distribution"

    def __init__(self, *args, **kwargs):
        # System base values
        self.baseMVA = 100.0
        self.baseKV = 12.66
        
        # Node (bus) data
        self.nodes = DataFrame(
            ['id', 'type', 'Pd', 'Qd', 'Gs', 'Bs', 'Vm', 'Va', 'baseKV', 'Vmax', 'Vmin'],
            [[1.0, 3.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 12.66, 1.0, 1.0],
             [2.0, 1.0, 0.1, 0.06, 0.0, 0.0, 1.0, 0.0, 12.66, 1.1, 0.9],
             [3.0, 1.0, 0.09, 0.04, 0.0, 0.0, 1.0, 0.0, 12.66, 1.1, 0.9],
             [4.0, 1.0, 0.12, 0.08, 0.0, 0.0, 1.0, 0.0, 12.66, 1.1, 0.9],
             [5.0, 1.0, 0.06, 0.03, 0.0, 0.0, 1.0, 0.0, 12.66, 1.1, 0.9],
             [6.0, 1.0, 0.06, 0.02, 0.0, 0.0, 1.0, 0.0, 12.66, 1.1, 0.9],
             [7.0, 1.0, 0.2, 0.1, 0.0, 0.0, 1.0, 0.0, 12.66, 1.1, 0.9],
             [8.0, 1.0, 0.2, 0.1, 0.0, 0.0, 1.0, 0.0, 12.66, 1.1, 0.9],
             [9.0, 1.0, 0.06, 0.02, 0.0, 0.0, 1.0, 0.0, 12.66, 1.1, 0.9],
             [10.0, 1.0, 0.06, 0.02, 0.0, 0.0, 1.0, 0.0, 12.66, 1.1, 0.9],
             [11.0, 1.0, 0.045, 0.03, 0.0, 0.0, 1.0, 0.0, 12.66, 1.1, 0.9],
             [12.0, 1.0, 0.06, 0.035, 0.0, 0.0, 1.0, 0.0, 12.66, 1.1, 0.9],
             [13.0, 1.0, 0.06, 0.035, 0.0, 0.0, 1.0, 0.0, 12.66, 1.1, 0.9],
             [14.0, 1.0, 0.12, 0.08, 0.0, 0.0, 1.0, 0.0, 12.66, 1.1, 0.9],
             [15.0, 1.0, 0.06, 0.01, 0.0, 0.0, 1.0, 0.0, 12.66, 1.1, 0.9],
             [16.0, 1.0, 0.06, 0.02, 0.0, 0.0, 1.0, 0.0, 12.66, 1.1, 0.9],
             [17.0, 1.0, 0.06, 0.02, 0.0, 0.0, 1.0, 0.0, 12.66, 1.1, 0.9],
             [18.0, 1.0, 0.09, 0.04, 0.0, 0.0, 1.0, 0.0, 12.66, 1.1, 0.9],
             [19.0, 1.0, 0.09, 0.04, 0.0, 0.0, 1.0, 0.0, 12.66, 1.1, 0.9],
             [20.0, 1.0, 0.09, 0.04, 0.0, 0.0, 1.0, 0.0, 12.66, 1.1, 0.9],
             [21.0, 1.0, 0.09, 0.04, 0.0, 0.0, 1.0, 0.0, 12.66, 1.1, 0.9],
             [22.0, 1.0, 0.09, 0.04, 0.0, 0.0, 1.0, 0.0, 12.66, 1.1, 0.9],
             [23.0, 1.0, 0.09, 0.05, 0.0, 0.0, 1.0, 0.0, 12.66, 1.1, 0.9],
             [24.0, 1.0, 0.42, 0.2, 0.0, 0.0, 1.0, 0.0, 12.66, 1.1, 0.9],
             [25.0, 1.0, 0.42, 0.2, 0.0, 0.0, 1.0, 0.0, 12.66, 1.1, 0.9],
             [26.0, 1.0, 0.06, 0.025, 0.0, 0.0, 1.0, 0.0, 12.66, 1.1, 0.9],
             [27.0, 1.0, 0.06, 0.025, 0.0, 0.0, 1.0, 0.0, 12.66, 1.1, 0.9],
             [28.0, 1.0, 0.06, 0.02, 0.0, 0.0, 1.0, 0.0, 12.66, 1.1, 0.9],
             [29.0, 1.0, 0.12, 0.07, 0.0, 0.0, 1.0, 0.0, 12.66, 1.1, 0.9],
             [30.0, 1.0, 0.2, 0.6, 0.0, 0.0, 1.0, 0.0, 12.66, 1.1, 0.9],
             [31.0, 1.0, 0.15, 0.07, 0.0, 0.0, 1.0, 0.0, 12.66, 1.1, 0.9],
             [32.0, 1.0, 0.21, 0.1, 0.0, 0.0, 1.0, 0.0, 12.66, 1.1, 0.9],
             [33.0, 1.0, 0.06, 0.04, 0.0, 0.0, 1.0, 0.0, 12.66, 1.1, 0.9]])

        # Generator (unit) data
        self.units = DataFrame(
            ['id', 'bus_id', 'Pg', 'Qg', 'Qmax', 'Qmin', 'Vg', 'mBase', 'status', 'Pmax', 'Pmin', 'mc_a', 'mc_b', 'mc_c', 'p_max', 'p_min'],
            [[1.0, 1.0, 0.0, 0.0, 10.0, -10.0, 1.0, 100.0, 1.0, 10.0, 0.0, 0.0, 0.0, 20.0, 10.0, 0.0]])

        # Branch (line) data
        self.lines = DataFrame(
            ['id', 'from', 'to', 'r', 'x', 'b', 'rateA', 'ratio', 'angle', 'status', 'floor', 'cap'],
            [[1.0, 1.0, 2.0, 0.05752591161723931, 0.02932448856844086, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0],
             [2.0, 2.0, 3.0, 0.3075951673242839, 0.156667639990117, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0],
             [3.0, 3.0, 4.0, 0.22835665566062455, 0.11629967381185907, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0],
             [4.0, 4.0, 5.0, 0.23777792751984705, 0.12110389853477384, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0],
             [5.0, 5.0, 6.0, 0.5109948114372992, 0.44111517910399334, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0],
             [6.0, 6.0, 7.0, 0.11679881404281126, 0.386084968641515, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0],
             [7.0, 7.0, 8.0, 0.4438604503742304, 0.14668483537107332, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0],
             [8.0, 8.0, 9.0, 0.642643047350938, 0.461704713630771, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0],
             [9.0, 9.0, 10.0, 0.6513780013926013, 0.461704713630771, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0],
             [10.0, 10.0, 11.0, 0.12266371175649943, 0.04055514376486502, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0],
             [11.0, 11.0, 12.0, 0.2335976280856225, 0.0772419507398506, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0],
             [12.0, 12.0, 13.0, 0.9159223237972591, 0.7206337084372169, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0],
             [13.0, 13.0, 14.0, 0.33791793635462913, 0.4447963383072657, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0],
             [14.0, 14.0, 15.0, 0.36873984561592654, 0.3281847018510615, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0],
             [15.0, 15.0, 16.0, 0.4656354429495194, 0.340039282336176, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0],
             [16.0, 16.0, 17.0, 0.8042396971217077, 1.0737754218358877, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0],
             [17.0, 17.0, 18.0, 0.4567133113212491, 0.3581331157081926, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0],
             [18.0, 2.0, 19.0, 0.10232374734519789, 0.09764430768002116, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0],
             [19.0, 19.0, 20.0, 0.9385084192478456, 0.8456683362907391, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0],
             [20.0, 20.0, 21.0, 0.2554974057186496, 0.29848585810940653, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0],
             [21.0, 21.0, 22.0, 0.4423006371525048, 0.5848051730893535, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0],
             [22.0, 3.0, 23.0, 0.28151509025703225, 0.19235616650319826, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0],
             [23.0, 23.0, 24.0, 0.5602849092438275, 0.4424254222102428, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0],
             [24.0, 24.0, 25.0, 0.559037058666447, 0.43743401990072095, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0],
             [25.0, 6.0, 26.0, 0.12665683360411692, 0.06451387485056989, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0],
             [26.0, 26.0, 27.0, 0.17731956704576368, 0.09028198927347643, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0],
             [27.0, 27.0, 28.0, 0.6607368807229547, 0.5825590420500687, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0],
             [28.0, 28.0, 29.0, 0.5017607171646838, 0.4371220572563759, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0],
             [29.0, 29.0, 30.0, 0.3166420840102922, 0.16128468712642474, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0],
             [30.0, 30.0, 31.0, 0.6079528012997611, 0.6008400530086925, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0],
             [31.0, 31.0, 32.0, 0.19372880213831675, 0.2257985619769946, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0],
             [32.0, 32.0, 33.0, 0.2127585234433688, 0.3308051880635605, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0],
             [33.0, 21.0, 8.0, 1.247850577380462, 1.247850577380462, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0],
             [34.0, 9.0, 15.0, 1.247850577380462, 1.247850577380462, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0],
             [35.0, 12.0, 22.0, 1.247850577380462, 1.247850577380462, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0],
             [36.0, 18.0, 33.0, 0.3119626443451155, 0.3119626443451155, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0],
             [37.0, 25.0, 29.0, 0.3119626443451155, 0.3119626443451155, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0]])

        # Load data
        self.loads = DataFrame(
            ['id', 'bus_id', 'Pd', 'Qd', 'mc_a', 'mc_b', 'mc_c', 'd_max', 'd_min'],
            [[1.0, 1.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0],
             [2.0, 2.0, 0.1, 0.06, 0.0, 0.0, 0.0, 0.1, 0.1],
             [3.0, 3.0, 0.09, 0.04, 0.0, 0.0, 0.0, 0.09, 0.09],
             [4.0, 4.0, 0.12, 0.08, 0.0, 0.0, 0.0, 0.12, 0.12],
             [5.0, 5.0, 0.06, 0.03, 0.0, 0.0, 0.0, 0.06, 0.06],
             [6.0, 6.0, 0.06, 0.02, 0.0, 0.0, 0.0, 0.06, 0.06],
             [7.0, 7.0, 0.2, 0.1, 0.0, 0.0, 0.0, 0.2, 0.2],
             [8.0, 8.0, 0.2, 0.1, 0.0, 0.0, 0.0, 0.2, 0.2],
             [9.0, 9.0, 0.06, 0.02, 0.0, 0.0, 0.0, 0.06, 0.06],
             [10.0, 10.0, 0.06, 0.02, 0.0, 0.0, 0.0, 0.06, 0.06],
             [11.0, 11.0, 0.045, 0.03, 0.0, 0.0, 0.0, 0.045, 0.045],
             [12.0, 12.0, 0.06, 0.035, 0.0, 0.0, 0.0, 0.06, 0.06],
             [13.0, 13.0, 0.06, 0.035, 0.0, 0.0, 0.0, 0.06, 0.06],
             [14.0, 14.0, 0.12, 0.08, 0.0, 0.0, 0.0, 0.12, 0.12],
             [15.0, 15.0, 0.06, 0.01, 0.0, 0.0, 0.0, 0.06, 0.06],
             [16.0, 16.0, 0.06, 0.02, 0.0, 0.0, 0.0, 0.06, 0.06],
             [17.0, 17.0, 0.06, 0.02, 0.0, 0.0, 0.0, 0.06, 0.06],
             [18.0, 18.0, 0.09, 0.04, 0.0, 0.0, 0.0, 0.09, 0.09],
             [19.0, 19.0, 0.09, 0.04, 0.0, 0.0, 0.0, 0.09, 0.09],
             [20.0, 20.0, 0.09, 0.04, 0.0, 0.0, 0.0, 0.09, 0.09],
             [21.0, 21.0, 0.09, 0.04, 0.0, 0.0, 0.0, 0.09, 0.09],
             [22.0, 22.0, 0.09, 0.04, 0.0, 0.0, 0.0, 0.09, 0.09],
             [23.0, 23.0, 0.09, 0.05, 0.0, 0.0, 0.0, 0.09, 0.09],
             [24.0, 24.0, 0.42, 0.2, 0.0, 0.0, 0.0, 0.42, 0.42],
             [25.0, 25.0, 0.42, 0.2, 0.0, 0.0, 0.0, 0.42, 0.42],
             [26.0, 26.0, 0.06, 0.025, 0.0, 0.0, 0.0, 0.06, 0.06],
             [27.0, 27.0, 0.06, 0.025, 0.0, 0.0, 0.0, 0.06, 0.06],
             [28.0, 28.0, 0.06, 0.02, 0.0, 0.0, 0.0, 0.06, 0.06],
             [29.0, 29.0, 0.12, 0.07, 0.0, 0.0, 0.0, 0.12, 0.12],
             [30.0, 30.0, 0.2, 0.6, 0.0, 0.0, 0.0, 0.2, 0.2],
             [31.0, 31.0, 0.15, 0.07, 0.0, 0.0, 0.0, 0.15, 0.15],
             [32.0, 32.0, 0.21, 0.1, 0.0, 0.0, 0.0, 0.21, 0.21],
             [33.0, 33.0, 0.06, 0.04, 0.0, 0.0, 0.0, 0.06, 0.06]])
        
        self.real_params = True
        super().__init__(*args, **kwargs)