Show Summary Details
More options …

# at - Automatisierungstechnik

### [AT - Automation Technology: Methods and Applications of Control, Regulation, and Information Technology]

Editor-in-Chief: Jumar, Ulrich

IMPACT FACTOR 2018: 0.500

CiteScore 2018: 0.60

SCImago Journal Rank (SJR) 2018: 0.211
Source Normalized Impact per Paper (SNIP) 2018: 0.532

Online
ISSN
2196-677X
See all formats and pricing
More options …

# Ersatzmodelle in bidirektionaler Optimierung gekoppelter Microgrids

Manuel Baumann
/ Sara Grundel
/ Philipp Sauerteig
/ Karl Worthmann
Published Online: 2019-11-30 | DOI: https://doi.org/10.1515/auto-2019-0075

## Abstract

The energy transition entails a rapid uptake of renewable energy sources. Besides physical changes within the grid infrastructure, energy storage devices and their smart operation are key measures to master the resulting challenges like, e. g., a highly fluctuating power generation. For the latter, optimization based control has demonstrated its potential on a microgrid level. However, if a network of coupled microgrids is considered, iterative optimization schemes including several communication rounds are typically used. Here, we propose to replace the optimization on the microgrid level by using surrogate models either derived from radial basis functions or neural networks to avoid this iterative procedure. We prove well-posedness of our approach and demonstrate its efficiency by numerical simulations based on real data provided by an Australian grid operator.

## Zusammenfassung

Die Energiewende bringt einen raschen Zuwachs eneuerbarer Energiequellen mit sich. Neben den physikalischen Veränderungen der Netzinfrastruktur spielen Energiespeichereinheiten und deren intelligente Nutzung eine entscheidende Rolle, um die sich ergebenden Probleme wie z. B. die stark schwankende Energieerzeugung zu bewältigen. In Bezug auf Letztere haben optimierungsbasierte Steuerungstechniken ihr Potential auf Microgrid-Ebene unter Beweis gestellt. Betrachtet man jedoch ein Netzwerk gekoppelter Microgrids, werden üblicherweise iterative Optimierungsansätze gewählt, welche mit mehreren Kommunikationsrunden einhergehen. Um derartigen Kommunikationsschleifen vorzubeugen, schlagen wir vor, den Optimierungsschritt auf Microgrid-Ebene durch den Einsatz geeigneter Ersatzmodelle zu vermeiden. Den hier verwendeten Ersatzmodellen liegen zum einen radiale Basisfunktionen und zum anderen neuronale Netze zugrunde. Wir zeigen, dass unser Ansatz wohlgestellt ist und demonstrieren die Effizienz anhand numerischer Simulationen basierend auf realen Daten eines australischen Verteilnetzbetreibers.

## 1 Introduction

The share of renewable energy sources rapidly increases; also due to more and more installed devices like e. g., solar panels at household-level. Hence, households become prosumers, i. e., power is not only consumed but also produced. Therefore, energy generation and distribution takes place in a distributed way. In particular, energy can be transmitted bidirectionally between the grid and the prosumers, which results in a paradigm shift in the grid organization. In addition, prosumers may also possess some kind of energy storage device in order to manipulate their power demand profiles by either charging or discharging. From the grid operator’s perspective it might be beneficial that charging decisions are not made based on local information only. Instead taking into account information on the entire grid may improve the system-wide operation, e. g., to flatten the overall power demand within the grid in order to facilitate the power supply. [1]. In order to achieve this goal, communication is needed. In the future, each household shall be equipped with a smart meter which yields so-called smart homes. Smart meters collect data and communicate with the grid operator automatically.

A straight-forward way to optimally operate the overall system is to formulate one large-scale optimization problem and to solve it in a centralized way, see, e. g., [2]. This approach, however, is hard to realize in practice. One of the disadvantages is that some central node needs the complete information about the grid, which is, e. g., due to data privacy, not desirable. Alternatives are decentralized or distributed optimization algorithms. In [3] the authors propose a decentralized approach to steer energy storage systems in order to avoid over-capacity of pole transformers while maintaining a high charging amount of energy storage systems in low-voltage distribution systems. The other option mentioned above are distributed optimization methods such as distributed dual ascent [4], Alternating Direction Method of Multipliers (ADMM) [5] or Augmented Lagrangian based Alternating Direction Inexact Newton (ALADIN) [6]. These algorithms use a star-shaped communication topology, i. e., each smart home communicates only with the grid operator and does not share any information with its neighbours. Nevertheless, in every iteration each household has to transmit specific (personal) data to the grid operator, see also [7] and [8] for an application of ADMM and ALADIN to electrical networked systems, respectively. In order to exploit the potential of these algorithms they are typically embedded within a Model Predictive Control (MPC) framework. MPC is a state-of-the-art technique to tackle optimal control problems by solving finite-dimensional optimization problems successively, see e. g., [9] for an introduction to MPC and [10], [11] for MPC approaches in electrical networks.

An alternate option to steer the power demand of local agents besides battery control is to schedule so-called controllable loads. Controllable loads can be shifted in time to avoid bottlenecks in the energy supply, see e. g., [12], [13]. There is also a large potential in the context of stochastic optimization of smart grids. For weather forecasting methods we refer to [14]. How to integrate electrical vehicles into the electricity network under uncertainties is described in [15].

Considering the power networks described so far, it is assumed that exchange of energy within the grid is possible at any time and does not cause any losses or additional costs, which might (approximately) hold for domestic nets, e. g., a town. In this paper, we refer to these grids as microgrids (MGs). In [16], [17], the concept of coupled MGs is used to tackle large-scale problems incorporating several MGs. In the latter, the authors show that even if each single MG is optimally operated, there is still room for improvement if energy can be exchanged among MGs. Therefore, a second optimization problem is solved on a higher grid level in order to optimally exchange energy resulting in a bilevel optimization problem [18].

In [19], the authors propose to replace the distributed optimization routine on the lower grid level by a surrogate model in order to speed-up the calculation and further reduce communication effort. Here, Radial Basis Functions (RBFs) [20] are used to approximate the input-output behaviour of ADMM within the framework of coupled MGs established in [17]. Besides RBFs there are various methods to learn the behaviour of a complex function. Artificial Neural Networks (NNs) are one of the most popular representatives of modern artificial intelligence techniques and are often used in practice due to their success in various application fields, see e. g., the survey article [21]. In [22] the authors forecast loads in a power grid using NNs, whereas in [23] NNs are used in an optimal power flow framework. The main advantage of using surrogates is that communication effort can be reduced.

In this paper, we extend the idea of coupled microgrids established in [17] by proposing an iterative bi-directional optimization routine in order to improve the overall performance. Due to its iterative structure, however, our method comes along with a strong need for communication between smart homes and grid operator. As a remedy we present two approaches to reduce the communication effort by substituting the optimization on microgrid level via surrogate models. A main difference compared to [19] lies in the different input-output map that is replaced by the surrogate models, for which we can show that each input uniquely determines an (optimal) output. Furthermore, we also take NNs as potential surrogate models into account and study the performance of the resulting approximations numerically in an MPC framework. Our simulations show that the proposed method approximately recovers the performance based on using ADMM but significantly reduces the communication burden. The effect of applying surrogate models within MPC extends our previous work [19] where a surrogate model based on RBFs was only applied in a static optimization problem.

The paper is structured as follows: In Section 2 we formulate a mathematical model for coupled microgrids that consists of two hierarchy levels, and introduce optimization problems corresponding to each of them. In the consecutive section, we propose an iterative scheme that requires the solution of a distributed optimization problem on the lower level which is solved using ADMM. In Section 4, we investigate the impact of disturbances w. r. t. the lower-level solution on the performance measured in terms of the upper-level objective function. Based on the results, we propose to replace ADMM by surrogates in order to reduce communication effort and computation time. The performance of the optimization scheme incorporating surrogates is analysed in an MPC framework in Section 5.

## 2 A model for coupled microgrids

We consider a system of coupled microgrids (MGs) and call it a smart grid. Each MG consists of several residential energy systems (agents) coupled through the grid operator, which can be seen as Central Entity (CE). The coupling of the microgrids is done through a network, where some MGs are connected by a transmission line and others are not connected, cf. Figure 1.

