Strategic optimization operations in the integrated energy system through multitime scale comprehensive demand response

In the context of the dual carbon goal strategy, the proportion of new energy generation has increased annually, large‐scale renewable energy integration has been achieved, and the intermittent and uncertain operating characteristics pose an enormous challenge to the complete and stable operation of an integrated energy system (IES), promoting the complexity of IES optimization models. To increase the stability and accuracy of the system and improve the operation efficiency of the system, a Gaussian mixture model is used to fit the probability distribution of wind power and the prediction errors of the photovoltaic output. In addition, the expected maximization method is used to solve a model with hidden variables, the results show that the expectation maximization algorithm can improve the fitting accuracy, reduce the error caused by the subjective setting of the initial value, and make the fitting accuracy of the wind‐solar power prediction error greater. Then, to solve the problem in which the low resolution of the day‐ahead scheduling time leads to large errors, day‐ahead, day‐to‐day multitime scale operation optimization model takes into account the comprehensive demand response according to the differences in wind and solar output and load forecasting accuracy. Finally, simulation validation is conducted in multiple scenarios, and a comparative analysis is performed for single and multitime scale comprehensive demand response scenarios. The simulation results show that compared with the optimization results of no demand response day, the optimization results of this model reduce the total cost by 23.21%, carbon emissions by 13.98%, purchased electricity by 13.87%, and purchased gas by 19.31%, effectively improving the use of gas turbines in the system. The multitime scale scheduling strategy increases the overall operating cost of the IES, modifies the scheduling results, and agrees with real operating scenarios.


| INTRODUCTION
To date, with increasing global primary energy prices and the continuous deterioration of the environment, the gaps in technology and economy between clean, renewable wind and solar energy and traditional fossil fuels are constantly narrowing. 1The global energy crisis and environmental demand have prompted countries to initiate the transformation of energy and increase the proportion of renewable energy use. 2 To address the global shortage of fossil fuels and promote the development of renewable energy, a comprehensive energy system has emerged.Integrated energy system (IES) has the characteristics of versatility and heterogeneity, which can meet the energy coupling of different media.IES is an effective method for achieving low-carbon global energy consumption patterns and green energy systems. 3However, the uncertainty of its renewable energy output poses a serious challenge to the safety status and boundary construction of the entire energy system.The comprehensive energy system needs to predict multiple loads of electricity, gas, heat, and cooling on the demand side and to predict renewable energy generation, such as wind turbines and photovoltaics, on the supply side to address the differential impacts of prediction accuracy on the response and operational reliability characteristics of the IES.On this basis, in the field of IES research, the uncertainty and accuracy of IES operation need to be ensured through precise prediction and continuous updating of the realtime output of the system to ensure safe and stable operation of the system.
To improve the efficiency of integrated energy systems and enhance operational stability, many scholars have conducted research on the optimization and scheduling of integrated energy systems.In Liu et al.'s 4 study, to rapidly track the system fluctuations and accurately control the operating equipment, a bilevel and multitime scale dispatch and control strategy based on model predictive control (MPC) is proposed for a community integrated energy system (CIES) considering dynamic response performance.Zhuang et al. 5 applied the energy flow algorithm of electricity and natural gas coupling to operate a comprehensive power and gas system between regional cogeneration systems.Siqin et al. 6 proposed a distributed robust optimal dispatching model for the joint operation of multiple community-integrated energy systems.To ensure a successful alliance of multicommunity cooperative alliance, a profit allocation mechanism based on the improved Shapley value was proposed to reallocate the excess return fairly.Gou et al. 7 proposed a novel quantification method combining system operation simulation and dichotomy method to evaluate the real-time heat storage characteristic of DHS, where such indicators as heat shifting capability, and available storage/release capacity and depth are defined.Yang et al. 8 proposed a rolling optimization planning framework and model of an integrated energy system considering compressed air energy storage and sliding time window-based electric and heating integrated response demand, which can obtain both optimal resource configuration and energy management strategy.Yang et al. 9 proposed a distributed collaborative optimal dispatching strategy for the IES, based on edge computing and consistency algorithm.Yin et al. 10 proposed a relaxed deep generative adversarial network method for the real-time control framework to replace conventional combined methods with multiple time-scale combined frameworks.The proposed approach combines deep learning and relaxed operation with generative adversarial networks as the proposed method.Yuan et al. 11 studied a hierarchical energy system, including multiple regional integrated energy systems (RIESs) with multiple energy dispatch and supplement.To maximize social welfare, a bilevel programming model is developed, in which the upper level aims at maximizing the profits of the supplier, and the lower level aims at maximizing the RIESs' welfare.Zhao et al. 12 proposed a day-ahead robust optimal scheduling strategy of IES for electricity, cold energy, and heat energy supply, where the battery exchange service is incorporated by introducing the electric vehicle exchange station (EVES).Zheng et al. 13 developed a novel real-time dispatch method for IES with RL model training in stages based on the dueling double deep quality network (DQN).Pan et al. 14 constructed a twostage optimization model for planning configuration and operation scheduling with a comprehensive demand response.The above research is limited to the optimization scheduling of the present day, without in-depth research on the uncertainty of wind and solar power.However, the output prediction is not accurate enough, and there is a deviation from the actual output, resulting in the operation of the comprehensive energy system not being in line with the actual situation.In this paper, a more accurate prediction model is obtained by using the Gaussian mixture model, and a more effective optimal scheduling model is obtained by considering both price-based demand response and incentive-based demand response.
To further improve the processing results, some researchers have proposed and researched multiple time scales.Fang et al. 15 proposed a multistage and multitime scale energy management for hydrogen-based integrated energy system considering the electricity-heat-hydrogen supply-demand balance and demand uncertainties.The proposed solution consists of three stages, the day-ahead scheduling stage, MPC based intraday rolling dispatch stage, and intraday real-time adjustment stage to participate in the electricity and hydrogen market.Li et al. 16 proposed a multitime-space scale optimal operation strategy based on multidimensional energy supply and demand balance.Cheng et al. 17 proposed a multitime scale coordinated optimization method for energy hubs with multiple energy flows and types of energy storage systems.Liu et al. 18 combined the enhanced interval optimization method to propose a multitime scale optimization scheduling model for improving the grid connection of wind power during the heating season.Pan et al. 19 proposed an improved multitime scale coordinated control strategy for integrated energy systems with hybrid energy storage systems.Shen et al. 20 studied the multitime scale rolling optimization of integrated energy systems in hybrid energy storage systems.The above research is mainly focused on the complex energy flow, new energy usage, and hybrid energy storage, but it does not consider the corresponding optimization scheduling with the demand side.Yang et al. 21established a dayahead and day-ahead optimization scheduling model considering demand-side responses.Wang et al. 22 proposed a multitime scale park-level comprehensive energy system game optimization scheduling model that considers multiple demand response models.Ma et al. 23 proposed a multitime scale optimization scheduling strategy for regional comprehensive energy systems based on source load forecasting.Wu et al. 24 proposed a multitime scale framework for subsystem decomposition and corresponding economic MPC design.Yang et al. 25 established a multilevel rolling optimal scheduling model with multiple time scales.However, the above studies corrected the output of wind and solar power but ignored the intermittent uncertainty of large-scale wind and solar grid connection output, resulting in errors caused by factors, such as neglecting the uncertainty of wind and solar power and the imprecise output of various IES equipment under multiple time scales.Moreover, existing multitime scale studies have not considered the issue of comprehensive demand response, neglecting the relationship between distributed energy storage, distributed power generation, and load demand response, resulting in insufficient connection with the load side and system operation not being in line with reality.Based on the comprehensive demand response, this paper adopts a MPC method to realize rolling optimization.Considering distributed energy, distributed generation, and intermittency of wind power output, the day-day multitime scale optimization of the IES system is carried out.
The contributions of this study are as follows: First, the Gaussian mixture model is used to fit the prediction error of wind power and photovoltaic output, and the expectation maximization algorithm is used to solve the model; then the accuracy of the Gaussian mixture model solution is calculated for each fitting distribution to solve the problem of uncertainty in the wind and photovoltaic prediction output.Second, a multitime scale IES operation optimization model is constructed by taking into account the day before and day of to correct the true output of various IES equipment under the multiple time scales and to ensure the safe and stable operation of the system; then based on multiple time scales, a comprehensive demand response model that takes into account both price and incentive types is proposed.The complementary interactions and constraints between distributed energy storage, distributed power generation, and load demand response in multiple scenarios are analyzed, and the advantages and disadvantages of price and incentive demand responses are explored.Finally, for the optimization model of IES operation, the convex envelope linear reconstruction method in operations research is used for linearization decoupling to reduce the difficulty of model solving.

