A Bi-Level Coordinated Optimization Strategy for Smart Appliances Considering Online Demand Response Potential

Demand response (DR) is counted as an effective method when there is a large-capacity power shortage in the power system, which may lead to peak loads or a rapid ramp. This paper proposes a bi-level coordinated optimization strategy by quantitating the DR potential (DRP) of smart appliances to descend the steep ramp and balance the power energy. Based on dynamic characteristics of the smart appliances, the mathematic models of online DRP are presented. In the upper layer, a multi-agent coordinated distribution method is proposed to allocate the demand limit to each agent from the dispatching center considering the online DRP. In the lower layer, an optimal smart appliances-controlling strategy is presented to guarantee the total household power consumption of each agent below its demand limit considering the consumers’ comfort and response times. Simulation results indicate the feasibility of the proposed strategy.


Introduction
With the development of the smart grid, increasing intermittent renewable generations are connected to the power grid [1].In contrast to the traditional peak load shifting requirements, the timing balance between peak demand and renewable energy production brings a new challenge for power system operation.Particularly in locations with a high solar electric capacity, the amount of power that must be generated from sources other than solar displays a rapid increase around sunset and peaks in the mid-evening hours, producing a graph that resembles the silhouette of a duck [2,3].For the duck curve [4], there exist two typical line segments reflecting poor load factors: the decreasing segment for the duck abdomen and the increasing segment of the duck neck, both of which induce poor load factors by reducing average load and increasing maximum load, respectively.
In power systems with a large-capacity power shortage, like the duck load curve where there is rapid growth of photovoltaic (PV) generation [5], the major concern for grid operators is, after times of high solar generation, that the power system must rapidly increase power output around the time of sunset to compensate for the loss of solar generation to keep electricity supply balance and the power system's frequency stability.Storage can be used to fix these issues to flatten the load curve and prevent generator output fluctuation with a more well-fitting load factor.However, cost is a major limiting factor for energy storage to be utilized in a broad way.
Besides strategies of generation side, demand side resources have high potential to smooth the load curve.With growing number of smart meters and smart appliances being applied on the customer side, more consumption data can be used by demand response (DR) technologies to participate in smoothing the load curve.Such growing availability of energy consumption data offers unique opportunities in understanding the dynamics on both sides including customer behaviors on the consumption side and operating requirements, planning, and optimization on the utility side.
Existing DR programs usually offer identical incentives to participant consumers within the programs.However, since consumers are different in terms of life-style, electricity usage pattern [6] and response to incentives, how to calculate the concrete demand response potential (DRP) value when a DR event occurs to make the most of the DR resources of all participant consumers is a question of great significance for every DR implementer.To answer this question, a natural first step is to evaluate how much electricity usage could be reduced for each participant consumer considering the willingness and behaviors of consumers in the period of the coming DR event [7,8].Although there are quite a few works evaluating consumers' DRP using various methods [9][10][11], a method that can dynamically identify the appliances' operation characteristics difference online is still missing, which motivates the work of this paper.
In recent years, smart appliances have been extensively studied at home and abroad.Lu [12] investigated the heating, ventilation and air conditioning (HVAC) load potential for providing load balancing service.Niro et al. [13] proposed a practical strategy that can control large-scale domestic refrigerators for demand peak reduction in distribution systems.Although these studies use the DRP of the smart appliances, the method of evaluating the DRP quantitatively online is still limited.Ahmed et al. [14] the home energy management scheduling controller of the residential DR strategy is proposed to predict the optimal ON/OFF status for home appliances which can significantly reduce the peak-hour energy consumption.Bhattarai et al. [15] presents a multi-timescale control strategy to deploy electric vehicle demand flexibility to solve grid unbalancing and congestions.Shad et al. [16] presents a methodology for estimating and predicting the state of individual domestic electric water heaters (DEWHs) from models of their thermodynamics and water consumption.Authors of [14][15][16] did not take into account the steep ramp like in the duck curve.While in [17], the proposed DR strategy is designed in two layers (including the neighborhood area network (NAN) and the home area network (HAN)), and takes into account consumer comfort and proposes its indices, the DR strategy in HAN ignored the response times limit of all the smart appliances.An intelligent home energy management algorithm which manages household loads according to their preset priority and guarantees the total household power consumption below certain levels is presented in [18], which can benefit electric distribution utilities and DR aggregators in providing an insight into the limits and DRP available in residential markets.Half-hour-ahead rolling optimization and a real-time control strategy are combined to achieve household economic benefits and ability to deal with complex operating environments in reference [19].Authors of [14][15][16][17][18][19] proposed different DR programs in residential household to provide the load shifting and curtailing of appliances.However, they did not consider the DRP of the smart appliances and lack the quantitative method of DRP.
In this paper, we focus on a large-capacity power shortage in power system, which consists of a dispatching center, multiple agents and plenty of consumers with smart appliances including air conditioners (ACs) which are used to refrigerate, water heaters (WHs) and electric vehicles (EVs).The potential of providing load balancing services in [12] is extended to online DRP evaluation for household appliances and includes the EVs which can be interrupted for a longer time than HVAC.This study proposes a bi-level coordinated optimization strategy which includes the distribution method for allocating the demand limit to each agent in the upper method and optimization strategy for satisfying the demand limit in the lower method.The main contribution of this paper can be summarized: (1) a bi-level coordinated optimization strategy for smart appliances is proposed to not only descend the steep ramp but also reduce the peak loads; (2) a quantitative method of DRP is presented to evaluate the smart appliances' DRP online based on their dynamic operating characteristics and comfort settings; (3) in order to satisfy the demand limit of each agent, an algorithm is formulated to guarantee the consumers' comfort and response times of smart appliances within the permitted range.
The rest of this paper is organized as follows.In Section 2, the bi-level DR strategy is proposed.Section 3 describes the appliance models and their dynamic characteristics.Section 4 presents the multi-agent distribution method based on the DRP in upper layer.In Section 5, an optimization control strategy is proposed for smart appliances to guarantee the total load below demand limit.Section 6 provides the simulations of different scenarios and illustrates the results.Finally, the conclusion is drawn in Section 7.