Figure 1

Upper-level model: Schematic representation of four coupled MGs. Energy exchange is possible only via transmission lines.

## 2.1 Upper-level model: Energy exchange

We assume that we have $\mathrm{\Xi }\in \mathbb{N}$ many MGs which are partially coupled via transmission lines and can be interpreted as nodes of a non-complete graph, see Figure 1 where $\mathrm{\Xi }=4$. Each MG κ, for $\mathit{\kappa }\in \left[1:\mathrm{\Xi }\right]$, consists of ${\mathcal{I}}_{\mathit{\kappa }}\in \mathbb{N}$ agents modeled in detail in Subsection 2.2. We assume that each MG κ has an average power demand ${\overline{\mathit{z}}}_{\mathit{\kappa }}\mathrm{\left(}\mathit{n}\mathrm{\right)}$ at time n. Given this, we can compute the total power demand ${\mathcal{I}}_{\mathit{\kappa }}{\overline{\mathit{z}}}_{\mathit{\kappa }}$ of a MG. The control goal is to exchange power among the MGs in a way such that a desired quantity $\overline{\mathit{\zeta }}\mathrm{\left(}\mathit{n}\mathrm{\right)}$ is targeted by controlling the residential storage units. We specify $\overline{\mathit{\zeta }}\mathrm{\left(}\mathit{n}\mathrm{\right)}$ in Subsection 2.2, and assume for the moment that this quantity is known to the grid and has advantages for the grid operation. We assume that this desired quantity is independent of κ, but this is not necessary for the rest of the discussion.

Let ${\mathit{\delta }}_{\mathit{\nu }\mathit{\kappa }}$ describe the percentage of power ${\mathcal{I}}_{\mathit{\nu }}{\overline{\mathit{z}}}_{\mathit{\nu }}\mathrm{\left(}\mathit{n}\mathrm{\right)}$ that is transferred from MG ν to MG κ. We enforce ${\mathit{\delta }}_{\mathit{\nu }\mathit{\kappa }}$ equals zero if there is no transmission line between the two MGs. Otherwise, the power demand of a MG κ is given by its own total power demand ${\mathit{\delta }}_{\mathit{\kappa }\mathit{\kappa }}{\mathcal{I}}_{\mathit{\kappa }}{\overline{\mathit{z}}}_{\mathit{\kappa }}$, where ${\mathit{\delta }}_{\mathit{\kappa }\mathit{\kappa }}$ is what remains at the MG, and the sum over the power received from connected MGs, ${\sum }_{\mathit{\nu }\ne \mathit{\kappa }}{\mathit{\delta }}_{\mathit{\nu }\mathit{\kappa }}{\mathcal{I}}_{\mathit{\nu }}{\overline{\mathit{z}}}_{\mathit{\nu }}$. For each time step in our prediction horizon of length $\mathit{N}\in {\mathbb{N}}_{\ge 2}$, we want to match this to the desired power demand starting at time k for N timesteps of each MG in a least-squares sense. The objective function is thus given by $\mathcal{J}:{\mathbb{R}}^{\mathrm{\Xi }\mathit{N}}×{\mathbb{R}}^{\mathrm{\Xi }×\mathrm{\Xi }×\mathit{N}}\to \mathbb{R}$, $(z¯,δ)↦∑n=kk+N−1∑κ=1Ξζ¯(n)Iκ−∑ν=1Ξδνκ(n)ηνκIνz¯ν(n)2.$(1) Here, the vector $\overline{\mathit{z}}={\mathrm{\left(}\overline{\mathit{z}}\mathrm{\left(}\mathit{k}\mathrm{\right)}\mathrm{,}\dots \mathrm{,}\overline{\mathit{z}}{\mathrm{\left(}\mathit{k}+\mathit{N}-1\mathrm{\right)}}^{\top }\mathrm{\right)}}^{\top }$ with $\overline{\mathit{z}}\mathrm{\left(}·\mathrm{\right)}\in {\mathbb{R}}^{\mathrm{\Xi }}$ stacks the average power demand per MG and time step while the matrix $\mathit{\eta }={\mathrm{\left(}{\mathit{\eta }}_{\mathit{\nu }\mathit{\kappa }}\mathrm{\right)}}_{\mathit{\kappa }\mathrm{,}\mathit{\nu }=1}^{\mathrm{\Xi }}\in {\left[0\mathrm{,}1\right]}^{\mathrm{\Xi }×\mathrm{\Xi }}$ incorporates efficiencies along the transmission lines.

We are interested in minimizing (1) under the following constraints: All exchange rates ${\mathit{\delta }}_{\mathit{\nu }\mathit{\kappa }}$ are within the interval [0,1], sum up to 1, and only transfer power in one direction, meaning that either ${\mathit{\delta }}_{\mathit{\nu }\mathit{\kappa }}$ or ${\mathit{\delta }}_{\mathit{\kappa }\mathit{\nu }}$ is zero. Moreover, note that at this grid level, the average power demands per MG are known. Following [17], the optimization problem of the upper-level is, thus, formulated over the exchange rates δ, $minδ∈[0,1]Ξ×Ξ×NJ(z¯,δ)$(2a)$s.t.∑κ=1Ξδνκ(n)=1$(2b)$δνκ(n)·δκν(n)≤0,κ≠ν∀ν,κ∈[1:Ξ],n∈[k:k+N−1],$(2c) where ${\mathit{\delta }}_{\mathit{\nu }\mathit{\kappa }}\mathrm{\left(}\mathit{n}\mathrm{\right)}$ denotes the power exchange rate from MG ν to MG κ at time instance n. Constraints (2b) and (2c) ensure that the whole energy of each MG is scheduled and that exchanges via transmission lines can only occur in one direction during one time step. We denote the feasible set of (2) by $Dδ=δ∈[0,1]Ξ×Ξ×N|(2b) and (2c) hold.$ The efficiency of a transmission line does not depend on the direction of the transfer, i. e., the matrix η is symmetric. Furthermore, we assume no loss without transport, i. e., ${\mathit{\eta }}_{\mathit{\kappa }\mathit{\kappa }}\equiv 1$ for all $\mathit{\kappa }\in \left[1:\mathrm{\Xi }\right]$, in the rest of the paper.

## 2.2 Lower-level model: Single microgrid

As we have seen in the previous section, we consider an average power demand at each MG as well as some desired quantity $\overline{\mathit{\zeta }}\mathrm{\left(}\mathit{n}\mathrm{\right)}$. In order to understand these quantities better, we explain the modeling of the MG in all detail. The basis of our considerations forms the model presented in [24] and its extension [7]. Therefore, let each subsystem be equipped with an energy generation device (e. g., roof top photo-voltaic panels) and some storage device (e. g., a battery). Then, the i-th system, $\mathit{i}\in \left[1:{\mathcal{I}}_{\mathit{\kappa }}\right]$ in MG κ, can be described by the discrete time system dynamics, $xκi(n+1)=ακixκi(n)+T(βκiuκi+(n)+uκi−(n))$(3a)$zκi(n)=wκi(n)+uκi+(n)+γκiuκi−(n),$(3b) where ${\mathit{x}}_{{\mathit{\kappa }}_{\mathit{i}}}\mathrm{\left(}\mathit{n}\mathrm{\right)}$ and ${\mathit{z}}_{{\mathit{\kappa }}_{\mathit{i}}}\mathrm{\left(}\mathit{n}\mathrm{\right)}$ denote the State of Charge (SoC) of the battery and the power demand at time instance $\mathit{n}\in {\mathbb{N}}_{0}$, respectively. The latter incorporates the net consumption, ${\mathit{w}}_{{\mathit{\kappa }}_{\mathit{i}}}\mathrm{\left(}\mathit{n}\mathrm{\right)}={\ell }_{{\mathit{\kappa }}_{\mathit{i}}}\mathrm{\left(}\mathit{n}\mathrm{\right)}-{\mathit{g}}_{{\mathit{\kappa }}_{\mathit{i}}}\mathrm{\left(}\mathit{n}\mathrm{\right)}$, as the difference of load and power generation, cf. Figure 2.

