You are on page 1of 6

ADMM for Nonconvex AC Optimal Power Flow

Rabi Shankar Kar, Zhixin Miao, Miao Zhang and Lingling Fan
Department of Electrical Engineering
University of South Florida at Tampa, FL 33620
Email: zmiao@usf.edu

Abstract—The objective of the paper is to implement al- Reference [5] demonstrated consensus ADMM and proximal
ternative direction method of multipliers (ADMM) to solve a Jacobian ADMM for DC OPF and SOCP relaxation of AC
nonconvex alternating current optimal power flow (AC OPF) OPF.
problem. There is no guarantee of convergence for ADMM
when it is applied to a nonconvex optimization problem. In Another type of relaxation is semidefinite programming
this article, we not only present the procedure of consensus (SDP) relaxation. In [6], [7], SDP relaxation is applied on
ADMM implementation on an AC OPF problem for IEEE 14-bus a nonlinear state estimation problem. ADMM is then applied
system but also present the results related to ADMM parameters to solve the convex relaxation problems. The state estimation
and convergence. The solutions from MATPOWER and ADMM problem has a different objective function than the AC OPF
implementation are also compared.
Index Terms—AC OPF; ADMM; Fmincon
problem. It does not have the inequality constraints imposed
but has the equality constraints that describe each bus’s power
injection.
I. I NTRODUCTION
The objective of this paper is to present how to implement
AC OPF is a nonlinear and nonconvex optimization prob- ADMM for nonconvex AC OPF. Though this topic has been
lem. The decision variables include generators’ real and reac- addressed in [2], the reference paper does not present a
tive power outputs and voltage magnitude and angle at each tutorial approach of implementation. In addition, information
bus. The objective function is usually the generation cost exchange among subsystems is not straightforward.
and the constraints include equality constraints that describe Our contributions include a tutorial presentation to show
power injection relationship with voltage phasor and inequality how to separate the grid into subsystems and overlapping
constraints that describe generator limits, voltage limits, and areas, and how to implement consensus ADMM to find the
line flow limits. solution.
Alternating direction method of multipliers (ADMM) is a The rest of the paper is organized as follows. Section II
simple powerful technique suited to solve distributed convex describes the details about the ADMM algorithm. Section III
optimization. In ADMM, we divide the main system into describes about the implementation of consensus ADMM for
different sub-system called as area, and each area is coor- an AC OPF problem using IEEE 14-bus system as an example
dinated to find the final optimized solution. It is a attempt system. In Section IV, case studies are presented. Section V
to blend the benefits of Dual Decomposition method and concludes the paper.
Augmented Lagrangian Methods for constraints optimization
II. ADMM A LGORITHM
in ADMM algorithm. The detail description on dual decom-
position and Augmented Lagrangian is discussed in [1]. In A. Standard ADMM
ADMM, there are different algorithms, e.g., Gauss-Seidal, ADMM is an algorithm to solve distributed optimization
consensus ADMM, and proximal Jacobian ADMM. problem. Consider an optimization problem statement which
ADMM has been applied to solve AC OPF problems [2]– has an objective function consists of the sum of G1 (xx) and
[5]. In distributed AC OPF, the entire power grid is separated G2 (zz):
into multiple regions and each region solves its own opti-
mization problem with the inputs from the other region. The
min G1 (xx) + G2 (zz) (1)
output from each region is used for updating until convergence. x ∈c1 ,zz∈c2
For nonconvex optimization problems, there is no guaranteed s.t. A x = z
convergence for ADMM. Reference [2] describes ADMM
implementation for nonconvex AC OPF problems and it shows The augmented Lagrangian equation is defined as:
that convergence only occurs under certain conditions. ρ
Lρ (xx, z , λ ) = G1 (xx) + G2 (zz) + λ T (A Ax − z k22 (2)
Ax − z ) + kA
To have guaranteed convergence, AC OPF problems are first 2
relaxed to have convex optimization problems. In [3], second- where ρ > 0 is called the penalty parameter. The augmented
order cone program (SOCP) relaxation is applied to relax the Lagrangian method is developed in part to bring robustness
AC OPF problem for a distribution network. Such relaxation is to the dual ascent method, and in particular, to yield conver-
exact under milder assumptions for distribution tree networks. gence without assumptions of strict convexity or finiteness of
ADMM is then applied to solve the SOCP relaxation problem. objective function G [1], [2].
To search the optimal point, it is performed via an alternat- III. ADMM F ORMULATION FOR AC OPF
ing procedure which starts from initial values z 0 and λ 0 , and In this section, we will present the ADMM formulation for
iteratively updated according to eq. (3) until convergence. an AC OPF problem related to the IEEE 14-Bus system. The
 distribution topology of IEEE 14-Bus is shown in Fig. 1. Each
