Time-Scale Economic Dispatch of Electricity-Heat Integrated System Based on Users’ Thermal Comfort

The electricity-heat integrated system can realize the cascade utilization of energy and the coordination and complementarity between multiple energy sources. In this paper, considering the thermal comfort of users, taking into account the difference in dynamic characteristics of electric and heating networks and the response of users’ demands, a dispatch model is constructed. In this model, taking into account the difference in the time scale of electric and thermal dispatching, optimization of the system can be improved by properly extending the thermal balance cycle of the combined heat and power (CHP) unit. Based on the time-of-use electricity prices and heat prices to obtain the optimal energy purchase cost, a user demand response strategy is adopted. Therefore, a minimum economic cost on the energy supply side and a minimum energy purchase cost on the demand side are considered as a bilevel optimization strategy for the operation of the system. Finally, using an IEEE 30 nodes power network and a 31 nodes heating network to form an electricity-heat integrated system, the simulation results show that the optimal thermal balance cycle can maximize the economic benefits on the premise of meeting the users’ thermal comfort and the demand response can effectively realize the wind curtailment and improve the system economy.


Introduction
In energy demand, heat and electric energy are not only the basic needs of human production and life, but also the main energy forms of the integrated energy system. The interaction between power and thermal systems will play a significant role in efficiently promoting the economic transition to a low-carbon energy system with a high permeability of renewable energy. Electricity-heat integrated systems have become an inevitable trend to achieve the close integration of energy networks and improve the overall energy efficiency of the system [1][2][3][4].
At present, a lot of studies have been carried out to research the economic dispatch of electricity-heat integrated system [5][6][7]. Part of the literature decouples the constraints of combined heat and power (CHP) unit's "using heat to determine electricity" by adding electricity-to-heat equipment and heat storage devices [8,9] or utilizing the heat storage capacity of the district heating network [10], thus improving the flexibility of the electricity-heat integrated system. In [11], the air source heat pump is proposed as an alternative to the electrification of European heating. A specific heat pump model is proposed and open data from building, climate, and economic sources are used for analysis. This kind of electric heating equipment can effectively reduce carbon emissions. The authors in [12] proposed a multi-time scale optimization method for the CHP microgrid containing renewable energy, and the operational optimization of the hybrid microgrid was completed through the "hour", "minute" and "second" time scales. The authors in [3] described a mixed integer linear programming model for determining the optimal capacity and operation of seven combined cooling, heating and power systems in the heating and cooling network of a residential district (Shahid Beheshti Town) located in the east of Tehran. The economic and environmental results obtained from the scenarios revealed savings in costs and a reduction in CO 2 emissions in the optimal cogeneration system compared with using boilers to produce heat and buying electricity from the grid.
The wind power accommodation problem brings more challenges to the research of electricity-heat integrated systems. Most scholars have done a lot of research into improving the flexibility of CHP units, and improving the flexible peak-shaving capacity of electricity-heat integrated systems, which are the important means to solve the shortage of wind power accommodation [13]. In [14], a multi-level, multi-time-scale method was proposed to use a single demand-side resource to provide multiple system services at the same time, so as to alleviate the problem that insufficient flexibility would lead to the reduction of high-level renewable energy. Based on the time-of-use electricity price, a new energy optimal dispatching model considering the users' comfort and power consumption economy of microgrid was proposed in [15]. In [16], in order to make full use of renewable energy and dispatch demand side resources more hierarchically, a bilevel optimal dispatch model of the microgrid considering customer satisfaction was proposed, and the resulting net loads could be treated as a link between the upper and lower layer dispatch.
In this paper, considering the improvement of the living standards of users, the heating system needs to adjust the heating quantity according to the change of ambient temperature, and makes the corresponding regulation and control according to the user's somatosensory temperature. Buildings and district heating networks were used in [17] to realize energy storage to compensate for the reduced heat output of the district heating system. The obtained results were presented for the reference district heating system in Poland. Estimated consumption of heat from centralized sources, individual thermal generators, and heating stoves by the population of Russia is obtained in [18]. Segments of households are distinguished according to the type of thermal amenities and described, and the thermal comfort situation is analyzed. This kind of heating system, which takes the users' comfort as the control target, puts forward higher requirements for the operation and regulation level of the heat supply network. In addition, due to the thermal inertia of thermal energy, there is a large delay in the transmission and consumption links, so the mode of total heat supply balance in a certain period of time which is the time scale of heat balance can be selected to achieve system economic optimization [19]. The size of the thermal balance time scale has a great impact on users' comfort. Therefore, it is a key problem to select the optimal thermal balance dispatch time scale to achieve the balance between users' comfort and the system operation economy. The contributions of this paper are organized as follows: • Based on the outdoor temperature and the user's thermal comfort, the fuzzy membership function can be used as the user's thermal comfort index, which can scientifically reflect the relationship between heating power and users' comfort reasonably, and put forward the concept of the heat demand envelope belt.

•
Considering the users' comfort index and the characteristics of the real-time power balance and total heat energy balance in the dispatch time scale, the thermal balance dispatch cycle model is established to find the balance point between user comfort and system economy. The thermal inertia of the heating network is used to fully excavate the system operation economy and improve the unit operation flexibility.

•
Exploiting the available potential of user-side resources, a time-scale economic dispatch model of electricity-heat integrated systems considering thermal comfort is established. According to the relationship between time-sharing electricity price and thermal price, users can take a demand response (DR) action to obtain the optimal energy purchase cost.

•
Taking a typical winter day in a certain area of Liaoning Province of China as an example, considering the specific power network structure, the simulation results are more practical.
The simulation results show that the optimization model can determine the optimal heat regulation Energies 2020, 13, 5505 3 of 27 time of the system, which meets the requirements of user comfort, improve the flexibility of the system, improve the system operation economy, and effectively improve the wind power absorption capacity.