Figure 2

Lower-level model: Star-shaped network of residential energy systems and central entity (CE). The quantity $\mathit{w}=\ell -\mathit{g}$ in (3b) is obtained from the data set [25].

The system can be controlled by charging ${\mathit{u}}_{{\mathit{\kappa }}_{\mathit{i}}}^{+}$ and discharging ${\mathit{u}}_{{\mathit{\kappa }}_{\mathit{i}}}^{-}$ the battery at each time step. The length of a time step in hours is denoted by $\mathit{T}\mathrm{>}0$, e. g., $\mathit{T}=0.5$ corresponds to a half-hour time window. The constants ${\mathit{\alpha }}_{{\mathit{\kappa }}_{\mathit{i}}}\mathrm{,}{\mathit{\beta }}_{{\mathit{\kappa }}_{\mathit{i}}}\mathrm{,}{\mathit{\gamma }}_{{\mathit{\kappa }}_{\mathit{i}}}\in \mathrm{\left(}0\mathrm{,}1\right]$ represent efficiencies w. r. t. self discharge and energy conversion. Furthermore, the initial SoC ${\mathit{x}}_{{\mathit{\kappa }}_{\mathit{i}}}\mathrm{\left(}\mathit{k}\mathrm{\right)}={\stackrel{ˆ}{\mathit{x}}}_{{\mathit{\kappa }}_{\mathit{i}}}$, where $\mathit{k}\in {\mathbb{N}}_{0}$ denotes the current time instance, is assumed to be known. State and input are subject to the inequality constraints, $0≤xκi(n)≤Cκi$(4a)$u_κi≤uκi−(n)≤0$(4b)$0≤uκi+(n)≤u¯κi$(4c)$0≤uκi−(n)u_κi+uκi+(n)u¯κi≤1.$(4d) Here, ${\mathit{C}}_{{\mathit{\kappa }}_{\mathit{i}}}\ge 0$ denotes the battery capacity. The last constraint ensures that the bounds on discharging (4b) and charging (4c) hold even if the battery is both discharged and charged during one time step. Note that the case ${\mathit{C}}_{{\mathit{\kappa }}_{\mathit{i}}}=0$ covers the case, where not all systems have a storage device. Since the future net consumption is not known in advance, it is assumed to be reliably predictable on a short time horizon of size N, $\mathit{N}\in {\mathbb{N}}_{\ge 2}$, time steps.

For a concise notation we introduce the set ${\mathbb{X}}_{{\mathit{\kappa }}_{\mathit{i}}}=\left[0\mathrm{,}{\mathit{C}}_{{\mathit{\kappa }}_{\mathit{i}}}\right]$ of feasible states, the set ${\mathbb{U}}_{{\mathit{\kappa }}_{\mathit{i}}}=\left\{{\mathrm{\left(}{\mathit{u}}_{{\mathit{\kappa }}_{\mathit{i}}}^{+}\mathrm{,}{\mathit{u}}_{{\mathit{\kappa }}_{\mathit{i}}}^{-}\mathrm{\right)}}^{\top }\in {\mathbb{R}}^{2}\phantom{\rule{2.38387pt}{0ex}}|\text{(4b)}-\text{(4d)}\phantom{\rule{2.5pt}{0ex}}\text{hold}\right\}$ of feasible control pairs and the set $Dκi=zκi∈RN|zκi=zκi(k),…,zκi(k+N−1)⊤∃uκi∈UNsuch thatxκi(k)=xˆκi,(3) and (4) hold$ of feasible outputs over the next N time steps, $\mathit{i}\in \left[1:{\mathcal{I}}_{\mathit{\kappa }}\right]$, $\mathit{\kappa }\in \left[1:\mathrm{\Xi }\right]$. Referring to the feasible sets of a MG κ we use the Cartesian product, e. g., ${\mathbb{D}}^{\mathrm{\left(}\mathit{\kappa }\mathrm{\right)}}={\mathbb{D}}_{{\mathit{\kappa }}_{1}}×\dots ×{\mathbb{D}}_{{\mathit{\kappa }}_{{\mathcal{I}}_{\mathit{\kappa }}}}$ and ${\mathit{z}}^{\mathrm{\left(}\mathit{\kappa }\mathrm{\right)}}\in {\mathbb{D}}^{\mathrm{\left(}\mathit{\kappa }\mathrm{\right)}}$. Note that the sets ${\mathbb{D}}_{{\mathit{\kappa }}_{\mathit{i}}}$, $\mathit{i}\in \left[1:{\mathcal{I}}_{\mathit{\kappa }}\right]$, and hence ${\mathbb{D}}^{\mathrm{\left(}\mathit{\kappa }\mathrm{\right)}}$ are non-empty, compact, and convex.

The output quantity in (3b) is the power demand ${\mathit{z}}_{{\mathit{\kappa }}_{\mathit{i}}}$ of an individual agent in MG κ. The average power demand ${\overline{\mathit{z}}}_{\mathit{\kappa }}=\frac{1}{{\mathcal{I}}_{\mathit{\kappa }}}{\sum }_{\mathit{i}=1}^{{\mathcal{I}}_{\mathit{\kappa }}}{\mathit{z}}_{{\mathit{\kappa }}_{\mathit{i}}}$ in each MG can then be computed from the individual power demands, and is used as an input to (1). We define $\overline{\mathit{\zeta }}$ in (1) as a stable reference trajectory by averaging over a past time horizon and over all individual residential units of all microgrids, the so-called overall average net consumption as proposed in [7], $ζ¯(n)=1I·min{N,n+1}∑j=n−min{n,N−1}n∑i=1Iwi(j)$(5) where $\mathcal{I}={\sum }_{\mathit{\kappa }=1}^{\mathrm{\Xi }}{\mathcal{I}}_{\mathit{\kappa }}$ denotes the total number of agents within the entire smart grid. Due to averaging, the trajectory $\overline{\mathit{\zeta }}$ has little fluctuations and yields advantages for the grid operation.

Let us for the moment ignore the coupling described in Subsection 2.1. Then, $\mathit{\delta }\mathrm{\left(}\mathit{n}\mathrm{\right)}$ equals the identity for all $\mathit{n}\in \left[\mathit{k}:\mathit{k}+\mathit{N}-1\right]$ and $\mathcal{J}$ becomes $z¯↦∑n=kk+N−1∑κ=1Ξζ¯(n)Iκ−Iκz¯κ(n)2.$ Therefore, the overall objective $\mathcal{J}$ can be decoupled yielding the local optimization problem $minz(κ)∈D(κ)g(z¯κ)$(6) per MG with local objective function $\mathit{g}:{\mathbb{R}}^{\mathit{N}}\to {\mathbb{R}}_{\ge 0}$, $g(z¯κ)=ζ¯−z¯κ22.$

## 2.3 Fully coupled optimization problem

We are interested in optimizing the function (1). This function, in general, depends on δ as well as on $\overline{\mathit{z}}$. As seen in the previous section, the average power demand $\overline{\mathit{z}}=\overline{\mathit{z}}\mathrm{\left(}\mathit{u}\mathrm{\right)}$ depends on the control u, which we have to find in such a way that $\mathcal{J}$ is optimal. The overall optimization problem can be written as $minδ∈Dδ,z(κ)∈D(κ)J(z¯,δ).$(7) Note that due to constraint (2c) the optimization of $\mathcal{J}$ w. r. t. δ is non-convex. Furthermore, the large scale of the optimization w. r. t. $\overline{\mathit{z}}$ causes the use of a centralized solver to be expensive. In addition, using a centralized solver assumes the existence of a global entity gathering the information of the whole grid, in particular the personal data of each household, which is undesirable in practice. Hence, solving (7) centralized is impractical. In the subsequent section we present an approach to tackle (7) by solving the upper and lower-level problem iteratively. Doing so we avoid a node with full knowledge in the grid and only communicate specific aggregated information in each iteration among the agents.

## 3 Bidirectional optimization

