This paper was converted on www.awesomepapers.org from LaTeX by an anonymous user.
Want to know more? Visit the Converter page.

Graph-Based Modeling and Decomposition of Energy Infrastructures

Sungho Shin    Carleton Coffrin    Kaarthik Sundar    Victor M. Zavala University of Wisconsin-Madison, Madison, WI 53706 USA
(e-mail: sungho.shin@wisc.edu; victor.zavala@wisc.edu).
Los Alamos National Laboratory, Los Alamos, NM 87545 USA
(e-mail: cjc@lanl.gov; kaarthik@lanl.gov)
Abstract

Nonlinear optimization problems are found at the heart of real-time operations of critical infrastructures. These problems are computationally challenging because they embed complex physical models that exhibit space-time dynamics. We propose modeling these problems as graph-structured optimization problems, and illustrate how their structure can be exploited at the modeling level (for parallelizing function/derivative computations) and at the solver level (for parallelizing linear algebra operations). Specifically, we present a restricted additive Schwarz scheme that enables flexible decomposition of complex graph structures within an interior-point algorithm. The proposed approach is implemented as a general-purpose nonlinear programming solver that we call MadNLP.jl; this Julia-based solver is interfaced to the graph-based modeling package Plasmo.jl. The efficiency of this framework is demonstrated via problems arising in transient gas network optimization and multi-period AC optimal power flow. We show that our framework accelerates the solution (compared to off-the-shelf tools) by over 300%; specifically, solution times are reduced from 72.36 sec to 23.84 sec for the gas problem and from 515.81 sec to 149.45 sec for the power flow problem.

keywords:
Nonlinear Optimization, Decomposition, Graphs, Energy Systems
thanks: We acknowledge support from the Grainger Wisconsin Distinguished Graduate Fellowship.

1 Introduction

Real-time operation of modern energy infrastructures requires solving large-scale nonlinear programs (NLPs). Application examples include transient gas network optimization (Sundar and Zlotnik, 2018) and multi-period optimal power flow problems (Geth et al., 2020; Kim and Anitescu, 2020). Achieving real-time solutions for these problems is challenging, as they embed complex physical models that require space-time discretization. NLPs arising in this context can easily reach millions of variables and constraints and defy the scope of off-the-shelf solvers. Specifically, scalability bottlenecks are often encountered at the modeling level (function and derivative computations) and at the solver level (computation of the search step).

Large-scale NLPs arising in energy infrastructures have the key characteristic that they exhibit sparse graphs structures; we refer to such problems as graph-structured optimization problems (Jalving et al., 2019; Shin et al., 2020b; Jalving et al., 2020). Graph-structured problems can be conveniently modeled using specialized modeling platforms such as Plasmo.jl (Jalving et al., 2019, 2020) and solved using structure-exploiting optimization solvers such as PIPS-NLP (Chiang et al., 2014)). Plasmo.jl is a graph-based modeling platform that enables the modular construction and analysis of highly complex models; this platform also leverages the algebraic modeling capabilities of JuMP.jl (Dunning et al., 2017) and facilitates access to infrastructure modeling tools such as GasModels.jl and PowerModels.jl (Bent et al., 2020; Coffrin et al., 2018).

Another key benefit of Plasmo.jl is that it can communicate model structures to solvers, and this facilitates the implementation of different decomposition strategies, notably the alternating direction method of multipliers (Boyd et al., 2011), overlapping Schwarz (Shin et al., 2020a), and parallel interior-point (IP) methods (Chiang et al., 2014; Rodriguez et al., 2020).