Bi-Level Structure Based on DRP
Large-capacity power shortage conditions are likely to occur during critical time, when cascading failures and large-area blackouts occur.DR has been envisioned to deal with such unexpected supply-limiting events by selectively curtailing system loads.To allocate the shortage power reasonably, it is crucial to evaluate how much electricity usage could be reduced by each participant consumer.Considering the feasibility of the implementation, this paper proposes a bi-level coordinated optimization strategy.
To realize the proposed strategy, the technological structure is a bi-level structure, where the upper layer includes the dispatching center and DR agents as the curtailment service provider (CSP) to provide DR Service, and the lower layer consists of agents, consumers and smart appliances including ACs, WHs and EVs, as shown in Figure 1.The green arrow represents uploading data and the red arrow indicates giving instructions.Consumers set parameters in advance for all the smart appliances, which consist of the room temperature set point T set AC , water temperature set point T set W H , temperature limits of AC and WH (T AC com f ort_upper , T AC com f ort_lower , T W H com f ort_upper , T W H com f ort_lower ), travel distance L, finish time T, and response time coefficient α of EV.In each time interval of DR period, the ACs upload the room temperature T room and working power p AC to the agent, the WHs upload the water temperature T water and working power p W H and the EVs upload the working power p EV , while the agent transmits the DR signal (s AC , s W H , s EV ) to each smart appliance.Every agent has to upload the aggregated DRP to the dispatching center and the dispatching center determines the demand limit P limit for each agent.The rest of this paper is organized as follows.In Section 2, the bi-level DR strategy is proposed.Section 3 describes the appliance models and their dynamic characteristics.Section 4 presents the multi-agent distribution method based on the DRP in upper layer.In Section 5, an optimization control strategy is proposed for smart appliances to guarantee the total load below demand limit.Section 6 provides the simulations of different scenarios and illustrates the results.Finally, the conclusion is drawn in Section 7.

Bi-Level Structure Based on DRP
Large-capacity power shortage conditions are likely to occur during critical time, when cascading failures and large-area blackouts occur.DR has been envisioned to deal with such unexpected supply-limiting events by selectively curtailing system loads.To allocate the shortage power reasonably, it is crucial to evaluate how much electricity usage could be reduced by each participant consumer.Considering the feasibility of the implementation, this paper proposes a bilevel coordinated optimization strategy.
To realize the proposed strategy, the technological structure is a bi-level structure, where the upper layer includes the dispatching center and DR agents as the curtailment service provider (CSP) to provide DR Service, and the lower layer consists of agents, consumers and smart appliances including ACs, WHs and EVs, as shown in Figure 1  The bi-level control strategy including upper and lower layers is proposed to meet the requirements of load curtailment by quantitating smart appliances' response potential capacity. Figure 2 depicts the flow chart of the bi-level coordinated optimization strategy.In each time interval, the proposed control strategy starts by gathering information, which includes the status of all appliances, comfort range settings, water and room temperature, as well as the EV complete time.In the upper layer, the smart appliances' DRP of each agent is quantitated based on the dynamic The bi-level control strategy including upper and lower layers is proposed to meet the requirements of load curtailment by quantitating smart appliances' response potential capacity. Figure 2 depicts the flow chart of the bi-level coordinated optimization strategy.In each time interval, the proposed control strategy starts by gathering information, which includes the status of all appliances, comfort range settings, water and room temperature, as well as the EV complete time.In the upper layer, the smart appliances' DRP of each agent is quantitated based on the dynamic operating characteristics and comfort settings of smart appliances, then the aggregated DRP of the agent is achieved.The dispatching center allocates the total demand limit P limit to the agents on the basis of each agent's DRP ratio to the total DRP.In the lower layer, the comfort index is proposed to indicate the level of satisfaction of consumers for the corresponding appliance.Considering the consumers' comfort encompassing response times, the coordination optimization strategy of smart appliances is proposed to realize the total loads power below the demand limit P i limit of the ith agent.
Energies 2017, 10, 525 4 of 16 operating characteristics and comfort settings of smart appliances, then the aggregated DRP of the agent is achieved.The dispatching center allocates the total demand limit lim it P to the agents on the basis of each agent's DRP ratio to the total DRP.In the lower layer, the comfort index is proposed to indicate the level of satisfaction of consumers for the corresponding appliance.Considering the consumers' comfort encompassing response times, the coordination optimization strategy of smart appliances is proposed to realize the total loads power below the demand limit lim i it P of the ith agent.

Modeling and Dynamic Operating Characteristics of Residential Smart Appliances
The residential appliances include heating, ventilation, ACs, WHs, clothes dryers, washing machines, dishwashers, ranges, refrigerators, lights, plug loads, and EVs.ACs and WHs have the characteristic of thermal storage whereby homeowners can defer their power consumption by adjusting room/hot water temperature set points.Usage of EV can be deferred based on homeowner preference.All other loads, like cooking and TV, are not controlled.

AC Model
An AC system with a thermostat works in an "on-off" manner and the AC will simply run at its rated power when turned on.In general, a thermostat control is set that the room temperature will fluctuate around the thermostat set point s AC T within the dead band of ( ), the air conditioner will keep its previous status.
The relationship is presented in (1): is the thermostat dead band (°F ).
The AC is controlled by changing the cooling set point () Tt .Increasing the cooling set point to some value can stop the AC working.The controlled formula is presented in (2):