We propose to tackle the optimization problem (7) in a bidirectional way, i. e., we first find an optimal $\overline{\mathit{z}}$ for δ being the identity and then optimize (7) w. r. t. δ for fixed $\overline{\mathit{z}}$ in order to find the optimal exchange strategy. This typically already gives a considerable improvement, and has been also done e. g., in [17]. To solve (2) for a fixed $\overline{\mathit{z}}$ is straight forward, and we use a standard Sequential Quadratic Programming (SQP) solver. We refer to [26] for an introduction to SQP methods. In this paper we show how to incorporate the computed energy exchange from the upper level into the lower-level optimization problem in order to improve the overall performance.

## 3.1 Bidirectional optimization scheme

Assume that each MG κ, $\mathit{\kappa }\in \left[1:\mathrm{\Xi }\right]$, within the smart grid has already solved its inherent optimization problem (6) and based on the corresponding solutions ${\overline{\mathit{z}}}_{\mathit{\kappa }}$ an energy exchange policy ${\mathit{\delta }}^{\mathrm{\star }}$ has been computed according to (2). This exchange yields an updated power demand $z¯κ+(n)=1Iκ∑ν=1Ξδνκ⋆(n)ηνκIνz¯ν(n),n∈[k:k+N−1],$ and hence, the difference $\mathrm{\Delta }{\overline{\mathit{z}}}_{\mathit{\kappa }}\mathrm{\left(}\mathit{n}\mathrm{\right)}={\overline{\mathit{z}}}_{\mathit{\kappa }}\mathrm{\left(}\mathit{n}\mathrm{\right)}-{\overline{\mathit{z}}}_{\mathit{\kappa }}^{+}\mathrm{\left(}\mathit{n}\mathrm{\right)}$ in power demand for all MGs. We are interested in updating $\overline{\mathit{z}}$ in such a way that our cost function (1), $J(z¯,δ⋆)=∑n=kk+N−1∑κ=1Ξζ¯(n)Iκ−∑ν=1Ξδνκ⋆(n)ηνκIνz¯ν(n)2=∑κ=1ΞIκ2ζ¯−z¯κ+22=∑κ=1ΞIκ2(ζ¯+Δz¯κ)−z¯κ22$ is minimized further. One could think about fixing δ and finding an optimal $\overline{\mathit{z}}$. This, however, leads to an optimization problem not avoiding communication and coupling all microgrids. The trick here is now to fix not only the δ but also the $\overline{\mathit{z}}$-components from all the microgrids but one. This leads to optimizing ${\mathcal{I}}_{\mathit{\kappa }}^{2}{‖\mathrm{\left(}\overline{\mathit{\zeta }}+\mathrm{\Delta }{\overline{\mathit{z}}}_{\mathit{\kappa }}\mathrm{\right)}-{\overline{\mathit{z}}}_{\mathit{\kappa }}‖}_{2}^{2}$ locally in each MG, where $\mathrm{\Delta }{\overline{\mathit{z}}}_{\mathit{\kappa }}$ is computed by using the ${\overline{\mathit{z}}}_{\mathit{\kappa }}$’s and δ’s from the previous optimization step. Intuitively, the difference $\mathrm{\Delta }{\overline{\mathit{z}}}_{\mathit{\kappa }}$, $\mathit{\kappa }\in \left[1:\mathrm{\Xi }\right]$, can be interpreted as an additional load or generation, and, therefore, as a change of the desired power demand profile for MG κ. This yields the modified lower-level optimization problem $minz(κ)∈D(κ)gκ(z¯κ)=ζ¯κ+−z¯κ22,$(8) where ${\overline{\mathit{\zeta }}}_{\mathit{\kappa }}^{+}=\overline{\mathit{\zeta }}+\mathrm{\Delta }{\overline{\mathit{z}}}_{\mathit{\kappa }}$ In this formulation the updated reference trajectories ${\overline{\mathit{\zeta }}}_{\mathit{\kappa }}^{+}$, $\mathit{\kappa }\in \left[1:\mathrm{\Xi }\right]$, differ among the single MGs and depend on a given δ and a given previous ${\overline{\mathit{z}}}_{\mathit{\kappa }}$. The solution of the newly derived lower-level optimization problem can be solved with ADMM for all microgrids independently and in a parallel way.

Based on the updated reference value we solve (8) and (2) to improve the battery usage and the energy exchange and repeat the optimization until some terminal condition is satisfied, e. g., performance improvement less than a pre-defined tolerance or maximal number of iterations exceeded. This procedure is summarized in Algorithm 1. Note that we only update the reference $\overline{\mathit{\zeta }}$ on the lower level, since the upper-level optimization problem (1) does not change.

Algorithm 1

Iterative bidirectional optimization scheme

Neither convergence nor the interpretation of a potential limit of Algorithm 1 is clear a priori. Figure 3, however, experimentally shows convergence of the proposed scheme and a continuous improvement of the upper-level performance index. Here, we ran 10 iterations of the optimization scheme and plotted both the objective function values before and after the energy exchange within each iteration. The values stagnate after four iterations indicating that additional iterations do not further improve the overall performance. The next subsection elaborates on how to solve (8) in a fully distributed way using ADMM.

Figure 3

Evolution of the costs before and after energy exchange computed according to the bidirectional optimization scheme described in Algorithm 1, i. e., $\mathcal{J}\mathrm{\left(}{\overline{\mathit{z}}}^{\mathit{j}}\mathrm{,}{\mathit{\delta }}^{\mathit{j}-1}\mathrm{\right)}$ and $\mathcal{J}\mathrm{\left(}{\overline{\mathit{z}}}^{\mathit{j}}\mathrm{,}{\mathit{\delta }}^{\mathit{j}}\mathrm{\right)}$, resp. Note that $\mathcal{J}\mathrm{\left(}{\overline{\mathit{z}}}^{1}\mathrm{,}{\mathit{\delta }}^{0}\mathrm{\right)}$ yields the costs without microgrid coupling.

#### Remark 1.

The results displayed in Figure 3 and our numerical investigations indicate convergence to the global minimum of (7). However, a formal (and rigorous) derivation of this conjecture is left for future research.

## 3.2 Distributed optimization via ADMM

In this section we briefly discuss how to solve the lower-level optimization problem (6) or (8) using an Alternating Direction Method of Multipliers (ADMM) approach. We consider a single MG and therefore omit the index κ. Since the averaged output quantity appears in the objective function (6) or (8), we need to introduce an auxiliary variable a in order to decouple the lower-level optimization in the following way, $minz,ag(a¯)=‖a¯−ζ¯‖22$(9a)$s.t.1I∑i=1Iai−a¯=0,zi−ai=0$(9b)$zi∈Di∀i∈[1:I].$(9c) Note that (9c) is a short-hand notation for the battery dynamics (3)–(4), and yields a fully decoupled constraint in the variable z. ADMM is an optimization scheme to solve (9) based on the augmented Lagrangian ${\mathcal{L}}_{\mathit{\rho }}:{\mathbb{R}}^{\mathcal{I}\mathit{N}}×{\mathbb{R}}^{\mathcal{I}\mathit{N}}×{\mathbb{R}}^{\mathcal{I}\mathit{N}}\to \mathbb{R}$, for $\mathit{\rho }\mathrm{>}0$, $Lρ(z,a,λ)=g(a¯)+∑i=1Iλi⊤(zi−ai)+ρ2zi−ai22,$ in a distributed way, cf. [5]. Following [7], the ADMM algorithm for (9) yields the three-step iteration $\ell ↦\ell +1$, $ziℓ+1=argminzi∈Dizi⊤λiℓ+ρ2zi−aiℓ22$(10a)$aℓ+1=argmina∈RINg(a¯)−∑i=1Iai⊤λiℓ+ρ2‖ziℓ+1−ai‖22$(10b)$λiℓ+1=λiℓ+ρ(ziℓ+1−aiℓ+1)$(10c) until some termination condition is satisfied. Note that (10b) is an unconstrained optimization problem and can be solved explicitly. The problem (10a) can be solved in parallel by each battery in the MG introduced for our model in Section 2.2. Note that scheme (10) assumes communication within the MG, more precisely, each system i, $\mathit{i}\in \left[1:\mathcal{I}\right]$, sends its optimal solution ${\mathit{z}}_{\mathit{i}}$ to the CE and receives both the updated auxiliary ${\mathit{a}}_{\mathit{i}}$ and dual variable ${\mathit{\lambda }}_{\mathit{i}}$ in return. The variant discussed in [7] avoids unnecessary communication overhead by returning a broadcast variable instead, which only incorporates information on the aggregated values.