In this paper, we present a new and flexible decomposition framework for graph-structured optimization problems. Our framework uses a restricted additive Schwarz (RAS) decomposition scheme implemented within a filter line-search IP method (Wächter and Biegler, 2006). We present a Julia-based implementation of this approach, which we call MadNLP.jl (https://github.com/zavalab/MadNLP.jl). We use our framework to experiment with different decomposition strategies that exploit parallelism at the modeling and at the solver level. Specifically, we consider a scheme that parallelizes function and derivative computations by exploiting the modular structure of Plasmo.jl. We also consider a scheme that uses RAS (Cai and Sarkis, 1999) for parallelizing step computations. RAS has been widely used for the solution of large linear algebra systems arising from discretized partial differential equations (PDEs) (Balay et al., 2019), but we have recently shown that it can also be applied to solve general linear systems arising in graph-structured optimization (Shin et al., 2020b; Gerstner et al., 2016). Our computational results indicate that our framework can accelerate computations by up to 300% (compared to off-the-shelf tools).

The paper is organized as follows: In Section 2, we define the graph-structured problem of interest and discuss how its structure can be exploited at the modeling level. In Section 3, we discuss parallel decomposition schemes. In Section 4, we apply these schemes to transient gas network optimization and multi-period AC optimal power flow problems. Section 5 presents concluding remarks.

Refer to captionRefer to captionRefer to caption
Figure 1: Alternative graph representations of a transient gas network problem. Left: graph GG in which nodes represent times and the spatial (network) structure is embedded within each node. Right: graph G~\widetilde{G} in which each node represents a variable or a constraint. Middle: a slice of G~\widetilde{G} that corresponds to the structure contained in each node of GG.

2 Graph-Based Modeling

Optimization problems arising in energy infrastructures can be expressed as a graph-structured optimization problem of the form:

min{xi}iV\displaystyle\min_{\{x_{i}\}_{i\in{V}}}\; iVfi(xi)\displaystyle\sum_{i\in{V}}f_{i}(x_{i}) (1a)
s.t.\displaystyle\mathop{\text{s.t.}}\; ciI(xi)=0,iV,(λiI)\displaystyle c^{I}_{i}(x_{i})=0,\;i\in{V},\;(\lambda^{I}_{i}) (1b)
ciL({xj}jNG[i])=0,iV,(λiL)\displaystyle c^{L}_{i}(\{x_{j}\}_{j\in N_{G}[i]})=0,\;i\in{V},\;(\lambda^{L}_{i}) (1c)
xi0,iV(zi)\displaystyle x_{i}\geq 0,\;i\in{V}\;(z_{i}) (1d)

Here, the undirected graph G=(V,E){G}=({V},{E}) is an ordered pair of the nonempty, strictly ordered node set V{V} and the edge set E{{i,j}V:ij}{E}\subseteq\{\{i,j\}\subseteq{V}:i\neq j\}; NG[i]:={jV:{i,j}E}{i}N_{G}[i]:=\{j\in{V}:\{i,j\}\in{E}\}\cup\{i\} denotes the neighborhood of iVi\in{V} on G{G}. For each iVi\in{V}, xinix_{i}\in\mathbb{R}^{n_{i}} is the decision variable; fi()f_{i}(\cdot) is the objective function; ciI()c^{I}_{i}(\cdot) is the inner equality constraint function; ciL()c^{L}_{i}(\cdot) is the linking constraint function; λiImiI\lambda^{I}_{i}\in\mathbb{R}^{m^{I}_{i}} is the dual variable associated with (1b); λiLmiL\lambda^{L}_{i}\in\mathbb{R}^{m^{L}_{i}} is the dual variable associated with (1c); ziniz_{i}\in\mathbb{R}^{n_{i}} is the dual variable associated with (1d). General inequality constraints can be handled by introducing slack variables.

In the context of energy infrastructures, the graph G{G} may intuitively be used as an abstraction of the space-time structure of the problem. Specifically, each node iVi\in V is a component located at a particular spatial location and at a particular time point (e.g., a subset of buses, generators, storage facilities, and electric lines in power networks or a subset of junctions, compressors, and pipelines in gas networks). The link constraints (1c) may represent spatial connections (e.g., interconnecting electric lines in power networks or pipelines in gas networks) or temporal connections. Furthermore, we will show that the graph G{G} can also be used as a general abstraction in which each node iVi\in V represents an individual variable or constraint of the problem (the graph encodes the general sparsity structure of the problem). The ability to represent the same optimization problem in different forms provides flexibility to identify efficient decomposition strategies.

We define the short-hand notation for (1):

min𝒙\displaystyle\min_{\boldsymbol{x}}\; 𝒇(𝒙)\displaystyle\boldsymbol{f}(\boldsymbol{x}) (2a)
s.t.\displaystyle\mathop{\text{s.t.}}\; 𝒄(𝒙)=0(𝝀)\displaystyle\boldsymbol{c}(\boldsymbol{x})=0\quad(\boldsymbol{\lambda}) (2b)
𝒙0(𝒛),\displaystyle\boldsymbol{x}\geq 0\quad(\boldsymbol{z}), (2c)

where 𝒙:={xi}iV\boldsymbol{x}:=\{x_{i}\}_{i\in V}, 𝝀={[λiI;λiL]}iV\boldsymbol{\lambda}=\{[\lambda^{I}_{i};\lambda^{L}_{i}]\}_{i\in V}, 𝒇():=iVfi()\boldsymbol{f}(\cdot):=\sum_{i\in V}f_{i}(\cdot), 𝒄():={[ciI();ciL()]}iV\boldsymbol{c}(\cdot):=\{[c^{I}_{i}(\cdot);c^{L}_{i}(\cdot)]\}_{i\in V}, 𝒏=iVni\boldsymbol{n}=\sum_{i\in V}n_{i}, and 𝒎=iVmiI+miL\boldsymbol{m}=\sum_{i\in V}m^{I}_{i}+m^{L}_{i}. Here, nin_{i} and mim_{i} are the primal-dual variable dimensions, and {()i}iV\{(\cdot)_{i}\}_{i\in V} denotes the vector concatenation. We use boldface symbols to denote quantities associated with multiple nodes.

Each node iVi\in V may contain more than or less than one variable and constraint (ni,mi0n_{i},m_{i}\in\mathbb{Z}_{\geq 0}). Thus, the problem graph G=(V,E)G=(V,E) may be different from the primal-dual coupling graph G~=(V~,E~)\widetilde{G}=(\widetilde{V},\widetilde{E}), where V~:=[1,𝒏+𝒎]\widetilde{V}:=\mathbb{Z}_{[1,\boldsymbol{n}+\boldsymbol{m}]}, E~:={{i,j}:(𝒙,𝝀)(𝒙,𝝀)2(𝒙,𝝀,𝒛)[i,j]0}\widetilde{E}:=\{\{i,j\}:\nabla^{2}_{(\boldsymbol{x},\boldsymbol{\lambda})(\boldsymbol{x},\boldsymbol{\lambda})}\mathcal{L}(\boldsymbol{x},\boldsymbol{\lambda},\boldsymbol{z})[i,j]\neq 0\}. Here, ()\mathcal{L}(\cdot) is the Lagrangian of (2), and we use syntax [a,b]:={a,a+1,,b}\mathbb{Z}_{[a,b]}:=\{a,a+1,\cdots,b\}. We can observe that a node ii in VV corresponds to a set of nodes Ui[1,𝒏+𝒎]U_{i}\subseteq\mathbb{Z}_{[1,\boldsymbol{n}+\boldsymbol{m}]} in V~\widetilde{V}, which contains multiple variables and constraints. Example graphs GG and G~\widetilde{G} for a transient gas network problem are depicted in Figure 1 (a detailed problem formulation can be found in Section 4.1). Graph GG contains 24 nodes, each corresponding to a time point in a prediction horizon. Periodicity (over a 24 hours period) is enforced as constraints (this periodicity creates the cycle shape of GG). In this graph, each node embeds the spatial structure of the problem (network and pipelines). Graph G~\widetilde{G} unfolds the temporal and spatial structure and shows the interconnectivity between all variables and constraints in the problem.

3 Graph-Based Decomposition

We proceed to describe our IP solver MadNLP.jl, comprising a new Schwarz decomposition scheme that exploits graph structures within an IP method, and we describe its interface to Plasmo.jl.

3.1 Interior-Point Method

The IP method implemented in MadNLP.jl finds the solution of (2) by solving a sequence of barrier subproblems:

min\displaystyle\min\; φ(𝒙):=𝒇(𝒙)μ𝐞Tlog(𝒙)s.t.𝒄(𝒙)=0.\displaystyle\varphi(\boldsymbol{x}):=\boldsymbol{f}(\boldsymbol{x})-\mu\,\mathbf{e}^{T}\log(\boldsymbol{x})\quad\mathop{\text{s.t.}}\;\boldsymbol{c}(\boldsymbol{x})=0. (3)

with a decreasing sequence for parameter μ\mu. The KKT conditions for (3) give the nonlinear equations:

𝒇(𝒙)+A𝝀𝒛=0;𝒄(𝒙)=0;𝑿𝒁𝐞μ𝐞=0,\displaystyle\nabla\boldsymbol{f}(\boldsymbol{x})+A^{\top}\boldsymbol{\lambda}-\boldsymbol{z}=0;\;\boldsymbol{c}(\boldsymbol{x})=0;\;\boldsymbol{X}\boldsymbol{Z}\mathbf{e}-\mu\,\mathbf{e}=0, (4)

where A:=𝒄(𝒙)A:=\nabla\boldsymbol{c}(\boldsymbol{x}), 𝑿:=diag(𝒙)\boldsymbol{X}:=\mathop{\text{diag}}(\boldsymbol{x}), and 𝒁:=diag(𝒛)\boldsymbol{Z}:=\mathop{\text{diag}}(\boldsymbol{z}). A solution of KKT system (4) is obtained by computing primal-dual Newton steps 𝒅\boldsymbol{d}^{*} from:

[W+Σ+δwIAAδcI]𝑴[dxdλ]𝒅=[𝒙φ(𝒙)+A𝝀𝒄(𝒙).]𝒑,\displaystyle\underbrace{\begin{bmatrix}W+\Sigma+\delta_{w}I&A^{\top}\\ A&-\delta_{c}I\end{bmatrix}}_{\boldsymbol{M}}\underbrace{\begin{bmatrix}d^{x}\\ d^{\lambda}\end{bmatrix}}_{\boldsymbol{d}}=-\underbrace{\begin{bmatrix}\nabla_{\boldsymbol{x}}\varphi(\boldsymbol{x})+A^{\top}\boldsymbol{\lambda}\\ \boldsymbol{c}(\boldsymbol{x}).\end{bmatrix}}_{\boldsymbol{p}}, (5)

where W:=𝒙𝒙2(𝒙,𝝀,𝒛)W:=\nabla^{2}_{\boldsymbol{x}\boldsymbol{x}}\mathcal{L}(\boldsymbol{x},\boldsymbol{\lambda},\boldsymbol{z}), Σ:=𝑿1𝒁\Sigma:=\boldsymbol{X}^{-1}\boldsymbol{Z}, and δw,δc>0\delta_{w},\delta_{c}>0 are regularization parameters. The step 𝒅\boldsymbol{d}^{*} computed from (5) is safeguarded by a line-search filter procedure to induce global convergence (Wächter and Biegler, 2006). Typically, the solution of the linear system (5) is the most computationally intensive step in the IP method. This system is typically solved using direct linear solvers that are based on LDLLDL^{\top} factorizations (e.g., as those implemented in HSL routines (HSL, 2007)). Decomposition strategies based on Schur complements (Chiang et al., 2014) and iterative strategies (Curtis et al., 2012; Rodriguez et al., 2020) have also been proposed. The solution of (5) based on a direct block LDLLDL^{\top} factorization reveals the inertia (the number of positive, zero, negative eigenvalues) of 𝑴\boldsymbol{M}. This inertia information is crucial in determining the acceptability of the computed step and in triggering the regularization of the linear system. However, inertia is not available when using iterative solution algorithms (as that proposed in this work). In MadNLP.jl, we use an inertia-free regularization strategy to determine the acceptability of the step (Chiang and Zavala, 2016). This method performs a simple negative curvature test to trigger regularization.

3.2 Restricted Additive Schwarz (RAS)

We propose a solution strategy for (5) based on an RAS scheme. We define some concepts and quantities that help explain our algorithm. Consider a partition {Vk}k=1K\{V_{k}\}_{k=1}^{K} of VV; we call VkV_{k} non-overlapping subdomains. This partition can be obtained by applying a graph partitioning scheme to GG. We then construct a family of overlapping subdomains {Vkω}k=1K\{V_{k}^{\omega}\}_{k=1}^{K} (these are constructed by expanding VkV_{k}). The expansion procedure is performed by progressively incorporating adjacent nodes (Shin et al., 2020b) (the size of overlap ω\omega represents the expansion level). We observe that:

VkVkωV,k=1,,K;k=1KVk=k=1KVkω=V,\displaystyle V_{k}\subseteq V^{\omega}_{k}\subseteq V,\;k=1,\cdots,K;\quad\bigsqcup_{k=1}^{K}V_{k}=\bigcup_{k=1}^{K}V^{\omega}_{k}=V,

where \sqcup denotes disjoint union. With {Vk}k=1K\{V_{k}\}_{k=1}^{K} and {Vkω}k=1K\{V^{\omega}_{k}\}_{k=1}^{K}, we define the corresponding index sets in the space of primal-dual variables in 𝒏+𝒎\mathbb{R}^{\boldsymbol{n}+\boldsymbol{m}} as follows:

Wk:=iVkUi;Wkω:=iVkωUi,k=1,,K,\displaystyle W_{k}:=\bigsqcup_{i\in V_{k}}U_{i};\quad W^{\omega}_{k}:=\bigsqcup_{i\in V^{\omega}_{k}}U_{i},\;k=1,\cdots,K,

where UiW:=[1,𝒏+𝒎]U_{i}\subseteq W:=\mathbb{Z}_{[1,\boldsymbol{n}+\boldsymbol{m}]} is the index set of [xi;λi][x_{i};\lambda_{i}] in [𝒙;𝝀][\boldsymbol{x};\boldsymbol{\lambda}]. We now observe that:

WkWkωW,k=1,,K;k=1KWk=k=1KWkω=W.\displaystyle W_{k}\subseteq W^{\omega}_{k}\subseteq W,\;k=1,\cdots,K;\;\quad\bigsqcup_{k=1}^{K}W_{k}=\bigcup_{k=1}^{K}W^{\omega}_{k}=W.

We state the RAS scheme for solving (5) as:

𝒅(+1)=𝒅()+(k=1KR~k𝑴k1RkP1)𝒓(),=0,1,.\displaystyle\boldsymbol{d}^{(\ell+1)}=\boldsymbol{d}^{(\ell)}+\Big{(}\underbrace{\sum_{k=1}^{K}\widetilde{R}_{k}\boldsymbol{M}^{-1}_{k}R_{k}^{\top}}_{P^{-1}}\Big{)}\boldsymbol{r}^{(\ell)},\;\ell=0,1,\cdots. (6)

Here, \ell is the RAS iteration counter, 𝒓():=𝒑𝑴𝒅()\boldsymbol{r}^{(\ell)}:=\boldsymbol{p}-\boldsymbol{M}\boldsymbol{d}^{(\ell)} is the residual; 𝑴k:=𝑴[Wkω,Wkω]\boldsymbol{M}_{k}:=\boldsymbol{M}[W^{\omega}_{k},W^{\omega}_{k}]; Rk:={ei}iWkR_{k}:=\{e^{\top}_{i}\}^{\top}_{i\in W_{k}}; R~k:={(e~ik)}iWk\widetilde{R}_{k}:=\{(\widetilde{e}^{k}_{i})^{\top}\}^{\top}_{i\in W_{k}}, where eie_{i} is the ii-th standard basis of 𝒏+𝒎\mathbb{R}^{\boldsymbol{n}+\boldsymbol{m}}, and e~ik=ei\widetilde{e}^{k}_{i}=e_{i} if iWki\in W_{k} and 0 otherwise.

The RAS scheme (6) involves the following steps. We first obtain the residual at the current step \ell; then, for each overlapping subdomains {Vkω}k=1K\{V^{\omega}_{k}\}_{k=1}^{K}, the associated residual is extracted as Rk𝒓()R^{\top}_{k}\boldsymbol{r}^{(\ell)}. The kk-th subsystem is then solved by applying 𝑴k1\boldsymbol{M}^{-1}_{k}. In MadNLP.jl, a factorization of 𝑴k\boldsymbol{M}_{k} is computed with a direct solver and stored, so that the system can be repeatedly solved whenever the new right-hand-side is given. Subsequently, the solution 𝑴k1Rk𝒓()\boldsymbol{M}^{-1}_{k}R^{\top}_{k}\boldsymbol{r}^{(\ell)} for the kk-th overlapping subdomain is restricted to the non-overlapping subdomain VkV_{k} and then mapped back to the full-space by applying R~kω\widetilde{R}^{\omega}_{k} (the indices associated with VVkV\setminus V_{k} are set to zero in this step). Key defining features of RAS are the concepts of overlap and restriction. The overlap allows the dampening of the adverse effect of the truncated domain, and the restriction procedure discards the part of the solution where the adverse truncation effect is strong.

It has been empirically observed that the convergence of the RAS algorithm improves as the size of overlap ω\omega increases and as the conditioning of 𝑴\boldsymbol{M} improves (Cai and Saad, 1996). For positive definite 𝑴\boldsymbol{M}, an exponential relationship between the convergence rate and the size of overlap has been established (Shin et al., 2020b). When ω=0\omega=0, the RAS scheme reduces to a block-Jacobi scheme (decentralized) while, when ω\omega is maximal (𝑴k=𝑴\boldsymbol{M}_{k}=\boldsymbol{M}), the RAS scheme becomes a direct solution method (centralized). In this sense, RAS provides a bridge between fully decentralized and fully centralized schemes (thus providing flexibility). In the Schwarz submodule of 𝙼𝚊𝚍𝙽𝙻𝙿.𝚓𝚕{\tt MadNLP.jl}, ω\omega is set automatically based on the relative size of VkV_{k}, and adaptively adjusted whenever a convergence issue occurs. Algorithm (6) uses a simple static iteration (also called a Richardson iteration), but more sophisticated iterative methods (e.g., the generalized mean residual (GMRES) method) can also be used (by treating PP as a preconditioner). Both Richardson and GMRES iterators are implemented in MadNLP.jl.

The construction of partitions for the RAS scheme is illustrated in Figure 2; these partitions correspond to the transient gas network example of Figure 1. Here, by partitioning the problem graph G=(V,E)G=(V,E) (first subfigure), the node set VV is divided into 4 subdomains V1,V2,V3,V4V_{1},V_{2},V_{3},V_{4} (second subfigure). These subdomains are associated with the primal-dual index sets W1,W2,W3,W4W_{1},W_{2},W_{3},W_{4} (third subfigure). After applying expansions, the associated blocks 𝑴1,𝑴2,𝑴3,𝑴4\boldsymbol{M}_{1},\boldsymbol{M}_{2},\boldsymbol{M}_{3},\boldsymbol{M}_{4} of 𝑴\boldsymbol{M} are identified (last subfigure); these blocks are used by the RAS scheme (6).

Refer to captionG=(V,E)G=(V,E)Refer to captionV1V_{1}V2V_{2}V3V_{3}V4V_{4}Refer to captionW1W_{1}W2W_{2}W3W_{3}W4W_{4}𝑴1\boldsymbol{M}_{1}𝑴2\boldsymbol{M}_{2}𝑴3\boldsymbol{M}_{3}𝑴4\boldsymbol{M}_{4}
Figure 2: Graph-based decomposition in MadNLP.jl applied to a transient gas network problem.

3.3 Implementation in MadNLP.jl

The abstraction layers within MadNLP.jl are shown in Figure 3. The problem is modeled as an OptiGraph object (the core modeling object of Plasmo.jl). The OptiGraph is interfaced with multiple JuMP.jl models. The JuMP.jl model objects provide a set of local function oracles (objective, objective gradient, constraint, constraint Jacobian, and Lagrangian hessian). The Plasmo.jl-MadNLP.jl interface collects these local function oracles and creates a set of oracles for the full problem, where the local oracles are evaluated in parallel.

The Solver object of 𝙼𝚊𝚍𝙽𝙻𝙿.𝚓𝚕{\tt MadNLP.jl} is created from the OptiGraph object of Plasmo.jl. The Solver object of MadNLP.jl uses a line-search filter IP method (Wächter and Biegler, 2006) to solve the problem. The step computation is performed by the linear solver specified by the user. The linear solver can be specified either as a direct solver or as the RAS solver. When the RAS solver is chosen, multiple subproblem solver objects are created by using standard direct solvers (e.g., by using Ma57 of HSL routines). These subproblem solvers are used for factorization and backsolve for 𝑴k\boldsymbol{M}_{k} blocks. The RAS scheme (6) exploits multi-thread parallelism available in Julia. After termination of the IP solution procedure, the primal-dual solutions are sent back to the OptiGraph object and Model objects from JuMP.jl so that the user can query the solution via the interface provided by Plasmo.jl and JuMP.jl. See Figure 3 for a comparison with a conventional implementation.

Plasmo.OptiGraphMadNLP.SolverSchwarz.SolverJuMP.ModelMa57.SolverJuMP.ModelMa57.Solver\vdots\vdots{𝒙k,𝝀k,𝒛k}\{\boldsymbol{x}^{*}_{k},\boldsymbol{\lambda}^{*}_{k},\boldsymbol{z}^{*}_{k}\}𝒙,𝝀,𝒛\boldsymbol{x}^{*},\boldsymbol{\lambda}^{*},\boldsymbol{z}^{*}𝒅\boldsymbol{d}^{*}{𝒅k}\{\boldsymbol{d}^{*}_{k}\}{𝒇k(),𝒈k()}\{\boldsymbol{f}_{k}(\cdot),\boldsymbol{g}_{k}(\cdot)\}𝒇(),𝒈()\boldsymbol{f}(\cdot),\boldsymbol{g}(\cdot)𝑴,𝒑\boldsymbol{M},\boldsymbol{p}{𝑴k,𝒓k()}\{\boldsymbol{M}_{k},\boldsymbol{r}^{(\ell)}_{k}\}
JuMP.ModelMadNLP.SolverMa57.Solver𝒙,𝝀,𝒛\boldsymbol{x}^{*},\boldsymbol{\lambda}^{*},\boldsymbol{z}^{*}𝒅\boldsymbol{d}^{*}𝒇(),𝒈()\boldsymbol{f}(\cdot),\boldsymbol{g}(\cdot)𝑴,𝒑\boldsymbol{M},\boldsymbol{p}
Figure 3: Schematics of graph-based modeling and solution (top) and conventional modeling and solution (bottom).

4 Case Studies

The proposed computational framework was tested using transient gas network and multi-period AC power flow problems. In this section, we present the problem statements followed by numerical results and discussion.

4.1 Transient Gas Network

We consider a transient gas network problem (Sundar and Zlotnik, 2018) of the form:

minρ,φa,φ,α,s,dt𝒯((i,j)𝒞γPijta+icitsitiDcitdit)\displaystyle\min_{\begin{subarray}{c}\rho,\varphi^{a},\varphi^{-},\\ \alpha,s,d\in\mathbb{R}\end{subarray}}\;\sum_{t\in\mathcal{T}}\left(\sum_{(i,j)\in\mathcal{C}}\gamma P^{a}_{ijt}+\sum_{i\in\mathcal{R}}c_{it}s_{it}-\sum_{i\in D}c_{it}d_{it}\right) (7a)
s.t.\displaystyle\mathop{\text{s.t.}}\; j𝒩(i)fijta=j(i)sjtj𝒟(i)djt,i𝒩,t𝒯\displaystyle\sum_{j\in\mathcal{N}(i)}f^{a}_{ijt}=\sum_{j\in\mathcal{R}(i)}s_{jt}-\sum_{j\in\mathcal{D}(i)}d_{jt},i\in\mathcal{N},t\in\mathcal{T} (7b)
ρiminρitρimax,i𝒩,t𝒯\displaystyle\rho^{\min}_{i}\leq\rho_{it}\leq\rho^{\max}_{i},\;i\in\mathcal{N},\;t\in\mathcal{T} (7c)
ρit2ρjt2=λLDφijta|φijta|,(i,j)𝒫,t𝒯\displaystyle\rho_{it}^{2}-\rho_{jt}^{2}=-\frac{\lambda L}{D}\varphi^{a}_{ijt}|\varphi^{a}_{ijt}|,\;(i,j)\in\mathcal{P},t\in\mathcal{T} (7d)
L^(ρ˙jt+ρ˙it)=4φijt,(i,j)𝒫,t𝒯\displaystyle\hat{L}(\dot{\rho}_{jt}+\dot{\rho}_{it})=-4\varphi^{-}_{ijt},\;(i,j)\in\mathcal{P},\;t\in\mathcal{T} (7e)
fijta(ρitρjt)0,(i,j)𝒞,t𝒯\displaystyle f^{a}_{ijt}(\rho_{it}-\rho_{jt})\leq 0,\;(i,j)\in\mathcal{C},\;t\in\mathcal{T} (7f)
ρjt=αijtρit,(i,j)𝒞,t𝒯\displaystyle\rho_{jt}=\alpha_{ijt}\rho_{it},\;(i,j)\in\mathcal{C},\;t\in\mathcal{T} (7g)
PijtaPijmax,(i,j)𝒞,t𝒯\displaystyle P^{a}_{ijt}\leq P_{ij}^{\max},\;(i,j)\in\mathcal{C},\;t\in\mathcal{T} (7h)
fijafijtafija,(i,j)𝒞,t𝒯,\displaystyle-f^{a}_{ij}\leq f^{a}_{ijt}\leq f^{a}_{ij},\;(i,j)\in\mathcal{C},\;t\in\mathcal{T}, (7i)

where ρ˙it=ρitρit1Δt\dot{\rho}_{it}=\frac{{\rho}_{it}-{\rho}_{it-1}}{\Delta t}, Pijta=WaAijP^{a}_{ijt}=W_{a}A_{ij}, and fijta=Aijφijtaf^{a}_{ijt}=A_{ij}\varphi^{a}_{ijt}. Here, 𝒩\mathcal{N} is the set of junctions; 𝒫\mathcal{P} is the set of pipelines; 𝒞\mathcal{C} is the set of compressors; \mathcal{R} is the set of receipts; 𝒟\mathcal{D} is the set of demands; (i)\mathcal{R}(i) is the set of receipts at junction i𝒩i\in\mathcal{N}; 𝒟(i)\mathcal{D}(i) is the set of demands at junction i𝒩i\in\mathcal{N}; 𝒯\mathcal{T} is the time index set; ρ\rho is the densitiy; φa\varphi^{a} is the average mass flux; φ\varphi^{-} is the negative mass flux; α\alpha is the compression ratio; ss is the supply; dd is the demand; ρ˙\dot{\rho} is the time derivative of density; PaP^{a} is the power consumption of compressor; ff is the mass flow; cc is the gas price; γ\gamma is the economic factor; λ,L^,L,D,A,Δt\lambda,\hat{L},L,D,A,\Delta t, and WaW_{a} are physical parameters. To implicitly enforce the periodicity, we let ρi0=ρiT\rho_{i0}=\rho_{iT}, where TT is the end time index. The gas network under study consists of 2 compressors, 6 junctions (35 junctions after discretization), 4 pipelines (32 pipelines after discretization), 1 receiving points and 5 transfer points (which work either as receipt or delivery). The model is constructed using GasModels.jl (Bent et al., 2020).

4.2 Multi-Period AC Power Flow

We consider a multi-period AC power flow problem with storage (Geth et al., 2020) of the form:

minv,s,sg,sse,sc,sd,sqc\displaystyle\min_{\begin{subarray}{c}v,s,s^{g},s^{s}\in\mathbb{C}\\ e,sc,sd,sqc\in\mathbb{R}\end{subarray}}\; t𝒯k𝒢ckt0+ckt1(sktg)+ckt2(sktg)2\displaystyle\sum_{t\in\mathcal{T}}\sum_{k\in\mathcal{G}}c^{0}_{kt}+c^{1}_{kt}\Re(s^{g}_{kt})+c^{2}_{kt}\Re(s^{g}_{kt})^{2} (8a)
s.t.\displaystyle\mathop{\text{s.t.}}\; viL|vit|viU,i𝒩,t𝒯\displaystyle v^{L}_{i}\leq|v_{it}|\leq v^{U}_{i},\;i\in\mathcal{N},t\in\mathcal{T} (8b)
k𝒢isktgkLisktd+kSiskts=jN𝒢[i]sijt,i𝒩,t𝒯\displaystyle\sum_{k\in\mathcal{G}_{i}}s^{g}_{kt}-\sum_{k\in L_{i}}s^{d}_{kt}+\sum_{k\in S_{i}}s^{s}_{kt}=\sum_{j\in N_{\mathcal{G}}[i]}s_{ijt},i\in\mathcal{N},t\in\mathcal{T} (8c)
sijt=(Yij+Yijc)|vit|2|Tij|2YijvitvjtTij,(i,j),t𝒯sijt=(Yij+Yjic)|vjt|2YijvitvjtTij,(i,j)R,t𝒯\displaystyle\begin{aligned} &s_{ijt}=(Y_{ij}+Y_{ij}^{c})^{*}\frac{|v_{it}|^{2}}{|T_{ij}|^{2}}-Y^{*}_{ij}\frac{v_{it}v_{jt}^{*}}{T_{ij}},\\ &\qquad(i,j)\in\mathcal{E},\;t\in\mathcal{T}\\ &s_{ijt}=(Y_{ij}+Y_{ji}^{c})^{*}|v_{jt}|^{2}-Y^{*}_{ij}\frac{v_{it}^{*}v_{jt}}{T^{*}_{ij}},\\ &\qquad(i,j)\in\mathcal{E}^{R},\;t\in\mathcal{T}\\ \end{aligned} (8d)
|sijt|sijU,(i,j)R,t𝒯\displaystyle|s_{ijt}|\leq s^{U}_{ij},\;(i,j)\in\mathcal{E}\cup\mathcal{E}^{R},\;t\in\mathcal{T} (8e)
θijΔL(vitvjt)θijΔU,(i,j),t𝒯\displaystyle\theta^{\Delta L}_{ij}\leq\angle(v_{it}v_{jt}^{*})\leq\theta^{\Delta U}_{ij},\;(i,j)\in\mathcal{E},\;t\in\mathcal{T} (8f)
skgLsktgskgU,k𝒢,t𝒯\displaystyle s^{gL}_{k}\leq s^{g}_{kt}\leq s^{gU}_{k},\;k\in\mathcal{G},\;t\in\mathcal{T} (8g)
ektekt1=(ηcsctsdt/ηd)Δt,k𝒮,t𝒯{T}\displaystyle e_{kt}-e_{kt-1}=(\eta^{c}sc_{t}-sd_{t}/\eta^{d})\Delta t,k\in\mathcal{S},t\in\mathcal{T}\setminus\{T\} (8h)
skts+(scktsdkt)=1sqckt+skloss,k𝒮,t𝒯\displaystyle s^{s}_{kt}+(sc_{kt}-sd_{kt})=\sqrt{-1}sqc_{kt}+s^{\text{loss}}_{k},\;k\in\mathcal{S},t\in\mathcal{T} (8i)
|skts|sku,0ektekuk𝒮,t𝒯\displaystyle|s^{s}_{kt}|\leq s^{u}_{k},0\leq e_{kt}\leq e_{k}^{u}\;k\in\mathcal{S},t\in\mathcal{T} (8j)
0scktscku,0sdktscku,k𝒮,t𝒯,\displaystyle 0\leq sc_{kt}\leq sc_{k}^{u},0\leq sd_{kt}\leq sc_{k}^{u},\;k\in\mathcal{S},t\in\mathcal{T}, (8k)

Here, 𝒢\mathcal{G} is the set of generators; 𝒩\mathcal{N} is the set of buses; \mathcal{E} is the set of (directed) branches; R\mathcal{E}^{R} is the set of branches with inverted directions; 𝒮\mathcal{S} is the set of storage; 𝒯\mathcal{T} is the time index set; vv\in\mathbb{C} is the voltage; ee\in\mathbb{R} is the state of charge; ss\in\mathbb{C} is the power flow; sgs^{g}\in\mathbb{C} is the power generation; sss^{s}\in\mathbb{C} is the complex power injected by the storage; scsc\in\mathbb{R} is the charging rate; sdsd\in\mathbb{R} is the discharging rate; sqcsqc\in\mathbb{R} is the reactive power slack; c0,c1,c2c^{0},c^{1},c^{2}\in\mathbb{R} are the generation costs; sds^{d}\in\mathbb{C} is the power demand; YY is the admittance; TT is the branch complex transformation parameter; η\eta is the charging efficiency; slosss^{loss} is the storage energy loss; Δt\Delta t is the time interval. Note that (8) can be reformulated as an NLP with real variables by separately treating the real and imaginary part of the variables and equations (a polar formulation is used here). The power network under study is a variant of IEEE 14 bus test system; this comprises 1414 buses, 55 generators, 11 storage, 11 shunt, and 2020 branches. The detailed model is constructed with PowerModels.jl (Coffrin et al., 2018).

4.3 Results and Discussion

We compare the proposed method (MadNLP.jl interfaced with Plasmo.jl and Schwarz), with the conventional method (MadNLP.jl interfaced with serial/parallel direct solvers Ma57 or MKL-Pardiso along with non-graph based algebraic modeling language JuMP.jl). The conventional methods are referred to as JuMP-Ma57 and JuMP-PardisoMKL, and the proposed method is referred to as Plasmo-Schwarz/Ma57. Furthermore, the mix of proposed/conventional approaches (JuMP-Schwarz/Ma57, Plasmo-Ma57, and Plasmo-PardisoMKL) is also tested together. For JuMP-Schwarz/Ma57, the graph partitioning tool METIS was used to partition the primal-dual coupling graph G~\widetilde{G} directly. A Richardson scheme was used as an iterator for the RAS scheme. The study was performed by solving the gas (7) and power (8) problems while varying the size of the problems (by increasing the length of the prediction horizon). The code was run on a server computer equipped with 2 CPUs of Intel Xeon CPU E5-2698 v4 running 2.20GHz (20 core for each), and 20 threads are used for the computation. Code to reproduce the results can be found in https://github.com/zavalab/JuliaBox/tree/master/AdchemCaseStudy

For both problems, we found that the graph-based approach can significantly accelerate the solution (see Figure 4). In particular, comparing JuMP-Ma57 and Plasmo-Schwarz/Ma57, Plasmo-Schwarz/Ma57 becomes faster than JuMP-Ma57 when the prediction horizon is 3 days or more. Function evaluations are always faster in Plasmo.jl compared to JuMP.jl because the computational savings from function evaluations directly reduce the total solution time (parallelizing the function evaluation itself has no impact on the other part of the algorithm). On the other hand, one can see that the speed-up from parallel linear algebra is only observed when the problem size is sufficiently large (3 days in the gas network and 60 days in the power network). This is because the reduction in the problem size also reduces the overlap size. In our implementation, we set the size of overlap using the relative size of the block (the size of the overlap is reduced if the overall problem size is reduced). As a result, the RAS scheme (6) may become slow, and the number of required factorization/backsolve steps increases. This indicates that the use of RAS is beneficial only when the problem size is sufficiently large. For the gas problems, the acceleration of linear algebra computations was more pronounced. In contrast, for the power problems, the acceleration of function evaluations was more pronounced. This is because the AC power flow formulation has a large number of nonlinear expressions. By comparing the linear solver time for JuMP-Schwarz/Ma57 and Plasmo-Schwarz/Ma57, we see the advantage of using a graph-based modeling language for obtaining the partitions {Wk}k=1K\{W_{k}\}_{k=1}^{K}. We recall that for JuMP-Schwarz/Ma57, the Metis graph partitioning routine is directly applied to G~\widetilde{G} while Plasmo-Schwarz/Ma57 uses the user-provided problem graph GG. One can observe that, in general, the linear solver time is shorter for PlasmoNLP-Schwarz/Ma57. This indicates that the user-provided graph information can be leveraged for obtaining high-quality partitions.

Refer to captionRefer to captionRefer to captionRefer to captionRefer to captionRefer to captionFunction Evaluation Wall Time (sec)Function Evaluation Wall Time (sec)Linear Solver Wall Time (sec)Linear Solver Wall Time (sec)Solution Wall Time (sec)Solution Wall Time (sec)Number of VariablesRefer to caption
Figure 4: Solution time (top), linear solver time (middle), function evaluation time (bottom) for transient gas network (left) and multi-period AC optimal power flow (right) problems.

5 Conclusions and Future Work

We have presented a graph-based modeling and decomposition framework for large-scale nonlinear programs arising in energy infrastructures. Here, we introduce a new decomposition paradigm for linear algebra systems within an interior-point method: a restricted additive Schwarz (RAS) scheme. We implement this framework in the Julia package MadNLP.jl and show that the RAS approach accelerates computations (compared to off-the-shelf approaches) by up to 300%. This work focused on applying RAS to conduct temporal decomposition; applying RAS as a spatial decomposition scheme is a future direction of interest. A surprising finding was that the RAS scheme is effective at handling instances with a large number of active inequality constraints. We are interested in determining the reasons for this by investigating the convergence properties of the RAS scheme within an interior-point context.

{ack}

We acknowledge Andreas Wächter for helpful comments and Jordan Jalving for implementing the requested features in Plasmo.jl.

References

  • Balay et al. (2019) Balay, S., Abhyankar, S., Adams, M., Brown, J., Brune, P., Buschelman, K., Dalcin, L., Dener, A., Eijkhout, V., Gropp, W., et al. (2019). PETSc users manual.
  • Bent et al. (2020) Bent, R., Sundar, K., and Fobes, D. (2020). GasModels.jl. https://github.com/lanl-ansi/GasModels.jl.
  • Boyd et al. (2011) Boyd, S., Parikh, N., and Chu, E. (2011). Distributed optimization and statistical learning via the alternating direction method of multipliers. Now Publishers Inc.
  • Cai and Saad (1996) Cai, X.C. and Saad, Y. (1996). Overlapping domain decomposition algorithms for general sparse matrices. Numerical linear algebra with applications, 3(3), 221–237.
  • Cai and Sarkis (1999) Cai, X.C. and Sarkis, M. (1999). A restricted additive schwarz preconditioner for general sparse linear systems. SIAM Journal on Scientific Computing, 21(2), 792–797.
  • Chiang and Zavala (2016) Chiang, N.Y. and Zavala, V.M. (2016). An inertia-free filter line-search algorithm for large-scale nonlinear programming. Computational Optimization and Applications, 64(2), 327–354.
  • Chiang et al. (2014) Chiang, N., Petra, C.G., and Zavala, V.M. (2014). Structured nonconvex optimization of large-scale energy systems using PIPS-NLP. In 2014 Power Systems Computation Conference, 1–7. IEEE.
  • Coffrin et al. (2018) Coffrin, C., Bent, R., Sundar, K., Ng, Y., and Lubin, M. (2018). PowerModels.jl: An open-source framework for exploring power flow formulations. In 2018 Power Systems Computation Conference (PSCC), 1–8. 10.23919/PSCC.2018.8442948.
  • Curtis et al. (2012) Curtis, F.E., Huber, J., Schenk, O., and Wächter, A. (2012). A note on the implementation of an interior-point algorithm for nonlinear optimization with inexact step computations. Mathematical programming, 136(1), 209–227.
  • Dunning et al. (2017) Dunning, I., Huchette, J., and Lubin, M. (2017). JuMP: A modeling language for mathematical optimization. SIAM Review, 59(2), 295–320.
  • Gerstner et al. (2016) Gerstner, P., Schick, M., Heuveline, V., Meyer-Hübner, N., Suriyah, M., Leibfried, T., Slednev, V., Fichtner, W., and Bertsch, V.V. (2016). A domain decomposition approach for solving dynamic optimal power flow problems in parallel with application to the german transmission grid. Preprint Series of the Engineering Mathematics and Computing Lab, (1).
  • Geth et al. (2020) Geth, F., Coffrin, C., and Fobes, D.M. (2020). A flexible storage model for power network optimization. arXiv preprint arXiv:2004.14768.
  • HSL (2007) HSL, A. (2007). collection of fortran codes for large-scale scientific computation. See http://www. hsl. rl. ac. uk.
  • Jalving et al. (2019) Jalving, J., Cao, Y., and Zavala, V.M. (2019). Graph-based modeling and simulation of complex systems. Computers & Chemical Engineering, 125, 134–154.
  • Jalving et al. (2020) Jalving, J., Shin, S., and Zavala, V.M. (2020). A graph-based modeling abstraction for optimization: Concepts and implementation in plasmo. jl. arXiv preprint arXiv:2006.05378.
  • Kim and Anitescu (2020) Kim, Y. and Anitescu, M. (2020). A real-time optimization with warm-start of multiperiod ac optimal power flows. Electric Power Systems Research, 189, 106721.
  • Rodriguez et al. (2020) Rodriguez, J.S., Laird, C.D., and Zavala, V.M. (2020). Scalable preconditioning of block-structured linear algebra systems using admm. Computers & Chemical Engineering, 133, 106478.
  • Shin et al. (2020a) Shin, S., Anitescu, M., and Zavala, V.M. (2020a). Overlapping schwarz decomposition for constrained quadratic programs. arXiv preprint arXiv:2003.07502.
  • Shin et al. (2020b) Shin, S., Zavala, V.M., and Anitescu, M. (2020b). Decentralized schemes with overlap for solving graph-structured optimization problems. IEEE Transactions on Control of Network Systems.
  • Sundar and Zlotnik (2018) Sundar, K. and Zlotnik, A. (2018). State and parameter estimation for natural gas pipeline networks using transient state data. IEEE Transactions on Control Systems Technology, 27(5), 2110–2124.
  • Wächter and Biegler (2006) Wächter, A. and Biegler, L.T. (2006). On the implementation of an interior-point filter line-search algorithm for large-scale nonlinear programming. Mathematical programming, 106(1), 25–57.