| Gaussian mixture model
The wind power output is constantly changing according to the changes in wind speed, with multiple peaks and valleys appearing on the same day, exhibiting a multipeak characteristic.The output of photovoltaic power generation is intermittent.A single error fitting model has a poor fitting effect and cannot accurately represent the power generation of wind and photovoltaic power.The Gaussian mixture model (GMM) is a linear combination of multiple sub-Gaussian distributions that can fit any probability density distribution.Fitting uncertain sets is the key to handling robust optimization problems.In this study, a Gaussian mixture model is introduced to describe and fit the probability distribution of prediction errors for uncertain factors in wind power and photovoltaic output.The GMM approximates the probability density functions of various distribution characteristics through multiple sub-Gaussian distributions, which can make the fitting of prediction errors for wind and photovoltaic output power increasingly accurate.The probability density function formula for Gaussian components is shown in Equations ( 1) and ( 2): 2 (1) where ( ) is the density function of the i Gaussian component.

| Expectation maximization (EM) algorithm
The EM algorithm is a type of maximum-likelihood estimation method used to estimate unknown parameters of probability models.The expected maximization solution step is divided into two steps, namely, the expected step and the maximum step, through which the estimated parameters can be solved.During the iteration process, the size of another parameter is continuously estimated based on this value.When neither parameter changes, the iteration stops.The specific and detailed steps of this algorithm are as follows: The existing parameter set is represented by For Equation (3), which requires its maximum value, the logarithm of the likelihood function is first calculated and then summed.The second step of the above equation indicates that when the sample takes x i , the sum hidden variable z j ( ) , j = 1, 2, …, k.The equation is obtained as the sum of multiple terms, which is relatively cumbersome to derive.Therefore, it is necessary to simplify and formally transform the equation.
For the convenience of derivation, the distribution function of x i over z is used as Q z ( ) i , which must meet the following conditions in Equation (4): Therefore, the above equation can be simplified as follows in Equation ( 5): Equation ( 5) is the core calculation formula of the expectation maximization algorithm.According to Jensen's inequality, if f is a convex function and X is a random variable, [ ( )] is true.The equal sign only holds when X takes a constant value.
According to the above equation, the following equation can be derived, which is the lower bound of the likelihood function, denoted as J z Q ( , ).This J z Q ( , ) is the expectation of the variable.The expected calculation formula is Next, the derivative of the likelihood function needs to be taken, and the lower bound depends on the two factors p x z θ ( , ; ) ( ) in the above equation.By changing the values of these two elements, the value of the lower bound can continuously increase, approaching L θ ln ( ).If J z Q L θ ( , ) = ln ( ) is reached, the iterations will end.Step E mainly solves for the expected value of the implicit variable.To hold the equal sign, p x z θ Q z ( , ; )/ ( ) ( ) needs to be a constant, assuming the following in Equation (7): ZHENG ET AL. | where c is a constant.
, the following formula is established in equation: In the above equation, the obtained result  p z x θ ( ; ) is called the posterior probability of the implicit variable z i .Therefore, the posterior probability of Q z ( ) is the expectation of the implicit variable; this parameter is the E step in the EM algorithm.
Step M is conducted to solve the maximum likelihood function, from which the following can be obtained: For Equation ( 9), the partial derivative of θ is taken to make it 0. The expected step is returned and solving is continued, iterating these two steps in sequence multiple times until convergence, where θ is the desired parameter.
Based on the above inference, the EM algorithm can be completed in the following two steps: Step E: Step M: The expectation maximization algorithm iteratively solves for hidden parameter variables, first obtaining the expected value of the hidden variable through the expectation step.Then, the results obtained from the expected step are first used to solve for the maximization step and then iterated in sequence.If the final two results are less than a certain threshold, the iteration is stopped; that is, the final parameter obtained is the value of the parameter to be estimated.