According to Theorem 3.1 in [7] the optimization scheme (10) converges in the following sense.

#### Theorem 1.

Consider Problem (9) with g being strictly convex, closed and proper and let the iterates $\mathrm{\left(}{\mathit{z}}^{\ell }\mathrm{,}{\mathit{a}}^{\ell }\mathrm{,}{\mathit{\lambda }}^{\ell }\mathrm{\right)}$ be computed according to (10). Then the following following statements hold true:

• 1.

${\mathrm{\left(}{\mathit{z}}^{\ell }-{\mathit{a}}^{\ell }\mathrm{\right)}}_{\ell \in {\mathbb{N}}_{0}}$ converges to zero for $\ell \to \infty$,

• 2.

${\mathrm{\left(}\mathit{g}\mathrm{\left(}{\overline{\mathit{a}}}^{\ell }\mathrm{\right)}\mathrm{\right)}}_{\ell \in {\mathbb{N}}_{0}}$ converges to the optimal value ${\mathit{g}}^{\mathrm{\star }}$ of (9),

• 3.

${\mathrm{\left(}{\mathit{\lambda }}^{\ell }\mathrm{\right)}}_{\ell \in {\mathbb{N}}_{0}}$ converges to the dual optimal ${\mathit{\lambda }}^{\mathrm{\star }}$ of (9).

According to [7] and the references [5, Section 3] and [4, Appendix C] therein, problem (6) fulfils the assumptions of Theorem 1.

## 4 Surrogate models for ADMM

This section is dedicated to surrogate models for the optimization routine (10) within a single MG. For simplicity of notation we omit the index κ.

Due to the distributive structure of ADMM, the residential energy systems do not need to share information with their neighbours but only with the CE, see also the star-structure in Figure 2. In each iteration of ADMM, subsystem i has to transmit its solution ${\mathit{z}}_{\mathit{i}}^{\ell }$ of (10a) to the CE. The optimization scheme presented in Algorithm 1, however, suggests to run ADMM more than once in order to improve the performance w. r. t. to the objective function (1). In order to avoid unnecessary communication, we propose to use surrogate models to approximate the optimization routine (10). More precisely, we are interested in a function which approximates $\mathit{\phi }:{\mathbb{R}}^{\mathit{N}}×{\mathbb{R}}^{\mathcal{I}}×{\mathbb{R}}^{\mathit{N}}\to {\mathbb{R}}^{\mathit{N}}$: $φ(w¯,x(k),ζ¯)=z¯,$(11) for all feasible $\mathrm{\left(}\overline{\mathit{w}}\mathrm{,}\mathit{x}\mathrm{\left(}\mathit{k}\mathrm{\right)}\mathrm{,}\overline{\mathit{\zeta }}\mathrm{\right)}\in {\mathbb{R}}^{\mathit{N}}×\mathbb{X}×{\mathbb{R}}^{\mathit{N}}$. Note that we do neither assume knowledge on the local net consumption ${\mathit{w}}_{\mathit{i}}$, $\mathit{i}\in \left[1:\mathcal{I}\right]$, nor on the future SoC $\mathit{x}\mathrm{\left(}\mathit{n}\mathrm{\right)}$, $\mathit{n}\mathrm{>}\mathit{k}$.

Figure 4 (top) shows that if the approximation (11) is sufficiently accurate, the impact on the performance of the optimization scheme is negligible. Here, the costs $\mathcal{J}\mathrm{\left(}\overline{\mathit{z}}\mathrm{,}\mathit{\delta }\mathrm{\right)}$ after optimization are visualized for 48 consecutive time steps (equals 24-hours simulation time). In the experiment, we disturbed the ADMM solution in Algorithm 1 by uniformly distributed additive noise, i. e., $\overline{\mathit{z}}+{10}^{-\mathit{p}}·\mathit{d}$, where the vector $\mathit{d}\sim \mathcal{U}\mathrm{\left(}-1\mathrm{,}1\mathrm{\right)}$, and $\mathit{p}\in {\mathbb{N}}_{0}$ denotes the intensity of the disturbance.

Figure 4

Effect of mapping error in (11) (top) and of the approximation via radial basis functions (RBFs) and a neural network (NN) on the open-loop performance $\mathcal{J}\mathrm{\left(}\overline{\mathit{z}}\mathrm{,}\mathit{\delta }\mathrm{\right)}$ within 48 consecutive time steps (bottom). We use $\mathit{T}=0.5$h in (3a).

Note that (11) might yield approximations to the solution $\overline{\mathit{z}}$ that either aggravate the performance w. r. t. (6) compared to the solution $\overline{\mathit{w}}$ associated with $\mathit{u}\equiv 0$ or solutions that correspond to an infeasible control $\stackrel{ˆ}{\mathit{u}}\notin \mathbb{U}$. As a remedy, we propose to apply ADMM once after replacing it by a surrogate in the optimization scheme. More precisely, first we run Algorithm 1 using a surrogate in Step 4(b) until the while loop terminates and then we additionally repeat Steps 4 and 5 using ADMM.

## 4.1 Well-posedness

The following proposition states that for equality in (11), a proper mapping is defined. For a concise notation we replace the index ${\mathit{\kappa }}_{\mathit{i}}$ by i here.

#### Proposition 1.

Consider φ given by (11), where $\overline{\mathit{z}}$ describes the optimal solution of (6) computed via ADMM, i. e., $\overline{\mathit{z}}=\overline{\mathit{z}}\mathrm{\left(}{\mathit{u}}^{\mathrm{\star }}\mathrm{\right)}$. We assume all hyper-parameter to be fixed meaning that $\left\{\mathit{T}\mathrm{,}{\mathit{\alpha }}_{\mathit{i}}\mathrm{,}{\mathit{\beta }}_{\mathit{i}}\mathrm{,}{\mathit{\gamma }}_{\mathit{i}}\mathrm{,}{\mathit{C}}_{\mathit{i}}\mathrm{,}{\overline{\mathit{u}}}_{\mathit{i}}\mathrm{,}{\underset{_}{\mathit{u}}}_{\mathit{i}}\right\}$ in (3)(4) are constant over time for all $\mathit{i}\in \left[1:\mathcal{I}\right]$. Then φ is a mapping, i. e., for all $\mathrm{\left(}\overline{\mathit{w}}\mathrm{,}\mathit{x}\mathrm{\left(}\mathit{k}\mathrm{\right)}\mathrm{,}\overline{\mathit{\zeta }}\mathrm{\right)}\in {\mathbb{R}}^{\mathit{N}}×\mathbb{X}×{\mathbb{R}}^{\mathit{N}}$, there exists a uniquely determined $\overline{\mathit{z}}\in {\mathbb{R}}^{\mathit{N}}$ such that $\overline{\mathit{z}}$ is the solution to the optimization problem (6).

#### Proof.