Modeling and Dynamic Operating Characteristics of Residential Smart Appliances
The residential appliances include heating, ventilation, ACs, WHs, clothes dryers, washing machines, dishwashers, ranges, refrigerators, lights, plug loads, and EVs.ACs and WHs have the characteristic of thermal storage whereby homeowners can defer their power consumption by adjusting room/hot water temperature set points.Usage of EV can be deferred based on homeowner preference.All other loads, like cooking and TV, are not controlled.

AC Model
An AC system with a thermostat works in an "on-off" manner and the AC will simply run at its rated power when turned on.In general, a thermostat control is set that the room temperature will fluctuate around the thermostat set point T s AC within the dead band of ±T d AC /2.(1) The mathematic model of AC Controlling AC load can be carried out by adjusting cooling set points.When the room temperature increases above the cooling set point by half of the thermostat dead band (T s AC + T d AC /2), the air conditioner is ON.As the air conditioner drops below the cooling set point by half of the thermostat dead band (T s AC − T d AC /2), the air conditioner is OFF.If the room temperature is within the temperature range ( ), the air conditioner will keep its previous status.The relationship is presented in (1): where p AC (t) is the working power of air conditioner in time interval t (kW); P AC is the rated power of AC (kW); T AC (t) is the room temperature in time interval t ( • F); T s AC (t) is the cooling set point in time interval t ( • F); and T d AC is the thermostat dead band ( • F).The AC is controlled by changing the cooling set point T s AC (t).Increasing the cooling set point to some value can stop the AC working.The controlled formula is presented in (2): where s AC (t) is the DR control signal which is received from in-home controller; and T set AC is the cooling set point ( • F).
(2) Determination of room temperature For each time interval t, the room temperature is calculated as: where ∆t is the length of time interval t (h); G(t) is heat gain rate of the house during time interval t, positive for heat gain and negative for heat loss (Bth/h); C AC is cooling capacity (Bth/h); and ∆c is energy needed to change the temperature of the air in the room by 1 • F (Bth/ • F).

WH Model
The water heater model is a temperature-based model rather than energy-based one.This means that the duration of the ON period of the heating coils depends on the temperature set point and the current water temperature.When the current water temperature drops below the desired temperature set point by half of the thermostat dead band (T s W H − T d W H /2), the water heater is ON.As the water temperature goes above the desired temperature set point by half of the thermostat dead band (T s W H + T d W H /2), the water heater is OFF.If the water temperature is within the temperature range ( ), the water heater keeps its previous status.The relationship is presented in (4): where p W H (t) is the working power of water heater in time interval t (kW); P W H is the rated power of WH (kW); T W H (t) is the water temperature in time interval t ( • F); T s W H (t) is the desired temperature set point in time interval t ( • F); and T d W H is the thermostat dead band ( • F).The WH is controlled by changing the water set point T s W H (t). Decreasing the water set point to some value can stop the WH working.The controlled formula is presented in (5): where s W H (t) is the DR control signal which is received from in-home controller; and T set W H is the water set point ( • F).
The water temperature in the tank is calculated as Formula (6): where T inlet is the temperature of inlet water ( • F); f r(t) is the hot water flow rate in time interval t (gpm); A tan k is surface area of the tank ( f t 2 ); V tan k is the volume of the tank (gallons); R tan k is the heat resistance of the tank ( • F• f t 2 •h/Btu); and ∆t is the duration of each time interval (minutes) [20].

EV Model
Here, an on-off strategy is used for EV response, which means that each EV is charged by a constant and maximum power.The benefits of charging with on-off strategy instead of adjustable power are as follows.First of all, it was suggested that charging the EV with a constant power could prolong the battery's service time.Secondly, smaller communication overheads are required to contact with a small subset of EVs and hence it is more practical to turn charging on or off rather than adjusting the charging rate when great amounts of EV charging are scheduled.Finally, it is expected that using on-off strategy can fully charge the EVs in shorter timeframe [21].
To model EV charging profiles, three parameters are essential: the rated charging power, the plug-in time and the battery state-of-charge (SOC).The plug-in time is related to the time of vehicle arrival at home and arrival at work.
The calculation of the EV charging profile is described in (7): where  (8) where SOC(t) is the state of charge in time interval t, and SOC min is the minimum SOC limit of EV at the desired finish time [22].The battery SOC after EV charging completes should fulfill customers' demand, which is determined by: where SOC 0 is the initial SOC of EV; L is the travel distance of EV (mile); E EV is the efficiency of driving (mile/kWh); and Q EV is the full capacity of battery (kWh).
The EV battery charging model is as follows: where Q EV is the full battery capacity (kWh); η is the coefficient of charging.