x k+1 = argmin λ k )T (A
G1 (xx) + G2 (zzk ) + (λ Ax − z k ) bus has their own load. There are three transformers between
x ∈c1
ρ  Bus 5 and 6, Bus 4 and 9, Bus 4 and 7, respectively. Five
+ kA Ax − z k k22 (3a) generators are connected on Bus 1, 2, 3, 6 and 8, respectively.
2 
z k+1 = argmin G1 (xxk+1 ) + G2 (zz) + (λλ k )T (A
Ax k+1 − z ) 13
z ∈c2 AREA B
ρ 
+ kA Ax k+1 − z k22 (3b) 12 14
2
λ k+1 = λ k + ρ(A Ax k+1 − z k+1 ) (3c) 11
10

9
Finally, the ADMM iteration should converge to the follow- 6
G4
ing results. G1
GS
GS
7
G5
GS
Consensus Area 8
Axk − zk
    1
0 4

lim G1 (xxk ) + G2 (zzk ) =  v?  (4) 5


k→∞
λk λ?
2
where v? is the optimal value of the objective function, and 3
λ ? is the optimal dual variable. G2
GS
AREA A
G3
GS

B. Consensus ADMM for OPF


Fig. 1: IEEE 14 bus partition into 2 areas. The dash lines
Consensus ADMM is a special form of ADMM. Consider denotes the boundary of each areas and the buses enclosed in
an optimization problem given below: each area.
m
min ∑ fi (xxi ) A. AC OPF Statement
i=1
Each bus number is marked as i, where i = 1, 2, . . . 14.
s.t. x i = z , i = 1, · · · , m (5) Let Y be the branch admittance matrix, Vi and Ii represent,
respectively, voltage and current injection at bus i. The net
where i notates variables in Area i. It is called global con-
power injection at the bus i can be expressed as follows:
sensus algorithm, since at convergence all the local variables ∗
should be equal to global variable. The augmented Lagrangian Si = Vi · Ii (8a)
function can be derived for the problem (5) as below, N

m
Pi (V, θ ) = ∑ ViV j (Gi j cos(θi − θ j ) + Bi j sin(θi − θ j )) (8b)
 ρ  j=1
Lρ (xx1 , . . . , x m , z , λ ) = ∑ fi (xxi ) + λ Ti (xxi − z ) + kxxi − z k22 N
i=1 | 2
{z
Lρ,i
} Qi (V, θ ) = ∑ ViV j (Gi j sin(θi − θ j ) − Bi j cos(θi − θ j )) (8c)
j=1
(6)
Thus, the common global variable z is solved by collabo- where Ii is derived by Yi, j and V j in (9), G is the bus con-
rative filtering in (7). ductance matrix, Gi j = Re(Yi j ) and, B is the bus susceptance
matrix, Bi j = Im(Yi j ) and Y is the bus admittance matrix.
x k+1
i = argmin Lρ,i (xxi , λ ki , z k ), i = 1, · · · , m (7a)
xi Ii = ∑ Yi, j ·V j (9)
m
1 j
z k+1 = ∑ x k+1 (7b)
m i=1 i The AC OPF problem can be formulated as a minimization
of the summation of individual polynomial cost functions fPgi
λ k+1
i = λ ki + ρ(xxk+1
i − z k+1 ), i = 1, · · · , m (7c)
and fQgi of real and reactive power generation, respectively,
For details refer to [1], [5]. for each generator on the following buses (1, 2, 3, 6, 8), shown
in (10).
In this paper, we will adopt consensus ADMM to solve a
The optimization variables x in (11) consists of 5×1 vectors
nonconvex AC OPF problem. Each area only need to handle
of generator real and reactive power generations Pg and Qg ,
its own objective function and constraints for a given global
and 14 × 1 vectors of voltage magnitudes V and angles θ .
z k . All the areas update their decision variables in parallel till
convergence. min ∑ fP (Pgi ) + fQ (Qgi ), (10)
x
  • Area B:
Pg
Qg  – Its own buses: 6-14.
x=
V 
 (11) – Boundary Buses: 4 and 5.
– Branches: 6-11, 6-12, 6-13, 7-8, 7-9, 9-10, 9-14, 10-
θ
11, 12-13, 13-14, 5-6, 4-7, 4-9.
s.t. Pgi ≤ Pgi ≤ Pgi (12a) • Consensus Area:

Qgi ≤ Qgi ≤ Qgi (12b) – Consensus Buses: 4, 5, 6, 7, 9.


Based on the partition of the area, the decision variables
Vi ≤ Vi ≤ Vi (12c) for each area will be defined. We define the variables which
θi ≤ θi ≤ θi (12d) belong to area A as (.)A and the variables which belong to
Pgi − Pdi − Pi (V, θ ) = 0 (12e) area B as (.)B . And we define the bus variables as (.)ki where
Qgi − Qdi − Qi (V, θ ) = 0 (12f) i is the bus number and k denotes the number of iterations.
Let x A and x B be the decision variables for area A and B
The inequality constrains eqs. (12a) to (12d) give the upper respectively, where,
and lower bounds for generator real power, reactive power, all  T
bus’s voltage magnitudes and angles. x A = PgA QgA V1A · · · V7A V9A θ1A · · · θ7A θ9A (13a)
 T
The equality constrains eqs. (12b) and (12e) are from power x B = PgB QgB V4B · · · V14B θ4B · · · θ14B (13b)
injection equations (8b) and (8c), which including real and
reactive components, expressed as functions of V , θ and where PgA = [Pg1 , Pg2 , Pg3 ], QgA = [Qg1 , Qg2 , Qg3 ], PgB includes
generator generations Pg and Qg . The load demand Pd and [Pg4 , Pg5 ], and QgB includes [Qg4 , Qg5 ].
Qd at each bus is assumed constant and are given in the z denotes the vector of the consensus variables:
T
MATPOWER [8] input file. The AC OPF is a nonconvex

z = V4 V5 V6 V7 V9 θ4 θ5 θ6 θ7 θ9 . (14)
optimization problem due to the nonlinear equality constraints
related to power injections. The global variable z is initialized with the default value of
V and θ . The parameter ρ is considered as 20 initially. The
B. ADMM Implementation lower bounds and upper bounds of the objective variables, as
The IEEE 14-Bus network is shown in Fig. 1. It has 5 in (12a)-(12d), are defined based on MATPOWER’s input file.
generator buses and 9 load buses. The network is partitioned The dual variable vectors are defined as λ A and λ B for area
into 2 areas: Area A and Area B. In the figure, the area A and area B respectively.
enclosed with red dotted line is the intersection area called The global variable vector z is related with consensus local
as consensus area or overlapping area. Area A includes buses variable x cA and x cB : x cA = z , x cB = z .
1-5, the branches inside this area as well as the branches in the 1) Area A: The objective function for Area A is as follows
consensus area (4-7, 4-9, and 5-6). Area B includes buses 6-14,
2
branches inside Area B as well as the branches 6-5, 7-4, and 9- ρ
LρA (xxA , z k , λ kA ) = λ kA )T (xxcA −zzk )+
f pi (Pgi )+(λ xxcA − z k

4. Each area decides its own buses’ voltage magnitudes, phase ∑ 2 2
i=1,2,3
angles as well as real and reactive power of its generators (15)
inside the area. Area A treats the buses belonging to Area B Inequality constraints include the following.
in the overlapping area as voltage sources and decides their
voltage magnitudes and phase angles. Power injection equality s.t. Pgi ≤ Pgi ≤ Pgi , i = 1, . . . , 3 (16a)
of those buses (Bus 6, 7, 9) will not be considered. Area B Qgi ≤ Qgi ≤ Qgi , i = 1, . . . , 3 (16b)
treats the buses inside the overlapping area but belonging to
Vi ≤ Vi ≤ Vi , i = 1, . . . , 7, 9 (16c)
Area A as the boundary buses (Bus 4 and Bus 5). For its own
buses, power injection equations will be imposed as equality θi ≤ θi ≤ θi , i = 1, . . . , 7, 9 (16d)
constraints while considering Bus 4 and 5 as two voltage Equality constraints including the following.
sources.
Both areas will decide the voltage magnitudes and phase Pgi − PDi = ∑ ViV j (Gi j cos(θi − θ j ) + Bi j sin(θi − θ j )) (17a)
angles for the buses in the overlapping area. Thus, voltage Qgi − QDi = ∑ ViV j (Gi j sin(θi − θ j ) − Bi j cos(θi − θ j ))
phasors of those buses (4, 5, 6, 7, 9) will be treated as the (17b)
local variables to achieve consensus. Below is a detailed list
i = 1, . . . , 5
of each area’s information and consensus area’s information.
• Area A: 2) Area B: The objective function for Area B is as follows
– Its own buses: 1-5. 2
– Boundary Buses: 6, 7 and 9. ρ
LρB (xxB , z k , λ kB ) = λ kB )T (xxcB −zzk )+
f pi (Pgi )+(λ xxcB − z k

– Branches: 1-2, 1-5, 2-3, 2-4, 2-5, 3-4, 4-5, 4-7. 4-9,
∑ 2 2
i=4,5
5-6. (18)
Inequality constraints include the following. variables λA and λB are plotted versus the iteration steps.
Along with dual variable, the decision variables Pg , Qg , V
s.t. Pgi ≤ Pgi ≤ Pgi , i = 4, 5 (19a)
and θ are also plotted.
Qgi ≤ Qgi ≤ Qgi , i = 4, 5 (19b) We did test for three different scenarios to check the
Vi ≤ Vi ≤ Vi , i = 4, . . . , 14 (19c) robustness of the consensus ADMM optimization algorithm.
• Scenario 1: We assume that the costs of generation are
θi ≤ θi ≤ θi , i = 4, . . . , 14 (19d)
all zero.
Equality constraints including the following. • Scenario 2: The cost of each generator is assumed to be
linear cost.
Pgi − PDi = ∑ ViV j (Gi j cos(θi − θ j ) + Bi j sin(θi − θ j )) (20a)
• Scenario 3: The cost of each generator is quadratic using
Qgi − QDi = ∑ ViV j (Gi j sin(θi − θ j ) − Bi j cos(θi − θ j )) the same cost function as the MATPOWER input file
(20b) case14.m.
i = 6, . . . , 14
A. Scenario 1: Zero generation cost
At each iteration step k, for a given z k , λ kA and λ kB , Area A Fig. 2 resents the outputs for Scenario 1. The figure shows
finds the optimal solution x k+1
A and Area B finds the optimal convergence for all variables. This case is tested for ρ = 20.
solution x k+1
B . The update process for the decision variables
B. Scenario 2: Linear cost
based in the consensus ADMM are as follows:
1 The cost function equation of a power system network is
z k+1 = (xxk+1 + x k+1
cB ) (21a) stated as (22).
2 cA
λ k+1 k
A = λ A + ρ(x xk+1
cA − z
k+1
) (21b) f (Pgi ) = ∑ C1i Pgi +C2i Pg2i (22)
λ k+1
B = λ kB + ρ(xxk+1
cB − z
k+1
) (21c) where C1i is the linear cost coefficient and C2i is the quadratic
cost Coefficient. In Scenario 2, C2i is changed to zero. There-
IV. C ASE S TUDY fore,
The pseudocode is presented in Algorithm 1. Matlab func- f (Pgi ) = ∑ C1i Pgi (23)
tion f mincon is used to solve each area’s optimization prob- Fig. 3 presents the outputs with a linear cost function. In
lem. this case, the penalty parameter ρ is 20 and the system is
Algorithm 1 Pseudocode for ADMM converging for this ρ. We calculated the minimum generation
cost at ρ = 20, and it was found to be 5383 $/hr.
1: procedure M AIN P ROGRAM
2: Initialize ρ. C. Scenario 3: Quadratic cost
3: Initialize xA0 and xB0 for area A and area B. A quadratic cost function for a power system network is
4: Initialize global variable z . shown as in (22).
5: Initialize λA and λB . Dual variable for area A and In this case, tests were conducted with different ρs. The
area B respectively. outputs in Fig. 4 shows that when ρ is small, ADMM is not
6: Initialize the lower bound and upper bound for the converging.
decision variables. Next ρ is increased to 100, 000 and ADMM is converging.
7: Initialize the threshold error value The outputs are plotted in Fig. 5. The outputs show that all
8: while err ≥ threshold error do variables are converging. The converged values are compared
9: Area A: with MATPOWER’s solution as shown in Table I. The results
10: Ob jA ← Objective function of area A from ADMM are similar as those from MATPOWER.
11: x Aout ← Output from f mincon . solves Ob jA
12: Area B: TABLE I: MATPOWER and ADMM Comparison
13: Ob jB ← Objective function of area B Generations MATPOWER ADMM Error
14: x Bout ← Output from f mincon . solves Ob jB Pg1 (MW) 194.33 194.30 -0.03
Qg1 (MVar) 0 0 0
15: Update x k+1
cA ← x A out Pg2 (MW) 36.72 36.71 -0.01
16: Update x k+1
cB ← x Bout Qg2 (MVar) 23.69 23.52 -0.17
17: Update z k+1 ← Avg(xxk+1 k+1
cA , x cB )
Pg3 (MW) 28.74 28.74 0
k+1 k Qg4 (MVar) 24.13 24.27 0.14
18: Update λ A ← λ A + ρ ∗ (xxk+1 cA − z
k+1 )
Pg6 (MW) 0 0 0
k+1 k k+1
19: Update λ B ← λ B + ρ ∗ (xxcB − z k+1 ) Qg6 (MVar) 11.55 11.49 -0.06
20: end while Pg8 (MW) 8.49 8.47 -0.02
Qg8 (MVar) 8.27 8.23 -0.04
21: end procedure Minimum Cost ($/hr) 8081.5 8079.3 -2.2

To illustrate convergence of the consensus ADMM, the Remarks: We have demonstrated the performance of
norm of the error kxik − zk k was calculated and the dual ADMM for nonconvex AC OPF. Depending on the penalty
0.5 100 1.02
Pg1 V4

Voltage
Pg2 V5

Pg
A 0 50 1
λ
Pg3 V6
Pg6 V7
-0.5 0 Pg8 0.98 V9
5 10 15 20 5 10 15 20 5 10 15 20
Iterations (k) Iterations (k) Iterations
0.5 50 0.05
Qg1 θ4
Qg2

Qg
B

0 0 0 θ5

θ
λ

Qg3
θ6
Qg6
-0.5 -50 Qg8 -0.05 θ7
5 10 15 20 5 10 15 20 5 10 15 20 θ
9
Iterations (k) Iterations (k) Iterations

(a) λA and λB . (b) Pg and Qg . (c) The voltages in consensus area.


Fig. 2: Scenario 1: Zero generation cost. ρ = 20.

5 200 1.05
Pg1 V4

Voltage
Pg Pg2 V5
λA

0 100 1
Pg3 V6
Pg6 V7
-5 0 Pg8 0.95 V9
10 20 30 40 5 10 15 20 25 30 35 40 10 20 30 40
Iterations (k) Iterations (k) Iterations
5 50 0.1
Qg1 θ4
Qg2
Qg
λB

0 0 0 θ5

θ
Qg3
θ6
Qg6
-5 -50 Qg8 -0.1 θ7
10 20 30 40 5 10 15 20 25 30 35 40 10 20 30 θ 940
Iterations (k) Iterations (k) Iterations

(a) λA and λB . (b) Pg and Qg . (c) The voltages in consensus area.


Fig. 3: Scenario 2: Linear generation cost. ρ = 20.

50 1 1.1
Pg1 V4
Voltage
Pg2 V5
Pg
λA

0 0 1.05
Pg3 V6
Pg6 V7
-50 -1 Pg8 1 V9
5 10 15 20 25 30 35 5 10 15 20 25 30 5 10 15 20 25 30 35
Iterations (k) Iterations (k) Iterations
100 50 0.1
Qg1 θ4
Qg2
Qg
B

0 0 0 θ5
θ
λ

Qg3
θ6
Qg6
-100 -50 Qg8 -0.1 θ7
5 10 15 20 25 30 35 5 10 15 20 25 30 5 10 15 20 25 30 θ 9 35
Iterations (k) Iterations (k) Iterations

(a) λA and λB . (b) Pg and Qg . (c) The voltages in consensus area.


Fig. 4: Scenario 2: Quadratic cost. ρ = 20

×10 4 200 1.1


5
Pg1 V4
Voltage

Pg2 V5
Pg

100 1.05
λA

0 Pg3 V6
Pg6 V7
-5 0 Pg8 1 V9
5 10 15 20 25 30 35 5 10 15 20 25 30 5 10 15 20 25 30 35
Iterations (k) Iterations (k) Iterations
4
×10 50 0.1
5
Qg1 θ4
Qg2
Qg

0 0 θ5
λB

0 Qg3
θ
Qg6 6

-5 -50 Qg8 -0.1 θ7


5 10 15 20 25 30 35 5 10 15 20 25 30 5 10 15 20 25 30 θ 9 35
Iterations (k) Iterations (k) Iterations

(a) λA and λB (b) Pg and Qg (c) The voltages in consensus area.


Fig. 5: Scenario 2: Quadratic cost. ρ = 100, 000.
[2] T. Erseghe, “Distributed optimal power flow using admm,” IEEE trans-
parameter ρ, the algorithm may or may not converge. Care- actions on power systems, vol. 29, no. 5, pp. 2370–2380, 2014.
fully choosing ρ results in a solution same as that from [3] Q. Peng and S. H. Low, “Distributed algorithm for optimal power flow
MATPOWER. on a radial network,” in Decision and Control (CDC), 2014 IEEE 53rd
Annual Conference on. IEEE, 2014, pp. 167–172.
V. C ONCLUSION [4] A. X. Sun, D. T. Phan, and S. Ghosh, “Fully decentralized ac optimal
ADMM is implemented in this paper for a nonconvex AC power flow algorithms,” in Power and Energy Society General Meeting
(PES), 2013 IEEE. IEEE, 2013, pp. 1–5.
OPF. The consensus ADMM algorithm is applied to IEEE 14-
[5] M. Ma, L. Fan, and Z. Miao, “Consensus admm and proximal admm for
Bus system to solve an AC OPF problem. Different scenarios economic dispatch and ac opf with socp relaxation,” in North American
are carried out to test our methodology. Based on the output Power Symposium (NAPS), 2016. IEEE, 2016, pp. 1–6.
of the case studies, we can conclude that a nonconvex opti- [6] H. Zhu and G. B. Giannakis, “Multi-area state estimation using distributed
mization problem will not always present a stable converged sdp for nonlinear power systems,” in Smart Grid Communications (Smart-
GridComm), 2012 IEEE Third International Conference on. IEEE, 2012,
output. Ability to achieve a converged solution depends on the pp. 623–628.
tuning penalty parameter ρ. [7] ——, “Power system nonlinear state estimation using distributed semidef-
inite programming,” IEEE Journal of Selected Topics in Signal Process-
R EFERENCES ing, vol. 8, no. 6, pp. 1039–1050, 2014.
[1] S. Boyd, N. Parikh, E. Chu, B. Peleato, and J. Eckstein, “Distributed [8] R. D. Zimmerman, C. E. Murillo-Sánchez, and R. J. Thomas, “Matpower:
optimization and statistical learning via the alternating direction method Steady-state operations, planning, and analysis tools for power systems
of multipliers,” Foundations and Trends R in Machine Learning, vol. 3, research and education,” IEEE Transactions on power systems, vol. 26,
no. 1, pp. 1–122, 2011. no. 1, pp. 12–19, 2011.

You might also like