A set of comprehensive indicators to assess energy flexibility: a case study for residential buildings

, Abstract. The increasing share of renewable energy sources in the power industry poses challenges for grid management due to the stochastic nature of their production. Besides the traditional supply-side regulation, grid flexibility can also be provided by the demand side. Demand-Response is an attractive approach based on adapting user demand profiles to match grid supply constraints. Nevertheless, defining the flexibility potential related to buildings is not straightforward and continues to pose challenges. Commonly accepted and standardized indicators for quantifying flexibility are still missing. The present paper proposes a new quantification methodology to assess the energy flexibility of a residential building. A set of comprehensive indicators capturing three key elements of building energy flexibility for demand response, notably, capacity, change in power consumption and cost of the demand response action have been identified. The proposed methodology is applied to a residential building, whose heating system is controlled by means of a model predictive control algorithm. The building model is developed on the basis of the experimental data collected in the framework of a European Commission supported H2020 research project Sim4Blocks, which deals with the implementation of demand response in building clusters. The optimal control problem has been investigated by means of mixed-integer linear programming approach. Real time prices are considered as external signals from the grid driving the DR actions. Results show that the proposed indicators, presented in the form of daily performance maps, allow to effectively assess the energy flexibility potential through its main dimensions and can be easily used either by an end-user or a grid-operator perspective to identify day by day the best DR action to be implemented.


Introduction
Reducing greenhouse gas (GHG) emissions, increasing the penetration of renewable energy sources (RES) and improving energy efficiency are recognised as the three main targets of the Europe 2020 strategy [1]. To achieve these goals, a transition towards a new paradigm of the energy system, and in particular of the electricity grid, is required [2].
The experiences from countries such as Denmark, where renewables already cover up to 60% of the total energy demand [3], have shown that the integration of RES into the traditional power system network is a not straightforward process, due to the stochastic and intermittent nature of such sources, which stresses the stability and management of the grid [4]. Conventionally, the continuous balance between power supply and demand is managed by the supply-side, through regulation procedures driven by the instantaneous energy demand. With the increase of renewable energy penetration, a new concept for the energy system, where the demand-side is enabled to take part in the grid management, is emerging. In this context, the so-called Demand Response refers to "changes in electric usage by end-use customers from their normal consumption patterns in response to changes in the price of electricity over time, or to incentive payments designed to induce lower electricity use at times of high wholesale market prices or when system reliability is jeopardized" [5].
The ongoing electrification of building thermal loads to address defossilisation targets associated building demand, highlights the paramount role of the building sector to achieve ambitious EU targets. Buildings account for more than 50% of EU final energy consumption, 16% of which is met by renewables [6].
Among the available technologies for heating and cooling of buildings, heat pumps are recognised as one of the most suitable solutions thanks to their low CO2 emission levels and their capability to link the electricity and the heating/cooling sector, thereby providing energy flexibility to the power system. Moreover, EU Directive 2009/28/EC, on the promotion of the use of energy from renewable sources, recognises the heat pumps as sustainable energy devices [7].
Fisher et al. [8] provides a comprehensive review of the application and control strategies of heat pump systems in a smart grid framework. Their analysis highlights as a key development, measures aimed at easing the transition towards a decentralised energy system. Such systems are characterised by reliable and economic operations similar to the power grid, capable of integration of onsite generation from renewable sources and operations under variable electricity tariffs. Moreover, their work underlines the widespread use of advanced control strategies, such as model predictive control (MPC), due to their capability to outperform the more conventional control approaches, such as rule-based controls (RBC).
Nevertheless, comprehensive assessment of MPC potential through field-testing is still missing, as well as detailed techno-economic analysis and design criteria of such heat pump systems under smart-grid operations. Therefore, these topics are identified as areas where further research efforts should be focused. Similar conclusions were presented by Péan et al. [9] who carried out an exhaustive review on available control strategies for improving the flexibility potential related to the use of heat pumps in buildings. Despite their complexity and cost, compared to traditional rule base control, control strategies like MPC represents a promising solution, especially when the control action is aimed at minimising system operational costs. Nevertheless, it is concluded that further research activities should be carried out to investigate improved objective functions directly connected to the building energy flexibility activation, as well as the need of more experimental work [9].
Besides these considerations, the most suitable applications and control strategies aimed at unlocking the flexibility potential, thermal energy storage system (TES) represent a further key element from a DR activation perspective. Among the available technologies, water storage tanks and building thermal mass are identified as competitive solutions to provide energy flexibility [10,11].
Reynders et al. [12] investigated the energy flexibility offered by structural thermal energy storage, providing three key indicators capable of summarising the main flexibility dimensions: capacity, time and cost. The authors provide a generalised methodology to assess the flexibility potential offered by the structural thermal energy storage in buildings, considering different archetypes of the Belgian building stock. Their results show the effectiveness of the proposed key parameters to quantify the energy flexibility, as well as the need for a dynamic evaluation of energy flexibility including several boundary conditions (e.g. occupancy behaviour or solar gains).
Junker et al. [13] provides a quantification methodology based on a Dynamic Flexibility Function to identify the dynamic response of a building (or cluster of buildings) to a penalty signal coming from the grid. On the basis of the Flexibility Function and the adopted penalty signal, a Flexibility Index is defined to determine to what extent the building is capable of responding to grid requests, as well as quantifying the overall effectiveness in the use of the available energy flexibility.
Despite the amount of research aimed at assessing the energy flexibility offered by the building sector, common definitions and quantification methodologies are still missing, making comparisons between different studies difficult [14].
The aim of the present work is to provide a set of comprehensive indicators capturing the three key elements of building energy flexibility for demand response: capacity, change in power consumption and cost of the demand response action. These indicators are then used to establish performance maps aimed at facilitating the choice of appropriate DR actions, from an economic point of view, among all the possible implementable actions.
The following structure is adopted in the paper: Section 2 describes the methods used, the system modelling and the optimal control problem formulation. Section 3 presents a description of the case study analysed and Section 4 discusses the results obtained. Finally, Section 5 summarises the main findings of the work.