Aggregated DRP
DRP means the appliance is working and can stop working to response the DR signal without affecting the consumer's comfort.Figure 3 shows the DRP of AC and WH in different conditions.
For the AC, when the room temperature is between T set AC − T d AC /2 and T set AC + T d AC /2, the AC has DRP if the room temperature has a downward tendency and has no DRP if it has an upward tendency.In order to guarantee the comfort of consumers, the comfort range is set previously.In general, the range of thermostat set point T set AC within the dead band of ±T d AC /2 is between T AC com f ort_lower and T AC com f ort_upper except in the condition of AC responding.When the room temperature goes above the T set AC + T d AC /2 which is below T AC com f ort_upper , the AC has DRP until the room temperature is higher than the maximum temperature of comfort range.
For the WH, when the water temperature is between  The DRP indexes of the three appliances in time interval t + 1 are obtained based on the parameters of time interval t, "1" if the appliance has DRP and "0" if the appliance has no DRP, which are described as following formulas ( 11)-( 13): where ( 1) are the DRP status of the AC, WH, and EV in time interval t + 1 respectively.The aggregated DRP of each agent is presented in ( 14): where  The DRP indexes of the three appliances in time interval t + 1 are obtained based on the parameters of time interval t, "1" if the appliance has DRP and "0" if the appliance has no DRP, which are described as following formulas ( 11)-( 13): where DP AC (t + 1), DP W H (t + 1), and DP EV (t + 1) are the DRP status of the AC, WH, and EV in time interval t + 1 respectively.The aggregated DRP of each agent is presented in ( 14): where DRP total (t + 1) is the DRP of all the appliances in one agent in time interval t + 1 (kW); N 1 is the total number of ACs; P i AC is the rated power of ith AC (kW); DP i AC (t) is the DRP index of ith AC in time interval t; N 2 is the total number of WHs; P j W H is the rated power of jth WH (kW); DP j W H (t) is the DRP index of jth WH in time interval t; N 3 is the total number of EVs; P k EV is the rated power of kth EV (kW); and DP k EV (t) is the DRP index of kth EV in time interval t.

Multi-Agent Coordinated Distribution Method of Upper Layer Based on the DRP
Figure 4 depicts the flow chart of the multi-agent coordinated distribution method in the upper layer.Based on the dynamic operating characteristics of all the smart appliances and the comfort settings given by consumers in advance, the DRP statuses of smart appliances are achieved online.For each agent, the aggregated DRP is obtained combining the DRP status with the rated power of smart appliances and then its corresponding DRP ratio to the total DRP is calculated.Each agent uploads the aggregated DRP to the dispatching center and the dispatching center allocates the total DR limit to the agents based on the DRP ratio.

Multi-Agent Coordinated Distribution Method of Upper Layer Based on the DRP
Figure 4 depicts the flow chart of the multi-agent coordinated distribution method in the upper layer.Based on the dynamic operating characteristics of all the smart appliances and the comfort settings given by consumers in advance, the DRP statuses of smart appliances are achieved online.For each agent, the aggregated DRP is obtained combining the DRP status with the rated power of smart appliances and then its corresponding DRP ratio to the total DRP is calculated.Each agent uploads the aggregated DRP to the dispatching center and the dispatching center allocates the total DR limit to the agents based on the DRP ratio.The DR limit for each agent is calculated in Formula (15): is the total DRP of the lth agent (kW); L is the total number of agents; and lim it P is the total demand limit for all the agents (kW).

Flexible Comfort Index
The primary difference between smart appliances including AC, WH and EV and other business and industry loads is that the former are much more related with customers' behavior and their subjective desire.In order to realize DR using the smart appliances, the consumers' comfort should be considered.The comfort index is proposed, which indicates the customer's subjective desire of participating DR that has helped utilities to design DR policies and strategies.
The better the customer feels, the higher the comfort index is.It means that the appliance has higher priority to be controlled when the comfort index is higher.The AC and WH comfort of consumers are related with the room temperature and water temperature, respectively.When the room temperature is lower with the function of AC or the water temperature is higher, the consumers are more satisfied with the AC or WH.In order to quantify the consumers' comfort index of AC and WH, its mathematic model is proposed based on the comfort temperature range which is set by consumers previously.The comfort index is limited between 0 and 1.The AC comfort index decreases with the room temperature increasing and the WH comfort index increases with the water temperature increasing, as described in formulas ( 16) and ( 17 The DR limit for each agent is calculated in Formula (15): where p l AC , p l W H , and p l EV are total working power of ACs, WHs, and EVs in the lth agent, respectively (kW); p l load is the total power of all the appliances except smart appliances in the lth agent (kW); P l limit is the demand limit of the lth agent (kW); DRP l total is the total DRP of the lth agent (kW); L is the total number of agents; and P limit is the total demand limit for all the agents (kW).

Flexible Comfort Index
The primary difference between smart appliances including AC, WH and EV and other business and industry loads is that the former are much more related with customers' behavior and their subjective desire.In order to realize DR using the smart appliances, the consumers' comfort should be considered.The comfort index is proposed, which indicates the customer's subjective desire of participating DR that has helped utilities to design DR policies and strategies.
The better the customer feels, the higher the comfort index is.It means that the appliance has higher priority to be controlled when the comfort index is higher.The AC and WH comfort of consumers are related with the room temperature and water temperature, respectively.When the room temperature is lower with the function of AC or the water temperature is higher, the consumers are more satisfied with the AC or WH.In order to quantify the consumers' comfort index of AC and WH, its mathematic model is proposed based on the comfort temperature range which is set by consumers previously.The comfort index is limited between 0 and 1.The AC comfort index decreases with the room temperature increasing and the WH comfort index increases with the water temperature increasing, as described in formulas ( 16) and ( 17): For the EV, the consumer cares more about whether the EV can support the distance of travel for the whole day or not, and the charging times, which can reflect the lifetime of EV battery.If the EV cannot charge to the desired SOC at the complete time, the comfort index is set as 0 which means the consumer gives the poorest rating for comfort and cannot participate the DR program.The comfort index is related with the charging times N(t) and its coefficient α.The comfort index formula of EV is as follows.
where C AC (t), C W H (t), and C EV (t) are the comfort index of air conditioner, water heater and electric vehicle in time interval t respectively; T AC com f ort_upper and T W H com f ort_upper are the upper limit of room temperature and water temperature respectively; T AC com f ort_lower and T W H com f ort_lower are the lower limit of room temperature and water temperature respectively; T AC (t) is the room temperature in time interval t and T W H (t) is the water temperature in time interval t; N(t) represents the total charging times during the t period; SOC(t) is the SOC of EV in time interval t; and SOC min is the minimum SOC limit of EV at the desired finish time [12].Based on Formula (18), the coefficient α is calculated as α = 1/N(t), then the consumers can set the value of α to limit the response times.
The smart appliances are turned off starting from higher comfort index until the total load is below the demand limit, which indicates the sequence of load shedding, not the amount of load shedding.Therefore, it does not indicate more load shedding.

