Professional Documents
Culture Documents
TN2 OPF Derivatives PDF
TN2 OPF Derivatives PDF
c 2008, 2010, 2011, 2017, 2018 Power Systems Engineering Research Center (Pserc)
All Rights Reserved
∗
Revision 5 – April 2, 2018. See Section 8 for revision history details.
CONTENTS CONTENTS
Contents
1 Notation 4
2 Introduction 5
3 Voltages 6
3.1 Bus Voltages . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6
3.1.1 First Derivatives . . . . . . . . . . . . . . . . . . . . . . . . . 6
3.1.2 Second Derivatives . . . . . . . . . . . . . . . . . . . . . . . . 7
3.2 Branch Voltages . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7
3.2.1 First Derivatives . . . . . . . . . . . . . . . . . . . . . . . . . 7
4 Bus Injections 7
4.1 Complex Current Injections . . . . . . . . . . . . . . . . . . . . . . . 7
4.1.1 First Derivatives . . . . . . . . . . . . . . . . . . . . . . . . . 8
4.2 Complex Power Injections . . . . . . . . . . . . . . . . . . . . . . . . 8
4.2.1 First Derivatives . . . . . . . . . . . . . . . . . . . . . . . . . 8
4.2.2 Second Derivatives . . . . . . . . . . . . . . . . . . . . . . . . 9
5 Branch Flows 11
5.1 Complex Currents . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11
5.1.1 First Derivatives . . . . . . . . . . . . . . . . . . . . . . . . . 11
5.1.2 Second Derivatives . . . . . . . . . . . . . . . . . . . . . . . . 12
5.2 Complex Power Flows . . . . . . . . . . . . . . . . . . . . . . . . . . 13
5.2.1 First Derivatives . . . . . . . . . . . . . . . . . . . . . . . . . 13
5.2.2 Second Derivatives . . . . . . . . . . . . . . . . . . . . . . . . 13
5.3 Squared Current Magnitudes . . . . . . . . . . . . . . . . . . . . . . . 16
5.3.1 First Derivatives . . . . . . . . . . . . . . . . . . . . . . . . . 16
5.3.2 Second Derivatives . . . . . . . . . . . . . . . . . . . . . . . . 16
5.4 Squared Apparent Power Magnitudes . . . . . . . . . . . . . . . . . . 17
5.4.1 First Derivatives . . . . . . . . . . . . . . . . . . . . . . . . . 17
5.4.2 Second Derivatives . . . . . . . . . . . . . . . . . . . . . . . . 18
5.5 Squared Real Power Magnitudes . . . . . . . . . . . . . . . . . . . . . 18
5.5.1 First Derivatives . . . . . . . . . . . . . . . . . . . . . . . . . 19
5.5.2 Second Derivatives . . . . . . . . . . . . . . . . . . . . . . . . 19
2
CONTENTS CONTENTS
8 Revision History 27
References 28
3
1 NOTATION
1 Notation
nb , ng , nl number of buses, generators, branches, respectively
|vi |, θi bus voltage magnitude and angle at bus i
vi complex bus voltage at bus i, that is |vi |ejθi
V, Θ nb × 1 vectors of bus voltage magnitudes and angles
V nb × 1 vector of complex bus voltages vi
I bus nb × 1 vector of complex bus current injections
If , It nl × 1 vectors of complex branch current injections, from and to ends
S bus nb × 1 vector of complex bus power injections
Sf , St nl × 1 vectors of complex branch power flows, from and to ends
Sg ng × 1 vector of generator complex power injections
P, Q real and reactive power flows/injections, S = P + jQ
M, N real and imaginary parts of current flows/injections, I = M + jN
Ybus nb × nb system bus admittance matrix
Yf , Yt nl × nb system branch admittance matrices, from and to ends
Cg nb × ng generator connection matrix
(i, j)th element is 1 if generator j is located at bus i, 0 otherwise
Cf , Ct nl × nb branch connection matrices, from and to ends,
(i, j)th element is 1 if from end, or to end, respectively, of branch i is
connected to bus j, 0 otherwise
[A] diagonal matrix with vector A on the diagonal
AT (non-conjugate) transpose of matrix A
A∗ complex conjugate of A
Ab matrix exponent for matrix A, or element-wise exponent for vector A
1n , [1n ] n × 1 vector of all ones, n × n identity matrix
0 appropriately-sized vector or matrix of all zeros
4
2 INTRODUCTION
2 Introduction
The purpose of this document is to show how the AC power balance and flow equa-
tions used in power flow and optimal power flow computations can be expressed in
terms of complex matrices, and how their first and second derivatives can be com-
puted efficiently using complex sparse matrix manipulations. Similarly, the deriva-
tives of the generalized AC OPF cost function used by Matpower [1, 2] and the
corresponding OPF Lagrangian function are developed. The relevant code in Mat-
power is based on the formulas found in this note, in which nodal balances are
expressed in terms of complex power and voltages are represented in polar coor-
dinates, and in the companion Matpower Technical Note 2 [3] and Matpower
Technical Note 3 [4], which present formulas for variations based on nodal current
balances and cartesian coordinate voltages, respectively.
We will be looking at complex functions of the real valued vector
Θ
V
X= Pg .
(1)
Qg
T
For a complex scalar function f : Rn → C of a real vector X = x1 x2 · · · xn ,
we use the following notation for the first derivatives (transpose of the gradient)
∂f h
∂f ∂f ∂f
i
fX = = ∂x1 ∂x2 · · · ∂xn . (2)
∂X
The matrix of second partial derivatives, the Hessian of f , is
∂2f ∂2f
2 · · · ∂x1 ∂xn
∂x. 1
T
∂ 2f
∂ ∂f . ..
fXX = 2
= = .. .. . . (3)
∂X ∂X ∂X 2
∂ f 2
∂ f
∂xn ∂x1
··· ∂x2
n
5
3 VOLTAGES
In these derivations, the full 3-dimensional set of second partial derivatives of F will
not be computed. Instead a matrix of partial derivatives will be formed by computing
the Jacobian of the vector function obtained by multiplying the transpose of the
Jacobian of F by a constant vector λ, using the following notation.
∂ T
FXX (α) = FX λ (6)
∂X λ=α
3 Voltages
3.1 Bus Voltages
V is the nb × 1 vector of complex bus voltages. The element for bus i is vi = |vi |ejθi .
V and Θ are the vectors of bus voltage magnitudes and angles. Let
E = [V]−1 V (10)
∂V
VΘ = = j [V ] (11)
∂Θ
∂V
VV = = [V ] [V]−1 = [E] (12)
∂V
6
3.2 Branch Voltages 4 BUS INJECTIONS
∂E
EΘ = = j [E] (13)
∂Θ
∂E
EV = =0 (14)
∂V
∂V T
∂
VVV (λ) = λ = [λ] EV = 0 (15)
∂V ∂V
V f = Cf V (16)
V t = Ct V (17)
∂Vf ∂V
= Cf = jCf [V ] (18)
∂Θ ∂Θ
∂Vf ∂V
= Cf = Cf [V ] [V]−1 = Cf [E] (19)
∂V ∂V
4 Bus Injections
4.1 Complex Current Injections
I bus = Ybus V (20)
7
4.2 Complex Power Injections 4 BUS INJECTIONS
∂I bus ∂V
IΘbus = = Ybus = jYbus [V ] (22)
∂Θ ∂Θ
∂I bus ∂V
IVbus = = Ybus = Ybus [V ] [V]−1 = Ybus [E] (23)
∂V ∂V
and
∗
S bus = [V ] I bus (25)
∂Gs s
GsX = = GΘ GsV GsPg GsQg
(26)
∂X
∗
∂S bus h bus ∗ i ∂V ∂I bus
GsΘ = = I + [V ] (27)
∂Θ h i ∂Θ ∂Θ
bus ∗
= I j [V ] + [V ] (jYbus [V ])∗ (28)
h ∗
i
= j [V ] ( I bus − Ybus ∗ [V ∗ ]) (29)
∗
∂S bus h bus ∗ i ∂V ∂I bus
GsV = = I + [V ] (30)
∂V h i ∂V ∂V
bus ∗
= I [E] + [V ] Ybus ∗ [E ∗ ] (31)
h ∗
i
= [V ] ( I bus + Ybus ∗ [V ∗ ]) [V]−1 (32)
8
4.2 Complex Power Injections 4 BUS INJECTIONS
∂
GsXX (λ) = GsX T λ
(35)
∂X
s
GΘΘ (λ) GsΘV (λ) 0 0
GsVΘ (λ) GsVV (λ) 0 0
= (36)
0 0 0 0
0 0 0 0
∂
GsΘΘ (λ) = GsΘ T λ
(37)
∂Θ
∂ h bus ∗ i ∗ ∗T
= j I − [V ] Ybus [V ] λ (38)
∂Θ
∂ h bus ∗ i
=j I [V ] λ − [V ∗ ] Ybus ∗ T [V ] λ (39)
∂Θ
h i
∗ ∗ bus ∗
=j
[V ] [λ] (−jY bus [V ]) + I [λ] (j [V ])
| {z } | {z }
∗ ∂V
∂I bus
∂Θ ∂Θ
h i
− [V ∗ ] Ybus ∗ T [λ] (j [V ]) − Ybus ∗ T [V ] λ (−j [V ∗ ]) (40)
| {z } | {z }
∂V ∂V ∗
∂Θ ∂Θ
h i
= [V ∗ ] Ybus ∗ T [V ] [λ] − Ybus ∗ T [V ] λ
h ∗
i
+ [λ] [V ] Ybus ∗ [V ∗ ] − I bus (41)
=E +F (42)
∂
GsVΘ (λ) = GsV T λ
(43)
∂Θ
∂ h bus ∗ i ∗ ∗T
= [E] I λ + [E ] Ybus [V ] λ (44)
∂Θ h i
∗
= [E] [λ] (−jYbus ∗ [V ∗ ]) + I bus [λ] j [E]
| {z } |{z}
∗ ∂E
∂I bus
∂Θ ∂Θ
9
4.2 Complex Power Injections 4 BUS INJECTIONS
h i
+ [E ∗ ] Ybus ∗ T [λ] j [V ] + Ybus ∗ T [V ] λ (−j [E ∗ ]) (45)
|{z} | {z }
∂V ∂E ∗
∂Θ ∂Θ
h i
= j [E ∗ ] Ybus ∗ T [V ] [λ] − Ybus ∗ T [V ] λ
h ∗
i
− [λ] [E] Ybus ∗ [V ∗ ] − I bus (46)
h i
−1 ∗ ∗T ∗T
= j [V] [V ] Ybus [V ] [λ] − Ybus [V ] λ
h ∗
i
− [λ] [V ] Ybus ∗ [V ∗ ] − I bus (47)
= jG(E − F) (48)
∂
GsΘV (λ) = GsΘ T λ
(49)
∂V
h i
∗ ∗T
= j [λ] [V ] Ybus − Ybus [V ] λ [V ∗ ]
h ∗
i
− [V ∗ ] Ybus ∗ T − I bus [V ] [λ] [V]−1 (50)
= GsVΘ T (λ) (51)
∂
GsVV (λ) = GsV T λ
(52)
∂V
∂ h bus ∗ i ∗ ∗T
= [E] I λ + [E ] Ybus [V ] λ (53)
∂V h i
∗
= [E] [λ] Ybus ∗ [E ∗ ] + I bus [λ] |{z}
0
| {z }
∗ ∂E
∂I bus ∂V
∂V
h i
+ [E ∗ ] Ybus ∗ T [λ] [E] + Ybus ∗ T [V ] λ |{z}
0 (54)
|{z} ∗
∂V ∂E
∂V ∂V
−1
= [V] ∗ ∗ ∗
[λ] [V ] Ybus [V ] + [V ] Ybus ∗T
[V ] [λ] [V]−1 (55)
= G(C + C T )G (56)
Computational savings can be achieved by storing and reusing certain interme-
diate terms during the computation of these second derivatives, as follows:
A = [λ] [V ] (57)
B = Ybus [V ] (58)
10
5 BRANCH FLOWS
C = AB ∗ (59)
∗T
D = Ybus [V ] (60)
E = [V ∗ ] (D [λ] − [Dλ]) (61)
h i
bus ∗
F =C−A I = j [λ] GsΘ (62)
G = [V]−1 (63)
GsΘΘ (λ) = E + F (64)
GsVΘ (λ) = jG(E − F) (65)
GsΘV (λ) = GsVΘ T (λ) (66)
GsVV (λ) = G(C + C )G T
(67)
5 Branch Flows
Consider the line flow constraints of the form H(X) < 0. This section examines 3
variations based on the square of the magnitude of the current, apparent power and
real power, respectively. The relationships are derived first for the complex flows at
the from ends of the branches. Derivations for the to end are identical (i.e. just
replace all f sub/super-scripts with t).
I f = Yf V (68)
I t = Yt V (69)
11
5.1 Complex Currents 5 BRANCH FLOWS
f ∂ fT
IXX (µ) = I µ (75)
∂X X
f f
IΘΘ (µ) IΘV (µ) 0 0
I f (µ) I f (µ) 0 0
= VΘ VV (76)
0 0 0 0
0 0 0 0
f ∂ fT
IΘΘ (µ) = I µ (77)
∂Θ Θ
∂
j [V ] Yf T µ
= (78)
∂Θ
= − Yf T µ [V ]
(79)
f ∂ fT
IVΘ (µ) = I µ (80)
∂Θ V
∂
[E] Yf T µ
= (81)
∂Θ
= j Yf T µ [E]
(82)
f
= −jIΘΘ (µ) [V]−1 (83)
f ∂ fT
IΘV (µ) = I µ (84)
∂V Θ
∂
j [V ] Yf T µ
= (85)
∂V
= j Yf T µ [E]
(86)
f
= IVΘ (µ) (87)
f ∂ fT
IVV (µ) = I µ (88)
∂V V
∂
[E] Yf T µ
= (89)
∂V
=0 (90)
12
5.2 Complex Power Flows 5 BRANCH FLOWS
f ∂S f h
f f f f
i
SX = = SΘ SV SPg SQg (93)
∂X
∗
h ∗ i ∂V
f ∂I f
= If + [Vf ] (94)
∂X ∂X
∗
h ∗ i ∂V
f ∂I f
SΘf = I f + [Vf ] (95)
h ∗ i ∂Θ ∂Θ
= I f
jCf [V ] + [Cf V ] (jYf [V ])∗ (96)
h ∗i
= j( I f Cf [V ] − [Cf V ] Yf ∗ [V ∗ ]) (97)
∗
h ∗ i ∂V
f ∂I f
SVf = I f + [Vf ] (98)
h ∗ i ∂V ∂V
= I f
Cf [E] + [Cf V ] Yf ∗ [E ∗ ] (99)
SPf g = 0 (100)
SQf g = 0 (101)
f ∂ fT
SXX (µ) = SX µ (102)
∂X
f f
SΘΘ (µ) SΘV (µ) 0 0
S f (µ) S f (µ) 0 0
= VΘ VV (103)
0 0 0 0
0 0 0 0
13
5.2 Complex Power Flows 5 BRANCH FLOWS
f ∂ fT
SΘΘ (µ) = S µ (104)
∂Θ Θ
∂ h ∗i
= j [V ] Cf T I f − [V ∗ ] Yf ∗ T [Cf V ] µ (105)
∂Θ
∂ h ∗i
=j [V ] Cf T I f µ − [V ∗ ] Yf ∗ T [Cf V ] µ (106)
∂Θ
h h ∗i i
∗ ∗
T T
=j
[V ] C f [µ] (−jY f [V ]) + C f I f µ j [V ]
| {z } |{z}
∗ ∂V
∂I f
∂Θ ∂Θ
h i
− [V ∗ ] Yf ∗ T [µ] Cf j [V ] − Yf ∗ T [Cf V ] µ (−j [V ∗ ]) (107)
|{z} | {z }
∂V ∂V ∗
∂Θ ∂Θ
= [V ∗ ] Yf ∗ T [µ] Cf [V ] + [V ] Cf T [µ] Yf ∗ [V ∗ ]
h i
− Yf ∗ T [µ] Cf V [V ∗ ] − Cf T [µ] Yf ∗ V ∗ [V ]
(108)
= Ff − Df − Ef (109)
f ∂ fT
SVΘ (µ) = S µ (110)
∂Θ V
∂
T
h ∗i
f ∗ ∗T
= [E] Cf I µ + [E ] Yf [Cf V ] µ (111)
∂Θ h h ∗i i
= [E] Cf T [µ] (−jYf ∗ [V ∗ ]) + Cf T I f µ j [E]
| {z } |{z}
∗ ∂E
∂I f
∂Θ ∂Θ
h i
+ [E ∗ ] Yf ∗ T [µ] Cf j [V ] + Yf ∗ T [Cf V ] µ (−j [E ∗ ]) (112)
|{z} | {z }
∂V ∂E ∗
∂Θ ∂Θ
= j [E ∗ ] Yf ∗ T [µ] Cf [V ] − [E] Cf T [µ] Yf ∗ [V ∗ ]
h i
− Yf ∗ T [µ] Cf V [E ∗ ] + Cf T [µ] Yf ∗ V ∗ [E]
(113)
−1
= j [V] [V ∗ ] Yf ∗ T [µ] Cf [V ] − [V ] Cf T [µ] Yf ∗ [V ∗ ]
h i
− Yf ∗ T [µ] Cf V [V ∗ ] + Cf T [µ] Yf ∗ V ∗ [V ]
(114)
= jG(Bf − Bf T − Df + Ef ) (115)
14
5.2 Complex Power Flows 5 BRANCH FLOWS
f ∂ fT
SΘV (µ) = SΘ µ (116)
∂V
= j [V ] Cf T [µ] Yf ∗ [V ∗ ] − [V ∗ ] Yf ∗ T [µ] Cf [V ]
h i
− Yf ∗ T [µ] Cf V [V ∗ ] + Cf T [µ] Yf ∗ V ∗ [V ] [V]−1
(117)
f T
= SVΘ (µ) (118)
f ∂ fT
SVV (µ) = SV µ (119)
∂V
∂ h ∗i
= [E] Cf T I f µ + [E ∗ ] Yf ∗ T [Cf V ] µ (120)
∂V h h ∗i i
T ∗ ∗ T
= [E] Cf [µ] Yf [E ] + Cf I f µ |{z} 0
| {z } ∂E
∗
∂I f ∂V
∂V
h i
∗ ∗T ∗T
+ [E ] Yf [µ] Cf [E] + Yf [Cf V ] µ |{z}
0 (121)
|{z} ∗
∂V ∂E
∂V ∂V
= [V]−1 [V ∗ ] Yf ∗ T [µ] Cf [V ] + [V ] Cf T [µ] Yf ∗ [V ∗ ] [V]−1 (122)
= GFf G (123)
Af = Yf ∗ T [µ] Cf (124)
Bf = [V ∗ ] Af [V ] (125)
Df = [Af V ] [V ∗ ] (126)
Ef = Af T V ∗ [V ]
(127)
Ff = Bf + Bf T (128)
G = [V]−1 (129)
f
SΘΘ (µ) = Ff − D f − E f (130)
f T
SVΘ (µ) = jG(Bf − Bf − Df + Ef ) (131)
f f T
SΘV (µ) = SVΘ (µ) (132)
f
SVV (µ) = GFf G (133)
15
5.3 Squared Current Magnitudes 5 BRANCH FLOWS
where I f = M f + jN f .
f
h ∗i
f
f∗
HX = I f IX + I f IX (136)
h ∗i h ∗ i ∗
f f
= I f IX + I f IX (137)
nh ∗ i o
f
= 2 · < I f IX (138)
= M f − jN f (MXf + jNXf ) + M f + jN f (MXf − jNXf )
(139)
f f f
f
= 2 M MX + N NX (140)
n o n f o
f
= 2 < I f < IX + = I f = IX (141)
f ∂ fT
HXX (µ) = HX µ (142)
∂X
f f
HΘΘ (µ) HΘV (µ) 0 0
H f (µ) H f (µ) 0 0
= VΘ VV (143)
0 0 0 0
0 0 0 0
16
5.4 Squared Apparent Power Magnitudes 5 BRANCH FLOWS
f ∂
fT
HXX (µ) = HX µ (144)
∂X
∂ T h ∗i
f f ∗T
f
= IX I f µ + IX I µ (145)
∂X
f∗ f ∗ f ∗T
h ∗i
f fT f
( I f µ) + IX ( I f µ) + IX
= IXX [µ] IX + IXX [µ] IX (146)
f∗
n h ∗i o
f fT
= 2 · < IXX ( I f µ) + IX [µ] IX (147)
f∗
n h ∗i o
f f f fT
HΘΘ (µ) = 2 · < IΘΘ ( I µ) + IΘ [µ] IΘ (148)
∗
n h ∗i T
o
f f
HVΘ (µ) = 2 · < IVΘ ( I f µ) + IVf [µ] IΘf (149)
∗
n h ∗i T
o
f f
HΘV (µ) = 2 · < IΘV ( I f µ) + IΘf [µ] IVf (150)
f∗
n h ∗i o
f f f fT
HVV (µ) = 2 · < IVV ( I µ) + IV [µ] IV (151)
where S f = P f + jQf .
f
h ∗i
f
f∗
HX = S f SX + S f SX (154)
h ∗i h ∗ i ∗
f f
= S f SX + S f SX (155)
nh ∗ i o
f
= 2 · < S f SX (156)
= P f − jQf (PXf + jQfX ) + P f + jQf (PXf − jQfX )
(157)
17
5.5 Squared Real Power Magnitudes 5 BRANCH FLOWS
P f PXf + Qf QfX
=2 (158)
n o f n f o
f f
=2 < S < SX + = S = SX (159)
f ∂ fT
HXX (µ) = HX µ (160)
∂X
f f
HΘΘ (µ) HΘV (µ) 0 0
H f (µ) H f (µ) 0 0
= VΘ VV (161)
0 0 0 0
0 0 0 0
f ∂
fT
HXX (µ) = HX µ (162)
∂X
∂
f T
h ∗i
f ∗T
f
= SX S f µ + SX S µ (163)
∂X
f ∗ f ∗ f ∗T
h ∗i
f f T f
( S f µ) + SX ( S f µ) + SX
= SXX [µ] SX + SXX [µ] SX (164)
f ∗
n h ∗i o
f f f T
= 2 · < SXX ( S µ) + SX [µ] SX (165)
∗
n h ∗i T
o
f f
HΘΘ (µ) = 2 · < SΘΘ ( S f µ) + SΘf [µ] SΘf (166)
∗
n h ∗i T
o
f f
HVΘ (µ) = 2 · < SVΘ ( S f µ) + SVf [µ] SΘf (167)
∗
n h ∗i T
o
f f
HΘV (µ) = 2 · < SΘV ( S f µ) + SΘf [µ] SVf (168)
∗
n h ∗i T
o
f f
HVV (µ) = 2 · < SVV ( S f µ) + SVf [µ] SVf (169)
18
6 GENERALIZED AC OPF COSTS
f
= 2 P f PXf
HX (172)
n o
f
= 2 < S f < SX (173)
f ∂ fT
HXX (µ) = HX µ (174)
∂X
f f
HΘΘ (µ) HΘV (µ) 0 0
H f (µ) H f (µ) 0 0
= VΘ VV (175)
0 0 0 0
0 0 0 0
f ∂ fT
HXX (µ) = HX µ (176)
∂X
∂ f T f
= 2PX P µ (177)
∂X
f fT f
f
= 2 PXX ( P µ) + PX [µ] PX (178)
n o n To n o
f f f
= 2 < SXX ( < S f µ) + < SX [µ] < SX (179)
n o n To n o
f f
HΘΘ (µ) = 2 < SΘΘ ( < S f µ) + < SΘf [µ] < SΘf (180)
n f o n To n o
f f
HVΘ (µ) = 2 < SVΘ ( < S µ) + < SV [µ] < SΘf
f
(181)
n o n To n o
f f
HΘV (µ) = 2 < SΘV ( < S f µ) + < SΘf [µ] < SVf (182)
n o n To n o
f f
HVV (µ) = 2 < SVV ( < S f µ) + < SVf [µ] < SVf (183)
19
6.1 Polynomial Generator Costs 6 GENERALIZED AC OPF COSTS
∂f a
fXa = (189)
∂Xa
= fΘ fVa fPag fQa g fYa fZa
(190)
h i
0 T 0 T
P
= 0 0 (F ) (F ) 0 0Q (191)
20
6.2 Piecewise Linear Generator Costs 6 GENERALIZED AC OPF COSTS
a ∂fXa T
fXX = (192)
∂X
0 0 0 0 0 0
0 0 0 0 0 0
0 0 fPa P
0 0 0
= 0 0
g g
a
(193)
0 f Qg Qg 0 0
0 0 0 0 0 0
0 0 0 0 0 0
where
h i
P 00
fPag Pg = F (194)
h i
00
fQa g Qg = FQ (195)
∂f b
fXb = (197)
∂Xb
= fΘ fVb fPb g fQb g fYb fZb
(198)
= 0 0 0 0 1Tny 0
(199)
21
6.3 General Cost Term 6 GENERALIZED AC OPF COSTS
∂W
A = WR̄ = = DL + 2 DQ R̄ (212)
∂ R̄
c ∂f c
B = fW = = W T H w + C wT (213)
∂W
∂ R̄
R̄X = =N (214)
∂X
∂W
WX = = WR̄ · R̄X (215)
∂X
= AN (216)
∂f c
fXc = c
= fW · WX (217)
∂X
= BAN (218)
∂
c
fXc T
fXX = (219)
∂X
∂
N T AB T
= (220)
∂X
T ∂ w w
T ∂ R̄
=N A (H W + C ) + 2 DQ B (221)
∂X ∂X
T w
T
= N AH WX + 2 DQ B R̄X (222)
= N T AH w A + 2 DQ B T N
(223)
23
7 LAGRANGIAN OF THE AC OPF
∂f
fX = = f a + fXb + fXc (226)
∂X hX i
0 T 0 T
= 0 0 (F ) (F ) 1ny 0 + BAN
P Q T (227)
∂ 2f a b c
fXX = 2
= fXX + fXX + fXX (228)
∂X
0 0 0 00 0
0 0 h 0 i 00 0
00
0 0 FP 0 0 0
= h i
Q 00
0 0 0 F 0 0
0 0 0 0 0 0
00 0 0 0 0
T w
T
+ N AH A + 2 DQ B N (229)
subject to
G(X) = 0 (231)
H(X) ≤ 0 (232)
where
<{Gs (X )}
G(X) = ={Gs (X )} (233)
AE X − BE
24
7.1 Nodal Current Balance 7 LAGRANGIAN OF THE AC OPF
and
H f (X )
H(X) = H t (X ) (234)
AI X − BI
Partitioning the corresponding multipliers λ and µ similarly,
λP µf
λ = λQ , µ = µt (235)
λE µI
LX (X, λ, µ) = fX + λT GX + µT HX (237)
Lλ (X, λ, µ) = GT (X) (238)
Lµ (X, λ, µ) = H T (X) (239)
where
<{GsX } 0 0 <{GsΘ } <{GsV } −Cg 0 0 0
GX = ={GsX } 0 0 = ={GsΘ } ={GsV } 0 −Cg 0 0 (240)
AE AE
and
HXf
f
HΘ HVf 0 0 0 0
0 0
HX = HXt 0 0 = HΘt HVt 0 0 0 0 (241)
AI AI
25
7.2 Nodal Power Balance 7 LAGRANGIAN OF THE AC OPF
and
26
8 REVISION HISTORY
8 Revision History
• Revision 5 (April 2, 2018) – Added References section and mention of Mat-
power Technical Note 3 and Matpower Technical Note 4. Updated some
LATEX syntax for consistency across Matpower Tech Notes 2, 3, and 4. Also,
the following notation changes were made to allow U and W to be used for
cartesian coordinates in Matpower Technical Note 4: u → ū, U → Ū ,
W → W.
27
REFERENCES REFERENCES
References
[1] R. D. Zimmerman, C. E. Murillo-Sánchez, and R. J. Thomas, “Matpower:
Steady-State Operations, Planning and Analysis Tools for Power Systems Re-
search and Education,” Power Systems, IEEE Transactions on, vol. 26, no. 1,
pp. 12–19, Feb. 2011. DOI: 10.1109/TPWRS.2010.2051168 2
[4] B. Sereeter and R. D. Zimmerman, AC Power Flows and their Derivatives us-
ing Complex Matrix Notation and Cartesian Coordinate Voltages, Matpower
Technical Note 4, April 2018. [Online]. Available: http://www.pserc.cornell.
edu/matpower/TN4-OPF-Derivatives-Cartesian.pdf 2
28