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

Source Code for Module pypower.idx_brch

 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 branch matrix. 
18   
19  Some examples of usage, after defining the constants using the line above, 
20  are:: 
21   
22      branch[3, BR_STATUS] = 0              # take branch 4 out of service 
23      Ploss = branch[:, PF] + branch[:, PT] # compute real power loss vector 
24   
25  The index, name and meaning of each column of the branch matrix is given 
26  below: 
27   
28  columns 0-10 must be included in input matrix (in case file) 
29      0.  C{F_BUS}       from bus number 
30      1.  C{T_BUS}       to bus number 
31      2.  C{BR_R}        resistance (p.u.) 
32      3.  C{BR_X}        reactance (p.u.) 
33      4.  C{BR_B}        total line charging susceptance (p.u.) 
34      5.  C{RATE_A}      MVA rating A (long term rating) 
35      6.  C{RATE_B}      MVA rating B (short term rating) 
36      7.  C{RATE_C}      MVA rating C (emergency rating) 
37      8.  C{TAP}         transformer off nominal turns ratio 
38      9.  C{SHIFT}       transformer phase shift angle (degrees) 
39      10. C{BR_STATUS}   initial branch status, 1 - in service, 0 - out of service 
40      11. C{ANGMIN}      minimum angle difference, angle(Vf) - angle(Vt) (degrees) 
41      12. C{ANGMAX}      maximum angle difference, angle(Vf) - angle(Vt) (degrees) 
42   
43  columns 13-16 are added to matrix after power flow or OPF solution 
44  they are typically not present in the input matrix 
45      13. C{PF}          real power injected at "from" bus end (MW) 
46      14. C{QF}          reactive power injected at "from" bus end (MVAr) 
47      15. C{PT}          real power injected at "to" bus end (MW) 
48      16. C{QT}          reactive power injected at "to" bus end (MVAr) 
49   
50  columns 17-18 are added to matrix after OPF solution 
51  they are typically not present in the input matrix 
52   
53  (assume OPF objective function has units, C{u}) 
54      17. C{MU_SF}       Kuhn-Tucker multiplier on MVA limit at "from" bus (u/MVA) 
55      18. C{MU_ST}       Kuhn-Tucker multiplier on MVA limit at "to" bus (u/MVA) 
56   
57  columns 19-20 are added to matrix after SCOPF solution 
58  they are typically not present in the input matrix 
59   
60  (assume OPF objective function has units, C{u}) 
61      19. C{MU_ANGMIN}   Kuhn-Tucker multiplier lower angle difference limit 
62      20. C{MU_ANGMAX}   Kuhn-Tucker multiplier upper angle difference limit 
63   
64  @author: Ray Zimmerman (PSERC Cornell) 
65  @author: Richard Lincoln 
66  """ 
67   
68  # define the indices 
69  F_BUS       = 0    # f, from bus number 
70  T_BUS       = 1    # t, to bus number 
71  BR_R        = 2    # r, resistance (p.u.) 
72  BR_X        = 3    # x, reactance (p.u.) 
73  BR_B        = 4    # b, total line charging susceptance (p.u.) 
74  RATE_A      = 5    # rateA, MVA rating A (long term rating) 
75  RATE_B      = 6    # rateB, MVA rating B (short term rating) 
76  RATE_C      = 7    # rateC, MVA rating C (emergency rating) 
77  TAP         = 8    # ratio, transformer off nominal turns ratio 
78  SHIFT       = 9    # angle, transformer phase shift angle (degrees) 
79  BR_STATUS   = 10   # initial branch status, 1 - in service, 0 - out of service 
80  ANGMIN      = 11   # minimum angle difference, angle(Vf) - angle(Vt) (degrees) 
81  ANGMAX      = 12   # maximum angle difference, angle(Vf) - angle(Vt) (degrees) 
82   
83  # included in power flow solution, not necessarily in input 
84  PF          = 13   # real power injected at "from" bus end (MW) 
85  QF          = 14   # reactive power injected at "from" bus end (MVAr) 
86  PT          = 15   # real power injected at "to" bus end (MW) 
87  QT          = 16   # reactive power injected at "to" bus end (MVAr) 
88   
89  # included in opf solution, not necessarily in input 
90  # assume objective function has units, u 
91  MU_SF       = 17   # Kuhn-Tucker multiplier on MVA limit at "from" bus (u/MVA) 
92  MU_ST       = 18   # Kuhn-Tucker multiplier on MVA limit at "to" bus (u/MVA) 
93  MU_ANGMIN   = 19   # Kuhn-Tucker multiplier lower angle difference limit 
94  MU_ANGMAX   = 20   # Kuhn-Tucker multiplier upper angle difference limit 
95