System modelling
A residential building equipped with a hybrid generator composed by an air-to-water heat pump (HP) and a gas boiler (B) is used as case study. A hot water tank is also considered as thermal energy storage (TES), connected in parallel to the load, as it is shown in Figure 1. The two generators are operated according to a control strategy resulting from the solution of an optimal control problem (OCP) aimed at minimising the end-user energy bill, while keeping the indoor temperature within the comfort constraints. The generators can be operated either alternatively, implementing fuel switching strategies based on either cost or CO2 emission minimisation, or simultaneously, according to the operational strategies (OS) reported in Table 1.
The TES adds a degree of freedom to the control actions, since it can be charged by the HP (# $,&'( ) during low tariff hours in the night and, then, discharged during the day as an auxiliary source (̇& '( ) to meet the load demand (OS 4 and 5) [15].
The HP is modelled by means of the so-called secondlaw efficiency ( 22 ), as shown in Eq. 1. (1) IJKL and I+MNOP are the sink and source temperatures, considered equal to the external temperature ( PQR ) and the HP supply temperature ( #$ IMS ), respectively. When the HP directly meets the load, the HP supply temperature is considered equal to the temperature required by the emission system ( PT ). Otherwise, if the HP is used to charge the TES, its supply temperature to the storage tank will be considered constantly equal to the maximum allowed storage temperature ( &'( T,Q ) plus a fixed Δ . The gas boiler is modelled by means of a constant efficiency ( . ) over its whole operative range.
The water tank is modelled as a perfectly-mixed tank, by means of the following energy balance: with: r water density; V storage volume; c specific heat of water; &'( storage temperature and &'( overall heat transfer coefficient of the tank.
The building dynamics are described by a linear statespace model as per Eq. 3: and represent the state and the input matrices, respectively, while is the state vector consisting of the node temperatures and is the input vector containing the input signals: thermal power delivered to the building by the generation system (̇) and weather conditions (i.e. solar radiation ( ) and ambient and ground temperature, PQR and kK-, respectively).
The approach is similar to that developed in [16], which is based on experimental data collected from a residential building located in a district in Wüstenrot (Germany).
In order to define a baseline case from which the energy flexibility of an implemented DR action can be quantified, a scenario with no DR measure is first considered. Once the baseline OCP is solved, the DR measures are implemented by reducing (down flexibility) the baseline heat pump electrical consumption ( #$_NPq ) to a fraction (p) of its value for a time-span Δ st , which is defined as: where Δ st TJK is the minimum duration of a DR request and δ ∈ ℕ ; is a positive integer variable.
The hourly electricity price ( Pn ) is used as an external signal to simulate the requested DR actions from the grid, according to the procedure described in [11]. When the electricity price is higher than an upper threshold value ( Pn Ryn-), the reference heat pump consumption is reduced by an amount equal to 1-p. Different scenarios are then considered by varying the values of p and d, respectively. Finally, for each scenario, a new optimal control strategy is defined by solving a new OCP in which the objective function is the same as that adopted in the baseline case and new constraints are included to take into account the DR actions, as specified in Section 2.2. Once the new OCP is solved, the energy flexibility is assessed in terms of capacity, duration and cost as per the indicators described in Section 2.3.

Optimal control problem
The aim of the controller is to minimise the daily operational cost of the system ( +S s,z ), while preserving the comfort condition within the building. To this end, the objective function is defined as the sum of the hourly operational costs over the whole day (T = 24 h), as shown in Eq. 7.
Two binary variables, #$,&'( and #$,) are introduced to identify the HP operation: if the HP is operated to charge the storage tank ( #$,&'( = 1), then it cannot be used to meet the load demand ( #$,) = 0), and vice-versa. This results in the constraint: Constraints on the operative limits of the two generators are introduced by means of the following inequalities: For the TES, the following constraints are considered: The first constraint (Eq. 11), is introduced to consider that the TES can deliver energy to the load only if its temperature is greater than the temperature required by the emitter system, while the second one (Eq. 12) controls the evolution of the TES temperature. Finally, the indoor temperature ( N++T ) is constrained during the occupied period by the comfort band: where N++T ($ is the desired setpoint value and ƒoe and ƒ•• represents the heating hours of the day.
Once the OCP described by Eqs. 7-13 is solved, the reference HP electrical consumption is derived as: Several DR measures are considered by introducing the following constraint: where t is the hour of the day during which the electricity price goes beyond the threshold value, thus activating the DR request. These threshold values are evaluated for each day as: with: s standard deviation of the distribution of the daily prices on the day-ahead market; Pn T,Q is the maximum daily price while P n is the mean daily price.

Flexibility indicators
In the present study, the indicators used to assess the flexibility offered by the adopted DR strategy are the flexibility capacity, the flexibility efficiency and flexibility cost. As highlighted by the presented literature review, these indicators provide a description of the three main dimensions that should be considered for a comprehensive characterisation of energy flexibility.
The cost associated with a DR measure (Δ •nPQ ), is defined as the difference between the operational costs resulting with and without DR strategy, +S_st s,z and +S_NPq s,z , respectively as given by Eq. 17 When a cost-optimal optimal control strategy is adopted, the introduction of a DR measure leads to higher operational costs, due to the deviation of the consumption pattern from the optimal one [11].
To identify indicators useful from a grid perspective, the storage capacity has been defined as the available electric energy flexibility ( ) based on existing literature [17]. This index measures the variation of the building electrical energy consumption over the period in which the DR action is active: Finally, to take into account the environmental impact of a DR action, the following performance index is introduced: The latter, defined as a primary energy efficiency index, is the ratio between the primary energy consumption achieved in the base case scenario ( .‚ ) and the one concerning the scenario in which the DR measure is applied ( st ).
It is noted that all these indicators are functions of the two parameters p and d, which characterise any DR action in terms of its intensity and duration. This means that it is possible to define maps as functions of these indicators which, in combination, can describe the overall building response to each DR action. This approach can be useful for different perspectives: from a grid point of view, an aggregator can use these maps to formulate its bidding strategy by exploiting all the flexibility potential offered by its assets. At the same time, these indicators can be used by legislative entities from a policy-making perspective, since they can identify the most environmentally sustainable DR actions based on primary energy consumption or the CO2 emissions savings.

Case study
A residential building located in Wüstenrot, Baden-Württemberg, Germany, is considered for the purposes of a case study. The building has three storeys with a total living floor area of 311 < and a total heated volume of 975 > . Tables 2 and 3 summarise its construction detail. The weather conditions used for the simulations correspond to the Stuttgart IWEC weather file provided in ASHRAE (2001). The comfort period is defined between 8 am -9 pm and within this time interval, the thermostatic set-point N++T ($ is set to 20 °C. The low temperature heating emitter system (underfloor heating) is supplied with water at a constant temperature PT = 35 °C. The hybrid generator is composed of an air-source heat pump (rated thermal capacity equal to 20 kW) coupled with a gas boiler (rated thermal capacity equal to the maximum load minus the HP capacity). The boiler efficiency . is considered constant and equal to 0.96. A 1 > water tank is considered as TES, whose temperature can vary within the range well as taxes are considered in accordance with [19]. The natural gas price is considered fixed at 0.07 €/kWh. Different scenarios are considered by varying the parameters p and d, in the range [0-1] and [1-8], respectively, which means varying the HP power consumption from the reference value down to zero (HP shut-down) for a time period that varies from a minimum of 15 min (Δ st TJK ) to a maximum of 2 hours. All the simulations were performed over the first week of January, with this period being representative of typical winter conditions.

Results
Starting from the base case scenario, Figure 2 shows the daily operation of the generators (Figure 2a) and the resulting evolution of the room and TES temperatures (Figure 2b), over the first week of January. It is noted that the controller prioritises the direct operation of the HP. The gas boiler and the TES are operated only during the first hours of the day, when the associated load demand peak is greater than the heat pump capacity. Moreover, the controller operates the heat pump to charge the TES during low-tariff night time hours. To understand the logic behind this optimal control strategy, it is useful to analyse how the performance of the two generators are affected by the different operative conditions. To this end, Figure 3 shows the evolution of ) and &'( over the third day of the analysed week.  The value of the at which the HP is equivalent to the gas boiler, from an economic perspective, is defined in Eq. 20 as: (20) Fig. 3. Heat pump performance (Day 3).
From Figure 3 it follows that these inequalities hold: This is a direct consequence of the lower supply temperature required for the HP to meet directly the load demand, compared to the higher supply temperature required to charge the storage tank. It is interesting to note that the inequalities expressed by Eq. 21 reflects the order of priority adopted by the controller and, consequently, the logic behind the optimal control strategy. Figure 4 shows the impact on the daily operation of the generators and on the evolution of the indoor and TES temperatures, when a DR event occurs during which the HP is turned-off for a duration of 2 hours. It can be observed that the reduction of the HP power consumption when the DR request is active coincides with the operation of both the gas boiler and the TES (Figure 4a). As shown in Figure 4b, the controller maintains the internal temperature at its setpoint value ( N++T ($ = 20 °C), avoiding temperature reduction of the zone during the DR event and thereby not compromising the building thermal comfort. Furthermore, if the daily variation of the HP power consumption between the two scenarios with and without DR is analysed, no rebound effect is observed (see Figure 5). This is a direct consequence of the capability of the controller (i) to predict the impact of the DR event on the evolution of the indoor temperature and (ii) to define the control strategy capable of minimising the deviation of the indoor temperature from its setpoint at the minimum cost.
Finally, besides the decrease in the heat pump power consumption and the absence of the rebound effect following the DR action, another important feature that can be highlighted is that when the DR event is active, the controller prioritises the gas boiler over the TES. Once again, this is a consequence of both the generator efficiency and the adopted energy prices. As can be observed in Figure 3, during the charging phases of the storage tank, the heat pump is operated with a which  is less than , and consequently with a greater operational cost. This is an important aspect that needs to be highlighted, since this implies that the TES affordability is strictly connected with; (i) the HP COP during the charging phase of the storage tank ( &'( ) and, (ii) energy price, which depends on local market conditions.
Once the control actions are identified, the three performance indicators (Eqs. [17][18][19] can be readily calculated for each day and for each duplet of intensity (p) and duration (d) of the DR event. In order to highlight how these indicators work, Figures 5-7 show the performance maps derived by applying the proposed methodology on the third day of the analysed week. Figure 6 shows the cost deviation associated with the DR measures obtained by varying the values of their intensity (p) and duration (d) in the range [0 -1] and [1 -8], respectively. As can be seen, the cost deviation increases as the value of p decreases and d increases. This is not surprising as both these parameters define how much the sub-optimal control strategy adopted by the controller due to the DR event deviates from the optimal one achieved in the base line case without DR. Furthermore, it can be observed that for p > 0.3, its impact on the cost deviation is higher compared to that of the parameter d, while it is the opposite when p < 0.3. This can be explained by considering that for p > 0.3, the boiler is capable of meeting the residual load demand which cannot be covered by the HP due to the DR events. On the other hand, for p < 0.3, the residual load demand is higher than the boiler capacity and, therefore, also the TES energy content has to be used to meet the load demand. To this end, the controller needs to operate the HP to charge the storage tank during the night, even when &'( < P® , providing the amount of thermal energy which cannot be delivered by the boiler alone during the DR event. Figure 7 shows the energy flexibility quantity ( ) map, versus the DR parameters p and d. Each point on the map corresponds to the area under the graph of the power difference ( Figure 5), during the hours of the day in which the DR request is active (grey marked areas in Figure 4). It is noted that a maximum of 9.4 kWh can be achieved. As for the cost-deviation, the available energy flexibility increases as the DR parameters increases. As highlighted by Eq. 18, the is proportional to both the time-span during which the DR request is active (d) and the percentage reduction (1-p) of the baseline HP power.
Finally, to give a comprehensive view of the DR actions that can be implemented by varying the parameters p and d, their impact on the primary energy efficiency is analysed (see Figure 8). As shown in Figure  8, the primary energy efficiency varies over the range 0.9 -1. The lower primary energy efficiency, achieved for high values of d and low values of p, is due to the increased use of the less efficient generator, in this case the heat pump, during the charging phases of the storage    tank. Due to the limited power of the gas boiler, the controller uses the energy content of the TES to meet the load demand. It can be observed that, as for the costdeviation map, the parameter p has a higher impact than the parameter δ on the shape of the efficiency surface. In this way, applying the proposed methodology for each day of the heating season, it is possible to evaluate a set of comprehensive indicators that can be used for instance by a grid operator (e.g., an aggregator) to identify its most profitable bidding strategy on the day-ahead market. In such a scenario, it is assumed that an aggregator receives the performance maps from the end-user. In this way, it is possible to evaluate all the possible combinations of the DR actions that can be implemented amongst the demand side units assessing the overall flexibility that can be offered to the grid together with its associated costs and environmental impact.

Conclusions
The present paper describes a methodology for assessing the energy flexibility offered by a residential building under various DR strategies. A set of comprehensive indicators were derived based on the flexibility dimensions proposed in the literature: capacity, efficiency and cost. All indicators were defined based on two dimensionless parameters capable of identifying the main dimensions of a DR request: its intensity (as percentage of reduction of the building power consumption) and its duration, 1-p and d, respectively. The impact of different DR measures can be characterised simply by mapping the proposed indicators over the allowable range for the parameters p and d. This information, presented in the form of daily performance maps, can then be used by a grid operator for the assessment of the overall flexibility that can be provided to the grid. This would make it possible to analyse all possible combinations of DR actions that can be implemented among end-users, knowing their associated costs and environmental impact.
A residential building equipped with a hybrid generator composed of a heat pump coupled with a gas boiler and an energy storage tank was used as a case study to evaluate the proposed methodology. Different DR measures were applied by reducing HP power consumption during a DR event. The DR activation request was defined according to the evolution of the electricity prices on the day-ahead electricity market.
The results showed that the system is capable of providing almost 10 kWh of electrical energy flexibility for a 2 hour DR event, with a primary energy efficiency of 0.93 and an additional cost of 2.5% with reference to the base-line non DR scenario. During this DR period, the heat pump is non-operational and the heating demand is provided by the gas boiler and TES system. While this study was focused only on the heating season, this methodology can be also be applied to a similar cooling season scenario. Finally, the analysis of the optimal control strategy highlights that, beside the HP operating efficiency during the TES charging phases, the affordability of the TES is strongly affected by the market condition. Its cost-effectiveness in applying load-shifting strategy was found to be strictly related with the values of the electricity prices, which in turns affects the P® and, consequently, the cost-effectiveness of the shifting strategy.
In closing, the methodology as shown, is capable of assessing the flexibility available from the various DR strategies that could be implemented at building level by considering their associated cost and efficiencies. Further work will investigate how this information could be aggregated on a district level.