Professional Documents
Culture Documents
R. Zimmerman
D. Gan
rz10@cornell.edu
deqiang@ee.cornell.edu
Power Systems Engineering Research Center (PSERC)
School of Electrical Engineering, Cornell University
INTRODUCTION.............................................................................................................................................1
THE POWER FLOW SOLVER.........................................................................................................................2
THE OPTIMAL POWER FLOW FORMULATION............................................................................................2
THE OPTIMIZATION TOOLBOX BASED OPF SOLVER.................................................................................2
THE LP-BASED OPF SOLVER........................................................................................................................2
General Introduction......................................................................................................................................3
The Sparse Solver..........................................................................................................................................4
The Dense Solver............................................................................................................................................7
The Formulation of LP Sub-problem................................................................................................................7
Solving the LP Sub-problem..........................................................................................................................8
Computing KT Multipliers (incomplete)...........................................................................................................8
Checking KT Conditions (incomplete)..............................................................................................................8
Computing Generation-load Shift Factors (incomplete)......................................................................................9
The Jacobian Matrix of Load Flow.................................................................................................................9
Linearized Formulation of Line Flow.............................................................................................................10
TEST RESULTS (INCOMPLETE)..................................................................................................................10
THE COMBINED UC-OPF SOLVER (INCOMPLETE).....................................................................................10
FINAL REMARKS (INCOMPLETE)................................................................................................................10
REFERENCE.................................................................................................................................................10
Introduction
The restructuring of the electric power industry in many parts of the world is creating a need for new analytical as well as
simulation tools. To test new ideas and methodologies for the operation of competitive power systems, researchers need to
have ready access to simulation tools which are easy to use and modify. The MATPOWER package, a set of Matlab m-files
developed by PSERC at Cornell University, is intended as such a tool.
At present, MATPOWER can be used to solve the following problems:
economic dispatch
unit commitment
combined unit commitment and optimal power flow
transient stability
stability-constrained optimal power flow
This note is simply a technical note maintained by the authors describing the details of the algorithms implemented in
MATPOWER. Its purpose is to provide technical details for those interested in modifying or extending the current
functionality.
Minimize
Pg ,Q g
Vi V
Vi V m
Pgi PgiM
Pgi Pgim
Qgi QgiM
Qgi Qgim
The OPF formulation described above is used for both the Optimization Toolbox based OPF and the LP-based OPF. The
objective function of the OPF problem is assumed to be summation of costs of individual generators. The cost of each
generator is expressed in the form of either quadratic function or piece-wise linear curve.
Pg1
Pg2
General Introduction
LP-based OPF method has been extensively examined, and used in quite a few modern power systems. The algorithm we
coded is perhaps different from that in production-grade software. The major difference is that our algorithm is much simpler.
The reason of doing so is, certainly, to make the OPF solver more re-usable. The flow chart of our solver is demonstrated in
Fig. 3.
Update solution
yes
STOP
Fig. 3 Flow Chart of LP-based OPF Solver
The stopping criteria, the selection of starting point, handling infeasibilities, etc. will be explained in the coming version of
this note.
The LP-based OPF solver can not handle OPF problems with quadratic cost function directly. If the cost information of
generators is given by quadratic functions, the quadratic curves will be discretized into piece-wise linear functions in M-file
opf.m. So in this chapter, we assume that the cost of generators is piece-wise linear.
We have developed two variants of LP-based OPF solver, one is called dense solver, and another is sparse solver. In the
algorithm of dense solver, load flow equations are eliminated, so are network voltages. In sparse solver, load flow equations are
preserved. The dense solver is more independent on the performance of LP solver but is less readable, while sparse solver is
more readable but is more dependent on the performance of LP solver. In subsequent text, we will give the details underlying
both solvers.
Minimize
V , , PG , Q G
)+...+(
nseg( i)
Pgi
S.T.
Gij
=0
(i=1, ,ng)
=0
(i=1, , nb)
=0
(i=1, , nb)
Pi
Vj +
V j
j=1
n
Pi
j= 2
n
Qi
Vj +
V j
j=1
~
S l f
V j +
V j
j =1
~
n
S lt
V j +
V j
j =1
~
S l f
j
j
j= 2
~
n
Sl t
j
j
j= 2
j= 2
- Pgi
Qi
- QGi
S lM S l0
S lM S l0
Vi
V M Vi0
Vi
Vi0 V m
(l=1,.., nl)
(l=1,.., nl)
PGi
PGiM PGi0
(i=1, , ng)
PGi
PGi0 PGim
(i=1, , ng)
QGi
QGi
m
Q0Gi QGi
PGij
PGij
QGiM
Q 0Gi
PGij
M
PGij
0
PGij
0
(i=1, , ng)
(i=1, , ng)
(i=1, , ng, j=1, , nseg(i))
(i=1, , ng, j=1, , nseg(i))
MIN
V
0
0
0
0
[
] Pg
Q g
Pg
Pg
S.T.
J PV ,ref V + J P ,ref
J PV V
+ J P
J QV V
+ J Q
~
S f
~
S f
V
V
V
V
~
St
~
St
- M ppg Pg = 0
E ref Pgref
,
=0
- Pg
=0
- Q g
S M S0
S M S0
V M V0
V0 Vm
V
Pg
PgM Pg0
Pg
Pg0 Pgm
Q g
Q g
- Pg 0
-
-
Note:
=0
QgM Q 0g
Q0g Q mg
Pg Pg M Pg 0
Pg
(Step size constraints)
Q g
(Step size constraints)
= G
21 G22 Q g
~
~
~
~
~ S S V S S G11
S =
=
V V G21
M jg = J ref G
V
=
J PV
J
QV
G12 V
= [T1
G 22
Pg
T2 ]
Qg
MIN
S.T.
Pg
[0 0 ]Q g
P
g
Pg
- M ppg Pg
( M j g,P I ref ) Pg
=0
M jgQ
, Qg
=0
T1 f Pg
T2 f Q g
S M S0
T1t Pg
T2t Q g
S M S0
G11 Pg
G12 Qg
V M V0
- G11 Pg
G12 Qg
V0 Vm
Pg
PgM Pg0
Pg
Pg0 Pgm
Q g
Q g
- Pg 0
-
-
QgM Q 0g
Q0g Q mg
Pg Pg M Pg 0
Pg
Q g
0 c
=
A x b
where A is composed of the binding terms of coefficients matrix A of a LP problem. The above formula is the basis we
compute KT multipliers. Let us rewrite the constraints of sparse LP formulation as:
E1u + J P1 x = 0
Eu + Jx = 0
Du + Bx = S~
Where: u contains controllable variables, x contains state variables V and . Matrix D and B jointly denote a submatrix of sparse linearized LP matrix. The sub-matrix is composed of the binding rows of the inequality constraints. Binding
constraints is identified after LP is solved.
Since AT = c , it follows:
J1T
E1T
J T B T 1
=
E T D T
1 and are provided by LP solver (the dual vector). Solving the above equation, we get .
f (P )+ g + h
i
i i
i i
L
= ij ij iju lij = 0
Pgij
trans
= i
Pgi
L
lf
Q gi
lf
i i + i = 0
u
= i i + i = 0
hk
L
=
Vi
L
=
P(V , )
i
Vi
iu + li
sk
~
S f
~
S kf
Vi
ks
~
S t
~
S kt
Vi
=0
=0
J PV P
=
J QV V Q
J P + J PV V = P
J + J V = 0
QV
Q
1
P = J P J PV J QV
J Q = J
Pij = ij / X ij = H J 1 P
Matrix
Pi
= VV
i j G ij sinij Bij cosij
j
Pi
= Vi
i
V (G
j i , j i
ij
= Qi BiiVi 2
Pi
= Vi Gij cosij + Bij sin ij
V j
j =1
j i
ji
NB
Qi
= VV
i j Gij cosij + Bij sinij
j
Qi
= Vi V j Gij cosij + Bij sin ij
i
j i , j i
= Pi GiiVi 2
Qi
= Vi Gij sinij Bij cosij
V j
)
j i
)
ji
Pi
=
Vi
=
V (G
j i , j i
ij
V (G
Qi
=
Vi
1
Pi + GiiVi2 )
(
Vi
j i , j i
ij
1
Qi BiiVi 2 )
(
Vi
Sij = Vi
Pij =
Vi Vj
R + jX
R + jX
R Vi2 VV
i j cosij VV
i j X sin ij
2
Qij
Vi
Qij
V j
Qij
Pij RVV
i j sin ij VV
i j X cosij
=
2
i
R +X2
Pij
RVV
i j sin ij VV
i j X cosij
=
2
j
R +X2
P +Q
2
ij
2
ij
Qij =
R +X
Pij R( 2Vi V j cosij ) V j X sin ij
=
Vi
R2 + X 2
Pij RVi cosij Vi X sin ij
=
V j
R2 + X 2
~
Sij =
)= V
Vi 2 VV
i j (cosi j sini ) cos j + j sin j
=
=
jVV
i j sin ij VV
i j cosij
R2 + X 2
2
RVV
i j sin ij + X Vi VV
i j cosij
R +X
RVj sin ij + X 2Vi V j cosij
2
jX )
R +X
RVi sinij XVi cosij
2
(R
R2 + X 2
RVV
i j cosij + XVV
i j sinij
=
i
R2 + X 2
Qij RVV
i j cosij + XVV
i j sin ij
=
2
2
j
R +X
S~ij
Vi
= 2 Pij0
Pij
Vi
+ 2Qij0
Qij
Vi
10