1 Introduction

In line with the energy and climate objectives, the share of energy generated from Renewable Energy Sources (RES) such as wind or solar energy is continuously growing, e.g. representing 30% in Europe in 2016Footnote 1. Despite their many advantages, the intermittent and non-controllable nature of RES is adding further stress to the energy network and hence, grid operators are often forced to curtail RES generation or to limit its further penetration in the most congested areas. Smart tri-generation districts (electricity, gas and heat) can be key to mitigate these issues and increase the renewable hosting capacity of the grid, provided their feature advanced energy conversion and storage capabilities. Being equipped with boilers and heat pumps, the next generation of smart districts are capable of converting electricity into thermal energy, whereby excess energy can be stored thanks to their storage capacity. Analogously, power to gas technologies transforms the electricity into methane so that the latter can be reused (i.e. by a gas boiler) or exported to a gas network. Unfortunately, even if these three networks are closely physically linked, different energy carriers are usually considered separately in energy management solutions, resulting in an under-optimal use of the capabilities of energy systems. Thus, there is the need of management algorithms which will ensure that the right conversion/storage method is chosen to avoid curtailment and maximise efficiency, taking into account all energy carriers. The optimal management of buildings has been commonly addressed by means of centralised approaches, which aggregate all needed information to make central decisions at a central controller. For example, Xiao et al. [1] proposed a novel approach that aims to reduce peak hours electricity consumption. In addition, some research papers used predictions in order to improve the quality of the proposed algorithms [2, 3]. However, the implementation of centralized approaches is typically not suitable for solving the multi-stakeholder district coordination due to the privacy and interoperability issues caused by a centralised optimisation strategy. In contrast, agent-based technology, which relies on dynamic, decentralised and hierarchical negotiation, is considered as a good solution for a smart grid communication because of the autonomy, reactivity, pro-activeness and collaborative capabilities of the agents [4]. For example, [5] proposes an agent that optimizes energy usage in commercial buildings by exploiting the flexibility of different occupants to hold event/meeting schedules. The work presented in [6] proposes a MAS-based control algorithm for building energy management system that is able to minimize energy costs while maximizing energy efficiency for all the energy zones using power system optimisations. Yuce et al. [7] presents a new scheduling algorithm for building energy management by using negotiation and optimisation algorithms. The proposed method requires (a) thermal energy modelling, (b) Artificial Neural Network (ANN) training, and (c) Genetic Algorithm-ANN (GAANN) based optimisation. This proposed algorithm integrates all building aspects: geo-metrical information, occupancy schedules, HVAC schedules and building materials details. Therefore, over the past years, some works have focused on designing new demand response schemes to better incentivise and coordinate the consumers. For example, in [8] authors formulated an energy consumption scheduling game, based on pricing tariffs which differentiate the energy usage in time and level. In order to minimize the peak-to-average ratio in aggregate load demand, the authors in [9] proposed to use a game theory for demand-side management. In the same context, a multi-party energy management model for smart buildings (integrating PV systems and automatic demand response) based on non-cooperative game theory is proposed in [10]. To address these challenges this paper proposes a MAS energy platform to optimise simultaneously the different energy flows of the district. In this context, this paper proposes the following contributions:

  • We model the district multi-vector energy management problem by means of a multi-vector energy coordination network.

  • We distribute this cooperative network among different agents and we use the ADMM algorithm as a coordination mechanism among these agents.

  • We empirically evaluate our approach via simulations showing how the proposed approach can significantly reduce the district energy costs.

The rest of this paper is organized as follows. We first formulate the district multi-vector energy management problem as an energy coordination network (Sect. 2.1), we continue by presenting the optimisation algorithms (Sect. 2.2) and by describing some of the implemented agent models (Sect. 2.3). Finally, we present some simulation results (Sect. 3) and conclude (Sect. 4).

2 Distributed District Multi-vector Energy Management

The objective of district multi-vector energy management is to ensure an optimal use of energy at district-level. With this aim we propose to model the optimisation problem by means of an energy coordination network and solve it distributively using advanced optimisation schemes based on the ADMM algorithm. Our approach rely on predictions of consumption, RES and grid prices and performs a day-head optimisation providing the scheduling for the operations of the different district dispatchable devices (storages, converters, generator).

2.1 Multi-vector Energy Coordination Networks