Control Strategy of Lower Layer
As mentioned above, a higher comfort index of AC means the room temperature is closer to the comfort lower limit, which results in more power consumption.Similarly, a higher comfort index of WH/EV needs more power energy.Therefore, this section solves an electricity load scheduling problem of each agent that aims at guaranteeing the comfort index of the residence considering three kinds of appliances that are introduced in the previous section between 0 and 1. ACs and WHs are controlled on the premise of keeping the room/water temperatures limited to the comfort range, which belongs to the comfort settings permitted by consumers previously.The formulas are described as ( 19)-( 21): The EV SOC at the desired finish time should be below SOC min and the charging times are limited as follows: For each agent, the total load power consumption should be below the demand limit allocated based on the DRP: where C i AC is the ith AC comfort index; C j W H is the jth WH comfort index; C k EV is the kth EV comfort index; and N 1 , N 2 , and N 3 are the total numbers of AC, WH, and EV respectively.
In order to prevent the status of AC and WH switching frequently, the least DR time have to be set, namely the appliance should keep responding for at least t limit minutes once it starts to respond.When the appliances are during the t limit period, it is uncontrolled and the remaining smart appliances response to the DR event.
The solution is implemented in MATLAB.Figure 5 depicts the flow chart of optimal strategy in lower layer.n is the total number of controlled smart appliances.When comparing the numerical magnitude of total load P total and demand limit P limit , if P total is smaller than P limit , update the appliances' status and continue in next time interval; on the contrary, the comfort indexes of smart appliances except the uncontrolled ones mentioned above are calculated and ranked in descending order which defines the largest comfort index C 1 , the second largest one C 2 , and so on.Next, the parameters are judged as to whether the status S i of ith smart appliance equals 1 (1 if the smart appliance is working, 0 if the smart appliance is not working) and if the comfort index is above 0 which meets the constraints of Formulas ( 19)-( 21).If so, the ith smart appliance should stop working to transform the S i from 1 to 0 until the updated total load is below the demand limit.
Energies 2017, 10, 525 10 of 16 In order to prevent the status of AC and WH switching frequently, the least DR time have to be set, namely the appliance should keep responding for at least lim it t minutes once it starts to respond.
When the appliances are during the lim it t period, it is uncontrolled and the remaining smart appliances response to the DR event.
The solution is implemented in MATLAB.Figure 5 depicts the flow chart of optimal strategy in lower layer.n is the total number of controlled smart appliances.When comparing the numerical magnitude of total load total P and demand limit lim it P , if total P is smaller than lim it P , update the appliances' status and continue in next time interval; on the contrary, the comfort indexes of smart appliances except the uncontrolled ones mentioned above are calculated and ranked in descending order which defines the largest comfort index 1 C , the second largest one 2 C , and so on.Next, the parameters are judged as to whether the status Si of ith smart appliance equals 1 (1 if the smart appliance is working, 0 if the smart appliance is not working) and if the comfort index is above 0 which meets the constraints of Formulas ( 19)-( 21).If so, the ith smart appliance should stop working to transform the Si from 1 to 0 until the updated total load is below the demand limit.

Simulation Settings
This section demonstrates the feasibility of the proposed bi-level DR strategy and analyzes the DRP of all the smart appliances and its impact factors.We evaluate the proposed bi-level DR strategy in Section 2 in a community with 10 agents including 1000 residential houses and 3.3 MW PV.The rated power of AC, WH, and EV are 3 kW, 4 kW and 3.3 kW, respectively.For the comfort range setting, the room temperature should be between 19 and 24 °C ; the water temperature should be between 44 and 50 °C ; the EV should finish charging by 6 a.m. and its SOC should be above 0.95 at the desired finish time; the capacity of EV is 33 kWh.

Simulation Settings
This section demonstrates the feasibility of the proposed bi-level DR strategy and analyzes the DRP of all the smart appliances and its impact factors.We evaluate the proposed bi-level DR strategy in Section 2 in a community with 10 agents including 1000 residential houses and 3.3 MW PV.The rated power of AC, WH, and EV are 3 kW, 4 kW and 3.3 kW, respectively.For the comfort range setting, the room temperature should be between 19 and 24 • C; the water temperature should be between 44 and 50 • C; the EV should finish charging by 6 a.m. and its SOC should be above 0.95 at the desired finish time; the capacity of EV is 33 kWh.
In this paper, it is assumed that the PV starts dropping off and the utility power plants need to ramp up quickly at 6 p.m., and that a demand limit is imposed on this agent during the quickly increased ramp and evening peak period (between 6 p.m. and 11 a.m.).Note that the demand limit level can vary every 15 min or every hour depending on system requirements, but for the purpose of this study, a demand limit of the dispatching center includes a ramp limit assumed to vary every 1 min and peak demand limit assumed to be fixed.Also, 11 a.m. is assumed to be the end of the DR event.For DR control, we set the control interval ∆t as one minute, which is short enough that the customers' load demand and the renewable energy supply are assumed static.For the DRP of lower layer, the time interval is 15 min.
In order to analyze the DRP of all the smart appliances and its impact factors, there are different parameters for each agent shown in Table 1.Some houses expand the comfort range of AC, WH and EV in agents 2 and 3; some have different DR times limit in agents 4 and 5; some have diverse composition of each kind of smart appliances in agents 6 and 7; and the others have different responsive appliances ratio to the smart appliances in agents 8-10.

