Beruflich Dokumente
Kultur Dokumente
Version 1.0
Ray D. Zimmerman; PSERC, Cornell University, Ithaca, NY 14853
Jagadisan Viswanathan; Verilogic LLC, Pittsburgh, PA 15235
Alex Meeraus; GAMS Development Corporation, Washington, DC 20007
January 2008
Contents
1 Introduction
2 AC Power Flow
2.1
2.2
2.3
2.4
4 Implementation in GAMS
4.1
4.2
4.3
4.4
Sets . . . . . . . .
Data . . . . . . . .
AC Power Flow . .
AC Optimal Power
. . .
. . .
. . .
Flow
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
2
2
3
3
4
4
5
6
6
7
7
8
1 Introduction
GAMSPOWER is a collection of AC Power Flow (PF) and AC Optimal Power Flow (OPF)
problems formulated in the GAMS modeling language (http://www.gams.com/). The data for
these problems are the same as the corresponding cases in MATPOWER (http://www.pserc.
cornell.edu/matpower/). This document briey describes
- the mathematical models used in the AC PF and OPF problems. It is based on the material
in MATPOWER User Manual [1].
- some of the details of the implementation in the GAMS framework.
After this work was completed, we learned that Antonio Conejo and his colleagues at the University
of Castilla-La Mancha, Ciudad Real, Spain have been using GAMS to solve AC OPF problems for
more than 15 years! Three of their recent works on optimization problems with AC Power Flow
at the centre stagemodeled and solved in GAMS frameworkare cited in the References.
1
2 AC POWER FLOW
2 AC Power Flow
2.1 Admittance matrix of the network
The admittance matrix of the network Y is obtained by combining elements described below:
- The shunt admittance of bus k is computed as
Yftc =
Ys + j Bc 12
2
1
Ys ejshift
1
Ys ejshift
Y s + j Bc
2
and Ys =
1
R + jX
Let B denote the set of branches and let N denote the number of buses. The elements of Y are
obtained as folllows:
Ykk
= Yk,sh +
yff,c +
(f,t,c)B:f =k
Yik
ytt,c
yf t,c +
(f,t,c)B:f =i,t=k
for all k = 1, 2, . . . , N
(f,t,c)B:t=k
ytf,c
i = k,
for all i, k = 1, 2, . . . , N
(f,t,c)B:f =k,t=i
Ii
Yik Ek
k=1
Pi + jQi
Ei Ii
Ei
Yik Ek
k=1
=
k=1
where i and k are the angles, |Ei | and |Ek |, the magnitudes, of the voltages at the buses i and
k , respectively. Equating the real and imaginary parts of both the sides results in:
N
Pi
(1)
(2)
k=1
N
Qi
=
k=1
2.3 Specications
There are 4 variables (|E|, , P and Q) and two equations, (1) and (2), per bus. So, to solve the
Power Flow problem, the values of two variables must be specied, in a consistent manner, for
each bus. The simplest cases of Power Flow problems deal with following types of buses:
Reference bus : The magnitude of the bus voltage and the bus angle are xed. Obviously, there
can be only one reference bus for a given problem.
PV bus : Here, at least one generator is assigned to the bus. The active power power injected
(= sum of active power outputs of generators assigned to the bus - demand) and magnitude
of the bus voltage are specied.
The classication into PV or PQ buses does not apply anymore: but a reference bus is still
needed to x one of the bus angles (most often, to zero).
The MATPOWER User Manual [1] shows how the optimization framework also allows additional constraints to be taken into consideration. For example, consider the P-Q capability curve
of a generator. This means the point (p, q), where p and q are the active and reactive power
outputs, respectively, must lie within a (bounded, convex) polyhedron dened by a set of linear
inequalities.
Other possibilities are to treat the phase shifter angle shift and the transformer tap ratio of
some branches as variables.
PF F (f, t, c)
(rateA(f, t, c)/baseMVA)2
(rateA(f, t, c)/baseMVA)2
(3)
(4)
and
for i = 1, 2, . . . ..n
are non-decreasing, i.e., 0 < m1 m2 . . . mn , it is shown in MATPOWER User Manual [1], the
cost y for active power output p satises the inequalities:
y mi (p xi1 ) + yi1
for i = 1, 2, . . . ..n
dene the segments for the piecwise-linear cost for reactive power, then the cost z for reactive
power output q satises the inequalities
z ni (q ui1 ) + vi1
where
for i = 1, 2, . . . ..n
for i = 1, 2, . . . ..n
For quadratic cost functions, the generation cost for active power p is computed as c0 + c1 p +
c2 p2 . The cost for reactive power q is similarly computed as d0 + d1 q + d2 q 2 .
Pi
pj Pid )/baseMVA
(5)
qj Qd )/baseMVA
i
(6)
jGi
Qi
(
jGi
where Pid and Qd are the active and reactive power demands at i with
i
pmin pj pmax
j
j
min
max
and qj
qj qj
if j is online
(7)
and
pj = 0
and
qj = 0
if j is oine
(8)
yj = c0 + c1 pj + c2 p2
j
(9)
or
for i = 1, 2, . . . n
(10)
(11)
or
for i = 1, 2, . . . n
(12)
C=
(yj + zj )
jG
The optimization problem is to minimize C subject to all the constraints described earlier.
(13)
4 IMPLEMENTATION IN GAMS
4. Add the constraints identied in step 2 and solve AC OPF again, using the last solution as
the starting point.
5. Go to step 2.
4 Implementation in GAMS
The GAMS input le for any problem is quite self-explanatory. The following brief descriptions
of some details are simply meant to guide a new user.
4.1 Sets
In GAMS, the basic building blocks are sets. The model is created with parameters, variables
and equations dened on sets. For the PF and OPF problems, the basic sets are the buses
and generarors dened by their identiers. The relationship between objects is expressed through
subsets of the product sets. For example, the association between generators and buses is expressed
in statements like:
1.2.1,
2.4.1,
3.6.1,
So, 2.4.1 is the branch connecting (from) bus 2 and (to) bus 4 with the circuit identier 1.
Other subsets are dened as needed: For example:
Set
pq(bus)
pv(bus)
ref(bus)
iso(bus)
pq(bus)
pq buses (bus_type == 1)
pv buses (bus_type == 2)
reference bus (bus_type == 3)
isolated bus (bus_type == 4) ;
= yes$(bus_type(bus) eq 1);
4 IMPLEMENTATION IN GAMS
4.2 Data
Data are entered as scalars, parameters and tables. Parameters are lists of values dened over
sets. Tables are similar to matrices used in MATPOWER case les. Additional data may be
created as needed using GAMS modeling language statements.
Some parameters have been dened in `main.gms' simply to show additional possibilities. Some
of them are redundant and can be easily removed. To illustrate, consider the parameter ratio
dened by
denom(fbus,tbus,ckt)$branch(fbus,tbus,ckt)
= ratio(fbus,tbus,ckt)$(ratio(fbus,tbus,ckt) ne 0)
+ 1$(ratio(fbus,tbus,ckt) eq 0);
We can avoid the parameter ratio altogether by changing the above to:
denom(fbus,tbus,ckt)$branch(fbus,tbus,ckt)
=
branch_data(fbus,tbus,ckt, 'ratio')
$(branch_data(fbus,tbus,ckt, 'ratio') ne 0)
+ 1$(branch_data(fbus,tbus,ckt, 'ratio') eq 0);
From the given data, additional parameters needed in the model are generated. See the declaration : Parameters ysh_r(bus), ysh_i(bus), etc. and the following statements in `main.gms'
where the terms related to the admittance matrix of the network (subsection 2.1) are computed.
Positive variables
E(bus)
If some generators are oine, then one checks if any PV bus must be converted to a PQ bus. The
specications for the buses are made as shown:
E.fx(ref)
P.fx(pq)
E.fx(pv)
P.fx(pv)
= Vm(ref); theta.fx(ref) = 0;
= -Pd(pq)/baseMVA; Q.fx(pq) = -Qd(pq)/baseMVA;
= Vm(pv);
= (sum(ab(gen,pv)$online(gen),Pg(gen))-Pd(pv))/baseMVA;
REFERENCES
Variables
Pgen(gen)
Qgen(gen)
total_cost
Positive variables
pcost(gen)
qcost(gen)
The declarations and denitions of cost functions correspond to the optimization model described
in subsections 3.2 and 3.3. Bounds on the variables Pgen and Qgen are specied in:
Pgen.lo(gen)
Pgen.up(gen)
Qgen.lo(gen)
Qgen.up(gen)
=
=
=
=
Pmin(gen)$online(gen);
Pmax(gen)$online(gen);
Qmin(gen)$online(gen);
Qmax(gen)$online(gen);
So, for generators that are oine, the above bounds are all zero.
The AC OPF is solved as a nonlinear optimization problem with the objective function
total_cost with the statement:
References
[1] MATPOWER 3.2 User's Manual: Available online at: (http://www.pserc.cornell.edu/
matpower/).
[2] F. Milano, C. A. Canizares and A. J. Conejo: Sensitivity-Based Security-Constrained OPF
Market Clearing Model, IEEE Trans. on Power systems, 20(4), 2051-2060, November 2005.
[3] A. J. Conejo, F. Milano and R. Garcia-Bertrand: Congestion Management Ensuring Voltage
Stability, IEEE Trans. on Power systems, 21(1), 357-364, February 2006.
[4] R. Minguez, F. Milano, R. Zarate-Minano and A. J. Conejo: Optimal Network Placement of
SVC Devices, IEEE Trans. on Power systems, 22(4), 1851-1860, November 2007.
[5] A. J. Wood and B. F. Wollenberg: Power Generation, Operation and Control, second edition,
Wiley, New York (1996).