Harnessing the flexibility of thermostatic loads in microgrids with Solar Power Generation

This paper presents a demand response (DR) framework that intertwines thermodynamic building models with a genetic algorithm (GA)-based optimization method. The framework optimizes heating/cooling schedules of end-users inside a business park microgrid with local distributed generation from renewable energy sources (DG-RES) based on two separate objectives: net load minimization and electricity cost minimization. DG-RES is treated as a curtailable resource in anticipation of future scenarios where the infeed of DG-RES to the regional distribution network could be limited. We test the DR framework with a case study of a refrigerated warehouse and an office building located in a business park with local PV generation. Results show the technical potential of the DR framework in harnessing the flexibility of the thermal masses from end-user sites in order to: (1) reduce the energy exchange at the point of connection; (2) reduce the cost of electricity for the microgrid end-users; and (3) increase the local utilization of DG-RES in cases where DG-RES exports to the grid are restricted. The results of this work can aid end-users and distribution network operators to reduce energy costs and energy consumption.


Introduction
The stochastic nature of solar and wind energy resources poses several challenges to the large-scale integration of distributed generation from renewable energy sources (DG-RES) into electricity networks, mainly in terms of reliability and economical feasibility [1][2][3].The flexibility, i.e., the possibility to adapt or shift the electricity generation profile in time, lost on the generation side due to resource variability needs to be compensated by an increased flexibility of the transmission and distribution systems, of the electricity markets and/or of the demand side [4].
The concept of smart grids encompasses different technical solutions that enable flexibility from other sources, such that consumption and/or generation can be shifted with respect to time.This can be achieved through enhanced monitoring and control functionalities, the use of (electrical and/or thermal) buffers and increased consumer participation through demand response (DR) programs [5,6].
DR can be defined as the set of possible actions voluntarily taken by consumers to change their energy usage-either in terms of quantity or timing-in response to an external control signal; e.g., price, resource availability or network security [7][8][9].Harnessing demand-side flexibility through DR (some examples of which are given in [7,8,[10][11][12][13] within the broader concept of demand-side management (DSM)) has become increasingly important within the framework of smart grids.The wide availability and large thermal capacity of thermostatically-controlled loads (e.g., heating, ventilation and air conditioning (HVAC) systems, refrigerators and water heaters) allows for their flexible operation without negatively impacting equipment performance.The aggregation of these types of end-user loads can sum large amounts of energy and have thus become a valuable flexible resource for the implementation of DR programs [14][15][16][17][18][19][20][21][22].
Harnessing the flexibility of end-users is also a more viable solution when compared to other options, such as electrical storage or network reinforcements.The costs of electrical energy storage systems are still prohibitive and, thus, limit their widespread adoption as a source of flexibility.Power system expansions are time consuming and also require significant investments that could be avoided with proper planning and the implementation of DR programs [9].
The benefits of DR are not exclusive to end-users or network operators, nor are their objectives primarily economical.Table 1 summarizes different objectives for deploying demand-side flexibility found in the literature and the stakeholders involved.
Table 1.Objectives for deploying demand-side flexibility.

Objective Stakeholder(s) References
Improve system balancing Transmission system operator (TSO) [9,17,21,23] Lower fossil fuel-based generation capacity TSO [24,25] Integrate renewable energy sources (RES) Distribution system operator (DSO) Policy makers Advocacy groups [26,27] Increase system operation efficiency DSO [9,16,28,29] Reduce energy usage and/or costs Customers (electricity bill and connection capacity) DSO (distribution losses) [19,27] Reduce CO 2 emissions Policy makers Advocacy groups [30] Another concept aimed at meeting emissions reductions, fostering the integration of DG-RES and tackling the hurdles faced by individual end-users is through smart microgrids.Microgrids have historically been proposed as a solution to overcome issues relating to the dispatch, control and interconnection of small generation close to customer loads in islanded situations (e.g., for emergency/backup power) [31].In recent times, they have been proposed as the building blocks for implementing smart grid functions in the distribution system [5,[32][33][34].Smart microgrids use enhanced communications and controls on top of power system components to enhance traditional functionalities and provide additional services to the grid when operating in grid-parallel mode.These additional services can help reduce the costs of energy supply and open the electricity markets for the participation of individual end-users through aggregation services [31].They can also improve the overall power system performance, for instance by integrating DG-RES, managing its intermittency at a local level and optimizing the interface with the external grid to flatten out peaks in consumption or control the infeed of renewables.However, DR within the context of smart microgrids is a topic still to be investigated [35].Moutis et al. propose planned suburban residential areas to be operated as microgrids with DG-RES and electricity storage to support the reliability of the electricity supply [36].Because the focus of the aforementioned work was on power quality and stability issues, the control of loads, storage and DG-RES were not considered.The authors of [36] nevertheless mention demand-side management as a topic for further research, concluding from their results that, apart from traditional voltage control, demand-side management may also play an important role in the successful, large-scale deployment of smart microgrids.
Efforts to implement DR have been mostly focused on using the flexibility of thermostatic loads of residential customers [9,11,15,18,[37][38][39][40][41].However, the DR potential of this customer segment in demonstration projects has turned out to be lower than expected due to low participation, limited flexibility of resources, large aggregation requirements and prohibitive entrance costs [41][42][43].
The flexibility of end-users in the commercial and industrial (C&I) sector makes an interesting case for the widespread use of DR programs to enable new paradigms for the operation and planning of smart microgrids.This type of end-user has an overall higher consumption footprint (50%-60% of primary energy consumption [44,45]) and a higher peak demand in comparison with residential customers [24,46].However, the systematic implementation of DR programs for C&I consumers has been limited.This is despite the fact that the C&I sectors were involved in managing power use through contracts with utilities and network operators since the advent of DR and other demand-side management technologies, as discussed in [8,9,37,46].Some reasons for the limited systematic implementation of DR in the C&I segment are: (1) C&I customers' individual energy needs and opportunities vary greatly from one another; (2) applications are either restricted in scope or related to ad hoc solutions for a particular industry or location; and (3) there is a lack of consideration and/or documentation of the lessons learned in previous projects [34,46].
An additional limiting factor of the systematic deployment of DR for C&I end-users is that quantifying and unlocking the flexibility of these customers is not always straightforward and requires, in many cases, the support of an extensive data collection framework and a deep understanding of processes inherent to the industry or the specific customer site [46][47][48].Flexibility can be defined as a function of the available appliances, the nature of the loads and the objectives of flexibility deployment [43].The problem is that most methods for quantifying flexibility are ex-post and based on the measurement results of very specific projects.Wattjes et al. look at a "quick and dirty" method to quantify flexibility through an ex-ante method by generalizing primary and secondary process loads in C&I premises, but it does not give a very precise indication of the flexibility of each type of load; only whether it could potentially be steered or not [49].
Flexibility can be quantified as a percentage of peak load reduction, but the amount and nature of the peak load needs to be known ex-ante in order to be able to determine what the impact of the flexibility is.This means that there is no input-output relationship given between flexibility and the nature of the loads.Furthermore, knowing the average percentage of flexibility does not guarantee that the flexibility will be available at critical peak moments.How the flexibility is deployed (i.e., what the optimization objectives are) also influences the DR actions that need to be taken.
Existing top-down approaches to quantify flexibility potential for DR, such as those found in [18,29,[50][51][52], are very valuable for traditional market players, such as energy suppliers and/or system operators with access to plentiful aggregated historical data, but no way to know what the system characteristics of each individual end-user are.However, one downside of the data-driven approach is that the link between historical and present/future usage could be compromised by a changing system infrastructure and operation, vis-à-vis DG-RES, electric vehicles, storage and other emerging technologies.Such historical data may also not be readily available, including the case of new buildings and business parks.Therefore, we propose a bottom-up, physical modeling approach that is complementary to data-based approaches and that could be useful for new market entities in the power system, such as (microgrid) aggregators, who do not necessarily have access to historical data, but do have access to the technical characteristics of the field devices they control on the supply and demand side.
Bottom-up physical modeling approaches used to determine DR potential from loads' physical constraints are documented in [53].The authors of [53] use physical models of household appliances to create aggregate profiles of prototypical residential dwellings, which they use, in conjunction with ambient temperature values, to train piecewise linear regression models to represent DR potential as a function of ambient temperature.Although the DR potential is based on arbitrary testing of different temperature setpoints within a certain comfort range and therefore no optimal temperature settings are achieved, this approach is very useful when dealing with large aggregations (in the order of thousands) of homogeneous buildings, but is not applicable in the business-park microgrid domain due to the heterogeneous nature of the buildings located in these types of areas.Another shortcoming of the DR potential assessment in works such as [53,54] is that, although their modeling approaches are very thorough, their DR quantification methods are based on load response scenarios that are neither dynamic nor optimal.
There are some works in the literature [27,29] that do combine an optimization framework with either a top-down [29] or a bottom-up [27] approach to assess DR potential.However, in order to determine the optimal building load schedule that will yield minimum electricity costs, they require solving two optimization problems ex-ante (energy minimization and energy maximization) to get the maximum and minimum power constraints for the main optimization problem.This approach is useful for small-scale problems with one or few building loads, but does not scale well to the microgrid domain, nor does it consider DG-RES scheduling.Here, we argue for a different methodology that enables us to optimize the load and DG-RES schedules for all customers inside a microgrid simultaneously under a single optimization problem.This is especially important when applied to microgrids with heterogeneous customer types and DG-RES.
In this paper, we propose an automated demand response framework that intertwines the domains of thermal systems and power systems by connecting the thermal dynamics of large buildings to their energy use.We test the proposed DR framework with a case study of a refrigerated warehouse in combination with an office building located in a business park with local PV generation.Our framework iteratively interfaces thermodynamic models of C&I customer premises with an optimization algorithm to show the link between energy flexibility and thermal loads; i.e., how flexibility can be harnessed from customer sites with thermostatic loads and what are the resulting benefit in terms of energy efficiency and cost.The DR framework we propose enables: 1.The operation of C&I areas as grid-connected smart microgrids in order to support the local use of DG-RES through flexible demand, optimize multiple building schedules at the same time through a common goal and create benefits for the stakeholders involved.2. The unlocking of the flexibility of thermostatic loads from commercial and industrial (C&I) consumers as the main source for reshaping consumption.
The DR implementation we propose aims to: (1) follow DG-RES production in a grid-connected business park microgrid in order to minimize either energy consumption or cost; and (2) treat DG-RES as a curtailable resource, preparing the ground for situations where the interface between the microgrid and the rest of the distribution grid is constrained.
The main contribution of this paper, thus, is that it combines an optimization-based demand response tool with a bottom-up physical modeling approach to highlight the relationship between flexibility and the nature of the loads independently from historical load data.
The rest of this paper is organized as follows: the motivation for this work and the methodology used are discussed in Section 2. The case study is described in Section 3. Numerical results are given in Section 4 and discussed in Section 5. Finally, conclusions and directions for future work are discussed in Section 6.

Methodology
This section first lists the main assumptions and methodology used for (1) the thermodynamic models of C&I buildings and (2) the modeling optimization framework.It also describes the interaction between the two models.

Assumptions
The scope of the work focuses on quantifying flexible electricity consumption and cost savings related to the heating or cooling processes in C&I end-user sites.For the purposes of this work, we define load flexibility as the ability of loads to be shifted in time by automated DR actions.This means that the loads are neither reparametrized nor curtailed, but rather only hastened or delayed depending on an external control signal.Human interactions with the loads are not considered as part of the flexible load used for our DR program, given that end-user behavior does not account for the main consumption in refrigerated warehouses or other types of industrial loads.
All loads that are not shiftable are considered a part of the buildings' inflexible baseload, i.e., the processes occurring in the building that are uncontrollable or uninterruptible in nature, and are neglected for the electricity consumption and cost calculations in this study.We assume ventilation gains/losses, as well as internal heat gains from lighting, people and equipment to be constant and, therefore consider the heating or cooling load required to balance out these gains and losses as part of the baseload of our buildings.
We assume that the mechanical heating or cooling system of the buildings has the same principle of operation as a heat pump with a forced air distribution system.We also assume that the forced air distribution system has a constant mass flow rate and is able to maintain a constant air supply temperature.
The heat transfer mechanisms we consider in our building model are conduction and convection.We consider radiative heat transfer as negligible compared to convective heat transfer due to the forced air distribution system of the mechanical heating/cooling system.This is because building materials have generally low emissivity values, and the working temperature differences between the indoor air, the building materials and the ambient are relatively low.
We also assume that all physical and thermal properties of building materials, as well as the indoor and ambient air remain constant, on the grounds that the temperature ranges we are working with are relatively small for any significant change in physical or thermal properties to take place.
The optimization framework aims to optimize the mechanical heating/cooling system schedules of the buildings in the smart microgrid on a day-ahead time horizon and with an hourly resolution.We assume that all end-users in the microgrid (consumers, prosumers and producers alike) are price-takers, meaning that they cannot influence the market electricity prices, and that electricity prices are the same for all consumers.We also assume that for the 24-h time horizon, hourly electricity prices can be perfectly forecasted or are either known via a previous agreement with the customer (i.e., through a contract where pricing schemes are stipulated).We do not consider peak capacity pricing schemes in our work, though they will be included in future work.Lastly, we assume that hourly ambient temperature and DG-RES generation values can be forecasted with a reasonable degree of accuracy.

Thermodynamic Models
The thermodynamics of C&I customer premises can be described by a first-order dynamic system.Reduced-order building models have been extensively proposed in the literature for satisfying different objectives; e.g., to test the effect of new building components [55], to size building components [56], to optimize building operation schedules and controls [26,27,[56][57][58] or forecast the energy performance of buildings [27].
We created a generic, lumped parameter resistance/capacitance (RC) circuit model to achieve a better understanding of how the thermal mass of buildings can unlock demand-side flexibility in terms of available shifting power and duration and possible energy/cost savings.This approach has been previously used in [14,20,55,59], among other works, to capture first-order transients without having to perform a heavily-detailed building simulation that would require an extensive previous knowledge of the buildings and their processes.Another advantage of having a relatively simple building model is that it also facilitates the real-time implementation in control systems, such as the optimization framework we propose in this work.
The energy balance at the building level is given by: where m a is the mass of the indoor air, c p,a is the specific heat capacity of air at 0 • C and the product (mc p ) a is the heat capacity of the indoor air in J/K; dT i (t)/dt is the rate of change in temperature of the indoor air with respect to time in K/s; and Qgains are the heat gains, Qlosses the heat losses and Qmechanical the heat supplied or extracted by the building mechanical heating or cooling system, in watts.
Heat gains and losses are broken down into the following categories [60]: • internal gains due to, e.g., people, products, lighting and/or equipment present in the building; • transmission gains or losses through the exterior surfaces of the building, such as the roof, walls, floor and windows; and • infiltration gains or losses due to mechanical ventilation and unintentional leakage through cracks and seams in the building.
As mentioned in the Assumptions section (Section 2.1), infiltration gains and losses are neglected.Rewriting (1) to expand Qlosses and Qgains , we have: The calculation method for each of the terms in (2) will be discussed in the following subsections.

Transmission Gains
Transmission gains through the building envelope are the heat flows between the indoor and ambient environment through each building envelope element n (i.e., the building walls, roof, floor and windows): where R env,tot , given in K/W, is the overall thermal resistance of the building envelope; i.e., the building's ability to resist heat flows: in which R conduction,n and R convection,n are the total thermal resistances due to each of the heat transfer mechanisms occurring in the building envelope, in K/W.
For each element n of the building envelope: where L n is the material thickness in m, k n the thermal conductivity coefficient in W/(mK), A n the heat transfer surface area in m 2 and h in−env,n and h env−amb,n are the convective heat transfer coefficients in W/(m 2 K) between the building envelope element and the indoor air or the ambient, respectively.The convective heat transfer coefficient values are experimentally determined and dependent on air velocity, flow regime and surface roughness of the building material.
Common values for different types of heat transfer media and surfaces can be found in [60,61].
The time constant of the building envelope is given by τ env = (R env,tot C env,tot ), where C env,tot is the overall thermal capacitance of the building; i.e., the building's capacity to store heat: with m n being the mass of building envelope element n in kilograms and c p,n the specific heat capacity of the material, in J/(kgK).

Internal Gains
As mentioned in the Assumptions section, internal gains from lighting, people and equipment are assumed to be inflexible (i.e., part of the baseload) and are therefore neglected in the building model.Product gains, in the case of the refrigerated warehouse, are not negligible, however, as they account for most of the cooling load of the system and are given by: with m p and c p,p being the mass in kilograms and specific heat capacity in J/(kgK) of the refrigerated product.Product temperature changes at a rate: where R p = 1/(h in−p A p ) is the thermal resistance between the product and the indoor air; h in−p the convective heat transfer coefficient between the product and the indoor air; A p the surface area of the product exposed to the refrigerated air; and C p = (mc p ) p the thermal capacitance of the product.Refrigerated warehouses have a lightweight construction with a high insulation value, which means that the thermal mass, i.e., the materials' inertia against temperature fluctuations, of the building envelope will be low.The bulk of the thermal mass in the refrigerated warehouse is due to the thermal capacitance of the products it stores.

Contribution of the Mechanical Heating/Cooling System
We assume that the mechanical heating or cooling system of the buildings has the same principle of operation as a heat pump with an air distribution system.The heating/cooling capacity of the mechanical system (i.e., the heat supplied or extracted by the building's mechanical heating or cooling system) is given by: where ṁa is the mass flow of the conditioned air, c p,a is the specific heat capacity of air and T supply is the temperature of the conditioned air, all of which we assume constant.The thermodynamic efficiency of the conversion of electrical power into mechanical power by the heat pump's compressor is given by the coefficient of performance (COP).Also known as the energy efficiency ratio (EER) in cooling applications, the COP is defined, in steady-state operation, as the ratio of heat supplied to or extracted from the building to the electrical power consumed by the heat pump or refrigeration system at a nominal temperature.In reality, the COP, similarly to the heating/cooling capacity of the mechanical system, is dependent on the difference between the the ambient temperature and the conditioned air supply temperature.This means that temperature dynamics are not taken into account with a nominal COP value, and energy performance in practice will be inferior if ambient temperatures deviate too far from the nominal temperature.
While [26,55,58] acknowledge the importance of variable COP, limitations with the black-box simulation software they employed precluded them from modeling a variable COP.We adapted the work of [56,62], where COP for heating and cooling were modeled as a quadratic function for a fixed supply temperature based on regressions from catalog data.In [62], the COP was modeled as a function of the heat source temperature.In [56], the COP was modeled as a function of the ratio between the supply temperature and the temperature difference between supply temperature and heat source.In our work, we approximate the COP as a quadratic function of the conditioned air supply and ambient temperatures, as described in (10):

Thermodynamic Model Building Blocks
The building thermodynamics were modeled in MATLAB-Simulink/Simscape by splitting the system into two submodels: 1. Building submodel, in which the geometrical characteristics, as well as the physical and thermal properties of the building materials are captured.2. Mechanical heating/cooling system model.
The inputs and outputs of the thermodynamic submodel of a C&I building are shown in Figure 1.The inputs to the mechanical heating/cooling system submodel are functions of time and are: • an ON/OFF signal to the heating/cooling system, denoted by β in Figure 1; and • the indoor temperature of the building, denoted by T in .
The output of the mechanical heating/cooling system submodel is the heat supplied to or extracted from the building by the heat pump/refrigeration system as a function of time, denoted by Qmechanical in the diagram.
The inputs to the building submodel are: • Qmechanical , from the mechanical heating/cooling system submodel; and • the ambient temperature as a function of time, denoted by T amb .The building submodel's states are the different temperatures of the building envelope and its contents: temperature of the indoor air, temperature of the products stored (in the case of the refrigerated warehouse) and the temperatures of the different elements of the building envelope.The model also requires some initialization parameters, which include the geometrical and material characteristics of the building and the initial states of the temperatures of the different components.
Apart from the different system temperatures, the outputs of the building submodel are the heat flows in each section of the building envelope and its contents and the power consumption of the building as a function of time, plus the total energy consumption of the building over the designated time horizon.
Section 3 gives the parameters used to populate the model for the case study that we developed.

Optimization Modeling Framework
This section describes the optimization modeling framework problem formulation.We combine the thermodynamic models of C&I buildings with an optimization modeling framework to show the link between energy flexibility and building temperature settings; i.e., how flexibility can be harnessed from customer sites with thermostatic loads and what the benefits are in terms of energy efficiency and cost.

Problem Formulation
Let us consider that the ON/OFF signal of the mechanical heating or cooling system of end-user i at time t is defined by the binary variable β(i, t).Let us also consider that the electricity consumption of the mechanical heating or cooling system of end-user i at time t is given by E(i, t).The net energy imported from the grid of all I end-users connected to the business park microgrid, E net (t), after the predicted contribution of local DG-RES in the microgrid E RES (t) at time t is given by: The optimization problem is to choose the switching schedules (β(i, t)) and PV production schedule (E RES (t)) over the whole time horizon, such that either energy consumption (13) or energy cost (14) are minimized; the building temperatures (T in (i, t)) will not exceed the critical values determined by the end-users (12b); and local renewable energy exports from the microgrid to the distribution grid are curtailed (12c).The optimization problem is also subject to the physical constraints of local energy generation from renewables in the microgrid (12d).The optimization problem takes on the form: In the energy consumption minimization problem, In the energy cost minimization problem: with λ(t) being the predicted retail price of electricity at time t.Constraint (12b) determines the flexibility of the building and enforces the critical temperature ranges for each customer, T min (i, t) and T max (i, t).The values of T in (i, t) are obtained from the thermodynamic building submodels.Constraint (12c) enforces the restriction of local DG-RES exports from the microgrid to the distribution grid.Constraint (12d) enforces the physical upper and lower bounds of local DG-RES production.
The binary variable β makes the problem mixed-integer, which is why we turn to (meta)heuristic methods in general, and genetic algorithms in particular, to solve the optimization problem.

Proposed Genetic Algorithm-Based Control
Although there are many control strategies being developed, there is still room for improvement, and one of the suggestions found in the literature is to use metaheuristic optimization algorithms to improve the performance of DG-RES and DR in microgrids [35].Genetic algorithms (GA) are an evolutionary optimization approach that iteratively searches for an optimal value of a certain fitness function over randomly-selected points in the definition domain [63].GA are advantageous to use in nonlinear mixed-integer problems, especially when handling integer variables.Additionally, because they handle multiple search spaces, GAs scale well to higher dimensional problems, especially if the search is parallelized [63].
The GA-based controller we propose is similar to the work of Zong et al. [26], who used this approach for managing the loads of a single refrigerated warehouse to take advantage of local wind production and reduce costs.Said work was done in the context of the Night Wind pilot project [58].The design variables of our GA-based control strategy are the switching and DG-RES production schedules, and the objective is to minimize electricity costs or energy for the total optimization time horizon and for multiple customer premises in a microgrid.In [26], the objective function is to minimize electricity consumption costs of a single building by using the indoor temperature of the building as the design variable.Our problem formulation introduces local DG-RES as a curtailable resource for instances where exports to the grid are restricted, while in [26], it is assumed that excess DG-RES production can be fed-in back to the distribution grid.

Interaction between Thermal Models and Optimization Modeling Framework
Conventional mechanical heating/cooling system temperature controls have a fixed set point temperature and fixed temperature trip points.The compressor switches off when the indoor temperature is lower than the difference between the set point and lower trip point (i.e., at T min for cooling applications and T max for heating applications).It switches on when indoor temperature is higher than the difference between the setpoint and the upper trip point (i.e., at T max for cooling applications and T min for heating applications); and takes the state of the previous time step when indoor temperature falls within the deadband.
However, the fixed-setpoint conditions of the temperature control restrict the flexibility of the thermal loads [51].By contrast, in order to harness and increase the flexibility of the thermal loads at C&I customer premises, we propose coupling the thermal models with the optimization modeling framework to devise an optimal on/off strategy for the heater or chiller to separately achieve the objectives of (1) minimal cost and (2) maximal energy efficiency and discuss the potential benefits of such a strategy.The resulting multidisciplinary DR framework iteratively intertwines the thermodynamic building model with the GA-based optimization.Figure 2 visualizes the interactions between the thermal models and the optimization modeling framework.
For every generation in the GA, each individual β in the population of candidate solutions is input into the thermodynamic model to get T in (i, t) and E(i, t).The outputs of the thermodynamic model serve as inputs for the optimization framework, where they are evaluated with respect to the constraints and the objective function.The best individuals of the generation are checked against the termination conditions and used to generate the new population for the next generation if the termination conditions are not met.If the termination conditions are met, the GA ends and returns (1) the optimal β that satisfies the objective function and (2) the objective function value.A block diagram of the GA showing the interaction with the thermal models is shown in Figure 3.The next section introduces the case study used to test the simulation framework that combines the thermal models with the optimization modeling framework.Numerical results for the case study are given in Section 4 and discussed in depth in Section 5.

Case Study
This section describes the case study used to test the interaction of the thermodynamic models with the optimization framework.The case study at hand consists of the business park operated as a grid-parallel microgrid, whose goal is to manage its end-users' loads and local energy generation in order to (1) minimize end users' energy costs or (2) maximize local energy consumption from local solar PV generation, per the problem formulation from Section 2.3.1.A refrigerated warehouse and a medium office building are located in the business park.

Description of Building Characteristics
The office's building parameters are based on [20,64], though we neglect loads related to user comfort (e.g., moisture control and CO 2 concentration levels) that were considered in [20], on the grounds that we consider them inflexible loads that form part of the building's baseload.
The refrigerated warehouse is a newly-built, one-story construction, whose building parameters were derived from the reference building stock found in [64].The design temperature for outdoor conditions of the refrigerating facility are set equal to the 0.4% wet-bulb temperature in the Netherlands: T amb = 20 • C, in accordance with ASHRAEguidelines [60].
The geometrical characteristics, as well as the thermal and physical properties of the materials used to model the refrigerated warehouse and the office building are given in Tables A1 and A2 in Appendix A.
We assume that the refrigerated warehouse serves as a bulk storage cooling facility.By bulk storage facility, it is meant that there is no product in-or out-flow during the 24-h time horizon of the optimization problem.This is a reasonable assumption because the optimization time horizon is less than the storage lifetime of the refrigerated products, which is in the order of weeks or months, depending on the type of [65].We assume that the temperature at which the product arrives is equal to the warehouse storage temperature, meaning that the refrigeration system is only used to maintain the product temperature.
Temperature control in both the warehouse and the office occurs with a conventional thermostat.In the business-as-usual scenario, the critical indoor air temperatures of the office building are T min,o f f ice = 19 • C and T max,o f f ice = 21 • C.These limits remain the same for our GA-based controller.
In the business-as-usual scenario, the critical indoor air temperatures of the refrigerated warehouse are T min,warehouse = 1 • C and T max,warehouse = 3 • C to keep product temperature stable at around 2 • C. Because the indoor air has less thermal mass than the products stored in the warehouse, indoor air temperatures fluctuate much faster than product temperatures.We propose to use the high thermal mass of the stored products as a source of flexibility.
Industry best practices dictate that product temperature during storage should be kept as stable as possible to avoid the deterioration of product quality and moisture migration of food products [65][66][67], although fluctuations between 1 and 2 • C are permissible [67].We set the maximum product temperature deviation in the refrigerated warehouse to plus/minus 1 • C with a tolerance of 0.3 • , which is well within the 2 • C limit for product quality preservation.Product temperature T p will be used for the constraints formulation of the optimization problem.This means that T p will be allowed to oscillate between 1 and 3 ± 0.3 • C in our GA-based controller.
We assume that the products in the warehouse are pelletized and stored in rows of pallets whose surface areas are exposed to forced air cooling.Product directly exposed to the chilled air will be the most sensitive to changes in indoor air temperature.With that in mind, we consider the product temperature to be the temperature at the surface of the pallet and the thermal mass of the product to be the specific heat capacity of the product times the mass of the product on the outer surface of the pallets.
The thermal and physical properties used to model the product inside the refrigerated warehouse are given in Table 2. 3851 J/(kgK)

Mechanical Heating and Cooling System Settings
The characteristics of the mechanical cooling and heating systems for the refrigerated warehouse and office building, respectively, are given in Table 3.

Parameter
Unit Warehouse Office Conditioned air mass flow, ṁ kg/s 125 0.6 Supply temperature, T supply Coefficients b 0 to b 5 used to calculate the COP for the warehouse chiller and office heating system were obtained from catalog values from [68,69], respectively, and are shown in Table 4. −0.000375 0

Local DG-RES: PV Production
This subsection describes the PV system located on the business park microgrid for use of all end-users of the microgrid.Consider a commercial one kilowatt-peak (kWp), polycrystalline silicone PV module.
The theoretical annual yield at standard testing conditions (STC) is 1041.6 kWh/kWp [70].Using empirical correction factors from [70] to adjust for deviations from STC for conditions in the Netherlands at an optimum orientation angle, we get a yield of 806.3 kWh/kWp.Assuming energy conversion losses of 80% and a module efficiency of 15%, the annual energy yield per square meter of PV panels installed is 98.22 kWh/m 2 /year.This means that 8.21 square meters would be required per kWp PV capacity installed.
Assuming there are 1600 square meters available for the installation of PV panels throughout the business park, the total PV capacity installed would be approximately 195 kWp.Solar irradiation values are taken from the Royal Dutch Meteorological Institute (KNMI) archives from a central location in the Netherlands for three representative days in the last 10 years: extreme summer and winter temperatures and a day representing average temperature conditions.
Figure 4 shows the energy production due to PV for the three scenarios of the study.The solid blue line represents the winter PV production profile' the dashed red line with asterisk markers represents the summer PV production profile' and the dotted green line with round markers represents the PV production profile for the average temperature scenario.Note that the slight decrease in energy production in the summer PV generation profile that can be observed around noon is most likely due to cloud coverage.The total energy produced over the time horizon for each representative day is tabulated in Table 5.These values will give the upper bounds for E max RES in the constraint (12 d).
We assume that there is no net-metering scheme nor financial incentive present to feed excess DG-RES production back to the regional distribution grid.For that reason, for the business-as-usual scenario, we curtail excess PV production.

Electricity Retail Prices
We assume that the microgrid aggregating entity is exposed to dynamic, day-ahead electricity prices and that the end-users connected to the business park microgrid have electricity contracts that follow said prices. Figure 5 plots the hourly electricity prices in A C/kWh used for the case study.

Genetic Algorithm
The design variables of the optimization problem, as mentioned before in Section 2.3.1, are the hourly switching schedules of the mechanical heating or cooling system for all customers, β, and the hourly forecasted DG-RES production schedule, E RES .For the 24-hour time horizon of the case study, β has a length of 48 (24 variables per microgrid end-user), and E RES has a length of 24.The resulting phenotype for the GA has 72 elements.Design Variables 1-48 are binary, while Design Variables 49-72 are continuous, whose values are limited by the constraint (12d) in the problem formulation.The fitness function (12a) is subjected to the constraints (12b) and (12c).Additional settings for the GA are as follows: the evolution is limited to 500 generations with a population size of 100 phenotypes; the crossover function rate is set at 0.8.Termination criteria for the GA are a minimum change in the fitness function value of 1 × 10 −5 and a maximum constraint violation of 0.3.

Numerical Results
This section presents the microgrid simulation results for the two optimization objectives formulated in Section 2.3.1-costminimization and energy minimization-performed in the context of three ambient temperature scenarios for the Netherlands: worst-case summer and winter temperatures and average ambient temperature.
We begin with the business-as-usual (BAU) case, meaning that temperature control is carried out by a conventional thermostat in the buildings and there is no local PV generation, nor any demand-response program in place.We then present the results of the effect of local PV in terms of net cost and energy reduction, but without the effect of DR.Then, we present the effect of DR in our smart microgrid, with regard to the energy consumption and the cost minimization problems solved by our proposed GA-based controller.We compare the optimization results for each temperature scenario (summer, winter, average) to the business-as-usual and PV-with-no-DR scenarios within the framework of the assumptions that we made.

Business-As-Usual Case
Table 6 shows the results for the BAU case for the business park microgrid, where there is neither local PV generation nor DR.Table 6.Results for the business-as-usual case for three temperature scenarios in the Netherlands.

Energy (kWh)
A Table 7 shows the effect of having local PV generation in the business park microgrid for each of the three temperature scenarios.From the table, it can be seen that the net load and costs at the point of connection of the microgrid with the regional distribution grid are reduced with respect to the BAU scenario.However, PV by itself does little in general with respect to peak reduction; only in the summer scenario was the peak reduced by approximately eight percent.

Optimization Framework
This subsection presents the simulation results of the GA-based optimization framework.These results show the effect of DR for both the energy and cost minimization problems on the business park microgrid.Results were obtained by parallelizing the GA computations into eight pools of workers using MATLAB's Parallel Computing Toolbox.The simulations were carried out using an Intel Core i7-3770 processor running at 3.4 GHz.
It is important to mention that the optimization framework deals with a non-convex combinatorial problem, which means that no global minimum can be guaranteed.We carried out the simulations several times for each scenario and have ported our best results after several iterations of

Cost Minimization
Results for the cost minimization problem for the three temperature scenarios are shown in Table 10. Figure 7 shows the results of the cost minimization problem for the average temperature scenario, the subplots and legends of which are homologous to those of Figure 6.Table 10 shows the positive effect of DR on energy and cost savings with respect to the scenario with PV, but no DR.Optimization results in terms of cost savings do not differ greatly from the results for the the energy minimization problem, despite the electricity consumption being slightly higher and energy savings being more modest in the cost minimization problem (e.g., consumption increase of 2.4% and savings decrease of 7% in the average temperature scenario).However, the load profile patterns in the cost minimization problem are more spread-out throughout the day to take advantage of both the low prices (see Hours 0-6 in Figure 7) and the availability of PV during the daylight hours (see Hours 5-17 in Figure 7); whereas, in the energy minimization problem, the loads are lumped around the times PV production is high (see Hours 5-17 in Figure 6).Table 11 shows the percentage of local PV utilization under the three temperature scenarios for: the case with PV, but no DR; and the cases with PV and DR.From the table, it can be seen that in the winter and average temperature scenarios, DR can improve the utilization of local PV resources under the energy minimization problem.In the summer scenario, the PV with no DR case has a better local PV utilization ratio than the cases with DR; however, net load and cost are still lower with DR activated.The energy minimization problem has a better local PV utilization ratio because, as mentioned before, the GA optimization harnesses the buildings' internal thermal masses to shift the loads and cluster them around the times where PV production is occurring, whereas the cost minimization algorithm uses the internal mass of the buildings to spread the loads throughout the day to take advantage of both low electricity prices and PV production times.Unlike the winter and average temperature scenarios, the PV utilization ratio is the same in the summer scenario for both the energy and cost minimization problems.The similarity of results observed among the summer scenarios can be explained by the fact that there is less load flexibility in the refrigerated warehouse.That is, because the refrigerated warehouse experiences larger heat gains due to the high ambient temperature, the rate of change in product temperature also increases.That means that the chiller has to cycle on and off more frequently to maintain the product temperature stable, leaving less space for the loads to be hastened or delayed.

Discussion
This section further discusses the results obtained and their practical implications.The limitations of the work are also discussed in this section.
The results obtained show in general terms that DR improves the utilization of local DG-RES by reducing (1) the net apparent load of the microgrid entity at the point of connection with the public electricity grid and (2) the overall cost of energy for the end-users connected to the microgrid.Both DR optimization objectives are an improvement with respect to the BAU scenario and the scenario with PV, but no DR.
Because of the non-convex, combinatorial nature of the optimization problem our DR framework attempts to solve, it is not possible to guarantee that the solution obtained at the end of a given simulation run will be the best one (i.e., a global minimum cannot be guaranteed), but the results presented in this work, based on a number of successive runs from which the best local optimum was selected, show a clear indication of the benefits of this framework.
From the end-users' perspective, the cost minimization objective for DR is the most desirable, as they pay less for the energy they consume.From the distribution network operator's perspective, the energy minimization objective for DR in the microgrid is more desirable.In the latter, consumption is shifted to times of high DG-RES production, thereby potentially reducing both peak loads and peak injections.
The ability to curtail DG-RES in our framework only becomes interesting in the event of aging network assets that cannot cope with the large infeed of DG-RES, regulatory frameworks that restrict feed-in due to potential network problems or to avoid negative retail electricity pricing situations.Hence, the applicability of this feature depends on network constraints and also on policy decisions regarding the infeed of DG-RES.Adding network constraints to the model is the first direction that will be explored in our future work.
The results also give insight into the technical potential of using buildings' internal thermal masses to harness economic benefits for all end-users of the microgrid when using shared resources.Synergies/complementarity between the different loads and DG-RES can be observed from the results, especially for the average (spring/fall scenario).For the summer and winter scenarios, the effect of having diverse users connected to the microgrid is diminished for our particular case study, as almost no energy was being consumed by the refrigerated warehouse in the winter, and the same went for the office building in the summer.
Nevertheless, by pooling shared resources and using DR to reshape the different customer loads to get complementary profiles, we can think of creating local, sustainable 'energy communities' in C&I business parks.However, clear contracts or agreements should be put in place on how to distribute these benefits among the end-users, perhaps based on their contribution to reshaping the apparent load profile on the point of connection with the regional electricity grid.
For this framework to be realized in a real-life implementation, an extensive monitoring and control infrastructure needs to be put in place.We also require reliable forecasting methods for DG-RES and temperature, in order to employ the deterministic approach used for the DR framework in this paper.Another precondition required for our model is to have previous knowledge of end-users' building parameters and characteristics (although not in great detail) to be used as an input for the thermodynamic models.Generic building models can be used to approximate real-life customer sites, but the more information that can be gathered on the building characteristics and processes, the more accurate the simulation results will be.

Conclusions
This work presented a multidisciplinary demand response framework that connects the thermal behavior of a building to its energy use by means of a dynamic model and is able to optimize the local energy generation and consumption of all end-users of the microgrid simultaneously.We tested the proposed DR framework with a case study of a refrigerated warehouse and an office building located in a business park with local PV generation in which energy use and electricity costs were optimized in two separate optimization problems.
Results showed the technical potential of DR for C&I customers in terms of: (1) a positive effect of automated solutions for thermostatically-controlled climate; and (2) a positive effect of local use of DG-RES (PV) on the 'energy community' as a whole.
Our framework demonstrated that flexibility can be harnessed from customer sites using the buildings' internal thermal masses in order to: (1) reduce the energy exchange at the point of connection of the microgrid to the regional electricity distribution network; and (2) reduce the cost of electricity for the end-users connected to the microgrid.
The combination of the thermodynamic physical models and the optimization method can be employed as a practical tool in future demonstration projects or commercial endeavors to gain insight on the value of flexibility from C&I loads in concentrated business areas in terms of cost and energy efficiency without the need to resort to expensive field trials.We believe this tool represents a step forward towards the systematic implementation of DR schemes in the C&I domain, especially for end-users clustered as a local energy community that manages their own energy flows.
One possible extension of this work could be not only to set up an interaction framework that defines roles, functionalities and mechanisms within the smart microgrid stakeholders to distribute benefits, but to extend the framework in such a way that it can link and expand the effects of DR in the microgrid to a greater distribution area.Other future directions of the work include: adding network constraints to increase the realism of the model and test its robustness and considering capacity pricing in addition to energy pricing in the cost minimization problem formulation.We also intend to test different mixes of DG-RES (wind and solar) and also consider adding dedicated thermal and/or electrical buffers to test their effect on possible off-grid applications.Adding more types of customers to the microgrid is necessary to test the scalability of our framework.Finally, another possible future direction of the work is addressing the uncertainties inherent in temperature, irradiation and pricing forecasts through a stochastic representation of input data and resulting problem formulation.

Figure 1 .
Figure 1.Inputs and outputs of the physical model.

Figure 2 .Figure 3 .
Figure 2. Smart microgrid simulation framework: interactions between the physical model and the optimization framework.

Figure 4 .
Figure 4. Solar PV generation for three representative days in the Netherlands.

Figure 5 .
Figure 5. Dynamic electricity pricing scheme for the end-users of the business park microgrid.

Figure 6 .
Figure 6.Energy minimization results for the average temperature scenario.

Figure 7 .
Figure 7. Cost minimization results for the average temperature scenario.

Table 2 .
Physical and thermal properties of the refrigerated products.

Table 4 .
Coefficients for coefficient of performance (COP) calculations.

Table 5 .
Maximum PV generation over each representative scenario.

Table 7 .
Results for the case illustrating the effect of PV without demand response for three temperature scenarios in the Netherlands.

Table 10 .
Results for the cost minimization problem for three temperature scenarios in the Netherlands.

Table 11 .
PV utilization with and without demand response (DR).

Table A2 .
Convective heat transfer coefficients used for the thermodynamic building models.