| Requirement response model
The rapid development of integrated energy systems has made demand response applicable not only to electrical loads but also to other types of energy loads.In an integrated energy system, there are multiple energy coupling devices in the electricity heat gas system, and the evolution of its comprehensive demand response has become particularly important.Through changes in energy prices, the load can be transferred within 24 h, and different types of energy loads can be replaced at the same time node.Rapid adjustment can flatten the peak and valley hours of the load in the system and improve flexibility.

| Price-based demand response
The time of use electricity price mechanism 26 is a common price-based demand response mechanism.The basic concept is to divide a day into multiple time periods and set different electricity price standards based on the needs of electricity users, including peak, flat, and valley prices.Users can actively adjust their energy consumption time and electricity consumption values based on changes in electricity prices, transferring peak loads to the valley hours of electricity prices.
The elasticity coefficient is an important parameter contributing to the impacts of electricity prices on user demand.The elasticity coefficient is defined as the relative change in electricity demand caused by relative changes in electricity prices.There are two main modes: single-period response and multiperiod response.A single-period response refers to users responding to the existing electricity price during this period, without adjusting the total load of the day, by increasing or decreasing the period's electricity consumption and adjusting the load situation to adapt to changes in electricity prices.The model is shown in Equation (12).
In this study, a mathematical model is constructed based on multitime period response behavior, and its formulas are shown in Equations ( 13) and ( 14), which represent the response for users to the current time period and other time periods, respectively.
where ε ii and ε ij , respectively, represent two kinds of electricity price elasticity coefficients: self-elasticity coefficient and cross-elasticity coefficient; q Δ and p Δ are the relative increments of electricity q and electricity price p, respectively.
For users in n time periods, an electricity price demand response matrix is established based on the electricity price, and the specific model is shown in below equation:

| Motivational demand response
Incentive demand response 22 refers to the signing of a contract between the executing agency and the user.
When the system energy supply reliability is insufficient and the load changes, the user needs to adjust the energy consumption load, and the user can receive compensation or pay breach penalties according to the contract.In the actual incentive demand response, subsidies are provided based on the amount of change in the user demand response.Most policymakers adopt a tiered pricing approach, where the lower the user response is, the lower the subsidy unit price, while the higher the user response is, the higher the subsidy unit price.The functional relationship between the translatable electrical load before and after the corresponding demand is shown in Equations ( 16) and ( 17): where E t FH and E t FHD are transferable electrical loads before and after the demand response, respectively; E Δ t

FH
is the change before and after the demand response.
The translatable electrical load achieves peak shaving and valley filling by transferring the high peak load to the low electricity price moment, as shown in Equations ( 18) and (19). ) where E t LoadD is the constant electrical load; E t LoadFHD is the electrical load after the shifting demand response; E t LoadFH is the electrical load before the demand response; P FH is the reduction of shifting load at peak times; ζ FH is the unit of transferable demand response price; C PY is the compensation cost of the translatable demand response.

| Multitime scale optimization scheduling strategy
In the multitime scale scheduling optimization of this study, the MPC method is used to achieve rolling optimization.MPC 27 is a control method based on mathematical models that predicts the behavior of the system in future time periods, optimizes decisions, and achieves control of the system.In the multitime scale optimization scheduling of the integrated energy system, MPC can be used for optimizing scheduling at two time scales, the day before and the day after, as shown in Figure 1.
In day-ahead dispatching, MPC carries out optimal dispatching with the goal of optimal economic cost by forecasting the demand for electric energy and heat energy in a period in the future, combining the generator sets, energy storage equipment, gas boilers, and other equipment in the integrated energy system, and making the energy supply and demand balance and economy of the energy system reach the optimal level in the future.At this stage, the start and stop statuses of the equipment are determined with a high priority.