Indoor Temperature Model
At present, there are two common types of civil heating systems, which are hot water-air radiator convection heating systems or low temperature hot water floor radiant heating system. In this paper, a hot water air radiator convective heating system is adopted.
The inner surface of the heating radiator is hot water, and the outer surface side is indoor air. The radiator increases the indoor temperature by heating the indoor air. The heat dissipation power of the radiator Q ra,t can be described below: where c w is the specific heat capacity of water; m j is the mass flow of hot water in the water supply pipe connected to user j; T in and T out represent the inlet and outlet temperature of hot water, respectively. Considering the temperature loss of the hot water pipe, the temperature of the inlet pipe and the outlet pipe of the house satisfy the following formula: where h is the heat transfer coefficient; l s is the length of the pipe; m is the superior hot water mass flow connected to the user; T s , T r and T a refer to the water supply temperature, return water temperature and outdoor temperature of the heat pipe in the heating network, respectively. Thus the indoor temperature calculation formula is given as follows: where T n,t+1 is the indoor temperature at time t + 1; δ is the air heat transfer coefficient; ∆t is the unit dispatch time; T c is the heat dispatch cycle of the electricity-heat integrated system; U ra,t represents the on-off state of the radiator during the t period; U ra,t = 0 and U ra,t = 1 represent the shutdown state and open state, respectively.

Users' Thermal Comfort Index
While the electricity-heat integrated system improves the operating economy, it also needs to ensure users' thermal comfort requirements. In order to simplify the analysis, this paper only uses temperature as a measure of the comfort level of people's thermal perception. Therefore, we define a fuzzy membership function based on thermal comfort [20]: where a and b are set values; µ is a fuzzy membership value based on user thermal comfort. According to reference [21], the desired indoor temperature is influenced by the preference of the user, the local climate (temperature/humidity), the physical characteristics of the room (insulation, heat gain), etc. For example, the suitable indoor temperature ranges for people's daily life is from 22 to 26 • C. This shows that people's comfortable temperature in daily life tends to be in a fuzzy range. In order to reflect the user's temperature preference more truly, we propose the fuzzy membership Energies 2020, 13, 5505 4 of 27 function. In this paper, we set a = 25 • C, b = 6.1616 and µ is set to be greater than 0.9; that is, when the indoor temperature is within the temperature range of 23.586 to 26.414 • C, the human body is at a more comfortable temperature. We can also adjust the values of a, b, and µ according to the different comfort requirements of different users. Therefore, the following research in this paper also makes the temperature maintain a range through the ambiguity of the user's perception of temperature, and the thermal network does not need a real-time balance, so that the total heat demand can be adjusted within a certain range, which is more convenient to adjust the output of the thermal power unit to obtain a higher economy. The fuzzy membership function based on user thermal comfort is shown in Figure 1.
range. In order to reflect the user's temperature preference more truly, we propose the fu ership function. In this paper, we set a = 25 °C, b = 6.1616 and μ is set to be greater than s, when the indoor temperature is within the temperature range of 23.586 to 26.414 °C n body is at a more comfortable temperature. We can also adjust the values of a, b, and ing to the different comfort requirements of different users. Therefore, the following rese s paper also makes the temperature maintain a range through the ambiguity of the u ption of temperature, and the thermal network does not need a real-time balance, so tha eat demand can be adjusted within a certain range, which is more convenient to adjus t of the thermal power unit to obtain a higher economy. The fuzzy membership function b er thermal comfort is shown in Figure 1. ermal Demand Envelope Based on Users' Thermal Comfort he main heat dissipation device in the user room is a radiator, and the power of the rad meet the following constraints.

Thermal Demand Envelope Based on Users' Thermal Comfort
The main heat dissipation device in the user room is a radiator, and the power of the radiator must meet the following constraints.
where K s is the heat transfer coefficient of the radiator; F s is the heat dissipation area of the radiator; N s is the correction coefficient of the number of assembled pieces, connection forms and installation forms of the radiator. Based on the user's thermal comfort, the upper and lower limits of radiator output are given as follows: Q ra,t ≤ Q ra,t ≤ Q ra,t Q ra,t = K s F s N s where µ is the user's minimum thermal comfort standard and the corresponding upper and lower temperature is T µ j n and T µ j n , so the upper and lower limits of the power of the user's radiator are Q ra,t and Q ra,t . µ j is the comfort degree set for user j, and the indoor temperature of the user at time t must meet the comfort condition µ j ≤ µ t ≤ 1.
Adjustable range of user's heat demand at each moment is expressed as follows: Energies 2020, 13, 5505 where ∆Q ↑ ra,t and ∆Q ↓ ra,t are the powers that can be increased and reduced by the user radiator at time t, that is, the adjustable range of thermal power to meet the user's thermal comfort demand.

Electricity-Heat Integrated System Structure
The power supply network, heating network, heat storage system, control system coordinating the temperature balance of the supply and demand side, and the electric boiler equipment as a coupling link constitute the electricity-heat integrated system. The architecture is shown in Figure 2.
ectricity-Heat Integrated System Structure he power supply network, heating network, heat storage system, control system coordina mperature balance of the supply and demand side, and the electric boiler equipment ing link constitute the electricity-heat integrated system. The architecture is shown in Figu t can be seen from Figure 2 that the power grid, wind turbine, and gas turbine jointly su r. The gas turbine and gas-fired boiler both use natural gas as fuel cooperating with each o smit the heat generated to the heating network, which distributes the heat energy. Due to ence of power consumption during peak and valley periods and the randomness and anti-p tion characteristics of wind power generation, it is necessary to coordinate the equipmen tegrated energy system to accommodate wind power, realize the cascade utilization of en chieve the purpose of an economic dispatch. stem Unit Modeling.
Gas Turbine he gas turbine uses clean fossil energy and natural gas as fuel, and uses the waste heat reco to recover the high-temperature gas emitted from fuel combustion and power generatio e heat for users, realizing the cascade utilization of energy; the energy utilization efficienc rbines is usually as high as 75-90%, and the unit area is smaller, while the power equip he same area is larger [22]. The gas turbine power supply and heat supply are given as foll , e cj cj g e cj  It can be seen from Figure 2 that the power grid, wind turbine, and gas turbine jointly supply power. The gas turbine and gas-fired boiler both use natural gas as fuel cooperating with each other to transmit the heat generated to the heating network, which distributes the heat energy. Due to the difference of power consumption during peak and valley periods and the randomness and anti-peak regulation characteristics of wind power generation, it is necessary to coordinate the equipment of the integrated energy system to accommodate wind power, realize the cascade utilization of energy and achieve the purpose of an economic dispatch.

