e2nIEE / pandapower
1
# -*- coding: utf-8 -*-
2

3
# Copyright 1996-2015 PSERC. All rights reserved.
4
# Use of this source code is governed by a BSD-style
5
# license that can be found in the LICENSE file.
6

7
# Copyright (c) 2016-2021 by University of Kassel and Fraunhofer Institute for Energy Economics
8
# and Energy System Technology (IEE), Kassel. All rights reserved.
9

10

11 1
"""Defines constants for named column indices to bus matrix.
12

13
Some examples of usage, after defining the constants using the line above,
14
are::
15

16
    Pd = bus[3, PD]     # get the real power demand at bus 4
17
    bus[:, VMIN] = 0.95 # set the min voltage magnitude to 0.95 at all buses
18

19
The index, name and meaning of each column of the bus matrix is given
20
below:
21

22
columns 0-12 must be included in input matrix (in case file)
23
    0.  C{BUS_I}       bus number (1 to 29997)
24
    1.  C{BUS_TYPE}    bus type (1 = PQ, 2 = PV, 3 = ref, 4 = isolated)
25
    2.  C{PD}          real power demand (MW)
26
    3.  C{QD}          reactive power demand (MVAr)
27
    4.  C{GS}          shunt conductance (MW at V = 1.0 p.u.)
28
    5.  C{BS}          shunt susceptance (MVAr at V = 1.0 p.u.)
29
    6.  C{BUS_AREA}    area number, 1-100
30
    7.  C{VM}          voltage magnitude (p.u.)
31
    8.  C{VA}          voltage angle (degrees)
32
    9.  C{BASE_KV}     base voltage (kV)
33
    10. C{ZONE}        loss zone (1-999)
34
    11. C{VMAX}        maximum voltage magnitude (p.u.)
35
    12. C{VMIN}        minimum voltage magnitude (p.u.)
36

37
columns 13-16 are added to matrix after OPF solution
38
they are typically not present in the input matrix
39

40
(assume OPF objective function has units, u)
41
    13. C{LAM_P}       Lagrange multiplier on real power mismatch (u/MW)
42
    14. C{LAM_Q}       Lagrange multiplier on reactive power mismatch (u/MVAr)
43
    15. C{MU_VMAX}     Kuhn-Tucker multiplier on upper voltage limit (u/p.u.)
44
    16. C{MU_VMIN}     Kuhn-Tucker multiplier on lower voltage limit (u/p.u.)
45

46
additional constants, used to assign/compare values in the C{BUS_TYPE} column
47
    1.  C{PQ}    PQ bus
48
    2.  C{PV}    PV bus
49
    3.  C{REF}   reference bus
50
    4.  C{NONE}  isolated bus
51

52
@author: Ray Zimmerman (PSERC Cornell)
53
@author: Richard Lincoln
54
"""
55

56
# define bus types
57 1
PQ = 1
58 1
PV = 2
59 1
REF = 3
60 1
NONE = 4
61

62
# define the indices
63 1
BUS_I = 0    # bus number (1 to 29997)
64 1
BUS_TYPE = 1    # bus type
65 1
PD = 2    # Pd, real power demand (MW)
66 1
QD = 3    # Qd, reactive power demand (MVAr)
67 1
GS = 4    # Gs, shunt conductance (MW at V = 1.0 p.u.)
68 1
BS = 5    # Bs, shunt susceptance (MVAr at V = 1.0 p.u.)
69 1
BUS_AREA = 6    # area number, 1-100
70 1
VM = 7    # Vm, voltage magnitude (p.u.)
71 1
VA = 8    # Va, voltage angle (degrees)
72 1
BASE_KV = 9    # baseKV, base voltage (kV)
73 1
ZONE = 10   # zone, loss zone (1-999)
74 1
VMAX = 11   # maxVm, maximum voltage magnitude (p.u.)
75 1
VMIN = 12   # minVm, minimum voltage magnitude (p.u.)
76

77
# included in opf solution, not necessarily in input
78
# assume objective function has units, u
79 1
LAM_P = 13   # Lagrange multiplier on real power mismatch (u/MW)
80 1
LAM_Q = 14   # Lagrange multiplier on reactive power mismatch (u/MVAr)
81 1
MU_VMAX = 15   # Kuhn-Tucker multiplier on upper voltage limit (u/p.u.)
82 1
MU_VMIN = 16   # Kuhn-Tucker multiplier on lower voltage limit (u/p.u.)
83

84
# Additional pandapower extensions to ppc
85 1
CID = 13   # coefficient of constant current load at rated voltage in range [0,1]
86 1
CZD = 14   # coefficient of constant impedance load at rated voltage in range [0,1]
87

88 1
bus_cols = 15

Read our documentation on viewing source code .

Loading