Model Predictive Control of Smart Districts With Fifth Generation Heating and Cooling Networks

—Fifth Generation District Heating and Cooling (5GDHC) networks, in which low temperature water is distributed to water-source heat pumps (WSHPs) in order to meet thermal demands, are expected to have a signiﬁcant impact on the decar-bonisation of energy supply. Thermal storage installed in these networks offers operational ﬂexibility that can be leveraged to integrate renewable electrical and thermal energy sources. Thus, when considered as part of a smart multi-energy district, 5GDHC sub-station devices (e.g., WSHPs, storage) may be optimally operated using Model Predictive Control (MPC) in order to match demand withlow-costsupplyofelectricity.However,theapplicationofMPC requirestheabilitytomodel5GDHCnetworkswithinthecontextofamulti-energysystem.Hence,thispaperextendsanexisting,gen-eralisedcontrol-orientedmodellingframeworkformulti-energysystemstoaccommodate5GDHCnetworks.Additionsincludethe abilitytorepresenthydraulicpumps,thermodynamiccycledevices(suchasWSHPs)andmulti-energynetworkswithintheframe-work.Furthermore,aneconomicMPC(eMPC)schemeisproposedforenergymanagementof5GDHC-basedsmartdistricts.Finally, acasestudyispresentedinwhichtheproposedeMPCcontrolleriscomparedwithrule-basedcontrolforeconomicoperationofa smartdistrict.


Model Predictive Control of Smart Districts With Fifth Generation Heating and Cooling Networks
Michael Taylor , Sebastian Long, Member, IEEE, Ognjen Marjanovic , Member, IEEE, and Alessandra Parisio , Senior Member, IEEE Abstract-Fifth Generation District Heating and Cooling (5GDHC) networks, in which low temperature water is distributed to water-source heat pumps (WSHPs) in order to meet thermal demands, are expected to have a significant impact on the decarbonisation of energy supply.Thermal storage installed in these networks offers operational flexibility that can be leveraged to integrate renewable electrical and thermal energy sources.Thus, when considered as part of a smart multi-energy district, 5GDHC substation devices (e.g., WSHPs, storage) may be optimally operated using Model Predictive Control (MPC) in order to match demand with low-cost supply of electricity.However, the application of MPC requires the ability to model 5GDHC networks within the context of a multi-energy system.Hence, this paper extends an existing, generalised control-oriented modelling framework for multi-energy systems to accommodate 5GDHC networks.Additions include the ability to represent hydraulic pumps, thermodynamic cycle devices (such as WSHPs) and multi-energy networks within the framework.Furthermore, an economic MPC (eMPC) scheme is proposed for energy management of 5GDHC-based smart districts.Finally, a case study is presented in which the proposed eMPC controller is compared with rule-based control for economic operation of a smart district.Index Terms-Model predictive control, smart districts, district heating and cooling, multi-energy systems.