First note that ADMM yields the unique solution of (6), see e. g., [5]. Furthermore, there are no constraints on ${\mathit{z}}_{\mathit{i}}$, $\mathit{i}\in \left[1:\mathcal{I}\right]$, and the future SoC can be interpreted as an affine function of the current SoC and the future (dis-) charging rate. Hence, expansion of (3a) and averaging of (3b) yield, $minuz¯(u)−ζ¯22,subject toxi(k+1+n)=αin+1xi(k)+T∑ℓ=kk+nαin+k−ℓ(βiui+(ℓ)+ui−(ℓ)),xi(k)=xˆi,and constraints (4),z¯(k+n)=w¯(k+n)+u¯+(k+n)+γ¯u¯−(k+n),n∈[0:N−1],$ where $\overline{·}$ denotes the corresponding average value w. r. t. all subsystems, in particular $\overline{\mathit{z}}\mathrm{\left(}\mathit{n}\mathrm{\right)}=\frac{1}{\mathcal{I}}{\sum }_{\mathit{i}=1}^{\mathcal{I}}{\mathit{z}}_{\mathit{i}}\mathrm{\left(}\mathit{n}\mathrm{\right)}$. This representation of (6) illustrates that the (predicted) average values $\overline{\mathit{\zeta }}={\mathrm{\left(}\overline{\mathit{\zeta }}\mathrm{\left(}\mathit{k}\mathrm{\right)}\mathrm{,}\dots \mathrm{,}\overline{\mathit{\zeta }}\mathrm{\left(}\mathit{k}+\mathit{N}-1\mathrm{\right)}\mathrm{\right)}}^{\top }$ and $\overline{\mathit{w}}=\mathrm{\left(}\overline{\mathit{w}}\mathrm{\left(}\mathit{k}\mathrm{\right)}\mathrm{,}\dots \mathrm{,}\overline{\mathit{w}}\mathrm{\left(}\mathit{k}+\mathit{N}-1\mathrm{\right)}\mathrm{\right)}$ and the current SoC ${\left\{{\mathit{x}}_{\mathit{i}}\mathrm{\left(}\mathit{k}\mathrm{\right)}\right\}}_{\mathit{i}=1}^{\mathcal{I}}$, uniquely determine the optimal solution $\overline{\mathit{z}}\mathrm{\left(}{\mathit{u}}^{\mathrm{\star }}\mathrm{\right)}$ obtained by ADMM.  □

#### Remark 2.

Note that $\overline{\mathit{\zeta }}↦\overline{\mathit{z}}$ as introduced in [19] does not define a mapping since the solution $\overline{\mathit{z}}$ of (6) not only depends on the reference value $\overline{\mathit{\zeta }}$ but also on the future net consumption $\overline{\mathit{w}}$ and the current SoC ${\mathit{x}}_{\mathit{i}}\mathrm{\left(}\mathit{k}\mathrm{\right)}$.

## 4.2 Radial basis functions approximation

Radial Basis Functions (RBFs) are used to interpolate functions based on a set of sampling data. We briefly recap some basics on RBFs. For a detailed introduction to theory and application see e. g., [20], for a similar approach where RBFs are used to replace ADMM we refer to [19].

Let $\mathit{M}\in \mathbb{N}$ denote the number of samples. Then, the interpolation function of (11) is given as the sum of basis functions ${\mathit{\psi }}_{\mathit{m}}:{\mathbb{R}}^{\mathit{N}}×\mathbb{X}×{\mathbb{R}}^{\mathit{N}}\to \mathbb{R}$, $\mathit{m}\in \left[1:\mathit{M}\right]$, and a regularization term $\mathit{q}:{\mathbb{R}}^{\mathit{N}}×\mathbb{X}×{\mathbb{R}}^{\mathit{N}}\to {\mathbb{R}}^{\mathit{N}}$. More precisely, $z¯≈φRBF(χ)=∑m=1Mψm(χ)αm+q(χ),$(12) where $\mathit{\chi }=\mathrm{\left(}\overline{\mathit{w}}\mathrm{,}\mathit{x}\mathrm{\left(}\mathit{k}\mathrm{\right)}\mathrm{,}\overline{\mathit{\zeta }}\mathrm{\right)}$ is the joint inputs of Proposition 1, and ${\mathit{\alpha }}_{\mathit{m}}\in {\mathbb{R}}^{\mathit{N}}$, $\mathit{m}\in \left[1:\mathit{M}\right]$. The basis functions are so-called radial basis functions of the form, ${\mathit{\psi }}_{\mathit{m}}\mathrm{\left(}\mathit{\chi }\mathrm{\right)}=\mathit{\psi }\mathrm{\left(}‖\mathit{\chi }-{\mathit{\chi }}_{\mathit{m}}‖\mathrm{\right)}$, where the kernel ψ yields support close to the sampling data ${\mathit{\chi }}_{\mathit{m}}$, $\mathit{m}\in \left[1:\mathit{M}\right]$. We choose an affine linear regularization $\mathit{q}\mathrm{\left(}\mathit{\chi }\mathrm{\right)}={\mathit{\beta }}_{0}+\mathit{B}\mathit{\chi }$. Note that different choices are possible. The missing parameters ${\mathit{\alpha }}_{\mathit{m}}$, ${\mathit{\beta }}_{0}$ and B are determined by interpolation conditions, cf. [19], [20].

In Figure 5, a possible fit via RBFs is visualized. Here, we interpolated given data from two-weeks of optimization (4540 data points) based on sampling data picking each 25-th data point to train (12). Then, we tested ${\mathit{\phi }}^{\mathrm{RBF}}$ on the following day, and plotted the fitting. Our implementation is based on the Matlab toolbox DACE [27]. Note that the evaluation time of the RBF approximation grows with the number of data points used. Already with 180 data points to train (12) with $\mathit{N}=6$ causes the function evaluation of ${\mathit{\phi }}^{\mathrm{RBF}}$ to be expensive, see Table 1. Using more data points would no longer yield an advantage over using ADMM w. r. t. computation time.

Figure 5

RBF and neural net fitting of the first component $\overline{\mathit{z}}\mathrm{\left(}\mathit{k}\mathrm{\right)}$ of $\overline{\mathit{z}}={\mathrm{\left(}\overline{\mathit{z}}\mathrm{\left(}\mathit{k}\mathrm{\right)}\mathrm{,}\dots \mathrm{,}\overline{\mathit{z}}\mathrm{\left(}\mathit{k}+\mathit{N}-1\mathrm{\right)}\mathrm{\right)}}^{\top }$ within 48 consecutive time steps indicating the quality of the approximation (11).

## 4.3 Neural networks approximation

Neural Networks (NNs) are a state-of-the-art method in artificial intelligence frameworks. Based on huge amounts of data $\mathit{M}\gg 1$ they are able to learn and recognize patterns in complex systems. We consider a NN of l-layers as an approximation to the mapping (11), i. e., $z¯≈φNN(χ)=σW[l]…σ(W[2]χ+b[2])…+b[l],$(13) where σ denotes the sigmoid function, and the weights ${\mathit{W}}^{\left[\mathit{l}\right]}$ and biases ${\mathit{b}}^{\left[\mathit{l}\right]}$ are determined during the training phase. Here, the number of neurons at layer $\mathit{l}-1$ and at layer l determine the number of rows and columns of ${\mathit{W}}^{\left[\mathit{l}\right]}$, respectively. Note that a separate neural network is trained for each MG. For an introduction to deep learning and neural networks we refer the reader to [28], [29]. To train the NNs, we used Matlab’s built-in toolbox nftool.

The overall goal of the approximation (13) is to be sufficient in the sense of the MPC performance shown in Figure 6. Our experiments in Figures 4 (bottom) and Figure 5 show that with one hidden layer of ten neurons only, a satisfying approximation on a 24-hours time window can be achieved if the training data is large enough. Note that NNs benefit from big data. In our case study, we trained the NN only on data corresponding to two weeks.

## 5 Numerical proof-of-concept

Model Predictive Control (MPC) is a method to tackle optimal control problems on an infinite time horizon by solving a series of finite dimensional optimization problems instead, see e. g., [9] for an introduction to non-linear MPC.

## 5.1 Model predictive control (MPC)

Consider the optimal control problem (6). In order to provide an optimal control sequence over an arbitrary long time horizon we use MPC. To this end, at current time instance $\mathit{k}\in {\mathbb{N}}_{0}$ we assume the future net consumption ${\mathrm{\left(}{\mathit{w}}_{\mathit{i}}\mathrm{\left(}\mathit{k}\mathrm{\right)}\mathrm{,}{\mathit{w}}_{\mathit{i}}\mathrm{\left(}\mathit{k}+1\mathrm{\right)}\mathrm{,}\dots \mathrm{,}{\mathit{w}}_{\mathit{i}}\mathrm{\left(}\mathit{k}+\mathit{N}-1\mathrm{\right)}\mathrm{\right)}}^{\top }\in {\mathbb{R}}^{\mathit{N}}$ to be predicted for all subsystems $\mathit{i}\in \left[1:\mathcal{I}\right]$. Based on the prediction, Algorithm 1 is executed (per MG) to determine control sequences ${\mathit{u}}_{\mathit{i}}$, $\mathit{i}\in \left[1:\mathcal{I}\right]$, and an exchange strategy δ. Then, only the first instances ${\mathit{u}}_{\mathit{i}}\mathrm{\left(}\mathit{k}\mathrm{\right)}$ and $\mathit{\delta }\mathrm{\left(}\mathit{k}\mathrm{\right)}$ are implemented and the time instance is incremented. Algorithm 2 outlines this MPC scheme.

