-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathConfigurations.py
384 lines (342 loc) · 7.84 KB
/
Configurations.py
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
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
# -*- coding: utf-8 -*-
"""
Created on Sat Oct 28 14:43:20 2023
@author: Gregory_Guo
"""
"""
DFIG_HVDC Configuration files
state order specify the order of the equation
"""
sys_inputs = ['S1UD', 'S1UQ', 'S2UD', 'S2UQ']
sys_outputs = ['P_right', 'Qright', 'P_left', 'Qleft']
# Block1 --> Electrical left
states1 = ['Icd1', 'Icq1']
inputs1 = ['Usd1', 'Usq1', 'Ucd1', 'Ucq1']
constraints_assign1 = []
constraints_combi1 = []
bias1 = False
Type1 = 'B'
Ident1 = 'L'
# Block2 --> Electrical right
states2 = ['Icd2', 'Icq2']
inputs2 = ['Usd2', 'Usq2', 'Ucd2', 'Ucq2']
constraints_assign2 = []
constraints_combi2 = []
bias2 = False
Type2 = 'B'
Ident2 = 'L'
# Block3 --> Capacitor left
states3 = ['pVdc1']
inputs3 = ['P_left', 'id1']
constraints_assign3 = []
constraints_combi3 = []
bias3 = False
Type3 = 'B'
Ident3 = 'L'
# Block4 --> Capacitor right
states4 = ['pVdc2']
inputs4 = ['P_right', 'id2']
constraints_assign4 = []
constraints_combi4 = []
bias4 = True
Type4 = 'B'
Ident4 = 'L'
# Block5 --> Transimission line
states5 = ['pId_dc']
inputs5 = ['Vleft', 'Vright']
constraints_assign5 = []
constraints_combi5 = []
bias5 = False
Type5 = 'B'
Ident5 = 'L'
# Block6 --> Control left
states6 = ['pPhia1', 'pPhib1', 'pPhic1', 'pPhid1']
inputs6 = ['Icd1', 'Icq1', 'pVdc1', 'Qleft']
constraints_assign6 = []
constraints_combi6 = []
bias6 = True
Type6 = 'B'
Ident6 = 'L'
# Block7 --> Control right
states7 = ['pPhia2', 'pPhib2', 'pPhic2', 'pPhid2']
inputs7 = ['Icd2', 'Icq2', 'Pright', 'Qright']
constraints_assign7 = []
constraints_combi7 = []
bias7 = True
Type7 = 'B'
Ident7 = 'L'
# Block8 --> PLL_left
states8 = ['pLPLL_PI', 'pLPLL_THETA']
inputs8 = ['Usd1', 'Usq1']
constraints_assign8 = []
constraints_combi8 = []
bias8 = True
Type8 = 'B'
Ident8 = 'L'
# Block9 --> PLL_right
states9 = ['pHRPLL_PI', 'pRPLL_THETA']
inputs9 = ['Usd2', 'Usq2']
constraints_assign9 = []
constraints_combi9 = []
bias9 = False
Type9 = 'B'
Ident9 = 'L'
# for transmission line
# DFIG_C
states10 = ['UD', 'UQ']
inputs10 = ['DFIG_Ix', 'DFIG_Iy', 'DFIG_Lx', 'DFIG_Ly']
constraints_assign10 = []
constraints_combi10 = []
bias10 = False
Type10 = 'B'
Ident10 = 'L'
# DFIG_L
states11 = ['DFIG_Lx', 'DFIG_Ly']
inputs11 = ['UD', 'UQ', 'PCCUx', 'PCCUy']
constraints_assign11 = []
constraints_combi11 = []
bias11 = False
Type11 = 'B'
Ident11 = 'L'
# PCC
states12 = ['PCCUx', 'PCCUy']
inputs12 = ['DFIG_Lx', 'DFIG_Ly', 'HVDC_Lx1', 'HVDC_Ly1', 'infL_x', 'infL_y']
constraints_assign12 = []
constraints_combi12 = []
bias12 = False
Type12 = 'B'
Ident12 = 'L'
# inf_L
states13 = ['infL_x', 'infL_y']
inputs13 = ['S1UD', 'S1UQ', 'PCCUx', 'PCCUy']
constraints_assign13 = []
constraints_combi13 = []
bias13 = False
Type13 = 'B'
Ident13 = 'L'
# HVDC_C
states14 = ['UD2', 'UQ2']
inputs14 = ['HVDC_Lx2', 'HVDC_Ly2', 'HVDC_Lx', 'HVDC_Ly']
constraints_assign14 = []
constraints_combi14 = []
bias14 = False
Type14 = 'B'
Ident14 = 'L'
# HVDC_L
states15 = ['HVDC_Lx', 'HVDC_Ly']
inputs15 = ['S2UD', 'S2UQ', 'UD2', 'UD2']
constraints_assign15 = []
constraints_combi15 = []
bias15 = False
Type15 = 'B'
Ident15 = 'L'
# DFIG
# Block1 --> Asynchronous Machine
states16 = ['Ird', 'Irq', 'Isd', 'Isq']
inputs16 = ['Urd', 'Urq', 'Usd', 'Usq']
constraints_assign16 = []
constraints_combi16 = []
bias16 = False
Type16 = 'B'
Ident16 = 'L'
# Block2 --> Grid Filter
states17 = ['pigd', 'pigq']
inputs17 = ['Usdg', 'Usqg', 'Vrefd', 'Vrefq']
constraints_assign17 = []
constraints_combi17 = []
bias17 = False
Type17 = 'B'
Ident17 = 'L'
# Block3 --> Swing Equations
states18 = ['pwm']
inputs18 = ['Te', 'TL']
constraints_assign18 = []
constraints_combi18 = []
bias18 = False
Type18 = 'B'
Ident18 = 'L'
# Block4 --> Capacitor
states19 = ['pVdc']
inputs19 = ['Prsc', 'Pgsc']
constraints_assign19 = []
constraints_combi19 = []
bias19 = True
Type19 = 'B'
Ident19 = 'L'
# Block5 --> RSC
states20 = ['pPhira', 'pPhirb', 'pPhirc']
inputs20 = ['Ird', 'Irq', 'pwm']
constraints_assign20 = []
constraints_combi20 = []
bias20 = True
Type20 = 'B'
Ident20 = 'L'
# Block6 --> GSC
states21 = ['pPhiga', 'pPhigb', 'pPhigc']
inputs21 = ['pVdc', 'pigd', 'pigq']
constraints_assign21 = []
constraints_combi21 = []
bias21 = True
Type21 = 'B'
Ident21 = 'L'
# Block7 --> Axis
states22 = ['pTurbine_w', 'pshaft_w']
inputs22 = ['pwm', 'Wind']
constraints_assign22 = []
constraints_combi22 = []
bias22 = False
Type22 = 'B'
Ident22 = 'L'
# Block8 --> PLL_rsc
states23 = ['pRPLL_PI', 'ptheta_pll']
inputs23 = ['UD', 'UQ']
constraints_assign23 = []
constraints_combi23 = []
bias23 = True
Type23 = 'B'
Ident23 = 'L'
# Block9 --> PLL_gsc
states24 = ['pGPLL_PI', 'gtheta_pll']
inputs24 = ['UD', 'UQ']
constraints_assign24 = []
constraints_combi24 = []
bias24 = False
Type24 = 'B'
Ident24 = 'L'
# Algebraic --> TL
states25 = ['pTurbine_w', 'pshaft_w', 'pwm']
dot25_x = ['TL']
constraints_assign25 = []
constraints_combi25 = []
bias25 = False
Type25 = 'A'
Ident25 = 'L'
# Algebraic --> Te
states26 = ['Ird', 'Irq', 'Isd', 'Isq']
dot26_x = ['Te']
constraints_assign26 = []
constraints_combi26 = []
bias26 = False
Type26 = 'A'
Ident26 = 'L'
# Algebraic --> Prsc
states27 = ['Ird', 'Irq', 'Urd', 'Urq']
dot27_x = ['Prsc']
constraints_assign27 = []
constraints_combi27 = []
bias27 = False
Type27 = 'A'
Ident27 = 'L'
# Algebraic --> Pgsc
states28 = ['pigd', 'pigq', 'Usdg', 'Usqg']
dot28_x = ['Pgsc']
constraints_assign28 = []
constraints_combi28 = []
bias28 = False
Type28 = 'A'
Ident28 = 'L'
# Algebraic --> Usd, Usq
states29 = ['UD', 'UQ', 'ptheta_pll']
dot29_x = ['Usd', 'Usq']
constraints_assign29 = []
constraints_combi29 = []
bias29 = True
Type29 = 'A'
Ident29 = 'L'
# Algebraic --> Usdg, Usqg
states30 = ['UD', 'UQ', 'gtheta_pll']
dot30_x = ['Usdg', 'Usqg']
constraints_assign30 = []
constraints_combi30 = []
bias30 = False
Type30 = 'A'
Ident30 = 'L'
# Algebraic --> Vrefd, Vrefq
states31= ['pigd', 'pigq', 'pPhiga', 'pPhigb', 'pPhigc', 'pVdc', 'Usdg', 'Usqg']
dot31_x = ['Vrefd', 'Vrefq']
constraints_assign31 = []
constraints_combi31 = []
bias31 = True
Type31 = 'A'
Ident31 = 'L'
# Algebraic --> Vrefq
states32= ['Ird', 'Irq', 'pPhira', 'pPhirb', 'pPhirc', 'pwm']
dot32_x = ['Urd', 'Urq']
constraints_assign32 = []
constraints_combi32 = []
bias32 = True
Type32 = 'A'
Ident32 = 'L'
# HVDC
# Algebraic --> P_right
states33 = ['Icd2', 'Icq2', 'Ucd2', 'Ucq2']
dot33_x = ['P_right']
constraints_assign33 = []
constraints_combi33 = []
bias33 = False
Type33 = 'A'
Ident33 = 'L'
# Algebraic --> Pright
states34 = ['Icd2', 'Icq2', 'Usd2', 'Usq2']
dot34_x = ['Pright']
constraints_assign34 = []
constraints_combi34 = []
bias34 = False
Type34 = 'A'
Ident34 = 'L'
# Algebraic --> Q_right
states35 = ['Icd2', 'Icq2', 'Usd2', 'Usq2']
dot35_x = ['Qright']
constraints_assign35 = []
constraints_combi35 = []
bias35 = False
Type35 = 'A'
Ident35 = 'L'
# Algebraic --> P_left
states36 = ['Icd1', 'Icq1', 'Ucd1', 'Ucq1']
dot36_x = ['P_left']
constraints_assign36 = []
constraints_combi36 = []
bias36 = False
Type36 = 'A'
Ident36 = 'L'
# Algebraic --> Q_left
states37 = ['Icd1', 'Icq1', 'Usd1', 'Usq1']
dot37_x = ['Qleft']
constraints_assign37 = []
constraints_combi37 = []
bias37 = False
Type37 = 'A'
Ident37 = 'L'
# Algebraic --> Usdq1_pll
states38 = ['UD1', 'UQ1', 'pLPLL_THETA']
dot38_x = ['Usd1', 'Usq1']
constraints_assign38 = []
constraints_combi38 = []
bias38 = True
Type38 = 'A'
Ident38 = 'L'
# Algebraic --> Usdq2_pll
states39 = ['UD2', 'UQ2', 'pRPLL_THETA']
dot39_x = ['Usd2', 'Usq2']
constraints_assign39 = []
constraints_combi39 = []
bias39 = False
Type39 = 'A'
Ident39 = 'L'
# Algebraic --> Ucdq1_ref
states40 = ['Icd1', 'Icq1', 'pPhia1', 'pPhib1', 'pPhic1', 'pPhid1', 'pVdc1', 'Qleft', 'Usd1', 'Usq1']
dot40_x = ['Ucd1', 'Ucq1']
constraints_assign40 = []
constraints_combi40 = []
bias40 = True
Type40 = 'A'
Ident40 = 'L'
# Algebraic --> Ucdq2_ref
states41 = ['Icd2', 'Icq2', 'pPhia2', 'pPhib2', 'pPhic2', 'pPhid2', 'Pright', 'Qright', 'Usd2', 'Usq2']
dot41_x = ['Ucd2', 'Ucq2']
constraints_assign41 = []
constraints_combi41 = []
bias41 = True
Type41 = 'A'
Ident41 = 'L'