I. INTRODUCTION
A S PART of the drive towards low carbon energy provision, the transfer of heat to or from buildings is often identified as an area for decarbonisation and efficiency improvements [1].Low temperature thermal networks which connect consumers of heating or cooling services to locally available heat sources or sinks are expected to play an important role in delivering these changes.Such networks are already in use at the district level in Europe and their operation is the subject of continued research [2].
Early generation district heating (DH) networks utilise centralised generation plant to distribute high temperature The authors are with the Department of Electrical and Electronic Engineering, the School of Engineering, The University of Manchester, Manchester, M13 9PL, U.K. (e-mail: michael.taylor-6@manchester.ac.uk; sebastian.long@manchester.ac.uk;Ognjen.Marjanovic@manchester.ac.uk; alessandra.parisio@manchester.ac.uk).
Color versions of one or more figures in this article are available at https: //doi.org/10.1109/TEC.2021.3082405.
steam/water, resulting in high thermal losses, high installation costs and the inability to exploit low-enthalpy heat sources [3].Fourth Generation DH (4GDH) technologies, as defined in [4], are characterised by lower operating temperatures and integration into sustainable energy systems.Lower 4GDH network temperatures of 30-70 °C, enabled by reduced heating demands from new or retrofit low-energy buildings, improve thermal efficiency and allow better utilisation of low-temperature renewable heat.However, despite 4GDH improving upon earlier generations, thermal losses would still be expected due to operation at above ambient network temperatures.Furthermore, 4GDH networks cannot serve cooling demands, they must instead be integrated with separate, similarly defined, fourth generation district cooling (4GDC) networks [4].
In contrast, Fifth Generation DH and Cooling (5GDHC) networks supply water to decentralised end-user substations serving both heating and cooling demands, independently of network temperature [2].Substations are equipped with water-source heat pumps (WSHPs) that are able to produce water at the desired temperature for heating or cooling, further improving thermal efficiency by allowing the networks themselves to operate at ambient temperatures [5].Unlike the traditional system of DH supply and return pipes, heating provision in 5GDHC systems is achieved by drawing water from a warm pipe, extracting the heat using a WSHP and discharging cooled water to a cooler pipe (see Fig. 1).The reverse is true for a cooling demand.Thus both heating and cooling can be supplied simultaneously by a single two-pipe network.5GDHC networks may have a centralised pumping station, with some users demanding heating and others cooling (bi-directional energy flow), or have decentralised pumps located at each substation, with users able to switch between demand for heating or cooling at different times (bi-directional mass and energy flow) [2].
Flexibility attained by utilising 5GDHC networks and large capacity thermal storage can be leveraged to support an electrical system with high penetration of renewable energy sources [6].Several technologies facilitate effective interaction of electrical and heat networks such as WSHPs, combined heat and power plants (CHPs), chillers and hydraulic pumps.These technologies enable shifting of thermal demand in order to accommodate electrical network requirements and thus partially decouple electrical supply and demand [7].This flexibility can be exploited in smart districts [8], in which monitoring and ICT infrastructure facilitate intelligent trading of multi-energy flows via distribution networks and automated multi-energy devices.However, advanced energy management control methods are needed to optimally integrate 5GDHC networks into these multi-energy systems [9].
Model Predictive Control (MPC) is a particularly promising method for management of smart districts.MPC is able to predict evolving system states, account for physical constraints and use a feedback mechanism to handle uncertainties in forecasted prices, renewable generation and demand.However, the lack of flexible approaches for development of multi-energy system models that are readily integrated into MPC formulations has hindered the application of advanced model-based control techniques [7].To address this problem, the Control Oriented Modelling framework for Multi-Energy Systems first introduced in [10] (referred to as COMMES herein) offers a generalised and scaleable method to describe multi-energy systems.This paper extends the original COMMES method by addition of multi-energy network models, a hydraulic pump model and an updated energy conversion model for matrix representation of thermodynamic cycle devices (e.g.WSHPs, absorption chillers).The extension therefore facilitates development of 5GDHC smart district models for integration into MPC schemes.

