An Energy Management Optimization Method for Community Integrated Energy System Based on User Dominated Demand Side Response

: With the development of integrated energy systems (IES), the traditional demand response technologies for single energy that do not take customer satisfaction into account have been unable to meet actual needs. Therefore, it is urgent to study the integrated demand response (IDR) technology for integrated energy, which considers consumers’ willingness to participate in IDR. This paper proposes an energy management optimization method for community IES based on user dominated demand side response (UDDSR). Firstly, the responsive power loads and thermal loads are modeled, and aggregated using UDDSR bidding optimization. Next, the community IES is modeled and an aggregated building thermal model is introduced to measure the temperature requirements of the entire community of users for heating. Then, a day-ahead scheduling model is proposed to realize the energy management optimization. Finally, a penalty mechanism is introduced to punish the participants causing imbalance response against the day-ahead IDR bids, and the conditional value-at-risk (CVaR) theory is introduced to enhance the robustness of the scheduling model under different prediction accuracies. The case study demonstrates that the proposed method can reduce the operating cost of the community under the premise of fully considering users’ willingness, and can complete the IDR request initiated by the power grid operator or the dispatching department.


Background and Motivation
The development of energy cogeneration and integration technologies as well as renewable energies (e.g., photovoltaic (PV)) has attracted many scholars to undertake research on integrated energy systems (IES). The term IES takes into consideration many kinds of energy subsystems, e.g., electricity supply, gas supply, heating, cooling [1,2]. Different forms of energy are coupled and closely connected through energy conversion equipment (e.g., combined heat and power (CHP) unit, electric heating equipment), and can meet the diverse energy demands of users. However, because of its multienergy coupling characteristic, it is impossible to design, plan and optimize separately the operation of various energy supply systems as the traditional distributed energy supply system does [3]. Therefore, how to efficiently deal with the complementarity and substitution between different energy streams has become a key issue to realize energy cascade utilization and to improve comprehensive energy utilization efficiency. Additionally, the traditional energy management system (EMS) framework cannot adapt to the coexistence and interaction features of centralization and distribution in IES [4,5] (e.g., the energy management policy relationship between user satisfaction with participating in IDR events and response load capacity. In [19], a user dominated demand side response (UDDSR) scheme that allows energy users to dynamically choose to join or withdraw from DR events was put forward. In this scheme, users can submit flexible DR bids to community EMS for participating in DR events. That is, users can flexibly choose the working hours of each household device. However, this scheme only focuses on electric load, and fails to consider the overall optimization within IES.

Novelty and Contribution
In this paper, an energy management optimization method for community IES based on UDDSR is put forth, where users can submit the day-ahead IDR bid for load responses that fully meets their own comfort, and respond to the IDR requests issued by the power grid operator or dispatching department according to the planned capacity of the IDR bid on the next day. Additionally, an aggregated buildings thermal model is introduced to establishe the adjustable thermal load model, and the user's power load adjustable time, power load adjustable capacity, thermal load adjustable time and heating temperature are set as optimized parameters to establish a day-ahead scheduling model. Considering the uncertainty of PV output, user load, outdoor temperature, and user actual UDDSR response capacity in the community IES, a penalty mechanism is introduced to punish the participants making imbalanced response against the day-ahead IDR bids, and the conditional value-at-risk (CVaR) theory is introduced to enhance the robustness under different prediction accuracy.
The contributions of this paper are summarized as follows: (1) The interruptible power load, shiftable power load, and adjustable thermal load are modeled, respectively, and are optimized by UDDSR scheme in order to obtain the aggregated IDR bids. (2) An aggregated buildings thermal model is introduced to measure the temperature requirements of the entire community of users for heating. The adjustable thermal loads of the IDR bids submitted by users are modeled within the context of air temperature, and can be optimized by regulating the indoor temperature of users. (3) From the overall perspective of system operation, a day-ahead scheduling optimization model for the community IES based on UDDSR is established, and the CVaR theory is introduced to deal with the uncertainties in IES.

Demand Response Load Modeling Based on UDDSR
In this paper, the detailed UDDSR optimization approach is based on the mechanism described in [19]. This mechanism allows users to submit flexible bids for DR events and achieves the optimal aggregation of these bids within the DR events. However, it only considers electric equipment including interruptible appliances (e.g., heating systems) and shiftable appliances (e.g., electric vehicles). In this section, the UDDSR optimization with adjustable thermal loads is further studied within the IDR events.

UDDSR Optimization with Adjustable Thermal Loads
In this paper, thermal loads of the aggregated buildings are modeled within the context of air temperature, and can be adjusted by regulating the indoor temperature of end users. Regarding the adjustable thermal loads of the IDR bids, the maximum and minimum of the heating temperature, the maximum adjustable temperature for heating, and the adjustable time period for heating can be set by users. Since this paper studies the centralized temperature regulation in the case of central heating, the community energy management system (CEMS) will first classify users according to the maximum adjustable temperature for heating in the IDR bids. For users who have the same adjustable temperature, CEMS will select as many users as possible who are willing to adjust the heating temperature within the IDR request period to participate in the UDDSR thermal load response according to (1). Additionally, CEMS will select the minimum of the highest temperatures and the maximum of the lowest temperatures submitted by all users in the IDR bids as the temperature constraint range of the central heating, as demonstrated in (2).
where M t u is the total number of users willing to participate in UDDSR thermal load response at time t; T inmin /T inmax is the minimum/maximum indoor temperature that costumers are willing to accept, respectively; T l,i /T u,i is the minimum/maximum heating temperature submitted by the user i.

Adjustable Thermal Loads Model Based on UDDSR
According to [20], the thermodynamic model of the aggregated buildings can be formulated as the RC equivalent circuit model, as demonstrated in Figure 1, where R is the equivalent thermal resistance of the house shell; C air is the air specific heat; L t AC is the adjustable thermal load at time t; T t in and T t out are the indoor and outdoor temperature at time t.
Energies 2021, 14, x FOR PEER REVIEW 4 of 24 temperature for heating in the IDR bids. For users who have the same adjustable temperature, CEMS will select as many users as possible who are willing to adjust the heating temperature within the IDR request period to participate in the UDDSR thermal load response according to (1). Additionally, CEMS will select the minimum of the highest temperatures and the maximum of the lowest temperatures submitted by all users in the IDR bids as the temperature constraint range of the central heating, as demonstrated in (2).
where M t u is the total number of users willing to participate in UDDSR thermal load response at time t; Tinmin/Tinmax is the minimum/maximum indoor temperature that costumers are willing to accept, respectively; Tl,i /Tu,i is the minimum/maximum heating temperature submitted by the user i.

Adjustable Thermal Loads Model based on UDDSR
According to [20], the thermodynamic model of the aggregated buildings can be formulated as the RC equivalent circuit model, as demonstrated in Figure 1, where R is the equivalent thermal resistance of the house shell; Cair is the air specific heat; L t AC is the ad- Therefore, the relation equation between indoor temperature and adjustable thermal load is as follows: The discrete model of (3) is where e is a constant; Δt is the scheduling interval and is assumed to be 1 h in this paper. Then, the adjustable thermal load L t AC is calculated from: Therefore, the relation equation between indoor temperature and adjustable thermal load is as follows: The discrete model of (3) is where e is a constant; ∆t is the scheduling interval and is assumed to be 1 h in this paper. Then, the adjustable thermal load L t AC is calculated from: where T adj is the maximum adjustable indoor temperature allowed by end users during IDR event; T t DRH , determined by IDR bids, is the adjustable time of thermal load allowed by users, and if T t DRH = 1/T t DRH = 0, the thermal load can/cannot be adjusted; ∆T max is the maximum indoor temperature variation during ∆t, and it should be less than 2 • C in order not to affect the comfort of users.

Electric Loads Model Based on UDDSR
In the community CHP system, the electric loads includes interruptible power loads and shiftable power loads. Based on the aggregated IDR bids obtained from UDDSR optimization in [19], the total response power of the interruptible appliances during the IDR event should be less than the maximum interruptible power at the same time after the aggregated IDR bid. Thus the interruptible power load is expressed as where L t DRE,int is the interruptible power load at time t; L t DRE,intmax is the maximum interruptible power load at time t, which can be obtained from aggregated IDR bid of end users.
The shiftable load model is expressed as where L t DRE,sh f is the total shiftable power load at time t; L t DRE,sh f ,out and L t DRE,sh f ,outmax are the load and the maximum load shifted from time t to other time; L t DRE,sh f ,in and L t DRE,sh f ,inmax are the load and maximum load shifted to time t, respectively; T is the optimized scheduling cycle; L t DRE,sh f ,outmax and L t DRE,sh f ,inmax can be obtained from aggregated IDR bid of end users.

PV Model
PV is a common distributed generation device in the community, and can be modeled as: where P t PV is the PV output power; P stc is the maximum PV output power under standard test conditions; G t is the light intensity and G stc is that under standard test conditions; ε is the PV power temperature coefficient; T t s is surface temperature of PV and T stc is that under standard test conditions.

Microgas Turbine (MT) Model
MT is an important CHP equipment in community CHP system, and its model is as follows: where P t MT is the MT output power at time t; V t MT is the MT gas consumption at time t; H ng is the calorific value of natural gas; η MT is the MT power generation efficiency; Q t MT is the MT output heat power at time t; η loss is the MT power loss efficiency.

Gas Boiler (GB) Model
GB burns natural gas to provide heat for community users and can be modeled as: where Q t GB is the GB output heat power at time t; V t GB is the GB gas consumption at time t; η GB is the GB heat production efficiency.

Waste Heat Recovery (WHR) Device Model
WHR can recover the flue gas waste heat after MT power generation to improve the energy utilization efficiency, and can be modeled as: where Q t W HR is the WHR recovered heat power at time t; Q t W H is the MT waste heat at time t; η WHR is the WHR heat recovery efficiency.

Heat Exchanger (HE) Model
HE can convert the heat of hot stream into hot water to provide heating for community end users, and is modeled as: where Q t HE /Q t HE,in is the HE heat power output/input at time t; η HE is the HE heat exchange efficiency.

Battery (BT) Model
The charging and discharging of BT can greatly improve the utilization rate of the response load on the user side, and the model of BT is: where W t BT represents the stored energy in BT; η BT,loss is the power loss rate of BT; P t BT,ch and P t BT,dis are the charging and discharging power of BT, respectively; η BT,ch and η BT,dis are the charging and discharging efficiency of BT, respectively.

Thermal Storage Tank (TST) Model
When the output thermoelectric power ratio of MT does not match the thermoelectric load ratio of community users, TST can compensate for the difference of thermoelectric ratio through heat storage and release behavior, and improve the utilization efficiency of user-side response heat load. TST can be modeled as: where W t TST is the amount of heat stored in TST at time t; η TST,loss is the energy loss rate of TST; Q t TST,ch is the heat storage power of TST; η TST,ch is the heat storage efficiency; Q t TST,dis is the heat release power; η TST,dis is the heat release efficiency.

Community CHP System Model Based on UDDSR
In this paper, the community CHP system consists of MT, GB, WHR, HE, PV, BT and TST, and its structure diagram is shown in Figure 2. where W t TST is the amount of heat stored in TST at time t; ηTST,loss is the energy loss rate of TST; Q t TST,ch is the heat storage power of TST; ηTST,ch is the heat storage efficiency; Q t TST,dis is the heat release power; ηTST,dis is the heat release efficiency.

Community CHP System Model Based on UDDSR
In this paper, the community CHP system consists of MT, GB, WHR, HE, PV, BT and TST, and its structure diagram is shown in Figure 2. Then, an energy hub model based on the bus bar form [21] is adopted to model the community CHP system. The bus bar structure of the community system is shown in Fig   Then, an energy hub model based on the bus bar form [21] is adopted to model the community CHP system. The bus bar structure of the community system is shown in Figure 3, and the flow relations of electricity, gas and heat energy are marked by arrows.
where W t TST is the amount of heat stored in TST at time t; ηTST,loss is the energy loss rate of TST; Q t TST,ch is the heat storage power of TST; ηTST,ch is the heat storage efficiency; Q t TST,dis is the heat release power; ηTST,dis is the heat release efficiency.

Community CHP System Model Based on UDDSR
In this paper, the community CHP system consists of MT, GB, WHR, HE, PV, BT and TST, and its structure diagram is shown in Figure 2. Then, an energy hub model based on the bus bar form [21] is adopted to model the community CHP system. The bus bar structure of the community system is shown in Fig

Day-Ahead Energy Optimization Model
In the community system studied in this paper, by participating in the UDDSR response arranged by CEMS, users can submit the day-ahead IDR bid of load response that fully meets their own comfort, and respond to the IDR request issued by the power grid operator or dispatching department the next day according to the planned capacity of IDR bid. For users, they can reduce or transfer unnecessary loads during the IDR event, and at the same time receive the subsidy of IDR response from the grid operator. For the entire community energy system, CEMS can schedule the user loads to the greatest extent according to the IDR bid plan of users, and thus achieve "peak clipping and valley filling" in energy use. Meanwhile, on the basis of ensuring the stability of the system operation, the overall operation cost of the system can also be reduced, and the economy of the system operation can be improved. The goal of system optimization is to minimize the total cost of system operation and the temperature change caused by the thermal load response adjustment within the allowable range of users, so as to ensure their satisfaction with energy use as much as possible. This can be described as the objective function below: where C total is the total cost of system operation; T ref is the national standard indoor optimum temperature; δ t is a time-varying parameter that measure the thermal comfort of users, and during the UDDSR event, δ t is relaxed to achieve the purpose of temperature regulation and consumption reduction, while in other moments δ t plays the role of making the indoor temperature close to the optimal temperature; N is the optimal scheduling cycle. The total cost of system operation is calculated by the following function: where C grid is the cost of electricity purchasing from the grid; C ng is the cost of natural gas; C om is the cost of equipment operation and maintenance; C UDDSR is the total subsidy for UDDSR participation given to users by the operator. C grid and C ng can be calculated as: where P t grid is the power purchased from the grid; e t p is the market price; e gas is the price of natural gas.
C om can be calculated as: where C om,MT , C om,GB and C om,PV are the unit power operation and maintenance costs of MT, GB, and PV, respectively. C UDDSR can be calculated as: where C u is the load response subsidy for users; C es is the energy storage subsidy; e t DRE is electric load response compensation per unit power; e t DRH is the thermal load response compensation per unit power; L t DRH is the change of thermal power caused by lowering the room temperature ∆T t within the range allowed by users at time t; T t in0 is the indoor temperature before UDDSR event; e BT is the unit power subsidy for the charging and discharging behavior of BT; e TST is the unit power subsidy for heat storage and release behavior of TST.
The operation constraints are described as follows.
where L t AE and L t AH are the basic electrical load and basic hot water load at time t after load aggregation, which cannot be scheduled during the UDDSR event.

2.
Energy supply constraints where P gridmax is the maximum interactive power between the community system and the power grid per unit time; P MTmax and P MTmin are the maximum and minimum generating power of MT; Q GBmax is the maximum heating power of GB.

Energy storage constraints
For BT, the constraints are: where S t BT,ch and S t BT,dis are 0-1 variables representing the charging and discharging state of BT; P BT,chmax and P BT,dismax are the maximum charging and discharging power of BT; W BTmax and W BTmin are the maximum and minimum energy storage capacity of BT.
For TST, the constraints are: where S t TST,ch and S t TST,dis are 0-1 variables representing the heat storing and releasing state of TST; P TST,chmax and P TST,dismax are the maximum heat storing and releasing power of TST; W TSTmax and W TSTmin are the maximum and minimum heat storage capacity of TST.

CVaR-Based Energy Optimization Model
The day-ahead energy optimization model mentioned in the above section is based on the accurate prediction of the basic electric and heat loads, PV output, and outdoor temperature. It ignores the error between the predicted value and actual value, and assumes that users will maximize the UDDSR response according to the response load capacity of the IDR bid. However, actually, the prediction error may have a significant impact on the optimization results, and users may not respond according to the maximum capacity after UDDSR bid, which must be taken into consideration. In order to solve the above questions, CVaR is applied.

CVaR Model
CVaR theory was firstly used to solve the optimal portfolio problem of investment risk related to financial hedging. It is mainly used to measure the investment loss when the investment loss exceeds the expected maximum loss (i.e., Value-at-Risk (VaR)) under a given confidence level. The CVaR model is shown as follows.
where CVaR con is the average excess loss under a given confidence level; con is the confidence level; f (X, γ) is the loss function; X is the investment portfolio; γ is the risk variable; VaR con is the expected maximum loss under the con; E[.] expresses the expect function.
If the probability of γ in different scenarios is known, the formulation of discrete CVaR can be expressed as follows.
where p t γ is the probability of γ occurring at time t; N is the number of discrete time intervals.
However, (42) needs to obtain VaR at the same confidence level first, which complicates the computing process. To increase the computing speed, the relaxation method in [22] is applied to solve CVaR and VaR simultaneously. The relaxed CVaR discrete function is converted into a common optimization problem, and its calculation formula is expressed as follows.
where CVaR con is the minimum value of g(X, α); α is the intermediate variable after relaxation of VaR, and when g(X, α) goes to the minimum, α is equal to VaR con .

Day-Ahead Energy Optimization Model Based on CVaR
In the community CHP system, the uncertainties include the prediction errors of electric and heat load, PV output and outdoor temperature, and the response load fluctuation of UDDSR. In this section, the random simulation algorithm is used to generate a set of uncertinty scenarios. It is assumed that the probability distribution of forecast errors and load response fluctuation obeys the normal distribution with the mean value being the forecast, i.e., γ~N(r forecast, σ 2 ), and the probability distribution formula is: where r is the uncertainty variable; σ is the standard deviation of r; r forecast is the forecast value of r. According to (43), the day-ahead energy optimization model based on CVaR is formulated as follows.
where C total,i is the total cost of system operation in scenario i; E[C total,i ] is the expected cost of system operation in all simulated uncertainty scenarios; φ i is the middle variable in scenario i; M is the total number of uncertainty scenarios. Then, after considering the uncertainties of forecast error and response fluctuation, the total cost of system operation can be converted into: where C punish is the penalty fee when users do not respond according to the response load optimized by day-ahead UDDSR; L t DRE is the total actual response load; L t DRE0 is the response load optimized by day-ahead UDDSR.
Additionally, according to (18), the objective function can be converted into where β is the uncertainty factor, i.e., the willingness of the community system to take risks, and β Є[0,1].
Meanwhile, the purpose of the energy optimization based on CVaR is to meet the operating conditions in all uncertainty scenarios, thus the bus balancing constraints can be converted into:

Case Study
The proposed model is conducted on a community IES modified from a central neighborhood in Anhui province in China. The community structure diagram is presented in Figure 2. The forecast curves of electricity load, hot water load, PV output and outdoor temperature of the system on a typical winter day is shown in Figure 4. In the appendix, the peak-valley time-of-use electricity price, the subsidy for users participating in UDDSR and the gas price are shown in Table A1, the equipment operating parameters are shown in Table A2, and the equipment cost and subsidy parameters are shown in Table A3, which are all modified from [23]. The cases were compiled with Python 3.7, and solved by Gurobi solver.  Table A2, and the equipment cost and subsidy parameters are shown in Table A3, which are all modified from [23]. The cases were compiled with Python 3.7, and solved by Gurobi solver.

Day-Ahead Energy Optimization Based on UDDSR
In order to verify the impact of the UDDSR mechanism on the whole community system, the outputs of the system equipment before and after the UDDSR response were analyzed.

Day-Ahead Energy Optimization Based on UDDSR
In order to verify the impact of the UDDSR mechanism on the whole community system, the outputs of the system equipment before and after the UDDSR response were analyzed.

Energy Optimization Results without UDDSR Response
When users do not participate in the UDDSR response, the community CHP optimizes energy consumption according to the prediction values of electric and heat loads, PV outputs, and outdoor temperature. The optimization results of equipment outputs are shown in Figure 5. It can be seen that during the valley period of the electricity price, since the cost of purchasing electricity from the grid is lower than that of MT generation, the electrical load is almost entirely satisfied by the power supply from the grid. Meanwhile, since the cost of heat production per unit power of GB is lower than that of MT, and the heat load at this time is higher, GB gives priority to full power to ensure heat supply. During the peak period of the electricity price, the cost of power supply from MT is lower than the electricity price, thus the power supply of MT increases significantly. At this time, the remaining heat load is supplemented by GB.
On the other hand, due to the CHP characteristics of MT, after complementing the heat load, MT has excess power. BT charges at the time of 04:00-05:00 and 15:00-16:00 to dissipate the excess power, and discharges during the peak period of power consumption, which improves the energy utilization rate and operating economy of the system. Similarly, when MT produces too much heat, TST uses the heat storage and release characteristics to meet the thermal load demand. The change of indoor heating temperature is depicted in Figure 6. It can be observed that the indoor temperature is always maintained near the optimal room temperature, and the heating needs are met. The change of indoor heating temperature is depicted in Figure 6. It can be observed that the indoor temperature is always maintained near the optimal room temperature, and the heating needs are met. The change of indoor heating temperature is depicted in Figure 6. It can be observed that the indoor temperature is always maintained near the optimal room temperature, and the heating needs are met.

Energy Optimization Results with UDDSR Response
When users participate in the UDDSR response, they submit a flexible IDR bid to CEMS according to their own energy demand. The bid content includes the interruptible load, the shiftable load, the time and capacity of the adjustable load and the CEMS aggregates and optimizes the responsive loads of the users. Based on the aggregated results of the responsive loads, the energy use of the community CHP system is optimized. The UDDSR bid results are shown in Figure 7. In this figure, the green curve indicates the adjustable time of the heating temperature allowed by users. When L_DRH State > 0, the upper and lower limits of the heating temperature are allowed to be reduced by Tadj, i.e., the heating range is changed into Tinmin-Tadj ≤ T t in ≤ Tinmax-Tadj; when L_DRH State < 0, the heating temperature cannot be reduced, i.e., the thermal load cannot be adjusted. In this case, it is assumed that Tadj = 1, Tinmin = 18, Tinmax = 26. It can be seen that the operating costs

Energy Optimization Results with UDDSR Response
When users participate in the UDDSR response, they submit a flexible IDR bid to CEMS according to their own energy demand. The bid content includes the interruptible load, the shiftable load, the time and capacity of the adjustable load and the CEMS aggregates and optimizes the responsive loads of the users. Based on the aggregated results of the responsive loads, the energy use of the community CHP system is optimized. The UDDSR bid results are shown in Figure 7. In this figure, the green curve indicates the adjustable time of the heating temperature allowed by users. When L_DRH State >0, the upper and lower limits of the heating temperature are allowed to be reduced by T adj , i.e., the heating range is changed into T inmin -T adj ≤ Tt in ≤ T inmax -T adj ; when L_DRH State < 0, the heating temperature cannot be reduced, i.e., the thermal load cannot be adjusted. In this case, it is assumed that T adj = 1, T inmin = 18, T inmax = 26. It can be seen that the operating costs of the community CHP system are lower when users perform UDDSR based on the optimized IDR response load, compared with performing UDDSR according to the maximum response capacity of the aggregated IDR bid.  The optimization results of the equipment output after the UDDSR response are shown in Figure 8. Figure 8a indicates that after the UDDSR response, the power purchasing from the grid during the peak load period is significantly reduced, since part of the unnecessary load is interrupted or shifted. Figure 8b indicates that during the period of 00:00-05:00 and 21:00-23:00, the MT heat supply is significantly reduced, and the heat The optimization results of the equipment output after the UDDSR response are shown in Figure 8. Figure 8a indicates that after the UDDSR response, the power purchasing from the grid during the peak load period is significantly reduced, since part of the unnecessary load is interrupted or shifted. Figure 8b indicates that during the period of 00:00-05:00 and 21:00-23:00, the MT heat supply is significantly reduced, and the heat load of the users has been adjusted. Figure 9 represents the comparison of the electric heating load before and after the user response. It can be observed that the UDDSR mechanism has an obvious "peak-shaving and valley-filling" effect on the community system, and can successfully complete the demand response events initiated by the grid operator or dispatching department. Figure 10 displays the indoor heating temperature changes before and after UDDSR response. After the UDDSR response, the heat load during the period of 00:00-05:00 and 21:00-23:00 has been reduced to a certain extent. Although the actual room temperature has been lowered, it is still higher than T inmin -T adj . This means the community system does not operate according to the minimum heating temperature, which guarantees the energy satisfaction of users to the greatest extent, and verifies the accuracy and validity of the heating temperature constraint in (18)     The comparison of system operating costs before and after UDDSR response is shown in Table 1. It can be seen that after participating in the UDDSR response, users can directly receive a load response compensation of RMB 250.49 (including power load and thermal load response compensation). The total daily operating cost of the community system is reduced by RMB 543.75, and the saving rate can reach 3.09%. The results verify the effectiveness of the proposed UDDSR mechanism.

CVaR-Based Energy Optimization
In this subsection, the random simulation sampling method based on (44) is used to model the uncertainties that the community system may face. Four scenarios where the maximum prediction error and maximum load response fluctuation (maximum uncertainty fluctuations) are not more than 5%, 10%, 15% and more than 15% are set for comparison. Among them the maximum prediction error of outdoor temperature is set to be not more than 2°C. The number of subscenarios in the uncertainty scenario set for each scenario is 100. The influence of different confidence levels con and different uncertainty coefficients β on the system optimization results is analyzed.

Energy Risk Optimization Results Based on CVaR
Scenario 2, where the maximum uncertainty fluctuation does not exceed 10%, is taken as an example to analyze the optimization results when con = 0.95, β = 1. A set of uncertainty scenarios is depicted in Figure 11. The comparison of system operating costs before and after UDDSR response is shown in Table 1. It can be seen that after participating in the UDDSR response, users can directly receive a load response compensation of RMB 250.49 (including power load and thermal load response compensation). The total daily operating cost of the community system is reduced by RMB 543.75, and the saving rate can reach 3.09%. The results verify the effectiveness of the proposed UDDSR mechanism.

CVaR-Based Energy Optimization
In this subsection, the random simulation sampling method based on (44) is used to model the uncertainties that the community system may face. Four scenarios where the maximum prediction error and maximum load response fluctuation (maximum uncertainty fluctuations) are not more than 5%, 10%, 15% and more than 15% are set for comparison. Among them the maximum prediction error of outdoor temperature is set to be not more than 2 • C. The number of subscenarios in the uncertainty scenario set for each scenario is 100. The influence of different confidence levels con and different uncertainty coefficients β on the system optimization results is analyzed.

Energy Risk Optimization Results Based on CVaR
Scenario 2, where the maximum uncertainty fluctuation does not exceed 10%, is taken as an example to analyze the optimization results when con = 0.95, β = 1. A set of uncertainty scenarios is depicted in Figure 11. The electrical load response is assumed to fluctuate below the optimal response obtained by day-ahead optimization based on UDDSR, i.e., the case only considers the situation where the actual response of users does not meet the standard. The adjustable thermal load is allowed to be regulated at 00:00-05:00 and 21:00-23:00, and this setting has a certain logical consistency with the heating needs of users.
The system energy optimization results of scenario 2 are depicted in Figure 12. From Figure 12a, it can be observed that when β = 1, the power supply of the community system is greater than the predicted electric load in most periods. In Figure 12b, L_AC0 is the thermal load of users before the UDDSR response, and the heating power of the community system during 00:00 and 06:00-13:00 is greater than the predicted heating load. The community system adopts a completely conservative risk avoidance strategy, i.e., to make the system operate normally under the interference of any risk fluctuations in the second scenario, the system equipment output as much power as possible to meet the electric and heating demand of users. Figure 13 shows the changes in indoor temperature in the four scenarios. It can be seen that the greater the risk fluctuation, the greater the indoor temperature variation. However, the change of the indoor temperature remains within 2°C per unit time, and the indoor temperature is kept within the upper and lower limits allowed by users. Figure 11. Uncertainty scenarios set with maximum risk fluctuation ≤10%.
The electrical load response is assumed to fluctuate below the optimal response obtained by day-ahead optimization based on UDDSR, i.e., the case only considers the situation where the actual response of users does not meet the standard. The adjustable thermal load is allowed to be regulated at 00:00-05:00 and 21:00-23:00, and this setting has a certain logical consistency with the heating needs of users.
The system energy optimization results of scenario 2 are depicted in Figure 12. From Figure 12a, it can be observed that when β = 1, the power supply of the community system is greater than the predicted electric load in most periods. In Figure 12b, L_AC0 is the thermal load of users before the UDDSR response, and the heating power of the community system during 00:00 and 06:00-13:00 is greater than the predicted heating load. The community system adopts a completely conservative risk avoidance strategy, i.e., to make the system operate normally under the interference of any risk fluctuations in the second scenario, the system equipment output as much power as possible to meet the electric and heating demand of users. Figure 13 shows the changes in indoor temperature in the four scenarios. It can be seen that the greater the risk fluctuation, the greater the indoor temperature variation. However, the change of the indoor temperature remains within 2 • C per unit time, and the indoor temperature is kept within the upper and lower limits allowed by users. The comparison of system operating costs in the four scenarios is shown in Table 2. When the maximum risk fluctuation is less than or equal to 5%, the expected total cost of system operation is reduced by RMB 158.7 compared with the total cost without UDDSR response, that is, a saving of 0.9%. When the maximum risk fluctuation is less than or equal to 10%, the expected cost of the community system operating in the second scenario is RMB 212.33 higher than that without UDDSR response. The system only needs to pay 1.21% more in operating expenses to deal with the impact of 10% risk fluctuation. When the maximum risk fluctuation is larger than 10%, the expected cost of system operation will continue to rise as the risk fluctuation becomes larger. Once the prediction error is large, the system must pay high costs in order to avoid operational risks. On the other hand, the average excess loss of the system increases with the increase in risk fluctuations, indicating that the system needs to increase investment to better deal with risks, which verifies the rationality of the algorithm proposed in this paper. The comparison of system operating costs in the four scenarios is shown in Table 2. When the maximum risk fluctuation is less than or equal to 5%, the expected total cost of system operation is reduced by RMB 158.7 compared with the total cost without UDDSR response, that is, a saving of 0.9%. When the maximum risk fluctuation is less than or equal to 10%, the expected cost of the community system operating in the second scenario is RMB 212.33 higher than that without UDDSR response. The system only needs to pay 1.21% more in operating expenses to deal with the impact of 10% risk fluctuation. When the maximum risk fluctuation is larger than 10%, the expected cost of system operation will continue to rise as the risk fluctuation becomes larger. Once the prediction error is large, the system must pay high costs in order to avoid operational risks. On the other hand, the average excess loss of the system increases with the increase in risk fluctuations, indicating that the system needs to increase investment to better deal with risks, which verifies the rationality of the algorithm proposed in this paper. The comparison of system operating costs in the four scenarios is shown in Table 2. When the maximum risk fluctuation is less than or equal to 5%, the expected total cost of system operation is reduced by RMB 158.7 compared with the total cost without UDDSR response, that is, a saving of 0.9%. When the maximum risk fluctuation is less than or equal to 10%, the expected cost of the community system operating in the second scenario is RMB 212.33 higher than that without UDDSR response. The system only needs to pay 1.21% more in operating expenses to deal with the impact of 10% risk fluctuation. When the maximum risk fluctuation is larger than 10%, the expected cost of system operation will continue to rise as the risk fluctuation becomes larger. Once the prediction error is large, the system must pay high costs in order to avoid operational risks. On the other hand, the average excess loss of the system increases with the increase in risk fluctuations, indicating that the system needs to increase investment to better deal with risks, which verifies the rationality of the algorithm proposed in this paper.  To further study the impact of confidence level con and uncetianty coefficient β (the risk preference of system operators) on the system optimization results, scenario 2 is used as an example to construct the following test set.
The performance of the expected cost of community system operation on the test set under scenario 2 is shown in Figure 14. The expected cost of system operation decreases as the confidence level decreases. This is because the predicted value of the uncertainty variable is used to generate the scenario. The lower the value of con, the lower the probability that the predicted value of the uncertainty variable is included in the uncertainty scenario set (i.e., the closer the uncertainty variable is to the predicted value). On the other hand, β represents the weight of CVaR in the optimization objective function. The larger  To further study the impact of confidence level con and uncetianty coefficient β (the risk preference of system operators) on the system optimization results, scenario 2 is used as an example to construct the following test set.
The performance of the expected cost of community system operation on the test set under scenario 2 is shown in Figure 14. The expected cost of system operation decreases as the confidence level decreases. This is because the predicted value of the uncertainty variable is used to generate the scenario. The lower the value of con, the lower the probability that the predicted value of the uncertainty variable is included in the uncertainty scenario set (i.e., the closer the uncertainty variable is to the predicted value). On the other hand, β represents the weight of CVaR in the optimization objective function. The larger the weight, the more the system tends to avoid uncertainties. Therefore, when con is determined, the expected cost of the system increases with the increase of β. Figure 15 shows the average excess loss CVaR that the community runs under uncertainty on the test set. The average excess loss of the system decreases with the increase in the CVaR weight. The larger the CVaR weight, the more prone the system is to uncertainties, and the system will try to reduce possible uncertainty-induced losses even if this results in of higher operation costs. On the other hand, when β is determined, the average excess loss increases with the rise of con. This is because CVaR measures the tail uncertainty outside the confidence interval. The larger con is, the greater the deviation between the uncertainty variables and the predicted value in the uncertainty scenario, and the greater the possible uncertainty loss is.
To more clearly show the relationship between CVaR and the expected cost of system operation, a case where con = 0.95 is analyzed. In this case, the uncertainty variables contained in the uncertainty scenario set are more volatile, and the system is faced with greater possible uncertainties. The results are shown in Figure 16. When β increases, the expected cost of the system continues to increase, while the average excess loss of the system continues to decrease. This is because the greater β is, the more the system prefers to avoid uncertainties, and the system is willing to pay higher operating costs in exchange for lower excess losses.

Conclusions
This paper proposes an energy optimization method for community IES based on UDDSR. The thermal model of aggregated buildings is introduced to measure users' adjustable thermal load, and the responsive loads including power loads and thermal loads are aggregated and optimized through UDDSR optimization. Then, a day-ahead scheduling model is proposed to optimize the energy management for the community IES, and CVaR theory is introduced to deal with the volatility of PV output, user load, outdoor temperature, and user actual UDDSR response load. The case study shows that the proposed UDDSR mechanism can effectively reduce the operating costs under the premise of fully considering the willingness of users to participate in IDR events. Additionally, the optimization method based on CVaR enables the community system to pay less than 2% in additional operating costs to deal with the energy deviation caused by the maximum uncertainty of 10%, thus verifying the correctness and effectiveness of the method presented in this paper. For further study, the relationship between user energy consumption

Conclusions
This paper proposes an energy optimization method for community IES based on UDDSR. The thermal model of aggregated buildings is introduced to measure users' adjustable thermal load, and the responsive loads including power loads and thermal loads are aggregated and optimized through UDDSR optimization. Then, a day-ahead scheduling model is proposed to optimize the energy management for the community IES, and CVaR theory is introduced to deal with the volatility of PV output, user load, outdoor temperature, and user actual UDDSR response load. The case study shows that the proposed UDDSR mechanism can effectively reduce the operating costs under the premise of fully considering the willingness of users to participate in IDR events. Additionally, the optimization method based on CVaR enables the community system to pay less than 2% in additional operating costs to deal with the energy deviation caused by the maximum uncertainty of 10%, thus verifying the correctness and effectiveness of the method presented in this paper. For further study, the relationship between user energy consumption behavior and response capacity can be explored, so as to construct a reward and punishment mechanism that is more suitable for the energy needs of users.