Package pypower :: Module idx_gen
[hide private]
[frames] | no frames]

Source Code for Module pypower.idx_gen

 1  # Copyright (C) 1996-2011 Power System Engineering Research Center (PSERC) 
 2  # Copyright (C) 2011 Richard Lincoln 
 3  # 
 4  # PYPOWER is free software: you can redistribute it and/or modify 
 5  # it under the terms of the GNU General Public License as published 
 6  # by the Free Software Foundation, either version 3 of the License, 
 7  # or (at your option) any later version. 
 8  # 
 9  # PYPOWER is distributed in the hope that it will be useful, 
10  # but WITHOUT ANY WARRANTY; without even the implied warranty of 
11  # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 
12  # GNU General Public License for more details. 
13  # 
14  # You should have received a copy of the GNU General Public License 
15  # along with PYPOWER. If not, see <http://www.gnu.org/licenses/>. 
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  # define the indices 
65  GEN_BUS     = 0    # bus number 
66  PG          = 1    # Pg, real power output (MW) 
67  QG          = 2    # Qg, reactive power output (MVAr) 
68  QMAX        = 3    # Qmax, maximum reactive power output at Pmin (MVAr) 
69  QMIN        = 4    # Qmin, minimum reactive power output at Pmin (MVAr) 
70  VG          = 5    # Vg, voltage magnitude setpoint (p.u.) 
71  MBASE       = 6    # mBase, total MVA base of this machine, defaults to baseMVA 
72  GEN_STATUS  = 7    # status, 1 - machine in service, 0 - machine out of service 
73  PMAX        = 8    # Pmax, maximum real power output (MW) 
74  PMIN        = 9    # Pmin, minimum real power output (MW) 
75  PC1         = 10   # Pc1, lower real power output of PQ capability curve (MW) 
76  PC2         = 11   # Pc2, upper real power output of PQ capability curve (MW) 
77  QC1MIN      = 12   # Qc1min, minimum reactive power output at Pc1 (MVAr) 
78  QC1MAX      = 13   # Qc1max, maximum reactive power output at Pc1 (MVAr) 
79  QC2MIN      = 14   # Qc2min, minimum reactive power output at Pc2 (MVAr) 
80  QC2MAX      = 15   # Qc2max, maximum reactive power output at Pc2 (MVAr) 
81  RAMP_AGC    = 16   # ramp rate for load following/AGC (MW/min) 
82  RAMP_10     = 17   # ramp rate for 10 minute reserves (MW) 
83  RAMP_30     = 18   # ramp rate for 30 minute reserves (MW) 
84  RAMP_Q      = 19   # ramp rate for reactive power (2 sec timescale) (MVAr/min) 
85  APF         = 20   # area participation factor 
86   
87  # included in opf solution, not necessarily in input 
88  # assume objective function has units, u 
89  MU_PMAX     = 21   # Kuhn-Tucker multiplier on upper Pg limit (u/MW) 
90  MU_PMIN     = 22   # Kuhn-Tucker multiplier on lower Pg limit (u/MW) 
91  MU_QMAX     = 23   # Kuhn-Tucker multiplier on upper Qg limit (u/MVAr) 
92  MU_QMIN     = 24   # Kuhn-Tucker multiplier on lower Qg limit (u/MVAr) 
93   
94  # Note: When a generator's PQ capability curve is not simply a box and the 
95  # upper Qg limit is binding, the multiplier on this constraint is split into 
96  # it's P and Q components and combined with the appropriate MU_Pxxx and 
97  # MU_Qxxx values. Likewise for the lower Q limits. 
98