A. Related Literature
Several modelling examples for simulation and/or optimal design of low temperature networks have recently been proposed for 5GDHC networks in [11], [12] and [13].The models presented in [12] and [13] are intended for configuration design and are therefore not suitable for application in on-line energy management.The mixed-integer linear programming (MILP) based model proposed in [11] is notable for its multi-energy approach with inclusion of fixed-flow network pumps.However, it does not feature reversible WSHPs, or any powered cooling device, and is intended specifically for off-line optimisation of an existing district energy system.
Optimal control of network temperatures is demonstrated in [5], using substation agent controllers to negotiate heating or cooling provision so that temperature deviations from their pre-determined set-points are minimised.The control scheme delivers significant energy efficiency improvements over operation with free-floating temperatures, yet it lacks any form of predictive scheduling capability necessary to optimise use of storage.In the STORM project, findings of which can be found in [14] and [15], control of smart DHC networks is achieved using both central and distributed agents.Individual agents responsible for substation control each cooperate with a central MPC controller, employing distributed optimisation to fulfil a pre-determined control schedule.However, the distributed optimisation method is limited to convex system models and the central control schedule appears to be planned off-line, in which case it cannot account for unexpected disturbances.A hierarchical MPC scheme is reported in [16] for on-line 5GDHC network energy balancing, implemented as part of wider thermal system control for the FLEXYNETS project reported in [3], [17].The MPC controller optimises a centralised CHP and storage unit through an MILP-based prediction model, achieving an 11% cost improvement over rule-based control.Further improvements would likely be possible if the controller was also able to coordinate the actions of substation devices, rather than these being treated as if belonging to separate systems.Moreover, with the exception of [11], none of the modelling approaches discussed so far consider integrated multi-energy systems.Therefore, they cannot be adopted to fully exploit the interaction of electrical and thermal systems.
The general multi-energy management system presented in [18] employs hybrid system modelling to coordinate urban energy systems using MPC.The framework is highly versatile and suited to development of modular controller models for relatively small systems.Nonetheless, it is not clear how this approach would be used to represent system hierarchy or partitioning of aggregated resources, since the framework only considers individual modules that represent single resources or the connections between them.The aggregation of resources into sub-systems is a convenient way to manage complexity at large scales, particularly if distinctions need to be made regarding management responsibilities or spatial proximity.
These distinctions are intuitively made using the COMMES framework proposed in [10].This is a generalised multi-energy system modelling approach also used in the development of MPC schemes.Modular component models for storage and flexible prosumers are connected to an energy conversion model (ECM) describing conversion devices and power flows.These components, when aggregated together, form a multi-energy hub which may be connected to other hubs via energy distribution networks to form a district.This hierarchical structure is suited to describing system topologies in a concise manner and can readily incorporate network topologies at the district level.COMMES is especially useful for integrating 5GDHC networks because it facilitates modelling of bi-directional energy flows and uses mixed-integer constraints to implement logical conditions that describe device characteristics, such as multiple operating modes.However, it does not permit adequate modelling of hydraulic pumps or WSHPs, both of which are key substation devices in 5GDHC networks.Furthermore, the scale of system that can be modelled using the existing framework is limited to single hubs as network models have not yet been included.Hence, in this paper the framework is extended in order to develop models of 5GDHC based smart districts that are readily integrated into MPC based energy management schemes.The proposed extension of the COMMES modelling framework provides the only example of a generic, control-oriented modelling approach for energy management of smart districts, considering multi-energy networks and 5GDHC substations with thermodynamic cycle devices (reversible WSHPs, chillers), decentralised hydraulic pumps and energy storage.Furthermore, an economic MPC (eMPC) controller responsible for on-line energy management scheduling of an entire smart district is proposed using the extended framework.
Remark 1: The framework is applicable to 5GDHC networks with bi-directional mass flow via decentralised pumps.Nevertheless, the generality of the framework ensures it could also be applied for less complex systems, including those with earlier generation district heating and cooling technologies.
Section II introduces the COMMES framework and its extensions which are the main contributions of this paper.A case study is presented in Section III to demonstrate the effectiveness of the proposed eMPC scheme in comparison to simple rule-based control.

A. Existing COMMES Framework
The methodology presented here extends the functionality of the existing COMMES framework to model 5GDHC substations and networks.The reader is referred to [10] for a comprehensive description of the original work and its definitions; due to space restrictions only a minimal description and relevant equations are replicated here.