Gas Turbine
The gas turbine uses clean fossil energy and natural gas as fuel, and uses the waste heat recovery device to recover the high-temperature gas emitted from fuel combustion and power generation to provide heat for users, realizing the cascade utilization of energy; the energy utilization efficiency of gas turbines is usually as high as 75-90%, and the unit area is smaller, while the power equipped with the same area is larger [22]. The gas turbine power supply and heat supply are given as follows: Energies 2020, 13, 5505 6 of 27 P e,cj = V cj H g η e,cj (12) P h,cj = V cj H g (1 − η e,cj − η loss )η h,cj (13) where P e,cj and P h,cj denote power generation and heat generation power of the gas turbine, respectively; η e,cj , η loss , η h,cj respectively represent the power generation efficiency, energy loss rate and heat recovery efficiency of the gas turbine; V cj is the hourly natural gas consumption of the gas turbine; H g is the natural gas heating value.

Gas Boiler
The gas boiler can be used as a collaborative heat generation equipment to cooperate with the gas turbine to meet the demand of heat load. The heat power of the gas turbine is given as follows: where Q gb,j , V gb, j and η gb,j respectively represent the heat production power, the volume of natural gas consumed per hour and the heat production efficiency of gas boilers.

Dispatch Model of Heat Balance Cycle
Heat balance dispatch directly or indirectly controls the heating equipment in the system by the heating system increasing or reducing its heat production, so as to meet the heat demand in a period of time. During the heat balance cycle, the sum of heat production of the gas turbine and the gas boiler shall be equal to the sum of the total heat load and the heat loss of the system, thus the heat power balance equation is obtained as follows: where P t h,cj is the heat generation power of the gas turbine; L t h,j is the heat demand of user j; P t h,loss is the heat loss power of heating network.
During the heat balance cycle, the total heat load should be equal to the heat required to satisfy the thermal comfort.
where N j is the total number of users. The heat exchanger realizes the temperature exchange between the primary and secondary heat supply networks, and the heat loss of the heat exchange network is given as follows:

Objective Function
The operation cost of the time-scale economic dispatch in the energy supply side of the electricity-heat integrated system includes the cost of generating electricity by thermal power units, the cost of purchasing natural gas, the cost of purchasing electricity from the superior power grid, and the cost of operating and maintaining the unit equipment in the dispatching cycle. The objective function is given as follows: Energies 2020, 13, 5505 where f 1 is the function of energy supply cost; T is the number of dispatching cycles; C t gi is the cost of thermal power; C t g is the cost of gas purchase; C t pe is the cost of electricity purchase; C t om is the cost of unit operation and maintenance.
The generation cost of the thermal power unit is a quadratic function of the power generated by the thermal power unit. The heat generation cost in the t period is given as follows: where N gi represents the number of thermal power units; a, b, c are constants. The cost function of purchasing natural gas is given as follows: where p h is the price of natural gas. The cost function of purchasing electricity from superior power grid is given as follows: where p t e is the time of use price of the superior power grid in time period and t and P t grid refer to the purchasing power of the electricity-heat integrated system in time period t.
The operation and maintenance costs of units in the electricity-heat integrated system are given as follows: where K gi , K cj and K gb, j are the unit price of the thermal power unit operation and maintenance, gas turbine operation and maintenance unit price and gas boiler operation and maintenance unit price, respectively.

Constraints
where θ s,z is the phase angle difference between node s and z; G sz and B sz are the conductance and admittance of the transmission line, respectively; L e,j is the electric load demand of user j in the area.

Reactive Power Balance of Power Network
where Q t gi , Q t ci , Q t wi and Q t L,i are the reactive power outputs of the thermal generator, gas turbine and wind turbine and load consumption reactive power at node s, respectively.

Inequality Constraints of Power Network Nodes
The inequality constraints of the power network include the phase angle constraint and amplitude constraint.
where θ n is the phase angle of node n in the power network.
where V n is the amplitude of node n in the power network.

Coupling Node Power Balance Constraint
As a coupling node, the CHP unit can generate thermal energy while generating electric power, and its active and reactive power outputs are constrained.

Inequality Constraints of Thermal Power Generating Units
where P t e,gi and P t e,gi are the upper and lower limits of active power generated by thermal power units, respectively; Q t e,gi and Q t e,gi are the upper and lower limits of reactive power generated by thermal power units, respectively.

Gas Turbine Inequality Constraints
where P t e,cj and P t e,cj are the upper and lower limits of the active power generated by the gas turbine, respectively; P t e,cj and P t e,cj are the upper and lower limits of the heat generation power of the gas turbine, respectively; Q t e,cj and Q t e,cj are the upper and lower limits of the reactive power generated by the gas turbine, respectively.

Gas Boiler Inequality Constraints
where Q t gb,cj and Q t gb,cj are the upper and lower limits of the gas boiler output, respectively.
where P t e,wi and P t e,wi are the upper and lower limits of wind power active power of wind farm wi, respectively.

Thermal Comfort Constraints
where µ j is the fuzzy membership value of thermal comfort of user j.

Users' DR Structure
Users' DR is one of the most important ways to realize energy consumption interaction. Operators can guide users to change their electricity load to participate in peak load regulation, and transfer the demand from peak time to valley period to obtain an effective method to smooth the load curve, which reduces the load peak valley difference, and increases the role of the demand side in the power market by actively participating in the optimization of the power consumption mode [23,24].

