1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17 """ Defines constants for named column indices to gen matrix.
18
19 Some examples of usage, after defining the constants using the line above,
20 are::
21
22 Pg = gen[3, PG] # get the real power output of generator 4
23 gen[:, PMIN] = 0 # set to zero the minimum real power limit of all gens
24
25 The index, name and meaning of each column of the gen matrix is given
26 below:
27
28 columns 0-20 must be included in input matrix (in case file)
29 0. C{GEN_BUS} bus number
30 1. C{PG} real power output (MW)
31 2. C{QG} reactive power output (MVAr)
32 3. C{QMAX} maximum reactive power output (MVAr)
33 4. C{QMIN} minimum reactive power output (MVAr)
34 5. C{VG} voltage magnitude setpoint (p.u.)
35 6. C{MBASE} total MVA base of machine, defaults to baseMVA
36 7. C{GEN_STATUS} 1 - in service, 0 - out of service
37 8. C{PMAX} maximum real power output (MW)
38 9. C{PMIN} minimum real power output (MW)
39 10. C{PC1} lower real power output of PQ capability curve (MW)
40 11. C{PC2} upper real power output of PQ capability curve (MW)
41 12. C{QC1MIN} minimum reactive power output at Pc1 (MVAr)
42 13. C{QC1MAX} maximum reactive power output at Pc1 (MVAr)
43 14. C{QC2MIN} minimum reactive power output at Pc2 (MVAr)
44 15. C{QC2MAX} maximum reactive power output at Pc2 (MVAr)
45 16. C{RAMP_AGC} ramp rate for load following/AGC (MW/min)
46 17. C{RAMP_10} ramp rate for 10 minute reserves (MW)
47 18. C{RAMP_30} ramp rate for 30 minute reserves (MW)
48 19. C{RAMP_Q} ramp rate for reactive power (2 sec timescale) (MVAr/min)
49 20. C{APF} area participation factor
50
51 columns 21-24 are added to matrix after OPF solution
52 they are typically not present in the input matrix
53
54 (assume OPF objective function has units, u)
55 21. C{MU_PMAX} Kuhn-Tucker multiplier on upper Pg limit (u/MW)
56 22. C{MU_PMIN} Kuhn-Tucker multiplier on lower Pg limit (u/MW)
57 23. C{MU_QMAX} Kuhn-Tucker multiplier on upper Qg limit (u/MVAr)
58 24. C{MU_QMIN} Kuhn-Tucker multiplier on lower Qg limit (u/MVAr)
59
60 @author: Ray Zimmerman (PSERC Cornell)
61 @author: Richard Lincoln
62 """
63
64
65 GEN_BUS = 0
66 PG = 1
67 QG = 2
68 QMAX = 3
69 QMIN = 4
70 VG = 5
71 MBASE = 6
72 GEN_STATUS = 7
73 PMAX = 8
74 PMIN = 9
75 PC1 = 10
76 PC2 = 11
77 QC1MIN = 12
78 QC1MAX = 13
79 QC2MIN = 14
80 QC2MAX = 15
81 RAMP_AGC = 16
82 RAMP_10 = 17
83 RAMP_30 = 18
84 RAMP_Q = 19
85 APF = 20
86
87
88
89 MU_PMAX = 21
90 MU_PMIN = 22
91 MU_QMAX = 23
92 MU_QMIN = 24
93
94
95
96
97
98