Upper Layer Simulation Results
Figure 6 illustrates the performance of the proposed bi-level coordinated optimal strategy in keeping the total household consumption below demand limit level and reducing the ramp.Figure 6 displays household consumption between 4 p.m. and 8 a.m. with improved ramp limit and peak demand limit.
Table 2 presents the results of multi-agent coordinated distribution method in upper layer.In order to show the variation tendency of DRP during the DR event, the sampling time is set simply as 1 h.It can be seen from Table 2 that the DRP of distinct agent is different and varies with the time going.The ratios of DR to DRP (β) are the same for all the agents.The actual response power of smart appliances is 0, since the total load equals the demand limit at 18:00 when the DRP of agents 1-5 are equivalent because of the same compositions and operating parameters of smart appliances except the comfort settings.④ : the actual response power of smart appliances (kW); ⑤ : the ratio of DP to DRP.
(1) Comfort range: To simulate the scenarios about comfort range, it is assumed that the room temperature range is expanded to be between 19 °C and 26 °C and the water temperature range is also expanded to be between 42.5 °C and 50 °C in agent 2. The minimum SOC limit at the desired finish time is 0.5 in agent 3. The simulation results for comparing agents 1-3 are shown in Figure 7.Both the room temperature range and the water temperature range in agent 2 are expanded, which means that the corresponding appliance can respond in larger range of temperature.Therefore, the variation range of DRP in agent 2 is larger than the one in agent 1.   (1) Comfort range: To simulate the scenarios about comfort range, it is assumed that the room temperature range is expanded to be between 19 • C and 26 • C and the water temperature range is also expanded to be between 42.5 • C and 50 • C in agent 2. The minimum SOC limit at the desired finish time is 0.5 in agent 3. The simulation results for comparing agents 1-3 are shown in Figure 7.Both the room temperature range and the water temperature range in agent 2 are expanded, which means that the corresponding appliance can respond in larger range of temperature.Therefore, the variation range of DRP in agent 2 is larger than the one in agent 1.  ④ : the actual response power of smart appliances (kW); ⑤ : the ratio of DP to DRP.
(1) Comfort range: To simulate the scenarios about comfort range, it is assumed that the room temperature range is expanded to be between 19 °C and 26 °C and the water temperature range is also expanded to be between 42.5 °C and 50 °C in agent 2. The minimum SOC limit at the desired finish time is 0.5 in agent 3. The simulation results for comparing agents 1-3 are shown in Figure 7.Both the room temperature range and the water temperature range in agent 2 are expanded, which means that the corresponding appliance can respond in larger range of temperature.Therefore, the variation range of DRP in agent 2 is larger than the one in agent 1.In the agent 3, the minimum SOC the EVs should charge to at the desired finish time reduces from 0.95 to 0.5.This means that the EVs charge to prospective SOC using less time and have more time to respond to the DR signal.As shown in Figure 7, the DRP in agent 3 is larger than the one in agent 1.
(2) Response times limit: Figure 8 depicts the impact of DR times for DRP by changing the coefficient α of the EVs and the least DR time for AC and WH, respectively.The coefficient α in agent 4 is 0.4, which means the EVs response times are limited to be less.Figure 8 illustrates that the DRP in agent 1 is larger than the one in agent 4 and varies later on account of the potential used during the DR event.In Figure 9, the EV mean response times reduce much more in agent 4 compared with the agent 1 and the AC and WH mean response times definitely increase much more.
In agent 5, the least DR times of AC and WH are set as 0, not 10 min like in agent 1.It is definite that the variation range of DRP in agent 1 is less than the in agent 5 as a result of the restriction on the DR behavior of the AC and WH.When the limit time of DR changes from 10 min to 0, the AC and WH mean response times increase, which leads to the variation of EVs shown in Figure 9.
Energies 2017, 10, 525 13 of 16 In the agent 3, the minimum SOC the EVs should charge to at the desired finish time reduces from 0.95 to 0.5.This means that the EVs charge to prospective SOC using less time and have more time to respond to the DR signal.As shown in Figure 7, the DRP in agent 3 is larger than the one in agent 1.
(2) Response times limit: Figure 8 depicts the impact of DR times for DRP by changing the coefficient α of the EVs and the least DR time for AC and WH, respectively.The coefficient α in agent 4 is 0.4, which means the EVs response times are limited to be less.Figure 8 illustrates that the DRP in agent 1 is larger than the one in agent 4 and varies later on account of the potential used during the DR event.In Figure 9, the EV mean response times reduce much more in agent 4 compared with the agent 1 and the AC and WH mean response times definitely increase much more.
In agent 5, the least DR times of AC and WH are set as 0, not 10 min like in agent 1.It is definite that the variation range of DRP in agent 1 is less than the in agent 5 as a result of the restriction on the DR behavior of the AC and WH.When the limit time of DR changes from 10 min to 0, the AC and WH mean response times increase, which leads to the variation of EVs shown in Figure 9.  (3) Composition of each kind of smart appliance: Different smart appliance composition can affect the DRP.There are 90 ACs (3 kW), 50 WHs (4 kW) and 100 EVs (3.3 kW) in agent 6 and 50 ACs, 80 WHs and 100 EVs in agent 7. The total power consumption in agent 6 equals to the power in agent 7. Figure 10 shows that the DRP in agent 6 is larger than the one in agent 7, since the ACs work more frequently than the WHs.In the agent 3, the minimum SOC the EVs should charge to at the desired finish time reduces from 0.95 to 0.5.This means that the EVs charge to prospective SOC using less time and have more time to respond to the DR signal.As shown in Figure 7, the DRP in agent 3 is larger than the one in agent 1.
(2) Response times limit: Figure 8 depicts the impact of DR times for DRP by changing the coefficient α of the EVs and the least DR time for AC and WH, respectively.The coefficient α in agent 4 is 0.4, which means the EVs response times are limited to be less.Figure 8 illustrates that the DRP in agent 1 is larger than the one in agent 4 and varies later on account of the potential used during the DR event.In Figure 9, the EV mean response times reduce much more in agent 4 compared with the agent 1 and the AC and WH mean response times definitely increase much more.
In agent 5, the least DR times of AC and WH are set as 0, not 10 min like in agent 1.It is definite that the variation range of DRP in agent 1 is less than the in agent 5 as a result of the restriction on the DR behavior of the AC and WH.When the limit time of DR changes from 10 min to 0, the AC and WH mean response times increase, which leads to the variation of EVs shown in Figure 9.  (3) Composition of each kind of smart appliance: Different smart appliance composition can affect the DRP.There are 90 ACs (3 kW), 50 WHs (4 kW) and 100 EVs (3.3 kW) in agent 6 and 50 ACs, 80 WHs and 100 EVs in agent 7. The total power consumption in agent 6 equals to the power in agent 7. Figure 10 shows that the DRP in agent 6 is larger than the one in agent 7, since the ACs work more frequently than the WHs.(3) Composition of each kind of smart appliance: Different smart appliance composition can affect the DRP.There are 90 ACs (3 kW), 50 WHs (4 kW) and 100 EVs (3.3 kW) in agent 6 and 50 ACs, 80 WHs and 100 EVs in agent 7. The total power consumption in agent 6 equals to the power in agent 7. Figure 10 shows that the DRP in agent 6 is larger than the one in agent 7, since the ACs work more frequently than the WHs.(4) The ratio of responsive loads to the smart appliances: At last, we evaluate the impact of different ratios of responsive loads to the smart appliances.Agents 8-10 have the same number of smart appliances as with agent 1, but not all the smart appliances are permitted to respond.The percentage of responsive loads in agent 8, agent 9 and agent 10 are 70%, 50% and 30%, respectively.Figure 11 shows the DRP of agent 1 and agents 8-10.The DRP is high when the percentage is high except the time of red circle and the variation tendency of DRP in agent 1 and agents 8-10 are almost the same.At the end of the DR event, there is no positive correlation between DRP and the ratio owning to the DR actions before.
In general, the DRP in agent 9 with higher ratio of responsive loads is higher than the one in agent 10.However, as depicted in Figure 11, the red cycle shows the DRP in agent 9 is lower compared with the agent 10.The reason is that more smart appliances in agent 9 respond to the DR signal and use more DRP before 21:00.