Power Demand Side Response
Considering the power demand side response, the use of electric energy can be reasonably planned to make the power grid run smoothly and save the cost of users. Demand side response strategies are mainly divided into two types: Incentive-based and price-based [25][26][27][28]. Incentive-based demand response (IDR) refers to the situation that the user responds to the load interruption request of the dispatching center at a specific time according to the signed contract, reduces or interrupts the power consumption, and obtains corresponding economic compensation [29]. The price-based demand response (PDR) strategy is divided into time-of-use pricing (TOU), real-time pricing (RTP), and critical peak pricing (CPP). TOU is a common electricity price strategy in China, which can effectively reflect the difference in power supply cost in different periods of the power grid. The main measures are to increase the electricity price appropriately in the peak period, reduce the price in the low period, reduce the difference between the peak and the valley of the load, which can improve the power consumption of users, and achieve the effect of the peak load shifting and valley filling. TOU is an effective electricity price type DR strategy to reduce peak load and save costs, and plays an increasingly important role in the power demand side response [30,31].
In this paper, TOU strategy is used to divide a day into peak period, flat period, and trough period. A reasonable peak-valley price can stimulate users to change the traditional power consumption mode economically, so as to alleviate the power tension in the peak period, tap the power demand in the low valley period, and achieve the purpose of peak load shifting and valley filling. Therefore, the key to implement TOU price is to determine the peak period and the level of peak valley price reasonably.

Heat Demand Side Response
The heating system is composed of a heat source, a heat supply network and heating buildings, among which the heat supply network and heating buildings have great thermal inertia [32]; the hot water in the heat supply network is transmitted from the heat source to the user through the pipeline, and the transmission is delayed, so that the temperature change on the user side always lags behind the temperature change of the heat source in time. The change in indoor temperature in the building is not sensitive to the change of the heating quantity, so the heat load does not need to be as absolutely balanced as the electrical load. At the same time, when the room temperature is controlled within a certain range, the human body can feel comfortable. The fuzziness of the human body's temperature perception increases the elasticity of the heat supply at each time point, so the thermal load can participate in the optimal dispatch of the integrated energy system [33].

Energy Management Unit
The energy management system (EMS) is the core of users' DR, and is where the information interaction between the energy supply side and the demand side is carried out [34][35][36]. The DR structure of the user side is shown in Figure 3.
Energies 2020, 13, x 10 of 26 certain range, the human body can feel comfortable. The fuzziness of the human body's temperature perception increases the elasticity of the heat supply at each time point, so the thermal load can participate in the optimal dispatch of the integrated energy system [33].

Energy Management Unit
The energy management system (EMS) is the core of users' DR, and is where the information interaction between the energy supply side and the demand side is carried out [34][35][36]. The DR structure of the user side is shown in Figure 3. The user's response to heat is mainly achieved by adjusting the opening of the pipe valve on the radiator connected to the user, thereby changing the mass flow of hot water flowing through the user; the user's response to electricity is mainly achieved by regulating the air conditioner for electricityto-heat, by which means it reduces the output of the heat supply units (gas turbines, gas boilers) to meet the heat balance in the heat balance cycle. Through the user's electricity and heat demand response, it can promote wind energy consumption and reduce the output of heating units, thereby improving the economy of the electricity-heat integrated system.
The demand-side scheduling in this paper refers to the EMS controlling the user's electricity-toheat equipment and the radiator water valve according to the current electricity and the heat prices to meet the user's thermal comfort needs in the most economical way.

Objective Function
The cost on the user side includes the user's power purchase cost and the heat purchase cost. The electricity price is the time-of-use electricity price, which is determined by the system's power generation; the heat price is set as a fixed value in this paper.  The user's response to heat is mainly achieved by adjusting the opening of the pipe valve on the radiator connected to the user, thereby changing the mass flow of hot water flowing through the user; the user's response to electricity is mainly achieved by regulating the air conditioner for electricity-to-heat, by which means it reduces the output of the heat supply units (gas turbines, gas boilers) to meet the heat balance in the heat balance cycle. Through the user's electricity and heat demand response, it can promote wind energy consumption and reduce the output of heating units, thereby improving the economy of the electricity-heat integrated system.
The demand-side scheduling in this paper refers to the EMS controlling the user's electricity-to-heat equipment and the radiator water valve according to the current electricity and the heat prices to meet the user's thermal comfort needs in the most economical way.

Objective Function
The cost on the user side includes the user's power purchase cost and the heat purchase cost. The electricity price is the time-of-use electricity price, which is determined by the system's power generation; the heat price is set as a fixed value in this paper.
where f 2 represents the energy purchase cost function of users participating in DR; p t e and p h are the time-of-use electricity and the heat price, respectively.

Restrictions
The users' DR is aimed at users with air conditioners in their homes. Participating in DR users' electricity demand has become two parts, one is the pure electricity demand, which directly supplies power to users, and the other part of the electricity demand is the electricity-to-heat demand, which supplies heat to users through air conditioning. The user's heat demand source has also changed from the original pure radiator heating to the coordinated heating of the radiator and the air conditioner. The users' DR has changed the original system energy structure, so new electric and heat balance constraints have been added.

1.
User electricity demand where L e0, j represents the pure electricity demand of user j; L e0, j denotes the electricity demand of user j to convert electricity to heat.

User thermal demand
where η j is the electric conversion efficiency of the air conditioner for user j.

3.
User hot water pipeline flow restriction where m set j is the rated water flow of user j; R t j is the ratio of the relative water flow of user j; R and R are the upper and lower limits of the relative water flow ratio, respectively.

Demand Model Simplification Strategy
In Equations (2) and (3), the house inlet pipe temperature and outlet pipe temperature models consider the temperature transmission loss of hot water pipes. Since the hl s /c w m i value is very small, the house inlet pipe temperature T t in and the house outlet pipe temperature T t out can be simplified by the equivalent infinitesimal value.
We assume that all users are connected to the superior water supply pipeline, so the sum of the water flow through all users is equal to the superior water flow connected to all users. Simultaneously, the water flow of each user is adjusted by the hot water valve of each user on the basis of the rated water flow, that is, there is a certain adjustment margin, so we use the relative water flow ratio to express it. Therefore, through Equations (41) and (42), we get the relationship between the user water flow and the superior water flow as follows: It can be known from the Equation (1) that the water flow rate determines the user's heat demand, so it is defined that the user's rated water flow rate is proportional to the user's heat load.
where K j is the defined scale factor. According to the above assumptions, the equation constraint of the balance of the user heat supply and demand in Equation (40) can be simplified to:

Solving the Underlying Model
After the lower-level model is simplified by assumptions and nonlinear constraints, a model with Equation (38) And then: where λ e , λ h , λ eh , µ R,j and µ R,j are Lagrange variables, respectively.
We can get the following conclusions from Equation (50).
Finally, we get the optimal electricity and heat demand.

2.
Optimal heat demand In Equations (52) and (53), we have made the following assumptions: The efficiency of the consumer's electrical conversion equipment is η 1 ≥ η 2 ≥ . . . ≥ η N j . In addition, in order to express the relationship between time-of-use electricity price p t e and heat price χ 2 p h , a variable ξ eh,j = η j c w m set j (T s −T r ) ϕ t j is defined, which can also be simplified to ξ eh,j = η j T s −T r T in −T out .

Bilevel Optimized Operation Strategy
The optimized electricity-heat integrated system model established in this paper includes two objective functions: Optimal operating cost on the energy supply side and minimizing user cost. It is a two-tier dispatch model covering the supply and demand side.
The bilevel model introduces user DR, and takes the minimum cost on the user side as the optimization goal. By simplifying the heating network model and optimizing the KKT conditions, the most economical piecewise linear function of electricity and heat demand is made according to the relationship between time-of-use electricity prices and heat prices. Taking the optimal operating cost on the energy supply side as the upper-level optimization goal, and using the piecewise function as the constraint of the upper-level optimization model to solve the upper-level optimization problem, turning the bilevel optimization problem into a single-layer optimization problem. While ensuring the lowest energy purchase cost for users, it also ensures the energy supply economy of the energy supply side units.
The solution flow chart of the bilevel dispatch model of the electricity-heat integrated system established in this paper is shown in Figure 4. The solution is solved by the primal dual interior Point Energies 2020, 13, 5505 14 of 27 method [37][38][39]. This method is robust, insensitive to the initial value selection, and converges rapidly. When solving large-scale systems, the number of iterations varies little with greatly increased constraints.

Example System and Simulation Parameters
The electricity-heat integrated simulation system adopted is composed of the IEEE30 n er network and the 31 node heating network. As shown in Figure 5, the power network inclu uses, 41 transmission lines, 24 loads, 3 wind power units, 6 thermal power units, and 3 CHP un des 1, 11, and 31 of the heat supply network are coupled with grid nodes 27, 7, and 14 thro P. Considering the difference of electric and thermal time scales, the dispatching time interva power system is set as 15 min, and that of the thermal system is 1 h. As thermoelectric coup ipment, the dispatching time interval of CHP's power supply and heating is defined as 1 h.

Start
Input parameters (equipment operating parameters, prediction parameters, etc.) Given that the lower limit of fuzzy membership that satisfies the users comfort range Select the heat balance scheduling period Tc in turn as 6h, 5h, 4h, 3h, 2h, 1h The upper model takes formula (19) as the objective function to optimize the solution Satisfy the constraint conditions (15), (17)
Output the scheduling plan before the optimal output of each unit

Example System and Simulation Parameters
The electricity-heat integrated simulation system adopted is composed of the IEEE30 node power network and the 31 node heating network. As shown in Figure 5, the power network includes 30 buses, 41 transmission lines, 24 loads, 3 wind power units, 6 thermal power units, and 3 CHP units. Nodes 1, 11, and 31 of the heat supply network are coupled with grid nodes 27, 7, and 14 through CHP. Considering the difference of electric and thermal time scales, the dispatching time interval of the power system is set as 15 min, and that of the thermal system is 1 h. As thermoelectric coupling equipment, the dispatching time interval of CHP's power supply and heating is defined as 1 h. The total power load is shown in Figure 6. The user thermal demand curve based on the most comfortable temperature can be obtained through the temperature difference between the supply and the return water of the pipeline in different periods as well as in Equations (1)    The total power load is shown in Figure 6. The user thermal demand curve based on the most comfortable temperature can be obt gh the temperature difference between the supply and the return water of the pipeli rent periods as well as in Equations (1)- (3), as shown in Figure 7.  The user thermal demand curve based on the most comfortable temperature can be obtained through the temperature difference between the supply and the return water of the pipeline in different periods as well as in Equations (1)-(3), as shown in Figure 7. The user thermal demand curve based on the most comfortable temperature can be obt gh the temperature difference between the supply and the return water of the pipeli rent periods as well as in Equations (1)  When users relax their requirements on thermal comfort and take fuzzy membership fun e standard to measure the thermal comfort of users, the thermal demand of users can fluc in a certain range. We use the minimum thermal comfort standard of 3000 users to ge lope of the thermal demand of the electricity-heat integrated system based on the th ort of users, which is the total thermal load, as shown in Figure 8. Through the heat dem When users relax their requirements on thermal comfort and take fuzzy membership function as the standard to measure the thermal comfort of users, the thermal demand of users can fluctuate within a certain range. We use the minimum thermal comfort standard of 3000 users to get the envelope of the thermal demand of the electricity-heat integrated system based on the thermal comfort of users, which is the total thermal load, as shown in Figure 8. Through the heat demand envelope, we can adjust the thermal load in a specific period of time, and the thermal output of the unit only needs to fall within the envelope band, which can increase the flexibility of the system dispatch.
es 2020, 13, x 1 lope, we can adjust the thermal load in a specific period of time, and the thermal output only needs to fall within the envelope band, which can increase the flexibility of the sy tch. Heating network parameters are shown in Table 1 and unit parameters are shown in Tabl   Heating network parameters are shown in Table 1 and unit parameters are shown in Table 2. When the method in this paper is applied to a larger scale practical system, the number of nodes to be processed increases or the scale of the calculation example becomes larger and more complicated. Because of the increase in data to be processed, the simulation execution will definitely increase the amount of calculation compared with the small-scale calculation example. However, the applicability of the algorithm itself will not change due to the scale of the calculation example, and the objective function, constraint conditions, and simulation process proposed in this paper will not change. Since Equations (24)-(29) are applicable to n-node systems, only different initial data are needed due to the difference in the node admittance matrix and the topology constraints, for example, the grid line parameters, node admittance matrix and load distribution parameters of the standard model of n-node distribution network (as Figures 5 and 6 and reference [40] show), and the heat supply network pipe length, the heat transfer coefficient, the specific heat capacity of water, and the load distribution of the n-node thermal system (as Figure 8, Tables 1 and 2 show). Therefore, the method proposed in this paper can be extended to the n-node power system 6.2. Simulation Analysis without Considering DR