| Daily optimization scheduling model
In the day-ahead optimal dispatching stage, according to the predicted electricity heat load curve and wind-solar output curve of the day, an economic and stable dayahead dispatching scheme is made for the integrated energy system in advance.The peak and valley power ZHENG ET AL.
| 2241 price difference and translatable load are used to achieve peak shaving and valley filling, and the highest priority equipment output operation status is determined.The time step used for the previous optimization scheduling is 1 h and the execution cycle is 24 h.At this stage, only the transferable load demand response is considered.
(1) Objective function The current optimization model mainly considers economic costs, including gas purchase and sales costs, electricity purchase and sales costs, carbon trading costs, CO 2 purchase costs, gas turbine startup and shutdown costs, and demand response costs.The objective function can be seen in Equation (22).
The cost of purchasing CO 2 is as follows: The demand response cost is shown in Equation ( 23): The start-up and shutdown costs of gas turbines are shown in Equation (24):  ( ) The optimization objective function is as follows in Equation ( 25): (2) Constraint condition The operation constraints of the equipment dispatched in the day ahead mainly include the operation constraints (26) of each piece of equipment and the power heat gas balance constraints ( 27), (28), and (29).Because the demand response of the transferable load is considered at this time, the power balance curve changes.(26)   where P t GT, indicates the output power of the gas turbine at time t; H t GT, is the output thermal power of the gas turbine at t; H t GB, is the output heat power of the gas boiler at t; H t HP, is the heat pump output power at t; P t P2G, is the input power of P2G; P t CCS, is the electrical power consumed by the carbon capture equipment; P GT,min and P GT,max are, respectively, the minimum and maximum power of gas turbine power generation; H GT,min and H GT,max are the minimum and maximum power of the gas turbine thermal output respectively; H GB,min and H GB,max are the minimum and maximum power of the heat output of the gas boiler respectively; H HP,min and H HP,max are the mini- mum and maximum power of the heat pump thermal output respectively; P P2G,min and P P2G,max are respec- tively, the minimum and maximum power of the power conversion equipment; P CCS,min and P CCS,max are the minimum and maximum power of the carbon capture equipment, respectively; η i down is the lower limit of climbing power of the i coupling unit of integrated energy system equipment; η i up is the upper limit of climbing power of coupling unit i of integrated energy system equipment; P i t , −1 is the power of the coupled equipment unit at time t − 1.
where P t PV, is the power of photovoltaic power generation; F t GT, is the amount of natural gas consumed by the gas turbine at time t; F t GB, is the amount of natural gas consumed by the gas boiler at time t; P t buy , P t sell are power purchased and sold, respectively; P t Loss, is the energy transmission loss of the electrical link network, which is generally 3% of the input power.Recently, priority has been given to scheduling equipment with high importance and poor flexibility, and the following equipment operation status and parameters have been determined: the start and stop status of gas turbines, the start and stop status of P2G equipment, and the response power curve of translatable electrical load demand.
(a) New constraints on electrical and thermal power balance At any time, the system needs to achieve a balance between supply and demand to meet the terminal load demand.
where P t LL, and H t LL, are, respectively, the load of electricity and heat after the demand response.

(b) Equipment constraints
The equipment constraints include the upper and lower limits of equipment output power constraints (26), gas turbine start stop constraints (32), electricity market constraints (33)-( 35), and natural gas market constraints (36).(c) Determine parameters

| Intraday optimization scheduling model
In the optimization dispatching stage within the day, the predicted values need to be predicted again, including the photovoltaic output state, fan output state, and electric heating load.The day-ahead dispatching creates a dispatching situation within 1 h according to the 24-h curve of the day-ahead prediction.However, the prediction results made 24 h in advance have relatively large deviations from the actual results.Therefore, the time step of 15 min and the implementation period of 2 h can be used in the day to obtain the source load prediction results with small errors.Based on the inputted source load situation, the scheduling plan of the energy system at this time scale is obtained.
(1) Objective function The intraday optimal dispatching is mainly found to further determine the operation status of other controllable equipment based on the equipment operation status and parameters determined by the day-ahead dispatching by adjusting the output of power generation equipment and the response of transferable load demand according to the day-ahead-day random source-side forecast deviation.Therefore, the same objective function is used for both intraday and intraday scheduling, but an increasingly accurate 96-point load prediction is used to align well with reality.The intraday optimization objective function is shown in Equation (39): (2) Constraint condition There are two main types of traditional intraday rolling optimization plans.The first type is that each intraday schedule is modified with a corresponding date and time for the present remaining time.The other type is to use the intraday rolling time window; that is, the current scheduling time can be scheduled and modified for the later inherent time, which is also called the window span.The use of intraday rolling time windows can improve the prediction accuracy of wind and solar power output, electricity, and heat load in the region with the shortening of prediction time.However, under the premise of significant improvement in calculation accuracy, the amount of data calculation increases, resulting in a decrease in solving speed.Therefore, the first rolling optimization method is adopted for calculation, which improves the utilization of data and solving speed.
The constraints of intraday scheduling are the same as those of day-ahead scheduling, mainly including energy balance constraints, equipment operation constraints, and day-ahead day coupling constraints.The equipment operation constraints are consistent with the day-ahead model, with t extending from 24 points in the daily scheduling interval of 1 h to 96 points in the scheduling interval of 15 min.
The balance constraints of electrical and thermal energy are shown in Equations ( 40) and (41), respectively.
The coupling constraints between the day ahead and the day ahead are shown in Equation (42): the operating parameters and status of the equipment determined recently, the start and stop operating status of the gas turbine, the operating start status of the P2G equipment, and the response amount to the demand for transferable electrical loads.
The equipment status solved by the day-ahead optimal scheduling at this time is brought into the day-ahead optimal scheduling.The day-ahead rolling scheduling link mainly consists of reading and extending the saved values of variables, comparing and analyzing the prediction curves of random source load, comparing and analyzing the multienergy flow optimization results, and saving the newfound variable values of the day ahead scheduling.The daily scheduling needs to extend from 24 points to 96 points in one dimension and save the output values for the last 15 min.
At this point, the equipment parameters that need to be coupled in the current optimization scheduling mainly include gas turbine power generation, heat generation power, gas boiler heat generation power, P2G, and CCS equipment coupling power consumption, as shown in Equation (43): The deviations in the day-ahead forecasts are within a reasonable range, indicating that the day-ahead scheduling plan is still valid.The equipment operation variable value determined by day-ahead scheduling can be used for day-ahead scheduling.The intraday random source load curve data with relatively low deviation rates are used for scheduling with the same economic goal as dayahead scheduling to effectively regulate the output power of controllable equipment, such as gas turbines.
(3) Determine parameters The daily scheduling mainly optimizes the scheduling of equipment with high importance levels and determines the following equipment operation variable values: gas turbine power generation and heat generation power, gas boiler heat generation power, carbon capture CO 2 amount, P2G equipment power consumption, and electricity and heat demand response that can reduce load.