Lower Layer Simulation Results
For each agent, the statuses of smart appliances are controlled to realize the total power consumption below the demand limit.In order to illustrate the results of lower layer strategy, Figure 12 shows the power consumption of each kind of smart appliances in agent 1.
In Figure 12, the first subfigure depicts the AC power from 16:00 to 08:00, in which the nonperiodic curve indicates the ACs response to the DR signal.The second subfigure shows the WH (4) The ratio of responsive loads to the smart appliances: At last, we evaluate the impact of different ratios of responsive loads to the smart appliances.Agents 8-10 have the same number of smart appliances as with agent 1, but not all the smart appliances are permitted to respond.The percentage of responsive loads in agent 8, agent 9 and agent 10 are 70%, 50% and 30%, respectively.Figure shows the DRP of agent 1 and agents 8-10.The DRP is high when the percentage is high except the time of red circle and the variation tendency of DRP in agent 1 and agents 8-10 are almost the same.At the end of the DR event, there is no positive correlation between DRP and the ratio owning to the DR actions before.(4) The ratio of responsive loads to the smart appliances: At last, we evaluate the impact of different ratios of responsive loads to the smart appliances.Agents 8-10 have the same number of smart appliances as with agent 1, but not all the smart appliances are permitted to respond.The percentage of responsive loads in agent 8, agent 9 and agent 10 are 70%, 50% and 30%, respectively.Figure 11 shows the DRP of agent 1 and agents 8-10.The DRP is high when the percentage is high except the time of red circle and the variation tendency of DRP in agent 1 and agents 8-10 are almost the same.At the end of the DR event, there is no positive correlation between DRP and the ratio owning to the DR actions before.
In general, the DRP in agent 9 with higher ratio of responsive loads is higher than the one in agent 10.However, as depicted in Figure 11, the red cycle shows the DRP in agent 9 is lower compared with the agent 10.The reason is that more smart appliances in agent 9 respond to the DR signal and use more DRP before 21:00.

Lower Layer Simulation Results
each agent, the statuses of smart appliances are controlled to realize the total power consumption below the demand limit.In order to illustrate the results of lower layer strategy, Figure 12 shows the power consumption of each kind of smart appliances in agent 1.
In Figure 12, the first subfigure depicts the AC power from 16:00 to 08:00, in which the nonperiodic curve indicates the ACs response to the DR signal.The second subfigure shows the WH In general, the DRP in agent 9 with higher ratio of responsive loads is higher than the one in agent 10.However, as depicted in Figure 11, the red cycle shows the DRP in agent 9 is lower compared with the agent 10.The reason is that more smart appliances in agent 9 respond to the DR signal and use more DRP before 21:00.