Comparison with Traditional Centralized Algorithms
Based on the typical days in the Liaoning Province of China without considering the output of the wind turbine, the optimization results are shown in Figures 9 and 10. Comparing the two scenarios, it can be seen that the results obtained by the traditional centralized algorithm [41] do not involve the reactive power output of the unit, and the optimization results obtained by considering the specific electrical network topology have a large deviation from the unit output results obtained by the traditional centralized algorithm. From the comparison of the optimization results, it can be seen that the optimization of the unit reactive power output has a great impact on the optimal dispatch results of the unit, which proves that the traditional centralized method does not consider the actual network topology and has an optimization deviation. In a word, the optimization model and the optimization strategy proposed in this paper are more practical. the specific electrical network topology have a large deviation from the unit output results obtained by the traditional centralized algorithm. From the comparison of the optimization results, it can be seen that the optimization of the unit reactive power output has a great impact on the optimal dispatch results of the unit, which proves that the traditional centralized method does not consider the actual network topology and has an optimization deviation. In a word, the optimization model and the optimization strategy proposed in this paper are more practical. the specific electrical network topology have a large deviation from the unit output results obtained by the traditional centralized algorithm. From the comparison of the optimization results, it can be seen that the optimization of the unit reactive power output has a great impact on the optimal dispatch results of the unit, which proves that the traditional centralized method does not consider the actual network topology and has an optimization deviation. In a word, the optimization model and the optimization strategy proposed in this paper are more practical.

The Influence of the Heat Demand Envelope on Unit Output
Taking 1 h as the dispatch time interval, we get the change in the heat output of the unit by considering the heat demand envelope, as shown in Figures 11 and 12. Comparing the two scenarios, it can be seen that when the heat demand envelope is not considered, the total power of the radiator and the total heat load must be balanced in real time, so the output of the CHP unit is obviously not flexible enough. When considering the envelope of heat demand, the heat output of the unit only needs to fall within the envelope, and the adjustment range of the CHP unit can be increased. In this paper, the user thermal demand envelope can optimize the output of the unit and increase the flexibility of system dispatch. Figure 11. Unit heat output without considering the heat demand envelope.

The Influence of the Heat Demand Envelope on Unit Output
Taking 1 h as the dispatch time interval, we get the change in the heat output of the unit by considering the heat demand envelope, as shown in Figures 11 and 12. Comparing the two scenarios, it can be seen that when the heat demand envelope is not considered, the total power of the radiator and the total heat load must be balanced in real time, so the output of the CHP unit is obviously not flexible enough. When considering the envelope of heat demand, the heat output of the unit only needs to fall within the envelope, and the adjustment range of the CHP unit can be increased. In this paper, the user thermal demand envelope can optimize the output of the unit and increase the flexibility of system dispatch. flexible enough. When considering the envelope of heat demand, the heat output of the unit only needs to fall within the envelope, and the adjustment range of the CHP unit can be increased. In this paper, the user thermal demand envelope can optimize the output of the unit and increase the flexibility of system dispatch.   Figure 13 shows that the value of μ changes when the heat balance cycle is 6 h, 5 h, 4 h, 3 h, 2 h, and 1 h. It can be seen from Figure 13 that as the thermal balance cycle continues to decrease, the amount of change in the fuzzy membership value based on the user's thermal comfort gets smaller and smaller until the requirement is met. Traditional units generally take a thermal balance cycle of 1 h, and through simulation analysis, we found that users' thermal comfort needs can be met when the thermal balance cycle is less than 3 h. Moreover, the larger the thermal balance cycle, the more Figure 11. Unit heat output without considering the heat demand envelope. flexible enough. When considering the envelope of heat demand, the heat output of the unit only needs to fall within the envelope, and the adjustment range of the CHP unit can be increased. In this paper, the user thermal demand envelope can optimize the output of the unit and increase the flexibility of system dispatch.   Figure 13 shows that the value of μ changes when the heat balance cycle is 6 h, 5 h, 4 h, 3 h, 2 h, and 1 h. It can be seen from Figure 13 that as the thermal balance cycle continues to decrease, the amount of change in the fuzzy membership value based on the user's thermal comfort gets smaller and smaller until the requirement is met. Traditional units generally take a thermal balance cycle of 1 h, and through simulation analysis, we found that users' thermal comfort needs can be met when the thermal balance cycle is less than 3 h. Moreover, the larger the thermal balance cycle, the more  Figure 13 shows that the value of µ changes when the heat balance cycle is 6 h, 5 h, 4 h, 3 h, 2 h, and 1 h. It can be seen from Figure 13 that as the thermal balance cycle continues to decrease, the amount of change in the fuzzy membership value based on the user's thermal comfort gets smaller and smaller until the requirement is met. Traditional units generally take a thermal balance cycle of 1 h, and through simulation analysis, we found that users' thermal comfort needs can be met when the thermal balance cycle is less than 3 h. Moreover, the larger the thermal balance cycle, the more flexible the unit's output and the more an optimal energy dispatch can be achieved. Therefore, we define the optimal thermal balance cycle value as 3 h.
Energies 2020, 13, x 19 of 26 flexible the unit's output and the more an optimal energy dispatch can be achieved. Therefore, we define the optimal thermal balance cycle value as 3 h. The electrical power balance is shown in Figure 14 and the thermal power balance is shown in Figure 15. The electrical power balance is shown in Figure 14 and the thermal power balance is shown in Figure 15.

The Influence of the Heat Balance Cycle on Unit Output
The electrical power balance is shown in Figure 14 and the thermal power balance is shown in Figure 15.  When c T = 1 h, in order to maintain the balance of power supply and demand, the electricityheat integrated system purchases electricity from the superior power grid during the peak electricity price period from 19:00-21:00. When c T = 3 h, within the thermal comfort range of the user, the thermal energy only needs to meet the supply and demand balance of the total heat in the heat balance cycle. Therefore, the electricity-heat integrated system increases the output of the CHP unit during peak electricity consumption during the dispatch cycle, thereby reducing the power purchase of the superior power grid during peak hours. The cost of electricity purchase is reduced, and the economy of the system operation is improved.