| Linearization processing
After introducing the price-based demand response, the time of use electricity price of the IES changes, and the electricity interaction cost in the objective function includes two nonlinear variables The convex envelope constraint condition of X t ( ) is as follows in Equation (45): By introducing the above convex envelope constraint relaxation conditions, the original problem can be transformed into a mixed integer linear programming problem, and the optimal lower bound of the problem can be obtained through a commercial solver.

| Model solving
YALMIP is a built-in toolbox in MATLAB that supports calling solvers, such as CPLEX and GUROBI.YALMIP typically involves four steps: creating variables, setting constraints, introducing parameter settings, and solving with an objective function.GUROBI is an optimization software developed by GUROBI Optimization in the United States that can solve optimization problems in fields, such as finance, electricity, and transportation.This software can solve continuous and mixed integer linear problems without limiting the variables and constraints of the problem, provide multiple interfaces, support multiobjective optimization problem solving, and perfectly adapt to the model proposed in this study (Figure 2).
In this study, first, the problem is linearized to an MILP model, 28 then mixed integer linear programming theory and piecewise linearization are used to solve this model.The CPU model is Intel(R) Xeon(R) W-2245 CPU @ 3.90 GHz 3.91 GHz.A comprehensive energy system model is established in the MATLAB 2018 environment, called the YALMIP toolbox, and the solution is optimized using the GUROBI 11.0 (Win64) solver.The solution process of the comprehensive energy system optimization model proposed in this study is shown in Figure 3: first, the basic variables are defined, the electrical and thermal loads of the comprehensive energy system are input, and parameter information and price setting parameters of the coupling equipment are obtained.Then, a multitime scale optimization model for the system is established, taking into account various uncertainty factors, meeting the constraints of the system, and solving the objective function.The optimal equipment output, total economic cost, and carbon emissions of the system are obtained.By debugging the differences in various time scales for operational analysis, different scenario examples are obtained, and the optimization results are analyzed.

| Parameter setting
The IES model constructed in this study is shown in Figure 3: the energy supply part mainly consists of the power grid, wind power generation, photovoltaic, and natural gas networks.The energy conversion equipment mainly includes electric to gas (P2G), gas turbines (GTs), gas boilers (GBs), heat pumps (HPs), and energy storage equipment (ES).The load requirements of the user end mainly include electricity and heat loads.
The equipment parameters of the IES are shown in Pan et al., 29 among which the main energy equipment parameters are shown in Table 1.In this study, peak-tovalley electricity prices are used, and the specific values are shown in Table 2.The IES multitime scale optimization scheduling model established in this study is a mixed integer linear programming model at each stage, based on MATLAB + YALMIP modeling, and the commercial solver GUROBI is used to solve the proposed model.
This study selects the 24-h electrical and thermal loads of the Xiong'an high-speed railway area as the raw data for simulation calculation.The selected cold and thermal loads are shown in Figure 4, and based on these data, the following daily and intraday wind and photovoltaic output predictions are obtained.

| Wind and solar output prediction
The settings set in the calculation example are as follows: the price of natural gas is 2.7 yuan/m 3 , and the low heating value H ng of natural gas is 9.7 kWh/m 3 .We adopt the time-of-use electricity price as the model solution.The solution algorithm parameter settings are as follows.
The population size is 100, the population segmentation ratio is set to 1:1, and the maximum number of iterations is 1500.The data selected in this chapter are all historically measured wind and solar output data obtained from the Xiong'an high-speed railway station area from March 1, 2023, to June 30, 2023.To express accurately, the capacity of wind and photovoltaic power generation devices is normalized.In this study, a single probability distribution model is compared with a Gaussian mixture model using different sub-Gaussian components.Figure 5 shows the probability distribution fitting curves of wind power and photovoltaic power prediction errors for each distribution model during a certain period.The figure shows that single distribution probability models, such as the normal distribution and Cauchy distribution, have poor fitting performance when fitting data, while the fitting performance can be greatly improved when using Gaussian mixture models.
By using the three indicators of average absolute error E MAE , root mean square error E RMSE , and evaluation coefficient η COD , the fitting effects of each distribution model are compared.When the average absolute error and root mean square error are smaller and the evaluation coefficient is larger, the fitting effect of the model is better, and the accuracy is higher.The fitting accuracy comparison of each distribution model for wind power prediction error and photovoltaic power prediction error at that time is obtained, as shown in Tables 3 and 4.
From the accuracy comparison data in the above table, it can be intuitively observed that the fitting effect of the Gaussian mixture model is significantly better than that of other single distributions.This method has obvious advantages.Later, using the Xiong'an highspeed railway station area as the raw data for wind and solar energy, the output prediction curve obtained through the above method is shown in Figure 6, thereby ensuring that the optimization of IES operation is effective and in line with real scenarios.