Algorithm 2

MPC for coupled MGs

Note that Problems (6) or (8) and (2) have to be solved in order to determine ${\overline{\mathit{z}}}^{\mathrm{\star }}$ and ${\mathit{\delta }}^{\mathrm{\star }}$ in each MPC iteration. Therefore, the open-loop costs $\mathcal{J}\mathrm{\left(}{\overline{\mathit{z}}}^{\mathrm{\star }}\mathrm{,}{\mathit{\delta }}^{\mathrm{\star }}\mathrm{\right)}$ can be computed in each iteration as well (cf. Figure 4). However, since Step 3 in Algorithm 2 suggests to only implement the first instance of the controls computed in Step 2, these costs are not attained. Instead the stage costs $∑κ=1Ξζ¯(k)Iκ−∑ν=1Ξδνκ⋆(k)ηνκIνz¯ν⋆(k)2$(14) are realized at each time step $\mathit{k}\in {\mathbb{N}}_{0}$ (cf. Figure 6).

## 5.2 Usage of surrogate models in MPC

We compare the performances using ADMM, RBFs, and NNs on the lower-level, i. e., in Step 4(b) of Algorithnm 1. In all numerical simulations we set $\mathit{T}=0.5$, $\mathit{N}=6$, $\mathrm{\Xi }=4$, ${\mathcal{I}}_{1}=50$, and ${\mathcal{I}}_{2}={\mathcal{I}}_{3}={\mathcal{I}}_{4}=10$.1 The battery parameters were randomly chosen with mean values $\mathit{C}=0.98$, $\underset{_}{\mathit{u}}=-0.24$, and $\overline{\mathit{u}}=0.25$. Based on the battery capacities we set ${\stackrel{ˆ}{\mathit{x}}}_{\mathit{i}}=0.5{\mathit{C}}_{\mathit{i}}$. In order to incorporate losses along the transmission lines, we used the efficiency matrix, $η=1.00.90.90.850.91.00.00.850.90.01.00.00.850.850.01.0in(1).$ For simplicity of the numerical computation, we only replaced the lower-level optimization routine for MG 1 and, thus, avoid training a separate surrogate model for each MG. We used Matlab for implementation.

Results on the MPC closed loop can be found in Figure 6 and Table 1. In Figure 6 the closed-loop performances of ADMM (black line) compared to perturbed ADMM, and ADMM (black line) compared to the two surrogate models are visualized. Similar to the open-loop case, small disturbances in ADMM have little impact and RBFs outperform the NN. The first column of Table 1 compares the sum of all MPC closed-loop performances using ADMM, RBFs and a NN while in column 2 the average runtimes of these approaches are reported. Note that when using a surrogate, we call ADMM once per MPC iteration. As elaborated in [7] in each ADMM iteration an N-dimensional vector has to be transmitted twice. Hence, both surrogates reduce the need for communication. Two great advantages of ADMM are that the local optimization (10a) can be parallelized and the global optimization is independent of the size of the MG. However, a single function evaluation such as (12) or (13) is faster than running the entire ADMM optimization routine.

Figure 6

Impact of mapping error (top) and approximation via RBF and NN (bottom) on the stage costs (14) within 48 consecutive time steps.

Table 1

Comparison of the summed MPC closed-loop performance ${\sum }_{\mathit{k}=0}^{47}{\sum }_{\mathit{\kappa }=1}^{\mathrm{\Xi }}{\left(\overline{\mathit{\zeta }}\mathrm{\left(}\mathit{k}\mathrm{\right)}{\mathcal{I}}_{\mathit{\kappa }}-{\sum }_{\mathit{\nu }=1}^{\mathrm{\Xi }}{\mathit{\delta }}_{\mathit{\nu }\mathit{\kappa }}^{\mathrm{\star }}\mathrm{\left(}\mathit{k}\mathrm{\right)}{\mathit{\eta }}_{\mathit{\nu }\mathit{\kappa }}{\mathcal{I}}_{\mathit{\nu }}{\overline{\mathit{z}}}_{\mathit{\nu }}^{\mathrm{\star }}\mathrm{\left(}\mathit{k}\mathrm{\right)}\right)}^{2}$ and runtime (per call): ADMM vs. RBFs vs. NNs.

Note that in column 2 of Table 1 we ignored the communication between smart homes and CE which is needed to apply ADMM in practice. However, the runtime of ADMM impairs when executed in an actual smart grid while surrogates do not require additional communication.

In order to improve the performance of the NN, more sampling data has to be generated to increase the training set significantly. To avoid large offline computation times, we chose $\mathit{N}=6$, i. e., a prediction horizon of three hours, which is rather short compared to [7], [19].

#### Remark 3.

We point out two implementation details to solve (2) efficiently. First, note that the optimization (2) can be parallelized in n, since there is no coupling. Furthermore, we replace (2c) by $δκν(n)·δνκ(n)≤ε$ for some tolerance $\mathit{\epsilon }\mathrm{>}0$ to smooth the feasible set.

## 6 Conclusions

In this paper we recalled an optimization problem arising in large-scale electrical networks. We proposed an iterative bidirectional optimization scheme to tackle this problem in a distributed way, and showed numerically that a small error on the lower level does not have noticeable impact on the performance. Based on this observation, we replaced the lower-level optimization by surrogate models using radial basis functions and artificial neural networks. The numerical results show the potential of using these surrogates to reduce communication effort and computational time in MPC while preserving the overall performance.

## References

• 1.

S. Parhizi, H. Lotfi, A. Khodaei and S. Bahramirad. State of the Art in Research on Microgrids: A Review. IEEE Access, 3(1):890–925, 2015.

• 2.

D. E. Olivares, C. A. Cañizares and M. Kazerani. A centralized optimal energy management system for microgrids. In 2011 IEEE Power and Energy Society General Meeting, pages 1–6, 2011. Google Scholar

• 3.

R. Okubo, S. Yoshizawa, Y. Hayashi, S. Kawano, T. Takano and N. Itaya. Decentralized Charging Control of Battery Energy Storage Systems for Distribution System Asset Management. In 2019 IEEE Milan PowerTech, pages 1–6, 2019. Google Scholar

• 4.

D. P. Bertsekas and J. N. Tsitsiklis. Parallel and Distributed Computation: Numerical Methods. Belmont, MA, USA: Athena Scientific, 1989. Google Scholar

• 5.

S. Boyd, N. Parikh, E. Chu, B. Peleato and J. Eckstein. Distributed Optimization and Statistical Learning via the Alternating Direction Method of Multipliers. Foundations and Trends in Machine Learning, 3(1):1–122, 2011. Google Scholar

• 6.

B. Houska, J. Frasch and M. Diehl. An Augmented Lagrangian Based Algorithm For Distributed Nonconvex Optimization. SIAM J. Optim., 26(2):1101–1127, 2016.

• 7.

P. Braun, T. Faulwasser, L. Grüne, C. M. Kellett, S. R. Weller and K. Worthmann. Hierarchical distributed ADMM for predictive control with applications in power networks. IFAC J. Syst. Control, 3:10–22, 2018.

• 8.

A. Engelmann, Y. Jiang, T. Mühlpfordt, B. Houska and T. Faulwasser. Towards Distributed OPF using ALADIN. IEEE Trans. Power Syst., 34(1):584–594, 2019.

• 9.

L. Grüne and J. Pannek. Nonlinear Model Predictive Control. Theory and Algorithms. Springer, London, 2 edition, 2017. Google Scholar

• 10.

