Professional Documents
Culture Documents
TN4 OPF Derivatives Cartesian PDF
TN4 OPF Derivatives Cartesian PDF
c 2008, 2010, 2011, 2017, 2018 Power Systems Engineering Research Center (Pserc)
All Rights Reserved
∗
Revision 1 – October 25, 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 . . . . . . . . . . . . . . . . . . . . . . . . . 7
3.1.2 Second Derivatives . . . . . . . . . . . . . . . . . . . . . . . . 7
3.2 Branch Voltages . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8
3.2.1 First Derivatives . . . . . . . . . . . . . . . . . . . . . . . . . 9
3.3 Reference Bus Voltage Angles . . . . . . . . . . . . . . . . . . . . . . 9
3.3.1 First Derivatives . . . . . . . . . . . . . . . . . . . . . . . . . 9
3.3.2 Second Derivatives . . . . . . . . . . . . . . . . . . . . . . . . 9
3.4 Bus Voltage Magnitude Limits . . . . . . . . . . . . . . . . . . . . . . 10
3.4.1 First Derivatives . . . . . . . . . . . . . . . . . . . . . . . . . 10
3.4.2 Second Derivatives . . . . . . . . . . . . . . . . . . . . . . . . 10
3.5 Branch Angle Difference Limits . . . . . . . . . . . . . . . . . . . . . 11
3.5.1 First Derivatives . . . . . . . . . . . . . . . . . . . . . . . . . 11
3.5.2 Second Derivatives . . . . . . . . . . . . . . . . . . . . . . . . 11
4 Bus Injections 12
4.1 Complex Current Injections . . . . . . . . . . . . . . . . . . . . . . . 12
4.1.1 First Derivatives . . . . . . . . . . . . . . . . . . . . . . . . . 12
4.1.2 Second Derivatives . . . . . . . . . . . . . . . . . . . . . . . . 13
4.2 Complex Power Injections . . . . . . . . . . . . . . . . . . . . . . . . 17
4.2.1 First Derivatives . . . . . . . . . . . . . . . . . . . . . . . . . 18
4.2.2 Second Derivatives . . . . . . . . . . . . . . . . . . . . . . . . 18
5 Branch Flows 20
5.1 Complex Currents . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 20
5.1.1 First Derivatives . . . . . . . . . . . . . . . . . . . . . . . . . 20
5.1.2 Second Derivatives . . . . . . . . . . . . . . . . . . . . . . . . 20
5.2 Complex Power Flows . . . . . . . . . . . . . . . . . . . . . . . . . . 20
5.2.1 First Derivatives . . . . . . . . . . . . . . . . . . . . . . . . . 21
5.2.2 Second Derivatives . . . . . . . . . . . . . . . . . . . . . . . . 21
5.3 Squared Current Magnitudes . . . . . . . . . . . . . . . . . . . . . . . 23
5.4 Squared Apparent Power Magnitudes . . . . . . . . . . . . . . . . . . 23
2
CONTENTS CONTENTS
8 Revision History 29
References 32
3
1 NOTATION
1 Notation
nb , ng , nl , nr number of buses, generators, branches, reference buses, respectively
ui , wi real and imaginary parts of bus voltage at bus i
|vi |, θi bus voltage magnitude and angle at bus i
vi complex bus voltage at bus i, that is |vi |ejθi or ui + jwi
U, W nb × 1 vectors of real and imaginary parts of bus voltage
V, Θ nb × 1 vectors of bus voltage magnitudes and angles
V nb × 1 vector of complex bus voltages vi , U + jW
I bus nb × 1 vector of complex bus current injections
If , It nl × 1 vectors of complex branch current injections, from and to ends
bus
S 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
Cref nr × nb reference bus indicator matrix
(i, j)th element is 1 if bus j is ith reference bus, 0 otherwise
[A] diagonal matrix with vector A on the diagonal
T
A (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
This document is a companion to Matpower Technical Note 2 [1] and Matpower
Technical Note 3 [2]. The purpose of these documents is to show how the AC power
balance and flow equations used in power flow and optimal power flow computa-
tions can be expressed in terms of complex matrices, and how their first and second
derivatives can be computed efficiently using complex sparse matrix manipulations.
The relevant code in Matpower [3,4] is based on the formulas found in these three
notes.
Matpower Technical Note 2 presents a standard formulation based on complex
power flows and nodal power balances using a polar representation of bus voltages,
Matpower Technical Note 3 adds the formulas needed for nodal current balances,
and this note presents versions of both based on a cartesian coordinate representation
of bus voltages.
We will be looking at complex functions of the real valued vector
U
W
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 = = ∂x ∂x2
· · · ∂xn . (2)
∂X 1
n m
For a complex vector function F : R → C of a vector X, where
T
F (X) = f1 (X) f2 (X) · · · fm (X) , (4)
the first derivatives form the Jacobian matrix, where row i is the transpose of the
gradient of fi . ∂f1 ∂f1
∂x1
· · · ∂xn
∂F
FX = = ... .. .. (5)
. .
∂X ∂fm ∂fm
∂x1
· · · ∂xn
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 = ui + jwi .
U and W are the vectors of real and imaginary parts of the bus voltages. Consider
also the vector of inverses of bus voltages v1i , denoted by Λ. Note that
1 1 ui − jwi vi ∗
= = 2 = (10)
vi ui + jwi ui + wi2 |vi |2
Λ = V −1 = [V]−2 V ∗ (11)
Θ = tan−1 [U ]−1 W
(12)
21
V = U2 + W 2 (13)
6
3.1 Bus Voltages 3 VOLTAGES
∂V
VU = = [1nb ] (14)
∂U
∂V
VW = = j [1nb ] (15)
∂W
∂Λ
ΛU = = − [Λ]2 (16)
∂U
∂Λ
ΛW = = −j [Λ]2 (17)
∂W
The following could also be useful for implementing certain constraints on volt-
age magnitude or angles. For the derivations, see the scalar versions found in Ap-
pendix A.
∂Θ
ΘU = = − [V]−2 [W ] (18)
∂U
∂Θ
ΘW = = [V]−2 [U ] (19)
∂W
∂V
VU = = [V]−1 [U ] (20)
∂U
∂V
VW = = [V]−1 [W ] (21)
∂W
∂
ΘU T λ
ΘU U (λ) = (22)
∂U
= 2 [λ] [V]−4 [U ] [W ] (23)
∂
ΘU T λ
ΘU W (λ) = (24)
∂W
7
3.2 Branch Voltages 3 VOLTAGES
= [λ] [V]−4 [W ]2 − [U ]2
(25)
∂
ΘW T λ
ΘW U (λ) = (26)
∂U
= [λ] [V]−4 [W ]2 − [U ]2
(27)
∂
ΘW T λ
ΘW W (λ) = (28)
∂W
= −2 [λ] [V]−4 [U ] [W ] (29)
∂
VU T λ
VU U (λ) = (30)
∂U
= [λ] [V]−3 [W ]2 (31)
∂
VU T λ
VU W (λ) = (32)
∂W
= − [λ] [V]−3 [U ] [W ] (33)
∂
VW T λ
VW U (λ) = (34)
∂U
= − [λ] [V]−3 [U ] [W ] (35)
∂
VW T λ
VW W (λ) = (36)
∂W
= [λ] [V]−3 [U ]2 (37)
V f = Cf V (38)
Vt = Ct V (39)
8
3.3 Reference Bus Voltage Angles 3 VOLTAGES
∂Vf ∂V
= Cf = Cf (40)
∂U ∂U
∂Vf ∂V
= Cf = jCf (41)
∂W ∂W
∂Gref
Gref
U = = Cref ΘU = −Cref [V]−2 [W ] (44)
∂U
∂Gref
Gref
W = = Cref ΘW = Cref [V]−2 [U ] (45)
∂W
−4
Gref
U U (λ) = Cref ΘU U (λ) = 2Cref [λ] [V] [U ] [W ] (46)
−4
Gref [W ]2 − [U ]2
U W (λ) = Cref ΘU W (λ) = Cref [λ] [V] (47)
−4
Gref [W ]2 − [U ]2
W U (λ) = Cref ΘW U (λ) = Cref [λ] [V] (48)
−4
Gref
W W (λ) = Cref ΘW W (λ) = −2Cref [λ] [V] [U ] [W ] (49)
9
3.4 Bus Voltage Magnitude Limits 3 VOLTAGES
max
HUV = VU = [V]−1 [U ] (52)
max
V
HW = VW = [V]−1 [W ] (53)
min max
HUV = −HUV (54)
V min V max
HW = −HW (55)
max
HUV U (λ) = VU U (λ) = [λ] [V]−3 [W ]2 (56)
max
HUV W (λ) = VU W (λ) = − [λ] [V]−3 [U ] [W ] (57)
V max −3
HW U (λ) = VW U (λ) = − [λ] [V] [U ] [W ] (58)
max −3
V
HW W (λ) = VW W (λ) = [λ] [V] [U ]2 (59)
min max
HUV U (λ) = −HUV U (λ) (60)
min max
HUV W (λ) = −HUV W (λ) (61)
V min V max
HW U (λ) = −HW U (λ) (62)
V min V max
HW W (λ) = −HW W (λ) (63)
10
3.5 Branch Angle Difference Limits 3 VOLTAGES
max
HUΘ = (Cf − Ct )ΘU = −(Cf − Ct ) [V]−2 [W ] (66)
max
Θ
HW = ΘW = (Cf − Ct ) [V]−2 [U ] (67)
min max
HUΘ = −HUΘ (68)
Θ min Θ max
HW = −HW (69)
max
HUΘU (λ) = (Cf − Ct )ΘU U (λ) = 2(Cf − Ct ) [λ] [V]−4 [U ] [W ] (70)
max
HUΘW (λ) = (Cf − Ct )ΘU W (λ) = (Cf − Ct ) [λ] [V]−4 [W ]2 − [U ]2
(71)
max −4
Θ
[W ]2 − [U ]2
HW U (λ) = (Cf − Ct )ΘW U (λ) = (Cf − Ct ) [λ] [V] (72)
Θ max −4
HW W (λ) = (Cf − Ct )ΘW W (λ) = −2(Cf − Ct ) [λ] [V] [U ] [W ] (73)
min max
HUΘU (λ) = −HUΘU (λ) (74)
min max
HUΘW (λ) = −HUΘW (λ) (75)
Θ min Θ max
HW U (λ) = −HW U (λ) (76)
Θ min Θ max
HW W (λ) = −HW W (λ) (77)
11
4 BUS INJECTIONS
4 Bus Injections
4.1 Complex Current Injections
Consider the complex current balance equation, Gc (X) = 0, where
and
∂I bus ∂V
IUbus = = Ybus = Ybus (82)
∂U ∂U
bus ∂I bus ∂V
IW = = Ybus = jYbus (83)
∂W ∂W
dg ∂I dg h dg dg dg dg i
IX = = IU IW IPg IQg (84)
∂X
∂I dg
IUdg = = −[Sd − Cg Sg ]∗ [Λ∗ ]2 (85)
∂U
∂I dg
dg
IW = = j[Sd − Cg Sg ]∗ [Λ∗ ]2 (86)
∂W
∂I dg
IPdgg = = − [Λ∗ ] Cg (87)
∂Pg
∂I dg
IQdgg = = j [Λ∗ ] Cg (88)
∂Qg
12
4.1 Complex Current Injections 4 BUS INJECTIONS
∂Gc c
GcX = = GU GcW GcPg GcQg
(89)
∂X
∂Gc
GcU = = IUbus + IUdg = Ybus − [Sd − Cg Sg ]∗ [Λ∗ ]2 (90)
∂U
∂Gc
GcW = bus dg
= j Ybus + [Sd − Cg Sg ]∗ [Λ∗ ]2
= IW + IW (91)
∂W
∂Gc
GcPg = = IPdgg = − [Λ∗ ] Cg (92)
∂Pg
∂Gc
GcQg = = IQdgg = j [Λ∗ ] Cg (93)
∂Qg
dg ∂ dg T
IXX (λ) = I λ (95)
∂X X
dg
IU U (λ) IUdgW (λ) IUdgPg (λ) IUdgQg (λ)
I dg (λ) I dg (λ) I dg (λ) I dg (λ)
= W U WW W Pg W Qg
(96)
IPdgg U (λ) IPdgg W (λ) 0 0
dg dg
IQg U (λ) IQg W (λ) 0 0
C −jC DT −jDT
−jC −C −jDT −DT
=
D −jD
(97)
0 0
−jD −D 0 0
∂ dg T
IUdgU (λ) = I λ (98)
∂U U
∂
−[Sd − Cg Sg ]∗ [Λ∗ ]2 λ
= (99)
∂U
13
4.1 Complex Current Injections 4 BUS INJECTIONS
dg ∂ dg T
IW U (λ) = I λ (103)
∂U W
∂
j[Sd − Cg Sg ]∗ [Λ∗ ]2 λ
= (104)
∂U
= 2j[Sd − Cg Sg ]∗ [λ] [Λ∗ ] Λ∗U (105)
∗ ∗ 3
= −2j[Sd − Cg Sg ] [λ] [Λ ] (106)
= −jC (107)
∂ dg T
IPdgg U (λ) = I λ (108)
∂U Pg
∂
−Cg T [Λ∗ ] λ
= (109)
∂U
= −Cg T [λ] Λ∗U (110)
= Cg T [λ] [Λ∗ ]2 (111)
=D (112)
∂ dg T
IQdgg U (λ) = I λ (113)
∂U Qg
∂
jCg T [Λ∗ ] λ
= (114)
∂U
= jCg T [λ] Λ∗U (115)
T ∗ 2
= −jCg [λ] [Λ ] (116)
= −jD (117)
∂ dg T
IUdgW (λ) = I λ (118)
∂W U
∂
−[Sd − Cg Sg ]∗ [Λ∗ ]2 λ
= (119)
∂W
= −2[Sd − Cg Sg ]∗ [λ] [Λ∗ ] Λ∗W (120)
14
4.1 Complex Current Injections 4 BUS INJECTIONS
dg ∂ dg T
IW W (λ) = I λ (123)
∂W W
∂
j[Sd − Cg Sg ]∗ [Λ∗ ]2 λ
= (124)
∂W
= 2j[Sd − Cg Sg ]∗ [λ] [Λ∗ ] Λ∗W (125)
= −2[Sd − Cg Sg ]∗ [λ] [Λ∗ ]3 (126)
= −C (127)
∂ dg T
IPdgg W (λ) = I λ (128)
∂W Pg
∂
−Cg T [Λ∗ ] λ
= (129)
∂W
= −Cg T [λ] Λ∗W (130)
T ∗ 2
= −jCg [λ] [Λ ] (131)
= −jD (132)
∂ dg T
IQdgg W (λ) = I λ (133)
∂W Qg
∂
jCg T [Λ∗ ] λ
= (134)
∂W
= jCg T [λ] Λ∗W (135)
∗ 2
= −Cg T [λ] [Λ ] (136)
= −D (137)
∂ dg T
IUdgPg (λ) = I λ (138)
∂Pg U
∂
−[Sd − Cg Sg ]∗ [Λ∗ ]2 λ
= (139)
∂Pg
= [Λ∗ ]2 [λ] Cg (140)
15
4.1 Complex Current Injections 4 BUS INJECTIONS
T
= IPdgg U (λ) = DT (141)
dg ∂ dg T
IW Pg (λ) = I λ (142)
∂Pg W
∂
j[Sd − Cg Sg ]∗ [Λ∗ ]2 λ
= (143)
∂Pg
= −j [Λ∗ ]2 [λ] Cg (144)
T
= IPdgg W (λ) = −jDT (145)
∂ dg T
IUdgQg (λ) = I λ (146)
∂Qg U
∂
−[Sd − Cg Sg ]∗ [Λ∗ ]2 λ
= (147)
∂Qg
= −j [Λ∗ ]2 [λ] Cg (148)
T
= IQdgg U (λ) = −jDT (149)
dg ∂ dg T
IW Qg (λ) = I λ (150)
∂Qg W
∂
j[Sd − Cg Sg ]∗ [Λ∗ ]2 λ
= (151)
∂Qg
= − [Λ∗ ]2 [λ] Cg (152)
T
= IQdgg W (λ) = −DT (153)
∂
GcXX (λ) = GcX T λ
(154)
∂X
c
GU U (λ) GcU W (λ) GcU Pg (λ) GcU Qg (λ)
GcW U (λ) GcW W (λ) GcW P (λ) GcW Q (λ)
=
GcP U (λ) GcP W (λ)
g g (155)
g g
0 0
GcQg U (λ) GcQg W (λ) 0 0
dg
= IXX (λ) (156)
16
4.2 Complex Power Injections 4 BUS INJECTIONS
C −jC DT −jDT
−jC −C −jDT −DT
=
D −jD
(157)
0 0
−jD −D 0 0
A = [Λ∗ ] (158)
B = [λ] A2 (159)
C = 2[Sd − Cg Sg ]∗ AB (160)
D = Cg T B (161)
GcU U (λ) = C (162)
GcW U (λ) = −jC (163)
GcPg U (λ) = D (164)
GcQg U (λ) = −jD (165)
GcW W (λ) = −C (166)
GcPg W (λ) = −jD (167)
GcQg W (λ) = −D (168)
GcU W (λ) = GcW U (λ) (169)
GcU Pg (λ) = GcPg U T (λ) (170)
GcW Pg (λ) = GcPg W T (λ) (171)
GcU Qg (λ) = GcQg U T (λ) (172)
GcW Qg (λ) = GcQg W T (λ) (173)
and
∗
S bus = [V ] I bus (175)
17
4.2 Complex Power Injections 4 BUS INJECTIONS
∂Gs s
GsX = = GU GsW GsPg GsQg
(176)
∂X
∗
∂S bus h bus ∗ i ∂V ∂I bus
GsU = = I + [V ] (177)
∂U h i ∂U ∂U
bus ∗ ∗
= I + [V ] Ybus (178)
∗
∂S bus h bus ∗ i ∂V ∂I bus
GsW = = I + [V ] (179)
∂W h ∂Wi ∂W
bus ∗
=j I − [V ] Ybus ∗ (180)
∂
GsXX (λ) = GsX T λ
(183)
∂X
s
GU U (λ) GsU W (λ) 0 0
GsW U (λ) GsW W (λ) 0 0
= (184)
0 0 0 0
0 0 0 0
∂
GsU U (λ) = GsU T λ
(185)
∂U
∂ h bus ∗ i
= I + Ybus ∗ T [V ] λ (186)
∂U
∂
= [λ] Ybus ∗ V ∗ + Ybus ∗ T [λ] V (187)
∂U
= [λ] Ybus ∗ + Ybus ∗ T [λ] (188)
=F (189)
∂
GsW U (λ) = GsW T λ
(190)
∂U
18
4.2 Complex Power Injections 4 BUS INJECTIONS
∂ h bus ∗ i
= j I − Ybus ∗ T [V ] λ (191)
∂U
∂
= j [λ] Ybus ∗ V ∗ − Ybus ∗ T [λ] V (192)
∂U
∗ ∗T
= j [λ] Ybus − Ybus [λ] (193)
=G (194)
∂
GsU W (λ) = GsU T λ
(195)
∂W
∂ h bus ∗ i
= I + Ybus ∗ T [V ] λ (196)
∂W
∂
= [λ] Ybus ∗ V ∗ + Ybus ∗ T [λ] V (197)
∂W
∗T ∗
= j Ybus [λ] − [λ] Ybus (198)
= GsW U T (λ) = G T (199)
∂
GsW W (λ) = GsW T λ
(200)
∂W
∂ h bus ∗ i
= j I − Ybus ∗ T [V ] λ (201)
∂W
∂
= j [λ] Ybus ∗ V ∗ − Ybus ∗ T [λ] V (202)
∂W
= [λ] Ybus ∗ + Ybus ∗ T [λ] (203)
=F (204)
19
5 BRANCH FLOWS
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 (212)
I t = Yt V (213)
∂I f h i
f
IX = = IUf IW
f
IPf g IQf g (214)
∂X
∂I f
IUf = = Yf (215)
∂U
f ∂I f
IW = = jYf (216)
∂W
∂I f
IPf g = =0 (217)
∂Pg
∂I f
IQf g = =0 (218)
∂Qg
20
5.2 Complex Power Flows 5 BRANCH FLOWS
f ∂S f h
f f f f
i
SX = = SU SW SPg SQg (222)
∂X
∗
h ∗ i ∂V
f ∂I f
= If + [Vf ] (223)
∂X ∂X
∗
h ∗ i ∂V
f ∂I f
SUf = I f + [Vf ] (224)
h ∗ i ∂U ∂U
f ∗
= I Cf + [Vf ] Yf (225)
∗
f
h
f∗
i ∂V ∂I f
f
SW = I + [Vf ] (226)
h ∂W i ∂W
f∗
=j I Cf − [Vf ] Yf ∗ (227)
SPf g = 0 (228)
SQf g = 0 (229)
f ∂ fT
SXX (µ) = SX µ (230)
∂X
f
SU U (µ) SUf W (µ)
0 0
S f (µ) S f (µ) 0 0
= WU WW (231)
0 0 0 0
0 0 0 0
∂ fT
SUf U (µ) = SU µ (232)
∂U
∂
T
h ∗i
f ∗T
= Cf I + Yf [Vf ] µ (233)
∂U
∗
∂I f ∂Vf
= Cf T [µ] + Yf ∗ T [µ] (234)
∂U ∂U
T ∗ ∗T
= Cf [µ] Yf + Yf [µ] Cf (235)
21
5.2 Complex Power Flows 5 BRANCH FLOWS
= Bf (236)
f ∂
f T
SW U (µ) = SW µ (237)
∂U
∂
T
h ∗i
f ∗T
= j Cf I − Yf [Vf ] µ (238)
∂U
∗
∂I f
T ∗T ∂Vf
= j Cf [µ] − Yf [µ] (239)
∂U ∂U
T ∗ ∗T
= j Cf [µ] Yf − Yf [µ] Cf (240)
= Df (241)
∂ fT
SUf W (µ) = SU µ (242)
∂W
∂ T h f ∗ i
= Cf I + Yf ∗ T [Vf ] µ (243)
∂W
∗
∂I f ∂Vf
T
= Cf [µ] + Yf ∗ T [µ] (244)
∂W ∂W
T ∗ ∗T
= −j Cf [µ] Yf − Yf [µ] Cf (245)
f T
= SW U (µ) = −Df (246)
f ∂ f T
SW W (µ) = SW µ (247)
∂W
∂ T h f ∗i
= j Cf I − Yf ∗ T [Vf ] µ (248)
∂W
∗
∂I f
T ∗T ∂Vf
= j Cf [µ] − Yf [µ] (249)
∂W ∂W
= j Cf T [µ] (−j)Yf ∗ − Yf ∗ T [µ] (j)Cf (250)
= Cf T [µ] Yf ∗ + Yf ∗ T [µ] Cf (251)
= Bf (252)
Af = Cf T [µ] Yf ∗ (253)
22
5.3 Squared Current Magnitudes 6 GENERALIZED AC OPF COSTS
Bf = Af + Af T (254)
T
Df = j Af − Af (255)
SUf U (µ) = Bf (256)
f
SW U (µ) = Df (257)
T
SUf W (µ) = SW
f
U (µ) = −Df (258)
f
SW W (µ) = Bf (259)
23
7 LAGRANGIAN OF THE AC OPF
µI
the Lagrangian for this problem can be written as
L(X, λ, µ) = f (X) + λT G(X) + µT H(X) (267)
24
7.1 Nodal Current Balance 7 LAGRANGIAN OF THE AC OPF
LX (X, λ, µ) = fX + λT GX + µT HX (268)
T
Lλ (X, λ, µ) = G (X) (269)
Lµ (X, λ, µ) = H T (X) (270)
where
<{GcU } <{GcW } <{GcPg } <{GcQg } 0 0
<{GcX } 0 0
={GcX } c c c c
0 0 = ={GU } ={GW } ={GPg } ={GQg } 0 0
GX =
Gref ref ref
X 0 0 GU GW 0 0 0 0
AE AE
(271)
and
HXf HUf f
0 0 HW 0 0 0 0
HXt 0 0 H
t
U HWt
0 0 0 0
V max V max V max
HX 0 0 HU HW 0 0 0 0
min
H V min H V min 0 0 0 0
HX = HXV 0 0 =
U max W (272)
Θmax Θmax
Θ
HX 0 0 HU
HW 0 0 0 0
Θmin Θmin Θmin
HX 0 0 HU HW 0 0 0 0
AI AI
25
7.1 Nodal Current Balance 7 LAGRANGIAN OF THE AC OPF
and
HX X (µ) 0 0
HXX (µ) = 0 0 0 (277)
0 0 0
HU U (µ) HU W (µ) 0 0
HW U (µ) HW W (µ) 0 0
HX X (µ) = (278)
0 0 0 0
0 0 0 0
f t
HW U (µ) = HW U (µf ) + HW U (µt )
V max V min
+ HW U (µV max ) + HW U (µV min )
26
7.2 Nodal Power Balance 7 LAGRANGIAN OF THE AC OPF
Θ max Θ min
+ HW U (µΘmax ) + HW U (µΘmin ) (281)
f t
HW W (µ) = HW W (µf ) + HW W (µt )
V max V min
+ HW W (µV max ) + HW W (µV min )
Θ max Θ min
+ HW W (µΘmax ) + HW W (µΘmin ) (282)
LX (X, λ, µ) = fX + λT GX + µT HX (283)
T
Lλ (X, λ, µ) = G (X) (284)
T
Lµ (X, λ, µ) = H (X) (285)
where
<{GsX } 0 0 <{GsU } <{GsW } −Cg 0 0 0
={GsX } s s
= ={G
0 0 U } ={GW } 0 −Cg 0 0
GX =
Gref ref ref
(286)
X 0 0 GU GW 0 0 0 0
AE AE
27
7.2 Nodal Power Balance 7 LAGRANGIAN OF THE AC OPF
and HXX (µ) is the same as for nodal current balance in (277)–(282).
28
8 REVISION HISTORY
8 Revision History
• Revision 1 (October 25, 2018)
– Added missing equality constraint for reference voltage angles. See Sec-
tions 3.3 and 7.
– Added missing inequality constraints for bus voltage magnitude limits.
See Sections 3.4 and 7.
– Added missing inequality constraints for branch voltage angle difference
limits. See Sections 3.5 and 7.
29
A SCALAR POLAR COORDINATE DERIVATIVES
v = |v|ejθ (291)
= u + jw (292)
We also have
w
θ = tan−1 (293)
u
|v| = u + w2
2 2
(294)
∂θ 1 ∂(u−1 w) 1 −1 u
= = u = (297)
∂w 1 + u−2 w2 ∂w 1 + u−2 w2 |v|2
30
A.2 Second Derivatives A SCALAR POLAR COORDINATE DERIVATIVES
∂ 2θ ∂(−|v|−2 w) −3 u 2uw
= = −w(−2|v| ) = (300)
∂u2 ∂u |v| |v|4
∂ 2θ ∂(|v|−2 u) −3 w 2uw ∂ 2θ
= = u(−2|v| ) = − = − (304)
∂w2 ∂w |v| |v|4 ∂u2
∂ 2 |v| ∂(|v|−1 w) u uw
= = w(−|v|−2 ) =− 3 (306)
∂w∂u ∂u |v| |v|
31
REFERENCES REFERENCES
References
[1] R. D. Zimmerman, AC Power Flows, Generalized OPF Costs and their Deriva-
tives using Complex Matrix Notation, Matpower Technical Note 2, Febru-
ary 2010. [Online]. Available: http://www.pserc.cornell.edu/matpower/
TN2-OPF-Derivatives.pdf 2
32