1) Energy Conversion Model (ECM):
The ECM is the fundamental component of COMMES that describes the combination, splitting and conversion of different energy flows through a hub, H (Fig. 2).Directional arcs represent paths through the ECM along which power can flow, with nodes representing the source or sink of each arc.Each node is associated with a specific energy carrier n and indexed by n H l (l =1, 2,...,m), where m is the total number of nodes in hub H associated with energy carrier n.For example, three electrical nodes in a hub would be indexed by e H 1 ,e H 2 and e H 3 .Power flow from a node n H j to another node n H k by means of a connecting arc (n j → n k ) is given by P H (n j →n k ) ≥ 0. Each arc has an associated factor η H (n j →n k ) which determines the amount of power arriving at the receiving node, used to represent conversion or loss between connected nodes.Two index sets are also associated with each node.These are I n l → , which denotes the set of sink nodes that n H l connects to, and I →n l , which denotes the set of source nodes that connect to n H l .The ECM uses a set of pre-defined nodes, i.e. terminal, sum, transmitter and switch nodes, to describe a variety of input-output devices, multi-mode devices and flow junctions.A fifth node type, i.e., injection nodes, is added to this set as part of the extensions detailed in Section II-C.
Terminal nodes represent interfaces to components outside of the ECM, such as network, storage or prosumer models.Power entering or leaving the ECM at a terminal node n H l is designated p H n l and may be positive or negative, respectively.These particular nodes may only have one adjacent node, n i , hence the power balance for a terminal node is given by: Sum nodes represent junctions within the ECM where flows split or combine: Transmitter nodes facilitate the description of devices such as CHPs which convert an input of one energy type into multiple output energy types with differing efficiencies.All flows leaving a transmitter node are equal to the sum of incoming arc flows: Switch nodes are sum nodes with added mutual exclusivity constraints on outgoing arcs that enable different operating modes to be modelled, e.g.heat pumps supplying heated water at different temperature levels.Binary decision variables δ H (n l →n j ) associated with outgoing arcs determine the active mode: To prevent simultaneous flows in opposite directions, mutual exclusivity constraints are also added whenever two nodes are connected by two directionally opposite arcs, i.e. bi-directional arcs: Logical conditions given in (4a) and (5a) are modelled as a system of mixed-integer linear inequalities, following the approach in [19].
2) Storage Model: COMMES uses a general n th order discrete-time state-space model to represent various energy storage units.For simplicity and without loss of generality, only first order single-input, single-output storage models are considered here.Thus the energy storage level Es H n l and the power charged/discharged Qs H n l to/from a storage device at a terminal node n H l are given by: where standby charge decay taking place in each sampling interval is represented by the loss coefficient α and ∆t is the assumed sampling interval duration; power flows are modelled with zero-order hold in each sampling interval.Power exchanged at the terminal node is expressed as: Bi-directional arcs between a storage-connected terminal node and its adjacent node within the ECM prevent simultaneous charging and discharging.In addition, the factors associated with these arcs are used to model, potentially different, charging η chg.and discharging η dis.efficiencies.
For battery storage technologies subject to degradation with each charge/discharge cycle, a cost function f (Qs H n l ) may be defined to capture general features of this degradation.Following the approach in [20], based on life-cycle test data for lithium manganese oxide batteries, a penalty is applied on the exchange of power with the battery: where λ deg is the linearised degradation cost coefficient.This approach only applies between specified state of charge (SoC) limits to prevent overcharge or over-discharge and maintain battery operation within a region of linear degradation cost vs.cycle depth of discharge.
3) Prosumer Model: Demand and generation of energy at a particular hub's terminal node can be combined and treated as a single prosumer.The prosumer model presented in [10] incorporates flexible demands with any combination of adjustable, pliable, shiftable or interruptible characteristics.Flexible demands are not covered here for the sake of simplicity, though they remain part of the COMMES framework.Instead, fixed demand L i (k) ≥ 0 and generation G i (k) ≥ 0 components may be used to model a prosumer M H n l at terminal node n H l : where N G n l and N L n l are the total number of generators and consumers at node n H l , respectively.Power exchanged between the prosumer and the terminal node is expressed as:

B. Framework Extension: Multi-Energy Networks
In order to maintain a tractable optimisation problem, several assumptions are made that avoid introduction of non-linearities into the network models.Firstly, it is assumed that hydraulic pumps are capable of supplying the required pressure head at maximum network flow conditions and gas pressure sufficient for maximum flow is provided by an upstream distribution network.These assumptions are satisfied when infrastructure is correctly designed to operate at known maximum flow conditions.It is also assumed that network side return temperatures at substation heat exchangers are maintained at fixed, pre-defined set-points, since the sampling time imposed by low-level temperature controllers is significantly shorter than the sampling time of eMPC.The assumption of fixed set-point temperatures is based on the work in [5], in which constant optimal set-point temperatures are identified for thermal networks serving heating and cooling loads; it is shown that the constant temperature approach offers comparable performance to varying temperatures, yet is much simpler to implement.Finally, common assumptions are made that nominal voltage is maintained across electrical networks and resistive losses are negligible.With these assumptions, modelling of pressures, temperatures and voltages can be avoided.
Whereas hubs are comprised of components connected to an ECM, districts consist of hubs connected to a network model.Nodes in the network represent electrical buses or pipe junctions and arcs represent electrical lines or pipes.Hence, for each network node l in network N : The interface between a network node and a given hub terminal node n H l is expressed as: It should be noted that, unlike gas or electricity networks, a 5GDHC network is assumed to be a closed system.This means that water flowing from the warm side of the network to the cool side must at all times be balanced by the reverse flow occurring elsewhere.As a result, there is symmetry in pressures and flows between the warm and cool sides of the network, hence only one side needs to be modelled.