| Analysis of recent optimization results
First, based on the historical operating data of a comprehensive energy system in a certain park, the training input variables include temperature, lighting, humidity, wind speed, holiday status, date, and equipment fault information.The training outputs are electrical and thermal loads.A neural network is used to train the nonlinear relationship between the input and output parameters.Subsequently, by substituting the meteorological data predicted by the meteorological bureau before the day, a random source load output curve is obtained.Figure 7 shows the electricity load curves before and after the demand response to the electricity incentive.During the electricity price peak period from 00:00 to 05:00, the electricity load increases, and during the electricity price peak period from 12:00 to 15:00, the load after the demand response decreases, achieving the effect of peak shaving and valley filling.
Figure 8 shows the start and stop status of the gas turbine.The start and stop status-2 and running-4 are displayed in the figure, indicating the start and stop status of the gas turbine.The gas turbine is in a shutdown state from 00:00 to 05:00, starts from 06:00 to 20:00, stops running once from 22:00 to 24:00 at night, and restarts the next day.
T A B L E 2 Time of use electricity price and gas price.

Parameter Value
Electricity price Peak time (11:00-14:00, 18:00-22:00) 1.2 yuan/(kWh) Valley time (22:00-24:00, 00:00-07:00) 0.4 yuan/(kWh) Ordinary time (07:00-11:00, 14:00-18:00) 0.4 yuan/(kWh) Natural gas price 2.7 yuan/m 3 Figures 9-11 show the balance of power, heat, and gas output in the daily dispatching.At 00:00-07:00, the electricity price is at a low point.At this time, the natural gas source is mainly from the P2G production and gas storage system.At this time, the main heating equipment is the gas boiler, and the gas turbine is not working.The system stores the surplus produced natural gas in the natural gas tank.At 08:00-22:00, the electricity price is at its peak and peak hours, with all gas sources coming from the main natural gas network for gas purchase.The gas supply is mainly for the gas turbine to generate heat.At this time, the electricity price is at its peak and peak hours, and the gas turbine is at full load output.At 22:00-00:00, the P2G equipment starts operating, utilizing the carbon dioxide generated inside the system to generate natural gas for gas turbines and boilers to generate heat and storing the excess natural gas for future use.
From Figure 10, between 0:00 and 05:00, when electricity prices are low, the main heating equipment is gas boilers and heat pumps.During this period, the heat pump plays a leading role, lasting until 07:00.At the same time, the natural gas generated by the P2G equipment is supplied to the gas boiler for use, which realizes the coupling of electric-heat-gas and improves the utilization of energy.During this period, the heat pump operates efficiently due to the low electricity prices, aligning with the characteristics of the off-peak electricity pricing period.Gas turbines become the main heating equipment between 06:00 and 22:00, which is also the peak user load period when gas turbines operate at near full power and play a vital role during periods of high electricity prices.In the 22:00-0:00 period, the electricity price is once again in a low period, at which time the heat pump becomes the main heating equipment again.Therefore, combined with the time-of-use price, you can see the use of different heating equipment under different electricity price periods, so as to realize the effective use of energy.
From Figure 11, it can be concluded that from 00:00 to 05:00, the main source of power supply comes from the purchase of electricity from the power grid and wind and solar power generation.At this time, P2G and CCS equipment work together, and the P2G equipment utilizes the CO 2 captured by CCS to generate natural gas for gas boiler heat generation.At this time, the electricity price is at a low period and the system purchases and stores excess electricity in batteries for the next use.From 06:00 to 22:00, the gas turbine starts operating and serves as the main power supply equipment.From 07:00 to 17:00, the photovoltaic equipment starts working, generating some electricity for the system to use.At this time, the electricity purchased from the power grid decreases.The battery starts discharging from  12:00 to 13:00 during the peak electricity price period, and charging starts from 03:00 to 05:00.The heat pump equipment starts during the low electricity price period at night, providing users with some thermal output, which reflects the peak shaving and valley filling effect of the battery.
Figure 12 shows that there is a strong correlation between the carbon balance and P2G with CCS equipment.Although the cost of CO 2 purchase is considered, the CO 2 generated by the system has already met the requirements for P2G methanation.From 00:00 to 05:00, the main source of CO 2 comes from the release of CO 2 storage devices and the capture of CO 2 from gas boilers by CCS.At this time, the gas turbine is not started.From 06:00 to 08:00, the gas turbine starts to operate and the CO 2 produced is used by P2G.The excess CO 2 is stored in the CO 2 storage device.From 09:00 to 10:00, 11:00 to 15:00, and 17:00 to 22:00, the electricity price is at its peak, and the P2G equipment is not working.From 22:00 to 24:00, the CO 2 captured mainly comes from the gas boiler, as the gas boiler and heat pump are the main heating equipment at this time.The coupling of P2G-CCS equipment enables the utilization of CO 2 generated by the system, thereby strengthening the electrical gas carbon coupling.
According to the economic analysis of the day-ahead model in different scenarios with and without demand response, Table 5 shows that the total cost of the scenario without considering demand response is the highest among the four scenarios, with a total cost of 30,523.91 yuan, and the carbon emissions are the maximum values of all scenarios, with a weight of 20,907.38 kg.When considering the demand responses of electricity prices, the load curve fluctuates with the real-time electricity price, indicating a significant reduction in total cost of 7.60% after considering the demand response.Carbon emissions have correspondingly decreased by 361.10 kg and fluctuations in electricity prices have led to F I G U R E 6 Forecast curves for wind turbine and photovoltaic output in the days ahead (left) and in the days ahead (right).
F I G U R E 7 Electric load curve before and after demand response.
F I G U R E 8 Gas turbine start and stop status.
significant changes in electricity purchases, resulting in a reduction of 665 kWh.When considering the incentive demand response, the total cost slightly decreases.When considering the comprehensive response, the total cost decreases by 2654.98 yuan and the carbon emissions decrease by 457.78 kg.The corresponding level of the electricity purchase decreases and the level of the gas purchase increases to meet the energy demand of the entire system.

