0% found this document useful (0 votes)
15 views311 pages

Smart Grid Optimization for Engineers

Uploaded by

Nadya Noorfatima
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
15 views311 pages

Smart Grid Optimization for Engineers

Uploaded by

Nadya Noorfatima
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

Optimal Coordination of Distributed Energy

Resources in Smart Grids Enabled by Distributed


Optimization and Transactive Energy
by

Rabab Haider
B.Sc. University of Toronto (2018)

Submitted to the Department of Mechanical Engineering


in partial fulfillment of the requirements for the degree of
Master of Science in Mechanical Engineering
at the

MASSACHUSETTS INSTITUTE OF TECHNOLOGY


February 2020

© Massachusetts Institute of Technology 2020. All rights reserved.

Author....... Signature redacted


Department of Mechanical Engineering
January 15, 2020

C ertified by ...... L(
Signature
. . . . . . . . . .......
redacted ........ . .
.

Anuradha M. Annaswamy
Senior Research Scientist,(1j e f Mechanical Engineering
Signature redacted-Thesis Supervisor

A ccep ted by ......................w ....................................


MASSACHUSETTS INSTITUTE Nicolas Hadjiconstantinou
OF TECHNOLOGY Professor of Mechanical Engineering
prA A 0 5 2020 lChairman, Department Committee on Graduate Theses

LIBRARIES
77 Massachusetts Avenue
Cambridge, MA 02139

MITLibranes http://Iibraries.mit.edu/ask

DISCLAIMER NOTICE
Due to the condition of the original material, there are unavoidable
flaws in this reproduction. We have made every effort possible to
provide you with the best copy available.

Thank you.

Some pages in the original document contain text


that runs off the edge of the page.

See Appendix C - MATLAB Code


p.213 - 301
2
Optimal Coordination of Distributed Energy Resources in
Smart Grids Enabled by Distributed Optimization and
Transactive Energy
by
Rabab Haider

Submitted to the Department of Mechanical Engineering


on January 15, 2020, in partial fulfillment of the
requirements for the degree of
Master of Science in Mechanical Engineering

Abstract
Modern active distribution grids are characterized by the increasing penetration of
distributed energy resources (DERs). The proper coordination and scheduling of a
large numbers of these DERs can only be achieved at the nexus of new technological
approaches and policies, primarily distributed computation and transactive energy.
Transactive energy is a control mechanism which uses economic incentives, such as
time-of-use or real-time electricity prices, to influence the behaviour of independent
agents (i.e. DERs in the grid) as needed by the grid operator. This thesis tackles
the problem of DER coordination by considering the role of distributed optimization
algorithms in solving the optimal power flow (OPF) problem, when a large number of
small scale DERs are present. The OPF problem minimizes costs to operate the grid,
while subject to network constraints. The distributed implementation makes large-
scale problems computationally tractable, while also maintaining privacy of local
information. First, we utilize a new convex formulation of the power grid based
on current injection (CI) and McCormick Envelopes, to model distribution grids of
meshed topology and unbalanced structure. The OPF problem is then solved for such
grid structures, using the distributed proximal atomic coordination (PAC) algorithm,
which has several advantages over other distributed algorithms. These advantages
include reduced network communication requirements, reduced local computational
effort, and improved privacy. The DER coordination problem is then extended to
consider storage devices. This requires a multi-period OPF formulation, which is also
solved using the PAC algorithm. Results from active configurations of the IEEE 123-
bus network corroborate the need for a multi-period optimization approach under high
penetration of renewable resources. Finally, we propose a retail market mechanism
which can be viewed as a transactive energy scheme within the distribution grid.
Through the retail market, DERs are optimally scheduled in an energy market, and
leveraged in alert system cases in an ancillary services market. The transactions of the
energy market are carried out at each primacy feeder through bilateral agreements

3
between the Distribution System Operator (DSO) and agents representing DERs
at feeder buses, leveraging the PAC algorithm. These interactions determine the
optimal real-time resource schedules and distributed Locational Marginal Price. The
PAC algorithm and proposed market are extensively validated on a real distribution
grid in Tokyo, a balanced IEEE 123-bus distribution grid, and a three feeder model
using the IEEE 13-bus. The energy market is shown to result in an overall increase
in revenue for the DSO.

Thesis Supervisor: Anuradha M. Annaswamy


Title: Senior Research Scientist, Department of Mechanical Engineering

4
Acknowledgments

To all those countless people, experiences, and mishaps which have made it possible

for me to arrive at the steps of MIT.

To my advisor for her words of wisdom, and reminders that research is the pro-

cess of uncovering truths.

To my friends for their well-timed moments of levity.

To my family, and especially my parents, who have guided me and supported me


through all endeavours. Your boundless love and infinite encouragement will always

get me through.

5
6
Contents

1 Introduction 19

1.1 Summary of Contributions . . . . . . . . . . . . . . . . . . . . . . . 24

.
2 Background 27

2.1 Introduction to the Electric Power System . . . . . . . . . . . . . . 27

.
2.1.1 Fundamentals of Electric Power . . . . . . . . . . . . . . . . 28

.
2.1.2 Electric Power Grid . . . . . . . . . . . . . . . . . . . . . . . 32

.
2.2 State of the Power System . . . . . . . . . . . . . . . . . . . . . . . 42

.
2.2.1 Challenges with DERs . . . . . . . . . . . . . . . . . . . . . 43

.
2.2.2 Paradigm Shift: Centralized to Decentralized . . . . . . . . . 43

.
2.3 Optimization Theory . . . . . . . . . . . . . . . . . . . . . . . . . . 45
2.3.1 D uality .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. 45
2.3.2 Optimality Conditions . . . . . . . . . . . . . . . . . . . . . 46
.

2.3.3 Convex Optimization . . . . . . . . . . . . . . . . . . . . . . 51


.

3 Optimal Power Flow for Meshed and Unbalanced Grids: Solutions


with Distributed Optimization 53
3.1 Notation for Power System Model .......... 54
3.2 Branch Flow Model .................. 55
3.2.1 Limitations of Branch Flow model . . . . . 56
.

3.3 Current Injection Model . . . . . . . . . . . . . . 57


.

3.3.1 Current Limits . . . . . . . . . . . . . . . 62


.

3.4 Distributed Optimization . . . . . . . . . . . . . . 63


.

7
3.4.1 Atomic Decomposition . . . . . . . . . . . . . 64

.
3.4.2 Statement of the PAC Algorithm . . . . . . . 66

.
3.4.3 Distributed Optimization with CI Model . . . 67

.
3.5 Reformulation of CI Model . . . . . . . . . . . . . . . . . . . . . . . 71

.
3.5.1 Source of Ill-Conditioning and Reformulation. . . . . . . . . 72

.
3.5.2 Analysis of System Condition Number . . . . . . . . . . . . 75

.
3.5.3 Eigenvalue analysis of Coordination Constraints . . . . . . . . 78
3.5.4 Eigenvalue analysis of Equality Constraints . . . . . . . . . . 82

.
3.6 Comparison with Branch Flow . . . . . . . . . . . . . . . . . . . . . 86

.
3.6.1 Qualitative Discussion on Simulation Results . . . . . . . . 89

.
3.6.2 Quantitative Discussion on Simulation Results . . . . . . . . 93
3.6.3 Additional Simulation Result . . . . . . . . . . . . . . . . . . 96

4 A Story of Storage: Multi-period Distributed Optimization for Dis-

tribution Grids 101


4.1 Multi-period Optimization . . . . . . . . . . . . . . . . . . . . . . . 101

.
4.2 Application to Distribution Grid . . . . . . . . . . . . . . . . . . . . 103

.
4.2.1 Demand Response . . . . . . . . . . . . . . . . . . . . . . . 104

.
4.2.2 Distributed Generators . . . . . . . . . . . . . . . . . . . . . 105

.
4.2.3 Generator Capability Curves . . . . . . . . . . . . . . . . . . 106
.
4.2.4 Storage System Modeling . . . . . . . . . . . . . . . . . . . 107
.

4.2.5 Ramp Constraints . . . . . . . . . . . . . . . . . . . . . . . 109


.

4.2.6 Defining Cost Function . . . . . . . . . . . . . . . . . . . . . 110


.

4.2.7 Electricity LMP Data . . . . . . . . . . . . . . . . . . . . . . 110


.

4.2.8 Electricity Demand Profiles . . . . . . . . . . . . . . . . . . 111


.

4.2.9 Renewable Generation Forecasts . . . . . . . . . . . . . . . . 112


.

4.2.10 Statement of MOPF Problem . . . . . . . . . . . . . . . . . 115


.

4.2.11 Decomposition for Distributed Computation . . . . . . . . . 116


.

4.3 Case Study Results . . . . . . . . . . . . . . . . . . . . . . . . . . . 117


.

4.3.1 Case 1: Motivating the need for Multi-period . . . . . . . . 118


.

8
4.3.2 Case 2: Understanding the need for Storage . . . . . . . . . . 121

4.3.3 Case 3: Scalability of the Model . . . . . . . . . . . . . . . . . 126

5 Using Transactive Energy: Proposal for a DSO-Centric Retail Elec-

tricity Market for Smart Distribution Grids 129

5.1 Introduction to US Electric Power System . . . . . . . . . . . . . . . 130

5.2 US Electricity Markets . . . . . . . . . . . . . . . . . . . . . . . . . . 131

5.2.1 Market Structure and Renewable Energy . . . . . . . . . . . . 133

5.2.2 Wholesale Electricity Markets . . . . . . . . . . . . . . . . . . 134

5.2.3 Participation of DERs in Electricity Markets . . . . . . . . . . 138

5.3 Literature Survey . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 144

5.4 Proposed Market Structure . . . . . . . . . . . . . . . . . . . . . . . . 147

5.4.1 Energy M arket . . . . . . . . . . . . . . . . . . . . . . . . . . 149

5.4.2 Ancillary Services Market . . . . . . . . . . . . . . . . . . . . 154

5.5 Validation of Proposed Market . . . . . . . . . . . . . . . . . . . . . . 155

5.5.1 Validation Metric 1: Privacy of the PAC Algorithm . . . . . . 156

5.5.2 Validation Metric 2: Computational Performance of the PAC


A lgorithm . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 157

5.5.3 Validation Metric 3: DSO revenue . . . . . . . . . . . . . . . . 161

6 Conclusions 171

6.1 Contributions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 171

6.2 Future Research Directions . . . . . . . . . . . . . . . . . . . . . . . . 172

6.2.1 Current Injection Model . . . . . . . . . . . . . . . . . . . . . 172

6.2.2 Development & Analysis of Distributed Optimization . . . . . 173

6.2.3 Extension of Retail Market . .. . . . . . . . . . . . . . . . . . . 1-73

6.2.4 Evaluation of Retail Market Design . . . . . . . . . . . . . . . 174

A Supplementary Results 177

A.1 Design of the PAC Algorithm . . . . . . . . . . . . . . . . . . . . . . 177


A.2 Convergence of the PAC Algorithm . . . . . . . . . . . . . . . . . . . 180

9
B Case Study Data 183
B.1 Network 3 Node ...................... 183
B.1.1 Load and DER Configuration 1 ......... 184
B.2 Network IEEE 13 Node . . . . . . . . . . . . . . . . . 185

.
B.2.1 Default Configuration . . . . . . . . . . . . . 185

.
B.2.2 Balanced Configuration . . . . . . . . . . . . . 191

.
B.2.3 Configuration for Ancillary Market Simulations 192
B.3 Network IEEE 123 Node . . . . . . . . . . . . . . . . 195

.
B.3.1 Default Configuration . . . . . . . . . . . . . 195

.
B.3.2 Configuration for Energy Market Simulations 197
B.4 Network JST-CREST 126 Node . . . . . . . . . . . . 199

.
B.5 Electricity LMP Data . . . . . . . . . . . . . . . . . . 201

.
B.6 Electricity Demand Data . . . . . . . . . . . . . . . . 203

.
B.7 Renewable Generation Forecasts . . . . . . . . . . . . 205

.
B.7.1 Small scale distributed residential PV . . . . . 205

.
B.7.2 Large scale distributed residential PV . . . . . 207
B.7.3 Distributed commercial PV . . . . . . . . . . .
. 209
B.7.4 W ind Farm . . . . . . . . . . . . . . . . . . . 211
.

C MATLAB Code 213


CA Main Scripts . . . . . . . . . . . . . . . . . . . . . . . . . 21 3
.

C.2 Atomized Central Solver . . . . . . . . . . . . . . . . . . 232


.

C.3 Implementation of PAC Algorithm . . . . . . . . . . . . . 233


C.4 Atomization for PAC . . . . . . . . . . . . . . . . . . . . 239
.

C.5 OPF Problem Setup . . . . . . . . . . . . . . . . . . . . 248


.

C.5.1 Main Setup . . . . . . . . . . . . . . . . . . . . . 248


.

C.5.2 DER Models . . . . . . . . . . . . . . . . . . . . 271


.

C.5.3 Objective Functions.... . . . . . . . . . . . . . 282


C.6 Result Processing . . . . . . . . . . . . . . . . . . . . . . 288
.

C.7 Network Data and Data Profiles . . . . . . . . . . . . . . 292


.

10
List of Figures

1-1 Breakdown of behind-the-meter DER potential in the US, for 2017, as

measured by GTM Research and Department of Energy [1]. . . . . . 20

1-2 Forecasted growth of behind-the-meter DER impact on peak potential,

showing growth from 46.4 GW in 2017 to 104.2 GW in 2023, leading

to large penetration of these flexible resources, as measured by GTM

Research and Department of Energy [1]. . . . . . . . . . . . . . . . . 20

2-1 Traditional Electric Power Grid, showing generation, transmission, and

distribution systems. . . . . . . . . . . . . . . . . . . . . . . . . . . . 33

2-2 Approximate models of transmission line . . . . . . . . . . . . . . . . 35

2-3 Complete model of three phase line segment . . . . . . . . . . . . . . 36

2-4 Graphical description of sequence domain components . . . . . . . . . 37

2-5 Examples showing decomposition of three-phase balanced (left) and

unbalanced (right) systems, using sequence components. Here, the pos-

itive, negative, and zero sequence components are labeled as 1, 2, and 0

respectively. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 38

2-6 Three-phase transposed cables . . . . . . . . . . . . . . . . . . . . . . 40

2-7 Graphic of the interface between the transmission network and distri-

bution network, with details pertaining to the primary and secondary

feeders in the distribution network . . . . . . . . . . . . . . . . . . . . 41

2-8 Image of nonconvex and convex surfaces, left and right respectively.

Local/global minima are indicated with yellow stars, and the initial

started point for the algorithm is indicated with yellow dots. . . . . . 51

11
2-9 Image of convex (left) and nonconvex (right) sets. . . . . . . . . .. . 5
52

3-1 Example network . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 55

3-2 Example network . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 58

3-3 Pictorial description of the atomization, and the use of variable copies

in PAC. The diagram also stresses that a one-to-one mapping of agents

to atoms is not required. . . . . . . . . . . . . . . . . . . . . . . . . . 65

3-4 Flowchart of the computational process. The PAC algorithm decom-

position is fixed for a network with a given topology. The scenario or

time-period specific updates must be run each time the PAC algorithm

is run. ................................... .70

3-5 Convergence results for the IEEE 13 node network, modified to have

D E R s. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 72

3-6 Convergence results for the IEEE 13 node network, modified to have

DERs with the modified CI model. . . . . . . . . . . . . . . . . . . . 76

3-7 Convergence results for the IEEE 123 node network with the modified

C I m odel. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 77

3-8 Simple topologies for discussing the system condition number . . . . . 79

3-9 Convergence results for the IEEE 13-bus network, under balanced con-

ditions, for the CI model . . . . . . . . . . . . . . . . . . . . . . . . . 90

3-10 Convergence results for the IEEE 13-bus network, under balanced con-

ditions, for the BF model. . . . . . . . . . . . . . . . . . . . . . . . . 91

3-11 Convergence results for the IEEE 13-bus network, zoomed in on the
first 100 iterations to show the behaviour of the algorithm per each

m odel. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 92

3-12 Convergence results for the IEEE 13-bus network, zoomed in on the

first 100 iterations to show the behaviour of the algorithm per each

m odel. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 93

12
3-13 Convergence results for the IEEE 13-bus network, under balanced con-

ditions, for the CI model, with o = 1, which influences the convergence

param eters. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 98

3-14 Convergence results for the IEEE 13-bus network, under balanced con-

ditions, for the CI model, with higher weight for the electrical losses

term , ( = 10. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 99

4-1 An example generator capability curve for a synchronous generator.

Here additional limitations for currents of field and excitor windings

are also shown, giving the curve a more complex shape. For the simple

power factor bounds we are considering, the curve will take on a smooth

circular shape for each quadrant of operation. Recall that Pj > 0 for

all generators, so we only have 2 quadrants of operation. . . . . . . . 107

4-2 Example demand profiles for a network with 5 nodes. . . . . . . . . . 113

4-3 Simulation results for 13-bus network over 2hrs. . . . . . . . . . . . . 119

4-4 Simulation results for 13-bus network over 5hrs. . . . . . . . . . . . . 119

4-5 Simulation results for 13-bus network over 8hrs. . . . . . . . . . . . . 120

4-6 Simulation results for 13-bus network over 24hrs. . . . . . . . . . . . 120

4-7 Simulation results over 24hr period for the 13-bus network with high

DR capabilities. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 122
4-8 Simulation results over 24hr period for the 13-bus network with high

DR capabilities and 1MW installed storage capacity. . . . . . . . . . 123

4-9 Simulation results over 24hr period for the 13-bus network with DR

capabilities and lower PV penetration (135kW). . . . . . . . . . . . . 124

4-10 Simulation results over 24hr period for the 13-bus network with DR

capabilities and higher PV penetration (265kW). . . . . . . . . . . . . 125

4-11 Simulation results over 24hr period for the 13-bus network with DR

capabilities, PV penetration of 135kW, and 0.5MW storage capacity. . 126

4-12 Simulation results over 24hr period for the 13-bus network with DR

capabilities, PV penetration of 135kW, and 1MW storage capacity. . 127

13
4-13 Simulation results over 24hr period for the 13-bus network with DR

capabilities, PV penetration of 135kW, and 2MW storage capacity. . 128

4-14 Simulation results over 24hr period for the 123-bus network with in-

stalled capacity of 179kW of renewable generation. . . . . . . . . . . . 128

5-1 Graphic showing the wholesale electric power markets in the US. The

grey regions are under traditionally regulated wholesale markets. The

coloured regions are the ISOs/RTOs where deregulated competitive

m arkets exist. [2] . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 132

5-2 Graphic showing the retail electric power markets in the US. The

grey regions are under traditionally regulated wholesale markets. The

coloured regions are states where deregulated competitive markets ex-

ist. [2] . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 133


5-3 Infographic of the wholesale and retail markets from PJM, under a

competitive market framework [3]. Other ISOs/RTOs have the same


general structure. ......................... .... .134

5-4 Typical timeline for planning and operations within the US electricity

system. Markets include day-ahead and real-time segments. . . . . . 135

5-5 Data from PJM for the DY 2018/2019, for DERs participating as DR [4].140

5-6 Plot showing the expected growth of solar PV in New England, as of


2019. This is primarily rooftop and small-scale solar resources. . . . . 141

5-7 Plot showing the variability in renewable energy production over a day

in New England. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 142


5-8 A set of price-demand curves showing the inefficiencies of using a fixed

retail price. Further, fixed prices can't leverage the flexibility of DERs. 142

5-9 A market structure in the form of a retail market within the distribu-

tion grid is necessary to best utilize the DERs within the network. . . 143

5-10 Proposed retail market structure . . . . . . . . . . . . . . . . . . . . . 148

5-11 Timeline of energy market layer interactions . . . . . . . . . . . . . . 153

5-12 Cost evolution with PAC and dADMM . . . . . . . . . . . . . . . . . 158

14
5-13 Flowchart of the computational process. The PAC algorithm decom-

position is fixed for a network with a given topology. The scenario or

time-period specific updates must be run each time the PAC algorithm

is run . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 160

5-14 The profiles of the time-dependent demand ratio a(i),i = 0,...,24,

for Networks JST-CREST 126 (top), IEEE-123 (middle), and IEEE-


13 (bottom ). . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 165
5-15 Profiles of P-LMP AP where red denotes the yearly average profile and

blue a constant LMP, for Networks JST-CREST 126 (top), IEEE-123


(middle), and modified IEEE-13 (bottom). . . . . . . . . . . . . . . . 166
5-16 Terminal configurations with the PAC algorithm and time-variant P-
LMP A...... . . . . .......... 167
5-17 The black graphs correspond to the scenario where all the loads of the

distribution grid are served by the main grid, the blue graph to the

scenario with the fixed P-LMP and the red graph to the scenario with

the time-varying P-LMP A... ....... . . . .. 168

5-18 The projected savings from the proposed retail market over a 24-hour

period . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 169

5-19 The projected savings from the proposed retail market over a 24-hour

period . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 169

B-1 An illustration of the distribution network model. The filled circles

show the nodes B. The red, blue and green filled circles indicate loads,

local generators and both, respectively. . . . . . . . . . . . . . . . . . 199

B-2 Demand profile taken from the system-wide demand for ISO-NE. . . 201

B-3 Demand profile taken from the system-wide demand for ISO-NE. . . 203

B-4 Solar PV generation profile for small distributed residential resource,

obtained from NREL's SAM tool. . . . . . . . . . . . . . . . . . . . . 205

B-5 Solar PV generation profile for large distributed residential resource,

obtained from NREL's SAM tool. . . . . . . . . . . . . . . . . . . . . 207

15
B-6 Solar PV generation profile for distributed commercial resource, ob-
tained from NREL's SAM tool. . . . . . . . . . . . . . . . . . . . . . 209

B-7 Wind generation profile for wind farm, obtained from NREL's SAM tool.211

16
List of Tables

3.1 Parameters for PAC algorithm for the Active IEEE 13 node network,

using the CI model. . . . . . . . . . . . . . . . . . . . . . . . . . . . . 71

3.2 Parameters for PAC algorithm for the Active IEEE 13 node network,

with the modified CI model. . . . . . . . . . . . . . . . . . . . . . . . 75


3.3 Comparison of feasibility eigenvalues for CI-Y and CI-Z models . . . 86

3.4 Comparison of the CI and BF model when using the distributed PAC

algorithm . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 96

3.5 Comparison of the CI and BF model when using the distributed PAC

algorithm . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 96

5.1 Computational Delays and Latency Requirements. All times measured

in seconds, (s). . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 161

5.2 PAC Computational Time. All times measured in seconds, (s). . . . . 161

5.3 Weighted average cost of using DGs or DRs for each feeder . . . . . . 170

5.4 New dispatch settings from AlgEX . . . . . . . . . . . . . . . . . . . . 170

B.1 Network Line data . . . . . . . . . . . . . . . . . . . . . . . . . . . . 183

B.2 Network nodal load data, in kW and kVAr . . . . . . . . . . . . . . . 184

B.3 Network Line data . . . . . . . . . . . . . . . . . . . . . . . . . . . . 185

B.4 Network nodal load data, in kW and kVAr . . . . . . . . . . . . . . . 187

B.5 Distributed energy resources (DERs) for active configuration. Gener-

ation capabilities in kW and kVA. . . . . . . . . . . . . . . . . . . . . 187

B.6 Distributed energy resources (DERs) for active configuration. Gener-

ation capabilities in kW and kVA. . . . . . . . . . . . . . . . . . . . . 188

17
B.7 Distributed energy resources (DERs) for active configuration. Gener-

ation capabilities in kW and kVA, and capacities in kWh. . . . . . . . 189

B.8 Distributed energy resources (DERs) for active configuration. Gener-

ation capabilities in kW and kVA, and capacities in kWh. . . . . . . . 190

B.9 Distributed energy resources (DERs) for active configuration. Gener-

ation capabilities in kW and kVA, and capacities in kWh. . . . . . . . 190

B.10 Network nodal load data, in kW and kVAr . . . . . . . . . . . . . . . 192


B.11 Network Line data . . . . . . . . . . . . . . . . . . . . . . . . . . . . 193
B.12 Network nodal load data, in kW and kVAr . . . . . . . . . . . . . . . 193

B.13 Generation node data for IEEE 13 . . . . . . . . . . . . . . . . . . . 194


B.14 Network nodal load data, in kW and kVAr . . . . . . . . . . . . . . . 195
B.15 Distributed energy resources (DERs) for active configuration. Gener-

ation capabilities in kW and kVA. . . . . . . . . . . . . . . . . . . . . 196

B.16 Generation node data for IEEE 123 . . . . . . . . . . . . . . . . . . . 197

B.17 Base values and simulation parameters for IEEE 123 . . . . . . . . . 198

B.18 Base values and simulation parameters for J-CREST 126 . . . . . . . 200

B.19 Line and load node data for J-CREST 126 . . . . . . . . . . . . . . . 200
B.20 Generation node data for JST-CREST 126 . . . . . . . . . . . . . . . 200

B.21 Hourly electricity prices from the real-time WEM for ISO-NE. . . . . 202

B.22 Hourly demand coefficient taken from the system-wide demand for
ISO -N E . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 204
B.23 Generation profile for a 3.85kW distributed residential solar PV resource206

B.24 Generation profile for a 11.55kW distributed residential solar PV resource208

B.25 Generation profile for an 185kW distributed commercial solar PV re-

source . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 210

B.26 Generation profile for a 600kW wind farm . . . . . . . . . . . . . . . 212

18
Chapter 1

Introduction

The modern distribution grid is characterized by the high penetration of Distributed


Energy Resources (DERs), including distributed generation (DG) units, flexible con-
sumption units (demand response, DR), and storage. The large majority of these
DERs are small-scale resources which are located behind-the-meter, meaning they
are not visible to utilities or control authorities. They are also largely owned by dif-
ferent third-party agents. These characteristics - the distributed nature, small scale,
and third-party ownership - make the efficient integration of these resources into the
grid a challenging and open research problem.
The penetration of small-scale DERs in the distribution grid is expected to con-
tinue growing. Figure 1-1 shows the breakdown of these behind-the-meter resources
in 2017, which contributed to 46.4GW of impact on the US power peak. The expected
growth is shown in Fig. 1-2, reaching upwards of 104.2GW by 2023. This amounts
to a substantial percentage of peak summer load of around 15%. The growth of
these resources is led by distributed solar (primarily rooftop solar photovoltaic, PV),
increased capacity in DR from smart home appliances, and increasing penetration of
electric vehicles (EV) and home charging infrastructures (distributed storage) [1]. If
efficiently utilized, these DERs are a valuable source of flexibility to grid operators.
Namely, DGs can be used to reduce costly power imported from the main grid; stor-
age can be used for storing excess renewable generation or for energy arbitrage; and

'In 2016, the US had 769 GW summer peak load [1].

19
DR provides necessary load-side flexibility under the new paradigm of uncontrollable
2
generation

Distributed Solar
Smart inverters will enable voltVAR support, curtailment and ramping

Small Combined Heat and Power (Under 50 MW)


• 18.5% of all installed CHP capacity
46.4 GW
Smart Thermostats
• Nearly 20 million purchased today, offering 8.3 GW of cycled peak demand
reduction
Electric Vehicles
0 Distributed Solar • 789 thousand EV purchased through Q4 2018, each with the ability to
*CHP ramp charging from 0 kW to 20 kw+
" Resi Smart Thermostats
" Electric Vehicles DIstributed Energy Storage
" Distributed Storage • Only 160 MW today, Califomia represents 90% of non-resi and 40% of
resi market

Figure 1-1: Breakdown of behind-the-meter DER potential in the US, for 2017, as
measured by GTM Research and Department of Energy [1].

US DER and Connected Device Impact on Peak Potential, 2017-2023

-o 120 104
E 100
80
0.40 (D 60 46.

.0 40
2 0
6L20
FiE 0--mu
2017 2018 2019 2020 2021 2022 2023
* Distributed Solar n CHP n Resi Smart Thermostats
* Electric Vehicles a Distributed Storage

Figure 1-2: Forecasted growth of behind-the-meter DER impact on peak potential,


showing growth from 46.4 GW in 2017 to 104.2 GW in 2023, leading to large pene-
tration of these flexible resources, as measured by GTM Research and Department of
Energy [1].

Efficiently leveraging this flexibility, however, is challenging. These DERs are


2
The changing energy generation mix includes many renewable resources, which cannot be con-
trolled the way traditional resources are. We cannot control when the sun shines or wind blows. As
such, generation can no longer be assumed to follow uncontrollable demand. To address this, we
must have some controllable components in demand - this is where demand-side management steps
in. More on this later.

20
typically located behind-the-meter, and as such are not visible to or accessible by

control authorities. Most small-scale renewable resources are solar PV: these are

highly variable resources whose output are entirely dependent on weather and cloud

cover. Accurate long-term solar forecasting is an open area of research - even 24hr

advance forecasting has high error margins. Another challenge comes in forecasting

demand, where net metering and EV charging can change consumer behaviour pat-

terns. Historical data which is currently (and successfully) used by grid operators to

forecast demand may no longer be accurate in predicting future demand patterns.


The private ownership of DERs also introduces concerns for data privacy and user

autonomy. Many distribution grid DERs such as small-scale storage and DGs are

owned by small businesses in the distribution grid, which may prefer to retain opera-
tional control over the resources. These resource owners should then have the option

to behave on an opt-in basis, rather than being required to cede control to and share

private information with a central authority 3

The optimization problem (optimal power flow, OPF) which is needed to effi-

ciently schedule such a large number of resources (i.e. when and how each DER is

being utilized), which are all owned by different independent agents, is a compu-

tationally challenging task. In today's electricity system, a similar OPF problem is

solved by transmission grid operators and in the wholesale electricity market (WEM).

The transmission level OPF is concerned primarily with large-scale transmission level

resources, and determines their dispatch and scheduling decisions, along with the
electricity prices at every node in the transmission network (termed the locational

marginal prices, LMPs). In general, the OPF problem determines the desired set

point of resources constrained by power flow physics, grid limits, and meeting elec-

tricity demand, all subject to minimizing the cost of operating the grid. These OPF

formulations involve a large number of variables to optimize over, complex feasibility

regions, and may have complicated objective functions. The computational chal-
3
Note that many smart home appliances can be remotely controlled, such as smart thermostats or
refrigeration units. These resources are often aggregated within a residential building or unit. Access
is given to a central authority (like a utility), which can then adjust set points in the building based
on power generation and demand across the network. This is another form of demand response, but
is not the key focus of this thesis.

21
lenges are further increased when considering integer variables representing on-off

unit commitment decisions.

Compared to the transmission grid, however, the OPF formulation for the distri-

bution grid is more complex. An active distribution grid with high DER penetration

will have many more resources, decision variables, and little to no large controllable

resources. In addition, the physical structure of the distribution grid varies greatly

from the transmission system: distribution grids can have both radial and meshed

topologies and are highly unbalanced electrical systems, while the transmission grid

is a balanced 3-phase system. These topological and structural differences render

power flow models such as the popular Branch Flow (BF) model [5-71 unsuitable for

OPF formulations for the distribution grid 181; as such, new power flow models are
required.

Moreover, the increased penetration of renewable generation (both at the trans-

mission level and locally within distribution grids) motivates the need for demand-side

management (such as DR) and storage. Storage can include large grid-scale batteries

which are typically owned and/or operated by utilities, small-scale batteries on-site

of businesses or residential complexes, and electric vehicles. Regardless of size, all

storage devices introduce new complexity to the OPF problem: there are constraints

coupled in time from the storage state of charge. Discharging a storage unit in one
period leaves less charged capacity for a future period. This requires the need for

multi-period optimization, to account for the impact current actions have on future

capabilities, and increases the size of the already large-scale optimization problem.

Finally, the key to efficient resource scheduling in distribution grids is to utilize

their flexibility, while also maintaining privacy and autonomy of DERs. This au-

tonomy, or indirect control of resources, is often termed "economic" or "transactive"

control. The concept of transactive energy uses a service-based value of power gener-

ation or consumption to influence desirable behaviours from autonomous agents (i.e.

DERs) at fast timescales [9, 10]. Price signals are used as the control signal. Agents

are compensated for the services they provide to the grid based on appropriately de-

signed market derivates. This "appropriate" design takes the form of a retail market

22
structure which behaves much like the WEM, but within the distribution grid. The

challenge here is to solve OPF problems in the distribution grid for resource schedul-

ing and determining distribution-level LMPs (d-LMPs) through coordinated markets

in a computationally tractable way.

The large-scale nature of the OPF problem applied to the distribution grid would

render centralized approaches 4 to perform poorly. To make these large-scale optimiza-

tion problems tractable, various distributed optimization approaches have been devel-

oped, including many that employ distributed alternating direction method of multi-

pliers (ADMM) [5,6,11-19] and proximal atomic coordination (PAC) [20,21]. These

distributed solvers solve the original centralized optimization formulation through

three key ideas. First, they properly allocate the computational burden of optimiz-
ing the problem's variables amongst different processing units. This can be different

processing units housed at the same facility, or units in different geographic loca-

tions which are also owned by different parties; we refer to these parties are "agents".

Second, they exploit parallel or sequential computation to speed up iteration con-

vergence. Third, they ensure that all agents agree on coupling variables so that the

distributed solution matches the original centralized solution, and a common objec-
5
tive is reached. To achieve agreement, agents must (at a minimum) communicate

with its' peers/neighbours. Ideally, a distributed algorithm should minimize the data

shared and communication requirements between agents. Since distributed methods

rely primarily on local computations at each node and peer-to-peer (P2P) exchange

of information, they are computationally tractable 6. Moreover, if well designed, dis-

tributed algorithms can be resilient to communication link and single-point failures.


Finally, the most attractive distributed algorithms will preserve the private informa-

tion of agents, while still realizing global objectives and meeting global constraints.

Indeed, distributed methods that are able to accomplish the above goals are highly

useful tools for solving optimization problems in various engineering and data science

4which are the best understood and most widely implemented class of optimization solvers
5
This is the objective function of the central optimization problem.
6
Especially compared to central methods which require all agents to send data to a central
entity,
which then solves a huge optimization problem.

23
problems. Further discussion of distributed optimization, and in particular the PAC

algorithm, is provided in Chapter 3.

In the context of distribution grids, the centralized optimization problem can

be distributed across the DERs, which are assumed to be independent agents with

computational capabilities 7. Private information for DERs can include the objective

functions (operating costs), operating constraints, and price of electricity (either to

be paid to or by the DER), and we desire for these to remain private. The PAC

algorithm has been applied to the OPF problem for radial balanced networks in [201,

to the OPF problem for meshed unbalanced networks in [8] (contributions by this

author, further discussed in Chapter 3), to the multi-period OPF problem (further

discussed in Chapter 4), and for coordinating a retail market in [22] (by this author,
further discussed in Chapter 5). A discussion on privacy of the PAC algorithm in the

context of electricity markets is also presented in [221 and Chapter 5.

1.1 Summary of Contributions

The high penetration of DERs in distribution grids provides operational challenges

when considering the optimal coordination of these resources. The three pillars of this

problem are: the high dimensionality of the OPF problem; the coupling constraints
introduced by storage devices; and the coordination of devices from independent

owners. To address these challenges, we need three corresponding tools: a distributed

computation approach; multi-period optimization; and a financial structure viewed

as a transactive energy scheme. These are the main contributions of this thesis. The

three components are each described below.

Optimal Power Flow for Meshed and Unbalanced Grids: Solutions with

Distributed Optimization. Distributed computation is applied to a new convex

relaxation of the OPF problem, based on current injection (CI) and McCormick

Envelopes (MCE), which can model meshed and unbalanced distribution grids. An

7
This is an assumption made for simplicity. It is not a requirement from the design of the
algorithm, nor the specific problem of distribution grid optimization.

24
eigenvalue analysis of the CI model and a proposed reformulation is carried out to
show how modelling decisions influence the applicability of distributed computation,

with a focus on convergence parameters of the PAC algorithm. The computational

performance of the PAC when using the CI model is compared to that of the Branch

Flow (BF) model, which is a popular OPF formulation, but is applicable only to

radial balanced grids.

A Story of Storage: Multi-period Distributed Optimization for Distribu-

tion Grids. The CI formulation of the OPF problem and the PAC algorithm are

extended to include decision variables with state retention, which require multi-period

optimization. Distributed computation is once again a tool used to tackle the large

scale problem of resource scheduling when there are many independent participating
agents within the distribution grid. This multi-period extension enables storage to

be considered within the dispatch problem.

Using Transactive Energy: Proposal for a DSO-Centric Retail Electricity

Market for Smart Distribution Grids. A novel retail market mechanism for
distribution grids under high penetration of DERs is proposed, where decisions are

carried out by a Distribution System Operator (DSO). The DSO oversees two markets:

(1) an energy market for DER scheduling and real-time market settlements (d-LMP)

through bilateral contracts; and (2) an ancillary market which oversees transactions

for alert conditions between primary feeders in the distribution network. The DSO

acts like a proactive utility, in that it accepts the LMP as traditionally determined

by the WEM, but optimally uses DERs within the distribution network, and only
requests service from the WEM for net loads beyond its DER capabilities. The
proposed market structure is numerically verified, showing potential savings for the

DSO under this new market mechanism.

The rest of the thesis is organized as follows. Chapter 2 introduces necessary back-

ground information that is required for sufficient understanding of the contributions of

this thesis, including an introduction to power physics, the changing distribution grid,

and optimization theory. Chapter 3 introduces the CI model and the PAC algorithm,

applies the distributed computation to the OPF problem, and makes computational

25
comparisons between the CI model and BF model. Chapter 4 discusses the extension

of the PAC algorithm to multi-period optimization, introduces models for DERs, and
presents simulation results for an active configuration of the IEEE 123-bus network.

Chapter 5 provides an overview of the US power system, with a focus on electric-

ity markets, then introduces the proposed DSO-centric retail market with validation

metrics and simulation results on three different test networks. Finally, conclusions

and future research directions are provided.

26
Chapter 2

Background

This chapter provides a brief introduction to several topics necessary to understand

the material in the thesis. Key nomenclature, notation, and terminology used through-

out the thesis will be introduced. An overview of electric power systems, the changing

distribution grid, and optimization theory will be provided.

2.1 Introduction to the Electric Power System

The electric power system is a large, highly complex dynamic system operating over

varying spatial and temporal scales. Power systems describes the interconnected
subnetworks of generation, transmission, and distribution. Generation has typically

been comprised of larger, centralized units such as coal and gas-fired power plants,

nuclear plants, and hydroelectric plants. Once power has been generated 1, it is carried
across the transmission system, which consists of high voltage AC lines. Through a

series of primary and secondary substations, the electrical power is stepped down to

lower voltages in the distribution network, which then supply end loads. A more
complete discussion of the transmission and distribution networks will follow in a

subsequent subsection.

'We engineers use this term loosely, as energy cannot be in fact created nor destroyed. Rather,
more appropriate terminology would be "energy has been converted from chemical or thermal energy
to electrical energy".

27
2.1.1 Fundamentals of Electric Power

The basic power physics variables are current, I, and voltage, V. Loosely speaking,

these variables measure the flow of charge, and the difference in electrical potential

energy, respectively. In an ideal world where all elements are lossless, the voltage drop

across a section of wire would be zero. However, when considering realistic systems,

and frankly interesting problems, losses in the form of voltage drop or changes across

electrical elements becomes important. The three fundamental components are:

" Resistance, R, measured in Ohms [Q]. Voltage drop over an element or segment

of wire, as described by Ohm's Law: V(t) = RI(t)

" Capacitance, C, measured in Farads [F]. Energy stored in an electric field

(between two parallel plates): 1(t) = C V(t)

" Inductance, L, measured in Henrys [H]. Change of voltage w.r.t. magnetic field

strength: V(t) = L 1(t)

By way of the Fourier Transform and using complex numbers, a simpler representation

of these elements can be obtained, where w = 27rf, and f is the signal frequency, and

j is the imaginary number.

R ->R

L - jwL
1 j

Every electrical system can be described using these three elements. More precisely,

we define the reactance, impedance, and admittance, to fully describe an electrical

component, along with the resistance.

" Reactance, X, measured in Ohms [Q]. X = wL - 1


WO

" impedance, Z, measured in Ohms [Q]. Z = R + jX

" Admittance, Y, measured in Siemens [S]. Y = 1/Z

28
Thus the electrical relationship can be simplified to

V(t) = ZI(t) (2.1)

I(t) = YI(t) (2.2)

By introducing reactance into our model, both voltage and current also take on com-

plex values. When dealing with complex numbers, there are three equivalent no-
tations: the rectangular, polar, and exponential forms. Polar form is often called
phasor notation when studying electrical systems. The exponential form is derived

from Euler's Identity. For an arbitrary complex number X = a + jb

" Rectangular Form: X = a + jb

• Polar Form: X = AZ6, where A = v/a2 + b 2 and 6 = tan- 1 (y/x)

" Exponential Form: X = A(cos 0 + jsin 0)

These representations can be used interchangeably, although the ease with which the
complex variables can then be manipulated depends on the application. While they

are all equivalent, the polar and exponential forms provide some key insights. For a
purely resistive network (X = 0), angles will be zero; for a purely reactive network
(R = 0), angles will be 900. Thus for a network with both resistive and reactive
components, the angle will depend on the ratio of these elements. Further, the angle

of the current, #, and the voltage, 0, are related to one another by the ratio of the
resistance and reactance in the network. We will revisit this after discussing electrical

power and AC circuits.

With knowledge of current and voltages in our network, one can calculate the

power drop across elements. When considering a circuit with reactive components,

the resulting power is complex (known as apparent power, S), with real and reactive

29
parts, denoted by P and Q respectively:

S = V(t)I(t)* (2.3)

IV(t)1 2 (2.4)
S= -
Z*

S = P + jQ (2.5)

where 1 9 |* indicates the complex conjugate. The real and reactive powers can also

be expressed as functions of the complex power and the power angle, as below:

P = ISIcos O (2.6)

Q= |Sjsin6 (2.7)

The concept of real and reactive power extends beyond being a mathematical

construct. In the most fundamental sense, real power P is the power used to do

actual work (dissipated by the load). Reactive power Q represents energy exchange

between reactive loads and parasitic elements (such as inductors and capacitors), and

does not contribute to work done. This "sloshing" back and forth of power increases

the overall current flowing in a circuit without contributing to any work, resulting in

increased thermal losses due to power line resistance. The power dissipated over an
element (or a segment of wire) is calculated as

p, = I2 R (2.8)

In order to minimize losses in a network, lower current is desirable. Thus, high

voltage lines are used, as halving the current (equivalently doubling the voltage)

results in a quarter of the losses due to the lines resistance. However, since loads are

typically 120/240 V, transformers are needed to step up voltages for transmission, and
step down voltages for distribution. A basic transformer consists of an ferromagnetic

core which can sustain a magnetic flux, and two sets of coils wrapped around either

side - a primary coil with Npri loops and a secondary coil with Nse loops. Transformers

30
make use of Ampere's Law, where a time-varying current induces a time-varying

magnetic field, and Faraday's Law of Induction, where a time-varying magnetic field

in turn induces an electromotive force (EMF) which drives a time-varying current.


The primary and secondary voltages are related to the turns of coil; for an ideal

(lossless) transformer the ratio is

Vpri Npri (2.9)


Vsec Nsee

Since transformers rely on time-varying currents to manipulate voltages, the electric

power system is built on alternating current (AC), rather than direct current (DC)
which is not time-varying. AC current typically follows a sinusoidal waveform, though
some specific applications may require a square or triangular waveform. Since power

is a product of the voltage and current, both of which are time-varying signals, the

power transfer is dependent on the phase angle between the two signals. Referring

back to the discussion on phasors, the difference in angle, 6 = ' - <, describes the
quality of power transfer. This is denoted as the power factor, pf:

P
pf = cos9 =1 (2.10)

equivalently: pf = cos arctan - (2.11)


P
and: Q = P tan arccos pf (2.12)

A high power factor (close to 1) is preferred. Comparing two loads which draw the

same current at the same voltage, but have different power factors, the load with the
lower pf will have less useful power transferred - namely, Powpf < Phighpf. This means

there are more resistive losses due to the higher current, for less work being done.

Power factor correction is frequently employed using power electronics to increase the

power factor of a load, and thereby improve the efficiency of the distribution system.

Note a negative power factor implies the device is generating power - and similarly,

a power factor of -1 indicates better quality of generation.

Within a given circuit, the currents and voltages can be determined based on the

31
generation and load at the different nodes. The two fundamental laws, Kirchhoff's

Current and Voltage Laws (KCL and KVL respectively) relate conservation of charge

and conservation of energy respectively, to the electric power quantities. Namely,


KCL dictates that the sum of currents into a node equals the sum of currents out of

a node (E In = T, I), while KVL dictates that the algebraic sum of voltage drops

around a loop equals zero (Z V = 0). These two laws, along with the definitions of

power and losses over elements, fully describe the power flow throughout a circuit or

electric grid.

2.1.2 Electric Power Grid

The traditional electric grid is composed of three main sections: generation, transmis-

sion, and distribution, see Fig. 2-1. Generation has typically comprised of centralized
large-scale powerplants, including coal or gas fired plants, nuclear, and/or hydro, lo-

cated far from loads. The transmission grid consists of the necessary transformers,

substations, and high-voltage power lines which transport the electricity from gen-

eration centers to load centers. Finally, the transmission grid is connected to the

distribution network by step-down transformers located at substations. The distri-

bution grid distributes the power to various loads, including industrial facilities, and

residential units through distribution feeders. While large-scale renewable resources


can be connected directly to the transmission system, such as wind farms or solar

arrays, many smaller-scale renewables are connected to the distribution system, or


are behind-the-meter (such as rooftop solar). With this, we focus on the distribution

grid. However, to appreciate some of the more nuanced details, some background on

transmission line modeling and the differences between transmission and distribution

systems is warranted.

Three Phase Systems

From the discussion on AC power, higher efficiency in a network, when considering

resistive losses, can be gained by using high voltage lines. However, this does not

32
Subtransmission
Customer
Transmission Lines
26kV and 69kV
765, 500, 345, 230, and 138 kV
f JAI
I I
I I 4 K. I I

Substation Primary Customer


Step-Down Lb 13kV and 4kV
Transformer

Generating Station Transmission I B B Secondary Customer


Generator Step Customer EJ 120V and 240V
Up Transformer 138kV or 230kV

Generation Transmission Distribution

Figure 2-1: Traditional Electric Power Grid, showing generation, transmission, and
distribution systems.

motivate why three-phase power is used within the power grid. To understand this,

we consider the cases of single phase and polyphase (specifically two and three phase)

power. We first recall that AC voltages and currents are of sinusoidal nature:

v(t) = V cos(wt) (2.13)

i(t) = I cos(Wt + 4) (2.14)

p(t) = v(t)i(t) = 2 cos(#) [1 + cos(2wt)] + 2 sin(#) sin(2wt) (2.15)

• Single Phase: Consider an AC voltage source supplying power to a load with


a single wire. From basic KCL, the current must have a return path to the
source. Since the source is AC, the power delivered to the load is also time-
varying. This, single-phase systems have non-zero return current and deliver
non-constant power.

" Two Phases: Consider an AC voltage source supplying loads with two phases.
We have two cases:

- "Split Phase": The two phases are 1800 apart. This lends itself to zero
return current (Ia + Ib = 0). However, the total instantaneous power

33
delivered to the load is non-constant.

ia(t) = I cos(wt + #) (2.16)

ib(t) = I cos(t + # + 7) (2.17)

- "Two Phase": The two phases are 900 apart. This lends itself to constant
instantaneous power delivered. However, there is non-zero return current

(1a + lb # 0).

ia(t) = I cos(wt +) (2.18)

ib(t) = I cos(wt + # + 7r/2) (2.19)

• Three Phases: Consider an AC voltage source supplying loads with three


phases, where the phases are 120° apart. Similar to the split phase case, there
is zero return current, eliminating the need for an extra return cable. Further,
the instantaneous power delivered is constant.

ia(t) = I cos(wt + #) (2.20)

ib(t) = I cos(wt + # + 21r/3) (2.21)


ic(t) = I cos(wt + # + 47r/3) (2.22)

For these reasons (constant power delivery and zero return current), the power
system uses three phase power.

Modeling of Electrical Lines

A fundamental part of modeling the power system is to model the electrical lines.
Consider a single power line, carrying a single phase of current. There will be elec-
trical resistances and inductances along the length of the line, due to the conductor's
electrical and electromagnetic properties. Additionally, the electromagnetic interac-
tions with the physical ground (i.e. Earth's surface) can be modeled as a capacitor,

34
T 2 Li1

Vt C C, Vi3 i Zrzr V

(a) Lumped parameter model of transmission (b) Approximation: Pi model of transmission


line line
ii, i.,1

ZT Vtov

Vi 0-ZT Vi

(c) Approximation: T model of transmission (d) Approximation: Simplest model, nomi-


line nal model for short lines

Figure 2-2: Approximate models of transmission line

as the charge imbalance between the wire and ground can be roughly imagined as two
capacitor plates with air as the dielectric medium. Although these impedances occur
over the entire power line, they can be approximated with lumped parameters, which
describe the entire line with a single resistor, inductor, and capacitor between nodes
i and Fig. 2-2a. For analysis, often approximations of this model are
j, as shown in
used to simplify the mathematics, lending to transmission line models in Fig. 2-2b
and Fig. 2-2c.

The simplest case as shown in Fig. 2-2d is often used to model short lines, which
considers the self-impedance (Z = R+jX) which is the wire's own resistance, R, and
inductance, X = wL. However, in three phase power systems, the three conducting
wires are in close proximity to one another, lending itself to electromagnetic interfer-
ence. This is captured as line-to-line impedances, as shown in Fig. 2-3. For the three
phase line, phases a, b and c, the matrix form of Ohm's law (Vbc = ZIa&c) can be

35
Ia I
+ Ib +b
C DC

Vagt bizc

Vbgi bgj 1-

Figure 2-3: Complete model of three phase line segment

written as

Va Zaa Zab Zac Ia

V = Zab Zbb Zbc Ib (2.23)


VC Zac Zbc ZccJ IcJ

where Z., are the self impedance and Z,, are the mutual impedances between phases
x and y. Note that for a single or two phase line, the missing line(s) will have zero
entries in the impedance matrix.

Balanced and Unbalanced Systems

With three phase lines and the corresponding line models introduced, the concept of
balanced and unbalanced systems can be discussed. We begin by introducing some

basic concepts, then discussing their implications on modeling transmission and dis-
tribution grids.
Definitions In a balanced system, each phases' line will have identical electrical prop-
erties. Specifically, between node i and j, the impedance of each line is the same. In
this case, when a balanced voltage is applied to each phase (same magnitude, just
shifted by 1200) and the loads are the same, the current drawn will also be balanced

(same magnitude, each shifted by 1200). In an unbalanced system, the electrical prop-
erties of the lines will be different. In this system, when a balanced voltage is applied

and the loads are the same, the current magnitudes along each phase will be different,

36
c B
C

At B

B/ C

Positive Sequence Components; Negotive Sequence Components; Zero Sequence Components


A-B-C A-C-B

Figure 2-4: Graphical description of sequence domain components

and the phase shift between the voltage and currents of each phase (9 = 4 - #) will

also be different.

Sequence Domain Until now, the polyphase AC voltages and currents have been de-

noted by their phases, which for three phase systems are each 1200 (equivalently 27r/3)
apart. This is known as the phase domain. An equivalent representation is in the

sequence domain, using symmetrical components. The sequence domain consists of

three sets of independent components: positive, negative, and zero sequences. The

positive sequence is when phasors are 1200 apart with a clockwise rotation. The neg-

ative sequence is when phasors are 1200 apart with a counterclockwise rotation. The

zero sequence is composed of phasors which are equal in magnitude and phase (colin-

ear phasors). The sequence domain is shown in Fig. 2-4. The sequence domain will be

denoted with subscript [0 + -], denoting the zero, positive, and negative sequences

respectively.

The sequence domain can be used to determine if a voltage or current is balanced

or unbalanced. In a balanced system, the sequence domain representation will have

only a non-zero positive sequence component. An unbalanced system will also have a

negative sequence and/or zero sequence component. The decomposition is shown in

Fig. 2-5. Note in the balanced network, the three voltages are simply colinear vectors,

while the negative and zero sequence vectors are zero. In the unbalanced case, there

are non-zero negative and zero sequence components. The 'a' multiplicative factor in

the diagram is a rotational operator, and will be discussed in the next section which

37
-4

N, VC

A
'VI V" VC A

V,

,
".
3V a
V,
X Is xI
Ic

Balanced network Unbalanced network

Figure 2-5: Examples showing decomposition of three-phase balanced (left) and un-
balanced (right) systems, using sequence components. Here, the positive, negative,
and zero sequence components are labeled as 1, 2, and 0 respectively.

introduces the Fortescue Transformation.

Fortescue Transformation According to Fortescue, who developed the methodol-

ogy of working with the sequence domain in 1913, every three-phase system can be

cast into sequence domain. The conversion from phase domain ([Zac]) to sequence
domain ([Zo+_]) is done through the Fortescue Transformation T, and is applicable

to both balanced and unbalanced networks.

1 1 1 1 1 1
T= 1 a2 a and T-1 = a 2 (2.24)
3
1a a2] 1 2 a_

Using Symmetrical Components The sequence domain is used when studying elec-
trical faults. The calculated sequence components are used as data inputs to pro-
tective relays, which act to minimize the impact of the outage, which could entail
islanding part of the grid. The sequence domain can also be used to understand the
degree of imbalance in a network - if the negative and zero sequence components are

large, the network has a high degree of imbalance. Symmetrical components can also
make analysis of balanced networks much simpler. Balanced networks are created
by transposing the cables, which is when the position of the cables relative to each
other are swapped in intervals, as in Fig. 2-6. By twisting the cables in this way,

38
the mutual impedances between the phases are equal, Zab = Zbc = Zac. The self and
mutual impedances for a transposed cable can be easily calculated, and the balanced
impedance is as below:

1
Zs = -(Zaa + Zbb + Zcc) (2.25)
3
1
ZM = -( Zab + Zc + Zac) (2.26)
3
Z Z Z
[Zbalanced] = Zm ZS Zm (2.27)

ZM ZM ZS

By applying the Fortescue Transformation to the three-phase impedance matrix,

the phase domain is obtained, as below

Zoo Zo+ Zo_


[ Zo+_] = T -' [Zabc]T =Z+0 Z++ Z+_ (2.28)

Z-0 Z-+ Z__

For transposed networks, the off-diagonals which describe the mutual coupling are
zero. The balanced impedance matrix in sequence domain is then

Zoo 0 0
(2.29)
[Z[0+1]] 0 Z++ 0
0 0 Z__

where:

Z 0 0 =Zs+2Zm (2.30)

Z++=Z__=Z+Zm (2.31)

Thus in the sequence domain, the three components are decoupled and can be repre-
sented with separate line diagrams. This decoupling makes the analysis much simpler,
as each circuit can be analyzed separately, and the final phase domain result deter-

39
a

Figure 2-6: Three-phase transposed cables

mined with the inverse Fortescue Transformation.

Transmission Grids

The transmission grid isn't the primary focus of this work, but should be briefly dis-
cussed to highlight the challenges in modeling the distribution grid. Since the primary
purpose of the transmission system is to transport electricity over large distances, the
minimization of losses is a key concern. As such, the cables are designed to have very
low impedances resulting in low R/X ratios. The cables are transposed to minimize
mutual impedance losses. These design features result in networks with little or no
unbalances, and small difference in voltage angles between nodes.

Distribution Grid

The distribution grid handles power delivery to customers, including industrial facili-
ties, large buildings, and small-scale residential units. The distribution grid is broken
down into the primary lines and the secondary lines. The high voltage transmission
line systems arrive at a substation, which steps down the voltage for the primary feed-
ers of the distribution grid. A single substation is typically serviced by at least two
transmission lines, and can feed anywhere between three to 30 primary distribution
feeders. The primary feeders are typically still three-phase lines, and deliver power
to large industrial loads, large office buildings, and can have DERs such as large PV
arrays, wind turbines, and utility-scale storage units connected. In addition to these
loads, a primary feeder will also connect to distribution transformers which service
the secondary feeders. There can be over 100 secondary feeders for each primary

40
Substation

Prirnary lines
3#, 4-35 kV

Transmission Secondary lines


1#, 120/240 V

Distribution
Distribution Transformer
25-50 kVA
Madmum Wt.g3e80 kv) HighVlage(..11lV) M Medium Volage (10 .. ) . v L tow Vt (40V)

Figure 2-7: Graphic of the interface between the transmission network and distri-
bution network, with details pertaining to the primary and secondary feeders in the
distribution network

feeder. These secondary feeders are typically one- or two-phase lines, and consist of

very short lines at 120/240 V. The secondary feeders service neighbourhoods and res-
idential units. The DERs in the secondary feeder are typically rooftop solar PV and
electric vehicles (EVs). Figure 2-7 shows this topology, and the connection between
the transmission and distribution grids.
The primary feeders are classified as medium voltage lines (between 1-35 kV), and
are often organized in a mesh topology. The redundancy in meshed networks allows
for increased reliability, as alternate paths for electricity flow are available in the event

of an outage. Critical loads, such as hospitals, police stations, and fire stations, are
typically connected to the primary feeder with backup substations, in case the primary
substation is damaged or inoperable. This, along with the meshed topology, ensures
critical loads are always serviced. Meshed networks are more expensive to build,
however, so most low voltage grids (secondary distribution lines) are radial topologies.
This means a single point of failure can take out the downstream branch in the grid,
and requires on-site repairs rather than rerouting through electronics or switches.
In North America, most distribution grids are radial topology, with the exception
of high-density urban areas, which enjoy meshed grids. Many European electricity
infrastructure enjoys meshed, looped, or tied-ring network structures, which are more

connective graph structures than radial networks. Meshed grids, however, are more

41
desirable due to increased resiliency and enabled bidirectional power transfer between
many nodes.
Since the distribution grid consists of lower voltage and shorter length lines, the
electrical impedances are typically higher than that of transmission lines - thus the
lines have a higher R/X ratio. Further, the distribution grid lines are not transposed,
and secondary feeders have many one- and two-phase lines, which connect residential
loads. These all contribute to a highly unbalanced distribution grid. Reactive power
support becomes more important in these grids, and are typically implemented as
power electronics and capacitor banks. These devices help minimize reactive power
in the grid, and improve the efficiency of power transfer. The unbalanced distribution
grid cannot be approximated as a balanced system, meaning the coupled three-phase
equations must be solved together.
From the above description, lets highlight the key points which motivate the work
presented in this thesis. The distribution grid:

1. has both radial and meshed topologies.

2. is highly unbalanced, due to the impedances of the lines, and the presence of
single- and two-phase lines, and corresponding loads.

3. has a large number of nodes - think up to 30 primary feeders per substation,


100 secondary feeders per primary feeder, and many 100's of nodes connected to
the secondary line. Now imagine that each node has a device - the coordination
of all these devices is a large problem which quickly gets out of hand.

2.2 State of the Power System

The section above introduced the fundamentals of electric power and the structure of
the power system, which have been present since the conception of a connected power
transmission and delivery system. Rather, the new challenges come from the increased
penetration of distributed energy resources, such as renewables and batteries.

42
2.2.1 Challenges with DERs

Within the transmission system, large-scale renewables such as wind and solar farms

have been integrated. While these resources are intermittent and uncontrollable, they

are large systems which can be operated directly by the load serving entity (LSE).

DERs in the distribution grid however, are small resources typically located behind

the meter where the LSEs and grid operators have little to no visibility. The penetra-

tion of these resources is increasing, including increased rooftop solar PV, storage and

batteries (which also include electric vehicles), and onsite nonrenewable generators

(such as controllable diesel generators). With more DERs in the distribution grid,
which has 100's of nodes on each secondary line, the number of devices which must
be controlled is very large. Finally, some residential units or small businesses may

have privacy concerns, meaning the LSE cannot (or perhaps should not) have direct

access to all information and control over the DERs. Thus the problems of visibility,

scale, and privacy are unique to DERs in the distribution grid. This, along with

the intermittency and uncontrollability of renewable resources, and the fundamental

requirement that supply meets demand in the power grid creates a rich and complex

resource coordination problem.

2.2.2 Paradigm Shift: Centralized to Decentralized

Based on the challenges discussed above, much of the leading research and devel-

opment in the power grid is moving from a centralized perspective to decentralized.


Thus far, the centralized perspective has been hugely successful - supply was fully

controllable with large scale powerplants and generators producing power in few point

locations. The grid operated by requiring that supply follow demand, and customers

paid flat rates for their electricity usage. However, with the increased penetration of

DERs, this paradigm no longer holds. First, renewables result in variable and uncon-

trollable supply. Thus enters the concept of demand-side management and demand

response, where both supply and demand are variable. This includes both direct

control over a load or using transactive energy schemes (such as time-of-use electric-

43
ity rates or real-time pricing) to influence consumer behaviour. This adds another

dimension to the overall problem - where the cost of compensating a customer for

changing their consumption as needed by the grid - must now be accounted for in the

optimization scheduling problem. With both distributed generation and demand re-

sponse spread within the distribution grid, resources are no longer large agglomerates

at point locations. These distributed resources can all provide important functions

to the grid operator; however, the grid operator cannot have direct control or full

knowledge of each of these resources as the coordination problem quickly gets out of

hand. Rather, these resources must be "smart". When equipped with computational

capabilities, these resources can schedule themselves, leveraging local information as

well as some shared information from neighbours and/or other nodes in the network.

Thus, the physical system and the operations both shift towards decentralized models,

or further, to distributed models.

As defined in [23] - an excellent survey paper on distributed optimization and

control algorithms applied to electric power systems - the following terminology will

be used here:

1. Centralized: Each agent communicates with a centralized controller that

performs computations and sends new commands;

2. Hierarchical: Algorithms where computations are done by agents that com-


municate with other agents at a higher level in a hierarchical structure, eventu-

ally leading to a centralized controller;

3. Distributed: Algorithms where each agent communicates with its neighbours,


but there is not a centralized controller;

4. Decentralized: Purely local algorithms, i.e. no communication between

agents.

44
2.3 Optimization Theory

We now shift the discussion to the mathematical formulation of the resource coordi-

nation problem. The concept of optimization is quite simple: find the minimum of

a function within a certain area. Consider a 2-dimensional plane. We want to find

the minimum value of some curve within, say, a known box. The curve represents a

cost function. The box is represented by a set of equations. Extending this visual

in n-dimensions, the 'box' is now an n-dimensional surface with 'flat' surfaces; this is

called a polytope. The set of equations describing the boundaries are the constraints.
The function to be minimized is the objective. From these, an optimization problem

is formed, where the objective function is minimized subject to a set of constraints.

min f(x) (2.32)


XERn

s.t. g(x) = 0 (2.33)

h(x) > 0 (2.34)

2.3.1 Duality

In the idea of duality, the constraints in the optimization problem are penalized by way

of an indicator function of sorts, to render an unconstrained optimization problem.

Each constraint ax = b is penalized as A(ax - b), where A is the Lagrange multiplier

corresponding to the constraint. A simple indicator function is a linear penalty of

scalar A is used, whereby A -+ o when the constraint is not satisfied. Then for an
objective function of f(x) which we are trying to minimize, the Lagrangian is the fol-

lowing: L(x, A) = f(x)+ A(ax - b). Then the set of points which satisfy the feasibility
requirements can be found as J(x) = maxA £(x, A). However, what we really wanted

was to minimize the objective function (and also thereby the Lagrangian), so the

optimal solution would be for the following problem: min- maxA £(x, A). However,
the min-max problem is challenging to solve, but can be converted into a max-min

problem by simply reversing the order of operations. Then, the resulting maximiza-

tion problem of maxA mint £(x, A) = maxA g(A), where g(A) = minx C(x, A) is the

45
dual problem. The Lagrange multipliers A are also called the dual variables, and are

determined from the dual problem, as well as the optimality conditions discussed in

the next section. The dual problem gives the tightest upper bound for a minimiza-

tion problem (equivalently tightest lower bound for a maximization problem). For

the solution p* and d* as the optima for the primal and dual problems respectively,

the optimality duality gap is defined as p* - d*.

2.3.2 Optimality Conditions

Returning to the 2-dimensional case, consider a general curve which has some min-

imum and maximum points. From basic calculus principles, we know the slope of

the line describes the rate of change of the function, described by the first derivative

of the function, d. We know the derivative is zero when at an extreme point - this

includes both minima, maxima, and saddle points. To differentiate between these

points, we consider the curvature of the line, described by the second derivate of

the function, d. The simplest case is the saddle point, where the curvature of the

line does not change, thus m = 0. For a minimum point, the curvature is positive,

> 0, and for a maximum point, the curvature is negative, 4 < 0. Extending

to n-dimensions, the first and second derivates are the gradient and hessian of the

function, respectively, and are defined as below:

Gradient Hessian

f (x) :R"' R f (x) :R" -+ R

&X1 j DX 1XVX 2 ' Oxiaxn


2
Vf = ... V f ... ... ...

II
2
-O _ 2 ° .2
.

L4Xn L9xnt9xi aXnOX2 .. 092


-

Further, for a general curve, we also consider local and global extreme points.

A local minimum, x*, is defined as the minimum of the function within a ball of

some finite radius r: f(x*) < f(x) Vx E Br>o(x*). A global minimum extends

this definition to a ball of infinite radius, whereby f(x*) <= f(x) Vx E R'. We

46
will return to the notions of global and local optimality in the section on Convex

Optimization.

For an unconstrained problem, the minimum is described as:

Necessary Condition: Vf(x) = 0, V 2f(x) >- 0

Sufficient Condition: Vf(x) = 0, V 2 f(x) >- 0

For a constrained problem as in (2.32), the minimum points obtained by the

relations above may no long be valid within the feasible polytope. As such, new

relations are needed to determine optimality of a point. These are known as the
Karush-Kuhn-Tucker (KKT) optimality conditions, and are shown below in (2.35).

Here we take a geometric approach to reaching the KKT conditions, and introducing

the Lagrangian function (which is defined in (2.35a)). In order to do so, we need some

additional terminology and concepts around level sets, and make use of the gradient

vector.

L(x, p, A) f(x) - pigi(x) - Aihi(x) (2.35a)


i=1 i=1

VxL(x, y, A) = 0 (2.35b)

V,,L(x, p) = 0 -+ -gi(x) = 0, (2.35c)

hi(x) > 0, i = 1, ... , nh (2.35d)

Ai > 0 (2.35e)

Aihi(z) = 0, i = 1,-.., nh (2.35f)

Level Sets

A level set, or contour of a function, is a set describing all points of function f(x)

where the function takes on a constant value c. Similarly a sub-level and supper-level

sets describe the inequality conditions, where the function takes on values less than

47
or greater than the constant c:

Level set : {x E R' : f (x) = c} (2.36)

Sub-level set: {x E Rn : f(x) ; c} (2.37)

Supper-level set : {x E Rn : f(x) > c} (2.38)

The gradient vector for any point on the level surface is perpendicular to the

surface. This falls simply from multivariable calculus, by looking at the dot product

of the gradient vector evaluated at a point on the surface, and a curve on the level

surface. Further, the gradient vector points in the direction of steepest ascent; thus

starting at point P, the direction of Vf(P) indicates which direction to follow to

increase f(x).

Consider two functions, f(x) : R" -+ R and g(x) : R" -+ R, with level sets

{x E R" : f(x) = ci} and {x E Rn : g(x) = c2 }. Consider the point where these

two level sets intersect, in particular, where they are tangent to each other, at point

x*. At this point, the gradient vectors for the two functions (which are tangent

to the level sets) are perpendicular to each other. Thus, they can be related as

Vf(x*) = pVg(x*), where pu is a nonzero constant.

Optimality: Equality Constraints

Consider the optimization problem with equality constraints:

min f(x) (2.39)


xER"

s.t. g(x) = 0 (2.40)

The equality constraints represent level sets. Points where these level sets are tangent

to the level sets of the function f(x) represent the minimum and maximum points. For

any other point where the constraint level set intersects with the level sets of f(x), the

negative gradient of f(x), -Vf(x) points in the direction of steepest descent, which

when followed, will eventually lead to another intersection point with the constraint

48
level sets. Thus, the tangency points indicate the maximum and minimum points.

From this, the necessary conditions for optimality can be written out, as in (2.41).

Note that these are no sufficient conditions, as these will give both minimum and

maximum points of the function.

L(x, pL) = f (x) - pg(x) (2.41a)

V,L(x, p) 0 -- Vf(x) =pVg(x) (2.41b)

V,,L(x, p) = 0 -+ -g(x) 0 (2.41c)

Optimality: Inequality Constraints

Consider the optimization problem with inequality constraints:

min f(x) (2.42)


XERn

s.t. h(x) > 0 (2.43)

The equality constraints represent supper-level sets. In this problem, the uncon-
strained optimal point can exist outside (or on the boundary) of the the feasible

region, or lies within the feasible region. These two cases are similar to the equality

constrained problem and the unconstrained problem respectively. Considering Case

A, where the unconstrained optimal point lies outside of the feasible set, the extreme

point must lie on the boundary of the supper-level set. Thus, the extreme point
occurs at the tangent point between the two level sets, {x E R" : f(x) = ci} and

{x E R" : h(x) = c 2 , c 2 > 0}. More specifically, Vf(x) points in the same direc-
tion as Vg(x) as the steepest ascent directions will be the same - the unconstrained

minima lies outside of the feasible region, so the function is increasing in the same

space where function g(x) is increasing. In this case, the optimality conditions are the

same as with the equality constraints, with an additional constraint requiring A > 0,

to describe that both gradients point in the same direction. Thus for Case A, the

49
necessary conditions for optimality are described by (2.44).

L(x, A) = f(x) - Ah(x) (2.44a)

V,L(x, A) = 0 -+ Vf(x) = AVh(x) (2.44b)

VA L(x, A) = 0 -+h(x) =0 (2.44c)

A >0 (2.44d)

Considering Case B, the unconstrained minimum lies within the feasible region - the

unconstrained minimum is the same as the constrained minimum. We can then treat

the problem as an unconstrained optimization problem, where we simply require the

first order condition that the gradient is zero. Recalling the level sets of the functions,

we then have no requirement on the two gradients being parallel. Thus for Case B,

the necessary conditions for optimality are described by (2.45).

L(x, A) = f(x) - Ah(x) (2.45a)

V,L(x, A) = 0 -+ Vf(x) = AVh(x) = 0 (2.45b)

VA L(x, A) > 0 -+ h(x) > 0 (2.45c)

A= 0 (2.45d)

Then combining the two cases, the necessary conditions for optimality in an inequality

constrained problem are described by (2.46).

L(x, A) = f(x) - Ah(x) (2.46a)

V.L(x, A) = 0 - Vf(x) = AVh(x) (2.46b)

VAL(x, A) > 0 - h(x) 0 (2.46c)

A >0 (2.46d)

Ah(x) = 0 (2.46e)

50
5,

4 4

33
2 3

-0.5 -0.5

Figure 2-8: Image of nonconvex and convex surfaces, left and right respectively.
Local/global minima are indicated with yellow stars, and the initial started point for
the algorithm is indicated with yellow dots.

2.3.3 Convex Optimization

Convex optimization is a subset of nonlinear optimization, where the objective func-

tion is a convex function and the feasible set is a convex set. In convex optimization,

there is a unique minimum, meaning there is only one minimum point which is both

local and global. This is unlike most nonlinear problems, where the function has many

local minima, and the point reached through and optimization algorithm is sensitive

to the initial condition. This is shown in Fig. 2-8, where the function on the right has
a global minimum which is guaranteed to be reached regardless of the starting point.

Convex Sets and Functions

A convex set is a set in which the line connecting any two given points within the

set, is entirely within the set. Consider a convex set C, where Vx1 , x 2 E C, the linear

combination of these two points also lies within the set: Ox 1 + (1 - )x 2 E C, 9 E [0, 1],

as shown in Fig. 2-9.

A convex function f : R' -+ R is convex if the domain of f is a convex set and the

line connecting two points on the function lies above the function: f(6x 1 +(1-6)x 2) <

Of(x 1 ) + (1 - 6)f(x 2 ), VXi, x 2 E domf, 0 E [0, 1]. Note that the sum of two convex

51
I1

Figure 2-9: Image of convex (left) and nonconvex (right) sets.

functions is also convex, and the negative of a convex function is a concave function.
Common convex functions include:

1. Affine: aTx + b for a,b E Rn

2. Powers: x' for a > 1 or a < 0 on R++

3. Exponentials: eax for a E R

4. Absolute value powers: |xtP for p > 1

5. Logarithms of form x log x on R++

6. Norms: ||x||, for p 1

52
Chapter 3

Optimal Power Flow for Meshed and


Unbalanced Grids: Solutions with
Distributed Optimization

The optimal power flow problem looks to find the operating levels for energy resources

so that supply meets demand, while minimizing some cost. Typically this problem is

solved by a central agent, such as a grid operator, which looks to minimize operating

costs of electric power plants and transmission costs, while ensuring that supply

equals demand. Note however, that the objective function need not be operating
costs - the objective could be to maintain voltages around desired setpoints (Volt-

VAr control), to minimize thermal losses in the network, or to minimize deviation

from a predetermined schedule.

The full AC formulation of the OPF problem is very challenging to solve. The

power flow equations are nonlinear and nonconvex functions which model the flow of
electricity throughout the network. Further, security constrained unit commitment

(SCUC) problems also use integer variables to help decide which generators will par-

ticipate in electricity production over a period of time. This introduces additional

integer constraints, resulting in a mixed-integer nonlinear program (MINLP) which

are even more challenging to solve. To further complicate matters, real operation re-

quires the OPF problem to be solved for the full distribution system every 5 minutes,

53
to ensure demand is met. Because of these challenges, many different approaches to

solving OPF is taken. Many approaches look to linearize the power flow equations

by making small angle assumptions - this is referred to as DC OPF. However, this

assumption breaks down in the distribution grid where voltage angles are not close to

one another. Other approaches use heuristics to solve the OPF problem, and others

use assumptions which may result in results which are not physically implementable.

This problem is exacerbated in the distribution grid where the physics of the lines

prevent the DC approximations from being made. Further, there is an increasing pen-

etration of DERs including solar PV, storage devices such as batteries, and demand
response, which can all be utilized to provide services to the grid; however, the chal-

lenge of solving the OPF simply grows as the number of participating devices grows.

A more detailed model is required to appropriately utilize these resources, but makes

the problem computationally intractable, especially for solving every 5 minutes.

This suggests the need for distributed computation, where multiple computing

agents can be utilized to solve the OPF problem. This is discussed briefly in the next

section. We also need accurate models of the power physics of the distribution grid,

which retain the physical constraints of the system while enabling better computation

and guaranteed global optimality. A convex formulation which is well conditioned is


desired. These are the focus of this chapter.

3.1 Notation for Power System Model

In this section we introduce the common formulations for power flow in AC grids. We

begin with the nonlinear branch flow (BF) model, then discuss the proposed current

injection (CI) model. We consider distribution grids with radial or meshed topologies

that can be represented as a directed graph rD = (B,TD), where B represents the

graph vertices and TD the graph directed edges denoted as (i,j) where i < j. For a

node j, the set of parent node(s) are i c {ij}V(i,j) E TD, and the set of child nodes

are k E {kj}V(j,k) E TD.


Consider Fig. 3-1 which depicts a simple 4-bus radial network. We will model both

54
P2 3,Q23 123 V3

1Z12 2 P3, Q3

V4
P1, Q1 P2,0Q2 4
P24 ;Q24-, 124

Figure 3-1: Example network

nodal and line power flow quantities, which are shown in blue and red respectively.
The nodal quantities are the real and reactive power injection (Pj, Qj) and the voltage
at the node (V), where we denote vj = I 1V2. The line quantities for a line (j, k) E TD
are the power flows through the line (Pk, Qik), and the current through the line (Ijk),
where we denote ljk = |Ijk|2. These quantities will be used in the models as we move
forward. Any additional terms will be defined as they arise.

3.2 Branch Flow Model

The branch flow model applies to primarily radial balanced networks, using branch
variables derived from Kirchhoff's laws to describe the power flow relationships. The
model leverages two relaxations to arrive at a convex formulation which can be readily
solved by commercial optimization solvers [5, 6]. The angle relaxation applies to
Ohm's law V - Vi = ZuIU, and assumes small angles and balanced flows to yield (3.1).
In this step we also change our variable space to use vj, lU (the squared magnitude of
the voltage and current) instead of V, IU. The second relaxation is to convexify (3.4)
in the form of a second-order cone (SOC) constraint, which yields (3.5). Then (3.1)-
(3.3) and (3.5) define the convex power flow relationships known as the BF model,

55
which can now be used within an OPF problem.

vj - vi = (R + X )lij - 2(RijPij + X (3.1)

Pi = Rijlij - P + E Pjk (3.2)


kE{kj}

Qu = Xulu - QJ + Z
kE{kj}
Qjk (3.3)

Pij + Q = Vilij (3.4)

pij + Ql < vilij (3.5)

3.2.1 Limitations of Branch Flow model

The main limitations of the branch flow model are the requirements on the topology
and structure of the grid. First, the grid must have a radial topology. There are
proposed convexifications for meshed networks under the BF model, but these com-
plicate the formulation and increase the size of the problem, by adding additional
variables. Second, the grid must be balanced. There are proposed techniques to use
BF for unbalanced networks, but they apply only to networks with limited degree of
unbalances. In [24] and [25] the authors model an unbalanced distribution network
and modify the BF model by assuming that the reciprocal unbalance of the phases are
small. This implies that the relative difference between the angles of each phase are
ignored, which is not a valid assumption in most distribution grids where the system
is highly unbalanced, and many single- and two-phase lines and/or loads exist.

Further, the BF model restricts the total amount of power injections to ensure
an exact convex relaxation. In other words, there is a limit on how active a network
can be, and the total DG and storage penetration. Note however, that this is a
mild condition for most networks, and can be determined a priori, with knowledge of
the network and operating limits. This is condition C1 and Theorem 4 in [7]. The
condition C1 depends only on the line parameters (Rij, Xij), the upper power injection
bounds (Pj, Qj), and the lower voltage bound (vU). The physical interpretation of
this constraint is to limit the reverse power flows in the network: if power loss across a

56
line is reduced, upstream reverse power flows will increase. The power loss on a line is

reduced when the current is reduced, to the extreme where power flow reverses on the

line. Note however that from case studies in [71, C1 is shown to be a mild condition,

even for networks with high penetration of DGs. Further details and conditions under

which C1 is met can be found in 171.

3.3 Current Injection Model

To overcome the limitations of the BF model for distribution grid, a new convex model

is proposed. The Current Injection (CI) model which leverages McCormick envelopes

(MCE) [26] as the convex relaxation for the bilinear form of the power terms - recall

power is a bilinear function of the current and voltages.

Consider the example network shown in Fig. 3-2, consisting of N nodes. We

consider a segment of nodes i,j and k, which is radial and single-phase for simplicity

1. By applying Kirchhoff's Current Law (KCL) and Ohm's Law at node j, we obtain

(3.6) and (3.7)-(3.8) respectively.

Ij + Iij - Ijk =0 (3.6)


V - V-:
1 = Zi.=Yi(Vi V) (3.7)

V - Vk
Ija = Z = Yjk(V -kg (3.8)
Zjk

where Zij = Rij + jXij is the impendance and Yij = -- is the admittance between

nodes i and j 2. Note that all variables here can be complex numbers (namely X # 0).

'Note that the CI model does not require radial and single-phase balanced networks. Rather, the
benefit of the CI model is its applicability to networks of any topology and to unbalanced multi-phase
networks as found in distribution grids.
2
The imaginary number 'j' is not to be confused with the subscript j indicating the node. Note
also that the convention for using 'j' to denote the imaginary part of the complex number as done
in electrical engineering is used here, as opposed to the mathematical convention of using 'i'.

57
I

V1 V VV Vn

1 •••• i Zij j Zjk k ••••a n

Iin

Figure 3-2: Example network

The nodal current injections and voltages can then be related, as follows:

Ij = Ijk - Ii (3.9)

= Yjk(Vj - Vk) - Yij(Vi - V) (3.10)

= Vj(Yjk + YU) - ViYu - Vjk (3.11)

This equation can be rewritten in matrix form as:

j-Yj +Yi + Yj -
k k [Yj i Vi-

(3.12)

Similar equations can be written for every node in the network, with the nodal current

injections and voltages being related by the network admittance bus matrix, Y, which

is constructed as:

Y Ek=l,..,Nik if i (3.13)
- YU if i| j

where Yik / 0 only where a line exists between nodes i and k. Then, the relationship

is I = YV. This is the typical model used in power flow analysis.

We can also calculate the power injection at the nodes as below, noting that

the complex power (apparent power) is composed of the real and reactive power

58
components:

Sj= * = (V I +V7Ii) +j(-VJ +VI) (3.14)

P j(VI Vj) (3.15)

Qj (--Vri + Vijj) (3.16)

where the superscripts r and i denote the real and imaginary components, respec-

tively; the rectangular form here makes it very easy to manipulate the terms.

We can easily make the extension to three-phase systems. The fundamental equa-

tions stay the same, but now the nodal and line variables can be extended to 3-element

vectors, and the admittances Yij now become matrices Yij c R 3 x 3 . The diagonal el-

ements of Yj represent the resistance and inductance of the line (as before), while

the off-diagonal terms represent the coupling between lines resulting from the electro-

magnetic interactions between the lines which are in close proximity to one another.

Further, the admittance line matrices are symmetric, so knowing the upper triangu-

lar (or equivalently lower triangular) components fully characterize the matrix. The

network admittance bus matrix is then Y E RI3Nx3N where N is the number of nodes
in the network.

Moving forward, we generally assume that all the vectors are column vectors

composed of the real and reactive components of all phases. When a specific line

does not exist (for example a 2-phase line) the variable will simply be 0.

59
Statement of the CI Model

Using the above, we can formulate the OPF problem as in (3.17)-(3.26).

min f(y)
Y
s.t. I = YV (3.17)

I = IT + j II Vj E [N] (3.18)

V = VT + j V Vj E [N] (3.19)

+ V II
Pj-=Vj I -jJ Vj C [N] (3.20)

QI -V I +JVIi Vj E [N] (3.21)

V< V VI Vj c [N] (3.22)

Vj E [N], j / j# (3.23)

P < P< Vj E [N] (3.24)

Q < QJ < Q Vj E [N] (3.25)

Vr =1, V =0 (3.26)

where Ij = If+ jIj, Vj = Vr + jV , and I, V, P, Q are column vectors of all the nodal
currents, voltages, real power, and reactive power injections respectively. Specifi-

cally, (3.17)-(3.21) describe the power physics, and (3.22)-(3.25) describe the limits
on nodal voltages, and real and reactive power injections. Finally, (3.26) describes
the slack bus, denoted as node j#, which is the point of common coupling (PCC)

of the distribution grid to the transmission grid (i.e. the substation). Note that a
load will have j = Qj = 0, while a generator will have Pj = 0, as the convention for

power/current injection being positive is used.

Relaxed CI Model

Note that until now, there have been no approximations or assumptions made. We've

been using the definitions and power relationships to describe the power flow in the

network. While the OPF problem in (3.17)-(3.26) fully describes the network, the

60
constraints in (3.20)-(3.21) render the problem nonconvex. This is challenging from

an optimization point of view, there is no guarantee for global optimality. Different

approaches can be taken to address this, including linearized approaches, approxi-


mations, and convex relaxations. Here we use the latter. The bilinear terms in the

constraints can be relaxed using McCormick Envelopes (MCE) [27], which provides a

lower bound on the original nonconvex problem. Tighter MCE bounds will produce

tighter lower bounds (thus closest to optimal), and will also decrease computation

time as the solution space is restricted. For a general bilinear form w = xy defined

over a set S c R3 = {x, y : x E [1, ], y E [y, V]}, the MCE convex relaxation is as

follows:

w >2 y + zy - xy (3.27)

w > Ty + xY - Xj (3.28)

w < zy + xF - fy (3.29)

w 5Ty + zy - Ty (3.30)

The (3.20)-(3.21) consist of four bilinear terms, requiring the introduction of four

new variables per node per phase, a, b, c, d which will then replace each term. This

relaxation also requires the introduction of current bounds. The calculation of the

tightest current bound is outside the scope of this thesis, but a possible technique to

recover current limits is presented in the following section.

The relaxed CI model is then formulated as a relaxed OPF as in the problem

61
formed with constraints (3.31)-(3.36).

min f(y)
y

s.t. (3.17), (3.22)-(3.26) (3.31)

Pj = aj + bj Vj E [N] (3.32)

Qj = -cj + dj Vj E [N] (3.33)

Vj E [N] (3.34)

I <I < Vj E [N] (3.35)

MCE bounds for aj, bj, cj, dj of form (3.27)-(3.30) Vj E [N] (3.36)

3.3.1 Current Limits

In order to apply the MCE convexification to the bilinear terms of the power flow

model, we require bounds on the current injection at the nodes. A simple set of

nonlinear optimization problems can be setup to determine upper and lower bounds

for the real and imaginary components of the current injection. For brevity, the

optimization problem is formulated for If, for a single phase. The same problem

must be solved for j, Ij, If, for each phase.

max Ei
il

s.t. =j Vrir + V I; (3.37)

(3.38)

S~ p (3.39)

(3.40)
QJ - Ji:- Ji
Q Pivrn vi (3.41)

(3.42)

For a general 3-phase network with N nodes, this small nonlinear problem must

62
be solved 3 x N x 4 times, for the 4 current bounds per node per phase. While

each nonlinear problem is very small and can be solved quite efficiently with a solver

such as Ipopt 128], the processing for a small network of 100 nodes required 1200
problems to be solved. This is a large computational burden, and can be time-

consuming, especially in real-time applications where power injection forecasts are

regularly updated. Further analysis of these problems and development of heuristic

methods to improve current bounds are outside the scope of this thesis. More details

can be found in 129].

3.4 Distributed Optimization

As discussed in Chapter 2, the resource coordination and scheduling problem for

the distribution grid under high DER penetration is a challenging problem. We can

however, leverage distributed computational devices, which may be located at every

DER location or shared amongst some smaller DERs. In order to do so, a distributed

algorithm is needed to ensure global optimality is reached while using only local

information and limited information exchange between computational agents in the

network.

This section provides a brief introduction to the distributed optimization algo-

rithm used in this thesis. It is based on proximal atomic coordination (PAC). For

more detailed information of the construction of the algorithm and proof of conver-

gence, please refer to [20, 21].

Distributed algorithms take a global (or centralized) problem as in (3.43)-(3.45),

and employ different techniques to break this into smaller problems. In the global

problem, y denotes the global decision vector, y, denotes the components of the deci-

sion vector owned by agent j, and matrices G and H correspond to the global equality

and inequality constraint matrices respectively. Smaller optimization problems are

typically easier to solve than those with more variables and constraints, especially

63
when dealing with nonlinear problems and/or integer constraints.

min f(yi) (3.43)


Y

s.t. Gy = 0 (3.44)

Hy > 0 (3.45)

Often, these smaller problems can be solved concurrently, thus reducing computa-

tional time. When designed well, distributed algorithms can reduce communication

requirements as all agents are not required to communicate with a single central en-

tity. They can also be robust to various modes of failure as all computations are

not dependent on a single point. Finally, if designed well, they can also be privacy

preserving; agents do not have to disclose their cost functions, operating constraints,

or sensitivity to setpoints with other agents. These motivate the use of distributed

algorithms for a wide range of applications, especially for machine learning (fast com-

putation), Internet of Things (IoT) applications (multiple coordinated agents), and

market applications (privacy is fundamental).

3.4.1 Atomic Decomposition

Some distributed algorithms require the global problem to be fully decomposable,


in that the objective function and constraints of each agent depend only on those

variables owned by the agent. This can limit the applicability of the algorithm on

different problems, or limits the number of agents which can be utilized. In compar-

ison, the PAC algorithm does not have this requirement. Instead, coupling between

agents is handled by agent j creating an estimate of the variables owned by agent

i, which agent j also depends on; these estimates are termed as "copies". With the

introduction of these new variables, we also required new constraints to ensure that

the copies converge to the actual variable value. The inter-agent dependencies are

depicted in Fig. 3-3. The matrix graph on the left shows each agent numbered 1 thru
4, with the coloured blocks indicating a dependence on that variable; specifically, the

64
black blocks indicate owned variables, while the grey blocks indicated inter-agent de-
pendencies. We can then distribute the problem into "atoms", noting that PAC does
not require a one-to-one mapping of agents to atoms. Here, we distribute amongst
three atoms labelled A, B, and C, with colour coordination showing ownership of
variables in blue, orange, and purple respectively. Finally, the cross-colours indicate
a variable copy, which is required because of the inter-atomic dependency.

1 2 3 4
234
A 'B C
t1 74Ij.
A
B
1 A
2 Atomize B

3 C
4 L; I CB

= Atom has estimate of Neighbour

Figure 3-3: Pictorial description of the atomization, and the use of variable copies in
PAC. The diagram also stresses that a one-to-one mapping of agents to atoms is not
required.

The complete atomic optimization problem can be written as in (3.46)-(3.49). In


this formulation, aj denotes the atomic decision vector for agent j, and is composed
of both the variables owned by atom j and those copied to satisfy the dependencies
on other atoms. The vector a denotes the vertical concatenation of all aj vectors.
Matrices Oj and Hj correspond to the submatrices of G and H which correspond to
the rows and columns pertinent to atom j. The global distributed equality matrix
0 is a block diagonal matrix composed of the individual Gj matrices. Finally, the
constraint in (3.49) describes the new coordination constraints added to ensure for a
variable x owned by atom i and copied by atom j, that zV -xi = 0 where the subscript
denotes the owner of the variable, and the superscript (where present) denotes the
atom who is copying the variable. Matrix B is the complete coordination matrix,
which takes on the form of an adjacency matrix, while the notation Bj,_ denotes the

65
rows belonging to the coupling variables for atom j.

min f (a) (3.46)

s.t. O aj = 0 Vj (3.47)
H aj > 0 Vj (3.48)

B ,_ aj > 0 Vj (3.49)

The complete decomposition profile can be found in [20,21].

3.4.2 Statement of the PAC Algorithm

The Proximal Atomic Coordination (PAC) algorithm is a variant of the prox-linear


algorithm, and adopts ideas for distributed optimization from distributed Alternating
Method of Multipliers (dADMM), namely the addition of the coordination problem.
PAC enjoys linear convergence, with a rate of o(1/T) [20,211. See Appendix A.1 for
a summary of the design of the algorithm. Detailed analysis is in [20,21].

The algorithm is stated as below:

aj [T + 1] = argminj { (aj, f [T] , V [T] ; aj [T])} (3.50)

pi [T + 1] = pj [T] + -pyjjaj[T + 1] (3.51)

#3 [T + 1] = pj [T + 1]+ pj jaj [T +1] (3.52)


Communicate {aj} to neighbours (3.53)
vj [-r + 1] = vj [r] + pyjBj,_a[T + 1] (3.54)

LDj [r + 1] = vj [-T+ 1] + pijBj,_ a [rT+ 1] . (3.55)


Communicate {i'j} to neighbours (3.56)

In the above, p > 0 is the step-size and gj, 'j > 0 are two over-relaxation terms with
-/j > ij. As shown in [20, 21] and summarized in Appendix A.2, the primal variables
a, and dual variables tt and v converge to the optimal solution a*, p*, and v*. A

66
key feature of the PAC algorithm is its privacy preserving structure; specifically, the

atomic objective functions, constraints, and dual variables (both pi and v, which act

as shadow prices describing the atom's sensitivity to the feasibility and coordination

constraints) are all kept private. This is discussed in more detail in [20], and the

interpretation of the dual variables in the context of a market is discussed in this

thesis in Chapter 5, as well as [22].

The convergence results of the distributed PAC algorithm can be measured using
the following two metrics, as evaluated at each iteration r:

" Distance to Feasibility: 1a [r] . This metric describes the feasibility gap of
the solution (whether power flow equations are satisfied).

• Distance to Consistency: ||Ba [r]112. This metric describes how far the variable

copies are from their true values. This can also be thought of as distance
to coordination. Recall the variable copies were introduced to distribute the

problem.

3.4.3 Distributed Optimization with CI Model

With the CI model introduced in the previous section, we can now move on to discuss

the application of the PAC algorithm to solve the CI formulation of the OPF. We

begin first by assuming the objective function is convex. This is, in general, a very
reasonable assumption as costs typically follow a squared law (and so are convex).

Note that we do not require the objective function to be separable amongst the

nodes; this is because the decomposition profile for PAC details how to address the

coupling variables between atoms, and atoms are already coupled within the power

flow constraints. The centralized problem as introduced in (3.31)-(3.36) has variables

as follows:

I Vr V' P Q a b c d] (3.57)
y=[

67
where each term in the vector y is of the form:

Ir= [I[] Vj E [N] (3.58)

i [j,a j, 'I ,c] (3.59)

where the superscripts r and i denote real and imaginary components respectively,

the subscript j denotes the node, and the subscripts a, b, c denote the phases. The

same follows for all other terms in y. The atomic vector, aj then takes on the form

of (3.60), where the last term are the coupling variables denoted by the symbol.

a = [I Ij Vjy Vj Pj Qj aj bj cd {ZV, j}vk,{(,k),(k,j)}eT] (3.60)

The OPF problem can be solved for voltage regulation, whereby the objective is

to regulate the real and imaginary components of the voltages about some desired

reference value. The objective function can be written as follows:

f(y) =
[(V,
- j)2 + (Vi - N?) 2] (3.61)
jc[N] pEa,b,c

where Zr and V? are the desired setpoints. In the rest of this section, Vr and Z.?
are the same for all nodes in the network; we note that node j# which is the point

of common coupling (PCC) to the transmission grid is treated as a slack node, with

Vg. = 1 and 1 = 0, Vp E a, b, c. This 'slack bus' is the boundary condition which

allows us to uniquely determine power flows in the network for given nodal injections.

Simulations & Computational Setup

The OPF problem is run with different power flow models in the day-ahead and

real-time energy markets, for both scheduling and real-time operations. As such,
the computational setup must be efficient enough to run in real-time. Figure 3-4

describes the workflow as implemented in this work. The General Model is the PAC

decomposition of a specific network. This can be run when setting up the operations

68
to make use of the CI model and PAC algorithm, and only needs to be re-run if the
network topology or participating DER agents are changed.
The next set of steps is the integration of Scenario Specific Data, which must be
re-run for every run of the PAC algorithm. This means these steps must be run once
for every day-ahead OPF problem, and run every 5 minutes 3 for a real-time OPF

solution. Before these steps are run, the forecast for demand and generation must be
updated. For real-time operation, the forecasts for period r+ 1 can be developed while
the PAC algorithm is solving the OPF for period w. Once forecasts are generated, the
Scenario Specific Data can be integrated; thus, if the forecasts are ready before the
PAC solution for period T is completed, the problem can be setup for period T + 1,
giving more time for the PAC algorithm to converge for period T + 1. Note that the

function setup only needs to be rerun if any changed variable bounds or item costs
are present in the objective function.
The final step before running the PAC algorithm is the PAC setup, which includes
determining the optimal PAC step sizes (p and -/j), and the initial conditions for the
algorithm. Note that for most networks and scenarios, the PAC parameters are the
same; thus in real implementation, this step can be run with the General Model and
values saved. Finally, the initial conditions can be either computed to an estimated
optimal point, fixed at some values relative to the upper and lower bounds of the
variables, or for real-time operations, set to be the optimal solution from the previous
period.
Finally, the PAC algorithm must be run in parallel over multiple cores or worksta-
tions to mimic the distributed nature of the algorithm. Note that the implementation
for this thesis is in MATLAB, where only limited functionalities are present for par-
allelizing code, as MATLAB readily makes use of all cores in a machine. An imple-
mentation in Python, as a comparison, would enable separate computational agents
to be formed, which could each use data pipes to selectively share information. For
the scope of this thesis, a parf or loop is used to parallelize the primal update across
3
The 5 minute market clearing for the real-time market is for the New England ISO (ISO-NE).
This can vary from 15 minutes to 5 minutes, depending on the market structure within a given ISO
or RTO.

69
the computational agents. Once the primal update - which consists of solving the
atomic OPF for the kth iteration - is complete, the dual variables are updated in a
centralized manner. Note that this is not a limitation of the PAC algorithm, but
rather a design choice to simplify the implementation.

Scenario Specific Data


General Model _ _ Forecasted Generation and Load, Demand Response capabilities

Grid Network Gnerate Model Problem Setup PFe-Pnroil nsh Setup Function Setup
Topology+Une Admittance Provide variable lighten bounds on bud on Generate
configurations matrix, PAC limits, cost MCE usIngvariable Geneal Model atomized
decomposition parameters bounds objective function

PAC
1: Update primal Palculae oer
cores/1Work1lstatons
OPF Solution
(KIh Iteration) Aggregate& Calculate PAC Setup
Update duals j: Update primal Price PAC parameters,
Predictions Initial conditions

N: Update primal

Rpe or K Rwagons

Figure 3-4: Flowchart of the computational process. The PAC algorithm decomposi-
tion is fixed for a network with a given topology. The scenario or time-period specific
updates must be run each time the PAC algorithm is run.

For simulations in Chapters 3-4, the following computational tools are used:

* All simulations are carried out in MATLAB 130].

" General Model: the global optimization problem with the CI model is setup
using the YALMIP package, which takes a set of objective functions and con-
straints, and maps them into a format acceptable by a third-party solver [31].

• Pre-processing: the current bounds are obtained by solving the set of nonlinear
optimization problems using Ipopt, a nonlinear solver, within the OPTI package.

" PAC Setup: each atomic optimization problem is setup using the YALMIP
package, which formats the objective function and constraints into a format
acceptable by the Gurobi commercial optimization solver [32]. For each iteration

70
of the PAC algorithm, the augmented Lagrangian is updated with the new
predictions of the dual variables.

• PAC Primal Update: the primal problem is solved directly in Gurobi.

Results from CI Model

The proposed CI model is solved using the PAC decomposition profile and algorithm.
The simulation results for the IEEE 13 node network, which has been modified to

include DERs (see Appendix B.2 for data), is shown in Fig. 3-5. The convergence

metrics of Distance to Feasibility and Consistency are plotted.

From the convergence trajectory, we see that the algorithm takes an unreason-

ably long time to approach the optimal solution. In particular, the dual problem of

consistency is very slow. The step sizes (p, -y) are very small, as shown in Table 3.1.

These can be attributed to the ill-conditioned system matrix dT0 +BTB, which has

a very high condition number and Am.

a= 1 - = 3.4701e - 4 Condition number: 2.505e7


L = 12.1696 p = 0.2867 Amax = 3.5070e + 4

Table 3.1: Parameters for PAC algorithm for the Active IEEE 13 node network, using
the CI model.

3.5 Reformulation of CI Model

The results from the previous section show unacceptable performance of the PAC

algorithm on the proposed CI model due to the ill-conditioned system matrix. There

are various approaches to dealing with ill-conditioned systems, however, the source

should first be investigated. In this section, the CI model is reformulated to result

in better system conditioning and performance for the PAC algorithm. Then, a

comparison of the two formulations is presented, where the eigenvalues of the system

matrix are analyzed.

71
Distance to Feasibility

-10-----

0itiet egblt

o 1000) 200X0 3000 400X0 5000 61000 7000I Mo 9000 B 0)


(a) Feasibility Metric
Distance to Consistev

0.4

0.3

0.1

0 10 20 3 4000 >00 6000 700 0 8 0000 100

(b) Consistency Metric

Figure 3-5: Convergence results for the IEEE 13 node network, modified to have
DERs.

3.5.1 Source of Ill-Conditioning and Reformulation

In this problem formulation, the modelling choices are the source of ill-conditioning,
particularly in the I = YV constraint. The other constraints are simply definitions
with unity coefficients; further all the variables are bounded on the order of 1, be-
cause we are dealing with per unit analysis of the electrical quantities. However, the
admittance per length are all on the order of 0.1, leading to larger coefficients once
the line length and per unit conversion are accounted for.
The first possibility is to reformulate the CI model ' to use the line impedances,
4
Hereby called CI-Y to indicate the CI model formulated using admittances, or CI-Z to indicate

72
rather than the admittances. Lets return to (3.6)-(3.8). Here we have KCL giving the

relationship between nodal injections and line flows, and Ohm's law relating the nodal

voltages to line flows. In our case, however, we want to stay in the realm of impedances

and not move towards the cleaner representation we get from admittances. We can

now define the graph incidence matrix, A. In this case, we define the outgoing edge

as positive and incoming edge as negative. Then, if we assemble the diagonal matrix

of line impedances, Z, and denote the vector of line currents as flow and the vector

of voltages as V, we can rewrite Ohm's law and KCL as:

AV = ZInow (3.62)

I = ATIoflw (3.63)

where the column vector I is the nodal current injections.

Then under this new model, we can rewrite the CI model using impedances (CI-Z)

as follows:

the CI model formulated using impedances.

73
min f(y)
y

s.t. I = ATIafoW (3.64)

AV = ZIfow (3.65)

I= If + jI Vj C [N] (3.66)

V =Vr + jVi Vj E [N] (3.67)

P = aj + bj Vj E [N] (3.68)

Qj = -cj + dj Vj E [N] (3.69)

Vj E [N] (3.70)
I <R
I I- J Vj E [N] (3.71)

P <P <P Vj [N), j fj# (3.72)


<J 3- J
Vj E [N], j , j# (3.73)

P < P <P.j Vj E [N] (3.74)

Vj E [N] (3.75)

V = )1, V =0 (3.76)

MCE bounds for aj, bj, cj, dj of form (3.27)-(3.30) Vj E [N] (3.77)

The centralized problem of (4.26)-(3.77) has variables as follows:

y = Ir Ii Vr' Vi P Q a b c d Ijr I (3.78)

where each term takes on the form of (3.58)-(3.59). The atomic vector, a then takes

on the form of (4.48), where the convention that an atom owns its downstream current

flows is used 5. Once again the last two terms gives the coupling variables denoted

5
This convention is chosen as most nodes will have more downstream nodes than upstream nodes.
Thus, by choosing that an atom owns downstream current flows, we attempt to minimize the number
of variables which must be copied to satisfy constraints.

74
by the-symbol.

ai [Ir I y y P Q a bj c3 dj { }vowJkVk,{(,k)}CED

{Vr,Zk}Vk,{(,k)}ETD {jlow,j, Iflow,ij}Vi,{(i,j)}ETD] (3.79)

We note that the CI-Z formulation has increased the number of variables, the
number of constraints, and the number of coupling variables (copies of the parent flows
are required). Despite the larger central and atomic optimization problems however,
this formulation significantly improves the performance of the PAC algorithm.
From the simulation results on the IEEE 13 node network (see Appendix B.2 for
data) with the CI-Z model, the performance improvement is readily seen as in Fig. 3-
6. The PAC algorithm now gets close to the optimal solution within 2000 iterations,
and converges within 3000 iterations, with just this simple modeling change. The
evolution of the objective cost is also shown in Fig. 3-6c for this model. In particular,
the matrix 5T5 + BTB now has much lower condition number, allowing for larger
step sizes, with the relevant parameters shown in Table 3.2.

a = 1 -= 1.931 Condition number: 120


L = 12.1696 p = 0.2873 Amax= 6.2758

Table 3.2: Parameters for PAC algorithm for the Active IEEE 13 node network, with
the modified CI model.

With this new formulation, larger networks can be simulated,, such as the IEEE
123 node network, as presented in Appendix B.3. The algorithm approaches optimal
within 20000 iterations, as shown in Fig. 3-7.

3.5.2 Analysis of System Condition Number

The performance of the PAC algorithm for the two models (CI-Y and CI-Z) can
be further analyzed by looking at the matrices G and B, which correspond to the
atomized equality constraint matrix and the coordination matrix respectively. In
particular, from [20, 21] we note the selection of the convergence rate parameters

75
Distance to iblt

0.25

0.15

0.1

0.05

0 1000 2000 3000 4000 1410 6001 7000 000 9000

(a) Feasibility Metric


Distance to Consistency
0.3

0.25~

0.2

0.15

0,05

0 1000 2000 3000 4000 5000 6000 7000 8000 000 0

(b) Consistency Metric


Costs
1.14

0.12 L

0.1

0.08

0.06

0.04

0.112

0
0 1 2 3000 5000 6000 7000 00 000 9 10

(c) Objective cost

Figure 3-6: Convergence results for the IEEE 13 node network, modified to have
DERs with the modified CI model.

depends on these matrices; these are the step-size p which is common to all agents,

and the over-relaxation terms 7y3 and jj [r], the latter of which is time-varying. For

simplicity, here we consider the case where -yj is the same for all agents, and -y3 =

76
(a) toi MFooibeity
. D... tr e toC onitency

W0.3.
02

0.2

0. 15

0.01

0 0.2 (04 0.0 (,. 1 1.2 0.4 1.A 1.80 2

(a) Feasibility Metric


Dloooooo to Conoocy

0.3

0.2

0.11

0.05

0 0.2 (4 0.0 (0 1 L2 1.4 1.00 I'S 2

(b) Consistency Metric

Figure 3-7: Convergence results for the IEEE 123 node network with the modified CI
model.

1j,Vj, Vr.

We begin by defining the following as from [20,21]:

G = diag(Gj)vj (3.80)

V = dTO + BTB (3.81)


1
p = (3.82)
7*Ama(V)
2aL
2*= (3.83)
2Amax(V) + min(V)

where G is a block diagonal matrix composed of the atomic equality constraints;


Ama.(V) is the largest eigenvalue of V; and Amin(V) is the smallest non-zero eigenvalue
of V. We also assume that each fj is differentiable, a-strongly convex and L-strongly

77
smooth. Then p* and y* are the convergence parameters which maximize the primal

convergence rate. For the CI-Y model, the convergence is very slow because p* and

-* are very small, as governed by the very large Amax(V). Thus, analysis of the

eigenvalues of matrix V is necessary; we will bound the value of the eigenvalues and

use the results to show why the CI-Z model outperforms the CI-Y model when solved

with PAC.

We begin our analysis by noting that the matrix V is a positive semi-definite

matrix (PSD), as it is the sum of two PSD matrices. From Courant-Fischermin-max

Theorem, we have

Amax(V) 5 Amax(OT5) + Amax(BTB) (3.84)

which allows us to analyze each component separately.

3.5.3 Eigenvalue analysis of Coordination Constraints

Let's first consider the eigenvalues of BTB, which is the Laplacian of the coordination

matrix. Namely, the coordination matrix can be thought of as an adjacency matrix

of a directed graph, where the nodes in the graph are the variables ai (a variable

owned by agent 1), and & (a variable copy of ai owned by another agent). Then the

Laplacian (BTB) will consist of the elements -1 on the off-diagonals, and the degree

of each self-owned variable on the diagonals (namely the number of times a variable

has been copied). We can apply Gershgorin'sCircle Theorem, which states that every

eigenvalue of a square matrix (E R"'X) lies within a Gershgorin disc, which is a circle

centered at bei with radius Ri, where:

n
Ri = | bijI
j=1jA#i
bii is the element on the diagonal

78
Then:

|Aj - bijI < Ri (3.85)

For the Laplacian, the element on the diagonal is the degree of the ith variable,

denoted as dgi. We also know that Ri = dgi for all rows, as the sum of the rows of

the Laplacian are all zero. Then we can simplify the inequality as follows:

|Aj - bijI Ri (3.86)


|AN - dgi| dgi (3.87)

-+ Ai < 2dgi (3.88)

- Ai > 0 (3.89)

where the condition that Ai 2 0 is known as the Laplacian is a PSD matrix. Then
the maximum eigenvalue of BTB is bounded by the maximum degree:

Amax(BTB) < 2 max (dgi) (3.90)

Since the decomposition profile is determined by the model chosen and our rules on

which agents retain copies of which coupling variables, we can further analyze the

CI-Y and CI-Z models. Throughout our analysis, we will consider the two following

simple cases: a 3-node radial network, and a 3-node meshed network as in Fig. 3-8

2 3
(a) Radial network (b) Mesh network

Figure 3-8: Simple topologies for discussing the system condition number

79
Eigenvalues of Coordination: CI-Y Model

As seen in (3.60), the agents must retain copies of the voltages of all neighbouring

agents. Then for the radial network in Fig. 3-8a, agent 1 will require copies of voltages

from agent 2; agent 2 requires copies of voltages from agent 1, 3; agent 3 requires copies

of voltages from agent 2. We see that only the voltages from agent 2 are copied twice,

while the others are only copied once. Thus, max (dgi) = 2 for this example. For the

meshed network in Fig. 3-8b, all the voltages are copied by two other agents, thus

max (dgi) = 2 as well. In the CIY model, the maximum number of variable copies

is equal to the maximum degree of the nodes in the network (i.e. the number of

neighbours):

Amax(B T B) 2 max (deg(j)) (3.91)

In the two example networks:

Radial: Amax(BTB) < 4 (3.92)

Mesh: A)max(BTB) 4 (3.93)

Eigenvalues of Coordination: CI-Z Model

As seen in (4.48), the agents must retain copies of the voltages of downstream nodes
(Vk) and copies of the flows from upstream nodes (Iij). Note here, that a node j has

downstream nodes k where the numbers j < k (child nodes), and upstream nodes

i where the numbers i < j (parent nodes). Then, the voltages of a node are copied

by its parents, and the outward flows of a node are copied by its children. However,

we note that only voltages can be copied multiple times, as lines flows have unique

{parent,child} pairs. Thus, only the number of parents is relevant.

In a radial network, as in Fig. 3-8a, nodes can have only one parent. Then, we

80
can uniquely determine dgi for all radial networks as:

max (dgi) = 1 (3.94)

Amax(BTB) < 2 (3.95)

In the meshed case, this becomes more complicated as each node can have multiple

parents (consider node 3) or multiple children (consider node 1). Then we can define

the maximum number of copies as:

max (dgi) = max(deg "(j)) (3.96)


J

where degi"(j) denotes the in-degree of the node j.


In the two example networks:

Radial: Ama(BTB) < 2 (3.97)

Mesh: Amax(BTB) 4 (3.98)

where we note that all radial networks will be bounded by 2.

Eigenvalues of Coordination: Comparison of CI-Y and CI-Z Models

From the analysis above, we can make the following conclusions:

" For a radial network, the CI-Z model always yields smaller Ama than the CI-Y
model (other than the trivial case of two connected nodes).

" For a meshed network, the CI-Z model will yield the same or smaller Ama, as

maxj(degi"(j)) 5 maxj (deg(j)). This depends on the specific meshed topology.

It's interesting to note that although the CI-Z model requires more coupling variables,

the impact on the maximum eigenvalues is the opposite - this is because of the partic-

ular decomposition chosen. We also note that the difference between CI-Y and CI-Z

here is quite small - there isn't an order of magnitude difference which could explain

81
the huge performance difference. Thus, the eigenvalues of 5T5 must dominate, and

will explain the difference between the two models. This will be discussed next.

3.5.4 Eigenvalue analysis of Equality Constraints

We can now consider the eigenvalues of 5T0. We begin by noting that O is a block

diagonal matrix, and so the following holds:

A(5 T 5) {A(5fGj)}vj (3.99)

Ama(O T O) = max(Ama,(5Tfj)) (3.100)

We now have a simpler problem, where we just need to characterize the eigenvalues

of the atomic equality constraint matrices. We can also show that:

Amax(5 j) = ||5 j|| 2 < |5j|| < |5jI|2 (3.101)

where 11 -||2 denotes the usual Euclidean norm and 1 -||F denotes the Frobenius norm.
We also note the following for a matrix A EE Rmxn:

m n
2
I|AIIF= Tr(AtA) ZIaij= (3.102)

where At is the Hermitian transpose (conjugate transpose). We note that our matrix

OTdj is a real matrix, so this is just a transpose. Since the equality constraints

(feasibility) are fully defined for our two models, we can further analyze the CI-Y and
CI-Z models as we did for the coordination constraints.

Eigenvalues of Feasibility: CI-Y Model

We begin by recalling the optimization problem formulated by (3.31)-(3.36). The

constraints from the CI-Y model can be easily distributed, and the G matrix is

82
defined as:

I- = gr(VY, V , Va, Vr))vk,{(j,k),(kj)}eTD

Oj = 7 k7V))Vk,{ (j,k),(kj)}E'D
P=a~b
Q= c + d
where the same constraints are present for all nodes. Let's begin by considering a

single-phase network, and determine the functions gr and gj to characterize the first

two constraints.

ij = VI) + (EY)V (3.104)

V r+jV (3.105)

Yj= y= y + yi (3.106)

I - - y Vi) + (SyE)Vr - (5y )Vi (3.107)

Ii= - (yVi + yVr) + (Eyi)V + (Ey )Vr (3.108)

where 1 = {(i, j), (j,k)} E TD is the set of all connected nodes. Then from (3.107)-

(3.108), we can fully characterize the matrix based on the admittances.

We can now evaluate the Frobenius norm, j|j3j2 as is the sum of the following
terms:

" P - a - b = 0 -+ (1 + 1 + 1) = 3

" Q+c-d=0-+(1+1+1)=3

I - gr() 0 4 (1+ E [(y[) 2 + (yi)2] + [El yr] 2 + [E yi] 2


)

* I_ - gE() =0 - (1+ Z[(y() 2 + (yi)2] + [E yr]2 + [E yi]2


)

A discussion on this result will be left after the CI-Z model is discussed.

83
Eigenvalues of Feasibility: CI-Z Model

We begin by recalling the optimization problem formulated by (4.26)-(3.77). These

constraints from the CI-Z model can be easily distributed, and the 03 matrix can be

easily defined as:

11= Zk,{(j,k),(kj)}ED Ij,k

jY Zk,{(j,k),(kj)}ED 'j,k

P=a-Fb
Gj =(3.109)
Q=c~d
Vr
- Y = gr(Ij,k, Iji,k)Vk,(3,k)ETD

V Z=
k'- g,(f, I,k)Vk,(j,k)ETD

where the first 4 constraints are present for all nodes, and the last 2 are present only

for nodes with children. Then, much like in the CI-Y model, we begin by considering

a single-phase network to determine the functions g, and gi to characterize the last

two constraints.

(Vj - Fk) = ZjIjk (3.110)


k,(j,k)ETD k,(j,k)ETD

Zjk = Zjk + jZjk (3.111)

(V - Vk) = (Z I - Zj Iik) (3.112)


k,(j,k)ETD k,(j,k)ETD

>E (V - Vk) = S (Z jI - ZjkIk) (3.113)


k,(j,k)ETD k,(j,k)ETD

Then from (3.112)-(3.113), we can fully characterize the matrix based on the impedances.

We can now evaluate the Frobenius norm, |j|03|| as is the sum of the following

terms, which are shown one constraint at a time.

" Ij - _ 1 1f= 0-+(1 + deg(j))

• Ij - ', JJ= 0 -(1 + deg(j))

• P- a - b= 0 - (1 + 1 + 1) = 3

84
* Q+c-d=O-*(1+1+1)=3

• Ek,(,k) (I
f V-- -gr(-) 0 -+ ( [(Zk) 2 + (Zik)2]

• Ek,(j,k)ETD(lVJ k)-gi(-) = 0 -+ ((1+1)x[deg°k (Z Zjk) 2

where 1 {(i, j), (j,k)} E TD is the set of all connected nodes. The last two constraints

can be easily combined for a 3-phase network as follows:

2 x [2degot(j) + sum(vecnorm(real(Z)) 2 ) + sum(vecnorm(imag(Z)) 2 )] (3.114)

where vecnorm() is the MATLAB command for the vector norm, and degout(j) denotes

the out-degree of the node j

Eigenvalues of Feasibility: Comparison of CI-Y and CI-Z Models

In comparing the Frobenius norms of the CI-Y and CI-Z models, the key differences

are the two components depending on admittances for the CI-Y model, and the two

components depending on impedances in the CI-Z model. Note that the CI-Z model

also has two components which depend on the degree of the agents, but we will show

that these are minor factors. We make the following observations:

• The CI-Z model depends only on children voltages, and the impedances of

downstream lines, while the CI-Y model depends on all connections and the

admittances of all lines.

" The per unit impedances and admittances are comparable, with the admit-
tances typically being smaller. Recall that distribution lines are more lossy

than transmission lines (have higher resistances), and so the corresponding per

unit impedance is higher and admittance is lower.

* Distribution lines are typically quite short, so the line length measured in miles

is typically < 1. Since Y = 1/Z, the line admittances become larger when
divided by the line length. Equivalently, line impedances become smaller when

85
multiplied by the line length. For example, the IEEE 123 node network has a
maximum line length of 0.1894mi, as in Appendix B.3.

* All values are converted to per unit analysis. For the networks we are consid-

ering, SBase = 5e3kW,VBase = 4160V, ZBase = 3.4611Q, YBase = 0.2889S.

Recall that we divide by the base value to get to the per unit analysis. This

operation results in even smaller impedances and larger admittances.

For a simple 3-node radial network as presented in Appendix B.1, we have the fol-

lowing results for the feasibility eigenvalues for node j 1:

Amax (Gj T Gj) Fl~I


CI-Y Model 2.4015e4 8.2584e4
CI-Z Model 3 42.0045

Table 3.3: Comparison of feasibility eigenvalues for CI-Y and CI-Z models

From these observations we can also make the following comments:

" The CI-Y model may work better for a transmission line where the lines are

longer. However, transmission lines have lower impedances, which would further

increase the admittance value. Here we see a tradeoff in performance depending

on the topology and line parameters.

" Different base values can be chosen to scale the admittances to smaller values;
however, this would require lower SBase and VBase values, resulting in higher

values for the inequality constraints.

3.6 Comparison with Branch Flow

As highlighted previously in this chapter, the CI model overcomes the limitations of

the BF model in that it is readily applicable to unbalanced and meshed networks.

However, the application here is using distributed computation, which warrants a

comparison between CI and BF when solved by the PAC algorithm.

86
For simplicity, we consider balanced radial networks under both the CI and BF
models. In order to make a fair comparison between the two models, the following

changes to the OPF problem are made:

" The IEEE 13-bus network is modified to be a 3-phase balanced network. The

impedance matrices are modified under the assumption that the lines are all

3-phase transposed, as per (2.29) and (2.30). The configurations are converted

to symmetric matrices, with the positive-sequence element being used to model

the cable (recall that the positive- and negative-sequences are identical). See

Appendix B.2.3.

" The loads are modified so every node has 3-phase balanced loads. Single-phase
spot loads were assumed to be 3-phase. All other loads are averaged over the

phases, to give balanced load on all three phases. See Appendix B.2.3.

" The BF model is extended to be 3-phase by replicating the single-line model

and solving all three independent and identical problems together. This is
done to better align with the 3-phase CI formulation, which utilizes the 3-

phase impedance matrix. Further discussion on implementation is provided

after presentation of simulation results.

" The objective function is changed from the example of Volt-VAr control to a

social welfare function. This has two components: electrical line losses, and the

cost of purchasing electricity from the grid. Under the BF model, the convex-

ification of (3.4) to yield a second-order cone (SOC) constraint is exact when

branch currents, lij = |I j12, are minimized. Minimizing the line losses thus in

turn minimizes lij, while retaining some physical and operational interpretation.

Note that the minimization of branch currents is not required in the CI model.

Further, the implementation of Volt-VAr control as done in (3.61) is challeng-

ing with the BF model, as we do not have access to voltage or current angles;

rather, once the convex BF OPF model is solved, the angles can be recovered

(under certain conditions) as discussed in detail in 15,6]. However, this ex-post

87
angle recovery does not enable us to employ such a simple Volt-VAr control
equation. To retain a simple formulation, we instead consider an economic ob-
jective function, where the LMP at the feeder, AP and A for real and reactive

power are considered 6. The two components of the social welfare function are

weighted by ( to consider the trade-off between economic considerations and

energy efficiency.

The social welfare function is as below:

fG-Cost(y) = A PF4 + A Q (3.115)

foss(y) = Ri,1|ij2, V(i,j) E T (3.116)

+ oss (3117)
fwelfare(Y) = fG-Cost (Y)
(i,j)eT

For the simulations, we take the following values: ( = 1, A = $30/MWh, AQ

$10/MWh. Network data and configurations can be found in Appendix B.2.3. The

simulation is run to make sure both models converge, with feasibility and consistency
3
errors on the order of le . The PAC variables are initialized to the solution of the

atomized problem solved using a centralized program. For the CI model, we can

easily implement the social welfare function by recalling:

|fIlow,ij 2 = fow,ijJflow,ij (3.118)


2
= (I; l,i 2 + I low,ij ) (3.119)

where the symbol * denotes the complex conjugate. To determine the optimal PAC

convergence parameters, we take the objective function to be a-strongly convex 7 and

6
Note that in electricity markets today, reactive power is not priced. We however, set a small
price on reactive power to make the problem a little more interesting.
7
The convexity measure is bounded as 0 < a < 1, where larger a values correspond to more
strongly convex functions.

88
L-Lipschitz continuous 8. We set a = 0.5 9. We estimate the best Lipschitz constant

by taking the maximum value of dfwelfare(Y)


dy over the feasibility region described by the
inequality constraints (i.e. bounds on y, not considering the equality constraints).

Note that the optimal step sizes are a strong function of both the system condition

number (which depends on the model, as discussed earlier in this chapter) and the

Lipschitz parameter. For the CI model, the Lipschitz parameter is calculated as:

L = 3 [A # + A] + Rij ( + 211wi)] (3.120)


(i,J)eT

where the factor of 3 in the first term comes from the 3-phase model of the network.

As a very conservative bound, we take I s0ig = Iji0ig = 5pu. This results in L = 610
for the CI model, and y = 48.5 and p = 0.0574. The same step-sizes and parameters

are used for the BF model as well in the following simulation results.

3.6.1 Qualitative Discussion on Simulation Results

In what follows, we present results from the PAC algorithm applied to both the CI and

BF models, and make both qualitative and quantitative analysis. The convergence

results for the CI and BF models are shown in Figures 3-9 and 3-10 respectively, for

the feasibility and consistency metrics.

From a first glance, the BF model looks to converge much faster and with smoother

profile. The BF model approaches converges within 5000 iterations, while the CI
model has comparable approach in a over 10, 000 iterations. This shows the BF
model converging in about half of the number of iterations.

A close up of the first 100 iterations is shown in Fig. 3-11. Here we see that
the BF model deviates further from feasibility and consistency as shown by the peak
8
Lipschitz continuity describes the continuity of a function by bounding the slope of the function,
or in other words, how quickly a function can change value. The Lipschitz parameter is any such
that |f(y2 - f(y1))I < LIy 2 - y1|. The smallest constant is called the best Lipschitz constant. For
a differentiable function, Lipschitz continuity means the function has a bounded derivative.
9
The objective function is a simple convex function. As such, one would think a = 1 is a suitable
parameter. However, here we set it to a lower value to ensure stability and convergence in the
algorithm. Further simulation results for a = 1 are also presented after the discussion between CI
and BF models.

89
Distance to Feasibility
1.8 -
1.6
-

1.21
1.2
-

0.8

0.6

0.4

0.2

0
0 0.5 1 1.5 2 2.5
4
x10

(a) Feasibility Metric for CI Model.

Distance to Consistency
0.7

0.6

0.5
-

0.
-

0.3

0.2

0.1 1

i I I

0 0.5 1I 1.5 2.5


x 10'

(b) Consistency Metric for CI Model.

Figure 3-9: Convergence results for the IEEE 13-bus network, under balanced condi-
tions, for the CI model.

90
Distance to Feasibility

4.5 - -~

4
-

3.5
-

3
-

2.5

1.5

0.5

0 0.5 1 1.5 2 2.5

(a) Feasibility Metric for BF Model.

Distance to Consistency
.... PAC
4.5

3.5

2.5

1.5

0.5

0 0.5 1 1.5 2 2.5


4
"'M

(b) Consistency Metric for BF Model.

Figure 3-10: Convergence results for the IEEE 13-bus network, under balanced con-
ditions, for the BF model.

91
Distace to Fe.aibility Distance toCnitry

2.- 2.4-
(a) Feasibility Metric for CI Model. (b) Consistency Metric for CI Model.

Dist.ance 00 Feasbility
0.2 Dmnn 1 n0 m

0l 10 2(1 30 0 I 50 64 1020 20 440 - In60 A0R010


09o0 10()

(c) Feasibility Metric for BF Model. (d) Consistency Metric for BF Model.

Figure 3-11: Convergence results for the IEEE 13-bus network, zoomed in on the first
100 iterations to show the behaviour of the algorithm per each model.

values of roughly 4.8 for both metrics, in comparison to the peak of 1.6 and 0.6 for
feasibility and consistency under the CI model. After the peak, both models show
sinusoidal behaviour, with the CI model exhibiting fewer jumps. Although the BF
model deviates further from the optimal solution, the two models reach comparable
levels around the 100 iteration mark, with BF potentially achieving lower error here.

Another set of close up graphs are shown for the CI and BF models in Fig. 3-12,
this time looking at the algorithm performance as it approaches convergence, here
we see that the BF model does indeed approach convergence 10 before the CI model.
However, this close up also gives us more information. Under the BF model, the PAC
algorithm is unable to improve the solution below errors of le~ 3 ; under the CI model,

10Here we are loosely using the term convergence, as when errors are on the order of 1e-3
.

Typically convergence would be when errors are on the order of 1e-6 , as the PAC algorithm does
indeed converge to the exact global optimum. This is compared to other distributed algorithms such
as dADMM which approaches the optimum, but does not reach it.

92
--1

100 Dit toa,ho the C bnsi.emw-avi alorthip r c model

C.5

- 4

3.5

(a)~ ~~ ~ ~~~~~~~L CossecDercfrC oe.()Cn istnc Mtri oner B odl

thge ptimal thvrne PAexhibts iuoida bhehavious exetedrk fromeino the ildua

dynamics for both models, but with higher amplitude oscillations in the CI model.
When approaching the optimal solution, the algorithm is numerically limited with

the BF model. Recall that when solving OPF, per unit analysis is commonly used to

scale variables down for numerical stability. This means there is potential for some

variables to take on very small values; this is potentially problematic for the BF model

under PAC.

3.6.2 Quantitative Discussion on Simulation Results


The CI and BF models are compared under the distributed PAC implementation.

As such, the focus is on computational time and iterations, rather than on the exact

power flow solution. Quantitative metrics for comparison are outlined below.

1. Primal Atomic Update: The primal atomic optimization problem for the

CI model is a linear program (LP), while for the BF model is a quadratically

constrained program (QCP). Note that if the objective function is a quadratic

cost function, the CI model is a quadratic program (QP) and the BF model is

a quadratically constrained quadratic program (QCQP). The linear constra ints

93
of the CI model should result in lower computational time per atomic primal

update, as QPs are much easier to solve than QCQPs. However, the compu-

tational time also depends on how tight the MCE bounds are for the convex

relaxation. The CI and BF models can be compared by looking at the maximum

and average time taken per primal atomic update.

• Average time per primal atomic iteration, averaged across atoms: tatomic

kZ {kLk t }, for iterations k = 1, ... , K and nodes j E N, measured in


milliseconds.

" Maximum time per primal atomic iteration: tatomic = maxj maxk tj, for

iterations k = 1, ... , K and nodes jE N, measured in seconds.

" Average standard deviation of time per primal atomic update: &atomic =

AEj{I-atomic,j} where Uatomic,j is the standard deviation of primal update


time for atom j across all K iterations, measured in milliseconds.

2. Number of iterations: The number of iterations, K, required by the PAC

algorithm depends on many different factors: the initial conditions, the choice of

step-sizes p and -y, and the problem being solved ". Here the CI and BF models

will be compared by fixing both the initial conditions and step-sizes to be the

same and comparing number of iterations (Keq), and by fixing only the initial

conditions and allowing step-size to be determined optimally as per [20, 21]


(Kdiff).

These metrics are tabulated in Table 3.4 for the simulation results above, using the

setup as described above with CI and BF models having the same initial conditions

and convergence parameters (as calculated for the CI model), for all results except
Kdiff. For calculating Kdiff, we estimate the Lipschitz parameter for the BF model

objective function and re-calculate the convergence parameters. These values are

all tabulated in Table 3.5, including the eigenvalues which influence the condition

number.
"Note here that the problem consists of both the choice of model for the physical problem, as
well as the objective function. Of course, fixing the objective function to be the same between the
CI and BF models is necessary for comparison.

94
The key insights here are the time for primal update. We had expected the CI

model to have shorter primal update times as it is a QP compared to the QCQP of

the BF model. However, the two are comparable (both solved directly in Gurobi, a

commercial optimization solver), with the CI model actually taking slightly longer.

This may be attributed to the larger variable space and the coupling between the

real and imaginary components of current and voltage. The CI model also takes

more iterations than the BF model, and so overall would take more time to converge.

However, the major difference here is that the CI model solves the power flow or

OPF problem in full, including the voltage and current angles. In comparison, the

BF model does not solve for the voltage angles; rather a post-processing step (more
accurately, an angle recovery algorithm) is required to recover the full OPF solution.
A more fair comparison here would be to setup the angle recovery algorithm and

compare the time for the CI-OPF and BF-OPF with angle recovery. Further, more

networks should be tested, including meshed networks as they can be convexified for

the BF model. A better comparison would set up these models and then compare

the performance of the models and the PAC algorithm.

From the data in Table 3.5 we see that the condition number for the CI-Z model

is better than the BF model as well, however, we've estimated a higher L parameter

for the CI model. This comes down to two main items:

• The value of ( heavily influences the L parameter (along with the actual optimal

objective cost). The per unit LMP for electricity (calculated as A/SBase, where

SBase is the base value for apparent power) is very large. In these simulations

A # = 150$/pu, A = 50$/pu, which for a 3-phase system results in L = 600.

The line resistances on the other hand are very small (order or 0.01pu), meaning

the influence of the line losses is minimal to the optimization problem. For a

higher weighting, the objective cost and L parameter would both be higher.

* The CI model has a higher L value because of the difference in model variables.

The CI model models the real and reactive components of branch current, while

the BF model considers only the squared magnitude of branch current. As such,

95
when taking the derivative of the objective function, the upper bounds on real

and reactive components of branch power are needed for the CI model; the

BF model does not require any information on the branch currents. Tighter

bounds on the branch current estimates would give a better bound on L for the

CI model, and could potentially result in improved performance.

Network Metric CI-Z Model BF Model


tatomic, ms 3.0 2.2
IEEE 13 Node tatomic, s 0.1618 0.0177
&atomic, ms 0.8 0.3
Keq 13000 5400
Kdiff 6300

Table 3.4: Comparison of the CI and BF model when using the dis tributed PAC
algorithm.

Parameter CI-Z Model BF Model


L 610 600
7 48.5 42.4
p 0.0574 0.0578
Amin 0.0527 0.0544
Amax 6.2439 7.0486
Table 3.5: Comparison of the CI and BF model when using the distributed PAC
algorithm.

3.6.3 Additional Simulation Result

Erom the discussions above, we can consider different simulations setups. We simulate
only the CI model and test the performance when a = 1 is used (as the objective

function is indeed convex) in Fig. 3-13 and ( = 10 to weight the energy efficiency

higher in Fig. 3-14. Here we see that having the higher a parameter does speed up

convergence, and we get closer to optimal in under 10000 iterations, as compared to

the case of a = 0.5. The results for the more weighted objective function also shows

better convergence. This may be attributed to the L value being higher (L = 696,
and thus larger step-sizes of -y = 55.47 and p = 0.0537). This could also be as

96
a result of more variables influencing the optimality: the branch currents are more

heavily weighted and so this may limit the solution space. Further, the branch current

variables can be bound better: the OPF solution has I = 0.2886pu, Ili=
1.2047e - 4pu. In the current problem setup, the branch current variables do not have

pre-set limits in the formulation of the optimization problem 12, but using estimates

from historical data can help to bound these variables, perhaps leading to smaller

feasibility regions (and thus, faster convergence).

1 2 However, note that this does not mean they are unbounded variables. Rather, the limits on
power injections at nodes and the power flow equations themselves limit branch power flow, and
thereby current flow. More specifically, the limits on branch current flow come primarily from line
thermal and ampacity limits, which are a result of cable specifications, rather than power physics.

97
A

Distance to Feasibility

1.6-

1A
-

1.2
-

0.8

0.6-

0.4

0.2

0 05 I 1.5 2 2.5
4
x10

(a) Feasibility Metric for CI Model.

(~ j?
Distance to Consistency

0.5-

0.4
-

0.3
-

0.2

0.1

0 0.5 I 1.5 2 2.5


x101

(b) Consistency Metric for CI Model.

Figure 3-13: Convergence results for the IEEE 13-bus network, under balanced con-
ditions, for the CI model, with a = 1, which influences the convergence parameters.

98
Distance to Fensibility
1.8

1.6

1.4

1.2
-

0.6

04A
0.2

ni
1 1.5
1
2.5
0 0.5 2
x10"

(a) Feasibility Metric.

r)istance to Consistency
0.6

0.51-

0.4

0.3

0.2

0.1 .2

0 0.5 I 1.5 2 2.5


x101
(b) Consistency Metric.

Figure 3-14: Convergence results for the IEEE 13-bus network, under balanced con-
ditions, for the CI model, with higher weight for the electrical losses term, 6 = 10.

99
100
Chapter 4

A Story of Storage: Multi-period


Distributed Optimization for
Distribution Grids

This chapter discusses the extended application of the PAC algorithm to address

multi-period optimization problems. In previous works employing the PAC algo-

rithm [20-221, all decision variables were assumed to have no state retention, lending

the problem to single period optimization. However, in the case of distribution grids

with a high penetration of DERs, and in particular storage devices, there is temporal

coupling between constraints. Using a storage unit during one hour lowers the state
of charge, and thus future available capacity. The extension for multi-period opti-

mization was evaluated in the context of DER scheduling and dispatch, primarily for

day-ahead decisions.

4.1 Multi-period Optimization

Consider the following multi-period optimization problem (4.1), where y E R(YxT)x

are the Y optimization variables for each of the T periods, subject to M optimization

101
constraints written in standard form.

minX f (Y) Efk (Y)


yERYXT kE[B) (4.1)
subj. to: Gy = OM

For a multi-period optimization problem over T periods, the decision vector y

consists of repeated units describing the system at each time instance of interest:

Yy=1 Yy,t=1

y where y Yy,t=2 (4.2)

yy=Y Yy,t=T

Likewise, the constraints Gy = OM can include a number of constraints linking

decision variables temporally Gt c G; these are described as Gty = 0IGti, where

-
denotes the dimension of the vector.

Following the decomposition profile for the PAC algorithm, introduced in Sec-

tion 3.4, the global multi-period optimization problem can be decomposed into smaller

subproblems. Note that each of the constraints in Gt can relate multiple variables

across time steps, regardless of which atoms the variables belong to, as the decompo-

sition profile makes use of variable copies to fully distribute the problem. Likewise,

the objective function fsj(y) can depend on variables across time steps, from any

atom. This is because each atom j retains a "copy" of the dependent variables from

corresponding atom i for all required time periods, Vt E T.

The atomized equivalent of (4.1) can then be obtained, where B represents the

adjacency matrix of the directed graph of the atoms (as introduced in Section 3.4):

min Efj (aj)


aERialjEB

subj. to: (4.3)


Gjaj = 0, jEB

Bj,_a = 0, j E B

102
where Bj,_ represents the rows of B that correspond to the coupling variables along

(i,j) E TD. The equation Ojaj = 0 corresponds to the atomized equality constraints
from the global problem (4.1). The atomized decision vectors aj E R(ITxTI)xl can be
expanded to show temporal groups, like the decision vector of the y (4.2):

a=1 aja,t=l

aj = aja=2 where aja= ajat=2 (4.4)

aja=JT ajaxt-T_

For a single period optimization problem, we clearly lay out the copied and owned

variables. Note that these follow for the multi-period formulation as well, with copies
of a variable made for every time period.

a3 1

a3 2
Owned variables

aj all (4.5)

Copied variables

4.2 Application to Distribution Grid

The multi-period extension of the PAC algorithm can now be applied to the problem of

day-ahead scheduling of resources within the distribution grid under high penetration

of DERs. By using the distributed PAC algorithm, the dispatch variables resulting in

lowest cost operation can be determined. Specifically, these variables include power

injection (Pj, Qj) 1 and storage control (Pj,Pjd) at each bus, for all time steps t E

[1, ... T].


The OPF formulation using the CI model introduced in Chapter 3 is used, as
'Recall that for the CI model, we define power injection as positive P and Q, and loads as negative
P and Q.

103
the distribution grids are highly unbalanced and can contain meshed topologies. The

model is extended to account for additional time-coupling constraints, and objective

function for the unit commitment problem. Specifically, the storage capacity and

ramp rates, and generator ramp constraints introduce states that persist across time

periods. Thus, including these constraints requires the solution of multi-period OPF

(MOPF), also called dynamic OPF, with the constraints coupling variables across

different time periods [33-35].

The formulation for modeling the DER devices is discussed here, with a focus on

the multi-period constraints in the last two subsections. For notational simplicity,

we discuss the formulation for a single-phase network, thus removing the subscripts

pertaining to the phase; extension to multi-phase network follows accordingly from

the model in Chapter 2.

4.2.1 Demand Response

Loads are modelled as negative power injections, as:

Pi P< 0 (4.6)

Note that the above formulation implies demand response capability at node j, to
100% of base load, Ej. For a fixed load (no demand response capabilities), the power
injection is fixed as per (4.7). For a load with demand response capabilities of
(
percent, the power injection is variable as per the bounds in (4.8).

P <_ P P (4.7)

P Pj 5 (1 - ()P (4.8)

Qi Qi < Qi (4.9)

In this model, we consider demand response only for real power consumption, thus

reactive power is fixed as per (4.9). We note, however, that with increase in power

electronically controlled loads, and motor-based loads (i.e. induction motors), the

104
demand response is also enable on reactive power. To include this, the reactive power

bounds will follow a similar form to (4.8), with additional constraints likely required
to model the relationship between Pj and Qj.

4.2.2 Distributed Generators

Generators are modelled as power injections with both real and reactive power capa-

bilities. Generators can be categorized as controllable and uncontrollable resources.

Controllable generators include traditional diesel generators and motors, where the

power output can be entirely controlled. The only limiting factors are availability of

fuel (which we can assume is not an issue), and the ramping up/down capabilities

(which will be discussed later). Uncontrollable generators are renewable generators,

where the power output is entirely dependent on the availability of solar or wind
resources. Note that renewable energy can be curtailed in most cases - production

beyond what is needed can be stored or curtailed (i.e. thrown away as waste), thus

the lower bound of generation is assumed to be flexible. Distributed generation can

be modelled as in (4.13) for controllable loads, and (4.11) for uncontrollable (renew-

able) resources, where ( is the amount of allowable curtailment. The value of ( is

determined largely by policies such as renewable energy standards or requirements: a

grid operator may be required to utilize all renewable energy generation and so ( 0,
while another may have more flexibility in resource use so 0 < < 1.

P Fi t
P Pi (4.10)

(1 - ()Pj, i Pj' Pj' (4.11)

P > 0

(4.12)

The values of Pj,t and Pj,t for controllable generators are determined by the technical

specifications of the generator. The value of Pjt for renewable resources is determined

by weather forecasts and historical data which estimate the generation capabilities

105
of the resource. These are assumed to be inputs to the OPF problem, and thus this
thesis does not focus on the forecasting of renewable energy generation. The same

can be said for the reactive power from the generators. Here for simplicity we assume

that only non-renewable generators can provide reactive power, and that this reactive

power can also be negative as it can be power electronically controlled. For renewable

resources, we assume Qj = 0.

Qj Qjt Q (4.13)
Qj> 0

4.2.3 Generator Capability Curves

Another important constraint for generators (both controllable and uncontrollable)

is the capability curve, which dictates the relationship between Pj and Qj. The capa-

bility curve details the safe and desirable regions of operation, which can include (but

not limited to) maximum current, maximum power, and power factor relationships,
as shown in Fig. 4-1. To keep a simple formulation, here we only consider the power

factor for the capability curve. For renewable resources, pf = 1 already as we assume

Qj = 0. However, for nonrenewable generators, the power factor should be limited to


ensure efficient operation. Recall that power factor is pf = cos(arctan( 9)). Then for

a range of power factors (giving positive and negative Qj, the capability curve can be

modelled as:

Pj tan(arccos(pfneg)) Qj < P tan(arccos(pfp.,)) (4.14)

where pfne,g is the negative power factor giving Qj 5 0, and pfPO, is the positive power

factor giving Qj > 0.

106
P1

Steady-state 8(max) P(max) S (max)


stabiiy knit

A#:EE,(max)

3 V, EtlXs

#
N
E=0
x,
Lag

Figure 4-1: An example generator capability curve for a synchronous generator. Here
additional limitations for currents of field and excitor windings are also shown, giving
the curve a more complex shape. For the simple power factor bounds we are consid-
ering, the curve will take on a smooth circular shape for each quadrant of operation.
Recall that Pj > 0 for all generators, so we only have 2 quadrants of operation.

4.2.4 Storage System Modeling

In order to extend the proposed CI model to include storage resources, we introduce

additional variables, Psd and PjF, which are the discharge and charge power for storage

unit at node j at time t respectively. These are related to the net power injection at

node j as:

1
P = -Pft - tP (4.15)
?j

For notational simplicity we assume that all storage units operate at unity power

factor, so Qy = OVt 2. The limitations on charge and discharge power can then be

specified as:

0 < P?!
It <
-
Ppd
J (4.16)

0 <PC < C (4.17)

2
Many storage devices can actually be used to provide reactive power support as power electronics
can be used very easily to adjust power factor. In this work, we simplify the case and use storage
to either store excess renewable generation, energy arbitrage, or as reserve.

107
Now we are ready to add the capacity constraints on the storage units. These are

integral constraints, and require knowledge of the system's current state of charge
(SOC) bj,,, as described by the previous SOC bj,t- 1 minus losses due to self-discharge

(written as gjself), and the net charging during the period t, while also accounting for
charging and discharging efficiency ( f and qP respectively). This temporal coupling

is described as:
1
bj, = (1 - gjelf)bj,t_ 1 + fP (4.18)

Note the SOC of a storage device at time period t is a dependent property, given

knowledge of the initial SOC bj,o and the actuation over each prior period t = [1, ... , t-

1]. Thus bj,t need not be a decision variable in our optimization problem; rather, it

can be calculated based on the charge and discharge over each period, P and

respectively. The capacity constraints for the storage device is therefore

where

s 1-elfAt)tbj
_ 77
____=__1 m-lj tD j,
+ Z(1-yefAt
'jI -j,t
tir[ fIPsp pJsd]) + 7P!Sc - pd

Self discharge
Self discharge of net charge over each period Net charge over
of initial SOC
current period

where the last two terms can be combined, and the upper bound on the summand

becoming t. Note that in most battery systems, a minimum non-zero SOC is desirable

at all times to keep the battery in good health - this is referred to as maximum depth of

discharge (maxDOD); thus bj = (1- maxDOD)bj. Typically, this is dependent on the

electrochemistry of the battery. This may be on the order of 30 - 50% (so maximum

depth of discharge is 50 -70%) to avoid damage to the storage system from excessive

discharge [36], but can also be as low as 10% for vanadium flow chemistry. The lower

limit can also be a technical requirement of the grid, as a contingency to ensure there

108
is power available in case of loss of generator 3. Additionally, an ending capacity

requirement is typically employed in the day-ahead unit commitment problem [331,


in order to recharge the battery for the next day of operation. This adds the following

constraint:

bj,0 = bj,T

Note that the SOC constraint is for the entire device, not per phase as the other

power constraints have been. The SOC constraint can be extended for a multi-phase
system by summing Pg and P over the phases at the node j, and aggregating it to

one value per timestep t.

4.2.5 Ramp Constraints

Another set of necessary temporal constraint are ramp constraints on generators and

storage devices4 . These are especially important for generators such as diesel gener-

ators which have non-negligible startup and shutdown times. Note that renewable

resources typically lack significant ramp constraints, further lending themselves to

rapid variability. As such, the ramp rates on renewables are not modelled.

These constraints require knowledge of the power output of the previous time

period, and only couple pairs of consecutive times. With ramp limits typically given

in kW/h. For period t, the ramp constraint is modeled as (4.19) for both generators

and storage units.

rjAt < Pj,t - Pj,t-i 5 jAt (4.19)

where rj and Tj represent the decrease and increase ramp rate limits for the device at

bus j.

3
This is a form of an ancillary service. Energy reserves are important for the reliability of the
grid. This will be further discussed in Chapter 5, in the context of market derivatives for services.
4
Ramp constraints on electrical storage systems are typically only relevant for sub-second
timescales, as they lack the limiting inertia that systems like flywheels posses.

109
4.2.6 Defining Cost Function

The day-ahead unit commitment problem aims to minimize the total costs incurred

by the system. This typically includes the cost to generate power, and power losses

across the distribution grid lines. The cost function, fMOPF(y), is:

fImport (y) = AFP + A Qj if j E F (4.20)

fLocal-Gen( aF 2
+ bFj+ c if j E B (4.21)
fstorage(y) = if j E B (4.22)
fOPF(yt) = [Import + f Local-Gen + fStorage(yt) Vt E T (4.23)

fMOPF(Y) f OPF(yt) (4.24)


t

where

•A and are the locational marginal price (LMP) of electricity, for each

feeder j#, j E F, as measured in $/pu;

• aF, b, c are quadratic cost terms for the marginal cost of locally generating

power, as measured in $/MW. These costs typically include fuel costs and any

marginal Operation and Maintenance (O&M) for the non-renewable resources.

Note that renewable distributed generators have no marginal cost of operation;

I is the marginal cost of using storage, as measured in $/MWh. This cost is


based on the battery wercost: cb _Crep - replacement cost [$
basedonthebc ywear = = lifetime throughput MWhlx roundtrip efficiency

where Qlife = No. of Cycles x x DOD x 2 1cRi.


cycle'

4.2.7 Electricity LMP Data

The price of electricity for a region (i.e. consider a single distribution grid) is de-

termined by the wholesale electricity market (WEM) and is termed the locational

marginal price (LMP). The WEM solves an optimization problem to determine the

price of electricity, which is the price at which load serving entities (LSE) such as

110
utilities purchase electricity and then sell to its customers at a retail price. The

LMP varies between different regions, reflecting operating characteristics and major

constraints on the transmission system, as well as losses resulting from the physical

transmission grid 5.

The LMP for the New England area are published online on the Independent

System Operator (ISO-NE) website [37], and is used in this thesis to determine Ag;

specifically the 5-minute real-time LMP data for May 14 2019 is queried. The 5-

minute data is averaged over 12 periods to give hourly LMP data. See Appendix B.5
for the hourly LMP data. The "LMP" for reactive power, A is not a concept currently

used in electricity markets; however, to show the potential of scheduling real and

reactive power with enhanced control in smart grids using DERs, we estimate A -=

0.1A . The LMP data is provided in $/MWh, and is converted to per unit analysis

($/pu) as:

SBase (4.25)
A# = # A$/MW 1e3

where SBase is the base value used for apparent power, to convert to per unit analysis.

Note that ISO-NE also uploads hourly day-ahead LMP prices, preliminary real-

time 5-min and hourly LMPs, and the actual real-time 5-min and hourly LMPs. Thus,

different simulations can be carried out to better understand the pricing data required

for best scheduling of DERs. This is outside the scope of this thesis, as the focus is

not on information availability for decision making, but is an interesting point worth

mentioning.

4.2.8 Electricity Demand Profiles

The IEEE test feeders all contain single period load data. In order to consider more

interesting and realistic problems with these test topologies, the provided load data

is treated as a base value, upon which a demand profile is used to generate multi-
5
The concept of the LMP and the structure of the US electricity market is discussed in more
detail in Chapter 5. This includes defining what the ISO is as a market and regulatory entity.

111
period load forecasts. A normalized base demand profile is obtained from the ISO-NE

reports on total recorded electricity demand for each five-minute interval [381, for real

power. As with the LMP data, the report is queried for May 14, 2019. The demand

data is averaged over 12 periods to give hourly demand data; see Appendix B.6 for

data.

This base demand profile is used to generate demand profiles for all N nodes

in the network. This is done to introduce some complexity into the model; rather

than assuming that all nodes follow the same demand profile, we perturb the base

profile and obtain more variability, as would be expected in a real load forecast. Let

a(t) refer to the base profile obtained directly from the ISO-NE report data. Then

the nodal real power demand profile for node j, apj(t), is obtained by introducing a
factor ofopj. This factor opj is a vector of normally distributed random variables,
such that oJp ~ A(0, 0.1) is of dimension T, where T is the number of time periods to

be simulated. Then apj(t) = a(t)(1 + S,j), resulting in every element of a(t) being

perturbed. This new profile is then smoothed using Gaussian filters to produce a

realistic demand profile. An example set of profiles is shown in Fig. 4-2, for a network

with 5 nodes, over a period of 24 hours.

It is assumed that reactive power consumption is related to real power consump-

tion (i.e. they are not independent values). To introduce additional complexity, nor-
malized demand profiles for reactive power are also generated, using the nodal demand

profiles. A perturbation vector composed of normally distributed random variables,

Qj ~ N(0, 0.01), is used, of dimension T, where T is the number of time periods to

be simulated. The resulting reactive power profile is aQM(t) = aprj(t)(1 + Qj).

4.2.9 Renewable Generation Forecasts

Renewable generators modelled in this work include distributed residential and com-

mercial PV, and wind farms. The NREL's System Advisory Model (SAM) tool was

utilized to obtain hourly generation forecasts for three renewable generator classes,

using the "Photovoltaics (detailed)" class. Wind generation data is also obtain from

112
Perturbed demand profiles for 5 nodes
1.05

0.95

0.9-

0.85

-
S0.8-

0.75

0.7

0.65

0.6'
0 5 10 15 20 25
Time, 24hr

Figure 4-2: Example demand profiles for a network with 5 nodes.

SAM, for a 600kW onshore wind farm. Generation profiles are queried for May 14 6.
See Appendix B.7 for the hourly generation profiles.

• Small scale distributed residential PV: This model is valid for up to 10kW
residential PV resources. Resource data for Phoenix, AZ 7, using the SunPower
SPR-X21-335 module, and SMA America (SB3800TL-US-22, 240V) inverter.
The DC to AC ratio is set to the default of 1.2. The desired array size is set to
4kWdc, giving a total AC capacity of 3.850kWac, and uses 1 inverter. All other
parameters are left unchanged.

• Large scale distributed residentialPV: This model is valid for resources larger
than 10kW residential PV. Resource data for Phoenix, AZ, using the SunPower
SPR-X21-335 module, and SMA America (SB3800TL-US-22, 240V) inverter.
The DC to AC ratio is set to the default of 1.2. The desired array size is set
to 12kWdc, giving a total AC capacity of 11.550kWac, and uses 3 inverters. All
other parameters are left unchanged.

" Distributed commercial PV: Resource data for Phoenix, AZ, using the Sun-
6
Note that SAM generation data is hourly data for the entire year. Thus, seasonal variations
can be readily captured using these profiles. The date of May 14 is chosen simply to align with the
ISO-NE LMP and demand data being utilized.
7
The generation data is only available for a few states, predominantly California.

113
Power SPR-E19-310-COM module, and SMA America (STP 60-US-10, 400V)
inverter. The DC to AC ratio is set to the default of 1.2. The desired array
size is set to 220kWdc, giving a total AC capacity of 179.58OkWac. All other
parameters are left unchanged.

Financial information for the resources is also included in the renewable generator
model. The capital cost and installation costs for the solar resources are obtain from
the default financial data in SAM: capital expenses (CAPEX) include the module
costs, inverter costs, and balance of system equipment; the installation expenses
include the installation labour, installer margin and overhead, and additional indirect
costs which consist of environmental studies and permitting. These values are given in
$. The annual operating and maintenance costs for solar obtained from the Annual
Technology Baseline report by NREL [39]. This is typically $25/kW/yr but can
be upwards of $40/kW/yr; a conservative value of $30/kW/yr is used for all solar
resources.
Financial information for the wind resource is also obtained from the NREL report.
We consider data for onshore wind for Techno-Resource Group (TRG)6 which has
average wind speed of 6.9m/s 8. The financial data lumps capital costs and installation
costs for an average total of $1640/kW [391. The annual operating and maintenance
costs are averaged to be $51/kW [39].
The NREL report also provides average capacity factors of 0.2 for solar and 0.4
for onshore wind [391.

8
The average desired wind speed for wind resources in New England is around 6.5m/s.

114
4.2.10 Statement of MOPF Problem

The centralized problem is formally stated as:

min fMOPF(Y)
y

s.t. I = ATIjfow (4.26)

AV = ZInow (4.27)

Ii = IT + jA, Vj E B (4.28)

V = Vr +jVi Vj E B (4.29)

P = aj + bj Vj E B (4.30)

Qj = -cj + dj Vj E B (4.31)

IP < P <P Vj E B (4.32)

p-? < pt<t Vj E B (4.33)

Vj E B, j j (4.34)
j-
J- j1
Vj E B, j = j# (4.35)
P.<P.ti<P.
J-<- pi Vj E B (4.36)

Vj E B (4.37)

V =1, = 0 (4.38)

MCE bounds of form (3.27)-(3.30) Vj E B (4.39)

P tan(cos- 1 (pfneg)) Qj Vj E BG (4.40)

Qj Pj tan(cos-1(pf ps)) Vj E BG (4.41)

rfAt Pj,t - Pj,t_ <rAt Vj E {BS U BG}, Vt E [T] (4.42)


1
Pit = -fPft - TfPi,t Vj E Bs,Vt E [T] (4.43)

0 P P,t jd Vj E Bs, Vt E [T] (4.44)


0 P Pf° Vj E Bs, Vt E [T] (4.45)

Vj E Bs, Vt E [T] (4.46)

bj,o = b ,r Vj E Bs, Vt C [T] (4.47)

115
where:

" S refers to the set of substations, T, to the set of feeders per substation s, and
B to the set of buses connected to (and including) feeder I at bus j#,

" T C B x B corresponds to the grid transmission lines,

* The notation (_) and (-) represent the lower and upper limits on local bus

variables;

" T represents the total number of time periods over which MOPF is being solved,

with At representing the length of each time period, in hours. Thus, T =

Hours to Schedule and t [1, ... , T]7


At

• The decision variables at time t are captured by the global decision vector yt

which captures the variables of each bus j at time t:

t = Ii Vr Vi Pt Qt at bt ct d Iflowr Ifowi Psd Psc

The decision variable over all time steps is denoted by vector y = [yl,vT; Y2,VT; ... ; yY,VT]•

The bold characters here denote vectors.

* bj,o is the initial capacity or energy level of the storage device at time t = 0, at

the start of the simulation

4.2.11 Decomposition for Distributed Computation

The OPF problem for the distribution grid with high penetration of DERs has high

dimensionality, dim(y) = (1ON+2M)T* [<], where M, N represent the number of grid

transmission lines and buses respectively, and [<D] denotes the number of maximum

number of phases in the network '. As previously discussed, it may not be tractable

for central solvers to reach optimal solution within a reasonable time. The use of
9
Typically a distribution grid will have lines which are three-phase, and peripheral lines which
service single- or two-phase loads. For simplicity of the calculation, here we assume that all lines
have the same number of phases, namely [<f] = 3.

116
distributed solvers can address this. In particular, we will make use of the PAC

algorithm again, as introduced in Chapter 3.

For the multi-period problem, the atomic vector, aj then takes on the form of

(4.48), where once again the last term are the coupling variables denoted by the ^

symbol. Note that we have omitted the subscript for time, t, on all variables inside

the vector aj,t for notational simplicity.

ai = [I IJ V Vj j i Qj aj bj Cj dj { f}owjk7 IflojkVk,{(j,k)}ETD

Psd k Vkj,(j,k)}ED f ow,ij, low,ij Vi,{(i,j)} (4.48)

where every vector element of aj is composed of the variable over all time steps, as

shown for a particular variable a:

a = [at=1 at=2 - at.T] (4.49)

With the decomposed problem, we can now employ the PAC algorithm to resource

scheduling problems for distribution grids with DERs.

4.3 Case Study Results

To evaluate the performance of the multi-period optimization, we consider distribu-

tion grids with varying penetration of DERs, solved for different time periods. We

consider 3 main case studies:

" Case 1: We consider the IEEE 13-bus network with fixed DER penetration

(demand response, renewable generation, and storage), and solve the MOPF

problem for different time periods: 2 hours, 5 hours, 8 hours, and finally 24

hours. We use these results to motivate the need for multi-period optimization.

" Case 2: We consider the IEEE 13-bus network with varying penetration of

DERs, and solve the MOPF problem for 24 hours. Namely, we consider net-

works with (a) only demand response; (b) (d) demand response and storage; (c)

117
demand response and renewables; and (d) demand response, renewables, and
storage. These simulation results help us understand the importance of storage

in active distribution grids.

e Case 3: We consider the IEEE 123-bus network with fixed penetration of

renewable generation, and solve the OPF problem over 24 hours. This test case

shows the scalability of the model, and the ability to consider more realistic

networks which are unbalanced and have flexible resources.

4.3.1 Case 1: Motivating the need for Multi-period

Here we consider the IEEE 13-bus network with small renewable energy penetration,

small demand response capabilities at 3 of the 5 loads, and 1MW of installed storage

capacity. The MOPF problem is solved for 2, 5, 8, and 24hours, and the results

are shown in Figs. 4-3, 4-4, 4-5, and 4-6 respectively. By comparing these results

we see that the storage unit is discharged more rapidly in the beginning of the day

when shorter time windows are used. While both the 8hr and 24hr simulations show

battery discharging in hours 1, 4, and 7, the 24hr simulation looks ahead to future

periods when electricity is more expensive (i.e. the evening, after 6pm) and charges in

additional periods, such as in hour 3. Further the 24hr period simulation is the only

one in which renewable generation is visible to the grid operator; the shorter windows

don't show any generation as solar doesn't become available until 8am. From these

results we see that longer windows are needed for efficient resource scheduling; else

a battery may be depleted too early on in the day, or it may not be charged when

electricity prices are low.

118
Time Period (hr)

1.4

1.2 t~o~ Eb""y

Time Period (hr)

Time Peiod (hr)

1.2

).4
Time Period (br)

Figure 4-3: Simulation results for 13-bus network over 2hrs.

Tim.ta Pmlod (hi)

7
OW MM--J
).2

2 Tim Pidg (h) -

E Uu -eio -br
Tim Peiod (hi)

l.2

2 Tim Pe~od (Mr)


- -_ A -_

Figure 4-4: Simulation results for 13-bus network over 5hrs.

119
Tie Period (h)

ir~ 2 3 4
Tim Period (hIa

-~ __

Time Period (hr)

I~

- - - - - -

-
.-L
I2 3 m P 6 7
Time Period (br)

Figure 4-5: Simulation results for 13-bus network over 8hrs.

Tim Piakid (hi)

23mw OWN." (hi)p

1 2 3 4 S8 10ii 12 1.31411II1718192421222324

VggggggggggWes 11 u 11 1
1 2 3 4 5 6 7 8 9 to 11 T 2P 1idr 14 is 16 17 is t0 2D 21 22 23 24
Tume Period (h)

1 2 3 4 b 6 7 8 9 10 11 1 3 14 16 t 1 - 17 l 19 2D 21 22 23 24

Tim. Period (hi)

Figure 4-6: Simulation results for 13-bus network over 24hrs.

120
4.3.2 Case 2: Understanding the need for Storage

Here we consider 4 different combinations of DERs present in the IEEE 13-bus distri-
bution grid, and also vary the amount of storage and/or renewable generation. Data
for the simulations is provided in Appendix B.2 for the network default configuration.

Case 2.a: DR

In this test case, the only DER present is demand response, which is available at 5 of
the 7 loads. The amount of available DR varies from 10%-50% of the total load at the
node. See Appendix B.2.1 for full data. The simulation results in Fig. 4-7 over the
24hr horizon show roughly 10%-15% curtailment of load (through DR) throughout the
network, for every hour. This is quite a substantial amount of curtailment, especially
given that it persists throughout the day. A more reasonable DR strategy would
curtail load only for a portion of the day, or would shift load from one hour of the
day to another.

Case 2.b: DR and Storage

In this test case, both demand response and storage are present in the network.
Demand response is available at 3 of 5 loads in the network, and a battery of 1MW
capacity with initial charge of 150kW is present. See Appendix B.2.1 for full data. The
simulation results in Fig. 4-8 show steady use of DR capabilities throughout the day
- much like Case 2.a - and storage being continuously cycled. The battery is charged
during periods of lower cost, and is discharged when prices are higher, namely during
the morning hours of 7-9am and the evening after 6pm. In reality, the storage device
may be operated with more limited cycling - rapidly switching between charging and
discharging mode can wear the battery down. This suggests that the battery wear
cost is not appropriately selected; it likely does not account for installation costs, and
externalities such as environmental assessments and permitting fees.

121
9J WE1 LJ LLJI LJ LJ II I II LJ -TTTA
2 3 4 5 6 7 9 9 10 12 Id
(13 1 5 16 17 1 19 20 2 1 22 22 24

Time Piod (h)

a 3 o 5a 7 9 10 11 12 13 14 15 1 17 Ii s 19 20 21 22 2.2b
r~me Period (br)
Tim P2lod (h)

I 2 3 4 7 9p v We 121 141i is 171u 19 02d 223 2

Th reslt fo the two test caeWr eysmlradaesoni is- _

Casem.c: Meanwh DRieuwag h

Inrthismestcae, ut averagidern arombinoof a lad renewmabl eect e

qiureit of7
Fiureit 4-7 imlor
imulatied elrcty duering periods for 13-unetork
eltiit overingh e bnetok (namel high
8amhDRto

6pm) .c:D Meawhle DRised houhuetedy,vrinblghl n oadmn

curtailmtentc, ut averaingr areoundnat7% of ota lad Oenewmayl epectlower Ri


uetilanduringmeriods
detiland commgerial solPare enrin,bu thohut
solar aenerinle theuaout
theunt ofDR greaDins
andDR retl
rmis resntivl
Snsan a, t is aers. lst that policy: curtin is usero educ he of

conant. Agin,orthidi nctity reitigD prooliy culrailneladiove (aeey hour to

122
= hW-W9. MJ-W~fty

1 .5 15 17 18 19 20 21 22 23 24
1 2 3 4 5 6 7 8 9 10 11 .3

Time Period (br)

1 2 3 1 5 9 to II 12 13
Trim Period (hr)
1I I 18 I 1 8 19 20 21 22 23 24

capabilities and 1MW installed storage capacity.

the day is not feasible. A more realistic policy could include having a limit on the
amount of curtailable load per node participating in DR, either over a 24hr period or
over a week. This would ensure that grid operator only utilizes the DR resources when
it most needed. Further, DR is currently modelled as a fixed percentage applied to
load over every hour. This is not a realistic model. Rather, the percentage of allowable
curtailment should vary throughout the day, and some base amount of electricity is
likely always to be consumed by loads. Better development of DR policies is outside
the scope of this thesis, but these simulation results show great potential for aiding
in these decisions.

Case 2.d: DR, Renewables, and Storage

In this test case, we consider the presence of all resources (DR, renewables, and
storage), with varying installed storage capacity. The network has DR present at

123
___I, ..-b .im 6

1 2 3 4 5 a 7 8 9 1 10 11 12 1 4 1; 1 17 3i 1 20 21 22 23 24

o - 0

1 2 3 4 5 6 7 8 9 10 11 P1 (r 14 15 0 17 18 19 20 21 22 23 24

Tam Plod (hr)

::L L IL JI I I I I LJ I h hIm
Thu~ Pu1hod (ho)

1 2 23 4
Tim IM (ho)

M in C. 4WIlOW
F 4- Sn ovr 2 period12 14 16 4h 17bs o9rk wt D
:.

J 0 2 2 23 'L
1 o 1 S
TIMM Period (br)

3 2 4 0 6 71 W sl V1, I 12 1 4attery 19cte 244 1 with 2

500kW initial charge, 0.5MW with 100kW initial charge, and 2MW with 300kW initial
charge. Note that in the last two test cases, the day begins with the battery near or
at the minimum charge it must maintain through operation (due to minimum SOC
requirements). See Appendix B.2.1 for full data.

The results for these configurations are shown in Fig. 4-11, 4-12, and 4-13 re-
spectively. Similar to other test cases, we see that DR resources are used steadily
throughout the day, while solar PV generation is used once it comes available from
8am to 6pm. The use of storage is the most interesting between these test cases: the
hourly LMP data is the same between all 3, while the specific demand values vary
based on the generated demand profiles.

In all three cases, the battery is discharged during the night hours (6pm and
onwards), even when there is limited capacity available (as with the 0.5MW case).

124
0 1 2 1 4 1 6 17 IS 19 20 21 22 23 24
1

---

15 10 17 1s I9 20 21 22 3 2
9 10 11 92 M 12 4
1

Ion MMW)
maPil~
2n

is 19 17 18 19 20 21 32 23 24
5 06 7 a 9 10 91 92 13 14
1 2 2 94
Tam Palod (hr)

0NN
4
1 2 2 1I 9 202122323
4 0a79to 19121 141is141I

Time PO'id (hr)

Figure 4-10: Simulation results over 24hr period for the 13-bus network with DR
capabilities and higher PV penetration (265kW).

These are the hours when the LMP is the highest. Interestingly, when storage capacity
is limited as with the 0.5MW capacity or is large as with the 2MW installed capacity,
there is less cycling between charge and discharge, as compared to the case with 1MW
installed capacity. When limited, the battery is used only for the highest prices during
the day, and charged at the lowest prices, both in intervals of around 2hrs. When
very large, the battery can be charged when electricity is cheaper and the stored
power can be discharged over more periods, both in intervals of around 3hrs. For the
middle case of 1MW installed capacity, the battery is discharged over more periods
than for the 0.5MW case, but requires more charging than the 2MW case in order to
meet network loads. These simple results show the importance of system planning,
which must include battery placement and sizing for networks with DERs and varying
demand profiles. Else, the resource will be strained to meet requirements, or may be
oversized and too expensive.

125
1 2 8 9 t0 01 12 13 11 15 0 17 i1 I 20 21 2 2
rt mod (hi)

W--(Dbha)

1 2 2 4 0 8 7 8 0 10 i1 12 1tr
3 14I 15 10 17 18 19 20 21 22 23 24

The Podd (hr)

capabilities,8P 9 p0 e1 n2 of135 1k 15 01 .7 stora 20 2g 22caacty


TIMe (he)
Sal I ~ googol Ihmh

20
1 2 3 4 567 9 02821o1 (~3N4is 1617is 18No21222324
Time Pefed (o

Figure 4-11: Simulation results over 24hr period for the 13-bus network with DR
capabilities, PV penetration of 135kW, and 0.5MW storage capacity.

4.3.3 Case 3: Scalability of the Model

Here we consider the IEEE 123-bus network which has been modified to include high
penetration of distributed renewable generation, in the form of residential solar PV
(installed capacity of 179kW). Full network data is available in Appendix B.3 for
the default network configuration. Here a very simple problem of fixed loads (no
DR) and distributed renewable resources is considered. Note that this is still an
optimization problem as the renewable generation can be curtailed. The results are
shown in Fig. 4-14, where once again, renewable generation is utilized during the
mid-day when generation is available.
For the network, we have N = 119, M = 118, T = 24 and 3-phase network, leading
to (10 x N + 2 x M) x T x 3 = 102672 variables which need to be solved for. This is
quite a sizeable problem, for what is still a small model network used as an academic
example. A real distribution grid will have many more nodes, and as such, be a much

126
- WE [an lki
13 14 15 16 17 is 19 20 21 22 23 24
10 11 12
1 2 3 4 5 6 7 8 9
Time Period (hr)

2 0
Peio (hr)
Time

1 2 3 4 5 6 7 8 9 1 11 1 1 14 i5 16 17 Is 19 20 21 22 23 24

I I J L LJI I LL J lI I J L L_

1 2 3 4 5 6 7 8 9 10 11
Fsr
12 13
eriod (
14
fn)
15 16 17 is 19 20 21 22 23 24

22 2324
1 2 a 4 5 T 8 D 10 11 12
Ti... Period (hr)
13 14 1 I 17 I 1 8 19 2 0 21

123

Figure 4-12: Simulation results over 24hr period for the 13-bus network with DR
capabilities, PV penetration of 135kW, and 1MW storage capacity.

larger problem.

127
A

1 2 23 4 5 6 7 8 9 to 11 12 13 14 is i6 17 3s 10 20 23 22 23 24
Tim Niod NOi

Tom P*iiod (hr)

123 011321s14153617Is1920212222 24
Time PaOod (hr)

1 2 3 4 6 7 a 9 0 3 12 13 it Is 5I 1 7 1 6to 2 3 21 22 2 24
Time Pdd (hk)

Figure 4-13: Simulation results over 24hr period for the 13-bus network with DR
capabilities, PV penetration of 135kW, and 2MW storage capacity.

1 2 3 4 5 6 7 8 1 30 11 12 12
ime Pusod (ur)
34 1S 3s 17 Is 12 2 3 ~ umorwOm iundely
9-wflhohoupdw)

3 2 3 4 5 6 7 8 9 0 36 i 12 13 34 15 1s 17 to 20 1 3 2
Time PMuOd (hr) 3 L.

3 3 4 6 7toI 1 11 1 2 1 3 4 14 I 17 12 1 2 0 1 23 U
raw. Pulod (hr) WA I.

1 2 3 4 5 a 7 6 0 30 11 12 13 14 is15 1 37 is 19 20 21 22 M3
Tim. Peuod Chi)

Figure 4-14: Simulation results over 24hr period for the 123-bus network with installed
capacity of 179kW of renewable generation.

128
Chapter 5

Using Transactive Energy: Proposal


for a DSO-Centric Retail Electricity
Market for Smart Distribution Grids

In this chapter of the thesis, we shift away from day-ahead resource scheduling (i.e.

hourly basis, or day-ahead schedules) and navigate towards real-time decision making

and electricity pricing. The PAC algorithm introduced in Chapter 3 can once again

be utilized to solve the OPF problem; this time however, the results of interest are

both primal and dual variables. The primal variables once again describe the opti-

mal scheduling of generating units and loads. The dual variables now give us the

retail price for electricity - namely, the shadow prices tell us how much a customer

should pay to consume electricity, and how much a DG should be paid for generating

electricity.

We begin by providing background information on the structure of the US electric

power market 1, then proceed to describe the proposed retail market and present

results validating the design.

'While the proposed retail market mechanism can be used in any electric system, the focus within
this thesis is on the US electric power market.

129
5.1 Introduction to US Electric Power System

The US electricity grid is composed of three main interconnections, which are con-

nected to each other via high-voltage DC power transmission lines (DC tie lines) or

variable-frequency transformers (VFTs). These tie lines and VFTs isolate the in-

terconnections and allow them to operate largely independently, but still allow for

some electricity transfer as needed for emergency balancing. The three interconnects

consist of the Eastern Interconnect, the Western Interconnect, and the Electric Reli-

ability Council of Texas (ERCOT). Both the Eastern and Western Interconnections

of the US are linked to the Canadian power grid.

The US electricity grid is overseen by North American Electric Reliability Cor-

poration (NERC) and Federal Energy Regulatory Commission (FERC), which are

in charge of the creation and enforcement of reliability standards, operational re-

quirements, and policies. NERC is a not-for-profit international regulatory authority

covering the US, Canada, and the northern portion of Mexico. NERC is the elec-

tric reliability organization (ERO) for North America, and oversees the reliability

and security of the grid. NERC is overseen by FERC in the US, and governmental

authorities in Canada. [40] FERC is an independent regulatory agency which over-

sees interstate transmission of electricity, natural gas, and oil. Under the Energy

Policy Act of 2005, FERC's responsibilities include regulating the transmission and
wholesale electricity markets, and overseeing the reliability of high voltage interstate

transmission system 2 [411


Within the interconnects, there are three entities which oversee the operation of

the grid and ensure reliable and economic grid operation:

• Independent System Operator (ISO): Coordinates, controls, and monitors the

grid. ISOs typically operate within a single US state or multiple states, but

over smaller geographical areas as RTOs. The ISOs were formed upon recom-
2
Note that here only two of the main responsibilities of FERC are considered, as we are concerned
only with the electric grid operation and markets. FERC has additional responsibilities including
overseeing mergers and acquisitions (M&A) of electricity companies and various other tasks per-
taining to natural gas, oil pipelines, hydroelectric projects, and environmental considerations of
electricity production and transportation tasks.

130
mendation by FERC, and act as an independent Federally regulated entity.

* Regional Transmission Organization (RTO): Is a transmission system operator


(TSO) with similar functionality as the ISOs, but typically over larger geograph-
ical areas. The RTOs were voluntarily created upon the suggestion of FERC in
1999, and act as independent governing bodies.

" Balancing Authority: Controls transmission and generation within its region to
ensure supply meets demand at all times, throughout the network. Balancing
is primarily done by turning on/off generators, and/or importing/exporting
electricity from neighbouring balancing authorities. Within an interconnect

there are multiple balancing authorities. All RTOs in the US are also balancing
authorities, and are subject to the reliability standards issued by NERC and
approved by FERC. ' 1421

The roles of ISOs and RTOs are similar, as they both operate regional electricity
grids, oversee the wholesale and retail electricity markets to ensure open access for
supply, and provide reliability planning. However, RTOs have greater responsibil-

ity for the transmission network. Within North America, there are currently seven
RTOs: California ISO (CAISO), ISO-New England (ISO-NE), Electric Reliability
Council of Texas (ERCOT), Midcontinent ISO (MISO), New York ISO (NYISO),
PJM Interconnection (PJM), and Southwest Power Pool (SPP).

5.2 US Electricity Markets

The US electricity markets have two components: wholesale and retail. Wholesale
electricity market (WEM) encompass electricity sale and exchange between electric
utilities and electricity traders. The retail market involves the sale of electricity
to end-use consumers, which includes large-scale facilities, small-scale businesses and
buildings, and residential units. A utility (or more generally known as a Load Serving
3
Note that the Electric Reliability Council of Texas (ERCOT) is a unique entity in that it is a
balancing authority, interconnect, and RTO at the same time. Also note that ERCOT is not subject
to FERC jurisdiction.

131
Wholesale Electric Power Markets

*CS auoaEPM
aMISO 4SPP
0 ISO-NE E ERDT
Soume:FederalEwVerj Regulatry Comision U NIso

Figure 5-1: Graphic showing the wholesale electric power markets in the US. The grey
regions are under traditionally regulated wholesale markets. The coloured regions are
the ISOs/RTOs where deregulated competitive markets exist. [2]

Entity (LSE)) will purchase electricity from the wholesale market (at wholesale price)
from producers and/or traders, and resell the electricity to end-use consumers.

Within the US, both traditionally regulated electricity markets and competitive
markets exist, as shown in Fig. 5-1. In the traditionally regulated markets, utilities
are vertically integrated, and are responsible for (and own) the generation, transmis-
sion, and distribution systems to serve consumers. In competitive markets, which
are overseen by the ISOs (and RTOs), independent power producers and non-utility
generators trade power, which is purchased by LSEs who sell power to consumers.

Similarly, within the retail market space, both traditionally regulated and com-
petitive markets exist, as shown in Fig. 5-2. In traditionally regulated retail markets,
consumers cannot choose who to purchase power from or where their electricity is
generated. In competitive retail markets, consumers are given the choice between
competitive retail suppliers; these can be directly from power producers or an LSE.
Note that even in competitive retail markets, some municipally-owned utilities may
not offer customer retail choice; different states and jurisdictions structure the market
in different ways. [2]

132
Retail Electric Power Markets

-+

9 Traditionally Regulated
N compeitve

Figure 5-2: Graphic showing the retail electric power markets in the US. The grey
regions are under traditionally regulated wholesale markets. The coloured regions are
states where deregulated competitive markets exist. [2]

5.2.1 Market Structure and Renewable Energy

The structure of the wholesale and retail markets impacts the ability for renewable
generation to become part of the electricity mix. In traditionally regulated markets,
the utilities must invest into renewable energy or "green pricing" products which may
include renewable energy certificates (RECs). In these markets, renewable electricity
is typically more costly, and barriers to entry are higher for renewable generation
as decisions are made top-down. Within deregulated and competitive markets (for
both wholesale and retail), customers have electricity choice and so have more power
over how much renewable energy or green pricing products are available; a higher
demand for these products will encourage LSEs to purchase electricity from green
resources. Finally, the market structure also influences whether customers can take
part in power purchase agreements (PPAs) with renewable resources '. For any PPA,
4
Most renewable/green energy projects in the US are supported on the basis of PPA. The PPA
is a contract between the electricity generator - in this case a renewable generator such as a wind or
solar farm - and an electricity buyer. They are typically long-term contracts which outline the sale
and price of electricity, and schedule for delivery. Financial counter parties can also take part in
PPA agreements as they can absorb the higher risk of engaging in a PPA with a renewable project,
which have uncontrollable and intermittent generation. PPAs are overseen by FERC.

133
Generator End user
Reseller
i.e., electricity utility companies,
competitive power providers
and electricity marketers

Figure 5-3: Infographic of the wholesale and retail markets from PJM, under a com-
petitive market framework [3]. Other ISOs/RTOs have the same general structure.

the project must be within a competitive wholesale market. For physical (direct)

PPAs, the consumer must also be within a competitive retail market and the project
must be interconnected with the consumer's ISO. For financial PPAs, the consumer
can be located anywhere in the US. [2]

5.2.2 Wholesale Electricity Markets

Within this thesis, we consider the more interesting problem of integrating DERs
within the distribution grid, many of which are behind-the-meter, through market
mechanisms. To do so, we consider regions with competitive wholesale electricity
markets, where more complex market structures exist. In this section, we introduce

the different electricity markets which work together to create the WEM. Within com-
petitive wholesale electricity markets there exists energy markets, capacity markets,
and ancillary services markets. These will be briefly described below.

Energy Market

The energy market is the largest component of the WEM, and deals with real-time and
day-to-day energy balancing. This market ensures supply meets demand, by balancing
the needs of buyers, sellers, and other market participants. The energy market is

134
I

.4-3o nours riounjy

Day-ahead D dEnergy and Frequen


Schedulng Day-ofdispatch Regulation to

Real-time

Figure 5-4: Typical timeline for planning and operations within the US electricity
system. Markets include day-ahead and real-time segments.

composed of the day-ahead and real-time energy markets. A general timeline for grid
planning and market operations is presented in Fig. 5-4, noting that the focus of this
thesis is on the markets side of the figure. Note that in some WEMs, the price of
electricity can be predetermined through bilateral contracts, which are between an
electricity buyer and a seller, determining the price of electricity, and the quantities
to be purchased (or sold), rather than through organized wholesale markets [3].

Day-Ahead Market The day-ahead energy market is a forward market: the prices
for electricity are set on an hourly basis (typically) for the next day of operation. Typ-
ically the day-ahead market closes 24-36 hours in advance of the operating day. The
hourly prices are determined through an optimization problem, which seeks to mini-
mize costs incurred, using the offers from generators, and bids from power consumers
'. Generally, the lowest-priced generators are "cleared" first (commitment to pur-
chase power from them over the next day is made), save for any resources which
may have prior purchase agreements. Generator offers are cleared from the lowest-
to highest-priced offers until the demand bid is met, along with some extra reserves.
The prices and schedule in the day-ahead market are binding, and allow buyers and
sellers to hedge against price volatility in the real-time market. However, deviations
from the schedule will be cleared in the real-time market. [3,43]

'Note that this includes both LSEs and market-related financial transactions.

135
Real-Time Market The real-time energy market is a spot market: the prices
and quantity of electricity is determined for immediate procurement and delivery
to balance differences in day-ahead commitments and actual real-time production
or demand. The real-time market can clear anywhere between every 5-15 minutes,
depending on the ISO under which it is coordinated 6. Any deviations from the
schedule determined in the day-ahead market is cleared in the real-time market.
The real-time market establishes a locational marginal price (LMP) that is paid or
charged to participants in the day-ahead market for demand or generation which
deviates from day-ahead commitments 143]. Note that the real-time market can have
significant volatility, but the average price of electricity remains fairly stable.

Locational Marginal Pricing This is an integral component of the energy market


and allows wholesale prices to reflect the locational differences within the power grid.
More specifically, the different prices reflect the operating characteristics and major
constraints on the transmission system, as well as losses resulting from the physical
transmission grid. In a lossless network, the LMPs at all points would be the same.
Further, LMPs provide information on congestion in the network - areas of conges-
tion will have higher LMP prices. Further, the price of generation across an ISO's
jurisdiction will also vary; thus, the LMP must reflect these regional differences, as
all loads cannot be served by the lowest price generator(s). LMPs give more granular
information on the entire grid, and are important as they account for more than just
the price of generating the electricity.

Capacity Market

The capacity market is a smaller component of the WEM and is concerned with
near long-term energy needs. Through the capacity market, the ISOs must ensure
there will be enough power supply in the future, to meet the forecasted average and
peak demand. Capacity markets are forward markets where contracts are determined
through Forward Capacity Auctions (FCA) which are held annually, three years before
6
ISONE and PJM clear every 5 minutes [3,43]. CAISO operates real-time markets which dispatch
power every 5 and 15 minutes [44]

136
the operating period (for both ISONE and PJM [3,43]). In the auction, different

suppliers compete to obtain commitments to supply a given capacity of energy, in

exchange for market-priced capacity payments. These resources commit to deliver

electricity (or limit demand for demand-response resources) when needed, especially

in the case of emergencies, for the year in which they are committed. The structure

of the capacity market supports the development of new resources to meet future

electricity needs, and help retain existing resources. Resources which clear in the

capacity market receive a stable revenue stream, even those which only serve peak

demand but don't run all year.

Ancillary Services Market

The ancillary services market work in tandem with the energy market to ensure that

supply meets demand at all times. This balancing is done through the regulation mar-

ket and reserves market, which make up the ancillary services. Other ancillary services

include voltage regulation and black-start, but there are no clear market derivatives

for these functions. In some competitive WEMs, the ancillary services may be pro-

cured on a cost-based method, rather than through a structured market. However,

having ancillary services markets ensure that resources are priced adequately under

shortage conditions, and provides structured market derivates for operating practices

related to reliability 145].

Regulation Market The regulation market operates on the seconds timescale and

corrects short-term, unforeseen fluctuations in supply/demand and focuses on the re-

liability of the system. The regulation market includes Automatic Generation Control

(AGC), which adjusts generation and consumption of participating resources every 2-

6 seconds 7, in response to automated signals. This may also be called the regulation

reserve [45].

7ISONE
requires AGC every 4 seconds [43]

137
Reserve Market The reserve market operates on the minutes timescale and meets

demand in the event of unexpected loss of generation or transmission resource. It

is composed of spinning and supplemental reserves, which both use resources which

have committed to reserving a specific percentage of their generating capacity to

meet emergency needs. Spinning reserves are a contingency element, which consist

of resources already synchronized with the grid to reach targeted output within 10

minutes. The supplemental reserves consist of resources which may or may not be

synchronized with the grid, but can be ramped up to supply the required energy

within 10 minutes. The reserve market is necessary for emergency situations and

ensures the reliability of the grid.

5.2.3 Participation of DERs in Electricity Markets

The current practice in the US for the integration of DGs is for them to participate

in the WEM [46]. While this participation largely pertains to DGs, certain amount

of participation also occurs from DR units and storage devices. FERC order 841

takes steps towards standardizing the participation of storage resources in wholesale

energy, ancillary services, and capacity markets, by treating storage as a generator

[471. Despite this, there is no clear treatment of value stack benefit for storage, or
aggregated distribution connected storage.
Further there is limited ability for small-scale DERs and behind-the-meter re-

sources to participate, especially in grids where Advanced Metering Infrastructure

(AMI) is not available. While some DER participation is allowed in the WEM, this

is primarily for large-scale resources or through aggregators. However, there remain

constraints on minimum resource size, capacity requirements, and/or ramping rates

which still limit DER participation. Different ISOs/RTOs have made their own de-

cisions on how to treat different DER classes. For example, CAISO allows demand

response to participate and submit bids, with aggregation of a minimum of 100 kW,

as long as these resources do not inject energy into the grid. In comparison, most

other system operators require aggregations to be at least 1 MW. These differences

prohibit the easy integration of small-scale DERs into the electricity system.

138
Demand response participation in the WEM is also documented by PJM, as shown
in Fig. 5-5. From Fig. 5-5a we see that DER units which participate as DR primarily
take part in the capacity market. The report goes on to detail that most DERs
participating as economic DR are certified to provide ancillary services [4]. This

looks very promising for DERs in the PJM region. However, we note that from

Fig. 5-5b, all of the behind-the-meter participating units are generators which use
carbon-based fuels; there is no participation of solar PV or storage in these programs,
despite their penetration in the grid.

Limitations of Current Market Structure

One of the central features of the emerging Smart Grid is a highly transformed dis-
tribution grid with a high penetration of DERs. Within New England, the expected
growth of solar PV shows high penetration of small-scale rooftop solar resources, see
Fig. 5-6. Following this trend, the current electricity market structure - namely only
having a competitive WEM - may not be sufficient for efficiently integrating these
resources and realizing efficient and reliable power delivery. Thus these highly flex-
ible, low-cost, and distributed resources will be under-utilized if the current market
structure persists.
The WEM largely takes on a centralized architecture, with the ISO/RTO oversee-
ing the market. Multiple participants take part, but the overall optimization problem
which considers the resource allocation based on the bids made by generators and
consumers, is solved in a centralized manner. As discussed in Chapter 2, the in-
creased penetration of DERs is pushing the structure of the distribution grid towards
a decentralized - perhaps distributed - form. Thus a centralized approach which con-
siders all resources seems to be inefficient, and such large-scale optimization problems
can quickly become intractable. Thus, we may want to move towards decentralized or
distributed architectures for the market as well as the computations associated with
decision making.
As briefly introduced in the discussion of DER participation in the WEM, we
note that minimum resource size requirements force DERs to be aggregated and

139
7

/AiI K
K

K Total for bothprogps


1,537 MW

(a) Diagram of the MW capabilities of DERs registered in DR programs, showing the


primary participation of DR-DERs in the capacity market.

Natural Gas
15.4%
Waste Products, 0.25%
Gasoline, 0.2%
011, 0.1%
Propane, 0.1%

(b) Fuel types for behind the meter DR generation units which participate in the capacity market as
DR units for DY 2018/2019.

Figure 5-5: Data from PJM for the DY 2018/2019, for DERs participating as DR [4].

140
Solar PV Projected Growth 6,700
New England, 2019 MW

2,900
MW

40W
Jan 2010 2018
IIi 2028

Figure 5-6: Plot showing the expected growth of solar PV in New England, as of
2019. This is primarily rooftop and small-sc'ale solar resources.

bid directly into the WEM. This can be limiting for many DERs, and also further
exacerbates the immense computational requirement of coordinating a large number

of resources. We reiterate that the transmission system consists of far fewer resources

than a smart grid with high penetration of DERs may have.

The lack of a real-time retail market also means the volatility of renewables (or
similar resources) is not reflected in hourly energy prices. A plot of renewable energy

production in a sample day for the New England system is shown in Fig. 5-7. Over the
course of the day, the output from wind and solar varies greatly. Further, the demand

for electricity, which is not shown on this plot, will also vary. Using a fixed-rate pricing
structure means the flexibility of DERs and the variability in their availability will
not be adequately accounted for. Figure 5-8 shows a sample set of price-demand
curves and highlights the inefficiencies associated for fixed retail prices, where both
supply and demand will vary continuously throughout the day. During times of high
demand, resources should be paid more for meeting the requirements (also for peak
demand hours), while during times of low demand, the resources should be paid less.
This picture becomes more complex when considering the flexibility of DR units,
which won't be adequately compensated for the services they can provide under a
fixed pricing structure. When demand is high and generation is low, DR units are
more valuable to the system operator, as they can be leveraged to help balance the
system, and so should be paid accordingly.

141
Renewable Generation, MW
400 New England, Sept 12 2019

200

-Wind
Solar

0
00hr 12hr 24hr

Figure 5-7: Plot showing the variability in renewable energy production over a day
in New England.

P Demand,,.k
PP~
Supply

DemandoM

Qo.M Qn Q
Figure 5-8: A set of price-demand curves showing the inefficiencies of using a fixed
retail price. Further, fixed prices can't leverage the flexibility of DERs.

Finally, these DERs can be owned and operated by different stakeholders. The
efficient and reliable operation of the distribution grid thus requires an overall market

structure that allows the procurement and integration of power generation from these

DERs, while maintaining data privacy. A retail market that oversees the participation
of DERs in the distribution grid and implements a suitable mechanism for their
scheduling and compensation is highly necessary. Figure 5-9 shows a schematic of
the desired retail market structure and interactions between different stakeholders,

142
including the WEM and the DERs.

Wholesale Electricity Market


Prices Schedules, Bids

Retail Market
Price4 Schedules Prices Schedules
Distributed Generators (DG) Demand Response (DR)
Renewables Residential Industrial

CHP Storage
Trains
o

Figure 5-9: A market structure in the form of a retail market within the distribution
grid is necessary to best utilize the DERs within the network.

The need for such a market has gained considerable traction, with various ap-
proaches being taken. The concept of transactive energy is one such promising design,
whereby a service-based value of power is used to influence desirable behaviours from
various autonomous agents, which include prosumers and DERs at the gridAA2s edge,
at fast timescales [9,101. In this way, transactive energy is providing a link between
the physical power flow in the grid, and market derivatives and regulatory constructs.
In this framework, an independent agent does not have to cede control of its DERs
to a centralized authority; rather it reacts to price signals to provide services to the
grid, for which it will be compensated.
As the number of DERs and prosumers increases, more structure is warranted to
coordinate and carry out the underlying transactive energy schemes. New operational
entities such as a Distributed System Operator (DSO) and a retail market coordinated
by DSOs may be needed. The DSO can take on various roles, including maintaining
system reliability, facilitating transactions between agents and aggregators, and acting
in the capacity of a utility whereby the DSO procures energy and coordinates a retail

143
market [481. The latter is the focus of this thesis, in which a structured set of market
interactions are proposed for the distribution grid, each one of which may be viewed
as a transactive energy scheme. A discussion of approaches taken in literature and
the design of the proposed retail market are presented in the next two sections.

5.3 Literature Survey

The coordination of power delivery as well as the overall market design as the number
of DERs begins to increase are areas of active research [49-75]. The literature herein
can be broadly grouped into centralized [52-58], decentralized [59-64], and distributed
approaches [65-75], with this paper being a member of the third category. Reference
[51] is a survey paper that gives an excellent overview of different market approaches
to integrating DERs, particularly focusing on prosumers and flexible loads.
References [52-581 consist of centralized market perspectives. A hierarchical mar-
ket structure is proposed in [52] and [53] to interlace the operation of the WEM with
the retail market, where a Distributed Network Operator (DNO) is responsible for
operating the market and load aggregators for smooth interactions with the WEM.
In [54] the optimal dispatch of DR units in a distribution grid occurs through collective
participation in the WEM, while in [55], competitive participation for the provision of
ancillary services is used. The authors in [56] propose a centralized market where the
DSO schedules the day-ahead transactions for DERs in the distribution grid. Bids
are made by prosumers, generators, and microgrids, and both the DSO market and
WEM are simulated iteratively until both wholesale price and distribution-level Lo-
cational Marginal Prices (d-LMP) are determined. The DSO is assumed to maximize
their payoff. In this design, DC power flow is used, which can yield large errors for
the highly unbalanced distribution grids. Meanwhile, [57] and [58] use an iterative
procedure to solve the Optimal Power Flow (OPF) problem based on a Three-Phase
Current Injection Method (TCIM), and determine d-LMPs per phase per bus through
difference of power constraints. Due to the centralized perspective proposed in these
papers, agents are required to disclose operating constraints and utility functions to

144
a central entity. In doing so, the agents lose data privacy; additionally, in market de-

signs where the DSO is maximizing its own profit, this acts against the best interest

of the market players. In addition, such a calculation of d-LMPs for a distribution

grid is computationally significantly harder than the typically smaller sized transmis-

sion grid, and the central optimization problem can quickly become intractable with

large number of DERs participating. Finally, these papers focus largely on d-LMP

calculation, rather than proposing holistic market interactions.

An attractive alternative to centralized perspectives is a decentralized one. Herein,

each agent is assumed to use local information to make decisions, but is otherwise

unaware of the presence of others and do not therefore communicate with them. Such

decentralized EMS are proposed in [59] and [601, to coordinate the operation of DERs
and networked microgrids in the distribution grid. Decentralized market designs have

also been proposed in 61-641. The authors of [611 introduce a decentralized market

with bilateral trading rules which result in fair allocation of the line losses. However,

the relation between trading rules and optimal dispatch of DERs are not addressed.

More recent works are those in [62-641, each of which consist of different approaches.

The market in [62] is a peer-to-peer (P2P) structure in which different agents bid in

the marketplace to determine day-ahead energy schedules. The market in [63] uses

blockchain to facilitate energy transactions, while [64] makes use of game-theoretic

approaches to determine real-time d-LMPs. All of these proposed markets have either

limited interactions or do not accommodate interactions with the WEM. The main

disadvantage of decentralized solutions simply stems from the fact that each agent's

decision is local and therefore predicated on the assumption that coupling with others
is weak. This leads to limited applicability without intervention from a centralized

decision maker and therefore cannot be scaled up, especially as the number of DERs

increases.

This brings us to the third category, of distributed solutions, where the agents

communicate with peers/neighbours to achieve a common objective, thus potentially

leading to an optimal global objective being achieved. Since distributed methods

rely primarily on local computations at each node and P2P exchange of information,

145
they are computationally tractable. Moreover, if well designed, they can be resilient

to communication link and single-point failures, and can preserve the private infor-

mation of the DERs, while still realizing network-level objectives. Papers [65-691

correspond to this category. The work in [651 introduces an algorithm with a parallel

architecture that can concurrently yield price discovery along with optimal scheduling

of resources in both transmission and distribution grids. Although the problem for-

mulation is very detailed, the proposed algorithm is quite complex and thus practical

implementation is challenging. In [66], a day-ahead energy market is run by a DNO,

using the predictor corrector proximal multiplier method. The DNO maximizes its

profits while determining a retail price for the DERs. In the proposed structure,

all agents share the same retail price, leading to inefficient pricing; since agents are

providing different grid services, they should be compensated based on the need for

their specific flexibility during the scheduled period. Many papers such as [67-69] use

consensus based approaches. In [67], a consensus-based algorithm is used to discover

electricity prices, when neglecting network constraints and congestion limits. In [681,

a cooperative energy management algorithm is designed, whereby local prices and

generator set points are determined; however, generators must share marginal costs

with neighbours in order to determine the global price of energy, reducing privacy

in the network. Further, the interpretation of this global price is unclear. Finally,

consensus+innovations approaches are used in [69] to address state estimation, eco-


nomic dispatch, and OPF problems. To utilize the consensus+innovations approach

for economic dispatch, the marginal costs at each bus are required to be the same at

optimality. This assumption is relaxed for the OPF problem, however only for con-

gested networks. Further, agents are still required to share their marginal costs with

neighbours. A discussion on the overall structure of the market and interactions with

the WEM are also lacking in these works. For the most part, consensus based ap-

proaches do not preserve privacy of constraints and/or prices, reducing applicability

for market applications, where even marginal prices should be kept private. It should

be noted that distributed approaches have also been employed for general EMS appli-

cations (see for example [70-75]). By in large, EMS systems focus on the operational

146
aspects of the grid, and deal with system monitoring and control, generation and
dispatch set points, and energy scheduling. These functions are not concerned with
market derivatives for services provided to the grid by DERs. As our focus is on a
market design with DERs, a discussion of these papers is beyond the scope and is
therefore omitted.
In contrast to previous works, the focus here is to develop a comprehensive retail
market with appropriate pricing for DERs in a distribution grid. This is discussed in
the next section.

5.4 Proposed Market Structure

The proposed retail market consists of a Distribution System Operator (DSO) which
is designated to carry out transactions in a distribution grid through two markets:
(1) an energy market for DER scheduling and real-time market settlements (d-LMP)
through bilateral contracts utilizing the distributed PAC optimization algorithm; and
(2) in an ancillary services market which oversees transactions for alert conditions
between primary feeders in the distribution network utilizing a simple optimization
based algorithm. The DSO acts like a proactive utility, in that it accepts the LMP
as traditionally determined by the WEM, but optimally uses DERs within the dis-
tribution network, and only requests services from the WEM for net loads beyond
its DER capabilities. In both markets, DERs are compensated based on the need for
their specific service.
A schematic of both the physical layer and the market layer of the proposed retail
market is shown in Fig. 5-10. All data communication coming from the WEM is
shown with purple arrows, while data communication moving upstream through the
DSO is shown with orange arrows.
The DSO is composed of DSO Representatives (DSOr) and DSO Workers (DSOw),
located at each primary feeder and substation, respectively. The energy market trans-
actions occur at each primary feeder, between the DSOr and agents representing DERs
at each bus of that feeder. The ancillary market transactions occur between primary

147
I ~ Physical Layer IMarket I ayer
Transmission Grid I Wholesale Electricity Market (WEM)

IJVPl'E8
S Worker 1 Workers Worker S
Substation I Substation s Substation S

Primary
Feeder I
Primary
Feeder2
Primary
Feeder1
Primary
Feeder L
j Rpresentative
1Rpeattv
I2
Representative
2
Representative
1
Rpresentative
L j
At PAC values,J E B {I;* 2 QL'

( Bus I Bus 2 Busj# Busj BusJ Agent


1
Agent ...
2 -
Agent ... Agent ... Agent
4 1-P
PAC

Figure 5-10: Proposed retail market structure

feeders and substations. The DERs are assumed to live at the primary feeder level;
any DERs and uncontrollable loads at the secondary feeder level and below are rep-
resented through aggregators and do not directly participate in this retail market.
Thus, each bus j in the physical layer is an independent agent in the market layer,
acting to minimize its expenses while subjected to network constraints 8. Each agent
is also an atom j in the PAC algorithm, which specifies how these agents interact with
one another 1. Through the PAC algorithm, agents securely share information so as
to converge to the optimal schedules and retail prices (d-LMPs) for each DER. These
converged values are the basis of a bilateral agreement between the DSOr and each
agent. The DSOr is responsible for making payments to the DERs, and charging all
agents for their consumption (net their generation).
The DSOr will then aggregate all data from its agents, and send the aggregated
load and generation information to its respective DSO,. Prior to the next WEM
8
Note that this is not a limitation of the PAC algorithm or the market design. Any DERs in
the primary feeder can also be aggregated to form a larger agent, but for simplicity, a one-to-one
mapping is used here.
'Again, the one-to-one mapping is done for simplicity and proof-of-concept. In reality, a group
of agents can be aggregated to form a single atom, but the system model would then move away
from the a purely physical model to a more abstracted network model.

148
clearing, and under normal grid operation, the DSO, will convey the net load (or

generation) to the WEM. The assumption is that the WEM will accept to serve

this net load (equivalently, accept to receive this net generation). The DSO, is also

responsible for making payments to (or accepting payments from) the WEM for power

imported from (or exported to) the transmission grid.

The ancillary services market deals with alert system conditions. Each agent must
notify its status of operation to the DSOr, which aggregates this data and flags any

risks of service disruption. In turn, the DSO, must notify its DSO, which monitors
the status of all its feeders. Then, the DSO, will carry out an "emergency procedure",

denoted as AlgEx, to dispatch ancillary units consisting of distributed generators and


fast-acting demand response loads, within its feeders. For example, suppose feeder 1

receives an alert status from one of its agents who will no longer be able to generate

the amount of power it had committed. Then, through AlgEx, the DSOw will find,

among the L connected feeders (in F,), the lowest cost generators to make up the

shortfall, or loads to reduce consumption and redirect power to feeder 1.

The details pertaining to both of these market structures will be discussed in the

next subsections.

5.4.1 Energy Market

The energy market employs the PAC algorithm to determine the optimal scheduling

of P9 *
QG* of the generating units, PY*,Q,V of the loads, and their d-LMPs P* pQ*
at node j, for all j in the distribution grid. For this application, we consider the BF

149
model of the power grid, and can state the central OPF problem as follows:

min fOPF(Y)
yERIYI

subject to:

PG <pG
J - 3 -
pG PC
J'
Vj C B

J - J - 3
Vj E B
Q9
Q9 <Q
- Q9 < Qy, Vj E B

,
Vj E B

vj : Vj ;J, Vj E B
V (i, j) E T (5.1)
P?23+Q? < -g2j,

i+Qi <-2 vili,j V (i, j) E T


0 < li, < -2ii, V(i,j) E 7
oj = v -2 (Ri,Pi+XijQij)+(R?,+Xi2j) lij,V (i,j) E T
PG PL =-P1j1J1 k:(j,k)ETPj,k,

V(i,j) E T
Q?-Qj = -Qij+Xijlij+Ek:(j,k)ET Qj,k,
PFG _pL = Zk:(i,k)ET Pi,k, Vi E F

Q9 -Ql" = Zk:(i,k)eT Qi,k, Vi C F

where the cost function is defined as:

f
G-Cost
(y) =
f1-A 3PG pG 2 + G)2,
J
ifj E BB\F
(5.2)
AF PG + A9Q9, ifj E F

L _ pLO)
2 9
L(Qj _ 0 2 ifjE
-_y
(5.3)
0, if j E F

fLoSS(y) = Ruij if (i,j) E T (5.4)

fOPFI\ = jEB FeG-Cost _ L-Utill E TijYiLossy)


(ij)Y) (5.5)
)

jCB (ij)ET

Here, fG-Cost corresponds to the generation cost function of distributed generators,


fL-Util to the disutility function of the flexible consumers capturing their dissatisfac-

150
tion for curtailing their consumption, fLo' to the power losses cost function where

losses are due to the line resistances, and foPF to the aggregate cost function of the

OPF problem.

Since the BF model is being used, only distribution grids with radial topology

and balanced networks are considered. These can be represented as a directed graph

I'D =(B,TD), where B represents the graph vertices and TD C T the graph directed

edges. The PAC decomposition for this OPF problem using the BF model depends

on the type of bus (i.e. feeder, end node). In particular, if (i,j) , {(j, hj)}jc l TD,
the vector yj would be:

yj= j j)j)Qj 71 PjG. pLj j;hj; QjlhjljE[n]]

If only (i, j) E TD (end node) by:

yjj = j)jG PL Gj ;1j


If only {(j, hj)}jE[n, E TD (feeder node) by:

Yj= [PjG ;Q; Vj; . pj;hj;Qi,hj jE[n]

where hj denotes the set of downstream buses connected to bus j.

Then as per the PAC decomposition presented in Chapter 3, the dependent vari-

ables between atoms must be accounted for, in the form of variable copies, which are

the estimate an atom j makes of a dependency on atom i. In the BF model, the de-

pendencies are the line flow variables and the nodal voltages; namely, atom j makes a

copy of the downstream power flows {Pj,h; Qj,h}, and the nodal voltage of the parent

vi. Thus the global problem which can be compactly written in matrix form for the

equality and inequality constraints as in (3.43)-(3.45), can be decomposed to the fol-

lowing atomized OPF problem, where the last three constraints are the coordination

constraints resulting from the atomization of the dependencies.

151
minEfj (aj)
a EB

subject to:
Gaj = 0, jE B

H (aj) 0, jEB (5.6)

y- vi 0=, Vi E 3
fIl - Pj,= 0, V(j,h) E T
Qh- Qj,h= 0, V(j, h) E T

Returning to the structure of the energy market, we denote AT and AT to be

the market clearing periods of the WEM and the retail market, respectively. For

ease of exposition, we assume that AT « AT, so the DSO market clears multiple

times within a single WEM clearance period. However, in general, these two clearing

periods can be chosen independently.

We make the following additional assumption: Between any two market clearings

To and To + AT of the WEM, the LMP of all feeder buses A is fixed, for all feeders

in a substation. This is denoted compactly as "AP is fixed, VI E F,, Vs E S". Thus,

A' is a boundary condition VI F,,Vs E S on the scheduling problem, for the N

DSO clearings over the time period [To, To + AT].

Note that in PAC, the feeder node j# is treated as a generator of infinite capacity

(P » 0, where P corresponds to the upper limit of power generation) - thus,


P* represents power imported from the main grid. Likewise, P.* represents power

exported to the main grid. Depending on whether the power is imported or exported,

either P'* = 0 or PG* = 0, respectively. Then for time period [To, To + AT] the aver-
age load (generation) of the distribution grid which will be imported from (exported
to) the main grid is calculated as PI* = P,*, - P* VE h,,VsES.

With the above assumptions in place, the operation of the energy market can now

be discussed. The proposed market determines the generation, consumption, and

prices at each j E B in the distribution grid, using the PAC algorithm, over every

152
(B) To+ Ar (C) To + AT
(A) TO
I II*- - I
WEM Dsori WEM

,'F0tq I L " QL* j E B A lI,To+AT \I,TO+AT


P.
P1*TO \A"EJ
1EF I.Ta ~,T
1 0+AT

DSO, DSO - - • DSOAgn Agent Agent Aget Agent DSOw - DSOw, DSOs
DS~j ..DCAsDSOSt 2 J# 4 1 S-...DOS.. SW

PAC
A1 Multiple iterationst betwe Tv -4 To ± ,-
PACConvereto to Q*1

DSO DSO DSO DSO


Repesetative Representaive Reprsetative iq nettive
1 2 1 L:

Figure 5-11: Timeline of energy market layer interactions

DSO market clearing period Ar. Note that the PAC algorithm is run independently

for each feeder, for a single time period.

Fig. 5-11 shows the interactions between the WEM, DSO, and agents for the

proposed energy market over one clearing of the WEM. The energy retail market

will consist of three interactions denoted as (A), (B), and (C). The first interaction

(A) occurs between the WEM and DSO,s, when the WEM clears: at time To the

WEM passes to each DSOw the forecasted load/generation over the period, and the

LMPs for each of its DSOrs, 1 E -,, Vs E S. This information is passed down to

each DSOr, which shares the LMP with its agents. The second set of interactions (B)

occur between the DSOr and the agents every Ar, prior to the next WEM clearing.

For each interaction (B), the agents will coordinate amongst each other, through the

PAC algorithm, and converge in some K iterations. In doing so, the converged values
PG* G* pL* QL
for each bus,
of the real and reactive power generation and load

in the distribution grid will be determined, along with their respective d-LMPs, pl.
The agents will enter into bilateral contracts with the DSOr with these scheduled

values. The d-LMPs are valid for the period Ar. This interaction repeats until the

next WEM clearing. Prior to the next clearing of the WEM, the DSOr will send to

the DSO, the load to be imported from (exported to) the main grid, P1*rT, which has

been aggregated over the N DSO clearings. The last interaction (C) from Figure 5-11,

is between the WEM and the DSO,s, and occurs at the next clearing of the WEM,

153
To + AT. Each DSO, will send to the WEM per each feeder, the load to be imported
from (exported to) the main grid, P*T, which has been aggregated over the N DSO
clearings.

5.4.2 Ancillary Services Market

The sections above detail the market under normal grid operation. However, with
increased DER penetration comes more flexibility within the network, which should
be leveraged to address alert conditions at lower costs. Under the proposed market
structure, the ancillary services market is employed when an alert status from a
DSOr is received. The ancillary market addresses the shortfall in generation or load
reduction. The alert code, codea, details whether a generator or a demand response
resource is no longer capable of generating or reducing demand as committed in the
market period, respectively. Once received, the DSOw runs the AlgEX procedure,
whereby the optimization problem in (5.7) is solved to meet the shortfall in feeder
x, AP, while minimizing the cost of deploying ancillary resources. In doing so, the

DSOw leverages the distributed network structure of the connected feeders.

min p ,G'PG/ PL'pL'

subject to:

Z1 I(p(PG'/
1G'pL') min (1APX, LG
P*) (5.7)
pG' p' Vic6 8
PLG pL' Vi E
PGL

where PG' is the additional generation required from feeder 1, and PL' is the additional
load reduction required from feeder 1 in order to meet the shortfall in feeder x.
In order to run AlgEx, the DSO, requires the following data from each of its
DSOrs, regarding their respective distribution networks:

• Maximum generating capacity: PG _ EB\j# G.


7

154
* Minimum load requirement: PL = , P;

* Optimal generation set point, as determined by PAC and committed in the

energy market: P1 G* Gj G*.

" Optimal load set point, as determined by PAC and committed in the energy

market: P1 L* Bi

P,G' - iEB 1 \j#AP*T'Gj


" Weighted average cost of local distributed generation: IP' EBI\j# TVpG

P L' j-E131i i*f-pt


" Weighted average cost of using demand response: Pi' = ;

" Alert information: [codea AP,], where AP, is the change in power quantity

-
either a decrease in generation capabilities, or a decrease in demand response

capabilities (i.e. increase in P for some j in feeder x). We note AP, > 0.

The AlgEX procedure is described next for generation shortfall, and a similar

procedure is carried out for load reduction. For ease of exposition, suppose DSO,

1 sends an alert code of 0 with a shortfall quantity of AP. The new maximum

generation capacity for the feeder is then pG - PG - AP1 . Under this shortfall, the

committed generation must also be adjusted, Pf = P1 G* - AP1 . The DR capabilities

remain the same. Finally, the new uncommitted generation and DR limits for the

feeder can be calculated as - - Pl,and PIL* - L respectively.

5.5 Validation of Proposed Market

The proposed market design must be evaluated. First, the PAC algorithm must be
evaluated for privacy considerations. In a market system where individual agents

(DER owners) may have sensitive information they do not wish to disclose, privacy is

a key requirement within any computational framework. Second, the computational

performance of the distributed PAC algorithm as applied to the OPF problem for

retail market must be evaluated. The algorithm must converge within the 6 7 time,

while accounting for computational time and potential latencies in the communication

155
network. Third, the economic performance of the market must be evaluated. At
a minimum, we desire an increased DSO revenue which reflects better utilization

of resources within the distribution grid. With better resource utilization, we also

expect lower electricity prices for customers ". This can manifest in two main ways:

the retail prices from the proposed market mechanism can be lower than fixed utility

retail prices (i.e. F* < Ata), or higher profit for the DSO will result in lower energy

costs for all consumers in the market over time. These three areas of validation will

be further explored.

5.5.1 Validation Metric 1: Privacy of the PAC Algorithm

The PAC algorithm is privacy preserving, thus satisfying the first requirement for use

in a retail market. The cost functions of the DERs fj(a3 ), the retail prices 1j , and the
coordination costs vj, all remain private to each atom j. The only outside variables
needed at each j are a of the neighbours, and iDj. Comparing PAC briefly to another

popular distributed optimization algorithm, dADMM (distributed Alternating Direc-

tion Method of Multipliers), we see that PAC is a more private algorithm. Namely,

both the cost functions and pj remain private to each atom for both the PAC and

dADMM algorithms. However, unlike dADMM, the dual variable Vj remains private

to atom j in PAC.

The dual variable vj can be thought of as a coordination price. This indicates how

far an atom j must deviate from its atomic optimal point (which it would operate at
when making decisions as an independent agent) in order to achieve coordination by

taking into account network constraints. This latter case, when an agent accounts

for network constraints, is required for efficient and lowest-cost resource use, and

is enabled through the privacy-preserving communication requirements of the PAC

algorithm. If vj is high, then atom j is further from its atomic optimal point AAS
thus, vj describes the tension between atomic and network optimality.
10
We expect lower electricity prices on average. Note that in a real-time market, prices can
fluctuate and can peak at high values during periods of lower generation and high consumption.
However, better resource utilization can help reduce these peak values while also reducing average
electricity prices.

156
The importance of privacy of vj can be explained thus: with knowledge of the
vj values, a rogue agent can carry out a cyberattack, deliberately manipulating the
variables that are communicated between atoms to be maximally different from one
another. This action has two implications: First, it will take longer to converge.
Second, since the values are maximally different, each atom j will be forced further

away from its atomic optimal point, incurring "losses" as it tries to coordinate with its
neighbors to achieve optimality. The losses can be thought of as an opportunity cost:
to meet network constraints, atom j has to sacrifice revenue it could have received
had it been operating closer to atomic optimality. We note that there may be more
targeted ways to use the j values, such as by agents to coerce neighbors into certain
behaviours. Detailed investigation into this, however, is beyond the scope of this
thesis. Thus, by keeping vj private to each atom, the PAC algorithm has added privacy
characteristics and may exhibit more resiliency to cyberattacks than dADMM (and
other distributed algorithms or architectures). Thus, the PAC algorithm protects the
interests of each agent, while ensuring no agent has enough information (of d-LMPs
or coordination prices) to exercise market power, or to destabilize the market and
prevent it from reaching equilibrium.

5.5.2 Validation Metric 2: Computational Performance of the

PAC Algorithm

The PAC algorithm was then tested to ensure satisfactory performance for use in a
retail market. In particular, we require the PAC algorithm to converge within the
retail market clearing period " which we propose to be shorter than (or at most
equivalent to) the WEM clearing period.
Initial numerical simulations were conducted on a 2.6GHz CPU Intel Core i7-
5600U PC using MATLAB and CVX. To improve performance, the algorithm was
then implemented using MATLAB, with optimization problems being setup using the
YALMIP interface, and solved directly with Gurobi Optimizer (similar to the setup in
11
which can be anywhere between 1-15 minutes depending on the ISO/RTO requirements

157
MR

_ZU
-optima
76 -PAC
-ADMM
74

-
t-72
070

-
68

66

64
0 50 100 150 20C
Iteration r

Figure 5-12: Cost evolution with PAC and dADMM

Chapter 3. These simulations were conducted on a 3.00GHz CPU Intel Xeon E5-1660

v3, 8 core workstation, with 128GB RAM. The analysis below was conducted for the

JST-CREST 126 Distribution Feeder Model (see Appendix B.4 for complete data).

Preliminary Analysis

The parameters p, -yj, and jj of the PAC algorithm were tuned to guarantee con-

vergence of the PAC algorithm (for more details see [20, 21]) and the vector a was

initiated at the optimal solution of the atomized central OPF problem, at i = 19h.

The PAC algorithm was compared with the popular dADMM [76,77] algorithm. Both
algorithms were run for 200 iterations, and results are shown in Fig. 5-12, where the

black graph shows the optimal cost obtained using a centralized optimization solver.

Both algorithms converge to a near-optimal value in roughly 150 iterations, with

the PAC algorithm converging slightly faster. From the initial implementation using

MATLAB/CVX, the total time required to complete 200 iterations with PAC is 130s
(0.65s/iteration/atom) and with dADMM is 203s (1.Ols/iteration/atom). Hence,
when the initial conditions are initiated close to the optimal solution, the proposed

PAC algorithm can converge in less than 5 minutes which is the standard time be-

tween two WEM clearings 12

12
for the ISO-NE WEM market

158
Implementation Considerations

The improved implementation considered the fact that the grid topology can be as-
sumed to be fixed; thus, the constraint matrices, G and Aj,_ in the PAC algorithm
are constant. Only the cost function (augmented Lagrangian) must be updated for
each PAC iteration, and the inequality constraints (limits on power generation and
load) updated for each time period.

Similar to in Chapter 3, the computational setup used to run the market sim-
ulations is provided in Figure 5-13. We note the main difference is that the PAC
decomposition does not use the Yalmip package to setup the centralized model, and
the Benchmarking is an optional step which compares the PAC algorithm to the
dADMM algorithm (while plotting the centralized solution). Finally, there is no

pre-processing step to recover current bounds, as the power flow model used for the
markets work is the BF model. We note again, that the PAC algorithm is imple-
mented in MATLAB, where a parfor loop is used to parallelize the primal update
across the computational agents. Once the primal update - which consists of solving
the atomic OPF for the kth iteration - is complete, the dual variables are updated in
a centralized manner. Note that this is not a limitation of the PAC algorithm, but
rather a design choice to simplify the implementation.

For worst-case computational time, the vector a was initiated at 'zero' - all node
variables are initiated at their lower bounds (PG pL Qf,Q,V); all line variables are

initiated at 0. To guarantee convergence, we run PAC for 4500 iterations. Tables 5.1
and 5.2 provide a summary of estimated computational times and latencies associated
with PAC that would correspond to a parallel implementation. Latency is defined as
the time between data generation and when it is acted upon by the next agent [78].
We also differentiate between latency and computational delays, which are times
associated with application/script execution [78-801. References [78-80] were used to
obtain reasonable approximations for latencies and computational delays.

These tables show that the retail market completes execution in 8.8 minutes. We
expect this time to be reduced by an order of magnitude through better initialization

159
MR

Scenario Specific Data


Forecasted Generation and Load, Demand Response capabilities

GerateMProe nish Setup PAC Decopositionrk ult


Grid Network -- •Central network
limits, cost -QUdtonsad
finish generating eu tm
generate n
atomiPed OPF Centrall
t
model ~ parameters centalI model objective function -tmi Onk Cenraly

PAC
1: Update primal PNNtup
OPF Sho S nPAC parametes, Initial
(Kihird) Aueae Calculate
.- Udaeul duals 4 j: Update primal Price. Pert otm
Update Predictions solutionwitiyc
2/% 1
solution within hypercujbe
.Optimal etra
solution (best)
N:Update primal

Repeat for KIterations

Figure 5-13: Flowchart of the computational process. The PAC algorithm decom-
position is fixed for a network with a given topology. The scenario or time-period
specific updates must be run each time the PAC algorithm is run.

(not zero). For example, a reduction of iterations from 4500 to 450 will reduce
execution time from 8.8 to 1.4 minutes. Execution time can be further reduced
as latency requirements reduce, to say 0.76 minutes, for lOms latency compared to
looms, at 450 iterations.

In order to implement the distributed energy markets, distributed computational


units and low latency communication infrastructure within the distribution network
is required. Each agent must have a computational node, representing a single or
a collection of distribution transformers and/or DERs. The units represented by a
single agent will have limited data privacy, and will all have the same d-LMP. Thus,
it is in the best interest of each unit to set up its own computing infrastructure.
Alternatively, a set of agents can share the same communication infrastructure, under
a common security protocol which prevents agents from accessing others' information.
Finally, a low latency communication network will be required, to allow the PAC
algorithm to rapidly make successive bids, and quickly reach a market equilibrium.
By reaching equilibrium faster, the energy market can have a shorter clearing time,
allowing different ISOs and RTOs to determine the clearing time which best suits
their needs.

160
SINGLE COMPUTATIONS Market Agent(s) Time
Data Processing: aggregating agent data DSOr 5
Data Processing: check for 'alert' system status DSOw 5
Algorithm Execution: run Alggy DSOw 10
LATENCY REQUIREMENTS Market Agent(s) Time
Data communication: at PAC convergence Agents -* DSOr 1
Data communication: before next market clearing DSOr -> DSOw 15

Table 5.1: Computational Delays and Latency Requirements. All times measured in
seconds, (s).

PAC COMPUTATION PER ITER Market Agent(s) Time No. Iter Total Time
Algorithm Execution Atom 0.0092 4500 41.4473
PAC information exchange (latency) Atom j ++ Atom i 0.1 4499 449.9
Total PAC Computational Time 491.35

Table 5.2: PAC Computational Time. All times measured in seconds, (s).

5.5.3 Validation Metric 3: DSO revenue

The proposed market operation can be validated to increase DSO revenue, as per the

following profit structure:

PDSO =DSO S - D DSOM (5.8)

with the different components that contribute to the net revenue defined as follows:

" Revenue earned from all loads: DSO = Ez (y fjL + p Q


" Payments made to flexible loads (DR units): Cl sF (Pj" - j)
+

-S QL*))E
Q* (QL° -_ ))

* Payments made to DGs: CD SO E G* _+Q*G*

" Payment made to WEM, for purchasing power: CwEOM APPG*


*

To evaluate this net revenue, a benchmark system is needed. Consider a market which

consists of a utility that purchases power from the WEM and sells to customers at a

fixed retail price, Are.tai In this system, DERs are assumed to not be compensated

for their services, as they are small-scale behind-the-meter resources and not visible

161
to the utility. Thus, the DSO's profit without the retail market is:

Pno-DSO no-DSO - CnDO (5.9)

where the first term denotes the revenue earned from all loads, given by

Eno-DSO retail E retail Q (5.10)


jEB jEB
and the payment to the WEM is

CnDO - G* + Q*. (5.11)

From (5.8)-(5.9), it follows that the additional revenue earned by the DSO when using
the retail market mechanism is given by:

PDSO-increase = PDSO - Pno-DSO (5.12)

Similarly, we can also quantify the savings for an inflexible consumer, j as:

Pconsumer-saving = (retaii - 1 y*)jL* (5.13)

Note that flexible consumers will receive additional compensation in the form of

revenue for their services.

The proposed retail market clears every AT seconds (or minutes) 13. A 24-hour period

can be grouped into 24 hour-long intervals T = [i, i + 1], where i corresponds to the

ith hour, i = 0, ... , 23, over this 24 hour period. Suppose that over this T, there are

N clearings of the retail market, which occur at t = i + nAT, n = 1, . . . , N, and M

clearings of the WEM, which occur at t = i+mAT, m = 1, ... , M. Since AT < AT,
it follows that n > m 14. Denoting n' = i + nAT and m' = i + mAT, we can then

13
We propose the retail market clears more frequently than the real-time WEM to leverage the
flexibility from the DERs. In particular, renewable generation is more volatile than traditional
generation, so a retail market which clears more frequently would be able to react to these fluctuations
with prices which better reflect the renewables.
14
Again, assuming the retail market clears more frequently than the WEM.

162
represent the profit calculated above as a function of time:

N
PDSO-increase j Dso(n', m') - Pno-DSO (n', m') (5.14)

where the n' is carried through to the pj, Pj, and Qj, and the m' is carried through

to the A,, Aretail, and Pi.

Case Studies

To validate the market design (both DSO revenue and functionality of the ancillary

services market), consider three networks. They will be introduced briefly here, and
more detailed information provided in Appendices B.4, B.3.2 and B.2.3.

JST-CREST 126 The original network model, presented in detail in [81], rep-

resents a distribution grid in Komae city in Tokyo, Japan with an area of 5 km22

Here we employ a compressed version of that network, as shown in Appendix B.4.

Our model contains |B| =84 nodes and 6 lines all connected to the feeder node in a
star topology. Details of base values, parameters, and information on electrical lines,

loads, and generators used in the simulation can be found in Appendix B.4.

The time-dependent ratio a(i) which governs the demand in the network, varies

according to the FY2017 average consumption profile in the Tokyo area [821. The

24-hour profile of a(T) is shown in Fig. 5-14 (top). In addition, vi = 1.023 pu (with

nominal value 6750V), and all loads are taken as unity power factor loads. We assume
that the reactive power of flexible consumers can be adjusted through proper control

of the air-conditioners. Further, we assume the P-LMP, AP, is either fixed at 10 or is

time-varying and varies according to the yearly average profile of the FY2017 system

price in Japan Electric Power eXchange (JEPX) [83] as shown in Fig. 5-15 (top) The

retail price for electricity is fixed at 26 JY/kWh, as per average retail electricity prices

in Japan [84,85].

163
IEEE 123 The IEEE 123 bus network was modified to be a balanced 3-phase
distribution network as further detailed in Appendix B.3.2. Further details on lines,

loads, and generators are also provided in Appendix B.3.2.

The time-dependent ratio a(i) is deduced from the ISO-NE report of total recorded

electricity demand for each five-minute interval of May 14, 2019 [38], as shown in

Fig. 5-14 (middle). Loads are not assumed to be unity power factor. Finally, we

assume the P-LMP, .4,is either fixed at $30/MWh or is time-varying and varies

according to the ISO-NE report of the final approved LMPs for each five-minute

interval for May 14, 2019 [37], as shown in Fig. 5-15 (middle).

IEEE 13 To test the alert case, a multi-feeder network was developed, with |iF, = 3

and |BiJ = 13V1 E F,. The IEEE 13-bus network [86] was modified to be balanced
3-phase (see Appendix B.2.3). Variations of the network were developed by adding

generators of varying capacity at different locations (see Appendix B.2.3), and per-

turbing the base loads as Pf A P (1 + 6j), where6j -~K(0, 0.15)Vj E B1 , VI E F,.


The time-dependent ratio per feeder, ai(i), is obtained by perturbing the ISO-NE

demand report [38] from May 14, 2019 as ai(i) = a(i)6i, where 61 - NP(0, 0.075) and
smoothing the resulting profile. The three demand curves are shown in Fig. 5-14

(bottom). The feeder P-LMPs, A', are either fixed at $30/MWh or are time-varying

and varies according to the ISO-NE five-minute LMPs for May 14, 2019 [37], taken
from different location IDs for each feeder, 1 E F, as shown in Fig. 5-15 (bottom).

The results are benchmarked using the following scenarios: (1) When all the loads

in the distribution grid are served only by the main grid, and (2) when the retail

market dispatches DERs through the PAC algorithm with the LMP being either

(a)fixed or (b)time varying (see Fig. 5-15).

Results from JST-CREST 126

The results from PAC across the JST-CREST distribution grid (see Appendix B.4 for

data) are shown in Fig. 5-16. Figure 5-16a shows the voltages across lines A and F

are higher than across other lines in the network. This is reasonable as the generation

164
1 I - I I I I

. 0.9

-
0.8

0.7

6 9 12 15 18 21 24
0 3

1
Time [h]

0.8 -~

6 9 12 15 18 21 24
0.0

Time [h]

Figure 5-14: The profiles of the time-dependent demand ratio a(i), i = 0, ... , 24, for
Networks JST-CREST 126 (top), IEEE-123 (middle), and IEEE-13 (bottom).

from local generators exceeds the local demand of the loads. Similarly, the voltages
across line C are suppressed as the total load connected to line C is higher than the
local generated power at node 53. Figure 5-16b shows that the Lagrange multipliers
corresponding to the voltage equality constraint, y4,,tend to be lower for nodes with
of the
higher voltages and vice versa. The local active generation and consumption
distribution grid can be seen in Fig. 5-16e and Fig. 5-16f, and the reactive power
generation and demand response throughout the network can be seen in Fig. 5-16g
and Fig. 5-16h.

To evaluate the impact of the retail market, we compare Scenario (1) and (2),
running the PAC algorithm using both LMP profiles shown in Fig. 5-15. Figure 5-
17a shows that generation and electricity imports are lower for Scenario (2), using
the market mechanism. Specifically, the DR units are sharing some of the load. This
is also illustrated in Fig. 5-17b which shows that DR units accommodate about 5 to

165
14

-
12-

8
0500 1000 1100
Time [h]

80
-
60

40
-j -

-
0 50 100 I [h 200 250 300
Timne[h]

/1 AA L
L-60-

40---

620

-
0 50 100 150 200 250 300
Time [h]

Figure 5-15: Profiles of P-LMP A where red denotes the yearly average profile and
blue a constant LMP, for Networks JST-CREST 126 (top), IEEE-123 (middle), and
modified IEEE-13 (bottom).

6% of the total load.


The most important results from the proposed market mechanism are the com-
pensation of DER units, and the increase in revenue for the DSO. The DSO's hourly
cost for compensating flexible loads and generating units is shown in Fig. 5-17c and
5-17d. Note that Scenario (1) assumes no scheduling or compensation of DERs in
the network. Figure 5-17d shows a lower total cost for electricity generation when
using the proposed market, as the PAC algorithm optimally schedules the DERs to
minimize network costs. Specifically, DERs are used more when electricity prices are
higher - the DR units peak usage is around hours 15-18, when the time-varying LMP
is the highest.
The hourly increase in revenue obtained from implementing the proposed retail
market is shown in Fig. 5-18, using the DSO revenue metric introduced in (5.14). The
revenue earned by the DSO without the retail market is driven by the difference in

166
1.0
13.E
9 78 83 1.
1. 13
1.0
12.1
1.0
18 1.0 12

11.1
1.0
1.01 11

1.
53
1 ic

(a) Bus voltage vj and power flow. (b) Lagrange multiplier p [1/pu]
1

0.9 0.9

0. 0.8

0.7 0.7

0.6 0.6

0.5 0.5

0.4 0.4

0.3 0.3

0.2 0.2

0.1 0.1
01
0
P
(c) Lagrange multiplier (P-LMP) pLj
(d) Lagrange multiplier (Q-LMP) yp9 [1/pu]
[1000JPY/pu]
100 04

90 0.35
80
0.3
70
0.25
60

50 0.2

40 0.15
30
0.1
20
0.05
101

(e) Ratio of active power generation to maxi- (f) Active power consumption PL [pu]
mum capacity PG/PG G 0.
0.5 30

0.4
2C
0.3

0.2

0.1

0 0

-0.1
-10
-0.2

-0.3 -20
-0.4

-0.5

(g) Reactive power generation Qf [pu] (h) Ratio of demand response to baseline active
power consumption -(P,,L - PL(19))/PL(19)
[%]

Figure 5-16: Terminal configurations with the PAC algorithm and time-variant P-
LMP 4.

167
MM

1o, 7

16
9-
5
- 8 94

13
2

6- E

0 3 6 9 12 15
0 3 6 2 1 8 2 24 _0 3 6 18 21 24
9 Tie2h 15
Time [h] 'ime [h]

(a) Active power generations (j PG). (b) Demand response ratio (E -(PL

-
PP(r))/Z PO(r))

30 800C0-
7000-
5 25 ,rjJ-L

10
cz~ U~ 000

10 30(
Ei
(5

'0 3 6 9 12 15 18 21 24 0 3 6 9 12 15 18 21 24
ime [hJ Time [h]
(c) Economic compensation of flexible loads. (d) Economic compensation of generators.
(Ei Ch). (Ei CG)

Figure 5-17: The black graphs correspond to the scenario where all the loads of the
distribution grid are served by the main grid, the blue graph to the scenario with the
fixed P-LMP and the red graph to the scenario with the time-varying P-LMP A.

wholesale and retail price; thus, when the wholesale price of electricity is low, such as
during the hours of 1-5, the revenue is high. Compared to the retail cost (26 JY/kWh),
the retail market d-LMPs, pf*, are much lower, thus the increase in revenue is small
during hours 1-5. However, as LMPs rise and DERs are efficiently scheduled, the DSO
generates additional revenue despite the added costs from compensating the DERs
for their services. At the end of the day when the LMP is lower but network demand
is high, the retail market continues to make additional revenue. This corroborates
the fact that the proposed local retail market can result in lower overall generation
cost for serving a given load by efficiently dispatching DG and DR units through the
distributed PAC algorithm.

168
260

-
240

-
220

-
200 --

m180-

10 3 6 9 12
Time [h]
15 18 21 24

Figure 5-18: The projected savings from the proposed retail market over a 24-hour
period

Results from IEEE 123

The proposed market mechanism was also evaluated on the IEEE 123 network (see
Appendix B.3.2 for data). As in the JST-CREST 126 network, the retail market
results in an increase in revenue for the DSO, as seen in Fig. 5-19. The increase in
revenue is similar to Fig. 5-18, as the demand profiles are very similar. The increase
in revenue is lowest during the first 5 hours, where the LMP and demand are both
low, and increases as demand increases. The usage of DGs also follows the demand
curve, while the demand response ratio is relatively constant over the 24 hours at
6.5%. In this way, PAC makes use of the DGs during periods of higher electricity
prices and demand, to lower the network cost of generation. Another key observation
is that during the high demand hours of 17-21 where the electricity prices are more
volatile, the DSO revenue profile is still smooth, from efficient DER management.

44

42
-

~4040
-

38
-

-36

6 9 12 15 18 21 24
0 3
Time [h]

Figure 5-19: The projected savings from the proposed retail market over a 24-hour
period

169
Results from IEEE 13

The proposed ancillary market was evaluated on the 3 feeder modified IEEE 13 net-

work (see Appendix B.2.3 for data). The PAC algorithm was used to calculate the

optimal DR schedule, based on the demand and LMP profiles in Figs. 5-14 and 5-15.

A contingency was then initiated, whereby feeder 3 loses all generating capabilities

(AP = 2.25 MW at T = 230), some of which was committed. Upon receiving the

alert from DSO, = 3,the DSO, carries out AlgEX (5.7). The weighted average cost

calculated by each DSO, is shown in Table 5.3. The resulting additional generation

or load reduction needed is shown in Table 5.4. In this test case, feeder 2 has the

lowest cost and picks up the slack from feeder 3. If the generating capacity of feeder

2 was all committed, then the DR units in feeder 2 would be deployed, followed by

DR units in feeder 3, and so on. The additional cost to the network, based on the

weighted average costs is 0.2813 units.

Item Feeder 1 Feeder 2 Feeder 3


P,'0.8811 0.8027 0.7818
P,G
p1' 0.8612 0.8194 0.8361

Table 5.3: Weighted average cost of using DGs or DRs for each feeder

Item Feeder 1 Feeder 2 Feeder 3


PGf 0 0.3505 0
PIL' 0 0 0

Table 5.4: New dispatch settings from AlgEX

170
Chapter 6

Conclusions

In this section we summarize the contributions of the thesis and key results. We then
discuss future research direction that can improve upon or extend the work presented

here.

6.1 Contributions

In this thesis, we have addressed the challenges of optimally coordinating a large num-

ber of distributed energy resources (DERs) within the distribution grid. We consider

the curse of dimensionality for large-scale optimization problems, the modelling and

scheduling of storage devices, and the required incentives to coordinate the indepen-

dently owned resources. We focus on utilizing distributed computation to solve the

optimal power flow (OPF) problem, as applied to the distribution grid.

First, we apply distributed computation (the proximal atomic coordination algo-

rithm, PAC) to a new convex relaxation of the OPF problem, which is able to model

meshed and unbalanced grids. This is done by modeling current injections (CI) and

using McCormick Envelopes (MCE).

Second, we extend the CI formulation to account for storage devices, by consider-


ing multi-period optimization. We run various simulations to show the necessity for

multi-period optimization, which has a forward-looking nature that enables efficient

scheduling of resources. We also consider the role of storage sizing through these

171
simulations.

Third, we propose a retail market mechanism for distribution grids, which pro-

vides the financial structure necessary to optimally coordinate independently owned

resources. We take a transactive energy approach, and propose an energy market

which utilizes the PAC algorithm to recover real-time scheduling and market dispatch

through bilateral contracts. We propose a Distribution System Operator (DSO) which

oversees the market, and interacts with the WEM. The proposed market structure is

numerically verified, showing potential savings for the DSO under this new market

mechanism.

6.2 Future Research Directions

There are many future avenues for research and development. Among these are future

work for the CI model, PAC algorithm, and proposed retail market. Some of these

are briefly discussed below.

6.2.1 Current Injection Model

The CI model has been shown to be effective in solving load flow and optimiza-

tion problems for meshed and unbalanced grids. A more detailed comparison with

BF is still desired: (1) comparing the performance of CI with BF+angle recovery

algorithms; (2) comparing the performance of CI on meshed networks, using convex-

ification techniques for the BF model; and (3) if possible, trying to compare the two

models for unbalanced networks.

The techniques used to obtain the current bounds must also be investigated. The

performance of the CI model is intimately tied with the tightness of the MCE relax-

ation. Using heuristics, detailed network data, or insights from operations may help

tighten these bounds.

172
6.2.2 Development & Analysis of Distributed Optimization

While the PAC algorithm shows great potential, there remains the issue that many

iterations are needed for the algorithm to converge. In addition, every iteration de-

pends on communication with neighbours leading to more risk of communication

failures such as packet drops or cyber-events. The performance of the PAC algorithm

must be re-evaluated, by conducting a thorough literature review and identifying

performance enhancement features. Time-varying learning rates (for -y) should also

be investigated, to improve performance of the algorithm as it approaches conver-


gence. Another aspect may be to develop heuristics to obtain the best convergence

parameters (7, p).

The distributed architecture of PAC suggests an ability to self-recover from cyber-

events, such as cyber-attacks or communication network failures. The robustness of


the PAC algorithm under these events must be investigated, by using multiple process-

ing units and secure communication protocols. Islanding events within distribution

grids can then be examined: the hypothesis is that the PAC algorithm should be able

to achieve global solutions for each islanded section of the grid. What this looks like

from a power systems and stability point of view is also an interesting question.

6.2.3 Extension of Retail Market

The current retail market design discusses the interactions of agents within the dis-

tribution grid, the DSO, and the WEM. The market structure must be extended

to consider the interactions with the Transmission System Operator (TSO). There
are various models for TSO-DSO interactions and responsibilities of each party as

outlined by their coordination schemes. Most notably, [87] compares five different

schemes between the DSO and the TSO to appropriately operate and compensate

distribution-level assets. More consideration is needed to understand how the pro-

posed retail market structure and the DSO entity can work with the TSO to bring

efficiency to the overall grid.

Assumptions about the exchange and ownership of information made in the pro-

173
posed design depend heavily on the current paradigm; however, when many distri-
bution grids begin coordinating their own retail markets and having a DSO, there

may be changes to the overall structure. More analysis is needed here. For exam-

ple, the proposed market structure and interactions (A)-(C) outlined in Chapter 5

have assumed that the WEM specifies the LMP Af at the initiation of the market

interactions, but that the DSO is free to determine the net generation and load seen

by the WEM. In practice, the DSO may be obligated to purchase power quantities

P*, Qi (assuming the DSO is importing power) over the period [To, To + AT]. In
such an event, the proposed PAC can still be used, but with an additional boundary

condition: between any two WEM market clearings To and To + AT, the net power
from the main grid, P* r is constant, VI EF, Vs E S.

6.2.4 Evaluation of Retail Market Design

When evaluating an energy market, there are additional considerations which must be

made. The market design must not allow agents to gain market power and influence

over prices and resource allocation, so to benefit themselves unfairly. The retail
prices determined by the market mechanism must also be evaluated to limit price

volatility, as volatile markets can be hard to predict, and result in high costs for

market participants. Historically, electricity prices have been tied with oil and gas
prices as these resources were the primary fuel for electricity generation. However,

as electricity production shifts to include more renewable resources, the ability for

policymakers and market analysts to project and estimate electricity prices to help
develop policies, rules, and make predictions on the future of the system, becomes

harder.

The market design must be equitable in allocating costs to consumers. In addition

to paying incremental cost of service, customers also pay a portion of the residual cost.

The method by which this residual cost is allocated to different consumers largely

depends on the equity of the electricity tariff design, as opposed to just the economic

efficiency - of which there may be multiple solutions. One of the key issues with high

DER penetration in the distribution grid is that DER adoption is primarily by high

174
income customers, resulting in a shift of residual cost from high income to low income

customers [88]. Some reports analyzing real-time electricity rates have also concluded

that these rate designs may be inequitable to low income customers [89).
The applicability of the proposed market design to different electric power systems

across the US and over the world can be investigated. Different electricity prices,
generation mixes, weather conditions, and of course, policy frameworks and existing

market structures, will all influence the success (or failure) of such a market.

175
176
Appendix A

Supplementary Results

A.1 Design of the PAC Algorithm

For complete information about the PAC algorithm, see [20,211. Here a summary of

the algorithm design is provided for completeness, as taken from the original works

on PAC.

We start by considering the constrained optimization problem:

min E fj (aj)
aERIaIjE|B|

subj. to: (A.1)


O aj = 0, jEB
Aj,_a = O, j E B

We can then form the Lagrangian of (A.1) as given by:

L (a, y, v) = [j (aj) + p'6jaj + vTA,jaj]


jEB

± ZL. (ajq, v)
.

jEB

We note that the two variables that are of most importance are a, the decision

variable, which corresponds to the optimal power generation and consumption of

177
active and reactive power, and p, the price associated with the decision variable. By
introducing augmentation and proximal regularization terms to £ (a, y, v) we obtain

the augmented Lagrangian:

(a, yi, v; a') I aj1


£ (aj, p, V) +
-

jEB

IIAj,_- a||1 + I 1aj - aj 11 (A.2)


jEB
- -p2

Given that, (aj, p , v; aj) = L (a, v)+ | |jaj - aj| 1we can express it more
compactly as:

p (a, yi, v; a') + [Z Gaj, p v; aa])


+,
j€ B

+ Oljaj11 + || IAj,_ a||2 (A.3)


jEB 2

where p > 0 is the step-size and -y > 0 is the over-relaxation term. The augmentation

terms can be linearized around a prior primal iteration (aj and a') as:

2 - 2 2 (A.4)

' Aj,_a| ~2 A ,a + p7j (aj a ) AT_ Aj,_ a (A.5)

Application of (A.4) and (A.5) to (A.3) yields:

Lp,, (a, y, v; a') = (aj, pj, v; aj)+py Ojaj, Ojaj


jEB

+ [(p7jAj,_aj, Aj,_aj)] (A.6)


jEB

To maintain complete privacy of the algorithm, we use two atomic-specific over-

relaxation terms: yj, 'j > 0 where 7j > ij. Thus, we can express the new 'predicted'

178
dual updates in (A.6) as:

3 =pj + pijadjaj, Vj E B

Dj =vj + pijAj,_ aj, Vj E B

Finally, we can write (A.6) as:

p,, (a, yL, v; a') = 3 (aj, #j, i ; aj) .(A.7)


jEB3

179
A.2 Convergence of the PAC Algorithm

For complete convergence proofs and results, see [20, 211. Key results are provided

here to support the use of the PAC algorithm.

Before stating the main result regarding the convergence of the PAC algorithm,

it is convenient to define the following auxiliary matrices:

G = diag 1l,..., K

G= diag 71INb ... , YLIB N}

F A= diag 7Y11NO • 1 • 3 • O , 1B|

V1= dT + ATA

V 1 (F) = OTFG0 + ATLAA

Asymptotic convergence of the distributed PAC algorithm given by (3.50)-(3.55) is

established through the following theorem. [20,21] Consider the ROPF formulation
of (5.1) and its atomized variant (A.1).

Let f# be a closed, convex and proper (CCP) function for all j E B and a [r] , p [-r] , fj [r] , v [r],
and i' [T] be the primal and dual variable trajectories of (3.50)-(3.55) under zero ini-

tial conditions. Further, let a* be the optimal primal solution to (A.1) and p,yj, j
the PAC parameters.

We define Amax A max {Amax(Vi)} , Amin A min {Amin(V1)}, 7max max {7j}, and
3EB 3EB jEB
7minAE {7j}•
jEB
Then, we have that:

a) If:
1 > P 2 ymaxnAmx (V1 ) (A.8)

then lime,, {a [T]} -+ a* with rate o

b) If:

1 ;> P 2 7'maxAmax (V 1 ) (A.9)

180
then for the ergodic averaged trajectory a [r] 0 K a [s], we have:

(a[r]) -#(a*) ( ~(P, 7max) (A.10)

IRa[ ] (P, 7max)


(() (A.11)

where:

RrRr (F) 1 (A.12)

and:

r 2 I -1
P112 ,~J
(E1 (p, i\
max) =-P |la*|| (A.13)
2 7minAmin (V 1
+

)
I- *|1 + 4p2 + 4P 2
(E2 (p, 7max) = (A.14)
2 2 7minAmin (V 1

)
where < sUPzEaf(a-) {||z11| 2}
Intuitively, Theorem A.2 guarantees that the nodal generation and consumption
profiles obtained upon convergence of the PAC algorithm coincide with the optimal
solution of the centralized OPF problem.

'The root R exists since V1 is square p.s.d. matrix. Specifically, if V1 = UEUT is a suitable
eigenvalue decomposition, then R = [U2UTI

181
182
Appendix B

Case Study Data

This section includes the simulation data so results can be reproduced.

B.1 Network 3 Node

Parent Node Child Node Line length (mi) Impedance Configuration Code
1 2 0.0568 1
2 3 0.0568 1

Table B.1: Network Line data

Impedances for each configuration are labelled as Z, for configuration x.

0.3465 + 1.0179j 0.1560 + 0.5017j 0.1580 + 0.4236j


Zi = 0.3375 + 1.0478j 0.1535 + 0.3849j
0.3414 + 1.0348j

0.7526 + 1.1814j 0.1580 + 0.4236j 0.1560 + 0.5017j


Z2 = 0.7475 + 1.1983j 0.1535 + 0.3849j
0.7436 + 1.2112jJ

V =0.95; V=1.05
6 -0.01; = 0.01

183
B.1.1 Load and DER Configuration 1

Node P, phase A P, phase B P, phase C Q, phase A Q, phase B Q, phase C


2 200 300 500 100 150 300
3 200 500 100 80 350 20

Table B.2: Network nodal load data, in kW and kVAr

184
B.2 Network IEEE 13 Node

B.2.1 Default Configuration

This configuration of the IEEE 13-bus network is used in Chapter 3 for preliminary

results of OPF solved in distributed way using the CI model.

Parent Node Child Node Line length (ft) Impedance Configuration Code
1 2 2000 1
2 3 500 3
2 5 500 2
5 6 300 1
3 4 300 3
2 7 2000 1
7 9 300 4
9 10 300 5
9 11 800 7
7 8 500 6
7 12 1000 1

Table B.3: Network Line data

185
Impedances for each configuration are labelled as Z., for configuration x.

0.3465 + 1.0179j 0.1560 + 0.5017j 0.1580 + 0.4236j


0.3375 + 1.0478j 0.1535 + 0.3849j
0.3414 + 1.0348jj

0.7526 + 1.1814j 0.1580 + 0.4236j 0.1560 + 0.5017j


0.7475 + 1.1983j 0.1535 + 0.3849j
0.7436 + 1.2112j_

0 0 0
Z3 = 1.3294 + 1.3471j 0.2066 + 0.4591j
1.3238 + 1.3569j

3238 + 1.3569j 0 0.2066 + 0.4591j


Z4 = 0 0
1.3294 + 1.3471j_

0 0 0
Z5 = 0 0
1.3292 + 1.3475j

0.7982 + 0.4463j 0.31 92 + 0.0328j 0.2849 - 0.0143j

Z6 = 0.7891 + 0.4041j 0.3192 + 0.0328j


0.7982 + 0.44631

1.3425 + 0.5124j 0 0
0 0
0

V = 0.9; V = 1.1

_ = -0.08; 6 = 0.08

186
Load and DER Configuration 1

This is the passive configuration.

Node P, phase A P, phase B P, phase C Q, phase A Q, phase B Q, phase C


3 0 170 0 0 125 0
4 0 230 0 0 132 0
6 160 120 120 110 90 90
7 385 385 385 220 220 220
8 485 68 290 190 60 212
10 0 0 170 0 0 80
11 128 0 0 86 0 0

Table B.4: Network nodal load data, in kW and kVAr

Load and DER Configuration 2

This is the active configuration created for Chapter 3. Load data is unchanged from
configuration 1.

Distributed generation, real power


Node P, Phase A P, Phase B P, Phase C P, Phase A P, Phase B P, Phase C
9 100 100 100 0 0 0
Distributed generation, reactive power
Node Q, Phase A Q, Phase B Q, Phase C Q, Phase A Q, Phase B Q, Phase C
8 200 200 200 -200 -200 -200
9 50 50 50 -50 -50 -50
10 0 0 100 0 0 -100
Demand Response
Node % enabled
3 20
6 10
11 30

Table B.5: Distributed energy resources (DERs) for active configuration. Generation
capabilities in kW and kVA.

187
Load and DER Configuration 3

This is the active configuration used for simulations in Chapter 4, where the penetra-

tion of renewable resources is varied. Note that the loads at node 3 and 8 have been

removed, and renewable generation has been introduced. Two different test cases are

presented for this configuration: a lower penetration of renewables (test case 1), and

a higher penetration of renewables (test case 2). The type of resource is indicated,

where 'PV' is photovoltaic, 'Comm' is commercial, 'Res S' is small residential, and

'Res L' is large residential. Refer to Appendix B.7 for information and generation

profiles of each resource type. All power and capacity data in kW and kWh.

Distributed generation, real power


Node P, Phase A NodeP,P, Phase
hasB A PP,
PhsePhase
P, has CC , Phse
_P, Phase
P,Phas B A , Pase
_P, Phase B _P, Phs C
9 150 150 150 0 0 0
Distributed generation, reactive power
Node Q, Phase A Q, Phase B Q, Phase C Q, Phase A Q, Phase B Q, Phase C
9 75 75 75 -75 -75 -75
Renewable Generation
Node Capacity Phases Type Test Case
2 130 a-b-e PV, Comm {2}
3 20 a-b-e PV, Res L { 1,2}
5 100 a-b-c PV, Comm { 1,2}
8 15 a-b-c PV, Res L { 1,2}
Demand Response
Node % enabled
4 20
6 10
11 30

Table B.6: Distributed energy resources (DERs) for active configuration. Generation
capabilities in kW and kVA.

Load and DER Configuration 4

This is the active configuration used for simulations in Chapter 4, where the total

installed storage capacity is varied. Note this uses the data from Configuration 3

(above), for test case 1. Three different test cases are presented, over which the

capacity of storage present at node 12 is varied. The type of renewable energy resource

188
is indicated, where 'PV' is photovoltaic, 'Comm' is commercial, 'Res S' is small

residential, and 'Res L' is large residential. Refer to Appendix B.7 for information

and generation profiles of each resource type. All power and capacity data in kW and

kWh.

Distributed generation, real power


Node P, Phase A P, Phase B P, Phase C P, Phase A P, Phase B P, Phase C
9 150 150 150 0 0 0
Distributed generation, reactive power
Node Q, Phase A Q, Phase B Q, Phase C Q, Phase A Q, Phase B Q, Phase C
9 75 75 75 -75 -75 -75
Renewable Generation
Node Capacity Phases Type
3 20 a-b-c PV, Res L
5 100 a-b-c PV, Comm
8 15 a-b-c PV, Res L
Storage
Node Capacity Power Ramp G A/L) qself Initial SOC
12 1000 700 600 1/1 0 500
500 300 300 0.95/0.95 0.021 100
2000 700 600 0.95/0.95 0.021 300
Demand Response
Node % enabled
4 20
6 10
11 30

Table B.7: Distributed energy resources (DERs) for active configuration. Generation
capabilities in kW and kVA, and capacities in kWh.

Load and DER Configuration 5

This is the active configuration used for simulations in Chapter 4, where only DR and

storage are added to the grid. The loads are the same as the passive configuration.

All power and capacity data in kW and kWh.

189
Distributed generation, real power
Node P, Phase A P, Phase B P, Phase C P, Phase A P, Phase B P, Phase C
9 150 150 150 0 0 0
Distributed generation, reactive power
Node Q, Phase A Q, Phase B Q, Phase C Q, Phase A Q, Phase B Q, Phase C
9 75 75 75 -75 -75 -75
Storage
Node Capacity Power Ramp r/C/77 r/self Initial SOC
12 1000 700 600 0.95/0.95 0.021 150
Demand Response
Node % enabled
3 40
4 20
6 50
8 10
11 30

Table B.8: Distributed energy resources (DERs) for active configuration. Generation
capabilities in kW and kVA, and capacities in kWh.

Load and DER Configuration 6

This is the active configuration used for simulations in Chapter 4, where only DR is

added to the grid. The loads are the same as the passive configuration. All power

and capacity data in kW and kWh.

Distributed generation, real power


Node P, Phase A P, Phase B P, Phase C P, Phase A P, Phase B P, Phase C
9 150 150 150 0 0 0
Distributed generation, reactive power
Node Q, Phase A Q, Phase B Q, Phase C Q, Phase A Q, Phase B Q, Phase C
9 75 75 75 -75 -75 -75
Demand Response
Node % enabled
3 40
4 20
6 50
8 10
11 30

Table B.9: Distributed energy resources (DERs) for active configuration. Generation
capabilities in kW and kVA, and capacities in kWh.

190
B.2.2 Balanced Configuration

The balanced configuration of the 13-bus network is used to compare current injection

and branch flow models. All cables were assumed to be 3-phase transposed, with con-

figurations 1 thru 7 converted to symmetric matrices, and using the positive sequence

component. The impedance configurations are provided below, and are labelled as

Z, for configuration x.

0.1860 + 0.59684 0 0
Zi = 0.1860 + 0.5968i 0
0.1860 + 0.5968iJ

0.5921 + 0.76022 0 0
Z2 = 0.5921 + 0.7602i 0
0.5921 + 0.7602iJ

0.8155 + 0.7483zi 0 0
Z3 = 0.8155 + 0.7483i 0
0.8155 + 0.7483iJ

0.8155 + 0.7483i* 0 0
Z4 = 0.8155 + 0.7483i 0
0.8155 + 0.7483iJ

0.4431 + 0.4492" 0 0
Z5 = 0.4431 + 0.4492i 0
0.4431 + 0.4492iJ

0.4874 + 0.4151 0 0
Z= 0.4874 + 0.4151i 0
0.4874 + 0.4151i

191
0.4475 + 0.1708i 0 0
Z7 = 0.4475 + 0.1708i 0
0.4475 + 0.1708i

V = 0.9; V=1.1

Load and DER Configuration 1

This is the passive configuration. The IEEE 13 bus network was modified to be a

balanced 3-phase distribution network as below:

" switches were assumed in their normal positions

* single-phase spot loads were assumed to be 3-phase

Node P Q
3 170 125
4 230 132
6 133 97
7 385 220
8 281 154
10 170 80
11 128 86

Table B.10: Network nodal load data, in kW and kVAr

B.2.3 Configuration for Ancillary Market Simulations

The IEEE 13 bus network was modified to be 3-phase balanced as below:

" switches were assumed in their normal positions

" single-phase spot loads were assumed to be 3-phase

" cables were assumed to be 3-phase transposed, with configurations 1 thru 7

converted to symmetric matrices

192
* shunt capacitors were modeled as reactive power generators, and were assumed

to be 3-phase

The configuration of nodes and lines varies slightly, as all nodes from the original

network are retained and a new line impedance configuration is created to connect to

switches and transformers. The data is provided below.

Parent Node Child Node Line length (ft) Impedance Configuration Code
1 2 2000 1
2 3 500 2
2 5 500 3
5 6 300 3
3 4 1 8
2 7 2000 1
7 8 1 8
7 10 300 4
7 13 1000 1
8 9 500 6
10 11 800 7
10 12 300 5

Table B.11: Network Line data

The impedances are the same as in Appendix , with the additional configuration
being a matrix of zeros.

The loads are the same as in Appendix B.2.3, except the labelling of the nodes

are different. As such, the data is provided again:

Node P Q
4 133 97
5 170 125
6 230 132
7 385 220
8 170 151
9 281 154
11 128 86
12 170 80

Table B.12: Network nodal load data, in kW and kVAr

The three feeder variations were developed by adding generators of varying ca-

193
pacity at different locations as in Table B.13.

Table B.13: Generation node data for IEEE 13

j EB 1 4 10 13
Feeder 1
pG [MW] 40 0.8 0.5 0.3
jEB 1 5 8 12
Feeder 2
pG [MW] 40 1 1.5 1.5
j EB 1 10 8
Feeder 3
pG [MW] 40 2 0.25

194
B.3 Network IEEE 123 Node

B.3.1 Default Configuration

This configuration of the IEEE 123-bus network is used in Chapter 3 for prelimi-

nary results of OPF solved in distributed way using the CI model, and Chapter4 for

multi-period optimization. Due to the large data size, the information on electrical

line/loads and generators can be found in IEEE documentation [86]. Key data is
provided below.
Some buses (switches) were removed, and some were relabelled. This data is
summarized here:

Original Label New Label


149 1
152 116
250 117
300 118
450 119

Table B.14: Network nodal load data, in kW and kVAr

Buses 120, 135, 160, and 197 were removed (switches) and the new line configu-

rations are:

Load and DER Configuration 1

This is the passive configuration. See IEEE documentation [86] for loads.

Load and DER Configuration 2

This is the first active configuration created for Chapter 3. Load data is unchanged

from configuration 1. Total PV penetration is 179kW.

195
Distributed generation, reactive power
Node Q, Phase A Q, Phase B Q, Phase C Q, Phase A Q, Phase B Q, Phase C
82 200 200 200 -200 -200 -200
90 50 50 50 -50 -50 -50
92 50 50 50 -50 -50 -50
94 50 50 50 -50 -50 -50
Renewable Generation
Node Capacity Phases Type
4 9 c PV, Res S
9 3 a-b-c PV, Res S
14 12 a-b-c PV, Res L
15 6 a PV, Res S
16 5 c PV, Res S
19 7 a-b-c PV, Res S
22 10 a-b-c PV, Res S
24 3 a-b-c PV, Res S
26 7 a-b-c PV, Res S
28 4 a-c PV, Res S
37 3 a-b-c PV, Res S
41 5 c PV, Res S
45 8 a-b-c PV, Res S
55 12 a-b-c PV, Res L
58 3 a-b-c PV, Res S
62 6 a-b-c PV, Res S
73 9 a-b-c PV, Res S
79 6 a-b-c PV, Res S
98 10 a-b-c PV, Res S
102 10 a-b-c PV, Res S
106 14 a-b-c PV, Res L
109 4 a-b-c PV, Res S
111 2 a PV, Res S
116 2 a-b-c PV, Res S
117 9 a-b-c PV, Res S
118 2 a-b-c PV, Res S
119 8 a-b- PV

Table B.15: Distributed energy resources (DERs) for active configuration. Generation
capabilities in kW and kVA.

196
B.3.2 Configuration for Energy Market Simulations

The IEEE 123 bus network was modified to be 3-phase balanced as below:

" switches were assumed in their normal positions

" single-phase spot loads were assumed to be 3-phase

" cables were assumed to be 3-phase transposed, with configurations 1 thru 12

converted to symmetric matrices

" shunt capacitors were modeled as reactive power generators, and were assumed

to be 3-phase

Electrical line/loads and generators data is in IEEE documentation [86]. Base values

and parameters are in Table B.17. Generators are in Table B.16.

Table B.16: Generation node data for IEEE 123

j cB 1 25 40 67 81 94
PG [MW] 20 0.5 0.7 0.8 1.2 0.75

197
Table B.17: Base values and simulation parameters for IEEE 123

Parameter IEEE 123


131 123
T 122
fbase, Hz 60
Vbase, kV 4.16
Sbase, kVA 10 3
vj, Pu 0.8
TIj, pu 1.2
S , pu 10
Q9, -Q9 See [86]
pG
-

PP 0

QL See [86]
QI 0
E [400,800]
E [4, 8]
,3QG [4, 8]
100
1

198
B.4 Network JST-CREST 126 Node

The original network model is presented in detail in [81]. Here we employ a compressed
version of that network, shown in Fig. B-1. Our model contains |Bl =84 nodes and 6
lines all connected to the feeder node in a star topology.

9 62 LINE D LINE F 78 83
LINE A 33

LINE B

LINE C 18

LINE E
53

Figure B-1: An illustration of the distribution network model. The filled circles show
the nodes B. The red, blue and green filled circles indicate loads, local generators
and both, respectively.

Details of base values and parameters are provided in Table B.18, with base values
determined as typical to power systems in Japan [90]. Information on electrical
lines/loads and generators can be found in Table B.19 and Table B.20, respectively.
The parameters PL are obtained randomly, to satisfy the total upper capacity values
in Table B.19.

199
Table B.18: Base values and simulation parameters for J-CREST 126

Parameter JST-CREST 126


|B| 84
T 83
fbase, Hz 50
Vbase, kV 6.6
Shase, kVA 10 3
vj, Pu 0.95
U[, pu 1.05
S?. pu 2
Qf, -Qf 0.15PG
PG 0
PL 0
Q 0
Qj 0
c [400, 800]
#-G c [4, 8]
/QG E [4, 8]
100
AQ 1

Table B.19: Line and load node data for J-CREST 126

LINE A B C D E F
Nodes in $ 8 31 18 8 8 10
Branchesin T 1 14 6 1 1 4
Total # of loads j 4 17 12 4 4 6
Sum of P,L [MW] 0.84 3.56 2.51 0.84 0.84 1.26

Table B.20: Generation node data for JST-CREST 126

jE B 1 9 18 33 53 62 78 83
P [MW] 10 5 0.6 1.2 0.6 0.3 1.8 3
PL [MW] 0 0 0.14 0.08 0.31 0.08 0.32 0.07

200
B.5 Electricity LMP Data

The locational marginal price (LMP) for the New England are is published online by

the Independent System Operator (ISO-NE) [371. The 5-minute real-time LMP data

for May 14 2019 is queried and averaged over 12 periods to give hourly LMP data.

This is the A# in $/kWh, and is provided below. Note that we take A# = 0A#.

Hourly LMP prices, obtained from ISO-NE real-time data


May 14, 2019
0.04

0.035
-

0.03
-

0.025
-

0.02
-

0.015
-

0 5 10 15 20 25
Time, 24hr

Figure B-2: Demand profile taken from the system-wide demand for ISO-NE.

201
Time (hr) LMP ($/kWh)
00 0.0218
01 0.0192
02 0.0193
03 0.0194
04 0.0191
05 0.0189
06 0.0321
07 0.0266
08 0.0229
09 0.0204
10 0.0206
11 0.0215
12 0.0217
13 0.0216
14 0.0216
15 0.0212
16 0.0215
17 0.0273
18 0.0316
19 0.0291
20 0.0266
21 0.0258
22 0.0394
23 0.0350

Table B.21: Hourly electricity prices from the real-time WEM for ISO-NE.

202
B.6 Electricity Demand Data

The electricity demand profile is obtained from the ISO-NE reports on total recorded

electricity demand for each five-minute interval [38], for real power. The report is

queried for May 14, 2019, and normalized. The 5-minute data is then averaged over

12 periods to give hourly demand data.

Base demand profile, obtained from ISO-NE system load data


May 14, 2019
1 I

0.95

0.9
-

0.85
-

0.8 k

0.75

0.7
0 5 10 15 20 25
Time, 24hr

Figure B-3: Demand profile taken from the system-wide demand for ISO-NE.

203
Time (hr) Demand coefficient
00 0.7366
01 0.7364
02 0.7251
03 0.7252
04 0.7437
05 0.7922
06 0.8646
07 0.9288
08 0.9330
09 0.9290
10 0.9268
11 0.9264
12 0.9227
13 0.9215
14 0.9181
15 0.9170
16 0.9434
17 0.9778
18 0.9892
19 0.9940
20 0.9880
21 0.9293
22 0.8423
23 0.7625
Table B.22: Hourly demand coefficient taken from the system-wide demand for ISO-
NE.

204
B.7 Renewable Generation Forecasts

B.7.1 Small scale distributed residential PV

Generation profile for a 3.85kW distributed residential solar PV resource (small re-

source), obtained from NREL's System Advisory Model (SAM) tool, queried for May

14. This model is used for residential resources up to 10kW size. Resource data

is for Phoenix, AZ, using the SunPower SPR-X21-335 module, and SMA America

(SB3800TL-US-22, 240V) inverter. The DC to AC ratio is set to the default of 1.2.

The desired array size is set to 4kWdc, giving a total AC capacity of 3.85OkWac, and

uses 1 inverter. All other parameters are left unchanged in the SAM setup.

Generation profile for a 3.85kW distributed residential solar PV resource


May 14, 2019
3.5

2.5 V

2
-z

0
1.5 k

0.5

0
0 5 10 15 20 25
Time, 24hr

Figure B-4: Solar PV generation profile for small distributed residential resource,
obtained from NREL's SAM tool.

205
Time (hr) Power (kW)
00 0
01 0
02 0
03 0
04 0
05 0
06 0.207588
07 0.796325
08 1.75089
09 2.62495
10 3.29244
11 3.74114
12 3.95503
13 3.92816
14 3.63557
15 3.09874
16 2.31529
17 1.29041
18 0.21557
19 0
20 0
21 0
22 0
23 0

Table B.23: Generation profile for a 3.85kW distributed residential solar PV resource

206
B.7.2 Large scale distributed residential PV

Generation profile for a 11.55kW distributed residential solar PV resource (small

resource), obtained from NREL's System Advisory Model (SAM) tool, queried for

May 14. This model is used for residential resources larger than 10kW size. Resource
data for Phoenix, AZ, using the SunPower SPR-X21-335 module, and SMA America

(SB3800TL-US-22, 240V) inverter. The DC to AC ratio is set to the default of 1.2.

The desired array size is set to 12kWdc, giving a total AC capacity of 11.550kWac,

and uses 3 inverters. All other parameters are left unchanged in the SAM setup.

Generation profile for a 11.55kW distributed residential solar PV resource


May 14, 2019
9

S4

0 I I I
0 5 10 15 20 25
Time, 24hr

Figure B-5: Solar PV generation profile for large distributed residential resource,
obtained from NREL's SAM tool.

207
Time (hr) Power (kW)
00 0
01 0
02 0
03 0
04 0
05 0
06 0.518969
07 1.99081
08 4.37724
09 6.56236
10 8.23361
11 9.35284
12 9.88759
13 9.8204
14 9.08893
15 7.74686
16 5.78823
17 3.22603
18 0.538925
19 0
20 0
21 0
22 0
23 0
Table B.24: Generation profile for a 11.55kW distributed residential solar PV resource

208
B.7.3 Distributed commercial PV

Generation profile for a 185kW distributed commercial solar PV resource, obtained

from NREL's System Advisory Model (SAM) tool, queried for May 14. Resource

data is for Phoenix, AZ, using the SunPower SPR-E19-310-COM module, and SMA

America (STP 60-US-10, 400V) inverter. The DC to AC ratio is set to the default

of 1.2. The desired array size is set to 220kWdc, giving a total AC capacity of

179.58OkWac. All other parameters are left unchanged in the SAM setup.

Generation profile for an 185kW distributed commercial solar PV resource


May 14, 2019
150

100 k

50 |-

0 .................
0 5 10 15 20 25
Time, 24hr

Figure B-6: Solar PV generation profile for distributed commercial resource, obtained
from NREL's SAM tool.

209
Time (hr) Power (kW)
00 0
01 0
02 0
03 0
04 0
05 0
06 9.23617
07 35.5421
08 78.1584
09 117.068
10 147.029
11 167.309
12 177.106
13 176.132
14 162.819
15 138.732
16 103.488
17 57.5034
18 9.51637
19 0
20 0
21 0
22 0
23 0
Table B.25: Generation profile for an 185kW distributed commercial solar PV resource

210
B.7.4 Wind Farm

Generation profile for a 600kW wind farm resource, obtained from NREL's System

Advisory Model (SAM) tool, queried for May 14.

Generation profile for a 600kW wind farm


May 14, 2019
400

350
-

300
-

250
-

200-

150
-

100
-

50
-

0 L
0 5 10 15 20 25
Time, 24hr

Figure B-7: Wind generation profile for wind farm, obtained from NREL's SAM tool.

211
Time (hr) Power (kW)
00 157.248
01 120.554
02 38.0912
03 18.6316
04 16.78
05 16.9781
06 21.9101
07 24.9154
08 29.0332
09 50.1929
10 81.6055
11 167.594
12 352.588
13 402.553
14 459.247
15 468.504
16 477.276
17 425.394
18 420.121
19 422.718
20 426.086
21 426.088
22 462.448
23 462.949

Table B.26: Generation profile for a 600kW wind farm

212
Appendix C

MATLAB Code

C.1 Main Scripts

masterSolver.m

%% c todetermine best PAC arameters for imlemettion

fac= {1: sov- witJ A,2 aaee

tes aam = "" "gmm" "ho"

gridlD= "Node","13Noe", "23Nd"

function masterSolver(gridID,dataConfigCode,T,K,initCondStatus,fnc,testParam)

FontSize = 12; % DeaultLineSiz e


LineWdith = 1.5;

MarkerSize = 16;

set (0, FontSize)


set (0, 'Textonize',FontSize);

set (0, 'de fa tText Interpret-er', 'latex');

set (0, ' d u e d rpreter , latex')

213
set (0, 'defaultAxesTickLabelInterpreter', 'latex');

set(0, 'defaultLineLinewidth',LineWdith);

set (0, 'defaultLineMarkerSize',MarkerSize);

% set (0, 'defaultigureindwSyle','docked')

kInit = 2; eps = le-3;

runSetup = 1; runPAC = 0;

runCIOPF = 1; runADMM = 0;

saveInd = 1; % to save ig andl a:Ia ednee for MOPF graphingJ

% setup anad solve the opttimization prolem

solveOPF;

end

solveOPF.m

dbstop if error

if runSetup

pathname = './networkd ata';

filename = strcat ('Network',gridID, T', int2str(T) ,'NEW.mat'); appenCN for

if isfile(strcat(pathname,filename))

load(strcat(pathname,filename))

else

fprintf('\n\t ERROR NETWORK FILE NOT FOUND\n');

ret urn;

end

%et pr data,
aio in atominzed rm

nodeData = strcat (" [Hj,ej,ineqcon, limits, costs,rengenInds,battInds,Sindsj,Sindsnew,

eval (nodeDa ta);

214
uo dat e vats for st orag e (dercomosimtion aireacv upD 1atedC.)

if ~isempty (battInds)

Lj = cellfun(@numel, Lset); % size of OWnd ar of each t

Tj = cellfun(@numel, Tset); %size cf each atom

aInds = cumsum(Tj);

numT = sum(Tj); t nuM

muInds = cumsum(Cj);

%~~ ru pae osn B jjl B2, nl

Oidlx=[];%rosf

ori=1:si-ze(Oset,2)

Otmp=Oset{i}';

atom=ones(size(O-tmp))*i;

Oidx= [Oidx; [O_tmp, atom]];

end

Tidx=[];

for i=1:size(Tset,2)

T-tmp=Tset{i}';

atom=ones(size(T-tmp))*i;

Tidx= [Tidx; [Tttmp, atom]];

end

uniqueVars = unique(Oidx(:,l));

rowgroup = arrayfun(@ (x) find(Oidx( :,1)==x) ,uniqueVars, 'UniformOutpu',false);

colgroup = arrayfun (@ (x) find (Tidx(:, 1)==x) ,uniqueVars, 'UniformOuzput',false);

vals = [];

rowidx = [
colidx = H;
for i=1:size(uniqueVars,1)

var = uniqueVars(i);

row = rowgroup{i};

col = colgroup{i};

atomO = Oidx(row,2); atcoms w i copy


atomT = Tidx(col,2);

215
owner = setdiff(atomT,atomO);%nd owner of v (in T, not in

)
owneridx = col(atomT == owner); find index in T of owner o var , not

copieridx = col (atomT ~ owner); find index f copy of var (only in

rowidx = [rowidx,reshape(repmat(row', 2, 1),1, [])1J


colidx = [colidx, reshape( [ones(1,size(copieridx, 1)) *owneridx; copieridx'],1,
vals = [vals,repmat([-1,1],1,size(copieridx,1))1;

% 0 rW , col Umn)

% are
Oid _-ro ws, Tid x ar colums

end

B = sparse(rowidx,colidx,vals,size(Oidx,1),size (Tidx, 1));

%oj(this
i _(j,- matrix)

Bj={}; Bj{N}={};

nuInds=zeros(1,N);

totalidxl = 0;

l _(-, ) which is nded for L a

Bj2={}; Bj2{N}={};

totalidx2 = 0;

for j = 1:N

numrows = size(Oset{j},2);

Bj{j} = B(totalidx_1+1:(totalidx_1+numrows),:);

totalidx_1 = totalidx_1 + numrows;

nuInds(j) = totalidxl;

% B_(-,
)

numcols = size(Tset{j},2);

Bj2{j} = B(:,totalidx_2+1:(totalidx_2+numcols));

totalidx_2 = totalidx_2 + numcols;

end

% build actuation projection matrix, PhiAct (P a Q arc actuation vars)

indsAct = (13:18); to ge'>t P and Q from every aj will need to update tor MOiD

indsActrep = reshape(repmat(indsAct,T,1)',1, []);


indsAct2rep = reshape(repmat((0:2),2*T,1)',1, []); % 3 phases per var

216
indsActAll = indsActrep + indsAct2rep;

colsAct = reshape(repmat([0,aInds(1:N-1)],2*3*T,1),1, []) + repmat(indsActAll,1,I

PhiAct = sparse (1:2*3*N*T,colsAct,ones(1,2*3*N*T),2*3*N*T,numT);

%
end

P_max = limits{1O};

Vr_min = limits{5}; Vr-max = limits{6};

Vi_min = limits{7}; Vi-max = limits{8};

xi = 50; % e ih Ting fr iecriIcal oses& price f e

Ibranchrmax = ones(3*M*T,1);

Ibranchimax = ones(3*M*T,1);

%e
enerated a tr.omi7ei obecti

[objfncs,globalObjfnc,L) = getObj-economic(N,T,costs,P-max);

[-jns bl fcL Max ax);


, =w l e N, M, T oS

end

arge problenS

allL = horzcat(Lset{:})'; allownd S

skip = cumsum(Tj);

cols =

for j 1:N

if j == 1

cols vertcat(cols,(1:Lj(j))');

else

cols = vertcat(cols,((1:Lj(j))+skip(j-1))');

end

end

PhiL = sparse (allL,cols,ones(1,size (alIL,1)),numTotalVars,numT); % y = , La

invPhiL = sparse(1:numT,horzcat(Tset{:}),ones(1,numT),numT,numTotalVars); a

G_tilda = blkdiag(Gj{:});
%

217
IrIndsAll = (1:3*N*T); % Ir is 1st set ofvar's

IiIndsAll = 3*1*N*T + (1:3*N*T); % Ii


is 2d set cof var s
VrIndsAll = 3*2*N*T + (1:3*N*T); %v r

ViIndsAll = 3*3*N*T + (1:3*N*T); Vi s 3r set Lfs

PIndsAll = 3*4*N*T + (1:3*N*T); P is s 4 s

QIndsAll = 3*5*N*T + (1:3*N*T); % Q is


is cth .e17 var s
MCEaIndsAll = 3*6*N*T + (1:3*N*T);
is se 0t f va-rsc
MCEbIndsAll = 3*7*N*T + (1:3*N*T); bi

MCEcIndsAll = 3*8*N*T + (1:3*N*T); c

MCEdIndsAll = 3*9*N*T + (1:3*N*T); %

.
if ~isempty (battInds)

Se-.te Pd is and Pchare indices

sizeNewVars = (numTotalVars - 3*N*numVars*T)/2;

PdisIndsAll = 3*N*numVars*T + (1:sizeNewVars);

PchargeIndsAll = 3*N*numVars*T + sizeNewVars + (1:sizeNewVars);

else

PdisIndsAll =

PchargeIndsAll = [];

end

%u cent rallv leaded


if runCIOPF

%r CIOPF

% run ACIOPF

H_tilda = blkdiag(Hj{:});

e_tilda = vertcat(ej{:});

SGtilda, = bkdiagr(Gj(:}); % otl

[aCIOPF, yCIOPF, muEq, muIneq, nuEq, error] = aciopfmin(N,M,T,numTotalVars,numT,glol

it error == 1
fprint f (\n\t RROR IN ACIOPF\n);

return;

218
e nd

end

genSaveResFig(yCIOPF, N, M, T, rengenInds, battInds, Sindsj, Sindsnew, limits, saveInd,

if runPAC

if runSetup

alpha = 0.5;

if runPAC

timePAC = zeros(N,K);

eigsPAC = eig(G_tilda'*Gtilda + B'*B);

sigMinPAC = min(eigsPAC(eigsPAC > le-3));

sigMaxPAC = max(eigsPAC);

gammaPAC = (2*alpha*L) / (2*sigMaxPAC + sigMinPAC);% (2*alph +2)/ (2 iviAC)

rhoPAC = 1/sqr-t(gammaPAC*sigMaxPAC);

gammaHPAC = gammaPAC;

% gmmaAC~g =4*Pi^2(sig~inPAC*n~orm (Piy*xROPF~a (,),2)^2);


-C A ;

% iPC1 g srt(igf PCsi xPA) / (2*Phi.norm (Piy*xRO'PFMat (:,1) ,2)) ;

end

end

switch fnc

case 1

% r':m PAC" sripz ally f Er s S

[aPAC, yPAC, muPAC, nuPAC, timePAC, totaltimePAC, aPACCVX, muPACCVX, nuPACCVX] =so

runSetup, initCondStatus,N,M,K,kInit,eps,...

numT,numTotalVars,numCVs,numTotalnG,Tj,muInds,nuInds,aInds,

G_tilda, B, Gj, Bj, Bj2, Hj, ej, PhiL, invPhiL, objfncs, . .


.

219
rhoPAC,gammaPAC,gammaPAC,aCIOPF,muEq,nuEq);

fprintf ('\n\t

fprintf('\n\t Time elapsed: \n');

fprintf(sprintf('\n\t Total time elapsed: %d for %d iterations',totaltimePA(

fprintf ( \n t Plotting Met rics\n')

metrics = calculateMetrics(K,N,globalObjfnc,PhiL,PhiAct,G-tilda,B,aPAC,runC:

plotMetrics (K, metrics, 1,0,'');

case 2

% p P r S

rangeParam = optParamPAC(testParam, [L,gammaPAC,rhoPAC],alpha,sigMaxPAC,sigM:

Lrange = rangeParam{l}; gammarange = rangeParam{2}; rhorange = rangeParam{3

iters = size(Lrange,2);

paramTestRes = {};

paramTestRes{iters} = {};

timeTestRes = zeros(1,iters);

maxFeasTest = zeros(1,iters);

maxConsisTest = zeros(1,iters);

endFeasTest = zeros(1,iters);

endConsisTest = zeros(1,iters);

timeNow = datestr(now, 'vyymmddTHHMMSS'); % (1S 861 s dard

filepath = strcat(' ./resprocessing/simresults /', timeNow, '_paramTesting_',gr:

mkdir(filepath)

for i = 1:iters

Ltest = Lrange(i);

gammatest = gammarange(i);

rhotest = rhorange(i);

[aPAC, yPAC,muPAC, nuPAC, timePAC, totaltimePAC, aPACCVX,muPACCVX, nuPACCVX]

220
runSetup, initCondStatus, N, M, K, kInit, eps, ...

numT,numTotalVars,numCVs,numTotalnG,Tj,muInds,nuInds,aInds,

G-tilda,B,Gj,Bj,Bj2,Hj,ej,PhiL,invPhiL,objfncs,

rhotest,gammatest,gammatest,aCIOPF,muEq,nuEq);

metrics = calculateMetrics(K,N,globalObjfnc,PhiL,PhiAct,G-tilda,B,aPAC,:

[maxFeas,maxFeasInd] = max(metrics(4,:));

[maxConsis,maxConsisInd] = max(metrics(5,:));

paramTestRes{i} = {Ltest,gammatest,rhotest,totaltimePAC,aPAC(:,end),...

maxFeas,maxFeasInd,maxConsis,maxConsisInd,metrics (4,end),metrics(5,

timeTestRes(i) = totaltimePAC;

maxFeasTest(i) = maxFeas;

maxConsisTest(i) = maxConsis;

endFeasTest(i) = metrics(4,end);

endConsisTest(i) = metrics(5,end);

plotMetrics(K,metrics,0,1,strcat(filepath, '/',timeNow, ', 'irer int2st:

i ,cnsitancy) currentd
%o(ea sibiiy consistency) 1-

end

filename = strcat (timeNow, _paramTesting_',gridID);

%ritetable (paramestses, t rest (i.lepath, a ilename)

save (strcat (filepath, '/,filename), 'paramTestRes', 'rangeParam','timeTestRes

otherwise

fprintf`('\n\t ERROR: Unknown fnc\n');

end

end

221
% fpr intf ('_\n\t

% fprintf('\n\t Time elapsed: \n');

% fprintf(sprintf('\n\t Total time elapsed: %d for %d iterations',totaltimePAC/60,K));

% fprintf (P\nt ------------ Plotting Metrics\n') ;

% metrics = calculateMetrics (k, globalObjfuc,PhiL,aPAC, runClOPF, aCIOPF);

plotMetrics (K, metri cs);


%

% process results to check things and produce relevant graphs

%fprintf ('\n\t - -- - - ----.. . Plotting Results\n');

%Apac = aPAC (: ,k_) ;

%Yp~ac = PhiL*Apac;

% graphRes (N, Apac, Ypac, limits)

function rangeParam = optParamPAC(testParam,optParams,alpha, sigMax,sigMin,N)

% optParams order: [L, gamma, rho]

L = optParams(1); gamma = optParams(2); rho = optParams(3);

gammaPAC - (2*alphaL)/ (2*sigMaxPAC + sigMinPAC);%(2*alpha*L+2)/(sigMinPAC);

% rhoPAC =1sr gmaA~i~xA)

iters = 100;

switch testParam

case "L"

Llow = 0.1;

Lupp = 4160*3*N*100;

Lrange = linspace (Llow, Lupp, iters);

gammarange = (2*alpha*Lrange)/(2*sigMax + sigMin);

rhorange = I ./sqrt (gammarange*sigMax);

gammarange = gamma*ones (size (Lrange));


rhorange - rho*ones (size (Lranqe));

case "gamma"

222
gammalow = gamma/10;

gammaupp = gamma*10;

gammarange = linspace(gammalow,gammaupp,iters);

Lrange = L*ones(1,iters);

ig~OaxfP AC)

rhorange = rho*ones(1,iters);

case "rho"

rholow = rho/10;

rhoupp = rho*10;

rhorange = linspace(rholow,rhoupp,iters);

Lrange = L*ones(1,iters);

gammarange = gamma*ones(1,iters);

otherwise

fprintf('\n\EERROR: Inccrrect testing para-meter\n');

end

rangeParam = {Lrange, ganmarange, rhorangel;

end

function [aPAC,yPAC,muPAC,nuPAC,timePAC,totaltimePAC,aPACCVX,muPACCVX,riuPACCVX] = solvel

N,M,K,kInit,eps,numT,numTotalVars,numCVs,numTotalnG,Tj,muInds,nuInds,aInds,

Gtilda,B,Gj,Bj,Bj2,Hj,ej,PhiL,invPhiL,objfncs,rhoPAC,gammaPAC,gammaHPAC,aC:

if runSetup

yO zeros(numTotalVars,1); CLCBAL VAR

muEqO = zeros (numTotalnG,1); egu cons

nuEqO zeros (numCVs,1); :.sue ofvr

switch initCondStatus

case 1 %a m i l o

1loriita estiCg, 1justi ui zero:


(

aO = invPhiL*yO;

ul s ata TA>freasibil It

muEqO = rhoPAC*gammaPAC*Gtilda*aO;

223
nuEqO = rhoPAC*gammaPAC*B*aO;

case 2 optirIal ceCnra.

aO = aCIOPF;

muEqO = -muEq;

nuEqO = -nuEq;

yO = PhiL*aO;

case 3 perturbed optimal

eps = le-2;

aO = aCIOPF + 2*eps.*(rand(numT,1)-0.5);

% d m ntain feail

muEqO = rhoPAC*gammaPAC*Gtilda*aO;

nuEqO = rhoPAC*gammaPAC*B*aO;

yO = PhiL*aO;

end

n i n i e ec

aPAC = zeros(numT,K);

aPAC(:,1) = aO;

yPAC = zeros(numTotalVars,K);

yPAC(:,1) = yO;

muPAC = zeros(numTotalnG,K);

muPAC(:,1) = muEqO;

nuPAC = zeros(numCVs,K);

nuPAC(:,1) = nuEqO;

I nitialize ectors for CVX (for testing)


aPACCVX = zeros(numT,K);

aPACCVX(:,1) = aO;

yPACCVX = zeros(numTotalVars,K);

yPACCVX(:,1) = yO;

muPACCVX = zeros(numTotalnG,K);

muPACCVX(:,1) = muEqO;

nuPACCVX = zeros (numCVs,K);

nuPACCVX(:,1) = nuEqO;

224
timePAC = zeros(N,K);

end

fprintf('\n\t Finished setup\n');

%iiilzmodels inGurob

fprintf('\n\t initializing PAC\n');

[models,newTj] = initAtomsGur(objfncs,Tj,Hj,ej,rhoPAC);

mujInds = {}; mujInds{N} = {};

nujInds = {}; nujInds{N} = {};

ajInds = {}; ajInds{N} = {};

for j = 1:N

if j == 1

midx = 1; nidx = 1; aidx = 1;

else

midx = muInds(j-1)+1;

nidx = nuInds(j-1)+1;

aidx = aInds(j-1)+1;

end

mujInds{j} = midx:muInds(j);

nujInds{j} = nidx:nuInds(j);

ajInds{j} = aidx:aInds(j);

end

tstart = clock;

for k=kInit:K

[aPAC(:,k),muPAC(:,k),nuPAC(:,k),timePAC(:,k),aPACCVX(:,k),muPACCVX(:,k),nuPACCI

updatePACOPFg(models,aPAC(:,k-1),muPAC(:,k-1),nuPAC(:,k-1),...

objfncs,Tj,Gj,Bj,Bj2,Hj,ej,mujInds,nujInds,ajInds,rhoPAC,gammaPAC,gammaHPAC,

aPACCVX(:,k-1),muPACCVX(:,k-1),nuPACCVX(:,k-1));

225
yPAC(:,k) = PhiL*aPAC(:,k);

print progress as necessary

if rem(k,500)==O

fprintf(sprintf('\n\t [PAC: Time %d/%d] Ran PAC',k,K));

end

end

tend = clock;

totaltimePAC = etime(tend,tstart);

end

function metrics = calculateMetrics (K,N,globalObjfnc,PhiL,PhiAct,G-tilda,B,aPAC,runCIOPI

setC metr-ics for gettng convergence

metrics = zeros(9,K);

if runCIOPF etrcs

metrics(1,:) = (globalObjfnc(PhiL*aCIOPF)).*ones(1,K); % central cost

metrics(2,1) = globalObjfnc(PhiL*aPAC(:,1)); % coSt

metrics(6,1) = globalObjfnc(PhiL*aPACCVX(:,1)); % cost

metrics(3,1) = norm(PhiL*(aCIOPF - aPAC(:,1)),2); % dist ot cost

metrics(7,1) = norm(PhiAct* (aCIOPF - aPACCVX(:,1)),2); %dist opt

end

for k = 2:K

metrics(2,k) = globalObjfnc(PhiL*aPAC(:,k));

distance
% to feasibilitV

metrics(4,k) = norm(G-tilda*aPAC(:,k),2);

% dis(t aice to consistency

metrics(5,k) = norm(B*aPAC(:,k),2);

metrics(6,k) = globalObjfnc(PhiL*aPACCVX(:,k));

% distan.3c to feas ibility

metrics(8,k) = norm(G-tilda*aPACCVX(:,k),2);

dstac
% t consistency

226
metrics(9,k) = norm(B*aPACCVX(:,k),2);

if runCIOPF

%dist ance to cpti ma act uaion

metrics(3,k) = norm(PhiAct*(aCIOPF - aPAC(:,k)),2);

metrics(7,k) = norm(PhiAct*(aCIOPF - aPACCVX(:,k)),2);

end

end

end

function plotMetrics (K,metrics, visibility, saveInd, filepath)

kVec = 1:K;

f igu-re('-visible', visibility);

subplot (2,2,1);

plot (kVec, metrics(1,kVec), k'); hold on;

plot(kVec, metrics(2,kVec),'b'); hold on;

(kVec, Metrics(,kve) ,' -') ; old


le(sprintf('Costs')); legend(COPF', 'PAC');

subplot(2,2,2);

plot(kVec, metrics(3,kVec), 'b'); hold on;

title (sprintf ( Distance to Optimal Actuation')); legend('PAC')

subplot (2,2,3);

plot(kVec, metrics(4,kVec), 'b'); hold on;

plokec, metrics (, kvec),'-'); hold on


title(sprintf('Distance to Feasibility'));

subplot (2,2,4);

plot (kVec, metrics(5,kVec), 'b'); hold on;

ote c, m) ' g' t ; holdn on;


title (sprintf ('Di stance to Consistency'));

227
if saveInd

if isempty(filepath)

fprintf('\n\t ERROR: Empty filepath for PAC figure\n');

else

filename = strcat (filepath, 'PACconvergence.fig');

savefig(filename)

end

end

if -visibility % close fig-ure that ian't displayed

close (gcf);

end

end

function genSaveResFig(y, N, M, T, rengenInds, battInds, Sindsj, Sinds-new, limi ts, sav

generate rraphchsched fm P l

generateResGraphs(y, N, M, T, rengenInds, battInds,Sindsj,Sindsnew, limits)

timeNow = datestr (now, 'yyyyrrddTHHNMSS'); (ISO 801 a


filepath = './resprocessing/sImresults//MOPF/';

filename = strcat(timeNow,gridID, '_T',int2str(T), 'config',int2str(dataConfigCode))


if saveInd

if isempty(filepath)

fprintf('\n\t ERROR: Empty flepath for MOPF res figure\n


else

f = strcat(filepath,filename);

savefig(strcat(f, ' .fig'))

save(strcat(f, '.mat'), 'y', 'N', 'M','T', 'rengenInds', 'battInds','Sindsj', 'Sin

end

end

close(gcf);

end

228
function graphRes(N,aPAC,yPAC,limits,battInds)

IrIndsAll = (1:3*N*T); % Iris 1s

IiIndsAll = 3*1*N*T + (1:3*N*T); seA ervar s


ofJar
VrIndsAll = 3*2*N*T + (1:3*N*T);

ViIndsAll = 3*3*N*T + (1:3*N*T);

PIndsAll = 3*4*N*T + (1:3*N*T);

%
e o; v--wars
QIndsAll = 3*5*N*T + (1:3*N*T);

%
6h S o 0 of i varS
MCEaIndsAll = 3*6*N*T + (1:3*N*T);
%b s7hst
MCEbIndsAll = 3*7*N*T + (1:3*N*T);
% bs hSet
MCEcIndsAll = 3*8*N*T + (1:3*N*T);

MCEdIndsAll = 3*9*N*T + (1:3*N*T);

if -isempty (battInds)

sizeNewVars = (numTotalVars - 3*N*numVars*T)/2;

PdisIndsAll = 3*N*numVars*T + (1:sizeNewVars);

PchargeIndsAll = 3*N*numVars*T + sizeNewVars + (1:sizeNewVars);

else

PdisIndsAll =

PchargeIndsAll =

end

Ir_min = limits{1}; Ir-max = limits{2};


Ii_min = limits{3}; Ii-max = limits{4};

Vr_min = limits{5}; Vr-max = limits{6};

Vi_min = limits{7}; Virmax = limits{8};

P_min = limits{9}; P-max = limits{10};

Q_min = limits{11}; Qmax = limits{12};

resP = yPAC(PIndsAll);

resQ = yPAC(QIndsAll);

resV = yPAC(VrIndsAll) + li*yPAC(ViIndsA.ll);

figure;

subplot(3,1,1); 1old on;

229
scatter(1:N*T,resP(1:3:end,:),'*','k');

scatter(1:N*T, [0;P-max(4:3:end,:)], '', 'k'); feede.r has max unbund

scatter (1:N*T,Pmin (1:3:end,:), 'o', 'k')

hline = refline([0 0]);

hline.Color = 'b';

hline.LineWidth = 0.5;

xlim([O N+1]);

title('Phase A');

ylabel('Power, P [pu]');

subplot(3,1,2); hold on;

scatter (1:N*T, resP (2:3:end, '* ',M'k')

scatter(1:N*T, [0;P max(5:3:end, :)],'o', 'k'); % feder has max unbounde

scatter (1:N*T,Pmin (2:3:end, :),'','k')

hline = refline([O 0]);

hline.Color = 'b';

hline.LineWidth = 0.5;

xlim([O N+1]);

tite('Phase B');

ylabel('Power, P [pu]');

subplot(3,1,3); hold on;

scatter(1:N*T,resP(3:3:end,:),'*','k');

scatter(1:N*T, [0;P-max(6:3:end, :)],'o', 'k'); % feeder has max n d

scatter(1:N*T,P-min(3:3:end,:),'o','k');

hline = refline([0 0]);

hline.Color = 'b';

hline.LineWidth = 0.5;

xlim([0 N+1]);

title('Phase C');

ylabel('Power, P [pu]');

xlabel('Node');

figure;

subplot(3,1,1); hold on;

scatter (1:N, resQ (1:3:end,: ) ,'k');


scatter (1:N, [0; Q max (4 :3: end, : ,' o', 'k 'M); %FeedulerL has ma.x unbounded( t

230
scatter(1:N,Qmin(1:3:end,:),'o','k');

hline = refline([0 0]);

hline.Color = 'b';

hline.LineWidth = 0.5;

xlim([0 N+1]);

title ('Phase A');

ylabel ( ' Reactive Power, Q [pul

subplot(3,1,2); hold on;

scatter (1:N, resQ(2:3:end,:, ''k

)
scatter (1:N, [0;Q_max (5:3:end,:)],'o','k'); % feeder has max unbounded

scatter(1:N,Q_min(2:3:end,:),'o','k');

hline = refline([0 0]);

hline.Color = 'b';

hline.LineWidth = 0.5;

xlim([O N+1]);

title('P-hase B');

ylabel('Reactive Power, Q [pu]');

subplot(3,1,3); hold on;

scatter(1:N,resQ(3:3:end,:),'*','k');

scatter(1:N, [0;Q max(6:3:end, :) ], 'o', 'k'); % feeder has maxunbounded

scatter(1:N,Q_in(3:3:end,:),'o','k');

hline = refline([0 0]);

hline.Color = 'b';

hline.LineWidth = 0.5;

xlim([0 N+1]);

title('Phase C');

ylabel('Reactive Power, Q [pu] ');

xlabel('Node');

Vmt = [ones(3,1); ones((N-1)*3,1).*O.95];

V_max = [ones(3,1); ones((N-1)*3,1).*1.05];

figure;

subplot (3,1,1); hold on;

231
plot(1:N,V-min(1:3:end),'k');

plot(1:N,V-max(1:3:end),'*k');

plot(1:N,abs(resV(1:3: end)), ' );

% scatter(I:N,abs(resV(1:3:end)), .','k');

xlim([O N+1]);

subplot(3,1,2); hold on;

plot(1:N,V-min(2:3:end),'k.');

-plot(1:N,V-max(2:3:end),''k');
olot(1:N,abs(resV(2:3:end)),'b');

% s catter-( 1:-N fab s (res V( 2: 3: end)) ' ,'k ;

xlim([O N+1]);

subplot(3,1,3); hold on;

plot(1:N,V min(3:3:end),'k');

plot(1:N,V max(3:3:end),'k');
plot(1:N,abs(resV(3:3:end)),'b');

s-atter(1:N,abs(resV(3:3:end)

xlim([O N+1]);

end

C.2 Atomized Central Solver

aciopf.m

function [ aOpt, yOpt, muEq, muIneq, nuEq, error ] = aciopfmin(N,M,T,numTotalVars,numT,<

error = 0;

a% y lmp1-111.D

a = sdpvar(numT,1);

y = sdpvar(numTotalVars,1);

cl = [y == PhiL*a];

c2 = [G tilda*a == zeros(size(G tilda,1),1)];

c3 = [H tilda*a <= e tilda]; % m

232
c4 = [B*a == zeros (size(B,1) , 1)];

%
ops = sdpsett ings ('solver', 'gurobi');

optimize([cl;c2;c3;c4],globalObjfnc(y),ops);

aOpt = value(a);

yOpt = value(y);

muEq = dual(c2);

muIneq = dual(c3);

nuEq = dual(c4);

end

C.3 Implementation of PAC Algorithm

initAtomsGur.m

funct ion [models, newNj] = initAtomsGur(objfncs, Tj,Hj,ej, rho)

N = length(Tj);

models{1} = {}; models{N} = {};


newNj{l} = 0; newNj{N} = 0;

for j = 1:N

NT j = T j(j) ; % a iable ength -r n

objfnc = objfncs{j};

rM,

aj = sdpvar(NTj,1,'full');

constraints = [Hj{j}*aj <= ejj}];

% pdate with constan udfnto

L" nCe liea an costn I vaLe 3 hni vr t

233
objfnc = @(aj, j_,len) objfnc(aj, j_,len) + (1/(2*rho))*(aj)'*(aj);

% set YALMIP and solver octions

options = sdpsettings ('solver', 'gurobi');

modelj = export(constraints, objfnc(aj,j,NTj), options);

models{j} = modelj;

newNj{j} = size(modelj.obj,1);

end

end

updatePACOPFg.m

func. tion [aPACNew,muPACNew,nuPACNew,timeNew,aPACNewCVX,muPACNewCVX,nuPACNewCVX]

updatePACOPFg(models,aPACOld,muPACOld,nuPACOld,objfncs,Tj,Gj,Bj,Bj2,Hj,ej,

muInds, nuInds, aInds, rho, gamma, gammaH, aPACOldCVX,muPACOldCVX, nuPACOldCVX)

aPACNew = aPACOld; % yP Ae w: yvK+

muPACNew = muPACOld; muP.A'C',ew: mu1- +1-'-]

nuPACNew = nuPACOld;

muBarPACOld = muPACOld;
% mu~arPC~ew:-mBarly
nuBarPACOld = nuPACOld;

p fo performance tsting:

%~~~ ~~P PAewV=aAClCVX; %y


AC~ew: ykk+1
% nuPANewtCVX =nuP.A'CuldCVX; nuK+1]
BPACNew:
%

% r. muB ar-P A C 0ld:C'VX =n . mA~d C VX;


%~~ -- nuaPAaw nar [k+1]
% nuBarA< dV = "A~dVX;

N = Iength(Tj)

timeNew = zeros(N,1);

%index vars fc,r parl COompU

parvars = {}; parvars{N} ={;

234
for j = 1:N

mujInds = muInds{j};

nujInds = nuInds{j};

ajInds = aInds{j};

ajPACOld = aPACOld(ajInds);

muBarPACOld(mujInds) = muPACOld(mujInds) + ga mmaH*rho*Gj{j}*ajPACOld;

nuBarPACOld(nujInds) = nuPACOld(nujInds) + ga mmaH*rho*Bjfj}*aPACOld;

ajPACOldCVX = aPACOldCVX(ajInds);

muBarPACOldCVX(mujInds) = muPACOldCVX(mujInds) + gammaH*rho*Gj{j}*ajPACOldCVX;

nuBarPACOldCVX(nujInds) = nuPACOldCVX(nujInds) + gammaH*rho*Bj{j}*aPACOldCVX;

parvars{j} = {muBarPACOld(mujInds), ajPACOld, Gj{j}, Bj2{j}, Tj(j)};

end

aPACNewVals = {}; aPACNewVals{N} ={;

%Updat Prima Vaile

parfor j = 1:N

muBarj = parvars{j}{l};

ajOld = parvars{j}{2};

Gjatom = parvars{j}{3};

Bj2atom = parvars{j}{4};

NTj = parvars{j}{5};

model = models{j};

%~~ marie fo ~epat


betVe CostE

cLinj = model.obj';

cConstj = model.objcon;

ximal
cConstj cConstj + 1/(2*rho)*dot(ajOld,ajOld); % ter-m

cLinj(1:NTj) = cLinj(l:NTj) - (1/rho)*ajOld'; % proximal term

cLinj(1:NTj) cLinj(l:NTj) + muBarj'*Gjatom; %o da v

235
cLinj(1:NTj) = cLinj(1:NTj) + nuBarPACOld'*Bj2atom;

tic;

[modelG, resG] = atomicGurobiOPT(model, full(cLinj), cConstj);

timeNew(j) = toc;

if strcmp(resG.status, 'OPTIMAL')

augA = resG.x;

aPACNewVals{j} = augA(1:NTj,:);

else

fprintf('PAC Optimization returned status: %s\n', resG.status);

aPACNewVals{j} = ajOld; % keep same old values

end

% fr
bE Larangan

obj fn c j=(a , _len ob jIej(aj _ len+muaj'*Gatma;

oj.nc j =(a J,,len ), aj _ e)+nuaPCl Bjao~4bjn-

vxeg qu Ie

v a Ibe a NT j)
ze (obj (aj,
)

sb aomm

vx end

t.imeNew() =-oc

sum ( isa(a > 0

fprint I (' [ropin - m y. -EOR ! UN SOLVABLE!


'

aPACNewVallsj = a

end

236
added for para llel im.lementation

for j = 1:N

ajInds = aInds{j};
ajPACNew = aPACNewVals{j};

if size(ajInds') ~ size(ajPACNew)

fprintf ('** INCORRECT DIMENSIONS. ERROR. **');

end

aPACNew(ajInds) = ajPACNew;

end

for j = 1:N

mujInds = muInds{j};

nujInds = nuInds{j};

ajInds = aInds{j};

muPACNew(mujInds) = muPACOld(mujInds) + garma*rho*Gj{j}*aPACNewVals{j};

nuPACNew(nujInds) = nuPACOld(nujInds) + gamma*rho*Bj{j}*aPACNew;

end

%Eo te Sting ca,heck agiSt CX impemnato

cor d = P1:iNa1.V 0.e'S

eja o =C ej" En ;
j'

ajPACOldCVX~ = aACO!dVX (a nds


mUBar j = -ndUs{ j) dCVX (mrmu
uBa:rPACOi

% update Lagrania

+ 2 ) * (a j-a jPACOldVX) ' a


oVj, cj = @(aj _ e
)

bj c I aj j_ -aen)

237
bn @ (j, ', ) bjlne]j (a, j_, leen) + nuBarPACOld'*Bj'' j*a];

-vx egin qfuiet

CIvx-solver sedllumi-

-vxpr eciinig;
v ara ble aj(

suAlbject to

Hjat om a j<=- ej-a-tom;


evx-end

if sum (i snan (a j > 0

pri (EvxPA ] ERROR! UN SOLVABLE!

aIPACNewCVX (aInds {) aj; ;


)

FN

Ude u = n j} ;
for j = s:
= {A } ;

CVX (mu I nds) = muPAlcVX' (ma jIs) gamma*Iho*G-


+ e {) CeW.VX (aj In
nuPAyNewCVX (nujinds) =nAlVXnjd) garrma* ro*Bj j)-aPAC ew VX;

end

atomicGurobiOPT.m

function [model,result] = atomicGurobiOPT(model, cLinj, cConstj)

%set objetive functio

model.obj = cLinj';

model.objcon = cConstj;

238
S et Some paraMEAerS

params = struct ('OutputFlag', 0);

result = gurobi(model,params);

end

C.4 Atomization for PAC

setupNetwork.m

%% GENEATE MODELF

funci-on setupNetwork(networkname,T) IT periods

modelpath = strcat (' ./models /Network ' ,networkname, 'Model .m' );

run(modelpath);

Y = zeros(3*N,3*N); % m e time

A = zeros (3*M,3*N);

Zlist = {}; Zlist{M} ={;

RMatj={}; RMatj{N}={}; % reistanes calculati losses for tom s

branchParent = min(arcs(:,1:2), [],2); % gesw node own heran flow variao

for i=1:size(arcs,1)

l=arcs (i, 1);

r=arcs (i, 2);

linelength=arcs (i,3);

c_val = admittances{arcs(i,4)};

Y ( [3*,1--2:3*11, [3*r-2:3*r])=-c-val/linelength/YBase;

Y ( [3*r-2:3*r], [3*1-2:3*1])=-c-val/linelength/YBase;

239
Y([3*1-2:3*1], [3*1-2:3*1])=Y([3*1-2:3*1], [3*1-2:3*1])+c-val/linelength/YBase;
Y([3*r-2:3*r], [3*r-2:3*rI)=Y([3*r-2:3*r], [3*r-2:3*r])+c-val/linelength/YBase;

for impedance model

z_val = impedances{arcs(i,4)};

Zlist{i} = z-val*linelength/ZBase;

S iv icidece matrix for voltagqe differences

A([3*i-2:3*i], [3*1-2:3*1]) = eye(3);

A([3*i-2:3*i],[3*r-2:3*r]) = -eye(3);

parent = branchParent(i);

RMatj{parent} = blkdiag(RMatj{parent},real(zval));

end

Zij = blkdiag(Zlist{:}); phase,


03 compex

%enerate he PCo decompos.


%variables

Ir=sdpvar(3*N*T,1);

Ii=sdpvar(3*N*T,1);

Vr=sdpvar(3*N*T,1);

Vi=sdpvar(3*N*T,1);

P=sdpvar(3*N*T,1);

Q=sdpvar(3*N*T,1);

a=sdpvar(3*N*T,1); MCE

b=sdpvar(3*N*T,1); % MCIE

c=sdpvar(3*N*T,1); MCE
fo, r Z ersetto
d=sdpvar(3*N*T,1); % Mc

Ibranchr=sdpvar(3*M*T,1); 1 fo o eresetaton

Ibranchi=sdpvar(3*M*T,1);
%

V=Vr+li*Vi;

I=Ir+1i*Ii;

Ibranch = Ibranchr + li*Ibranchi;

240
F = [];

for t = 1:T

inds = 3*N*(t-l)+1:3*N*t;

indsLine = 3*M*(t-l)+1:3*M*t;

F = [F;

Ir(inds) == real(A'*Ibranch(indsLine));

Ii(inds) == imag(A'*Ibranch(indsLine));

P(inds) == a(inds) + b(inds);

Q(inds) == -c(inds) + d(inds);

real(A*V(inds)) == real(Zij*Ibranch(indsLine));

irnag(A*V(inds)) == imag(Zij*Ibranch(indsLine));

end

set up phyica c (G matrix, Gx = 0) asing YalMIp

[model,recoverymodel] = export (F,0,sdpsettings ('solver','Gurobi'));

%ietth a i vet ors and matrices

decomposePAC

numVars = (3*N*10 + 3*M*2)*T;tmdate num vars to e total number 7 vari es

nG = (4*3*N+2*3*M)*T; % o be total nmber o eqality constraints (global)

% save file to .ma ta loa

filename = strcat('../Networ<',networkname, 'T',int2str(T), 'NEW.mat');

% ilname =st ra('. . /Nto rk ' , ewrnm,' a


T
save(filename,'SBase',' ase','ZBase','IBase','YBase','Stran', 'N' 'M','Neigh','pare,
Y' , 'Zij','RMatj','A', 'numVars ','nG',' nH','Lset ','Cset', 'Oset ','Tset','Gj','Hji
'aindsi','um','j','m' 'umd s ','n~d ' '~t l a , P iL , i v hi ' ' ' ' j','Bj2'

%G t l a', Phi', 'iV, r ~hiL',' 'IIL' B B


"

end

decomposePAC.m

numVars = (size (model. obj,1)-3*M*2*T) /N/T/3; N n Codes, 3 a pe v i, M

241
% Gx == 0

G=full(model.A);

% i G = md .A; trving without using full format of matrix

nG = (size(G,1)-3*M*2*T)/(3*N*T); number of eualty constra-int.s per noce, per phase

% x <=

nH = 28; numlber of inequality constrai.nts pernode, per phase

ss G m i t rpiace rabab' (dumy)set with zeros

G((G>O & G<le-25) I (G<O & G>-le-25)) = 0;

% St -set of indices of -vaIables oWne ya

Lset={}; Lset{N}={};

S C - deermines which rows of G eong to c a j


Cset={}; Cset{N}={};

%
etO -coied± vari.LOales required
Oset={}; Oset{N}={};
n t ar y vaa sh p t inices in G

Gtmp={}; Gtmp{N}={};

Tset={}; Tset{N}={};

Gj={}; Gj{N}={}; ja Zial i l stz

ecton m i ges om atize vars t glbav

PhiLmats={}; PhiLmats{N}={};

invPhiLmats={}; invPhiLmats{N}={};

deco-mose the matrix of th'e in e qualIty cstrais to obtain te one necessary for the

% create a new decomposition f Ax < (var names:


% get inisf m x of inequacly
' ~ ~ ~ ~ ~cnt o n.' .22
fo
±t each' "n W
Hjidx={}; Hjidx{N}={};

% era t traugh nodal. vars

for j = 1:N

%I , ars ( a vrs: only, a _i ime perids).


awne

242
ind1 = (0:numVars*T-1)*3*N + 3*(j-1) + 1; % beginnin ndex + pases*node + ofset

indlrep = reshape(repmat(indl,3,1),1, []);


ind2rep = reshape(repmat((0:2),numVars*T,1)',1, []); 3 h era

Lset{j} = indlrep + ind2rep;

Sws omatrix G - for sing erd onlv

indl = (0:nG-1)*3*N + 3*(j-1) + 1; % 1egin ing ;ffset of 1

indlrep = reshape(repmat(indl,3,1),1, []);

ind2rep = re sape(repmat((0:2),nG,1) ',1, []);

tempInds = indlrep + ind2rep;

Cset{j} = tempInds;

f mtx H( vas ony e


iods)
ind1 = (0:nH*T-1)*3*N + 3*(j-1) + 1;

indlrep = reshape(repmat(indl,3,1),1, [1);


ind2rep = reshape(repmat((0:2),nH*T,1)',1,[);

idx = indlrep + ind2rep;

Hjidx{j} = idx;

end

ierate ro ara on
Lindstart = numVars*3*N*T; % rea

Cindstart = nG*3*N; % i cal de,

Hindstart = nH*3*N*T; a

indRep = 3*M*T;

fo>r m=1:M

j=arcs (m, 1);

k=arcs (m, 2);

vinds = Lindstart + [3*m-2:3*m];

cinds = Cindstart + [3*m-2:3*m];

hinds = Hindstart + [3*m-2:3*m];

temprep = reshape(repmat((0:T-1),3,1),1, [])*(3* (M));

vindsrep = reshape(repmat (vinds,T,1)',1, []);

243
vindsrep = vindsrep + temprep;

hindsrep = reshape (repmat (hinds,T,1) ',1, []);

hindsrep = hindsrep + temprep;

%upstream owns then var, downstream coiste var

if j < k

s upstream, k is downstream

Lset{j} = [Lset{j},vindsrep,vindsrep+indRep];

Oset{k) = s vnds e

Cset{j} = [Cset{j}, cinds,cinds+indRep/T];

Hjidx{j} = [Hjidx{j}, hindsrep,hindsrep+indRep];

elseif j > k

s P isownstram

Lset{k} = [Lset{k},vindsrep,vindsrep+indRep];

Osetj = se

Cset{k} = [Cset{k}, cinds,cinds+indRep/T];

Hjidx{k} [Hjidx{k}, hindsrep,hindsrep+indRep];

else

sprintf ( \nt E RROR IN DE COMPOSITION: Ban ch, m, '\n');

return;

end

end

iteat e through atm


% Ugi
for j = 1:N

update Cse fori tipe .rio

Cinds = Cset{j};

timerep = reshape(repmat((0:T-1),size(Cinds,2),1),1, [])*(nG*3*N+2*3*M); %3 phases,


Cinds = repmat(Cset{j},1,T);

Cset{j} = Cinds + timerep;

Copies of nooa. vars need-d

row=Cset{j};

Gtmp=(G(row,:));

col=Lset{j};

Gtmp(:,col) = 0; E set owned indices t o

244
[nonzeroRow,nonzeroCol] = find(Gtmp); % get.eeded var copies

Oset{j} = unique(nonzeroCol)';

% totl- set- o-f var-s

Tset{j}=[cell2mat(Lset(j)) cell2mat(Oset(j))];

% Cequalty constraints

Gj{j} = G(row,Tset{j});

Indi =.. . . . (a :n -)*3 T + 3*(j-1) .+ 1; n be gin ly .rset of

id= indir p+ nn,rp $ 7 1, 3

2 a1a row s o at x eo rnncosrit

1)1 [] Tidsat %alnoa n

d = a, C, T ;

Eet ( = Lns
i) + ier
mt ep;

% ,,-- cpiedI nc, dal var (fxe fo pass

aux s =

x = x Z,I

end

Lj = cellfun(@numel, Lset); size f ne sQo eac h a

Oj = cellfun(@numel, Oset); size of es of

numCVs = sun(Oj); %Dtoa

Tj = cellfun(@numel, Tset); % ze of om
each atom ,")
aInds = cumsum(Tj);

numT = sum(Tj) tt n of a zeda


Cj = cellfun(@numel, Cset); a Cum f rows of G

245
muInds = cumsum(Cj);

Gtilda = blkdiag(Gj{:}); total Gtilda

allL = horzcat(Lset{:})'; % all owned vars stacked

skip = cumsum (Tj);

cols =

for j = 1:N

if j == 1
cols = vertcat(cols,(1:Lj(j))');

else

cols = vertcat(cols,((l:Lj(j))+skip(j-1))');

end

end

PhiL = sparse(allL,cols,ones(1, size (allL, 1)), (numVars*3*N+3*M*2)*T,numT);

invPhiL = sparse(1:numT,horzcat(Tset{:}),ones(1,numT),numT, (numVars*3*N+3*M*2)*T);

..ild coor dination matrix, B


Oidx=[]; I rows of
,

for i=1:size(Oset,2)

Otmp=Oset{i}';

atom=ones(si ze(O_tmp))*i;

Oidx=[Oidx;[O-tmp, atom]];

end

Tidx=[]; % columns of B

for i=1:size(Tset,2)

T_tmp=Tset{i}';

atom=ones(size(Ttmp))*i;

Tidx=[Tidx; [Thtmp, atom]];

end

uniqueVars = unique(Oidx(:,1));

rowgroup = arrayfun(@ (x) find(Oidx( :,1)==x) ,uniqueVars, 'UniformouCpt ',false);

246
colgroup = arrayfun(@ (x) find(Tidx(:,1)==x) ,uniqueVars, 'niformOutput',false);

% -roi
x = : ze ( i x,1)

vals = [

rowidx = [];
colidx = [];
for i=l:size(uniqueVars,l)

var = uniqueVars(i);

row = rowgroup{i};

col = colgroup{i};

atomO = Oidx (row, 2) ; % a

atomT = Tidx (col, 2) ; nee

owner = setdiff(atomT,atomO); % f idowner. Of vr


oi T,,E
owneridx = col(atomT == owner); find inexinT of var
Of COner
copieridx = col(atomT owner);

rowidx = [rowidx,reshape(repmat(row', 2, 1),1, []));

colidx = [colidx,reshape([ones(l,size(copieridx,l))*owneridx; copieridx'],l, [])];

vals = [vals,repmat([-1,1],l,size(copieridx,l))];

%cOdx are rows, Tidx are colmns

end

B = sparse(rowidx,colidx,vals,size(Oidx,l),size(Tidx,l));

% Costrut B (ths T (,-


_i mrrimx)

Bj={}; Bj{N}={};

nuInds=zeros(1,N);

totalidx_1 = 0;

,) ohh is needed for Larian


Bj2={}; Bj2{N}={};

totalidx_2 = 0;

for j = 1:N

numrows = slze(Oset{j},2);

Bj{j} = B(totalidx_1+1: (totalidxl+numrows),:);

247
totalidx_1 = totalidx_1 + numrows;

nuInds(j) = totalidx-l;

% B_( ,j

numcols = size(Tset{j},2);
Bj2{j} = B(:,totalidx_2+1:(totalidx_2+numcols));

totalidx_2 = totalidx_2 + numcols;

end

% build actuation proetoiton matrix, PhiAct (P and Q are actuation vars)

indsAct = (13:18); % to get P andQirom every aj need to update for MOPF

indsActrep = reshape(repmat(indsAct,T,1)',1, []);

indsAct2rep = reshape(repmat((0:2),2*T,1)',1, []); % 3 chases per var

indsActAll = indsActrep + indsAct2rep;

colsAct = reshape(repmat([O,aInds(1:N-1)],2*3*T,1),1, []) + repmat(indsActAll,1,N); % 2*:

PhiAct = sparse(1:2*3*N*T,colsAct,ones(1,2*3*N*T),2*3*N*T,numT);

C.5 OPF Problem Setup

C.5.1 Main Setup

setLimCost.m

%% GENEA -F UNC"T ONS

Case data
Fo sembe variable bounds and costs

% conta ins t og i around E s

function [Hj,ej,ineqcon,limits,costs,rengenInds,battInds,Sindsj,Sinds new,newTotalVars,i

V_min,Vrmax,delta-min,deltamax,N,M,A,Tset,Lset,Oset,Gj,Cj,nG,Hjidx,SBase,Stran,numI

P_max = zeros(N*3*T,1);

P_min = zeros(N*3*T,1);

Q_max = zeros(N*3*T,1);

248
Q_min = zeros(N*3*T,1);

%i set the firstr p.,erio ld, P ad

for i = 1:size(loadsP,1)

row = loadsP(i,:);

idx = ((row(1)-1)*3 + 1):((row(1)-1)*3 + 3);

P_max (idx) = Prmax (idx) - row (2 :4) '; loads et

P_min(idx) = P min(idx) - row(2:4)'; % assume no DR at loaI nod

end

for i = 1:size(loadsP,1)

row = loadsQ(i,:);

idx = ((row(1)-1)*3 + 1):((row(1)-1)*3 + 3);

Qmax (idx) = Qmax (idx) - row (2: 4) ' %loads negai


Q_min(idx) = Qmin(idx) - row(2:4)'; % assume o DR atl
end

if T > 1

% ue dman0prfil for00202_ adiioa time perios ndQbt

[mmdP,mmdQ] = demandProfiles(demandProfileID,N,T-1);

dP = reshape(repmat(mmdP',3,1),[],1); % eplicate fo 3 eS

dQ = reshape(repmat(mmdQ',3,1),[],1); %c, a f 3 he s

%apld n profil to i epiods for

P_max(3*N+1:end) = repmat(P-max(1:3*N),T-1,1).*dP;

P_min(3*N+1:end) = repmat(P-min(1:3*N),T-1,1).*dP;

Qjmax(3*N+1:end) = repmat(Qmax(1:3*N),T-1,1).*dQ;

Q-min(3*N+1:end) = repmat(Qmin(1:3*N),T-1,1).*dQ;

end

feeder P, Q brounds
% E=P^2 + Q^; _P = rr +v l ;Q = -r i +Vi

feedP = 0; feedQ = 0;

if size(loadsP,1) > 0

maxPLoad = sum(reshape(-P-max,3*N, []));

249
feedP = maxPLoad*1.5;

end

if size(loadsQ,1) > 0

maxQLoad = sum(reshape(-Qmax,3*N, []));


feedQ = min( [sqrt ( (Stran*SBase)^2 - feedP.^2) ',maxQLoad'*1.2], [],2)';

end

costaP = zeros(N*3*T,1); %quadratIc coeffcent. fo DERs

costbP = zeros(N*3*T,1); 11lilear acoefficient for DEs

costcP = zeros(N*3*T,1); % constant terms fr DERs

costbPs = zeros (N*3*T, i terms for storage (P pos and neg issue)

cost-bQ = zeros(N*3*T,1); %-linear coefficient tr rlevant fr e

H2jidx={}; H2jidx{N}={};

Qpfinds = []; Ppfinds = []; pfpos = []; pfneg =

H2ind = 1;

Prindsj = {}; Prindsj{N} = { % ndices for generators witr

H6jidx={}; H6jidx{N}={}; % for store c'r onstraintS

H6ind = 1;

delPGup = [];

delPGdown = [];

%add onrollable Ds

for i = 1:size(gensP,1)

row = gensP(i,:);

j = row(1);

idx = ((j-1)*3 + 1):((j-1)*3 + 3);

idxT = repmat(idx,1,T)+3*N*reshape(repmat((0:T-1),3,1),1,[]);

P-max(idxT) = P-max(idxT) + repmat(row(2:4) ',T,1);%row(2:4)'; % generators posit

Pjmin(idxT) = Pjmin(idxT) + repmat(row(5:7)',T,1);%row(:7)';

% prepare indc es for Dcapability curve


if (j ~ 1 && row(8) ~ 0 && row(9) ~= 0)

Ppfinds = [Ppfinds idx];

Qpfinds = [Qpfinds idx];

pfpos = [pfpos row(8)];

250
pfneg = [pfneg row(9)];

numConst = T; % oe per t priod.; only f os constraint; other easy to

H2jidx{j} = [H2ind:H2ind+numConst-1];

H2ind = H2ind + numConst;

end

%prepare indies for rm constraints

if (j ~ 1 && row(10) -= 0 && row(11) ~ 0)

Prindsj{j} = repmat(idx,1,T) + (3*N)*reshape(repmat((O:T-1),length(idx),1),

if size(row)> 11

PtO = sum(row(12:14)); % get initial poweein

PtO = 0; % asum no initia

end

delPGup = [delPGup row(10)*ones(1,T)]; %0epiae f

delPGdown = [delPGdown -row(11)*ones(1,T)]; replica

delPGup(end-T+1) = delPGup(end-T+1) + Pt0; %adu i

delPGdown(end-T+1) = delPGdown(end-T+1) + Pta; t adjust fir im peio

d o fr aave s ea sy oca.luLae

numConst = T; % one constraint per time peri (all phases

H6jidx{j} = [H6ind:H6ind+numConst-1];

H6ind = H6ind + numConst;

end

end

t for ml--peids

Ppfinds = repmat(Ppf inds, 1,T) + 3*N*reshape(repmat((0:T-1),length(Ppfinds),1),1, []),

Qpfinds = repmat(Qpfinds, 1,T) + 3*N*resape (repmat((0:T-1),length(Qpfinds),1),1, []

pfpos = repmat (pfpos, 1, T) + 3*N*reshape(repmat((0:T-1),length (pfpos),1),1, []);

pfneg = repmat (pfnieg, 1,T) + 3*N*reshape(repmat((0:T-1),length(pfneg),1),1, []);

for i = 1: size (gensQ, 1)

row = gensQ(i,:);

i = row(1);
idx = ( (j--1) *3 + 1): ((j-1) *3 + 3);

251
idxT = repmat(idx,1,T)+3*N*reshape(repmat((0:T-1),3,1),1, []);

Q_max(idxT) = Qmax(idxT) + repmat(row(2:4)',T,1);%rw(2:)'; % geerators


Q_nin(idxT) = Q-min(idxT) + repmat(row(5:7)',T,1);%row(5:7)';

end

rengenInds =

add renewaile g'enrts

for i = 1:size(rengens,2)

row = rengens{i};

j = row{1};

rengenInds = [rengenInds, j];

aoces v 3hase connecions

phases = row{3}; phases = num2cel1(convertStringsToChars(phases));

V = [1 2 3]; S = {'a ,'b', '';


[tf, idx] =ismember(phases,S);

phaseOut = V(idx(tf));

numPhases = length(phaseOut);

idx = (j-1)*3 + phaseOut;

idxT = repmat(idx,1,T) + reshape(repmat((O:T-1),numPhases,1),1, [])*3*N;

rengenspecs-i = rengenmodel(row{4},row{2},T);

if rengenspecsi == 0

return;

end

mmgP = reshape(repmat(rengenspecs-i('genP'),1,numPhases)', [],1);


mmgQ = reshape (repmat (rengenspecs-i('genQ') , 1,numPhases) ', [],1);

P max (idxT) = P max (idxT) + mm gP; % generators poitv

P-min (idxT) = Pjmin(idxT) + mm gP.*rengenspecsi ('curtailLimit');

Qmax (idxT) = Qjnax(idxT) + mm-gQ; % generators ps it iv

Q_jnin(idxT) = Q_min(idxT) + mm gQ.*rengenspecs_i ( 'curtail imit');


e di

252
% update P and Q r feeder

Pfeed = reshape(repmat(feedP,3,1), [],1);

Qfeed = reshape(repmat(feedQ,3,1), [],1);

feederInds = repmat(1:3,1,T);

timeInds = (O:T-1)*3*N;

reptimeInds = reshape(repmat(timeInds,3,1),1, []);


repfeederInds = feederInds + reptimeInds;

P-max(repfeederInds) = Pfeed;

Q_max(repfeederInds) = Qfeed;

Q_min(repfeederInds) = -Qfeed; fee.d er. cn poId po . s or neg

% Dues percentCage of base lioad as set pin

for i = 1:size(demRes,1)

row = demRes(i,:);

j = row(1);

idx = ((j-1)*3 + 1):((j-1)*3 + 3);

idxT = repmat(idx,1,T)+3*N*reshape(repmat((0:T-1),3,1),1,[]);

P_max(idxT) = Pmax(idxT).*(1-row(2)); % d e ative s

end

-3 st.a 7orag os ciers 25caciycsran

Sindsj = {}; Sindsj{N} =al v

Sindsnew = [;e storage, P dis and P c

Sindsnew-sizej = {}; Sinds new sizej{N} ={;

Sidx=1; idx for xhe

etaCAll = []; etaDAll = []; betaSDAll = [];


minCapAll = []; maxCapAll = [];%evice
initCapsAll = []; ini-ial batlter y cap y d

delPup = [];

delPdown = [];

G2jidx={}; G2jidx{N}={ 1; G2ind = 1; f dded euali raints

253
H3jidx={}; H3jidx{N}={}; %for storage Pdis nonnegativitv
H3ind = 1;

H4jidx={}; H4jidx{N}={}; for storage caparaints

H4ind = 1;
H5jidx={}; H5jidx{N}={}; fo sr rm ot

H5ind = 1;
battInds =

for i = 1:size(storage,1)

% or Looks like [oode battED phases itar - phases 'ab' or 'ac


row = storage(i,:);

j = str2num(row(1));

battID = row(2);

battInds = [battInds j];


phases = row(3); phases = num2cell(convertStringsToChars(phases));

V = [1 2 3]; S = {'a','b','c'};
[tf, idx] =ismember(phases,S);

phaseOut = V(idx(tf));

numPhases = length(phaseOut);

idx = (j-1)*3 + phaseOut;

idxrepT = repmat((j-1)*3+phaseOut,1,T) + reshape (repmat((O:T-1),length (phaseOut

%,
oad battery miodel

bSpecs = battmodel(battID); batt models a

sorage costs (lieartrm oy)

costbPs(idxrepT) = bSpecs('wearcost').*ones(numPhases*T,1); wear" cost to

r
% relae re ular -onst t:

% w h e P < pwrdch,ar

P-max(idxrepT) = Pjmax(idxrepT) + bSpecs('power'); discharEge ower


P min(idxrepT) = P min(idxrepT) - bSpecs('power'); carge power (is negative)

Sindsj{j} = repmat(idx,1,T) + (3*N)*reshape(repmat((0:T-1),length(idx),1),1,[]),

%sorageonly constraints:

%i P -- these vars exist only for storage odes,

254
% ci> pe ie.1 peri (aggr,egate o-,ver phases)

% r e eri regate over plases

%dd2new v p- p-a b idex onl

Sindsnew = [Sinds new Sidx]; % index or ori (Pcare easy to calculate afs

Sindsnewsizej{j} = numPhases;

Sidx = Sidx + 1;

% cpaci
lr ty consrai

etaCAll = [etaCAll bSpecs(etaC')];

etaDAll = [etaDAll bSpecs ( 'etaD')];

betaSDAll = [betaSDAll bSpecs('betaSD')];

minCapAll = [minCapAll (bSpecs ( 'capacrity)* (1-bSpecs( 'maxD2D')) )*ones (1,T)];

%
maxCapAll = [maxCapAll bSpecs('capa citv' ) *ones (1,T)]; t'rplcaedor easy vec

initCapsAll = [initCapsAll str2double(row(4) )*ones (1,T) I; % r iat e fo eaSy

% o amp con stant,-s

PtO = str2double(row(5:numPhases+4)); eton

delPup = [delPup bSpecs ('Y-ampU-p') *ones (1, T) };c f c

delPdown = [delPdown -bSpecs ( 'rampDown' ) *ones (1,T)]; % replicated for easy vecL
delPup (end-T+1) = delPup (end-T+1) + sum (PtO);

delPdown(end-T+1) = delPdown(end-T+1) + sum(PtO); adjust first time

% ew inrequality constraints: nron-negativitye or P dis PBcharge,

%
aeidx onyfrPds> ;teothaers are eas to calculat

numConst =1

H3jidx{j} [H3ind H3ind+numConst 1]

H3ind =H3ind + numConst

% ave indexnlfo upe bondo cpciy other is easy to calculate

numConst = T; %- one cosritprtme perriod (aILl phases sum)

H4jidx{j} = [H4ind:H4ind+numConst-1];

H4ind = H4ind + numConst;

255
Snew inequality constraints: ramp for battery

% have index only for ramp up constraint; other is easy to

numConst = T; % one constraint per time perind (all. phases sum)

H5jidx{j} = [H5ind:H5ind+numConst-1];

H5ind = H5ind + numConst;

new equa liy cost.nts : def of T, done in orde

%need numnhases: relating Pdis and Poharge to P (P is oer phase)


G2jidx{j} = [G2ind:G2ind+numPhases-1];

G2ind = G2ind + numPhases;

end

adjust for multi period

if~ isempty(storage)

Sindsnew = repmat(Sinds new,1,T) + max(Sindsnew) *reshape(repmat((0:T-1),lengtI

end

%.a han to per uni anlvsis

P_max = Pmax./SBase;

P_min = Pmin./SBase;

Q_max = Qmax./SBase;

Q_nin = Q_min./SBase;

minCapAll = minCapAll./SBase;

maxCapAll = maxCapAll./SBase;

initCapsAll = initCapsAll./SBase;

delPup = delPup./SBase;

delPdown = delPdown./SBase;

delPGup = delPGup./SBase;

delPGdown = delPGdown./SBase;

%et feeder costs (ostimats of market data for IjMPs)


mmp = retrieveLMPs(T);
mrnmq = mmp.*0.1; Q pries 10% ot price random settin

cost-bP(repfeederInds) = mmp;

256
cost-bQ(repfeederInds) = mmq;

%cov r 1- LCo'DSt-s f rom II $k~ -> S/u


costs = {cost-aP*SBase^2,cost-bP*SBase,costcP,costbPs*SBase,costbQ*SBase};

% get curent imis frol-prcesi

[Ir-min, Ir max, Iimin, Iimax,Vr-min,Vr-max,Vi-min,Vimax] =

.
genLimits (N,T,Vjmin,V max,delta min,delta_max,P-min,P-max,Q_min,Q_max,Y,battInd-

limits{1} = Ir-min; limits{2} = Ir-max;

limits{3} = Ii-min; limits{4} = Ii-max;

limits{5} = Vr-min; limits{6} = Vr-max;

limits{7} = Vi-min; limits{8} = Vi-max;

limits{9} = P-min; limits{10} = P-max;

limits{1l} = Qmin; limits{12} = Qmax;

Sgtaoizeine

[Hj,ej,ineqcon,battInds,newTotalVars,newTotalnG,Tset,Lset,Gj,Cj) = ineqCon(N,M,A,T,

pfpos,pfneg,betaSDAll,etaCAll,etaDAll,maxCapAll,minCapAll,initCapsAll,delPup,de

G2jidx,Hjidx,H2jidx,H3jidx,H4jidx,H5jidx,H6jidx,numVars,nG,Y,Zij,costs); Pi

end

function costP = retrieveLMPs(T)

dateid = 'Mav14201 9';

pathname = strcat('./networkdata/dataprofiles/' , dateid,'/');

filename = strcat(' isonedta_',dateid,'.mat');

if isfile(strcat(pathname,filename))
load(strcat (pathname, filename), 'mm p', 'units') ; % /kWh for

else

fprintf('\n\t ERROR PRICE DATA FILE NOT FOUND\n');

return;

end

257
assumne all profile data i.s needed per nour

% p e data is everv 5 mins from ISONE -> convert to hourly

n 12;

mmp-reshaped = reshape(mmp,n, []);

mm-p-hourly = mean (mm_preshaped) ';

mp-hourly = reshape(repmat(mm-p-hourly',3,1), [],1); %dplate for all phases

costP = mm_phourly(1:3*T); %3 phases, T timesteps

end

Limit Pre-procsing to determine tighter hounds for MCE

function [Ir min, Ir max, Ii min, Ii max,Vr min,Vr max,Vimin,Vi max]

genLimits (N,T,V min,V-max,de min,de max,P min,P max,Q_min,Q_max,Y,battInds, INDSTOPR(

mi and V_max are scalars right now

esl = Vmax.*(cos(de-max)+li*sin(de-max));

es2 = Vmax.*(cos(de-min)+li*sin(de-min));

es3 = Vmax.*(cos(de-max)+li*sin(de-min));

es4 = Vmax.*(cos(de-min)+li*sin(de-max));

es5 = Vmin.*(cos(de-max)+li*sin(de-max));

es6 = V_min.*(cos(demin)+1i*sin(demin));

es7 = Vmin.*(cos(de-max)+li*sin(de-min));

es8 = Vmin.*(cos(de-min)+li*sin(de-max));

esAll = [es1; es2; es3; es4; es5; es6; es7; es8];

Vr-min = min(real(esAll));

Vrmax = max(reaI(esAll));

Vi_min = min(imag(esAll));

Vimax = mx(imag(esA11));

%
sigl peri od

Vr_min_tl = [ones(3,1);Vr-min.*ones(3*(N-1),1)];

Vr_max_tl = [ones(3,1);Vr-max.*ones(3*(N-1),1)];

Vi_min_tl = [zeros(3,1);Vi-min.*ones(3*(N-1),1)];

Vimax_tl = [zeros(3,1);Viniax.*ones(3*(N-1),1)];

258
Vr_min = repmat(Vr _min_tl,T,1);

Vrmax = repmat(Vr _maxtl,T,1);

Vi-min = repmat(Vi _mintl,T,1);

Vimax = repmat(Vi _max-tl,T, 1);

optzma. zaion var

Ir = sdpvar(1,1);
Ii = sdpvar(1,1);
ables
Vr = sdpvar(1,1);

Vi = sdpvar(1,1);
P = Vr.*Ir+Vi.*Ii;

Q = -Vr.*Ii+Vi.*Ir;

z Cosr

Irmax = zeros(N*3*T,
N3T1);

Ir_min = zeros(N*3*T, 1);

Ii_max = zeros(N*3*T, 1);

Ii min = zeros(N*3*T, 1);

feederInds = repmat(1:3,1,T);

timeInds = (O:T-1)*3*N;

reptimeInds = reshape(repmat(timeInds,3,1),1, []);

repfeederInds = feederInds + reptimeInds;

%nedtgecurnlits baSed(nalDhApwr

r n xcluding feeder), every phaer, e me period

for j 4:N*3*T

if ismember(j,repfeederInds)

continue

end

F=[

P-min(j) <= P <= Pjmax(j),...

Q_min(j) <= Q <= Q_max(j),...

259
Vr-min(j) <= Vr <= Vr-max(j),...

Vimin(j) <= Vi <= Vi-max(j),...

];

obj=Ir;

ops = sdpsettings ('solver', 'icopt', 'verbose', 0);

optimize (F,-obj, ops);

Irmax(j) = value(Ir); % just in case

%Ir_min

P_min(j,1) <= P <= P-max(j,1),...

Q_min(j,1) <= Q <= Qmax(j,1),...

Vr_min(j) <= Vr <= Vr-max(j),...

Vi-min(j) <= Vi <= Vi-max(j),...

1;
obj=Ir;

ops = sdpsettings('solver','ipopt','verbose',0);

optimize(F,obj,ops);

Irmin(j) = value(Ir); %jst in ase

P_min(j,1) <= P <= Prmax(j,1),...


Q_jnin(j,1) <= Q <= Qmax(j,1),...

Vr_min(j) <= Vr <= Vrjmax(j),...

Vi_min(j) <= Vi <= Vi-max(j),...

];
obj=Ii;

ops = sdpsettings('solver', 'ipopt', 'ver.bose',0);

optimize (F,-obj, ops);

Ii_max(j) = value(Ii);

260
F= [

Pjmin(j,1) <= P <=P-max(j,1),...

Q_min(j,1) <= Q <= Q_max(j,1),...

Vr_min(j) <= Vr <= Vrmax(j),...

Vimin(j) <= Vi <= Vimax(j),...

];

obj=Ii;

ops = sdpsettings('solver', 'ipopt',verbose',0)

optimize(F,obj,ops);

Ii-min(j) = value(Ii);

end

% Feder imit detrminedi byeeder power and transformer rtn

%S= /^ + ^;P=Vi ii = -ri+Vi;V

Ir_min(repfeederInds) = Pjmin(repfeederInds) ./Vr-max(repfeederInds); n m

Ir_max(repfeederInds) = P-max(repfeederInds)./Vr-min(repfeederInds);

Ii_min(repfeederInds) = Qmin(repfeederInds)./Vr min(repfeederInds); -Dnot-: Qmin=

Ii_max(repfeederInds) = Qmax(repfeederInds)./Vr-min(repfeederInds);

STCONSIDERING REL PWER

i-f ~isempty(battInds)

fr i=1: length (battInds)

battID = battInds(i);

idx = (battID-1)*3 + (1:3);

idxrepT = repmat(idx,1,T) + re shape(repmat((0:T-1),3,1),1, [])*3*N;

Ii-min(idxrepT) = zeros(3*T,1);

Ii-max(idxrepT) = zeros(3*T,1);

end

end

%.av&e'CurrentLs__NEW', rm', 'irmax' , n , 'Vimax'

end

261
matri
Assemble iequ ali ty constr ants ces and vector

%'.x<= e so H-a <= ej

function [Hj,ej,ineqcon,battInds,newTotalVars, newTotalnG,Tset,Lset,Gj,Cj] = ineqCon(N,M,


pfpos,pfneg,betaSDAll,etaCAll,etaDAll,maxCapAll,minCapAll,initCapsAll,delPup,delPdox

G2jidx, Hjidx, H2jidx,H3jidx, H4jidx,H5jidx, H6jidx, numVars, nG, Y, Zij, costs)

%
Pnds, Qinds (after imit)s fmast;.er

%. c .onst.raiLnts
(currentx4, amacityx2, voltagex4, powerx4, MClx4x4)

Ir_min = limits{1}; Irmax = limits{2};

Ii-min = limits{3}; Iimax = limits{4};

Vr_min = limits{5}; Vrmax = limits{6};

Vi_min = limits{7}; Vimax = limits{8};

P_min = limits{9}; Pmax = limits{l0};

Q_min = limits{ll}; Qmax = limits{l2};

% inialze yalmigr variables

Ir=sdpvar(3*N*T,1);

Ii=sdpvar(3*N*T,1);

Vr=sdpvar(3*N*T,1);

Vi=sdpvar(3*N*T,1);

P=sdpvar(3*N*T,1);

Q=sdpvar(3*N*T,1);

a=sdpvar (3*N*T, 1);

b=sdpvar(3*N*T,1);

c=sdpvar(3*N*T,1);

d=sdpvar(3*N*T,1);

Ibranchr=sdpvar(3*M*T,1); for Z representation

Ibranchi=sdpvar(3*M*T,1); % for Zre

Pdis = sdpvar(length(Sindsnew),1); % h power

Pcharge = sdpvar(length(Sinds new),1); c e power

V=Vr+li*Vi;

I=Ir+li*Ii;

Ibranch = Ibranchr 4 li*Ibranchi;

% iqui irry
sai

262
ineqcon = [ % curren lits

Ir_min<=Ir, ...

Ir<=Ir-max, ...

Ti_min<=Ii, ...
Ii<=Ii-max, . .

.
Vr_min<=Vr,...

Vr<=Vr-max, . ..

Vi_min<=Vi, ...

Vi<=Vi-max, ...

P_min<=P, ...

P<=P-max,...

Q_min<=Q, ...

Q<=Qmax, ...

a>=Vrmin.*Ir+Vr.*Ir_min-Vrmin.*Ir_min

a>=Vrmax.*Ir+Vr.*Ir_max-Vr_max.*Ir_max,

a<=Vrmax.*Ir+Vr.*Ir_min-Vrmax.*Ir_min,

a<=Vr min.*Ir+Vr.*Irjmax-Vrjmin.*Irmax,

% MCE. -Fo3r br

b>=Vimin.*Ii+Vi.*Ii_min-Vimin.*Ii_m,i

b>=Vimax.*Ii+Vi.*Iimax-Vimax.*Ii_max,...

b<=Vi max.*Ii+Vi.*Ii min-Vi-max.*Ii_min...

b<=Vimin.*Ii+Vi.*Ii_max-Vimin.*Ii_max,...

c>=Vrmin.*Ii+Vr.*Ii_min-Vrmin.*Ii_min,...

c>=Vrmax.*Ii+Vr.*Ii_max-Vrmax.*Ii_max,...

c<=Vr max.*Ii+Vr.*Ii min-Vr-max.*Ii_min

c<=Vrmin.*Ii+Vr.*Iimax-Vrmin.*Ii_max,...

d>=Vimin.*Ir+Vi.*Ir_min-Vimin.*Ir_min,...

d>=Vimax.*ir+Vi.*Irmax-Vimax.*Ir_max,...

d<=Vimax.*Ir+Vi.*Ir_min-Vimax.*Ir_min...

d<=Vimin.*Ir+Vi.*Ir_max-Vimin.*Ir_max,

Ibranchr <= 1.5,

263
Ibranchi <= 1. 5 % dummy bounds

% secondary inequalitv constraints for pK, already multi-period treated

ineqconDER =

sum(P(reshape(Ppfinds,3, [])'),2).* tan(acos(pfneg')) <= sum(Q(reshape(Qpfinds,3,

sum(Q(reshape(Qpfinds,3, []) '),2) <= sum(P(reshape (Ppfinds,3, [])'),2) .* tan(acos

%storage capacCity cosrit

battInds = find (cellfun(@isempty,Sinds newsizej)); % ndes wich nave batteries

numbatts = length(battInds);

n = length(Sinds_new)/T;

Sinds = [Sindsj{:}]; % unacka into a ve

if isa(Sinds,'cell')

Sinds = [Sinds{:}]; need to unpack more

end

eqcon = [];
Sidx = 0;

if numbatts > 0

for i = 1:numbatts

batt = battInds(i);

nphases = Sindsnewsizej{batt};

Pidx = Sinds(Sidx+(1:nphases*T));

PSidx = i:numbatts:numbatts*T;

newEqconEx = (reshape(repmat ( (1./repmat (etaDAll' ,T, 1) .*Pdis (PSidx) - repmat


newEqconEx - (reshape (reomat((repmat(-ones(Liz J(etaCAl))',,1).*Pchrge(

eqcon = [eqcon;P(Pidx) == newEqconEx];

Sidx = Sidx + nphases*T;

end

end

264
%
storage constrais I > ases + '' (non-negativity and capac-t)

ineqconBattdefn =

Pdis >= 0;

zdis == 0;%DBUGN

Pcharge >= 0;

Pdis <= max([abs (delPup),abs (delPdown)])*ones(length(Sinds_new),1);

%
Pcharge <= max([abs(delPup) ,abs(delPdown) ])*ones(lerigth(Sindsnew),1);

%
P charge > max (as(delup) , ans (deldown) ] ) *cnes ( lenh(Sinds new) 1);

];

ineqconExps = []; e varal sid of capacity expr

ineqconVal = [];% connt i o ac expr

ineqrampExps = [ variable side o exp

for i = 1:numbatts

battID = battInds(i);

nphases = Sindsnewsizej{battID};

PSid = i;

betaSD = betaSDAll(i);

etaC = etaCAll(i);

etaD = etaDAll(i);

%or capacity

ineqconExp = etaC*Pcharge(PSid) - 1./etaD*Pdis(PSid);

ineqo oC p = P DEBUGGI 3¶NG

PSidx = i:numbatts:numbatts*T; % indices for ta=2 to tau=T

ineqconExps = [ineqconExps; ineqconExp]; %r' taU=1

for tau = 2:T


PSid = PSidx(tau);

i)neqconxp = Cneqc.o1xp*
(.-betaSd) +. cr( ); %DEBUGGING

ineqconExp = ineqconExp*(1-betaSD) + etaC*Pcharge(PSid) - 1./etaD*Pdis(PSid:

ineqconExps = [ineqconExps; ineqconExp];

end

265
%ramp constraints for batteries

Sindsbatt = Sindsj{battID};

Sindsbattidx = 1:nphases;

idxnew = Sindsbatt(Sindsbattidx); for time period

.
ineqrampExp = sum(P(idx new)); % for t.= 1 -Pt
ineqrampExps = [ineqrampExp];

%
idxold = idx_new;

for tau = 2:T


Sindsbattidx = nphases*(tau-1)+1:nphases*tau;

idxnew = Sindsbatt(Sindsbatt-idx);

ineqrampExp = sum(P(idx-new)-P(idxold));

ineqrampExps = [ineqrampExps; ineqrampExpl;

idxold = idx new;

end

ineqconVal(T*(i-1)+1:T*i) = (1-betaSD).^(1:T);

end

% ssemble.. capaciycnsrit

ineqconBattCap = [ineqconExps <= (maxCapAll - ineqconVal.*initCapsAll)'

ineqconExps >= (minCapAll - ineqconVal.*initCapsAll)'];

is 3consrit o bateris

ineqconBattRamp = [ineqrampExps <= delPup'

ineqrampExps >= delPdown'];

ramp constraints for generators

PGrampInds = find(-cellfun(@isempty,Prindsj)); nodes which have s with ramp con,

numPGr = length(PGrampInds);

ineqrampGExps = [];

for i = 1:numPGr

pgrampID = PGrampInds(i);

Prinds = Prindsj{pgrampID};

Pramp_idx = 1:3;

idxnew = Prinds(Prampidx); % fo r ime pe

ineqrampGExp = sum(P(idxnew)); % for

266
ineqrampGExps = [ineqrampGExp];f% fort

idxold = idxnew;

for tau = 2:T


Pramp_idx = 3*(tau-l)+1:3*tau;

idxnew = Prinds(Prampidx);

ineqrampGExp = sum(P (idx-new)-P (idx-old));

ineqrampGExps = [inegrampGExps; ineqrampGExpl;

idxold = idxnew;

end

end

ineqconDGRamp = [ineqrampGExps <= delPGup'

inegrampGExps >= delPGdown'];

[model,~] = export([ineqcon,ineqconDER,ineqconBattdefn,ineqconBattCap,ineqconBattRar

0,sdpsettings('solver','Gurobi'))

H=model.A;

e=model.rhs;

sense=model.sense;

Hj={}; Hj{N}={};

ej={}; ej{N}={};

DGpfInds = find(-cellfun(@isempty,H2jidx)); % ewith gfeertors wit 1 p it

% new equaitV cnsrin

Lstart = numVars;

numPdis = length(Sinds new); % nhases*T for Pis

newTotalVars = numVars + numPdis*2; % a dis an r o ba,t

G2indstart = find(sense=='=',1) 1; % i s a r

Hindstart = find(sense-='=',1) - 1a
numG2cons = cellfun(@max,G2jidx(~cellfun(@isempty,G2jidx))); index to reoeat

if isempty (numG2cons)

267
numG2cons = 0;

end

newTotalnG = nG + numG2cons;

% w new inecuiatv consraints.

if -isempty(DGpfInds) % have constraints

numH2cons = max(cellfun(@max,H2jidx(~cellfun(@isempty,H2jidx))));

else

numH2cons = 0;

end

if numbatts > 0 % have so:rage constraint

numH3cons = max(cellfun(@max,H3jidx(cellfun(@isempty,H3jidx))));

numH4cons = max(cellfun(@max,H4jidx(~cellfun(@isempty,H4jidx))));

numH5cons = max(cellfun(@max,H5jidx(-cellfun(@isempty,H5jidx))));

else

numH3cons = 0;

numH4cons = 0;

numH5cons = 0;

end

if numPGr > 0 %battery ramp constraint

numH6cons = max(cellfun(@max,H6jidx(~cellfun(@isempty,H6jidx))));

else

numH6cons = 0;

end

H2indstart = max(cellfun(@max,Hjidx)) + Hindstart; % start for f cons

H3indstart = numH2cons*2 + H2indstart; %start for Pds >

H4indstart = numH3cons*4*T + H3indstart; % ar for batt cap constaints

H5indstart = numH4cons*2 + H4indstart; to t nstint

H6indstart = numH5cons*2 + H5indstart; f csat g ramp Os ts

for j = 1:N

elems = Hjidx{j} + Hindstart; % prima iql constraints

268
- e for P--p co ai

if ismember(j,DGpfInds)

H2idxl = H2jidx{j};

H2idx2 = H2idxl + numH2cons; %alreadvy account for time perio

elems = [elems H2indstart+[H2idxl H2idx2]];

end

if ismember(j,battInds)

s og s at the no d.e

nphase = Sindsnew-sizej{j};

%
bgi updat of Gj~ by irs inse0ring ne.w coils for owned vars P0dis
% P0hrg (for T,- periods), -i C

oldGj = Gj{j};

[rowsGj,-] = size(oldGj);

newGj = [oldGj(:,1:length(Lset{j})) zeros(rowsGj,2*T) oldGj(:,lengftoh(Lset{j

Lidx1 = Lstart + (1:T); % n e for PI

Lidx2 = Lstart + numPdis + (1:T); tfor

Lset{j} = [Lset{j}, Lidxl, Lidx2];

Lstart = Lstart + T; % breetiticns of time taken ca o a e

Tset{j} = [cell2mat(Lset(j)) cell2mat(Oset(j))];

% append new, rows t 7ed

Gidx = repmat(G2jidx{j},1,T) + numG2cons*reshape(repmat(:T-1,length(G2jidx

newGj(rowsGj+1:rowsGj+nphase*T, 1:length(Tset{j})) = H(G2indstart + Gidx, T

Gj{j} = newGj;

Cj (j) = Cj (j) + T; % mmbeI o1 rowsOi G 0!j wned byj

end

269
% storage...

if ismember(j,battInds)

%et elements for rge


c;s nonnegativity

H3idxl = repmat(H3jidx{jl,1,T) + numH3cons*reshape(repmat(O:T-1,length(H3ji<

H3idx2 = H3idxl + numH3cons*T; % Parge >= C


H3idx3 = H3idx2 + numH3cons*T; % charge <= a.
H3idx4 = H3idx3 + numH3cons*T; harge <= max;

% e eflements for caacity conStr tS

H4idxl = H4jidx{j};

H4idx2 = H4idxl + numH4cons; already accountfor time periods


%/

%ge,t elements fo bat ramTyp costait

H5idxl = H5jidx{j};

H5idx2 = H5idxl + numH5cons; %al accoufo

elems = [elems H3indstart+[H3idxl H3idx2 H3idx3 H3idx4] H4indstart+[H4idxl I

end

if ismember(j,PGrampInds)

H6idxl = H6jidx{j};

H6idx2 = H6idxl + numH6cons; %fra ati

elems = [elems H6indstart+[H6idxl H6idx2]];

end

tic Inequal consta

Hj{j} = H(elems,Tset{j}); % a 1reaDy agmented wi

ej{j} = e(elems,:);

end

270
F = [];

for t = 1:T

inds = 3*N*(t-1)+1:3*N*t;

indsLine = 3*M*(t-1)+1:3*M*t;

F = [F;

Ir(inds) == real(A'*Ibranch(indsLine));

Ii (inds) == imag(A'*Ibranch(indsLine));

P(inds) == a(inds) + b(inds);

Q(inds) == -c(inds) + d(inds);

A*V(inds) == Zij*Ibranch(indsLine);

]n;
endi

ops = sdpsettings('' olv'', 'grobi');

% [~,globaOb-ifac = " j I (,TVrmX, Vi mX);


get I~

[~,globalObjfnc,~] getObj economic(N,T,costs,Pmax);

yETA = ,leI);au(i;vleV)vau(i;aleP;au(Q); value (a); vo

optimize ([F, ineqcon, ineqconDER, ineqconBattdefn, ineqconBattCap, ineqconBattRamp, ineqc

yCENTRAL-storage = [value (Ir) ;value (Ii) ;value (Vr) ;value (Vi) ;value (P) ;value (Q) ;value

end

C.5.2 DER Models

rengenmodel.m

O 0.0

System- Namelt Capct

er proucio limi

Ramp rates (Up nddom

271
[%]

napcity Fact.or

Capt--al cost of` system


Ior 4
Insalatonanilary co-,st s
[$/kW)
A11nnul & M f ost4Cs
[K v
Replacement cost
[kW
enerat ion pril ou

function specs = rengenmodel(rengenID,capacity,T)

if strcmp(rengenID, "solardistressmall")

specs = rengenIDSAMsolardistres-small(capacity,T);

elseif strcmp(rengenID, "solardistres_large")

specs = rengenID_SAMsolardistres-large(capacity,T);

elseif strcmp(rengenID, "solardistcomm")

specs = rengenID_SAMsolardistcomm(capacity,T);

elseif strcmp(rengenID, "wind-farm")

specs = rengenID_SAMwind-farm(capacity,T);

elseif strcmp(rengenID, "IITChinaSolar")

specs = rengenID_IITChinaSolar(;

elseif strcmp(rengenID, "IITChinaWind")

specs = rengenID_IITChinaWind(;

else

ERROR UNKNOWN REN GEN iD\n');

specs = 0;

end

end

function [specs,genFlag] = rengenIDSAMsolardistressmall(capacity,T)


[sesn lg reeengenID oio 2 c-n-.i~bupciO.
-

% sibte es idential s a v d f cpit ut 1kW,1

% cpait i k

dataCapacity = 3.85; in iil capac.iydata of. 35 kW;

maxGen = capacity;

minGen = 0;

rampUp = 0.8*capacity; % 4iven in KW

272
rampDown = 0.8*capacity; % gie i' kW

curtailLimit = 1;

capacityFactor 0.2; .go/lctricity/201

% ncial Informi

sysOM = 30; % tb eicity/2017/index.html?t.sr upwards of $40/


sysInstall = 6900/dataCapacity; % 6 + ,A

sysCap = 5800/dataCapacity; i ost sys- ter,$, SAM

sysReplace = 3000/dataCapacity; ements can cost upwards of 2500,

genID = 'solar_distressmall'; genFlag 0;

[genP,genQ] = generationProfiles(genID,T);

keySet = {'max~en', 'minGen', 'ramrp-Up', 'rampDown', 'curtailLimit', 'capacityFactor

valueSet = {maxGen, minGen, rampUp, rampDown, curtailLimit, capacityFactor, genP.*ci

specs = containers.Map(keySet, valueSet);

end

function [specs,genFlag] = rengenIDSAM solardistres-large(capacity,T)

% isriudresidentil s olar, valid.for.capoacit ies above 109kW, 31 inverters

% cpcity in kWi

dataCapacity = 11.89;
%

maxGen =.capacity;

minGen = 0;

rampUp = 0.8*capacity;
%

rampDown = 0.8*capacity;

curtailLimit = 1;

capacityFactor = 0.2;
%

sysOM = 30; % htp:/at,.;.nrel.gt

sysInstall = 17200/dataCapacity; 0, A

sysCap = 14400/dataCapacity; % a st M

sysReplace = 9000/dataCapacity; rlaeme twar 2500,

273
genID = 'solar_distressmall'; genFlag = 0;

[genP,genQ] = generationProfiles(genID,T);

keySet = {'maxGen', 'minen', 'rrpUp', 'rampDown', 'curtailLimit', 'capacityFactor


valueSet = {maxGen, minGen, rampUp, rampDown, curtailLimit, capacityFactor, genP.*ci

specs = containers.Map(keySet, valueSet);

end

function [specs,genFlag] = rengenIDSAMsolardistcomm(capacity,T)

dist:ruted
% commercial solar

%capaCct in kW

dataCapacity = 185; capacy of W;

maxGen = capacity;

minGen = 0;

rampUp = 0.8*capacity; i

rampDown = 0.8*capacity; %iven ink

curtailLimit = 1;

capacityFactor = 0.2; % https://atb.1 electrici

%finncal iormationf

sysOM = 30; % sttps: t n : r.ctric

sysInstall = 217000/dataCapacity; % 30`00+ 15110'+370 SAM

sysCap = 162000/dataCapacity; % capial cos t f st 70 , SAM

sysReplace = 12000/dataCapacity; nverter relcmet ancs uwrs of 2500,

genID = 'solar_distcomm'; genFlag = 0;

[genP,genQ] = generationProfiles(genID,T);

keySet = {'maxGen', 'minGen', 'rampUp', 'rampDown', 'curtailLimit', 'capacityFactor

valueSet = {maxGen, minGen, rampUp, rampDown, curtailLimit, capacityFactor, genP.*ci

specs = containers.Map(keySet, valueSet);

end

274
function [specs,genFlag] = rengenIDSAMwindfarm(capacity,T)

cm
% ical wdf

capVacitV inkW

dataCapacity = 600; %kW

maxGen = capacity;

minGen = 0;

rampUp = 0.8*capacity; % given in kW

rampDown = 0.8*capacity;

curtailLimit = 1;

capacityFactor = 0.4; %/ letrciv207ind htlt lw

sysOM = 51; % ty.ml>=l-, for

sysInstall = 0;

sysCap = 1640; % tex.ht,mltElw, for TR

sysReplace = 0;

genID = 'wi m'; genFlag = 0;

[genP,genQ] = generationProfiles(genID,T);

keySet = { 'maxGen', 'minen', 'ramp.p', 'rampDown', 'curtailLimit', 'capacityFactor

valueSet = {maxGen, minGen, rampUp, rampDown, curtailLimit, capacityFactor, genP.*ci

specs = containers.Map(keySet, valueSet);

end

function specs = rengenIDIITChinaSolar()

capacity = 1000;

maxGen = capacity;

minGen = 0;

rampUp = maxGen*10;

rampDown = maxGen*10;

curtailLimit = 1; , i = curtail 100% 1i-LItv

capacityFactor = 0.2;

275
financial intformt ion

sysOM = 100;

sysInstall = 1200;

sysCap = 5000; %capital cost f systei

sysReplace = 0;

% ke~et = (capcit ','mx~ea','mi~e .', rmptp', 'crampiown', 'cur.tailLimit', 's:

va = capaci max(e 0 min ram r w

% ~~ spJ = coties.Map key t valu:-t)

genProfile =

0.1

0.5

0.7

0.9

0.89

0.76

0.65

0.23

0]; aa

276
pf = 1;

keySet = {'maxGen', 'minGen', 'rampUp', 'rampDown', 'curtailLimit', 'capacityFactor

valueSet = {maxGen, minGen, rampUp, rampDown, curtailLimit, capacityFactor, genProf:

specs = containers.Map(keySet, valueSet);


end

function specs = rengenIDIITChinaWind()

capacity = 3000;

maxGen = capacity;

minGen = 0;

rampUp = maxGen*10;

rampDown = maxGen*10;

curtailLimit = 1; % 1 = curtai 100% abi

capacityFactor 0.4;

sysOM = 100;

sysInstall = 1200;

sysCap = 5000; aital costo se

sysReplace = 0;

genProfile =

0.75

1.5

1.9

2.1

2.2

1.45

0.8

1.5

277
1.4

0.2

0.45

0.4

1.05

1.2

2.5

2.8

2.7

2.75

2.75]; % data given nMW, ur

pf = 1;

keySet = {'maxGen', 'minGen', 'rampUp', 'rampDown', 'curtailLimit', 'capacitvFactor


valueSet = {maxGen, minGen, rampUp, rampDown, curtailLimit, capacityFactor, genProf:
specs = containers.Map(keySet, valueSet);

end

battmodel.m

se, returning quanties in .u., percentage,

%Maximum dep th of di

nd diSc e)
%Self di-schargerae

[W/h
an dichrg)

%% Japta
nua cost o
&(,ossy F'Mh
[count

% In j

278
ny trougput

%
atery wiear cost

function specs = battmodel(battID)

if stre-mp(battID, "1")

specs = battID-l();

elseif strcmp(battID, "IIT16")

specs = battID_IIT16();

elseif strcmp(battID, "IIT17")

specs = battID_IIT17();

elseif strcmp(battID, "IITChina")

specs = battID_IITChinao;

else

specs = 0;

end

end

function specs = battID l()

capacity = 1000; % n kW %o 100, 50

power = 700; in kW%0 30)

maxDOD = 0.85; % dt fi a

etaC = 0.95; ch are


etaD = 0.95; scharge efcec

betaSD 0.021;
f =D ; etD, 1

see pap,er: Opia 0loaino Dipre Energ StoagC ysem


r am~w =p
300; %see
ptimalAlloction
pper: f Dis ee En gyS rae yse

S0, 300

rampUp = 600;
%

rampDown = 600; 60, 0


%

cycleLife = 5000;

279
battOM = 100;

battInstall = 1200;

battCap = 5000;

battReplace = 1000;

%
energythru = cycleLife*capacity*maxDOD*2; 80% DOD, trips/ccle

wearCost = battReplace/(energythru*sqrt(etaC*etaD)); %ref: Hom-r energ

keySet = {'capacity', 'power', 'maxDOD', 'etaC', 'eCaD', 'betaSD', 'rampUp', 'rampD,

valueSet = {capacity, power, maxDOD, etaC, etaD, betaSD, rampUp, rampDown, cycleLif

specs = containers.Map(keySet, valueSet);

end

function specs = battIDIIT16()

capacity = 880;

power = 330;

maxDOD = 0.85; %ep of discharae

etaC = 0.95; % charge- effiercy

etaD = 0.95; % dscharge en

betaSD = 0.021; sef are rate

rampUp = 300; ;ee paer: Optipmal Alloation of Dispersed Enery Storage Systems i
%

rampDown = 300; ; seepaper Optmal caton


... of. D.ispersed EnergySoae ytm

cycleLife = 10000;

finnial infora

battOM = 100;

battInstall = 1200;

battCap = 5000;

battReplace = 1000; %/

energythru = cycleLife*capacity*0.8*2; % 80% D, 2 i


wearCost = battReplace/(energythru*sqrt(etaC*etaD)); ref: ergy

280
keySet = {'capacity', '-power', 'mnaxDOD', 'etaC', 'etaD', 'betaSD', 'rampUp', 'rampD

valueSet = {capacity, power, maxDOD, etaC, etaD, betaSD, rampUp, rampDown, cycleLiff

specs = containers.Map(keySet, valueSet);

end

function specs = battID_IIT17()

capacity = 960;

power = 880;

maxDOD = 0.85; % epth of discharge

etaC = 0.95; h
1 .fficiency

etaD = 0.95; % disc

betaSD = 0.021; seLf discarge ')Dtimal~~ O ertinD stributi

rampUp = 300; C rac)C


%

ion of Ds ese Enrg Soag Eytm


rampDown = 300; see na

cycleLife = 10000;

% , iacia iorm-atn

battOM = 100;

battInstall = 1200;

battCap = 5000;

battReplace = 1000;
%

energythru = cycleLife*capacity*0.8*2; 4 8% D4, 2 trips/cycle

wearCost = battReplace/(energythru*sqrt(etaC*etaD)); % ref: Homer energy

keySet = {'capacity', 'wr 'I, 'maxDOD', 'etaC , 'etaD', 'betaSD', rampp


valueSet = Icapacity, power, maxDOD, etaC, etaD, betaSD, rampUp, rampDown, cycleLif

specs = containers.Map(keySet, valueSet);

end

281
function specs = battID_IITChina()

capacity = 3000;

power = 500;

maxDOD = 0.9; %epth o-,f dicarge

etaC = 0.95; charge efficiency

etaD = 0.95; scha efciency

%. dert paper : Otmal Operation of DiDstpr buY

betaSD = 0; R low ba

rampUp = 300; % s ee paper: O l astion of Dispersed Energy Storage Systemsi


rampDown = 300; % see pracer: Opt:iml Allocation of Dispersed Eergy Storage Systems

cycleLife = 15000; % RIow batts

battOM = 100;

battInstall = 0;

battCap = 900;
%

battReplacePerc = 0.15; % replacmn cost is5 4.riin~

battReplace = battReplacePerc*battCap; % I/kWh

energythru = cycleLife*capacity*0.9*2; % 90%DO, 2 tripYs/ccle

wearCost = battReplace*capacity/(energythru*sgrt(etaC*etaD)); %ef: Honer energy,

keySet = {'capacity', 'power', 'maxDOD', 'etaC', 'etaD', 'betaSD', 'rampUp', 'rampD<

valueSet = {capacity, power, maxDOD, etaC, etaD, betaSD, rampUp, rampDown, cycleLif

specs = containers.Map(keySet, valueSet);

end

C.5.3 Objective Functions

getObj.m

function [objfncs,globalObjfnc,L] = getObj (N,T,Vr max,Vi max)

282
objfncs={}; objfncs{N}={};

for j = 1:N

VrInds = 3*2*T + (1:3*T); is3rd variable, 3*(j-1].)

ViInds = 3*3*T + (1:3*T) ; %i vare, 3* (>1)

% ol -var control r) +((V-1)^2

objf n cs Ij} = @ (aj, j_,len) sum((a j(Vr Inds) -one s(3*T, 1)).2 + (a j(Vi Inds) -z er o s(3

end

globalObjfnc = globalObj(N,T);

L = getObjL(N,T,Vr-max,Vimax);

end

Vr vi PT Q a.oe
ay -de :
VrI" V i PQao c
%v de :
Vr Vi P Q a oe L. (Ibranc r 0b
vr iPQaoe dIranch b

E( Ir __Njt .. . I)N tT , Ii)_N tI ...

(
(

Funct ion val = globalObj (N, T)

VrInds = 3*2*N*T + (1:3*N*T);

ViInds = 3*3*N*T + (1:3*N*T);

val = @(y) sum ((y(VrInds)-ones(3*N*T,1)).^2 + (y(ViInds)-zeros(3*N*T,1)).^2);

end

% Lshold e at least as large 3s tedrvtv


S-unct ion L = getObjL(N,T,Vr max,Vi max)

% (r 2 - * r + 1 i 2 -- > d/d = 2Vr +- 2 i - 2 (size of r

L sum ((2*Vr-max + 2*Vi-max)) - 2*3*N*T;

end

getObjeconomic.m

funct ion [objfncs,globalObjfnc,L] = getObj economic (N, T, costs, P max)

objfncs={}; objfncs{N}={};

283
costaP = costs{l};

costbP = costs{2};

costcP = costs{3};

costbPs = costs{4};

cost-bQ = costs{5};

for j = 1:N

PInds = 3*4*T + (1:3*T); % P is 5th variabi

QInds = 3*5*T + (1:3*T); % Q Is 6th variabl

costIdx = ((j-1)*3 + 1):((j-1)*3 + 3);

costIdxrep = repmat(costIdx,1,T)+3*N*reshape (repmat((0:T-1),3,1),1, []);

objfncs{j} = @(aj,j_,len) costaP(costIdxrep) '*aj(PInds).^2 + costbP(costIdxre

sum(cost-cP(costIdxrep)) + abs(costbPs(costIdxrep)'*aj(PInds)) + costbQ(c<

end

globalObjfnc = globalObj(N,T,costs);

L = getObjL(N,T,costs,P-max);

end

Dyrde:

% irer: ( -v

% yrerI [Ir ii V i Q(
[I l V V PQ ed banhrIbaChi, dw
[4
Pdis Pcare](gob l e
%arde: id
[IrY Vr Vi N'i N Irnh baci~dw dsPhre|(rtle
%v multi

function val = globalObj(N,T,costs)

costaP = costs{1};

costbP = costs{2};

costcP = costs{3};

costbPs = costs{4};

cost-bQ = costs{5};

PInds = 3*4*N*T + (1:3*N*T);

QInds = 3*5*N*T + (1:3*N*T);

284
val = @(y) cost-aP'*y(PInds).^2 + costbP'*y(PInds) + sum(cost-cP) + abs(costbPs'*1

end

% o at east as earg as the derivati ve


fu c 1ion L = getObjL(N,T,costs,Pjmax)

(Vr^2 -2*-Vr + 1) Vi'2 -> d/dly= Vi - 2(iz e to f Vr

cost aP = costs{1};

cost bP = costs{2};

costcP = costs{3};

costbPs = costs{4};

costbQ = costs{5};

L = 2.*costaP'*Pmax + sum(costbP + costbPs + cost bQ);

end

getObj socialwelfare.m

function [objfncs,globalObjfnc,L] = getObj socialwelfare(N,M,T,xi,costs,Zij,RMatj,numCh:

objfncs={}; objfncs{N}={};

costaP = costs{1};

costbP = costs{2};

costcP = costs{3};

costbPs costs{4};

costbQ = costs{5};

%~~~ ~~ nod ow dontra poeIlw

_ lP(eedr + LM * (edr

%assumye all- pases haemSM

eCt
% l d cS

for j = 1:N

numChildj = numChildren(j);

285
if numChildj > 0

IbranchrInds = 3*10*T + (1:3*T*numChildj);

IbranchiInds = (3*10 + 3*numChildj)*T + (1:3*T*numChildj);

objfncs{j} = @(aj, j_,len) xi*sum(RMatj{j}*(aj(IbranchrInds).^2 + aj(Ibranch:

else

% no children node, no downs.re power flows

objfncs{j} = @(aj,j_,len) 0;

end

PInds = 3*4*T + (1:3*T); % P is 5th variable

QInds = 3*5*T + (1:3*T); % Q is 6th variable

idx = (j-1)*3 + (1:3);

idxT = repmat(idx,1,T) + reshape(repmat((0:T-1),3,1),1, [])*3*N;

objfncs{1} = @(aj,j_,len) objfncs{1}(aj,j_,len) + ...

cost-aP(idxT) I*aj(PInds).^2 + costbP(idxT) '*aj(PInds) + sum(costcP(idxT))

end

RMat = real(Zij);

globalObjfnc = globalObj(N,M,T,xi,costs,RMat);

L = getObjL(N,T,xi,costs,RMat,Ibranchr max,Ibranchimax,Pjmax);

end

%yarer:. [ Jr.1 Vr Vi' P Q a.b dl (gilo al)C Y


%, ar'der 1 S V V Q a l ;d Vr-tilde Vi tilde] C)

%O yrder 1 I branh rbra-i) d (global

%F de : [ QiVa liP r d ( n r Ibranc_ oe


-pe iod [{V ) N t .. {( r _N t ,l (( i _N t .. {{ _..t ... ]
%v ut-

.unction val = globalObj(N,M,T,xi,costs,RMat)

costaP = costs{l};

costbP = costs{2};

costcP = costs{3};

costbPs = costs{4};

286
costbQ = costs{5};

IbranchrInds = 3*10*N*T + (1:3*M*T);

IbranchiInds = (3*10*N + 3*M)*T + (1:3*M*T);

PInds = 3*4*N*T + (1:3*N*T);

QInds = 3*5*N*T + (1:3*N*T);

RMatT = repmat({RMat},1,T);

% ssum,eall phse have sam LMP

val =@(y) xi*sum(blkdiag(RMatT{:})*(y(IbranchrInds).^2 + y(IbranchiInds).^2)) +

.
cost-aP'*y(PInds).^2 + cost-bP'*y(PInds) + sum(cost_cP) + abs(cost bPs'*y(PInds'

end

SS s

function L getObjL(N,T,xi,costs,RMat,Ibranchr max,Ibranchimax,Pjmax)

%
(V^2 - 2*r + 1) + Vi^2 -- >ddy=Cr V 2 (size ofVr-)

% eectrical loss *r -- ji^2 =R (1Ir^2 +1i2

%,cs- of electrcity frm1 eeder:. LM_*e(edr + LMPQ* (edr

% ->d =M iz f Pfeed' + LMPQ sJie of Qfeed

costaP = costs{1};

costbP = costs{2};

costcP = costs{3};

costbPs = costs{4};

cost-bQ = costs{5};

RMatT = repmat({RMat},1,T);

L = xi*sum(blkdiag(RMatT{:})*(Ibranchrmax + Ibranchi-max)*2) + 2.*costaP'*Pmax


+

287
end

C.6 Result Processing

generateResGraphs.m

function generateResGraphs( y, N, M, T, rengenInds, battInds,Sindsj,Sinds-new, limits)

%l :include some ei
Include rm ratesn imits forenera

IrIndsAll = (1:3*N*T); %Ir is 1st

IiIndsAll = 3*1*N*T + (1:3*N*T);

VrIndsAll = 3*2*N*T + (1:3*N*T);


s -Jh set ovas
ViIndsAll = 3*3*N*T + (1:3*N*T);

PIndsAll = 3*4*N*T + (1:3*N*T);

QIndsAll = 3*5*N*T + (1:3*N*T); 1 S 9th et of nar

MCEaIndsAll = 3*6*N*T + (1:3*N*T); % d i 10thset f va

MCEbIndsAll = 3*7*N*T + (1:3*N*T);

MCEcIndsAll = 3*8*N*T + (1:3*N*T);

MCEdIndsAll = 3*9*N*T + (1:3*N*T);

Ir_min = limits{1}; Irmax = limits{2};


Ii_min = limits{3}; Ii_max = limits{4};

Vr_min = limits{5}; Vr_max = limits{6};

Vi_min = limits{7}; Vi_max = limits{8};

P_min = limits{9}; Pmax = limits{10};

Q__min = limits{11}; Qmax = limits{12};

time (1:T);

periodend = T;

plotGenNLoad(N, T, y(PIndsAll), y(QIndsAll), time, rengenInds, battInds, Sindsj, P_

end

288
fu-ction plotGenNLoad(N, T, P, Q, time, rengenInds, battInds, Sindsj, Pmin)

%N, pG, qG3, qL, sC-t dmn,te,gnde,rgnNodes,


LL attNodes)

% get produc in from feeder-

feedinds = [1:3*N:3*N*T];

repPhasel = reshape(repmat(feedinds,3,1),1, [1);

repPhase2 = reshape(repmat((0:2),T,1)',1, []);

feedindsrep = repPhasel + repPhase2;

feederP = s:m(reshape(P(feedindsrep), [],T));

feederQ = sum (reshape(Q(feedindsrep), [],T));

if -isempty(rengenInds)

repPhasel = reshape(repmat(3*(rengenInds-1),3, 1) 1)

repPhase2 = reshape(repmat((1:3),size(rengenInds,2),1)',1,[])';

repT1 = repmat(repPhasel + repPhase2,T,1);

repT2 = reshape (repmat(3*N*(O:T-1),size(repPhasel,1),1), [],1);

rengensP = sum(reshape(P(repT1 + repT2), [ ],T));

rengensQ = sum(reshape(Q(repTl + repT2), {],T));

else

rengensP = zeros(1,T);

rengensQ = zeros(1,T);

e nd

% alothe-r gfen~s

%'ge s =. os.m (pG (g n de S2 :! en ), ) ,1

% gtatio o strae acro:ss en:tire nsfeork (net storage)

if ~isemr.pty (batt Inds)

indsStorage = [Sindsj{:}];

if isa(indsStorage, 'cell')

indsStorage = [indsStorage{:}]; % need to unpck more

289
end

indsStorageT = reshape (sort (indsStorage), [],T); % each column is he ndices fo

netStorageP = sum(P(indsStorageT));

netStorageQ = sum(Q(indsStorageT));

else

netStorageP = zeros(1,T);

netStorageQ = zeros(1,T);

end

%-LAD S

notStorageNotGen = setdiff( (2:N), [battInds,rengenInds]);

repPhasel = reshape (repmat(3*(notStorageNotGen-1),3,1), [],1);

repPhase2 = reshape (repmat((1:3),size (notStorageNotGen,2),1) 1, [])';

repT1 = repmat(repPhasel + repPhase2,T,1);

repT2 = rYeshape(repmat(3*N*(0:T-1),size(repPhasel,1),1), [],1);

loadInds = repT1 + repT2;

P_minT = reshape (Pmin (loadInds) , [],T); I each column is for time pert(

demandP = sum(PminT.*(P-minT<O)); %oads are anegate; cet et loads p peiod

P_load = P(loadInds);

P_loadT = reshape (P load, [],T); each coumn is for time eriod t (T columns)

loadsServicedP = sum(PloadT);

Q_load = Q(loadInds);

Q loadT = reshape (Q load, [],T); % each column is for tm perid t(

loadsServicedQ = sum(Q_loadT);

loadDR = abs(demandP) - abs(loadsServicedP); % amt of demand rspone, oaaross

loadDRpercent = (abs(demandP) - abs(loadsServicedP))./abs(demandP)*100;

figure, hold on;

subplot (5,1,1)

if size(time,2)==1

%ack to alw o sinle stacked bar

290
bar([1;nan], [[feederP;netStorageP.*(netStorageP>0);rengensP] '; nan(1,3)], 'staf

else

bar( [feederP;netStorageP.*(netStorageP>0) ;rengensP] ','stacked');

end

xticks((time(1):1:time(end)));

xlabel('Time Period (I ))

ylabe1('Real p owr in pu

legend(' Imored Elect icitv', 'Storage Generation (D- scharge) ', 'Renewable Generatio

leen (' emore EetrIcity', 'Nneeal Geeaion' 'Ren ew -abl Gene rato','

subplot (5,1,2)

if size (time, 2)==1

Sfstck ba

bar([1;nan], [[feederQ;netStorageQ.*(netStorageQ>0);rengensQ] '; nan(1,3)], 'sta

else

bar( [feederQ;netStorageQ.* (netStorageQ>0) ;rengensQI', 'stacked');

end

xticks((time(1):1:time(end)));

xlabel('ime Period (hr)');

ylabel('Reactive power in pu');

legend ( 'Imported Electricity', 'Storage Generation (Discharge) ','Renewable Generatio


leend (' cmorted E lect r i-0t.' Nonrenewable Generatin','Renewable Generation');

subplot (5,1,3)

if size(time,2)==1

% hack to alow fora.. sinl stce b,arf

bar([1;nan], [[loadsServicedP;netStorageP.*(netStorageP<0)] '; nan(1,2)], 'stacke

else

bar( [loadsServicedP;netStorageP.* (netStorageP<0)]', 'stacked');

end

xticks((time(1):1:time(end)));

xlabel('Time Period (br)');

ylabel('Real power in pu');

legend('System Load', 'Storage Load (Charging) ');

subplot (5, 1, 4)

291
if size(time,2)==1

% hack to allow for sinl e stacked bar

bar([1;nan], [[loadsServicedQ;netStorageQ.*(netStorageQ<0)]'; nan(1,2)], 'stackc

else
bar( [loadsServicedQ; netSt orageQ. * (netSt orageQ<0) ] ', 't acked');

end

xticks((time(1):1:time(end)));

xlabel('Time Period (hr)');

ylabel('Reactive Power in pu');

legend('System Load','Storage Load (Charging) ');

subplot (5,1,5)

if size(time,2)==1

ko al lw for sinLe stacked bar

scatter(time,loadDRpercent)
else

scatter(time,loadDRpercent)
end

xlim([O,time(end)]);
xticks((time(1):1:time(end)));
xlabel('Time Period (hr)');
vlabel( 'Percentage of Forecasted Load');

legend('Load Curtailed through DR');

end

C.7 Network Data and Data Profiles


All data files are not shown for brevity. Only the data files for the 3 node network

are shown for completeness of understanding code structure and dependencies. Net-

work3NodeModel.m

% af t configuration nd topoog
%~~~ ~
U: n ~entCha
Cosi

292
ene bse values
%

SBase=5e3; % kVA

VBase=4160; % V

ZBase=VBase^2/(SBase)/le3; % OII

YBase = 1/ZBase; Siemens

IBase=SBase*1e3/ (sort (3) *VBase);

N = 3;

arcs =

1 2 0.0568 1

2 3 0.0568 2

M;

M = size(arcs,1);

Graph-network=graph(arcs (:,1) ,arcs (:,2));

adj=full (adjacency (Graph-network));

[i, j]=find(adj);

Neigh = accumarray(i, j, [size(adj,1), 11,@(x) {sort(x).'});

parents = cellfun(@ (neighbours,node)neighbours (neighbours<node) ,Neigh,num2cell( (1:N)'),

children = cellfun(@(neighbours,node)neighbours (neighbours>node),Neigh,num2cell((1:N)'),

numParents = cellfun(@numel,parents);

numChildren = cellfun(@numel,children);

% CC trnsformerrtn

Stran = 5e3/SBase;

% adittnces oflnectg

c_601 = [0.4338 - 1.2502i -0.1840 + 0.4622i -0.1008 + 0.3455i

-0.1840 + 0.4622i 0.3798 - 1.1847i -0.0478 + 0.2639i

-0.1008 + 0.3455i -0.0478 + 0.2639i 0.3359 - 1.1176i];

293
c_602 = [0.5270 - 0.6756i -0.1416 + 0.1426i -0.2026 + 0.1600i
-0.1416 + 0.1426i 0.4648 - 0.6689i -0.1030 + 0.1309i

-0.2026 + 0.1600i -0.1030 + 0.1309i 0.4914 - 0.6710i];

admittances = {c_601,c_602};

z_601 = [ 0.3465+1.0179i 0.1560+0.5017i 0.1580+0.4236


0.1560+0.5017i 0.3375+1.0478i 0.1535+0.3849i
0.1580+0.4236i 0.1535+0.3849i 0.3414+1.0348i];
z_602 = [0.7526+1.1814i 0.1580+0.4236i 0.1560+0.5017
0.1580+0.4236i 0.7475+1.19831 0.1535+0.3849i
0.1560+0.5017i 0.1535+0.3849i 0.7436+1.2112i];

impedances = {z_601,z_602};

Network3NodeData.m

%%NETWOR~_K _PEFI

%3NO"DEN-ETWORK

classdef Network3NodeData

methods (Static)

%Select t-he desire setup


unction [Hj,ej, ineqcon, limits,costs,rengenInds,battInds,Sindsj,Sinds-new,numTo

V_min = 0.95; Vmax = 1.05;

delta_min = -0.01; deltamax = 0.01;

switch configCode

294
case 1

[loadsP,loadsQ,demRes,gensP,gensQ,rengens, storage,demandProfileID]

case 2

[loadsP, loadsQ,demRes,gensP,gensQ,rengens, storage, demandProfileID]

case 3

[loadsP, loadsQ, demRes,gensP,gensQ, rengens, storage,demandProfileID]

otherwise default
fprintf('\n~t - Default Network Configuration Usedn

[loadsP, loadsQ,demRes,gensP,gensQ,rengens, storage, demandProfileID]

end

rnpre-proces g adasse e all the benera

[Hj, ej, ineqcon, limits, costs, rengenInds,battInds, Sindsj, Sinds-new, numTotalVa

V_min,V-max,delta-min,delta-max,N,M,A,Tset,Lset,Oset,Gj,Cj,nG,Hjidx,SBa.

end

end

end

funct.ion [loadsP, loadsQ,demRes,gensP,gensQ,rengens, storage,demandProfileID] = configCod

demandProfileID = 'ISONE';

%[opApas p P and Q respecte

loadsP =

2 200 300 500

3 200 500 100]; % [node load]

loadsQ =

2 100 150 300

3 80 350 201; % frde load]

% emand respons ca pabltiJe s, per.-cen--ta'ge oDRenablomed

demRes =];

n ens neg rampup rampdown

gensP

295
S[node maxGenA maxGen:B maxGenC minGenA mindenB miInenC

gensQ = [];

{(node, capacitykW, phases, rengenD

.
rengens =

%[node battD phases init~harge ~fiitstate] -pchases 'ab' or 'abc'

S note: for 2 phase storage, initstate [x y rearctess of which phases are c,


storage =

end

function [loadsP, loadsQ, demRes,gensP,gensQ, rengens, storage,demandProfileID] = configeod

demandProfileID = 'ISONE';

loadsP = [

2 200 300 500]; % [node load J

loadsQ =

2 100 150 300]; % [nodeslad)

demRes = []; % demand response capabil

m
m axx eenie
m a nxoe
me m eEz minpen orpos pn rampup ramponn

gensP = [];
-9, 6. C)

gensQ = [;

r{o e, oa ~~o
%ine capityW pases, rengen D' , }

rengens = { };
% ~~ rnes= (,1,'ac','slrdi istres sma ll

ndeat D ases i arge ini'a' or 'abo'


% note: for 2p intsae=[ y regaless of which phases are c

storage = [3 "1" 'abc' 150 0 0 01;

storagye = [];.....500 0 0

296
end

function [loadsP, loadsQ,demRes,gensP,gensQ,rengens, storage,demandProfileID] = configCod

demandProfileID = ISONE';

loadsP = [

2 200 300 500

3 200 500 100];

loadsQ = [
2 100 150 300

3 80 3 50 20]; % -node
Cload

demRes = [

2 0.71;

gensP = [];
gensQ = [];
rengens

storage = [];

end

generationProfiles.m

-lcuntion [mmgP,mmgQ] = generationProfiles(generationID,T)

% mmcg - noralze geeao p for


%mmgQ - nlCKComlze eeration. pr0oie for Q, ior T or

pathname = ./net w.rk dat a/da aprof ies ' ;

switch generationID

case 'solar ditres sml

pf = 1; ed power f fo the nvere

DCtoAC 1.2; % fix e C to ACc

filename =

297
startDay = 'May 14, 12: 00 an';

case 'solardistres large'

pf = 1; % f po we act f inverter

DCtoAC = 1.2; % fix e d D't AC cOverSion ratio

filename = 'PV distres-pheonixAZ ll893W.csv';

startDay = 'May 14, 12:00 am';

case ' solar distcomm'

pf = 1; % f ixed ower facor frhinverter

DCtoAC= 1.2; % fixed C to A onr

filename = 'PV distcomm-pheonixAZ_185kW.sv';

startDay = 'May 14, 12:0 a

case 'windfarm'

pf = 1; % e power factoro hi t

DCtoAC = 1.2; % xed T to ACsion ri

filename = 'Wind farm_600kW.csv';

startDay = '05/14/2018 00:00'; % % Ma- 14

end

if isfile(strcat(pathname,filename))

genProfile = readtable(strcat(pathname,filename));

else

fprintf ('\n\t ERROR GEN PROF ILE FILE NOT FOUND\n');

ret urn;

end

if -strcmp(generationID, 'wind farm')

startInd = find(strcmo(genProfile.TimeStamp, startDay));

else

startInd = find(genProfile.TimeStamp == datetime(startDay));

end

if -isempty (startInd)

if startInd+T-1 > size(genProfile,1)

fprintf('\n\t ERROR GEN TIME EXCEEDS FORECAST\n');

return;

end

298
mmgPT = table2array(genProfile(startInd:startInd+T-1,2) )/DCtoAC;

mmgQT = mmgPT.*tan(acos(pf));

else

fprintf (\n\t - WARNNG GEN TM NOT FOUND\n');

mmgPT = zeros (T, 1);

mmgQT = zeros (T, 1);

end

mmgP = rescale(mmgPT);

mmgQ = rescale(mmgQT);

end

demandProfiles.m

fuctio [mmdP,rmmdQ] = demandProfiles(demandID,N,T)

%
m cPemand profLe fo
-

msQ- d n rol f
N isnumbr o nods i netork(so achno gets a uni~que poritle)

nominalP = ones(N,1); nominalQ = ones (N, 1); % t em, (may not need)

switch demandID

case 'ISONE'

[mm_dP, mm_dQ] = ISONE(N,T);

case 'normal'

[mm~dP, mmdQ ] = normalD (N, T, nominalP, nominalQ);

case 'normal I:'

[mm dP, mmdQ] = normalDpf (N, T, nominalP, nominalQ);

case 'randoim'

[mmdP,mmdQ] = randomD(N, T);

end

end

function [mnmdPT,mmdQT] = ISONE(N,T)

dateid = 'Mayl42019';

pathname = strcat (' . /networkdata /dataprofiles/', dateid, '');

299
filename = strcat ('isonedata_', dateid, '.mat');

if isfile(strcat(pathname,filename))

load (strcat (pathname, filename), 'rmd', 'units')

else

forintf('\n\t ERROR DEMAND PROFILE FILE NOT FOUND\n');

return;

end

assum all profile data isneed

% rofile data is every 5 mins from ISONE -> convert to hourly

n = 12;

mmcd-reshaped = reshape (mm d,n, []);

mm-d-hourly = mean(mm_d_reshaped);

mm-d-hourly = repmat(mm-d-hourly,N,1); % duplicate for all node

1'C 01,M
LL Ar......0C1

sigmaP = 0.1;
rP = normrnd(0,sigmaP,[N,24]); % need N by vi s

mm-dP-dup = mm_d_hourly.*(1+rP); % N

Smaa to give a mara reas ic deand proi

mmdP = smoothdata (smoothdata (smoothdata (mm dP dup', 1, ' aussian') ,2), ' gaussian') ';

e gnerresr-o vra:i:ry so - and ........ n...r. rollo _anrca pro__e

sigmaQ = 0.01;

rQ = normrnd(0,sigmaQ, [N,24]); need N y T var iatins

mm-dQ = mmdP. *(1+rQ); N by T

ij to s n return the desired.hours


mmdPT = mm-dP (:,1:T);

mm-dQT = mm-dQ(:,1:T);

end

Function [mmdP,mm.dQ] = normalD(N,T,nominalP,nominalQ)

%-random, noraly ditribte d deman p.roi fil

300
mmdP = round(abs(normrnd(1,O.3, [N*T,1])),2); ;Tmor variatiOn in 9?

mm-dQ = round (abs (normrnd (1, O . 1, [N*T, 1] )),2) ; I less variation in Q

check any 's i the profl set to a nominal value

have an negive values

nominalP = repmat(nominalP,T,1);

nominalQ = repmat(nominalQ,T,1);

mmndP (mmdP <= 0) = nominalP (mm_dP <= 0);

mm~dQ(mm~dQ <= 0) = nominalQ(mmdQ <= 0);

end

function [mm_dP,mm dQ] = normalDpf (N, T,nominalP,nominalQ)

mm_dP = round (abs (normrnd (1, 0. 3, [N*T, 1] )),2); re

mm-pf = round (abs (normrnd (0 . 55, O. 05, [N*T, 1] )),2) i clse

mmdQ = mm_dP .*(1-mmp f)./mm_p f;

% can't hae any nYeg aiv vles

nominalP = repmat(nominalP,T,1);

nominalQ = repmat(nominalQ,T,1);

mm-dP(mmdP <= 0) = nominalP(mmdP <= 0);

mm-dQ (mmdQ <= 0) = nominalQ (mmdQ <= 0) ;

end

function [mm dP,mm dQ] = randomD(N,T)

%ruyrandom eadpoie

mmdP = rand(N,T) ;% varIatTLcl.n 1

mm~dQ = rand(N,T); % vi a 2fg ranae ofthe2 P

end

301
302
Bibliography

[11 Jeff St. John. Distributed energy poised for AAexplosive growthAA2 on the us
grid. June 2018.

[2] US Environmental Protection Agency (EPA). U.s. electricity grid markets.


https://www.epa.gov/greenpower/us-electricity-grid-markets, 2017. Accessed:
2020-01-06.

[3] PJM. Market for electricity. https://learn.pjm.com/electricity-basics/market-


for-electricity.aspx, 2018. Accessed: 2020-01-06.

[4] PJM Demand Side Response Operations. 2018 distributed energy resources (der)
that participate in pjm markets as demand response. https://www.pjm.com/-
/media/markets-ops/demand-response/2018-der-annual-report.ashx?la=en,
2019. Accessed: 2020-01-06.

[5] M. Farivar and S. Low. Branch flow model: Relaxations and convexification part
i. IEEE Transactions on Power Systems, 28(3):2554-2564, 2013.

[61 M. Farivar and S. Low. Branch flow model: Relaxations and convexification part
ii. IEEE Transactions on Power Systems, 28(3):2565-2572, 2013.

[7] L. Gan, N. Li, U. Topcu, and S. H. Low. Exact convex relaxation of optimal power
flow in radial networks. IEEE Transactions on Automatic Control, 60(1):72-87,
Jan 2015.

[8] G. Ferro, M. Robba, D. D'Achiardi, R. Haider, and A.M. Annaswamy. A dis-


tributed approach to the optimal power flow problem for unbalanced and mesh
networks. In In 21st IFAC World Congress, 2020, 2019 (submitted).

[9] F.C. Schweppe, M.C. Caramanis, R.D. Tabors, and R.E Bohn. Spot Pricing of
Electricity. Kluwer Academic Publishers, 1998.

[10] Pu Huang, Jayant Kalagnanam, Ramesh Natarajan, Don Hammerstrom, Ron


Melton, Mayank Sharma, and Ron Ambrosio. Analytics and transactive control
design for the pacific northwest smart grid demonstration project. First IEEE
InternationalConference on Smart Grid Communications, Oct 2010.

[11] B. Stott, J. Jardim, and 0. Alsac. De power flow revisited. IEEE Transactions
on Power Systems, 24(3):1290-1300, 2009.

303
[12] M. Baran and F.Wu. Optimal sizing of capacitors placed on a radial distribution
system. IEEE Transactions on Power Delivery, 4(1):735-743, 1989.

[13] M. Baran and F.Wu. Optimal capacitor placement on radial distribution systems.
IEEE Transactions on Power Delivery, 4(1):725-734, 1989.

[14] A. Nedic and A. Ozdaglar. Distributed subgradient methods for multi-agent


optimization. IEEE Transactions on Automated Control, 54(1):48-61, 2009.

[15] A. Nedic, A. Ozdaglar, and P. A. Parrilo. Constrained consensus and opti-


mization in multi-agent networks. IEEE Transactions on Automated Control,
55(4):922-938, 2010.

[161 M. Gurbuzbalaban, A. Ozdaglar, and P. A. Parrilo. Convergence rate of incre-


mental gradient and newton methods. arXiv preprint:1510.08562,pages 922-938,
2015.

[17] M. Gurbuzbalaban, A. Ozdaglar, and P. A. Parrilo. A globally convergent incre-


mental newton method. Mathematical Programming, 151(1):283-313, 2015.

[18] M. Gurbuzbalaban, A. Ozdaglar, and P. A. Parrilo. Why random reshuffling


beats stochastic gradient descent. arXiv preprint: 1510.08560, 2015.

119] M. Gurbuzbalaban, A. Ozdaglar, and P. A. Parrilo. On the convergence rate


of incremental aggregated gradient algorithms. SIAM Journal on Optimization,
27(2):1035-1048, 2017.

[201 J. Romvary, G. Ferro, and A.M. Annaswamy. A distributed proximal atomic


coordination algorithm. IEEE Transactions on Automatic Control, 2019 (sub-
mitted).

121] J. Romvary. A proximal atomic coordination algorithm for distributed optimiza-


tion in distribution grids. PhD thesis, Massachusetts Institute of Technology,
2018.

[22] R. Haider, S. Baros, Y. Wasa, J. Romvary, K. Uchida, and A.M.


Anaswamy. Towards a retail market for distribution grids. IEEE
Transactions on Smart Grids, 2019 (under review). Available at
http://aaclab.mit.edu/resources/TowardsARetailMarketrevision.pdf.

[23] Daniel K. Molzahn, Florian D6rfler, Henrik Sandberg, Steven H. Low, Sambud-
dha Chakrabarti, Ross Baldick, and Javad Lavaei. A survey of distributed opti-
mization and control algorithms for electric power systems. IEEE Transactions
on Smart Grid, 8(6):2941-2962, 2017.

[24] Emiliano Dell'anese, Hao Zhu, and Georgios B. Giannakis. Distributed op-
timal power flow for smart microgrids. IEEE Transactions on Smart Grid,
4(3):1464AA*1475, 2013.

304
1251 Brett A. Robbins and Alejandro D. Dominguez-Garcia. Optimal reactive power
dispatch for voltage regulation in unbalanced distribution systems. IEEE Trans-
actions on Power Systems, 31(4):2903dA2913, 2016.

[26] Garth P. Mccormick. Computability of global solutions to factorable nonconvex


programs: Part i AAT convex underestimating problems. MathematicalProgram-
ming, 10(1):147&AS175, 1976.

[27] Garth P. Mccormick. Computability of global solutions to factorable nonconvex


programs: Part i AAT convex underestimating problems. MathematicalProgram-
ming, 10(1):147&AS175, 1976.

[28] Ipopt documentation.

[29] Giulio Ferro, Michela Robba, Mansueto Rossi, and Anuradha M. Annaswamy. A
new convex relaxation of the optimal power flow problem for distribution grids
with unbalanced structure and mesh topology. 2020 (unpublished).

[30] The Mathworks, Inc., Natick, Massachusetts. MATLAB version 9.5.0.713579


(R2018b), 2018.

[311 J. L6fberg. Yalmip : A toolbox for modeling and optimization in matlab. In In


Proceedings of the CACSD Conference, Taipei, Taiwan, 2004.

[32] LLC Gurobi Optimization. Gurobi optimizer reference manual, 2019.

[331 S. Gill and G. W. Ault. Dynamic optimal power flow for active distribution
networks. IEEE Transactions on Power Systems, 29(1):121-131, Jan. 2014.

[34] L. H. Macedo, J. F. Franco, M. J. Rider, and R. Romero. Optimal operation of


distribution networks considering energy storage devices. IEEE Transactions on
Smart Grid, 6(6):2825-2836, Nov. 2015.

[35] M. Nick, R. Cherkaoui, and M. Paolone. Optimal allocation of dispersed en-


ergy storage systems in active distribution networks for energy balance and grid
support. IEEE Transactions on Power Systems, 29(5):2300-2310, Sept. 2014.

[36] Homer. Homer pro 3.13. https://www.homerenergy.com/products/pro/docs/latest/


battery_minimumstateof-charge.html, 2019. Accessed: 2020-01-07.

137] ISO-NE. Pricing reports. https://www.iso-


ne.com/isoexpress/web/reports/pricing/-/tree/mps-rt-five-minute-final, 2019.

[38] ISO-NE. Energy, load, and demand reports. https://www.iso-


ne.com/isoexpress/web/reports/load-and-demand/-/tree/dmnd-five-minute-
sys, 2019.

[39] National Renewable Energy Laboratory (NREL). Annual technology baseline.


2017. Accessed: 2020-01-10.

305
[40] NERC. About nerc. https://www.nerc.com/AboutNERC/Pages/default.aspx,
2017. Accessed: 2020-01-05.

[411 FERC. What ferc does. https://www.ferc.gov/about/ferc-does.asp, 2018. Ac-


cessed: 2020-01-05.

[421 US Energy Information Administration (EIA). Us electric sys-


tem is made up of interconnections and balancing authorities.
https://www.eia.gov/todayinenergy/detail.php?id=27152, 2016. Accessed:
2020-01-05.

[431 ISONE. Faqs: Day-ahead energy marketdATcommitment, scheduling,


and dispatch. https://www.iso-ne.com/participate/support/faq/da-market-
commitment, 2019. Accessed: 2020-01-06.

[44] CAISO. Market processes and products.


http://www.caiso.com/market/Pages/MarketProcesses.aspx, 2019. Accessed:
2020-01-06.

[451 Jerry Webb. Indiana utility regulatory commission: Ancillary ser-


vices markets. https://pubs.naruc.org/pub.cfm?id=5375186A-2354-D714-51D9-
83D16B591C58, 2007. Accessed: 2020-01-06.

[46] ISO New England. Iso new england pricing reports. https://www.iso-
ne.com/isoexpress/web/reports/pricing/-/tree/ancillary, 2018.

[47] P. Maloney. FERC order opens 'floodgates' for energy storage in wholesale mar-
kets. https://www.utilitydive.com/news/ferc-order-opens-floodgates-for-energy-
storage-in-wholesale-markets/517326/, Feb. 2018.

[48] Farrokh Rahimi and Ali Ipakchi. Using a transactive energy framework. IEEE
ElectrificationMagazine, Dec 2016.

[49] M. Yazdanian and A. Mehrizi-Sani. Distributed Control Techniques in Micro-


grids. IEEE Transactions on Smart Grid, 5(6):2901-2909, November 2014.

[50] K. E. Antoniadou-Plytaria, I.N. Kouveliotis-Lysikatos, P. S. Georgilakis, and


N. D. Hatziargyriou. Distributed and Decentralized Voltage Control of Smart
Distribution Networks: Models, Methods, and Future Research. IEEE Transac-
tions on Smart Grid, 8(6):2999-3008, November 2017.

[51] Tao Chen, Qais Alsafasfeh, Hajir Pourbabak, and Wencong Su. The next-
generation us retail electricity market with customers and prosumers AA$ a
bibliographical survey. Energies, 2018.

[52] S. D. Manshadi and M. E. Khodayar. A Hierarchical Electricity Market Structure


for the Smart Grid Paradigm. IEEE Transactions on Smart Grid, 7(4):1866-
1875, Jul. 2016.

306
153] M. Hofling, F. Heimgartner, B. Litfinski, and M. Menth. A Perspective on the
Future Retail Energy Market. In Proceedings of the International Workshops
SOCNET 2014 and FGENET 2014, pages 87-95, 2014.

[541 S. Parhizi, A. Khodaei, and S. Bahramirad. Distribution Market Clearing and


Settlement. In Proceedingsof the IEEE Power and Energy Society General Meet-
ing, Jul. 2016.

155] L. Bai, J. Wang, C. Wang, C. Chen, and F. F. Li. Distribution Locational


Marginal Pricing (DLMP) for Congestion Management and Voltage Support.
IEEE Transactions on Power Systems, Oct. 2017.

[56] Yahya K. Renani, Mehdi Ehsan, and Mohammad Shahidehpour. Optimal trans-
active market operations with distribution system operators. IEEE Transactions
on Smart Grids, 9(6), Nov 2018.

[57] J. Wei, Y. Zhang, F. Sahriatzadeh, and A. K. Srivastava. Dlmp using three-phase


current injection opf with renewables and demand response. JET Renewable
Power Generation, 13(7):1160-1167, July 2019.

[58] J. Wei, L. Corson, and A. K. Srivastava. Three-phase optimal power flow based
distribution locational marginal pricing and associated price stability. IEEE
Power and Energy Society General Meeting, July 2015.

[59] C-H Lo and N. Ansari. Decentralized Controls and Communications for Au-
tonomous Distribution Networks in Smart Grid. IEEE Transactions on Smart
Grid, 4(1):66-77, March 2013.

[601 Z. Wang, B. Chen, J. Wang, and J. Kim. Decentralized Energy Management


System for Networked Microgrids in Grid-Connected and Islanded Modes. IEEE
Transactionson Smart Grid, 7(2):1097-1105, March 2016.

[61] N. Li. A Market Mechanism for Electric Distribution Networks. In Proceedings


of the 54th Conference on Decision and Control (CDC), Dec. 2015.

[62] Thomas Morstyn, Alexander Teytelboym, and Malcolm D. McCulloch. Designing


decentralized markets for distribution system flexibility. IEEE Transactions on
Power Systems, 34(3), May 2019.

[63] Claudia Pop, Tudor Cioara, Marcel Antal, Ionut Anghel, Ioan Salomie, and
Massimo Bertoncini. Blockchain based decentralized management of demand
response programs in smart energy grids. Sensors, 2018.

[64] Ni Zhang, Yu Yan, and Shengyao Xu. Game-theory-based electricity market


clearing mechanisms for an open and transactive distribution grid. In 2015 IEEE
Power & Energy Society General Meeting, July 2015.

307
[65] M. Caramanis, E. Ntakou, W. W. Hogan, A. Chakrabortty, and J. Schoene.
Co-Optimization of Power and Reserves in Dynamic T and D Power Markets
With Nondispatchable Renewable Generation and Distributed Energy Resources.
Proceedings of the IEEE, 104(4):807-836, Apr. 2016.
[66] Kuo Feng Hong Zhou, Zhi-Wei Liu, and Dandan Hu. Retail market pricing design
in smart distribution networks considering wholesale market price uncertainty.
In JECON 2017 - 43rd Annual Conference of the IEEE Industrial Electronics
Society, Nov 2017.

[67] Hajir Pourbabak, Tao Chen, and Wencong Su. Consensus-based distributed
control for economic operation of distribution grid with multiple consumers and
prosumers. In 2016 IEEE Power and Energy Society General Meeting (PESGM),
July 2016.
[68] Navid Rahbari-Asr, Unnati Ojha, Ziang Zhang, and Mo-Yuen Chow. Incremen-
tal welfare consensus algorithm for cooperative distributed generation/demand
response in smart grid. IEEE Transactions on Smart Grid, Nov 2014.

[69] Soummya Kar, Gabriela Hug, Javad Mohammadi, and Moura Jose M.F. Dis-
tributed state estimation and energy management in smart grids: A consen-
sus+innovations approach. IEEE Journal of Selected Topics in Signal Processing,
Dec 2014.
[70] W. Shi, X. Xie, Chi-Cheng Chu, and R. Gadh. Distributed Optimal Energy
Management in Microgrids. IEEE Transactions on Smart Grid, 6(3):1137-1146,
May 2015.
[71] Y. Zhang, N. Gatsis, and G. B. Giannakis. Robust Energy Management for Mi-
crogrids With High-Penetration Renewables. IEEE Transactions on Sustainable
Energy, 4(4):944-953, October 2013.
[72] H. S. V. S. K. Nunna and S. Doolla. Multiagent-Based Distributed-Energy-
Resource Management for Intelligent Microgrids. IEEE Transactions on Indus-
trial Electronics, 60(4):1678-1687, April 2013.

[73] Y. Xu and Z. Li. Distributed Optimal Resource Management Based on the Con-
sensus Algorithm in a Microgrid. IEEE Transactions on Industrial Electronics,
62(4):2584-2592, April 2015.

[74] Qiuye Sun, Renke Han, Huaguang Zhang, Jianguo Zhou, and Josep M Guerrero.
A multiagent-based consensus algorithm for distributed coordinated control of
distribued generators in the energy internet. IEEE Transactions on Smart Grid,
Nov 2015.

[75] J. W. Simpson-Porco, Q. Shafiee, F. Ddrfler, J. C. Vasquez, J. M. Guerrero,


and F. Bullo. Secondary Frequency and Voltage Control of Islanded Micro-
grids via Distributed Averaging. IEEE Transactions on Industrial Electronics,
62(11):7025-7038, November 2015.

308
[761 A. Makhdoumi and A. Ozdaglar. Convergence rate of distributed admm over
networks. IEEE Transactions on Automatic Control, 52(10):5082-5095, 2017.

[77] Y. Zhang, M. Hong, E. Dall'Anese, S. Dhople, and Z. Xu. Distributed Controllers


Seeking AC Optimal Power Flow Solutions Using ADMM. IEEE Transactions
on Smart Grid, Feb. 2017.

[78] P. Kansal and A. Bose. Bandwidth and latency requirements for smart trans-
mission grid applications. IEEE Transactions on Smart Grid, 2(3), Sept. 2012.

[791 Y-J Kim, M. Thottan, V. Kolesnikov, and W Lee. A secure decentralized data-
centric information infrastructure for smart grid. IEEE Communications Maga-
zine, 48(11):58-65, Nov. 2010.

[80] M. Kuzlu, M. Pipattanasomporn, and S. Rahman. Communication network


requirements for major smart grid applications in han, nan, and wan. Computer
Networks, 67:74-88, 2014.

[811 Y. Hayashi et al. Versatile Modeling Platform for Cooperative Energy Manage-
ment Systems in Smart Cities. Proceedings of the IEEE, 106(4):594-612, Mar.
2018.

[82] Tokyo Electric Power Company. https://www4.tepco.co.jp/en/forecast/html/index-


e.html.

[83] Japan Electric Power eXchange. http://www.jepx.org/english/index.html.

[84] OVO Energy. Average electricity prices around the world: $/kwh.
https://www.ovoenergy.com/guides/energy-guides/average-electricity-prices-
kwh.html, 2019.

[85] Tokyo Electric Power Company. Electricity rate plans.


https://www7.tepco.co.jp/ep/rates/electricbill-e.html, 2019.

[86] IEEE Power and Energy Society. Ieee pes amps dsas test feeder working group:
Resources. Technical report.

[871 Helena Gerard, Enrique Israel Rivero Puente, and Daan Six. Coordination be-
tween transmission and distribution system operators in the electricity sector: A
conceptual framework. Utilities Policy, 50:40-48, 2018.

[881 G. L. Barbose, N. R. Darghouth, B. Hoen, and R. H. Wiser. Income trends of


residential pv adopters: An analysis of household-level income estimates. LBNL
Energy Technologies Area, Apr 2018.

[89] Scott Burger, Ian Schneider, Audun Botterud, and Ignacio PAfrez-Arriaga. Con-
sumers, prosumers, prosumagers: How service innovations will disrupt the utility
business model. 2019.

309
[901 Standard models for Japanese power system. IEEJ Tech. Report, no. 754 (in
Japanese), 1999.

310

You might also like