PreprintPDF Available

An Efficient Learning-Based Solver for Two-Stage DC Optimal Power Flow with Feasibility Guarantees

Authors:
Preprints and early-stage research may not have been peer reviewed yet.

Abstract and Figures

In this paper, we consider the scenario-based two-stage stochastic DC optimal power flow (OPF) problem for optimal and reliable dispatch when the load is facing uncertainty. Although this problem is a linear program, it remains computationally challenging to solve due to the large number of scenarios needed to accurately represent the uncertainties. To mitigate the computational issues, many techniques have been proposed to approximate the second-stage decisions so they can dealt more efficiently. The challenge of finding good policies to approximate the second-stage decisions is that these solutions need to be feasible, which has been difficult to achieve with existing policies. To address these challenges, this paper proposes a learning method to solve the two-stage problem in a more efficient and optimal way. A technique called the gauge map is incorporated into the learning architecture design to guarantee the learned solutions' feasibility to the network constraints. Namely, we can design policies that are feed forward functions that only output feasible solutions. Simulation results on standard IEEE systems show that, compared to iterative solvers and the widely used affine policy, our proposed method not only learns solutions of good quality but also accelerates the computation by orders of magnitude.
Content may be subject to copyright.
i
An Efficient Learning-Based Solver for Two-Stage
DC Optimal Power Flow with Feasibility
Guarantees
Ling Zhang, Daniel Tabas and Baosen Zhang
Abstract—In this paper, we consider the scenario-based two-
stage stochastic DC optimal power flow (OPF) problem for
optimal and reliable dispatch when the load is facing uncer-
tainty. Although this problem is a linear program, it remains
computationally challenging to solve due to the large number
of scenarios needed to accurately represent the uncertainties. To
mitigate the computational issues, many techniques have been
proposed to approximate the second-stage decisions so they can
dealt more efficiently. The challenge of finding good policies to
approximate the second-stage decisions is that these solutions
need to be feasible, which has been difficult to achieve with
existing policies.
To address these challenges, this paper proposes a learning
method to solve the two-stage problem in a more efficient and
optimal way. A technique called the gauge map is incorporated
into the learning architecture design to guarantee the learned
solutions’ feasibility to the network constraints. Namely, we can
design policies that are feed forward functions that only output
feasible solutions. Simulation results on standard IEEE systems
show that, compared to iterative solvers and the widely used
affine policy, our proposed method not only learns solutions of
good quality but also accelerates the computation by orders of
magnitude.
I. INTRODUCTION
The optimal power flow (OPF) problem is one of the
fundamental tools in the operation and planning of power
systems [1]–[3]. It determines the minimum-cost generator
outputs that meet the system demand and satisfy the power
flow equations and operational limits on generators, line flows
and other devices. Traditionally, the OPF is formulated as
a deterministic optimization problem, where a solution is
computed for some nominal and fixed demand. However, with
significant penetration of renewable energy into the power grid
as well as demand response programs, the fluctuation in the
demand should be explicitly taken into account [4].
To take uncertainties in the net-load into account,1stochastic
programming methods are a type of common tools used to
to reformulate the OPF as a multi-stage problem [5]–[7].
In these problems, decisions are made sequentially at each
L. Zhang, D. Tabas, and B. Zhang are with the Department of Elec-
trical and Computer Engineering at the University of Washington. Emails:
{lzhang18,dtabas,zhangbao}@uw.edu. The authors are partially supported by
a NSF Graduate Fellowship, NSF grants ECCS-1942326 and ECCS-2023531,
and the Washington Clean Energy Institute.
1In this paper, we use the term net-load to capture both renewable
generation in the system [5] and the load.
stage, based on the forecast of the net-load and the fact that
additional adjustments can be made in future stages when the
uncertainties are better known.
In this paper, we consider a two-stage stochastic program
based on the DC optimal power flow (DCOPF) model. The DC
power flow model linearizes the power flow equations and is
the workhorse in power industries [8]. The two-stage DCOPF
problem is also becoming increasing popular as a canonical
problem that incorporates the impact of uncertainties arising
from renewable resources [9], [10]. In more general terms, the
two-stage DCOPF problem falls under the category of two-
stage stochastic linear programs with (fixed) recourse (2S-
SLPR) [11].
Like other 2S-SLPR problems, the second stage of the two-
stage DCOPF involves an expectation of the uncertain param-
eters ( i.e., the randomness in the net-load) over some proba-
bility distribution. In practice, the probability distributions are
rarely known and difficult to work with analytically. Therefore,
several different approaches have been used to approximate
2S-SLPR problems. Among these, the most popular is the
sample average approximation (SAA) [12]–[14].
The SAA is a basic Monte Carlo simulation method, which
represents the random parameter using a finite set of realiza-
tions (scenarios), yielding a (possibly large) deterministic two-
stage linear programming problem. Though the SAA approach
is easy to implement, directly using it to solving two-stage
DCOPF may result in computational challenges. A reason for
this is that the SAA method tends to require a large sample
set in order to generate a good-quality solution [15]–[17],
rendering the SAA formulation for two-stage DCOPF into a
very large-scale linear program. In some sense, the challenge
has moved from generating many high quality samples from
a probabilistic forecast to being able to solve a optimization
problem using these samples [18]–[20]. Secondly, as decisions
in power system operations are made in a more online (or
corrective) manner [10], [21], OPF problems need to be solved
repeatedly in real time. Even though solving single linear
programs are easy, solving two-stage DCOPF problems are
not [19], [22].
A common approach to reduce the computational burden
in solving two-stage DCOPFs is to model the second stage
decisions using an affine policy. More specifically, the second-
stage (or the recourse) dispatch decision is restricted to be
an affine function of the realized net-load and the first-stage
arXiv:2304.01409v1 [eess.SY] 3 Apr 2023
ii
decisions [23]–[25]. Once the affine policy is determined,
the decision-making in the real time is just simple function
evaluations. This method has been observed to provide good
performance when the net-load variations are small or are
restricted to a few possible instances [26]–[28]. However, if
the variations are large or include many possible values, the
affine policy method tends to not perform well. In fact, it may
produce decisions that do not even satisfy the constraints in
the two-stage optimization problem.
In this paper, we overcome the challenge in policy design
and solving two-stage DCOPF problems by presenting a neural
network (NN)-based architecture that is computationally effi-
cient and also guarantees the feasibility of learned solutions. In
particular, our architecture involves two neural networks, one
each for the first and second stages. The first neural network
learns the mapping from the load forecast to the first-stage
decisions. The second neural network approximates the cost-
to-go given the net-load realization and the learned first-stage
decisions. So, instead of using the affine policy, we offer an
NN-based policy to solve the second-stage OPF problem. This
NN policy is constructed using a technique called the gauge
map [29], [30], which allows the output of the NN to be
guaranteed to satisfy the DCOPF constraints. Since this policy
also involves only function evaluations, it preserves the speed
of affine policies. At the same time, a neural network is much
more expressive than an affine function, and can provide much
better approximations to the true solution.
The main advantages of the proposed learning architecture
are summarized below:
1) Since decision-making using the NNs only involves feed-
forward calculations, the proposed approach can solve
problems at much faster speed (i.e., within milliseconds
on average) compared to iterative solvers.
2) By using the gauge map, the neural networks’ outputs are
guaranteed to be a feasible solution in the constraint set.
As a result, all constraints in the problem are satisfied by
construction, which cannot be done using affine policies.
3) We validate the effectiveness of the proposed approach by
applying it to solving two-stage DCOPF problems on the
modified IEEE 118-bus system. The simulation results
demonstrate the ability of our approach to generate high-
quality solutions orders of magnitude more quickly than
commercial solvers.
The rest of this article is organized as follows: In Section
II, we describe the general setup of the two-stage DCOPF
problem and the two widely-used formulations of two-stage
DCOPF. Section III presents the proposed learning approach to
solving the two-stage DCOPF problem, including the overall
architecture design, the training of it and the decision-making
procedure. Section IV illustrates how to incorporate the gauge
map technique in the architecture design to ensure the feasi-
bility of the neural networks’ predictions. Section V provides
the simulation results and Section VI concludes the paper.
II. TW O-S TAGE DCOPF
In this section, we provide more details about the formula-
tion of two-stage DCOPF problems. Consider a power network
with Nbuses connected by Mtransmission lines. Without loss
of generality, we assume each bus ihas a generator as well as
a load, and the load is uncertain. We denote the randomness in
the system by ωPRN, which is a random vector, and the net-
load at each bus iis a function of ω, denoted by dipωq. Note
this notation allows us to capture the fact that the load depend
non-trivially on the underlying randomness. The algorithms
developed in this paper is compatible with any scenario-based
forecasting algorithms.
In the first stage of a problem, the exact value of dipωq
is not known. Rather, we assume a forecast is available.
Specifically, we adopt a scenario-based probabilistic load fore-
casting framework in this paper and assume a set of samples
(scenarios) that is representative of ωis available [31]–[35].
It is useful to assume that a nominal load–for example, the
mean of dipωq–is known in the first stage. We denote this
nominal load by s
di, and based on the scenario forecasts and
s
di, the system operator (SO) chooses a first-stage generation
dispatching decision, denoted by p0
i. Then once the actual
demand dipωqis realized, a second-stage (recourse) decision
pR
iis determined to balance the power network.
For concreteness, we specifically consider two widely used
formulations of the two-stage DCOPF problem, risk-limiting
dispatch (RLD) [5] and reserve scheduling [27]. Both are
two-stage stochastic linear programs with recourse, and both
highlight the structure and difficulty of two-stage problems.
A. Risk-Limiting Dispatch
The RLD problem seeks to find a first-stage dispatching
decision p0
iat each bus ithat minimizes expected total cost
in two stages. The second-stage decisions, pR
i, are made after
the net-load is observed.
We assume that the cost of dispatching generation at bus iis
αip0
iin the first stage and βirpR
is`in the second stage, where
αiand βiare prices measured in dollars per MW ($/MW)
and the notation rzs`maxtz, 0umeans that only power
purchasing (pR
ią0) incurs a second-stage cost and any excess
power (pR
iă0) can be disposed of for free [5], [36], [37].
The cost minimization problem is:
J
rldps
dqmin
p0αTp0`ErQpdpωq ´ p0;βq|s
ds(1a)
s.t. p0ě0,(1b)
where the expectation is taken with respect to the probability
distribution of dpωqconditioned on s
d, and Qpdpωq ´ p0;βq
is the second-stage cost or cost-to-go. Given the first-stage
decision p0 rp0
1,¨ ¨ ¨ , p0
NsTand a particular realization of
iii
dpωq, the second-stage cost is given by
Qpdpωq ´ p0;βqmin
pR,θ
βTrpRs`(2a)
s.t. BθpR´ pdpωq ´ p0q(2b)
´fmax ďFθďfmax,(2c)
where (2b) is the DC power flow constraints and (2c) is the line
flow limit constraints. Without loss of generality, we assume
bus 1is the reference (slack) node and set its voltage angle
to be zero. The notation θPRN´1denotes the voltage angles
at non-slack buses, the matrix BPRNˆpN´1qmaps θto the
nodal power injections, and the matrix FPRMˆpN´1qmaps
θto the flows on all edges. See Appendix A for details on
constructing Band F.
Note that the second-stage problem (2) can be seen as a
deterministic DCOPF problem with the demand dpωq ´ p0.
Since the recourse decision pRis not bounded, (2) is feasible
for any given demand input.
We approximate the expectation in (1) using samples. Let
tωkuK
k1be a collection of samples of ω, and tdpωkquK
k1be
the collection of load realizations. We determine the first-stage
decision by solving the following scenario-based problem that
is a deterministic linear program:
r
JK
rld ps
dqmin
p0,
tpRpωkq,θpωkquK
k1
αTp0`1
K
K
ÿ
k1
βTrpRpωkqs`
(3a)
s.t. p0ě0(3b)
Bθpωkq pRpωkq´pdpωkq ´ p0q,@k(3c)
´fmax ďFθpωkq ď fmax,@k(3d)
where the second-stage decisions tpRpωkq,θpωkquK
k1are
functions of ωand the constraints (3c)-(3d) related to the
second-stage decisions need to be satisfied for every load
realization dpωkq.
B. Two-stage DCOPF with Reserve
Sometimes the second-stage recourse decision pRcannot
be arbitrarily positive or negative. Instead, pRis limited
by various factors such as generator capacities or real-time
(second-stage) electricity market structure. This is captured
by a two-stage DCOPF where reserve services are provided to
deal with the possible mismatch between the actual generation
and the realized load [10], [27].
Specifically, we consider the spinning reserve service in this
paper. In the first stage, in addition to choosing an initial
dispatching decision p0
iat each bus i, the SO also needs
to decide the up and down reserve capacities, priand qri. In
this way, the first-stage cost at each bus iincludes both the
cost of dispatching p0
i, i.e., αip0
i, and of providing reserve
services that is given by µippri`qriq, where αiand µiare
prices measured in $/MW.
The second-stage recourse decision pR
iat each bus iis
constrained by the reserve capacities, priand qri. To quantify
the amount by which the reserve capacities decided in the first
stage might be exceeded, we define the cost of dispatching
pR
iat each bus ias a piecewise-affine function given by
γres
i´rpR
i´pris`´ rpR
i`qris´¯, where γres
iis penalty cost in
$/MW and rzs´mintz, 0u. This cost function means that
there would be no cost for second-stage dispatching within the
reserve amounts that are allocated in the first stage.
The two-stage DCOPF with reserve scheduling can be
formulated as the following stochastic program:
J
resps
dq
min
p0,
p
r,q
r
αTp0`µTpp
r`q
rq ` ErQpdpωq ´ p0;p
r,q
r,γresq|s
ds
(4a)
s.t. 0ďp0ďpmax (4b)
p0`p
rďpmax (4c)
p0´q
rě0(4d)
p
r,q
rě0,(4e)
where (4c)-(4e) constrain the up and down reserve at each bus i
to be positive and no larger than the available capacities around
p0
i. Given the first-stage decisions pp0,p
r,q
rqand a particular
realization of dpωq, the second-stage cost is given by
Qpdpωq ´ p0;p
r,q
r,γresq
min
pR,θ
γresT´rpR´p
rs`´ rpR`q
rs´¯(5a)
s.t. BθpR´ pdpωq ´ p0q(5b)
´fmax ďFθďfmax,(5c)
which can also be seen as a deterministic DCOPF problem
with demands dpωq ´ p0and the cost being the penalty
imposed on the generation value if it exceeds the reserve
capacities. This “penalizing deviations” technique is com-
monly employed by stochastic programmers to promote the
feasibility of second-stage problems for any given first-stage
decisions [38].
The SAA method solves the following scenario-based prob-
lem associated with (4)
r
JK
resps
dqmin
p0,p
r,q
r,
tpRpωkq,θpωkquK
k1
αTp0`µTpp
r`q
rq `
1
K
K
ÿ
k1˜γresT´rpRpωkq ´ p
rs`´ rpRpωkq ` q
rs´¯¸
(6a)
s.t. 0ďp0ďpmax (6b)
p0`p
rďpmax (6c)
p0´q
rě0(6d)
p
r,q
rě0(6e)
Bθpωkq pRpωkq´pdpωkq ´ p0q,@k(6f)
´fmax ďFθpωkq ď fmax,@k. (6g)
iv
C. Computational Challenges
To have a sample set of load realizations that is repre-
sentative enough of the true distribution of the random net-
load, a large number of realizations are required for even a
moderately sized system [39]. Therefore, although (3) and
(6) are linear programs, they are often large-scale problems.
In addition, since both the first and second-stage decisions
depend on the mean of the scenario forecasts, s
d, every
time the set of scenarios changes, we need to re-solve (3)
and (6). Even if a single instance can be solved efficiently
using commercial solvers such as CVXPY [40], [41] and
GLPK [42], repeatedly solving large-scale linear programs can
still impose considerable computational burdens.
The scale of the problems can grow quickly as the size
of the system and the number of scenarios grow. Therefore,
an affine policy is often used to approximate (2) and (5).
However, finding a good policy that satisfies the constraints
((3c),(3d), (6f), and (6g)) can be difficult. In the next section,
we present an NN-based learning architecture to enable more
efficient computation.
III. PROP OS ED LEARNING ALGORITHM
In this section, we present the learning algorithm to solve
the scenario-based problems in (3) and (6). To start with,
we rewrite the two-stage problem in a more compact way as
follows
r
JKps
dqmin
xrcpxq ` r
QKpx;tωkuK
k1,r
βq(7a)
s.t. xPX(7b)
where xdenotes the first-stage decisions, which is p0for (3)
and pp0,p
r,q
rqfor (6), and the set Xcollects all constraints
that xhas to satisfy, i.e., (3b) or (6b)-(6e). The notation
r
cp¨q is the generic representation of the first-stage cost and
r
QKpx;tωkuK
k1,r
βqis the estimated second-stage cost based
on the set of scenarios tωkuK
k1.
Here we use a simple decomposition technique such that
(7) becomes much easier to work with. To be specific, if the
first-stage decision xis taken as given, then the second-stage
cost r
QKpx;tωkuK
k1,r
βqis separable:
r
QKpx;tωkuK
k1,r
βq 1
K
K
ÿ
k1r
Qkpδdpx;ωkq;x,r
βq
where we use the notation δdpx;ωkqdpωkq ´ p0to
represent the demands that are not balanced by the first
stage when the load realization is actually dpωkq, and
r
Qkpδdpx;ωkq;x,r
βqis the optimal value of each scenario
problem for a particular load realization dpωkq. Each of these
scenario problems can be seen as a deterministic DCOPF
problem with demands δdpx;ωkqand an objective function
r
q;x,r
βqthat takes xand r
βas parameters. The deterministic
DCOPF problem can be written in the following generic form:
r
Qpδdpx;ωq;x,r
βqmin
pR,θrqppR;x,r
βq(8a)
s.t. BθpR´δdpx;ωq(8b)
´fmax ďFθďfmax.(8c)
Fig. 1: The architecture used for training in the proposed algorithm.
When making decisions in real time, we only need the network φ0
to predict the first-stage decisions from the given load forecast.
In a similar fashion, by exploiting the decomposable struc-
ture of (7), the proposed learning algorithm consists of two
subnetworks, denoted by φ0and φR, respectively. The first
subnetwork φ0learns the mapping from s
dto x, i.e., φ0:
RN
`ÞÝÑ X, while the second one learns the mapping from the
pair px,δdpx;ωqq to r
Qpδd;x,r
βq, i.e., φR:Xˆdpx,ωq ÞÝÑ
r0,`8s, where dpx,ωqis the set of all possible mismatches,
i.e., dpx,ωq tdpωq ´ p0|px,ωq P Xˆu, and is the
sample space of ω.
The two subnetworks can be implemented using neural
networks. Once trained, these neural networks can produce
solutions much faster than existing solvers. However, a key
question also arises: how to make neural networks satisfy
constraints, namely, how to ensure the output from φ0lies
within the feasibility set Xand the constraints of the op-
timization problem in (8) are satisfied? Notably, we want
to avoid steps such as projecting to the feasible set since
these introduce additional optimization problems [43], which
somewhat defeats the purpose of learning. This key question
will be tackled in the next section, and for the rest of this
section, we first treat the two subnetworks as black boxes to
provide an overview of the proposed algorithm .
This algorithm includes a training process and a prediction
process. The architecture used for training is shown in Fig. 1.
When the learning algorithm is used in practice, i.e., in the
prediction process, just the network φ0is required to predict
the first-stage decisions given a scenario forecast. The reason
why we need a second network φRis that the two networks
need to be trained together in order to obtain a network φ0
that can predict the solution to (7) accurately. We now describe
how the two networks in Fig. 1 are trained.
We use w0and wRto denote the respective parameters, i.e.,
the weights and biases, of neural networks in φ0and φR. The
goal of training is to learn the optimal values for w0and wR.
To this end, we first construct a loss function in the forward
v
pass, and then calculate the gradients of the loss function with
respect to w0and wRthrough the backward pass. Following
that, the stochastic gradient descent (SGD) method is used to
minimize the loss function.
Suppose ts
diuI
i1is a batch of training data consisting of I
load forecasts. The loss function is given by
min
w0,wRLpw0,wRq1
I
I
ÿ
i1
Lipw0,wRq,(9)
where
Lipw0,wRqrc´φ0ps
di;w0q¯`
1
K
K
ÿ
k1
φR˜x,δd´φ0ps
di;w0q;ωik¯;wR¸.
We use the double superscript ωik to represent that, for each
instance of s
di, we need to sample an independent set of
scenarios tωikuK
k1.
The stochastic gradients of the loss function with respect to
w0and wRat a randomly chosen data point s
diare calculated
using the chain rule in the backward pass, which can be
expressed as follows
BLipw0,wRq
Bw0rc1Bφ0ps
di;w0q
Bw0`
1
K
K
ÿ
k1
BφRpδik
d;wRq
Bδik
d
Bδik
d
Bφ0ps
di;w0q
Bφ0ps
di;w0q
Bw0(10a)
BLipw0,wRq
BwR1
K
K
ÿ
k1
BφRpδik
d;wRq
BwR.(10b)
where rc1is the derivative of rcp¨q and δik
d
δd´φ0ps
di;w0q;ωik¯. At each iteration t, SGD repeats
the following updates on w0and wRuntil a certain stopping
criterion is reached:
w0pt`1qÐÝ w0ptq´ρBLipw0,wRq
Bw0ˇˇˇw0ptq(11a)
wRpt`1qÐÝ wRptq´ρBLipw0,wRq
BwRˇˇˇwRptq,(11b)
where ρdenotes the step size. Note that all the backward pass
gradients given by (10) can be computed using the automatic
differentiation engine in machine learning libraries, such as
autograd in Pytorch [44], [45], and the SGD updating rules
in (11) can also be implemented therein.
Once parameters w0and wRreach a local minimum and
the training process terminates, we can use the trained network
φ0that is parameterized by the learned w0to predict the first-
stage decisions based on the load forecast. We summarize our
learning algorithm, including the training and the decision-
making procedures, in Table I.
In the next section, we show the detailed architecture design
of the two networks and answer the key question about how to
make them satisfy the constraints in the optimization problems.
Proposed Learning Algorithm
Training Procedure
1: Inputs: Number of iterations T, a minibatch of
training data, ts
duI
i1, sample space of ω
2: Parameters: w0,wR
3: for t1,¨ ¨ ¨ , T do
4: Randomly sample tωikui1:I ,k1:Kfrom .
5: Forward pass φ0´ts
duI
i1;w0¯ÝÑ txiuI
i1
6: for k1,¨ ¨ ¨ , K do
7: Calculate δdpxi,ωikqfor i1,¨ ¨ ¨ , I .
8: Forward pass φR´tδdpxi,ωikquI
i1;wR¯ÝÑ
!r
Qkpδdpxi;ωikq;xi,˜
βq)I
i1
9: end for
10: Construct the loss function using (9).
11: Randomly pick a data point s
diand calculate the
stochastic gradients using (10).
12: Update w0and wRusing (11).
13: Check stopping criterion.
14: end for
15: Outputs: Trained networks φ0and φR
Decision Making Procedure
1: Inputs: Load forecast s
dnew, trained network φ0
2: Forward pass φ0´s
dnew;w0¯ÝÑ xnew
3: Outputs: Predicted first-stage decision xnew
TABLE I: The proposed learning-based algorithm to solve (7).
IV. NET WO RK ARCHITECTURE DESIGN
In this section, we show the network design of φ0and φR
to ensure the feasibility of the networks’ outputs. Particularly,
each network consists of a sequence of neural layers, which
are convolutional or fully connected layers with an activation
function applied after each layer, then followed by a series of
transformations that map the output of the neural layers to a
feasible solution.
We first deal with first-stage constraints that must be sat-
isfied by φ0. These constraints, as given in (3b) or (6b)-
(6e), describe axis-aligned rectangular regions and are easy
to satisfy. We will then deal with the second-stage constraints
that φRmust satisfy. To be specific, φRis learning the optimal
value of the second-stage DCOPF problem and must satisfy
all the constraints in the optimization problem; otherwise, the
estimated second-stage cost may have a large deviation from
the true value and mislead the training of φ0. In turn, if the
first-stage decisions are poorly made, there may be no feasible
second-stage decisions when the uncertainties are realized.
The constraints in the second-stage problem describe a high-
dimensional polyhedral set that is dependent on the input data;
thus, guaranteeing feasibility requires some more nontrivial
techniques.
vi
Fig. 2: In the RLD problem, non-negative orthant constraints can
be enforced using ReLU activation in the last neural layer. For the
reserve scheduling problem, the Tanh activation is used at the last
neural layer and then the hypercubic output is passed through the
transformation layers in (12) to obtain a feasible solution.
A. Design of the first-stage network: φ0
The network φ0in the RLD formulation must satisfy
the non-negative orthant constraints in (3b), which can be
guaranteed by using a ReLU activation after the last neural
layer, and no additional transformation is needed.2For the
reserve scheduling problem, we can rewrite the constraints
in (6b)-(6e) in a more compact way as xP rs
x,xs, where
s
x rpmaxT,ppmax ´p0qT,p0TsTand x r0T,0T,0TsT.
In this way, the constraints in (6b)-(6e) can be treated as axis-
aligned rectangular constraints.
To enforce such axis-aligned rectangular constraints, we use
a Tanh activation on the last neural layer before the output and
denote the output as u. The tanh function has a range between
´1and 1, and we have uPB8, where B8is the unit ball with
`8norm given by B8tzPRn| ´ 1ďziď1,@iu. Next,
we apply the following scaling and translating operations to
transform uto a feasible solution that satisfies (6b)-(6e):
xi1
2pui`1qp¯xi´xiq ` xi,@i. (12)
We provide a diagram in Fig. 2 to illustrate the network
architecture of φ0for each of the problems in (3) and (6).
B. Network Design of φR
The network architecture design for φRis not as straight-
forward as for φ0because the constraints in (8b)-(8c) can
not be enforced by simply scaling and translating the neural
layers’ outputs. Indeed, (8b)-(8c) delineate a high-dimensional
polyhedral set in terms of θ. To see this, we can use the power
flow equations in (8b) to express the recourse variables pRas
an affine function of θ. The feasibility of θcan be expressed
as the following polyhedral set Θ:
θPΘtr
Fθďr
fu(13)
where r
F rFT,´FTsTPR2MˆNand r
f
rfmaxT,fmax TsTPR2M.Next, we describe the architecture
2The ReLU activation function is maxpx, 0q.
design of φRto transform the output of neural layers to a
point within Θ.
Concretely, we again use a Tanh activation function on the
last neural layer and denote the output from it by u, which
satisfies uPB8as we have discussed. Then we utilize
the gauge map technique [29] to fulfill the transformation.
Particularly, the gauge map can establish the equivalence
between two C-sets using the gauge functions associated with
them. We give the definitions of C-sets and gauge functions
below, and we will also show that both B8and Θare C-sets.
Definition 1 (C-set [46]).A C-set is a convex and compact
subset of Rnincluding the origin as an interior point.
By Definition 1, the unit hypercube B8is a C-set. To show
that the polyhedral set Θalso satisfies Definition 1, we first
note that the origin is an interior point of Θ. Regarding the
compactness of Θ, we provide the following theorem.
Theorem 4.1. The polyhedral set Θgiven by (13) is bounded.
The proof of Theorem 4.1 is given in Appendix B. Together,
we can conclude that Θis also a C-set. Before describing the
gauge transformation between B8and Θ, we first introduce
the concept of the gauge function associated with a C-set.
Definition 2 (Gauge function [46]).The gauge function as-
sociated with a C-set Pis a mapping given by gP:RnÞÝÑ
r0,`8s, given by
gPpzq mintλ:zPλP, λ ě0,zPRnu.
Proposition 1. If C-set Pis a polyhedral set of the form
P tzPRn|Az ďb,APRmˆn,bPRnu,
then the gauge function associated with it is
gPpzq max
i1,¨¨¨ ,m aT
iz
bi(,
where aiis the i-th row of Aand biis the i-th element of b.
The proof of Proposition 1 is provided in Appendix C.
By using the gauge function defined in Definition 2, we can
express the gauge map as follows.
Definition 3 (gauge map [29]).The gauge map between any
two C-sets Pand Qis a bijection G:PÞÝÑ Qgiven by
Gpz|P,Qq gPpzq
gQpzqz.
From this definition, the gauge map between B8and Θcan
be expressed as
Gpu|B8,Θq }u}8
gΘpuqu,(14)
where }u}8is the gauge of uwith respect to B8, namely,
gB8puq“}u}8, which directly follows from Proposition 1.
Note that gΘpuqcan also be calculated using Proposition 1
since Θis a polyhedral C-set.
vii
Fig. 3: An illustrative example of the gauge map from B8to a
polyhedral C-set Q. The 1,3
4,1
2and 1
5level curves of each set are
plotted in blue. For each point in B8, it is transformed to its image
(marked using the same color) in Qwith the same level curve.
Using (14), for every point in B8, we are able to find its
one-to-one correspondence (image) in Θ. To better see how
the gauge map works, we provide an illustrative example in
Fig. 3 to transform a point from B8to its image in a randomly
generated polyhedral C-set.
Once a feasible solution of θis obtained, the values for
for pRand the output of φR, i.e., the objective value of the
deterministic DCOPF in (8), can be be easily computed. We
summarize the network design of φRin Fig. 4.
Lastly, we discuss the differentiability properties of the
function in (14) since training the network architecture in
Fig. 1 requires a backward pass that can calculate the gradients
in (10). This is a nuanced point since both (14) and the layers
used in neural networks are not everywhere differentiable.
Here, we show that the non-differentiability introduced by the
gauge map is no more severe than the non-differentiability that
is already present in the neural network activation functions,
and the end-to-end policy is differentiable almost everywhere:
Theorem 4.2. Let Pand Qbe polyhedral C-sets. Standard
automatic differentiation procedures, when applied to the
gauge map G | P,Qq, will return the gradient of G | P,Qq
for almost all zPP.
Proof. The set Pcan be partitioned such that the gauge map
is a different analytic function on each region of the partition
(excluding the origin). By setting Gp0|P,Qq:0, we
obtain a function for which standard automatic differentiation
procedures will compute the gradient of G | P,Qqat all
zPPexcept possibly on a set of measure zero [47]. Details
are in Appendix E.
Theorem 4.2 shows that the gauge map is differentiable with
respect to the output of the neural layers, and hence enables
the computation of backpropagation gradients in (10) and the
training of the architecture in Fig. 1. The effectiveness of the
proposed learning architecture is validated on a modified IEEE
118-bus system as shown in the next section.
V. EX PE RI ME NTAL RESULTS
In this section, we provide the experimental results of using
the proposed algorithm in Table I to solve two-stage DCOPF
problems. Particularly, we consider two application contexts,
Fig. 4: The hypercubic output from the neural layers is transformed
to a feasible solution for θby the gauge map. Then the value of the
objective function can be easily computed.
namely, the risk-limiting dispatch and reserve scheduling prob-
lems on the IEEE 118-bus system (the detailed configuration
of the system can be found in [48]), and use our algorithm
to learn the first-stage solutions to the scenario-based prob-
lems in (3) and (6), respectively. We implement our learning
algorithm in Google Colab [49] using Pytorch and all codes
and data of our experiments are available at https://github.com/
ling-zhang-linnet/two-stage-dcopf-neural-solver.git.
Network architecture: We use a 4-layer convolutional
neural network (two convolutional layers followed by two fully
connected layers) for both φ0and φRin all experiments. A
dropout layer with the rate of 0.5is used on each of the fully
connected layers before the output. The network architectures
are trained offline using Adam Optimizer [50] and the default
learning rate is adopted. The size of hidden layer is tuned for
each application context and the details can be found in our
public code repository.
Data generation: There are two types of data in our algo-
rithm. The first type is the load forecasts. They are inputs to the
learning algorithm and comprise the datasets on which we train
and test the network architecture. In both application contexts,
the training dataset consist of 50000 load forecasts and testing
dataset of 100. The second type of data is the load realizations
that are used to solve the scenario-based problems (estimate
the expected second-stage cost) or to evaluate the solution
quality through ex-post out-of-sample simulations [25]. In our
algorithm, 20 load realizations are sampled independently at
each iteration to provide an estimate of the expected second-
stage cost during training, and 500 are used to evaluate the
solution quality via out-of-sample simulations.
Both types of data are generated using the Gaussian dis-
tribution but with different choices of the mean and standard
deviation. When generating load forecasts, we use the nominal
load of the system as the mean and set the standard deviation
to be 10% of it. The load realizations are generated specific to
each instance of load forecasts, that is, we use the forecast as
the mean and set the standard deviation as 5% of it to generate
samples of realized load for each instance.
Baseline solvers: In both application contexts, we apply
CVXPY solver [40] to solve the scenario-based problems in
(3) and (6) on the same testing dataset as used in our method to
viii
provide a benchmark. We also compare the solutions produced
by our method to that by solving (3) and (6) approximately
using the affine policy method, which is a widely applied ap-
proximation policy to make the two-stage stochastic programs
tractable [51]. The details on the affine policies used in each
application are given in Appendix D.
Evaluation procedure: To compare the performance of
different methods, we first use them to obtain their respective
first-stage solutions for each instance in the testing dataset, and
then we use the commonly adopted out-of-sample simulations
to evaluate the solution quality. To do this, for each method
and each test instance, we fix the value of the obtained first-
stage solutions (and hence the first-stage cost), and solve the
deterministic DCOPF problem in (8) 500 times using the same
set of load realizations. By summing up the average cost of
these 500 DCOPF problems and the fixed first-stage cost, we
obtain the out-of-sample value of the total cost.
We calculate the out-of-sample values of the total cost for
all test instances and use the average value as a metric to
measure the method’s performance across different instances.
We also report the average solving time of each method to
obtain the first-stage solutions to show the trade-off between
the solution quality and computational tractability.
A. Application I: Risk-Limiting Dispatch
The results of using different methods to solve the risk-
limiting dispatch problem in (3) on the 118-bus system are
provided in Table II. The average total costs of different
methods are represented as the ratio compared to the average
total cost obtained by applying CVXPY solver. From Table II,
we can see that our learning method is faster than applying
CVXPY solver by 4 orders of manitude while the difference
in average total cost is less than 0.8%. In comparison, using
the affine policy reduces the average running time by half,
however, it also performs 50% worse. This is because the
affine policy has bad generalization when applied to never-
seen instances of load forecasts.
Application I: Risk-limiting dispatch on 118-bus system
Methods Total cost Solving Time
(average, %) (average, minutes)
CVXPY 100 0.395
Proposed 100.767 10´5
Affine policy 199.413 0.199
TABLE II: Comparison of the expected total cost and solving time
averaged out over 100 test instances for using different methods to
solve the risk-limiting dispatch problem in (3) on the 118-bus system.
B. Application II: Reserve Scheduling
We summarize the results of using different methods to
solve the reserve scheduling problem in (6) on the 118-bus
system in Table III. All reported total costs are expressed
as the ratio to the average total cost achieved by applying
the CVXPY solver. Compared to the risk-limiting dispatch
problem, the reserve scheduling problem has more decision
variables and constraints and thus is more complicated. It takes
minutes for CVXPY solver to solve single instance. By using
an affine policy for the recourse dispatch, the average running
time per instance can be reduced by an order of magnitude, but
the average total cost also increases by an order of magnitude
due to poor generalization. In particular, the solutions found
by the affine policy method can become infeasible, therefore
incurring very high penalties. In contrast, our learning method
not only learns to provide good solution quality (within 10%
of the benchmark produced by CVXPY solver) but is also able
to speed up the computation by 4 orders of magnitude.
Application II: Reserve scheduling on 118-bus system
Methods Total cost Solving Time
(average, %) (average, minutes)
CVXPY 100 3.210
Proposed 110 10´4
Affine policy 1813 0.343
TABLE III: Comparison of the expected total cost and solving time
averaged out over 100 test instances for using different methods to
solve the reserve scheduling problem in (6) on the 118-bus system.
VI. CONCLUSIONS AND FU TU RE WORK
This paper presents a learning algorithm to solve two-
stage DCOPF problems efficiently. The algorithm use two
neural networks, one for each stages, to make the dispatch
decisions. The gauge map technique is built into the network
architecture design so that the constraints in two-stage DCOPF
problems can be satisfied explicitly for all load realizations.
Our numerical results on the IEEE 118-bus system validate
the effectiveness of our algorithm, showing that it can speed
up computation by orders of magnitude compared to the
commercial solver while still learning high-quality solutions.
A direction of future work is to generalize our learning
algorithm to solve non-convex programs, for example, using
the AC optimal power flow problem.
REFERENCES
[1] H. W. Dommel and W. F. Tinney, “Optimal power flow solutions, IEEE
Transactions on power apparatus and systems, no. 10, pp. 1866–1876,
1968.
[2] R. Baldick, Applied optimization: formulation and algorithms for engi-
neering systems. Cambridge University Press, 2006.
[3] J. D. Glover, T. J. Overbye, and M. S. Sarma, Power System Analysis
and Design. CENGAGE Learning, 2017.
[4] D. Bienstock, M. Chertkov, and S. Harnett, “Chance-constrained
optimal power flow: Risk-aware network control under uncertainty,”
SIAM Review, vol. 56, no. 3, pp. 461–495, 2014. [Online]. Available:
https://doi.org/10.1137/130910312
[5] P. P. Varaiya, F. F. Wu, and J. W. Bialek, “Smart operation of smart
grid: Risk-limiting dispatch,” Proceedings of the IEEE, vol. 99, no. 1,
pp. 40–57, 2011.
[6] R. Rajagopal, S. Univ, E. Bitar, P. Varaiya, F. Wu, and U. Berkeley,
“Risk-limiting dispatch for integrating renewable power,” International
Journal of Electrical Power and Energy Systems, vol. 44, 10 2011.
[7] B. Zhang, R. Rajagopal, and D. Tse, “Network risk limiting dispatch:
Optimal control and price of uncertainty, IEEE Transactions on Auto-
matic Control, vol. 59, no. 9, pp. 2442–2456, 2014.
[8] B. Stott, J. Jardim, and O. Alsac¸ , “Dc power flow revisited, IEEE
Transactions on Power Systems, vol. 24, no. 3, pp. 1290–1300, 2009.
[9] E. Sj¨
odin, D. F. Gayme, and U. Topcu, “Risk-mitigated optimal power
flow for wind powered grids, in 2012 American Control Conference
(ACC). IEEE, 2012, pp. 4431–4437.
ix
[10] L. Roald, S. Misra, T. Krause, and G. Andersson, “Corrective control to
handle forecast uncertainty: A chance constrained optimal power flow,”
IEEE Transactions on Power Systems, vol. 32, no. 2, pp. 1626–1637,
2016.
[11] J. Birge, “State-of-the-art-survey—stochastic programming: Computa-
tion and applications,” INFORMS Journal on Computing, vol. 9, pp.
111–133, 05 1997.
[12] A. Shapiro, Stochastic programming by Monte Carlo simula-
tion methods. Humboldt-Universit¨
at zu Berlin, Mathematisch-
Naturwissenschaftliche Fakult¨
at, 2000.
[13] A. Shapiro, D. Dentcheva, and A. Ruszczy´
nski, Lectures on Stochastic
Programming. Society for Industrial and Applied Mathematics,
2009. [Online]. Available: https://epubs.siam.org/doi/abs/10.1137/1.
9780898718751
[14] J. R. Birge and F. Louveaux, Introduction to Stochastic Programming,
2nd ed. Springer Publishing Company, Incorporated, 2011.
[15] J. Linderoth, A. Shapiro, and S. Wright, “The empirical behavior of
sampling methods for stochastic programming,” Annals of Operations
Research, vol. 142, pp. 215 –, 02 2006.
[16] T. H. de Mello and G. Bayraksan, “Monte carlo sampling-based
methods for stochastic optimization,” Surveys in Operations Research
and Management Science, vol. 19, no. 1, pp. 56–85, 2014.
[Online]. Available: https://www.sciencedirect.com/science/article/pii/
S1876735414000038
[17] S. Kim, R. Pasupathy, and S. G. Henderson, A guide to sample average
approximation,” Handbook of simulation optimization, pp. 207–243,
2015.
[18] Y. Chen, Y. Wang, D. Kirschen, and B. Zhang, “Model-free renewable
scenario generation using generative adversarial networks, IEEE Trans-
actions on Power Systems, vol. 33, no. 3, pp. 3265–3275, 2018.
[19] X. Pan, T. Zhao, and M. Chen, “Deepopf: Deep neural network for
dc optimal power flow,” in 2019 IEEE International Conference on
Communications, Control, and Computing Technologies for Smart Grids
(SmartGridComm). IEEE, 2019, pp. 1–6.
[20] F. Fioretto, “Integrating machine learning and optimization to boost
decision making,” in In Proceedings of the International Joint
Conference on Artificial Intelligence (IJCAI), 2022, pp. 5808–5812.
[Online]. Available: https://doi.org/10.24963/ijcai.2022/815
[21] F. Capitanescu, J. M. Ramos, P. Panciatici, D. Kirschen, A. M. Mar-
colini, L. Platbrood, and L. Wehenkel, “State-of-the-art, challenges, and
future trends in security constrained optimal power flow,” Electric power
systems research, vol. 81, no. 8, pp. 1731–1741, 2011.
[22] L. Zhang, Y. Chen, and B. Zhang, “A convex neural network solver for
dcopf with generalization guarantees,” IEEE Transactions on Control of
Network Systems, vol. 9, pp. 719–730, 2020.
[23] D. Kuhn, W. Wiesemann, and A. Georghiou, “Primal and dual linear
decision rules in stochastic and robust optimization,” Mathematical
Programming, vol. 130, pp. 177–209, 2011.
[24] M. Vrakopoulou, K. Margellos, J. Lygeros, and G. Andersson, “Prob-
abilistic guarantees for the n-1 security of systems with wind power
generation,” Reliability and risk evaluation of wind integrated power
systems, pp. 59–73, 2013.
[25] L. A. Roald, D. Pozo, A. Papavasiliou, D. K. Molzahn, J. Kazempour,
and A. Conejo, “Power systems optimization under uncertainty:
A review of methods and applications, Electric Power Systems
Research, vol. 214, p. 108725, 2023. [Online]. Available: https:
//www.sciencedirect.com/science/article/pii/S0378779622007842
[26] Y. Zhang, S. Shen, and J. L. Mathieu, “Distributionally robust chance-
constrained optimal power flow with uncertain renewables and uncertain
reserves provided by loads, IEEE Transactions on Power Systems,
vol. 32, no. 2, pp. 1378–1388, 2017.
[27] M. Vrakopoulou and I. A. Hiskens, “Optimal control policies for reserve
deployment with probabilistic performance guarantees,” in 2017 IEEE
56th Annual Conference on Decision and Control (CDC), 2017, pp.
4470–4475.
[28] R. Kannan, J. R. Luedtke, and L. A. Roald, “Stochastic dc optimal
power flow with reserve saturation, 2019. [Online]. Available:
https://arxiv.org/abs/1910.04667
[29] D. Tabas and B. Zhang, “Computationally efficient safe reinforcement
learning for power systems, 2022 American Control Conference (ACC),
pp. 3303–3310, 2021.
[30] ——, “Safe and efficient model predictive control using neural networks:
An interior point approach,” in 2022 IEEE 61st Conference on Decision
and Control (CDC), 2022, pp. 1142–1147.
[31] T. Hong and S. Fan, “Probabilistic electric load forecasting: A tutorial
review,” International Journal of Forecasting, vol. 32, no. 3, pp. 914—
-938, 2016.
[32] A. Khoshrou and E. J. Pauwels, “Short-term scenario-based probabilistic
load forecasting: A data-driven approach, Applied Energy, 2019.
[33] Y. Gu, Q. Chen, K. Liu, L. Xie, and C. Kang, “Gan-based model for
residential load generation considering typical consumption patterns,” in
Conference on Innovative Smart Grid Technologies, 11 2018.
[34] J. Xie and T. Hong, “Temperature scenario generation for probabilistic
load forecasting,” IEEE Transactions on Smart Grid, vol. 9, no. 3, pp.
1680–1687, 2018.
[35] L. Zhang and B. Zhang, “Scenario forecasting of residential load
profiles,” 2019. [Online]. Available: https://arxiv.org/abs/1906.07373
[36] M. Garcia and R. Baldick, “Approximating economic dispatch by
linearizing transmission losses,” IEEE Transactions on Power Systems,
vol. 35, no. 2, pp. 1009–1022, 2019.
[37] R. Palma-Benhke, A. Philpott, A. Jofr´
e, and M. Cort´
es-Carmona, “Mod-
elling network constrained economic dispatch problems,” Optimization
and Engineering, vol. 14, pp. 417–430, 2013.
[38] J. Higle, “Stochastic programming: Optimization when uncertainty mat-
ters,” TutORials in operations research, 09 2005.
[39] A. Shapiro and A. Ruszczy´
nski, Eds., Stochastic Programming, ser.
Handbooks in Operations Research and Management Science. Elsevier,
2003, vol. 10.
[40] S. Diamond and S. Boyd, “CVXPY: A Python-embedded modeling lan-
guage for convex optimization, Journal of Machine Learning Research,
vol. 17, no. 83, pp. 1–5, 2016.
[41] A. Agrawal, R. Verschueren, S. Diamond, and S. Boyd, A rewriting
system for convex optimization problems, Journal of Control and
Decision, vol. 5, no. 1, pp. 42–60, 2018.
[42] E. Oki, “Glpk (gnu linear programming kit),” in Department for Applied
Informatics, Moscow Aviation Institute, 2012.
[43] A. Agarwal, S. M. Kakade, J. D. Lee, and G. Mahajan, “On the theory
of policy gradient methods: Optimality, approximation, and distribution
shift,” The Journal of Machine Learning Research, vol. 22, no. 1, pp.
4431–4506, 2021.
[44] A. Paszke et al., Automatic differentiation in pytorch,” in NIPS Work-
shop Autodiff, 2017.
[45] ——, “Pytorch: An imperative style, high-performance deep learning
library, in Advances in Neural Information Processing Systems. Curran
Associates, Inc., 2019, pp. 8024–8035.
[46] F. Blanchini and S. Miani, Set-Theoretic Methods in Control.
Birkh¨
auser Basel, 2007.
[47] W. Lee, H. Yu, X. Rival, and H. Yang, “On correctness of automatic
differentiation for non-differentiable functions, in Advances in Neural
Information Processing Systems, 2020.
[48] W. A. Bukhsh, A. Grothey, K. I. M. McKinnon, and P. A. Trodden,
“Local solutions of the optimal power flow problem, IEEE Transactions
on Power Systems, vol. 28, no. 4, pp. 4780–4788, 2013.
[49] Welcome to colaboratory. [Online]. Available: https://colab.research.
google.com/notebooks/intro.ipynb
[50] D. P. Kingma and J. Ba, “Adam: A method for stochastic optimization,
2014. [Online]. Available: https://arxiv.org/abs/1412.6980
[51] A. Ben-Tal, A. Goryashko, E. Guslitzer, and A. Nemirovski, Adjustable
robust solutions of uncertain linear programs1,” Mathematical Program-
ming, vol. 99, pp. 351–376, 01 2004.
APPENDIX
A. Expressions of Band F
Suppose we use Eto denote the set of all lines in the power
system and pi, jqthe line connecting bus-iand bus-j. Without
loss of generality, we can assume the line pi, jqis the m-th out
of all lines. Let bij be the susceptance for the line pi, jq, then
the flow on line pi, jqis fij bi,j pθi´θjq. The nodal power
injection by bus-iis piřk:pi,kqPEfik řk:pi,kqPEbi,j pθi´
θjq. As a result, the matrix Bthat transforms the phase angle
θPRN´1into the nodal power injections at all buses can be
expressed as
@i, j :Bij $
&
%
´bij ,if pi, jq P Eand ij
řk:pk,jqPEbkj ,if pi, j q P Eand ij
0,otherwise.
x
The matrix Fthat maps θto flows on all lines is given by
Fmi bij , Fmj ´bij ,
@mP t1,¨ ¨ ¨ , M u, i, j P t1,¨ ¨ ¨ , Nuand ij.
B. Proof of Theorem 4.1
To show that the polyhedron given by (13) is bounded,
we use the definition of a bounded polyhedra: a polyhedra
is bounded if DKą0such that }θ} ď K, for all θPΘ.
From Appendix A, we know that the flow on line pi, jqcan
be expressed as fij bi,jpθi´θjq; therefore, we can rewrite
the polyhedra in (13) as
´fmax
i,j ďbi,j pθi´θjq ď fmax
i,j ,@pi, jq P E,
which are equivalent to
´fmax
i,j
bi,j
ďθi´θjďfmax
i,j
bi,j
,@pi, jq P E,(15)
that is, both θiand θjmust be bounded, otherwise, (15) would
be violated. Since every bus in the system must be connected
to at least one other bus, (15) implies that DKiPR`such
that |θi| ď Ki,@iP t1,¨ ¨ ¨ , N u, therefore, we can choose
KmaxitKiuand we have }θ} ď K. By definition, the
polyhedra given by (13) is bounded.
C. Proof of Proposition 1
By Definition 2, we can express the gauge function as-
sociated with the polyhedral set P tzPRn|Az ď
b,APRmˆn,bPRnuas the optimization problem
gPpzq mintλ|Az ďλbu, which is equivalent to finding
a value of λsuch that aT
izďλbi,@iP t1,¨ ¨ ¨ , mu, that is,
λěaT
iz
bi,@iP t1,¨ ¨ ¨ , mu. Therefore, the optimal value of λ,
namely, the value of the gauge function gPpzq, can be given
by maxi1,¨¨¨ ,m aT
iz
bi(.
D. Formulation of Affine Policy
For both application contexts, we consider the affine policy
for the recourse dispatch pRpωkqof the following form:
pRpωkq ξp1Tdpωkq ´ 1Tp0q,(16)
where ξ rξ1,¨ ¨ ¨ , ξNsTPRNis the vector of participation
factors that represent each generator’s contribution to balance
the mismatch between the realized load and the first-stage
dispatch. Particularly, the participation factors satisfy the fol-
lowing constraints:
ξiě0,@iPG, ξi0,@iPN{G,ÿ
iPG
ξi1,(17)
where the set Grepresents all buses that house generators and
the set N{Grepresents all buses except for those connected
to generators.
The problem formulations that are used to determine the
distribution factors in each application context are given as
follows:
Risk-limiting dispatch:
min
p0,ξ
tpRpωkq,θpωkquK
k1
αTp0`1
K
K
ÿ
k1
βTrpRpωkqs`
s.t. (3b) ´(3d),(16),(17).
Reserve scheduling:
min
p0,p
r,q
r,ξ,
tpRpωkq,θpωkquK
k1
αTp0`µTpp
r`q
rq `
1
K
K
ÿ
k1˜γresT´rpRpωkq ´ p
rs`´ rpRpωkq ` q
rs´¯¸
s.t. (6b) ´(6g),(16),(17).
Note that the distribution factors do not depend on the
particular load realizations in the second stage. They are
decision variables that need to be determined in the first stage.
In our experiments, we use the nominal loads as the input
scenario forecast to compute distribution factors’ values. Once
the distribution factors are determined, we then replace the
recourse dispatch decision pRpωkqwith the affine policy in
(16) and make quick first-stage decisions for each test instance
by solving optimization problems that only involve first-stage
variables.
E. Proof of Theorem 4.2
Let P tzPRn|Az ďbuand Q tzPRn|
Cz ďduwith APRmˆn,bPRm
``,CPRkˆn, and
dPRk
``. Let Aij be the polytope described as tzPP|
iParg maxi1,¨¨¨ ,m
aT
iz
bi, j Parg maxj1,¨¨¨ ,k
cT
jz
dju. The set
tAij |iP1,¨ ¨ ¨ , m, j P1,¨ ¨ ¨ , kuforms a polyhedral
partition of P, and the gauge map is an analytic function on
the interior of each Aij except when cT
jz0or z0.
Specifically, the gauge map on the interior of Aij ĎPcan be
written as Gpz|P,Qq aT
iz{bi
cT
jz{djz.
For any jP1,¨ ¨ ¨ , k,cT
jz0if and only if z0: since
Qforms a full-dimensional and bounded polytope, Cmust be
full-rank and tall (kąn). Thus, Cz 0if and only if z0.
We can now justify the choice Gp0|P,Qq:0as follows.
Let zαhfor some αą0and hPRnzt0u.There exist some
pi, jqand sufficiently small εą0such that zPAij @αP
p0, εq.The limit of aT
iz{bi
cT
jz{djzas αÑ0is equal to 0PRn.
By the above analysis, the gauge map is piecewise analytic
under analytic partition (PAP) on Pwhich implies desirable
properties for automatic differentiation [47]. Specifically, PAP
functions can be composed with one another (they obey a
chain rule), they are differentiable almost everywhere (except
possibly on a set of measure zero), and standard automatic
differentiation tools will compute the derivatives at all points
where the function is differentiable.
ResearchGate has not been able to resolve any citations for this publication.
Article
Full-text available
Scenario-based probabilistic forecasting models have been explored extensively in the literature in recent years. The performance of such models evidently depends to a large extent on how different input (temperature) scenarios are being generated. This paper proposes a generic framework for probabilistic load forecasting using an ensemble of regression trees. A major distinction of the current work is in using matrices as an alternative representation for quasi-periodic time series data. The singular value decomposition (SVD) technique is then used herein to generate temperature scenarios in a robust and timely manner. The strength of our proposed method lies in its simplicity and robustness, in terms of the training window size, with no need for subsetting or thresholding to generate temperature scenarios. Furthermore, to systematically account for the non-linear interactions between different variables, a new set of features is defined: the first and second derivatives of the predictors. The empirical case studies performed on the data from the load forecasting track of the Global Energy Forecasting Competition 2014 (GEFCom2014-L) show that the proposed method outperforms the top two scenario-based models with a similar setup.
Conference Paper
Full-text available
With the fast development of the Energy Internet, collecting and analyzing loads from the residential sector has become more and more important. However, the large-scale and real-time collection of residential loads still remains a big challenge due to high cost, technical barriers, and privacy concerns. Previous researches proposed two approaches for generating residential load profiles: bottom-up and top-down. However, these approaches suffer from either high complexity or low accuracy. In this work, we propose a residential load profiles generation model based on the Generative Adversarial Network (GAN). The GAN includes two independent networks: the generator and the discriminator which are trained against each other until achieving balance. Then we can produce synthetic profiles with the trained generator. To capture underlying features in load profiles, We transform them into matrices and implement convolution layers in networks. Furthermore, considering residents have different typical load patterns, We propose an advanced GAN based on the Auxiliary Classifier GAN to generate profiles under typical modes. We use K-means clustering to acquire the pattern class of load profiles and train the model with the labeled data. Case studies on the dataset from an Irish smart meter trial show that the model can generate realistic load profiles under different load patterns without loss of diversity.
Article
Electric power systems and the companies and customers that interact with them are experiencing increasing levels of uncertainty due to factors such as renewable energy generation, market liberalization, and climate change. This raises the important question of how to make optimal decisions under uncertainty. This paper aims to provide an overview of existing methods for modeling and optimization of problems affected by uncertainty, targeted at researchers with a familiarity with power systems and optimization. We also review some important applications of optimization under uncertainty in power systems and provide an outlook to future directions of research.
Article
The DC optimal power flow (DCOPF) problem is a fundamental problem in power systems operations and planning. With high penetration of uncertain renewable resources in power systems, DCOPF needs to be solved repeatedly for a large amount of scenarios, which can be computationally challenging. As an alternative to iterative solvers, neural networks are often trained and used to solve DCOPF. These approaches can offer orders of magnitude reduction in computational time, but they cannot guarantee generalization, and small training error does not imply small testing errors. In this work, we propose a novel algorithm for solving DCOPF that guarantees the generalization performance. First, by utilizing the convexity of DCOPF problem, we train an input convex neural network. Second, we construct the training loss based on KKT optimality conditions. By combining these two techniques, the trained model has provable generalization properties, where small training error implies small testing errors. In experiments, our algorithm significant outperforms other machine learning methods.
Article
We propose an optimization framework for stochastic optimal power flow with uncertain loads and renewable generator capacity. Our model follows previous work in assuming that generator outputs respond to load imbalances according to an affine control policy, but introduces a model of saturation of generator reserves by assuming that when a generator’s target level hits its limit, it abandons the affine policy and produces at that limit. This is a particularly interesting feature in models where wind power plants, which have uncertain upper generation limits, are scheduled to provide reserves to balance load fluctuations. The resulting model is a nonsmooth nonconvex two-stage stochastic program, and we use a stochastic approximation method to find stationary solutions to a smooth approximation. Computational results on 6-bus and 118-bus test instances demonstrate that by considering the effects of saturation, our model can yield solutions with lower expected generation costs (at the same target line violation probability level) than those obtained from a model that enforces the affine policy to stay within generator limits with high probability.
Article
Load forecasting is an integral part of power system operations and planning. Due to rising penetrations of rooftop PV, electric vehicles and demand response programs, forecasting the load of individual and a small group of households is becoming increasingly important. Forecasting the load accurately, however, is considerably more difficult when only a few households are included. A way to mitigate this challenge is to provide a set of scenarios instead of one point forecast, so an operator or utility can consider the full range of behaviors. This paper proposes a novel scenario forecasting approach for residential load using flow-based conditional generative models. Compared to existing scenario forecasting methods, our approach can generate scenarios that are not only able to infer possible future realizations of residential load from the observed historical data but also realistic enough to cover a wide range of behaviors. Particularly, the flow-based models utilize a flow of reversible transformations to maximize the value of conditional density function of future load given the past observations. In order to better capture the complex temporal dependency of the forecasted future load, we extend the structure design for the reversible transformations in flow-based conditional generative models by strengthening the coupling between the output and the conditioning input. The simulation results show the flow-based designs outperform existing methods in scenario forecasting for residential load by providing both more accurate and more diverse scenarios.