| Analysis of intraday optimization results
The day-ahead optimal dispatching determines the equipment operation parameters with the highest importance and the poorest flexibility.First, the day-ahead optimal dispatching substitutes the results of the dayahead dispatching into the day-ahead dispatching and mainly focuses on determining the variable values of gas turbine power generation, gas boiler heat generation, carbon capture CO 2 , P2G power consumption, and reducible demand response to allow sufficient time to adjust the day-ahead dispatching scheme.Because the random source load predicted during the day is closer to the actual value, the random source load curve predicted during the day is in line with practical needs.At this point, a load reduction incentive demand response is used.Figure 13 shows the load changes after the daily forecast of electricity and heat load and demand response values.Compared with the previous forecast load, the peak load is smaller, and its electricity load is more obvious.
In intraday scheduling, the equipment under the balance of electricity heat gas power ratio remains unchanged.The purchase and sale electricity price, gas turbine start and stop status, and P2G equipment start and stop status of the previous optimization scheduling stage are used in the intraday scheduling, which can transfer the response quantity of electric heating demand.The state of other equipment, such as gas turbine output, changes with the fluctuation of the new random source load curve.The power of the equipment is relatively obvious.By adjusting the power of controllable equipment, the fluctuation of wind and solar output and load prediction can be reflected.
In the intraday scheduling stage, the prediction interval is 15 min; thus, the source load fluctuation is relatively small.The new equipment output plan determined at this stage has basically met the needs of a short time prediction.However, to suppress the small fluctuations generated from the intraday to real-time stage, the power determination of energy storage equipment is not considered at this stage, and the electricity gas carbon energy storage is determined at the real-time scheduling stage.Figure 14 shows the daily to intraday output chart of GT.The mechanical and electrical output of the gas turbine fluctuates from the daily to the intraday stage.To meet the daily load fluctuation, the output is reduced during the peak electricity consumption stage.Although the fluctuation is obvious during the intraday stage, the output trend is still basically consistent with the optimized scheduling before the day.
Figure 15 shows the day-to-daily output diagram of GB, and the fluctuation of the gas boiler output can be clearly observed.Gas boilers, as the main equipment for heating, show obvious changes in the picture.From 0:00 to 08:00 every day, the heating capacity of the gas boiler increases significantly and its output also increases.In the days before the gas boiler does not work, it still begins to play a role, which further enhances the maximum  utilization of gas boiler equipment.Through the analysis, we can better understand the operation of gas boilers in different time periods, which is helpful for rational energy planning and utilization.
Figure 16 shows a comparison chart of P2G equipment before and during the day.During the low electricity price period, the P2G equipment is operating at full power.From 08:00 to 10:00, the daily fluctuation of power is relatively gentle and the equipment operation is increasingly stable and reliable.Due to the correlation between the operation of P2G equipment and peak and valley electricity prices, this pattern is observed in daily scheduling.
The intraday scheduling results determine the coupling of the equipment mentioned above.By comparing the curves, it can be found that the output difference of the coupling equipment between the intraday and the pre-day is different.The day-ahead optimization is based on an hour time scale and cannot quickly reflect the latest renewable energy output and load forecasting situation.In the face of direct power fluctuations in the system, it is not possible to quickly adjust and respond to equipment output and meet user load requirements.By refining the time scale and incorporating different energy flow types and equipment types into the scheduling strategy of the entire system, multiple time scales can not only suppress system power fluctuations but also effectively adapt to changes the prediction accuracy of wind and solar power generation and electric heating loads.Moreover, a small time scale makes system operation scheduling increasingly accurate.
Figure 17 shows the electricity balance output optimized for scheduling at 96 points during the day.From 00:00 to 07:00, the electricity price is in a low period and the gas turbine is not working.At this time, the electricity supply mainly relies on the purchase of electricity from the grid and the output of renewable energy.When the electricity price is at the peak, the gas turbine output and P2G equipment start to work in the low electricity price period, which is consistent with the trend of the day-ahead dispatching stage, and the output at each time has fluctuations.
Figure 18 shows the heat balance output optimized for scheduling at 06:00 during the day.From 00:00 to 03:00, the heat pump is the main heating equipment, while from 03:00 to 05:00, the gas boiler provides heat to the user.At this time, the natural gas generated by the P2G equipment serves as the gas boiler, promoting the coupling of electricity, heat, and gas and improving energy utilization.From 06:00 to 22:00, the main heating equipment is the gas turbine, and the output of the gas turbine can be used to regulate the heat load and suppress system power fluctuations.At this time, the user load is at the peak of the day, and the gas turbine is carrying nearly full power, playing a crucial role in the peak electricity price period.
Figure 19 shows the natural gas balance chart at 96 points during the day.From 00:00 to 05:00, the P2G equipment starts operating, generating natural gas for gas boilers and selling excess natural gas.From 07:00 to 21:00, the main heating equipment is the gas turbine, and at this time, the natural gas supply mainly comes from purchasing gas from external networks and generating P2G equipment during low electricity prices.
Figure 20 shows the daily carbon dioxide balance at 96 points.The CO 2 generated by the system itself is sufficient for P2G use.During the low-electricity price period, the main sources of CO 2 are carbon dioxide storage devices and CO 2 captured by CCS from gas boilers.During the peak period of electricity prices, from 17:00 to 22:00, the captured CO 2 mainly comes from gas boilers.From the optimization results of the day, the coupling utilization of P2G-CCS equipment and carbon dioxide storage devices improves the system's electricity gas carbon coupling.

