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

Source Code for Module pypower.idx_bus

 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 bus matrix. 
18   
19  Some examples of usage, after defining the constants using the line above, 
20  are:: 
21   
22      Pd = bus[3, PD]     # get the real power demand at bus 4 
23      bus[:, VMIN] = 0.95 # set the min voltage magnitude to 0.95 at all buses 
24   
25  The index, name and meaning of each column of the bus matrix is given 
26  below: 
27   
28  columns 0-12 must be included in input matrix (in case file) 
29      0.  C{BUS_I}       bus number (1 to 29997) 
30      1.  C{BUS_TYPE}    bus type (1 = PQ, 2 = PV, 3 = ref, 4 = isolated) 
31      2.  C{PD}          real power demand (MW) 
32      3.  C{QD}          reactive power demand (MVAr) 
33      4.  C{GS}          shunt conductance (MW at V = 1.0 p.u.) 
34      5.  C{BS}          shunt susceptance (MVAr at V = 1.0 p.u.) 
35      6.  C{BUS_AREA}    area number, 1-100 
36      7.  C{VM}          voltage magnitude (p.u.) 
37      8.  C{VA}          voltage angle (degrees) 
38      9.  C{BASE_KV}     base voltage (kV) 
39      10. C{ZONE}        loss zone (1-999) 
40      11. C{VMAX}        maximum voltage magnitude (p.u.) 
41      12. C{VMIN}        minimum voltage magnitude (p.u.) 
42   
43  columns 13-16 are added to matrix after OPF solution 
44  they are typically not present in the input matrix 
45   
46  (assume OPF objective function has units, u) 
47      13. C{LAM_P}       Lagrange multiplier on real power mismatch (u/MW) 
48      14. C{LAM_Q}       Lagrange multiplier on reactive power mismatch (u/MVAr) 
49      15. C{MU_VMAX}     Kuhn-Tucker multiplier on upper voltage limit (u/p.u.) 
50      16. C{MU_VMIN}     Kuhn-Tucker multiplier on lower voltage limit (u/p.u.) 
51   
52  additional constants, used to assign/compare values in the C{BUS_TYPE} column 
53      1.  C{PQ}    PQ bus 
54      2.  C{PV}    PV bus 
55      3.  C{REF}   reference bus 
56      4.  C{NONE}  isolated bus 
57   
58  @author: Ray Zimmerman (PSERC Cornell) 
59  @author: Richard Lincoln 
60  """ 
61   
62  # define bus types 
63  PQ      = 1 
64  PV      = 2 
65  REF     = 3 
66  NONE    = 4 
67   
68  # define the indices 
69  BUS_I       = 0    # bus number (1 to 29997) 
70  BUS_TYPE    = 1    # bus type 
71  PD          = 2    # Pd, real power demand (MW) 
72  QD          = 3    # Qd, reactive power demand (MVAr) 
73  GS          = 4    # Gs, shunt conductance (MW at V = 1.0 p.u.) 
74  BS          = 5    # Bs, shunt susceptance (MVAr at V = 1.0 p.u.) 
75  BUS_AREA    = 6    # area number, 1-100 
76  VM          = 7    # Vm, voltage magnitude (p.u.) 
77  VA          = 8    # Va, voltage angle (degrees) 
78  BASE_KV     = 9    # baseKV, base voltage (kV) 
79  ZONE        = 10   # zone, loss zone (1-999) 
80  VMAX        = 11   # maxVm, maximum voltage magnitude (p.u.) 
81  VMIN        = 12   # minVm, minimum voltage magnitude (p.u.) 
82   
83  # included in opf solution, not necessarily in input 
84  # assume objective function has units, u 
85  LAM_P       = 13   # Lagrange multiplier on real power mismatch (u/MW) 
86  LAM_Q       = 14   # Lagrange multiplier on reactive power mismatch (u/MVAr) 
87  MU_VMAX     = 15   # Kuhn-Tucker multiplier on upper voltage limit (u/p.u.) 
88  MU_VMIN     = 16   # Kuhn-Tucker multiplier on lower voltage limit (u/p.u.) 
89