C. Framework Extension: 5GDHC Substation Devices
1) Hydraulic Pumps: Hydraulic pumps are used to overcome pressure drop caused by friction and elevation changes in 5GDHC networks.These pumps are typically driven by electrical motors and significantly contribute to overall electrical power consumption.Decentralised fixed speed centrifugal pumps are considered within the current MILP framework.Centralised variable speed pumps could be accommodated if their range of operation is restricted (see [21]).However, the ability to model decentralised variable speed pumps requires non-convex modelling of network pressure.This is the subject of ongoing work, which focuses on extending the presented network modelling approach in Section II-B to also determine pressure in 5GDHC networks.
The electrical power Ψ required by a fixed speed centrifugal pump is a non-linear function of both pressure added to the pumped fluid and the volumetric flowrate φ through the pump.However, a good linear approximation of this relationship can be easily found by fitting a first-order model to manufacturer data over the operational range of φ [22]- [24]: where the standby power Ψ on and coefficient b can be obtained from pump characteristic curves.Hence, the electrical power consumed in order to pump water at terminal node h l , is determined by: where the volumetric flowrate in ( 9) is substituted with an equivalent expression using the relevant arc powers, fluid density ρ, specific heat capacity C p and fixed network temperatures T w and Tc.The binary variable δ H on is used to indicate if the pump is on.The general case of bi-directional flows at the terminal node is demonstrated in (10a), assuming that valves around the pump can be reconfigured to reverse the flow direction.For cases where power can only flow to or from the terminal node, P H (n i →h l ) (k) or P H (h l →n i ) (k) terms should be deleted, as appropriate.It is assumed throughout this work that decentralised network pumps are located at 5GDHC substations within each hub and therefore utilise electricity from the local hub.The electricity consumed by the pump is therefore supplied from an electrical terminal node e l : Although pumps in secondary heating medium circuits could also be modelled using (10a), it is reasonably assumed that this power consumption is small in comparison to network pumping requirements or power consumed by thermal devices.Hence, this power consumption is treated as fixed prosumer load to simplify the modelling.
2) Thermodynamic Cycle Devices: In the original COMMES framework, heat pumps are modelled using arc factors for direct conversion of electricity into a heating or cooling demand [10].This is suitable for heat pumps where heat transferred from the source does not need to be quantified, e.g.air-source heat pumps.However, for operation of 5GDHC networks it is necessary to model all flows between sources and sinks, both to balance the network and to determine pumping power requirements.
Electrical WSHPs, electrical chillers and absorption chillers each operate a thermodynamic refrigeration cycle [25][26].According to the first law of thermodynamics, and using the definition for the coefficient of performance of heating (COP), the cycle can be modelled by: where Q C is the heat absorbed from a reservoir at temperature T C and work W is used to reject heat Q H to a reservoir at higher temperature T H . Efficiency factor η carnot is used to represent the reduction in performance from the theoretical maximum (i.e.Carnot) COP.These definitions apply regardless of whether the modelled device is providing (11d) or removing heat (11e) but the definition of T H and T C changes in each case.For a 5GDHC network with fixed warm side and cool side temperatures (T w and T c ): where T load is the load temperature on the secondary side of the thermodynamic device and ∆T r is the temperature difference between water and refrigerant in the evaporator or condenser.
To accommodate both (11a) and (11b) as part of the ECM it is necessary to define a new injection node h l (Fig. 3) that accepts power injected by a node n i to increase heat flow from h i to h j : Node n i may be an electrical node, as in the case of a heat pump, or a heat node, in the case of an absorption chiller.If node n i is a switch node then all arcs connected to h l are only active when the binary variable associated with arc n i → h l is equal to 1: By supplying the injection node from a switch node it is possible to model reversible WSHPs and other multi-mode thermal generation equipment, e.g.tri-generation plants, as illustrated in Hub 3 of Fig. 5.