| Requirement response analysis
Figure 21 shows the power and heat load curves after the comprehensive demand response, and Table 6 shows the | 2253 multitime scale optimal dispatching table of the comprehensive demand response.Through the analysis of the day-ahead-day optimal dispatching under four scenarios, the total cost of the day-ahead dispatching is 177.79 yuan more than that of the day-ahead dispatching without considering the demand response scenario.Because the day-ahead dispatching plan takes into account the unit startup parameters, shutdown penalties, and other factors, it can only increase the power purchase.The cost of purchasing gas to meet the load requirements increases the operating cost.However, because dayahead dispatching does not consider the uncertainty of wind and solar output and load forecasting error on the system, the accuracy of the entire system model is relatively low and cannot reflect the actual operation of the unit.In contrast, the forecasting accuracy is increasingly accurate under multiple time scales and consistent with the actual status of system operation.
In summary, the introduction of price-based demand response results in a high output of low-energy consumption equipment during peak loads, resulting in a decrease in overall operating costs.After introducing incentive demand responses, facing the increase in load demand, end users can choose electricity or natural gas with high cost-effectiveness levels to meet the changes in load demand during a specific period, leveraging the complementary and coordinated role of various energy sources and reducing system operating costs.Therefore, the introduction of a comprehensive demand response can effectively reduce the overall operating costs of the comprehensive energy system and improve its lowcarbon performance.

| CONCLUSION
To address the uncertainty brought by renewable energy sources, such as wind power, photovoltaics, and various loads in the integrated energy system, adding entropy weight factors to the expectation maximization algorithm for solving Gaussian mixture models is proposed.Considering the large error of day-ahead scheduling, to effectively realize the economy of the system and the efficient use of energy, a day-ahead day-to-day IES hybrid time-scale operation optimization model considering the comprehensive demand response is constructed and the impacts of different demand responses on scheduling are analyzed through multiple scenarios.The conclusions obtained are as follows: (1) The Gaussian mixture model is used to fit the wind and solar prediction error and the hope maximization algorithm is introduced to solve the Gaussian mixture model.The results indicate that the expected maximization algorithm can improve the accuracy of fitting, reduce the error caused by the subjective setting of initial values, and increase the fitting accuracy of wind and solar power prediction error.
(2) In the previous stage, the scheduling determines the start and stop status of the gas turbine, the start and stop status of the P2G equipment, and the translatable electric load demand response power curve.The output status of each piece of equipment is analyzed through the electricity gas heat carbon balance diagram in the previous stage.(3) During the intraday scheduling phase, gas turbine power generation and heat generation, gas boiler heat generation, carbon capture CO 2 , P2G equipment power consumption, load reduction electricity, and heat demand response are determined.The equipment output status determined during the optimization scheduling phase is transmitted to the intraday phase, and the fluctuations of gas turbine, P2G equipment, and gas boiler daily output are compared and analyzed.(4) The optimization scheduling situations under different demand responses are analyzed through multiple scenarios, where the total cost and carbon emissions without considering demand responses are the maximum values among all scenarios.
When only considering the response to electricity demand, the purchase of electricity decreases by 480 kWh.In response to incentive demand, the electrical load is considered and the thermal load is stimulated, resulting in a change in the output of heating equipment and a reduction of 301.35 yuan in gas purchase costs.In the scenario considering the comprehensive demand response, the total cost in the day-ahead to day-to-day scheduling is

F
I G U R E 1 Day-ahead to day-to-day scheduling flowchart.

F I G U R E 2
Solution flowchart.

F I G U R E 3
Integrated energy system model architecture.T A B L E 1 Equipment parameter

F I G U R E 5
Probability density curve of prediction error for photovoltaic (left) and wind turbine (right) power generation.T A B L E 3 Comparison of fitting accuracy of various distribution models for wind power prediction errors.

F I G U R E 9
Electric output balance diagram.F I G U R E 10 Heat output balance diagram.

F
I G U R E 11 Natural gas balance diagram.F I G U R E 12 Carbon dioxide balance diagram.T A B L E 5 Day ahead scheduling results of comprehensive demand response.

F
I G U R E 13 Load before and after demand response.F I G U R E 14 GT day-ahead-daily output.F I G U R E 15 GB day-ahead-daily output.F I G U R E 16 P2G day-ahead-daily output.

F
I G U R E 17 Daily electricity balance.F I G U R E 18 Intraday heat balance.ZHENG ET AL.

F
I G U R E 19 Natural gas balance during the day.F I G U R E Intraday carbon dioxide balance.F I G U R E 21 Electrical load and thermal load after comprehensive demand response.

table .
) 23,438.26 yuan, which is the lowest value among all scenarios, and the carbon emissions are the lowest at 17,984.86 kg.The corresponding reduction in electricity consumption and increase in gas T A B L E 6 Hybrid time scale optimization scheduling table for comprehensive demand response.consumption effectively reduce the overall operating cost of the system and improve the low-carbon performance.Conceptualization; methodology; software; writing-original draft; writing-review and editing.Xiaowang Hou: Software; writing-original draft.Shouhan Xu: Software; writing-original draft.Tai Jin: Methodology; software.Wenjie Liu: Writing-review and editing.Na Li and Dongxu Guo: Methodology; software.Chongchao Pan: Writing-review and editing.