Following [11], an energy coordination network consists of a set of terminals, T, a set of devices, D, and a set of nets, N. By definition, a terminal is defined as a connection that models the energy exchange between a (single) device and a (single) net. Thus, each terminal \( t \in T \) is associated to an energy flow \( p_{t} = (p_{t} \left( 1 \right), \ldots ,p_{t} (H)) \in {\mathbb{R}}^{H} , \) over a time horizon \( H \in \text{N}^{ + } \). A device is associated to one or more terminals (i.e. transfer points) through which it exchanges energy. For each device \( d \in D \), d refers to: (1) the device; and (2) the set of terminals associated with the device itself. Furthermore, for all \( \tau \in [1,H],p_{t} (\tau ) \) is the energy consumed (if \( p_{t} (\tau ) > 0 \), otherwise produced) by device d through terminal t, during the time step corresponding to \( \tau \). In this paper, we consider \( p_{d} = \left\{ {p_{d} |t \in d} \right\}\,{\text{as}} \) the set of all power schedules associated with a device \( d. \, Then,\;p_{d} \,{\text{can}}\,{\text{be}}\,{\text{associated}}\,{\text{with}} \) a \( \left| d \right| \, \times H \) matrix. In addition to \( \left| d \right| \) terminals, each device d is also associated with: (i) a cost function \( f_{n} :{\mathbb{R}}\left| d \right| \times H \to {\mathbb{R}} \) that returns the operating cost of the device for a given energy schedule; and (ii) a set of constraints, \( C_{d} \), that \( p_{d} \) should satisfy in order to be a viable planning. Nets are energy exchange zones which constrain the energy schedules to satisfy physical constraints (i.e. energy balancing). We use the same notation for nets as we do for devices: every net \( n \in N \) has \( \left| n \right| \) terminals, an objective function \( f_{n} :{\mathbb{R}}\left| n \right| \times H \to {\mathbb{R}} \) and a set of constraints, \( C_{n} \), that satisfy the energy balancing condition \( (\sum_{t \in n} p_{t} \left( \tau \right) \, = \, 0,\forall \tau \in \left[ {1,H} \right]) \).

The global optimisation problem can be defined as follows:

$$ min_{{p \in {\mathbb{R}}^{{\left| \varvec{T} \right|\varvec{xH}}} }} \sum\nolimits_{d \in D} {f_{d} \left( {p_{d} } \right) + } \sum\nolimits_{n \in N} {f_{n} \left( {p_{n} } \right)} $$
(1)
$$ {\text{subject}}\,{\text{to}}\;\forall d \in D\,:\,p_{d} \in C_{d,} \forall n \in N\,:\,p_{n} \in C_{n} $$

where \( p = \left\{ {p_{t} |t \in T} \right\} \) is the set of all terminal power schedules of the network. Here, the energy cooperation network model is extended to model multiple energy vectors. Let \( T \) be the set of all terminals in the multi-vector energy coordination network. Let \( T_{e} \subseteq T \) be the set of terminals corresponding to the electrical network (i.e. those containing transfer of electric energy). Similarly, we define as \( T_{g} \subseteq T \) and \( T_{h} \subseteq T \) the set of terminals corresponding to the gas and heating network respectively. Figure 1 depicts a multi-vector energy network model for a generic district. Terminals corresponding to the heating flows \( (T_{h} ) \) are represented as red lines, terminals corresponding to electricity flows \( (T_{e} ) \) as blue lines and terminals corresponding to gas flows \( (T_{g} ) \) as green lines. In a similar way, heating nets are represented by red squares, electricity nets by blue squares and gas nets by green squares. Devices are represented by circles (each with the colour of the network to which they form part or in two colours if they convert energy from one network to another). The district is composed of four houses (from left to right): one equipped with a power-to-heat (P2H) device (i.e. heat pump or an electric boiler) that is connected to the electricity network, two connected and heated by the district heating network (DHN), and one equipped with a domestic gas-to-heat (G2H) device (i.e. a gas-fired boiler) that is connected to the gas network. On the generation side, we have one device for each possible thermal generator, each linked to the DHN through a net. Some of these generators are single-terminal devices, such as the gas-fuelled boiler and the solar thermal panels. Others such as G2H or P2H are two-terminal devices, having each terminal in a different network. All the buildings are connected to the electrical network even if their thermal energy is not supplied by electricity since they will have at least some baseline electrical load and possibly some local production (PV).