M. Khalid and A. V. Savkin. A model predictive control approach to the problem of wind power smoothing with controlled battery storage. Renewable Energy, 35(7):1520–1526, 2010.

• 11.

A. Parisio, E. Rikos and L. Glielmo. A model predictive control approach to microgrid operation optimization. IEEE Trans. Control Syst. Technol., 22(5):1813–1827, 2014.

• 12.

G. Graditi, M. L. Di Silvestre, R. Gallea and E. R. Sanseverino. Heuristic-Based Shiftable Loads Optimal Management in Smart Micro-Grids. IEEE Trans. Ind. Informat., 11(1):271–280, 2015.

• 13.

P. Braun, L. Grüne, C. M. Kellett, S. R. Weller and K. Worthmann. Model Predictive Control of Residential Energy Systems Using Energy Storage & Controllable Loads. Progress in Industrial Mathematics at ECMI 2014. Mathematics in Industry, 22:617–623, 2016. Google Scholar

• 14.

R. R. Appino, J. Á. G. Ordiano, R. Mikut, T. Faulwasser and V. Hagenmeyer. On the use of probabilistic forecasts in scheduling of renewable energy sources coupled to storages. Applied Energy, 210:1207–1218, 2018.

• 15.

R. R. Appino, M. Muñoz-Ortiz, J. Á. G. Ordiano, R. Mikut, V. Hagenmeyer and T. Faulwasser. Reliable Dispatch of Renewable Generation via Charging of Time-varying PEV Populations. IEEE Trans. Power Syst., 34(2):1558–1568, 2018.

• 16.

R. H. Lasseter. Smart distribution: Coupled microgrids. Proceedings of the IEEE, 99(6):1074–1082, 2011.

• 17.

P. Braun, P. Sauerteig and K. Worthmann. Distributed optimization based control on the example of microgrids. In M. J. Blondin, P. M. Pardalos and J. S. Sáez, editors, Computational Intelligence and Optimization Methods for Control Engineering, volume 150 of Springer Optimization and Its Applications. Springer International Publishing, 173–200, 2019. Google Scholar

• 18.

A. Sinha, P. Malo, and K. Deb. A Review on Bilevel Optimization: From Classical to Evolutionary Approaches and Applications. arXiv preprint arXiv:1705.06270, 2017. Google Scholar

• 19.

S. Grundel, P. Sauerteig and K. Worthmann. Surrogate Models For Coupled Microgrids. In I. Faragó, F. Izsák and P. Simon, editors, Progress in Industrial Mathematics at ECMI 2018, 30, 1 edition, Springer International Publishing, 2019. DOI: .

• 20.

M. D. Buhmann. Radial basis functions: Theory and implementations, volume 12. Cambridge university press, 2003. Google Scholar

• 21.

O. I. Abiodun, A. Jantan, A. E. Omolara, K. V. Dada, N. A. Mohamed and H. Arshad. State-of-the-art in artificial neural network applications: A survey. Heliyon, 4(11), 2018.

• 22.

H. Zhang, F. Xu and L. Zhou. Artificial neural network for load forecasting in smart grid. In 2010 International Conference on Machine Learning and Cybernetics, volume 6, pages 3200–3205, 2010. Google Scholar

• 23.

P. Siano, C. Cecati, H. Yu and J. Kolbusz. Real Time Operation of Smart Grids via FCN Networks and Optimal Power Flow. IEEE Trans. Ind. Informat., 8(4):944–952, 2012.

• 24.

K. Worthmann, C. M. Kellett, P. Braun, L. Grüne and S. R. Weller. Distributed and Decentralized Control of Residential Energy Systems Incorporating Battery Storage. IEEE Trans. Smart Grid, 6(4):1914–1923, 2015.

• 25.

E. L. Ratnam, S. R. Weller, C. M. Kellett and A. T. Murray. Residential load and rooftop PV generation: an Australian distribution network dataset. Internat. J. Sustain. Energy, 2015. Google Scholar

• 26.

J. Nocedal and S. J. Wright. Numerical Optimization. Springer, 2006. Google Scholar

• 27.

S. N. Lophaven, H. B. Nielsen and J. Søndergaard. DACE-A Matlab Kriging toolbox, version 2.0. Technical report, 2002. Google Scholar

• 28.

I. Goodfellow, Y. Bengio and A. Courville. Deep Learning. MIT Press, 2016. Google Scholar

• 29.

C. F. Higham and D. J. Higham. Deep Learning: An Introduction for Applied Mathematicians. arXiv preprint arXiv:1801.05894, 2018. Google Scholar

## Footnotes

• 1

Note that this setting yields the global optimization problem (7) with more than 1000 variables.

#### Manuel Baumann

Manuel Baumann received his Ph.D. in applied mathematics from Delft University of Technology in 2018. Prior to that, he studied mathematics at Technical University of Berlin (B.Sc.) and computer science at Royal Institute of Technology in Stockholm and at Delft University of Technology (M.Sc., double degree program). His research interests include numerical linear algebra, computational geophysics, and model-order reduction and optimization of power systems. He has published several journal papers in these fields including SIAM Journal on Scientific Computing and Springer Computational Geosciences. Since 2018, he is a post-doctoral researcher at the Max Planck Institute for Dynamics of Complex Technical Systems.

#### Sara Grundel

Sara Grundel received a Diploma in mathematics from ETH Zurich in 2005 and a Ph.D. degree in mathematics from the Courant Institute of Mathematical Sciences at New York University in New York City in 2011. Since then she has been holding a postdoctoral position at the Max Planck Institute in Magdeburg, Germany. In 2015 she became a research team leader focused on the simulation of energy systems.

#### Philipp Sauerteig

Philipp Sauerteig received both his B.Sc. (2016) and his M.Sc. degree (2017) in mathematics from Technische Universität Ilmenau, Germany, and started his Ph.D. at the Chair for Optimization-based Control in 2018. Currently, Philipp Sauerteig works as research assistant at his alma mater on distributed optimization and control of microgrids within the project “CONSENS: Consistent Optimization and Stabilization of Electrical Networked Systems” funded by the federal ministry of education and research. In 2019 was at the School of Information Science and Technology (SIST) at ShanghaiTech University in Shanghai, China, for a research stay. His interests are distributed optimization, model predictive control, multiobjective optimization, and surrogate models such as artificial neural networks.

#### Karl Worthmann

Karl Worthmann received the Diploma degree in business mathematics and the Ph.D. degree in mathematics from the University of Bayreuth, Germany. 2014 he was appointed assistant professor for “Differential Equations” at Technische Universität Ilmenau (TU Ilmenau), Germany. 2019 he was promoted to full professor after receiving the Heisenberg-professorship “Optimization Based Control” by the German Research Foundation in 2018. Karl Worthmann’s current research interests include systems and control theory with a particular focus on nonlinear model predictive control, stability analysis, and sampled-data systems. He was recipient of the Ph.D. Award from the City of Bayreuth, Germany, and stipend of the German National Academic Foundation. 2013 he has been appointed Junior Fellow of the Society of Applied Mathematics and Mechanics (GAMM), where he served as speaker in 2014 and 2015. Currently, Karl Worthmann is chairman “Mathematical Systems Theory” of the interdisciplinary GAMM activity group “Dynamics and Control Theory”. 2016 he received the best paper award in the category “Mathematics and Natural Sciences” of the TU Ilmenau.

Accepted: 2019-09-06

Published Online: 2019-11-30

Published in Print: 2019-11-18

Funding Source: Bundesministerium für Bildung und Forschung

Award identifier / Grant number: 05M18EVA

Award identifier / Grant number: 05M18SIA

Funding Source: Deutsche Forschungsgemeinschaft

Award identifier / Grant number: WO 2056/6-1

The authors gratefully acknowledge funding by the Federal Ministry for Education and Research (BMBF; grants 05M18EVA and 05M18SIA). Karl Worthmann is indebted to the German Research Foundation (DFG; grant WO 2056/6-1).

Citation Information: at - Automatisierungstechnik, Volume 67, Issue 12, Pages 1035–1046, ISSN (Online) 2196-677X, ISSN (Print) 0178-2312,

Export Citation