Considering DR Simulation Analysis
By considering the user's DR, we obtain the user's DR to the electricity price and changes in unit thermal output after user DR, as shown in Figures 16 and 17.  When T c = 1 h, in order to maintain the balance of power supply and demand, the electricity-heat integrated system purchases electricity from the superior power grid during the peak electricity price period from 19:00-21:00. When T c = 3 h, within the thermal comfort range of the user, the thermal energy only needs to meet the supply and demand balance of the total heat in the heat balance cycle. Therefore, the electricity-heat integrated system increases the output of the CHP unit during peak electricity consumption during the dispatch cycle, thereby reducing the power purchase of the superior power grid during peak hours. The cost of electricity purchase is reduced, and the economy of the system operation is improved.

Considering DR Simulation Analysis
By considering the user's DR, we obtain the user's DR to the electricity price and changes in unit thermal output after user DR, as shown in Figures 16 and 17. When c T = 1 h, in order to maintain the balance of power supply and demand, the electricityheat integrated system purchases electricity from the superior power grid during the peak electricity price period from 19:00-21:00. When c T = 3 h, within the thermal comfort range of the user, the thermal energy only needs to meet the supply and demand balance of the total heat in the heat balance cycle. Therefore, the electricity-heat integrated system increases the output of the CHP unit during peak electricity consumption during the dispatch cycle, thereby reducing the power purchase of the superior power grid during peak hours. The cost of electricity purchase is reduced, and the economy of the system operation is improved.

Considering DR Simulation Analysis
By considering the user's DR, we obtain the user's DR to the electricity price and changes in unit thermal output after user DR, as shown in Figures 16 and 17.  It can be seen from Figure 16 that users' DR mainly uses wind power through electricity-to-heat equipment for heating during low electricity prices. In normal electricity prices, due to the difference in the efficiency of users' electricity-to-heat equipment, selective electric heating is performed to It can be seen from Figure 16 that users' DR mainly uses wind power through electricity-to-heat equipment for heating during low electricity prices. In normal electricity prices, due to the difference in the efficiency of users' electricity-to-heat equipment, selective electric heating is performed to reduce the output of heating equipment. Figure 17 shows that the DR user's electricity-to-heat equipment does not take any action at the peak electricity price, because the peak electricity price is too high and it is not cost-effective for users to choose electricity-to-heat. The conclusion can be drawn that the user's DR reduces the total energy purchase cost through the price difference between electricity and heat.
6.3.1. The Influence of DR on the Heat Balance Cycle It can be seen from Figure 18 that user DR changes the optimal heat balance cycle of the electricity-heat integrated system from 3 h to 4 h, since the user's DR increases the diversity of heat production equipment through the output of electric-to-heat equipment. Heat production also provides space for the upper limit of the total heating output, and DR electricity can also be obtained through the unit's electrical output, which increases the output range of the unit and improves the overall flexibility of the unit.
does not take any action at the peak electricity price, because the peak electrici d it is not cost-effective for users to choose electricity-to-heat. The conclusion can er's DR reduces the total energy purchase cost through the price difference nd heat.
nfluence of DR on the Heat Balance Cycle be seen from Figure 18 that user DR changes the optimal heat balance cy heat integrated system from 3 h to 4 h, since the user's DR increases the divers equipment through the output of electric-to-heat equipment. Heat produ ace for the upper limit of the total heating output, and DR electricity can also b e unit's electrical output, which increases the output range of the unit and imp ibility of the unit. nfluence of DR on Unit Output ind power consumption and power purchase is shown in Figure 19 and the h hown in Figure 20. The main difference between the unit output after consideri Figure 18. The impact of DR on the thermal dispatch cycle.

The Influence of DR on Unit Output
The wind power consumption and power purchase is shown in Figure 19 and the heat power balance is shown in Figure 20. The main difference between the unit output after considering the DR when T c = 4 h and not considering the DR when T c = 3 h, is the increase of the optimal heat balance cycle T c , which will increase the flexibility of the unit output for the reason that the supply of heat energy only needs to meet the total heat balance during the heat balance cycle and satisfy the user's thermal comfort. We found that the electricity purchase phenomenon considering the DR when T c = 4 h mainly occurs at the normal electricity price at 17:00, as well as when the demand for electricity purchase is large. Meanwhile, regardless of the DR when T c = 3 h, there is a small amount of power purchase during peak hours which greatly reduces the economic efficiency of the production capacity of the electricity-heat integrated system due to the high price of electricity during peak hours. In addition, the increased DR users will use the valley hour electricity price to convert electricity to heat, increase wind power consumption, and effectively use the wind power surplus to reduce users' energy purchase costs while also increasing the economics of energy supply side capacity. purchase during peak hours which greatly reduces the economic efficiency of the production capacity of the electricity-heat integrated system due to the high price of electricity during peak hours. In addition, the increased DR users will use the valley hour electricity price to convert electricity to heat, increase wind power consumption, and effectively use the wind power surplus to reduce users' energy purchase costs while also increasing the economics of energy supply side capacity. The main difference between the unit output after considering the DR when c T = 1 h and regardless of the DR when c T = 1 h, is that the total output of wind turbines has been increased during the low price of the DR, for the users who participate in the DR will increase the electricity consumption during the low price period to convert electricity into heat to absorb excess wind power. In addition, due to the investment in electric-to-heat equipment, the heat output of gas boilers and gas turbine units on the energy supply side is reduced, thereby improving the production economy of the electricity-heat integrated system. Moreover, in the case of considering users' DR, the system will choose to purchase electricity from the superior power grid to convert electricity into heat according to the optimization results of the optimal electric-heating demand, so as to reduce the electric heating output of the gas turbine, improve the economy of users and increase the flexibility of the unit. It is obvious that, in the case of considering the DR of users, the system will perform selective electricity conversion at normal electricity prices based on the optimal electric-heating of the electricity-heat integrated system due to the high price of electricity during peak hours. In addition, the increased DR users will use the valley hour electricity price to convert electricity to heat, increase wind power consumption, and effectively use the wind power surplus to reduce users' energy purchase costs while also increasing the economics of energy supply side capacity. The main difference between the unit output after considering the DR when c T = 1 h and regardless of the DR when c T = 1 h, is that the total output of wind turbines has been increased during the low price of the DR, for the users who participate in the DR will increase the electricity consumption during the low price period to convert electricity into heat to absorb excess wind power. In addition, due to the investment in electric-to-heat equipment, the heat output of gas boilers and gas turbine units on the energy supply side is reduced, thereby improving the production economy of the electricity-heat integrated system. Moreover, in the case of considering users' DR, the system will choose to purchase electricity from the superior power grid to convert electricity into heat according to the optimization results of the optimal electric-heating demand, so as to reduce the electric heating output of the gas turbine, improve the economy of users and increase the flexibility of the unit. It is obvious that, in the case of considering the DR of users, the system will perform selective electricity conversion at normal electricity prices based on the optimal electric-heating The main difference between the unit output after considering the DR when T c = 1 h and regardless of the DR when T c = 1 h, is that the total output of wind turbines has been increased during the low price of the DR, for the users who participate in the DR will increase the electricity consumption during the low price period to convert electricity into heat to absorb excess wind power. In addition, due to the investment in electric-to-heat equipment, the heat output of gas boilers and gas turbine units on the energy supply side is reduced, thereby improving the production economy of the electricity-heat integrated system. Moreover, in the case of considering users' DR, the system will choose to purchase electricity from the superior power grid to convert electricity into heat according to the optimization results of the optimal electric-heating demand, so as to reduce the electric heating output of the gas turbine, improve the economy of users and increase the flexibility of the unit. It is obvious that, in the case of considering the DR of users, the system will perform selective electricity conversion at normal electricity prices based on the optimal electric-heating demand optimization result, which also improves the economic efficiency of user energy consumption.

