Professional Documents
Culture Documents
TN2 OPF Derdfsdfsdfivatives PDF
TN2 OPF Derdfsdfsdfivatives PDF
c 2008, 2010, 2011 Power Systems Engineering Research Center (Pserc)
All Rights Reserved
∗
Third revision. First draft was February 29, 2008, second February 24, 2010.
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 . . . . . . . . . . . . . . . . . . . . . . . . . 7
4.2 Complex Power Injections . . . . . . . . . . . . . . . . . . . . . . . . 8
4.2.1 First Derivatives . . . . . . . . . . . . . . . . . . . . . . . . . 8
4.2.2 Second Derivatives . . . . . . . . . . . . . . . . . . . . . . . . 8
5 Branch Flows 11
5.1 Complex Currents . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11
5.1.1 First Derivatives . . . . . . . . . . . . . . . . . . . . . . . . . 11
5.1.2 Second Derivatives . . . . . . . . . . . . . . . . . . . . . . . . 11
5.2 Complex Power Flows . . . . . . . . . . . . . . . . . . . . . . . . . . 12
5.2.1 First Derivatives . . . . . . . . . . . . . . . . . . . . . . . . . 12
5.2.2 Second Derivatives . . . . . . . . . . . . . . . . . . . . . . . . 13
5.3 Squared Current Magnitudes . . . . . . . . . . . . . . . . . . . . . . . 15
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 . . . . . . . . . . . . . . . . . . . . . . . . 17
5.5 Squared Real Power Magnitudes . . . . . . . . . . . . . . . . . . . . . 18
5.5.1 First Derivatives . . . . . . . . . . . . . . . . . . . . . . . . . 18
5.5.2 Second Derivatives . . . . . . . . . . . . . . . . . . . . . . . . 18
2
CONTENTS CONTENTS
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
Ibus nb × 1 vector of complex bus current injections
If , It nl × 1 vectors of complex branch current injections, from and to ends
Sbus 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 nl × nb system branch admittance matrix, from end
Yt nl × nb system branch admittance matrix, to end
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
1n n × 1 vector of all ones
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 and the corre-
sponding OPF Lagrangian function are developed.
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
T ∂x21
· · · ∂x∂1 ∂x n
2
∂ f ∂ ∂f . . .
fXX = = = .
. . . .
. (3)
∂X 2 ∂X ∂X ∂2f ∂2f
∂xn ∂x1
··· ∂x2 n
the first derivatives form the Jacobian matrix, where row i is the transpose of the
gradient of fi ∂f1 ∂f1
∂x1
· · · ∂x n
∂F
FX = = ... .. .. (5)
. .
∂X ∂fm
∂x1
· · · ∂f
∂xn
m
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
5
3 VOLTAGES
the Jacobian of the vector function obtained by multiplying the transpose of the
Jacobian of F by a vector λ, using the following notation
∂
FX T λ
FXX (λ) = (6)
∂X
Just to clarify the notation, if Y and Z are subvectors of X, then
∂
FY T λ
FY Z (λ) = (7)
∂Z
One common operation encountered in these derivations is the element-wise mul-
tiplication of a vector A by a vector B to form a new vector C of the same dimension,
which can be expressed in either of the following forms
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)
6
3.2 Branch Voltages 4 BUS INJECTIONS
∂V T
∂
VVV (λ) = λ = [λ] EV = 0 (15)
∂V ∂V
Vf = 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
Ibus = Ybus V (20)
7
4.2 Complex Power Injections 4 BUS INJECTIONS
and
∂Gs
GsX =
s
GΘ GsV GsPg GsQg
= (26)
∂X
∂Sbus ∂V ∂Ibus ∗
GsΘ = = [Ibus ∗ ] + [V ] (27)
∂Θ ∂Θ ∂Θ
= [Ibus ∗ ] j [V ] + [V ] (jYbus [V ])∗ (28)
= j [V ] ([Ibus ∗ ] − Ybus ∗ [V ∗ ]) (29)
∂Sbus ∂V ∂Ibus ∗
GsV = = [Ibus ∗ ] + [V ] (30)
∂V ∂V ∂V
= [Ibus ∗ ] [E] + [V ] Ybus ∗ [E ∗ ] (31)
= [V ] ([Ibus ∗ ] + Ybus ∗ [V ∗ ]) [V]−1 (32)
∂
GsXX (λ) = GsX T λ
(35)
∂X
GsΘΘ (λ) GsΘV (λ) 0 0
GsVΘ (λ) GsVV (λ) 0 0
= (36)
0 0 0 0
0 0 0 0
8
4.2 Complex Power Injections 4 BUS INJECTIONS
∂
GsΘΘ (λ) = GsΘ T λ
(37)
∂Θ
∂
= j [Ibus ∗ ] − [V ∗ ] Ybus ∗ T [V ] λ (38)
∂Θ
∂
= j [Ibus ∗ ] [V ] λ − [V ∗ ] Ybus ∗ T [V ] λ (39)
∂Θ
∗
[V ∗ ]) + [Ibus ∗ ] [λ] (j [V ])
= j
[V ] [λ] |(−jYbus
{z } | {z }
∂Ibus ∗ ∂V
∂Θ ∂Θ
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 ] λ
+ [λ] [V ] (Ybus ∗ [V ∗ ] − [Ibus ∗ ]) (41)
= E +F (42)
∂
GsVΘ (λ) = GsV T λ
(43)
∂Θ
∂
= [E] [Ibus ∗ ] λ + [E ∗ ] Ybus ∗ T [V ] λ (44)
∂Θ
= [E] [λ] (−jYbus ∗ [V ∗ ]) + [Ibus ∗ ] [λ] j [E]
| {z } |{z}
∂Ibus ∗ ∂E
∂Θ ∂Θ
h i
∗ ∗T ∗T
+ [E ] Ybus [λ] j [V ] + Ybus [V ] λ (−j [E ∗ ]) (45)
|{z} | {z }
∂V ∂E ∗
∂Θ ∂Θ
h i
= j [E ∗ ] Ybus ∗ T [V ] [λ] − Ybus ∗ T [V ] λ
∗ ∗ ∗
− [λ] [E] (Ybus [V ] − [Ibus ]) (46)
h i
= j [V]−1 [V ∗ ] Ybus ∗ T [V ] [λ] − Ybus ∗ T [V ] λ
− [λ] [V ] (Ybus ∗ [V ∗ ] − [Ibus ∗ ]) (47)
= jG(E − F) (48)
9
4.2 Complex Power Injections 4 BUS INJECTIONS
∂
GsΘV (λ) = GsΘ T λ
(49)
∂V
h i
= j [λ] [V ] Ybus ∗ − Ybus ∗ T [V ] λ [V ∗ ]
− [V ∗ ] Ybus ∗ T − Ibus ∗ [V ] [λ] [V]−1 (50)
= GsVΘ T (λ) (51)
∂
GsVV (λ) = GsV T λ
(52)
∂V
∂
= [E] [Ibus ∗ ] λ + [E ∗ ] Ybus ∗ T [V ] λ (53)
∂V
= [E] [λ] Ybus ∗ [E ∗ ] + [Ibus ∗ ] [λ] |{z}
0
| {z }
∂E
∂Ibus ∗
∂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)
A = [λ] [V ] (57)
B = Ybus [V ] (58)
C = AB ∗ (59)
D = Ybus ∗ T [V ] (60)
E = [V ∗ ] (D [λ] − [Dλ]) (61)
F = C − A [Ibus ∗ ] = j [λ] GsΘ (62)
G = [V]−1 (63)
s
GΘΘ (λ) = E +F (64)
GsVΘ (λ) = jG(E − F) (65)
GsΘV (λ) = GsVΘ T (λ) (66)
GsVV (λ) = G(C + C T )G (67)
10
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 (68)
I t = Yt V (69)
∂V
IΘf = Yf = jYf [V ] (71)
∂Θ
∂V
IVf = Yf = Yf [V ] [V]−1 = Yf [E] (72)
∂V
IPf g = 0 (73)
IQf g = 0 (74)
f ∂ fT
IXX (µ) = IX µ (75)
∂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)
∂Θ Θ
11
5.2 Complex Power Flows 5 BRANCH FLOWS
∂
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)
∂S f h i
f
SX = = SΘf SVf SPf g SQf g (93)
∂X
∗
h ∗ i ∂V
f ∂I f
= If + [Vf ] (94)
∂X ∂X
12
5.2 Complex Power Flows 5 BRANCH FLOWS
∗
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 = If + [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
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
∂Θ ∂Θ
13
5.2 Complex Power Flows 5 BRANCH FLOWS
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 − D f − E f (109)
f ∂ fT
SVΘ (µ) = S µ (110)
∂Θ V
∂ h ∗i
= [E] Cf T I f µ + [E ∗ ] Yf ∗ T [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)
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
14
5.3 Squared Current Magnitudes 5 BRANCH FLOWS
∂ h ∗i
= [E] Cf T I f µ + [E ∗ ] Yf ∗ T [Cf V ] µ (120)
∂V h h ∗i i
= [E] Cf T [µ] Yf ∗ [E ∗ ] + Cf T 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)
T ∗
Ef = Af V [V ] (127)
Ff = Bf + Bf T (128)
G = [V]−1 (129)
f
SΘΘ (µ) = Ff − Df − Ef (130)
f
SVΘ (µ) = jG(Bf − Bf T − Df + Ef ) (131)
f f T
SΘV (µ) = SVΘ (µ) (132)
f
SVV (µ) = GFf G (133)
where I f = M f + jN f .
15
5.3 Squared Current Magnitudes 5 BRANCH FLOWS
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 − jN f (MXf + jNXf ) + M f + jN f (MXf − jNXf )
f
= (139)
2 M f MXf + N f NXf
= (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 (µ) H f (µ)
f
0 0
= VΘ VV (143)
0 0 0 0
0 0 0 0
f ∂
fT
HXX (µ) = HX µ (144)
∂X
∂ T h ∗i
f f f ∗T
f
= IX I µ + 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 f fT
= 2 · < IXX ( I µ) + IX [µ] IX (147)
∗
n h ∗i T
o
f f
HΘΘ (µ) = 2 · < IΘΘ ( I f µ) + IΘf [µ] IΘf (148)
f∗
n h ∗i o
f f f fT
HVΘ (µ) = 2 · < IVΘ ( I µ) + IV [µ] IΘ (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)
16
5.4 Squared Apparent Power Magnitudes 5 BRANCH FLOWS
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
∂ T h ∗i
f 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 T
= 2 · < SXX ( S f µ) + SX [µ] SX (165)
17
5.5 Squared Real Power Magnitudes 5 BRANCH FLOWS
∗
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)
f∗
n h ∗i o
f f f fT
HVV (µ) = 2 · < SVV ( S µ) + SV [µ] SV (169)
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 ∂
f T
HXX (µ) = HX µ (176)
∂X
∂ T f
= 2PXf P µ (177)
∂X
18
6 GENERALIZED AC OPF COSTS
T
f
( P f µ) + PXf [µ] PXf
= 2 PXX (178)
n f o n To n o
f f f
= 2 < SXX ( < S µ) + < SX [µ] < SX (179)
n o n To n o
f f
HΘΘ (µ) = 2 < SΘΘ ( < S f µ) + < SΘf [µ] < SΘf (180)
n o n To n o
f f
HVΘ (µ) = 2 < SVΘ ( < S f µ) + < SVf [µ] < SΘf (181)
n f o n To n o
f f
HΘV (µ) = 2 < SΘV ( < S µ) + < SΘ [µ] < SVf
f
(182)
n o n To n o
f f
HVV (µ) = 2 < SVV ( < S f µ) + < SVf [µ] < SVf (183)
19
6.2 Piecewise Linear Generator Costs 6 GENERALIZED AC OPF COSTS
fQ1 (qg1 )
F Q (Qg ) =
..
(187)
.
ng ng
fQ (qg )
∂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)
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 fQg 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)
20
6.3 General Cost Term 6 GENERALIZED AC OPF COSTS
∂f b
fXb = (197)
∂Xb
fΘ fVb fPb g fQb g fYb fZb
= (198)
0 0 0 0 1Tny 0
= (199)
The “dead zone” costs are zeroed by multiplying by [U ]. The remaining elements
are shifted toward zero by the size of the “dead zone” by adding K̄, before applying
a cost.
R̄ = R + K̄ (204)
Each element of D specifies whether to apply a linear or quadratic function to
the corresponding element of R̄. This can be done via two more nw × 1 vectors, DL
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)
22
6.4 Full Cost Function 6 GENERALIZED AC OPF COSTS
∂
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)
∂f
fX = = fXa + fXb + fXc (226)
∂X h i
0 T 0 T
= 0 0 (F P ) (F Q ) 1Tny 0 + BAN (227)
∂ 2f a b c
fXX = = fXX + fXX + fXX (228)
∂X 2
0 0 0 0 0 0
0 0 h 0 i 0 0 0
00
0 0 FP 0 0 0
= h
00
i
0 0 0 FQ 0 0
0 0 0 0 0 0
0 0 0 0 0 0
+ N T AH w A + 2 DQ B T N
(229)
23
7 LAGRANGIAN OF THE AC OPF
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
24
7.2 Second Derivatives 7 LAGRANGIAN OF THE AC OPF
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
and
25