D. Control Scheme
A control scheme for energy management of a district with 5GDHC networks is illustrated in Fig. 4.An economic MPC (eMPC) controller schedules operation of the district over a prediction horizon with the objective of minimising external resource costs.Set-points determined by the eMPC controller for the current sampling interval are passed to lower level supervisory controllers, each responsible for a given hub.Actions are determined at the supervisory level with higher frequency in Fig. 4. Control scheme hierarchy for district energy management, adapted from [16].order to track these set-points, responding to deviations in expected demand due to unknown disturbances, incorrect forecasts or modelling inaccuracies.
The optimisation performed by the eMPC controller is based on the certainty equivalence principle, whereby future values of unknown daily price schedules, energy demand and generation are assumed known and equal to forecasted values.As forecasting methods are not within the scope of this paper, simple persistence forecasting is adopted which predicts that future disturbances are equal to historical values measured 24 hours previously.This could easily be substituted for more accurate forecasting methods.
The optimisation problem given in ( 13) is solved by the controller at each sampling instance (k) to give a solution vector x.The prediction horizon N p is a user-defined value that should be long enough to ensure long-term economic optimality.The index sets T,S,Tr,Sw and I identify all terminal, sum, transmitter, switch and injection nodes in the district, respectively.Bi-directional arcs are identified in Bd.The index sets Es,M,N and Ψ identify all energy storage units, prosumers, network nodes and pumps in the district, respectively.(8a) ∀N The objective function J(k) minimised by the controller consists of the economic cost to the district for importing, and revenue for exporting, energy from/to external networks.The purchase (selling) prices of electricity and gas at time k are denoted by π e buy (k)(π e sell (k)) and π g buy (k), respectively.The solution vector x =[P ⊤ dev P ⊤ sto P ⊤ int P ⊤ ext ] ⊤ that minimises (13) provides a schedule for all manipulated variables at the considered district energy flow management level.These are the device output levels P dev , rates of storage charge/discharge P sto , hub energy exchanges with internal networks P int and district energy exchanges with external networks P ext .This process is repeated at every sampling instant, incorporating feedback from system states in a standard receding horizon implementation of MPC.
Remark 2: It is assumed in this article that the district is operated by a single entity, as would be the case for a university, airport or hospital district, for example.This is the basis for ( 13), through which hubs are coordinated for the benefit of the overall district.This objective may also be used to control a district of independent hubs if it is assumed that they are part of a coalition also coordinated by a single entity, e.g. a commercial aggregator.In this case an additional benefit allocation mechanism would be required to ensure a fair distribution of revenue amongst cooperating hubs (see, for example [27]).
Remark 3: For the simulations reported in Section III-B, it is assumed that the simulated system shown within the dashed boundary in Fig. 4 follows precisely the set-points issued by the eMPC controller.The case study in Section III therefore demonstrates the effectiveness of the eMPC controller to continually schedule operation of the district, whilst stability and robustness are ensured by the actions of secondary-level controllers.

III. CASE STUDY
The general framework proposed in Section II is assessed by means of a simulated case study.The simulation description and results are described in this section.

A. Simulation Description
A fictitious smart district shown in Fig. 5 is used to exemplify the added capability of the extended framework.It comprises a commercial office hub (Hub 1), a supermarket hub (Hub 2) and a DHC hub (Hub 3).These are connected by a looped 5GDHC network and by radial electricity and gas networks.ECM schematics for each of the hubs are also given in Fig. 5, with arc conversion factors associated with devices provided in Table I (remaining arcs have unity conversion factor).Hub specific device parameters, such as operational limits and modelling coefficients, are given in Table II.Network modelling parameters are given in Table III.Table IV lists the index sets used to derive optimisation problem constraints for the district.Operational limits imposed on the system are represented by inequality constraints in the model.
1) Office Hub: A reversible WSHP serves both heating and cooling demands (M 1 h 7 & M 1 h 10 ) by either importing or exporting heat to the thermal network, via a pump (Ψ 1 h 1 ).Hot and cold water storage tanks (Es 1 h 6 & Es 1 h 9 ) decouple thermal demands from use of the WSHP.An auxiliary gas boiler is also present to ensure sanitary hot water can still be provided when the WSHP  is used for space cooling.In addition to 5GDHC substation devices, local electrical consumers and a solar photovoltaic (PV) array are combined as a prosumer (M 1 e 5 ) and a battery (Es 1 e 3 )is also located within the office hub.
2) Supermarket Hub: A refrigeration demand (M 2 h 5 )isprovided by a single mode WSHP whilst a relatively small demand for sanitary hot water (M 2 h 6 ) is met using an electrical immersion heater.Similarly to the office hub, thermal storage (Es 2 h 4 )i s present to decouple operation of the WSHP from demand, in this case a cold storage tank operating at temperatures below ambient.Although no electricity is generated within the supermarket hub, battery storage (Es 2 e 4 ) is available for energy arbitrage.

3) DHC Hub:
The DHC hub is needed to provide the balance of thermal demands across the district.It consists of a tri-generation system with connections to a large solar thermal collector (TC) (M 3 h 3 ) and seasonal storage (Es 3 h 4 ).The tri-generation system comprises a microturbine driven CHP (µ-CHP) and an absorption chiller which is able to use heat from the µ-CHP to provide cooling, with the remaining waste heat released to atmosphere.Surplus electricity from the µ-CHP is exported to the district.
Remark 4: The µ-CHP, due to its small size, is assumed to have greater flexibility than larger CHP units.Hence, the case study does not consider operational constraints on µ-CHP output levels such as minimum up and down-times.Given the considered sampling period, this is unlikely to significantly impact the results; however, such logical constraints could easily be included in the current mixed-integer framework if required (see [29], Section II-D).