Fig. 1.
figure 1

Multi-vector energy network. (Color figure online)

Moreover, in addition to the electricity demand from the buildings, the electricity network is also connected to the heating network (through the P2H converter devices) and to the gas network (through the P2G device) which are seen as flexible loads. Unlike heating and electricity, for the gas network our focus is strictly on the P2G devices and consequently, buildings will only have a gas connection if they have a gas-fuelled boiler.

Finally, the electrical and gas network have each a device (i.e. the electrical/gas utility device) that models the connection with the respective utility through which each network is able to import/export energy from outside the district at the stipulated contract prices.

2.2 Optimisation Algorithm

The assumption taken here is that there are multiple actors involved in the multi-vector optimizer that, even if they agree on cooperating/coordinating, they are interested on keeping locally the control of their actions as well as any sensitive data regarding its internal business model, preferences, or assets. This will cover scenarios where for example the different energy carriers correspond to multiple independent entities. In this case the optimization will be carried out independently by the three different energy carriers. It can also cover scenarios in which the different prosumers as owners of their flexibility want to keep the control of their behind-the meter assets or they do not want to communicate their preferences to an external entity. Following [11], the optimization problem from Eq. 1 can be solved by a distributed iterative coordination protocol based on the ADMM. In more detail, given a scaling parameter \( \rho \) the ADMM algorithm follows the three steps below at each iteration \( k + \, 1 \):

The device-minimization step (i.e. parallelized among devices):

$$ \forall d \in D, \quad p_{d}^{k + 1} = argmin_{{p_{d} \in C_{d} }} \left( {f_{d} \left( {p_{d} } \right) + \frac{\rho }{2}\left\| {p_{d} - \dot{p}_{d}^{k} + u_{n}^{k} } \right\|_{2}^{2} } \right) $$
(2)

The net-minimization step (i.e. parallelized among nets):

$$ \forall n \in N, \dot{p}_{n}^{k + 1} = argmin_{{p_{n} \in C_{n} }} \left( {f_{n} \left( { \dot{p}_{n} } \right) + \frac{\rho }{2}\left\| {p_{n}^{k + 1} - \dot{p}_{n} + u_{n}^{k} } \right\|_{2}^{2} } \right) $$
(3)

The (price) scaled dual variables update (i.e. parallelized among nets):

$$ \forall n \in N, \quad u_{n}^{k + 1} = u_{n}^{k} + \left( {p_{n}^{k + 1} - \dot{p}_{n}^{k + 1} } \right) $$
(4)

where u are the dual variables associated with the energy schedule p. The first step is achieved in parallel by all devices, and then the second and third step are achieved simultaniously by all nets.

2.3 Models of Device Agents

In this proposal, each device component is responsible for defining its local cost function and constraints as well as for implementing the device-minimization step (Eq. 2). The next subsections detail these local sub-problems and optimisation steps for the two main technologies that are focus of this paper: thermal energy storage systems and converters.

Thermal Energy Storage System. A thermal energy storage system is a one terminal device that models a water storage tankFootnote 2 which water temperature (ɛ) varies depending if it is taking in or delivering energy (i.e. if \( p_{s} (\tau ) \) is positive or negative) and should be kept within minimum and maximum temperature limits, i.e. ɛmin ≤ ɛ(τ) ≤ ɛmax. Let ɛinit be the initial temperature of the water storage, i.e. ɛ(τ) = ɛinit. At each time step \( \tau \in [1,H] \) the water storage temperature evolves as:

$$ \upvarepsilon\left(\uptau \right) =\upvarepsilon\left( {\uptau - 1} \right) - \,\upeta_{\text{L}} (\uptau) \, + \frac{\eta }{V \cdot D \cdot C}{\text{p}}_{s} (\uptau) $$
(5)

where \( C^{min} \le p_{s} (\tau ) \le C^{max} ,\eta \in ]0,1] \) is the heat exchange efficiency, V is the volume of the storage tank, \( \eta_{L} (\tau ) \) are the tank losses and \( D,C \) are respectively constants related to the density and the specific heat of water. To resolve the take into consideration all device constraints, we use a Dykstra projection algorithm [12]. We set up the output \( y_{H,1} \) as a matrix of H values. We consider also a matrix \( InitialCharge_{H,1} \) that takes into consideration all losses, then Eq. 6 presents the calculation of the initial charge at a timestep \( \tau \):