Lower Layer Simulation Results
For each agent, the statuses of smart appliances are controlled to realize the total power consumption below the demand limit.In order to illustrate the results of lower layer strategy, Figure 12 shows the power consumption of each kind of smart appliances in agent 1.
In Figure 12, the first subfigure depicts the AC power from 16:00 to 08:00, in which the nonperiodic curve indicates the ACs response to the DR signal.The second subfigure shows the WH power and the third subfigure depicts the EV power which start to charge at 17:00 and finish at 06:00.The blue area, green area and yellow area are the WH, AC and EV energy from 16:00 to 08:00 respectively.
Energies 2017, 10, 525 15 of 16 power and the third subfigure depicts the EV power which start to charge at 17:00 and finish at 06:00.The blue area, green area and yellow area are the WH, AC and EV energy from 16:00 to 08:00 respectively.

Conclusions
This paper presents a novel bi-level coordinated optimal strategy for smart appliances to balance a large-capacity power shortage, which can not only descend the ramp and reduce the peak loads.The strategy consists of two layers.In the upper layer, the demand limit is allocated to each agent based on the aggregated demand response potential of the smart appliances.In the lower layer, the online DRP is calculated and each agent schedules their smart appliances to guarantee the total load power below required demand limit considering the consumers' comfort and response times.

Conclusions
This paper presents a novel bi-level coordinated optimal strategy for smart appliances to balance a large-capacity power shortage, which can not only descend the ramp and reduce the peak loads.The strategy consists of two layers.In the upper layer, the demand limit is allocated to each agent based on the aggregated demand response potential of the smart appliances.In the lower layer, the online DRP is calculated and each agent schedules their smart appliances to guarantee the total load power below required demand limit considering the consumers' comfort and response times.
. The green arrow represents uploading data and the red arrow indicates giving instructions.Consumers set parameters in advance for all the smart appliances, which consist of the room temperature set point set AC T , water temperature set point set WH T , temperature limits of AC and WH ( distance L, finish time T, and response time coefficient α of EV.In each time interval of DR period, the ACs upload the room temperature ) to each smart appliance.Every agent has to upload the aggregated DRP to the dispatching center and the dispatching center determines the demand limit lim it P for each agent.

Figure 1 .
Figure 1.The structure of bi-level coordinated optimization strategy.AC: air conditioner; WH: water heater; EV: electric vehicle

Figure 1 .
Figure 1.The structure of bi-level coordinated optimization strategy.AC: air conditioner; WH: water heater; EV: electric vehicle

Figure 2 .
Figure 2. The flow chart of bi-level coordinated optimization strategy.

Figure 3 .
Figure 3. Demand response potential (DRP) of AC and WH.

Figure 3 .
Figure 3. Demand response potential (DRP) of AC and WH.
power of ACs, WHs, and EVs in the lth agent, respectively (kW); l load p is the total power of all the appliances except smart appliances in the lth agent (kW); lim l it P is the demand limit of the lth agent (kW); l total DRP

Figure 5 .
Figure 5. Flow chart of optimal strategy in lower layer.

Figure 5 .
Figure 5. Flow chart of optimal strategy in lower layer.

Figure 6 .
Figure 6.The total power consumption before and after the DR signal.

Figure 6 .
Figure 6.The total power consumption before and after the DR signal.

Figure 6 .
Figure 6.The total power consumption before and after the DR signal.

Figure 7 .
Figure 7. DRP with different comfort ranges.Figure 7. DRP with different comfort ranges.

Figure 7 .
Figure 7. DRP with different comfort ranges.Figure 7. DRP with different comfort ranges.

Figure 8 .
Figure 8. DRP with different response times limits.

Figure 9 .
Figure 9. Mean response times of all appliances with different response times limit.

Figure 8 .
Figure 8. DRP with different response times limits.

Figure 8 .
Figure 8. DRP with different response times limits.

Figure 9 .
Figure 9. Mean response times of all appliances with different response times limit.

Figure 9 .
Figure 9. Mean response times of all appliances with different response times limit.

Figure 10 .
Figure 10.DRP with different composition of each kind of smart appliances.

Figure 11 .
Figure 11.DRP with different ratio of responsive loads.

Figure 10 .
Figure 10.DRP with different composition of each kind of smart appliances.

Figure 10 .
Figure 10.DRP with different composition of each kind of smart appliances.

Figure 11 .
Figure 11.DRP with different ratio of responsive loads.

Figure 11 .
Figure 11.DRP with different ratio of responsive loads.

Figure 12 .
Figure 12.Power consumption of each kind of smart appliances.

Figure 12 .
Figure 12.Power consumption of each kind of smart appliances.
(8)V (t) is EV charge power in time interval t (kW); P EV is EV rated power (kW); N EV (t) is EV connectivity status in time interval t, "1" if EV is connected to the plug and "0" if EV is not connected; w EV (t) is EV charging status without control in time interval t, which depends on the battery SOC as shown in(8): "0" if EV is not being charged and "1" if EV is being charged; and s EV (t) is DR control signal for EV in time interval t, 0 = OFF, 1 = ON.
w EV (t) = 0, SOC(t) ≥ SOC min 1, SOC(t) < SOC min and T set W H + T d W H /2, the AC has DRP if the water temperature has an upward tendency and has no DRP if it has a downward tendency.In general, the range of thermostat set point T set W H within the dead band of ±T d W H /2 is between T W H com f ort_lower and T W H com f ort_upper except the condition of WH responding.When the water temperature drops below the T set W H − T d W H /2 which is above T W H com f ort_lower , the WH has DRP until the water temperature is lower than the minimum temperature of the comfort range.For the EV, when it is connected to the charging station and can charge to the minimum SOC before the desired finish time, it has DRP., the WH has DRP until the water temperature is lower than the minimum temperature of the comfort range.For the EV, when it is connected to the charging station and can charge to the minimum SOC before the desired finish time, it has DRP.

Table 1 .
The simulation parameters of all the agents.

Table 2 .
Simulation results of upper layer.

Table 2 .
Simulation results of upper layer.

Table 2 .
Simulation results of upper layer.