The Influence of DR on Wind Power Consumption
In order to analyze the impact of the electricity-heat integrated system considering user DR on wind power consumption, we designed the upper limit of total wind power output of 0.5 MW and the upper limit of total wind power output of 1 MW for analysis, and compared the consumption of wind power that responds to user DR under different wind power penetration rates.
According to the wind power consumption results in Figure 21, under the situation that the upper limit of the total output of wind power is 0.5 MW, the complete consumption of wind energy can be achieved in consideration of user DR, while the phenomenon of wind abandonment occurs in the case of no DR. In the case of the upper limit of the total output of wind power being 1 MW, the situation of taking into account the user's DR will also cause wind abandonment during the low electricity consumption situation, but compared with the case without considering the user's DR, the consumption of wind power has been significantly improved.
can be achieved in consideration of user DR, while the phenomenon of wind abandonment occurs in the case of no DR. In the case of the upper limit of the total output of wind power being 1 MW, the situation of taking into account the user's DR will also cause wind abandonment during the low electricity consumption situation, but compared with the case without considering the user's DR, the consumption of wind power has been significantly improved. It is concluded that the corresponding system with demand can effectively absorb wind energy compared with the system without DR, which can effectively reduce the electricity output of the unit and the power supply cost. Furthermore, the effective use of green energy has contributed to sustainable development and energy cleaning.

The Influence of DR and Optimal Heat Balance Cycle on Economy
In order to analyze the impact of user DR on economy, we set up several comparison scenarios, and the obtained cost scenarios are shown in Table 3.  It is concluded that the corresponding system with demand can effectively absorb wind energy compared with the system without DR, which can effectively reduce the electricity output of the unit and the power supply cost. Furthermore, the effective use of green energy has contributed to sustainable development and energy cleaning.

The Influence of DR and Optimal Heat Balance Cycle on Economy
In order to analyze the impact of user DR on economy, we set up several comparison scenarios, and the obtained cost scenarios are shown in Table 3. It can be seen that, when P max e,w = 0.5 MW, considering that DR has no obvious impact on the total cost, the heat balance cycle is the main factor affecting the total cost. When P max e,w = 1 MW, the wind power consumption including DR increases significantly. The DR and the optimal heat balance cycle have an important effect on the cost. Regarding the impact of total cost, DR mainly uses surplus wind power to improve economy, as well as the optimal thermal balance cycle mainly using thermal inertia to reduce costs by increasing the flexibility of the unit and reducing peak power purchases under the premise of satisfying the user's thermal comfort.

Conclusions
In this paper, a bilevel model of time-scale economic dispatch of the electricity-heat integrated system is proposed, which includes the economic dispatch model of the upper level energy supply side and the minimum energy purchase cost model of the lower level user side. Finally, the bilevel optimization problem is transformed into a single-layer optimization problem by the KKT condition. The simulation result shows that the proposed economic dispatch model can make full use of the difference in dynamic characteristics between electric and heating networks, and effectively improve the economy of the energy supply. The DR model can effectively promote the wind power consumption, increase the heat balance cycle, improve the flexibility of the unit operation, and achieve significant economic benefits.
In the economic research of the electricity-heat integrated system, the fuzzy membership index based on users' thermal comfort is innovatively put forward to reflect the relationship between heating power and users' thermal comfort, and the concept of the user heat demand envelope band is proposed. The heating power can be within the envelope band, which makes the output of the thermal power unit more flexible. However, the disadvantage of this paper is that it simplifies the specific structure of the thermal network, only considering the total heat balance of the heat supply network in the heat balance cycle. Due to the transmission delay of the thermal system, the supply and demand can be staggered in the time scale and the heating network structure considering the transmission delay is an important direction for subsequent research.
In addition, the DR of this paper is different from other studies, taking into account the impact of the DR of electrothermal coordination on the economic cost of the entire system. Moreover, this paper only considers the DR of the residential user load, so that multiple load types (such as residential, industrial, commercial, office) can be considered to carry out collaborative DR according to their load differences in the further study.

Conflicts of Interest:
The authors declare no conflict of interest.