$$ {\text{Initial}}\,{\text{Charge}}\left( \tau \right) = \frac{1}{\eta } \cdot \left( {\upvarepsilon^{\text{init}} - \sum\nolimits_{\tau = 0}^{i} {\upeta_{\text{L}} \left(\uptau \right)} } \right) $$
(6)

Converter. A converter is two-terminal device that transforms energy from one form (A) to another (B) such as converting electricity to heat. Electric boilers, gas boilers, heat pump and power to gas technology are modelled as converters devices. In this paper we use a simplified model for the converter which is based on three parameters: the minimum and maximum energy input \( (C^{min} /C^{max} ) \) and the conversion efficiency factor \( (\kappa \in (0,1]) \). Formally, the conversion equation for each time step \( \tau = 1 \ldots H \) is defined as follows:

$$ - {\text{p}}_{\text{B}} \left(\uptau \right) = \kappa {\text{p}}_{\text{A}} (\uptau) $$
(7)

where \( C^{min} (\tau ) \le p_{A} (\tau ) \le C^{max} (\tau ) \). For these constraints, the device-minimisation step can be computed analytically, as a projection on a hyperplane [13].

3 Verification of the Proposal Performance

Our simulations are carried out using JADE (Java Agent Development Framework) [14].

To show our proposal performance, we propose to simulate 2 scenarios with a time horizon H = 12. In the first scenario, we simulate separated networks (1 heating network, 1 electrical network and 1 gas network). The district electrical network is composed of 5 baseline loads, 3 renewable energy sources and a connection to the electric utility through which electricity can be imported/exported at fixed prices (varying between 0.12 and 0.33 €/unit for importing and fixed for 0.05 €/unit for exporting). The district heating network is composed of 5 baseline loads, 3 renewable energy sources, 1 thermal energy storage system and 1 generator with a price of 0.16 €/unit. The district gas network is composed of 5 baseline loads and one connection to the gas utility from which the district can import energy at the fixed price of 0.05 €/unit. In the second scenario, we connected all networks via converters (P2H, P2G and G2H with \( \kappa = 0.8,C^{min} = 0{\text{ and}}\,C^{max} = 10 \)). As data for the baseline loads, we use the domestic unrestricted consumers Elexon load profile [15]. The data for renewable energy sources are retrieved from [16] and varies between 0 and 1.25. Thermal storage parameters are defined in Simulation parameters defined in [17] with \( {\text{D = 1}} . 7^{ \circ } c/h \), V = 7570 L, C = 4.18 kJ/Kg°c, \( C^{max} = 90 \), \( C^{min} = 90 \), ɛinit = 10°c. Figure 2(a)–(c) shows the average cost per unit in both scenarios and for each network. First thing to observe is that for the heating network Fig. 2(b) the price per unit in the second scenario is zero since all the energy is produced either by heating RES or via converters imported from the other two networks. Instead, for the electrical network (see Fig. 2(a)) the cost of electricity for the first period is higher in the second scenario, since the excess of RES energy is exported to the heating network using the P2H converter and hence, the network does not receive the export price from the grid. Similarly, the cost per unit of the gas network is higher in the second scenario since the network exports through the G2H converter part of the energy. Figure 2(d) shows the total cost considering the three networks for the two scenarios. We observe here how there is a significant reduction on the district costs when optimising the three networks together.

Fig. 2.
figure 2

Average costs using both scenarios for each network

4 Conclusions and Future Works

In this paper, we proposed a distributed energy management for an eco-district taking into consideration all energy vectors. We resolved the optimisation problem using ADMM and implemented it as a MAS. Using different experimental inputs and via simulations, we showed the accuracy and the performance of the proposed approach. The results in this paper can be extended in several directions. First, the considered model can be generalized to include more devices (i.e. electrical vehicles, co-generation, etc.). Moreover, given all predictions we can extend all devices to optimise their decisions at each time slot according to the variations of predictions. Then, we plan to consider a dynamic scheduling of the control using closed loop control by which the steps are scheduled and adjusted regarding some external perturbations that cannot be predicted at the original time when the schedules were computed.