4) Simulation Input Data:
The simulation uses data from February 2018 with a half-hourly sampling interval, totalling 1344 data points.Half-hourly electricity prices used in the simulation are those set in February 2018 by U.K. energy supplier Octopus Energy Ltd for customers on its Agile Octopus tariff [30].Fixed prices are assumed for export of electricity to the external grid and purchasing of gas, at 1 p/kWh and 2.8 p/kWh respectively.A battery degradation cost coefficient λ deg =3.15 p/kWh is applied to each battery, determined using the approach in [20].Historical data recorded for February 2018 in the University of Manchester's building management system were used to obtain representative profiles of energy generation and consumption.For clarity, data profiles are shown for a single weekday only (Figs. 6(a)-(d).
5) Comparative Rule-Based Control Scheme: In order to gauge the performance of the eMPC controller, a simple rule based control (RBC) scheme has also been simulated for the same period.This scheme uses simple if-then-else logic to assign priority for the use of resources (see Table V).Renewable generation is always dispatched, whilst batteries and thermal storage tanks are charged or discharged when the electricity buying price passes pre-specified threshold values, i.e. π E low =10and π E high =20.These thresholds have been tuned to achieve the best performance from the RBC controller for the considered system and electricity price profile.After local storage dispatch has been determined, the RBC scheme ensures that local hub demands are always met by dispatching remaining available resources.Any surplus energy is exported to internal networks.

B. Results
The data described in Section III-A were used to run a simulation over 1296 half-hourly intervals, with prediction horizon N =48.IBM ILOG CPLEX 12.9 [31] with MATLAB [32] API was used to solve the controller MILP problem on an Intel Core i5-6200 U CPU @ 2.30 GHz with 8.00 GB of RAM.The default relative MIP gap tolerance of 1 × 10 −4 was increased to   1 × 10 −3 ; this improves the computation time of the controller with only a marginal (<0.05%) increase in the optimal cost.For clarity, the results are plotted for a single weekday only (Figs. 7(a)-(e)).
1) District Energy Imports: The amount of energy imported to the district from external gas and electricity networks is shown in Fig. 7(a).Import of electricity is minimised by the controller during higher purchase price periods, to the extent that no electricity is imported between 17:00 and 18:30.As shown by the profiles of imported thermal energy in 7(b), electricity associated with 5GDHC substation devices is minimised at this time, relying on thermal storage and use of the office gas boiler to reduce use of network pumps.It is worth noting that 19% of the total electrical energy demand of 5GDHC substation devices over the month is used by the network pumps, substantiating their significance and necessary inclusion in the prediction model.2) Operation of Storage: Thermal and electrical battery storage levels are shown in Figs.7(c) and 7(d), respectively, for both the office and supermarket hubs.Fig. 7(d) clearly shows that the batteries are operated to take advantage of fluctuating electricity prices, charging at a lower price period and discharging when prices peak.The fact that this behaviour is also observed for the thermal storage in 7(c) highlights the coupling between these systems and supports their integrated optimisation.Also apparent from comparison of Figs.7(a) and 7(d) is the effect of the electrical network's main feeder capacity constraint on simultaneous charging of the batteries.In particular, between 04:00 and 05:00 the controller opts to stagger the rate of charging of each battery so that this constraint is not violated.This scenario shows the importance of including network constraints in the control problem formulation.If, conversely, network capacity constraints were not considered, i.e. if electrical import was only constrained by hub transformer capacity, then the main feeder capacity limit could be exceeded by simultaneous charging of the batteries.
3) DHC Hub Operation: The µ-CHP is always operational during periods when the electricity price is at or above approx.9 p/kWh (Figs.6(a) and 7(e)).During these periods it is more economical to supply district electrical loads using local gas-fired generation, even if there are no demands from the 5GDHC network at the time, leading to some charging of the seasonal thermal storage.This again highlights the importance of a multi-energy systems approach; a µ-CHP solely operated to satisfy thermal demands would have reduced output, resulting in higher electricity costs for the district.Fig. 7(b) shows that, by discharging seasonal storage, the DHC hub may still provide the balance of energy required by the thermal network when electricity prices are low and the µ-CHP is not operational.Regardless of whether there is an excess or a deficit of heat, the controller is able to schedule operation to balance the 5GDHC network since the DHC hub includes a multi-mode tri-generation plant.This capability relies on the determination of power exchanges between hubs and the network, and is therefore enabled by the addition of injection nodes to the COMMES framework.

4) Comparison With Rule-Based Control:
The simulation results using the proposed eMPC controller compare favourably with those of the RBC scheme introduced in Section III-A5, with an average daily cost that is 10.4% lower than that of the RBC scheme (Table VI ).The eMPC controller is able to achieve this improved economic performance whilst maintaining operation within prescribed limits, unlike the RBC scheme which was found to violate the main electrical feeder capacity limit on several occasions; this is due to the RBC scheme prioritising energy arbitrage and the satisfaction of thermal loads, whilst electricity is left as a degree of freedom to balance energy demands.Hence, the proposed eMPC controller performs significantly better than the RBC scheme, both in terms of optimality and operational feasibility.

5) Computational Performance and Optimal Cost:
Table VII shows the impact of increasing prediction horizon length on solver computation time.As expected, there is an increase in average computation time as the horizon length is increased from N p =12(6 hrs) to N p =48(24 hrs), although the average computation time of 0.83 secs for N p =48is well within acceptable limits for a control scheme with half-hourly updates.The maximum computation time for the particular case under study can be several seconds longer than the average.This may be explained since in most intervals it was only necessary for the CPLEX solver to explore the route node of the MILP problem before obtaining an optimal solution; longer computation time results from more exhaustive searches by the solver's branch and cut algorithm.With a smaller relative MIP gap tolerance, additional nodes would have to be explored more often, with an associated increase in average computation time.
If the system scale is significantly increased to incorporate a large number of hubs, long computation times could become problematic.However, referring to Fig. 8, which shows the effect of increasing horizon length on the overall cost for a single day, it is clear that increasing the prediction horizon length beyond N p =27offers little benefit in this case.Therefore, if computation times are likely to be excessive for larger systems, a similar analysis could be performed in order to determine a minimum horizon length for eMPC, thereby significantly reducing the size of the optimisation problem.

IV. CONCLUSION
In this paper a gap in the research into control of smart districts has been identified; namely, the need for a general model development technique which considers 5GDHC networks and which can be readily incorporated into MPC schemes.In addressing this gap, an extension to an existing control-oriented modelling framework for multi-energy systems has been presented.Hence, the contributions of this paper include the addition of models to represent multi-energy networks, hydraulic pumps and thermodynamic cycle devices.Using the extended framework, an eMPC scheme has also been proposed and analysed by simulation of a smart district featuring a 5GDHC network.In comparison to a simulation using rule-based control, the proposed scheme exhibits significantly better performance.The results highlight the importance of modelling energy system networks and interactions, both to improve optimality and avoid infeasible network operation.Experimentation to vary the eMPC prediction horizon length also indicated that there is potential to define a minimum horizon length, thereby minimising the problem size, in order to manage computational burden whilst maintaining optimal economic operation.

Fig. 3 .
Fig. 3. Schematic of a generic injection node h l .

Fig. 5 .
Fig. 5. Modelled topology of a smart district generated using the extended COMMES framework.Dashed boxes indicate ECM boundaries.

Fig. 6 .
Fig. 6.(a) Gas and electricity prices; (b) Office half-hourly energy demands; (c) Supermarket half-hourly demands; (d) Half-hourly energy generation from solar PV and solar TC.Profiles are those for 2 nd February 2018.Dotted lines in (a)-(d) represent forecasts, recorded on the previous day.

Fig. 7 .
Fig. 7. (a) District electricity and gas imports; (b) Hub imports from 5GDHC network; (c) Office hot tank and supermarket cold tank storage levels; (d) Office and supermarket battery storage levels; (e) District µ-CHP output.Results are those for 2 nd February 2018.

TABLE VI COMPARISON
OF DAILY COST (1 MONTH SIMULATION)

TABLE VII EFFECT
OF PREDICTION HORIZON LENGTH ON COMPUTATIONAL PERFORMANCE (1 MONTH SIMULATION) Fig. 8. Effect of prediction horizon length on overall cost, using data for 2 nd February 2018.