Operational Optimization of Integrated Regional Energy Systems Considering Master–Slave Games and Electric Heating Equipment Testers: An Improved Coati Optimization Algorithm

are updated using the improved coati optimization algorithm (ICOA), and the lower-level optimization problem is modeled and solved by the solver. The results show that the proposed two-tier planning approach can considerably improve the revenue of the lower tier user side while ensuring the revenue of the upper tier microgrid operator. The revenue of the user aggregator increases by 23.1%, and the total system revenue increases by $29, which realizes a win–win situation for both the microgrid operator and the user aggregator and has long-term significance for improving the operational stability and economy of the regional integrated microgrid system.


Introduction
The overexploitation of fossil energy, the increasing deterioration of the natural environment, and the continuous innovation of Internet technology have made energy interconnection, low carbon emission, and high efficiency the main trends of current energy development. (1)The focus of current research is to realize the rational dispatch of different types of energy through coordinated management and distribution.Existing studies have concentrated on the coupling of multi-energy, demand-side response, and multi-time scale for dispatch analysis. (2)ith the increasing evolution of Integrated Energy Systems (IESs) and the reform of the electricity market, the power coupling interaction between the load and the source has become more pronounced, shifting from the traditional structure of vertical integration (top-down) to the competitive interaction structure.The traditional IES tariff does not receive other factors, and the interactive competitive IES tariff not only affects the load demand, but the load also reacts to the tariff.It is more appropriate to study the IES distributed optimization, such as game theory and the alternating direction multiplier method.Among them, game theory is a theory for studying how to make a reasonable decision in accordance with the ability and information available to each subject when there is a connection or conflict of interest among multiple decision subjects.The game models such as noncooperative game, bargaining game, evolutionary game, and master-slave game are gradually applied in the fields of optimal operation and energy management of energy systems.
With this background, we established a model based on the master-slave game and energy storage system for the integrated regional energy system (IRES) containing the microgrid operator and multiple users, and improved the flexibility of users' thermal energy demand by adding self-producing heat equipment on the user side under the framework of the strategy of heat and electricity price setting on the microgrid operator side.

Literature Review
Many scholars in China and abroad have proposed some methods to optimize the operation of integrated energy community microgrids.Li et al. (3) constructed a Stackelberg-based demand response scheme, in which the IES operator acts as the upper-level leader, pursuing the operator's maximum net profit by setting the price of energy, whereas the lower-level users act as followers that adjust their energy consumption schedules to minimize their total costs.Ouedraogo et al. (4) built an optimization system focused on low-cost software, considering the photovoltaic (PV) access case, through battery charging, and discharging is controlled by an energy management system (EMS) system to minimize system cost.Wang and Hu (5) proposed a two-stage management approach that takes into account the pre-trade actions of users and energy service providers (ESPs), constrains the tariff and load in the first period, and establishes an interactive game model of energy in the second period, which leads to the optimization of the electricity tariff and energy management system.Dong et al. (6) proposed a two-layer optimal dispatch system for IRES that considers the electric-thermal hybrid structure energy storage, which effectively enhances the revenue of energy storage system (ESS) operators while reducing the costs of the microgrid users and realizing the benefits of the multiple energy sources in the system.Pan et al. (7) proposed an improved strategy for IES based on the ESS to extend battery life through supercapacitors and reduce the running cost of replacing the ESS equipment.
Jiang et al. (8) proposed a two-tier model to resolve the joint planning-operation matter of the system, which can simultaneously ensure the benefits of the upper tier and reduce the operating costs of the lower tier, but their study lacks the equipment optimization for the lower tier operators.Li et al. (9) incorporated the response of loads such as electric and thermal energy into the optimal scheduling of IES, and an IES optimization model was developed to minimize the operating cost of the system, but the hierarchical optimization between upper-level decision makers and lower-level users was not considered in the study.A new low-carbon economic operation model was proposed (10) specifically to consider the demand-side dispatch of flexible loads in IES to better achieve rational load distribution and reduce system operation costs.Gao et al. (11) presented a method for configuring a HESS and proposed an active energy storage operation strategy to coordinate the demand of users in IES as well as the fluctuation of the RE sources.
Some groupes use a machine learning approach to optimize the operation of IES.Liu et al. (12) presented an improved moth-flame algorithm to resolve the optimal scheduling matter of energy sources in a pilot system.Zhang et al. (13) proposed a new grey wolf optimizer (GWO) optimization method that improves the limitations of traditional GWO to enhance the stability of hydroelectric plants by optimizing power delivery.In this study, a new solution algorithm [improved coati optimization algorithm (ICOA)] is proposed.On the basis of the coati optimization algorithm (COA), by adding Bernoulli chaotic mapping to the population initialization and dynamic inertia weight factors to the COA position update formula, the algorithm's seeking ability is further improved, and the rationality of the algorithm improvement strategy and the algorithmic performance of ICOA are verified by evaluating the metric values of the test functions and testing them in comparison with existing traditional algorithms.
In summary, there is a paucity of studies on the changes in the game outcome due to changes in the equipment on the user side during the game, and the configuration of the ESS in the IES improves the load regulation capability on the user side and reduces the user's power supply and demand to the microgrid.Therefore, the important results of this study are as follows.1.A new two-tier IRES optimization model is established to specify a reasonable regional microgrid system operation strategy by considering the microgrid side as the leader and the lower user side as the follower under the principle of the master-slave game.2. For the optimal electricity and heat tariff solution of the upper microgrid operator, we introduce the new optimization algorithm ICOA, which is optimized and improved by chaotic initialization and dynamic inertia weight coefficients, and the improved method is tested for comparison.3. The introduction of electric heating equipment is considered on the user side in IRES, while electric and thermal coupling is considered in both the upper and lower layers to better match the actual scenario, and the heat price setting strategy of the microgrid is changed to reduce the cost on the user side.
4. An optimization model that considers the various functions of ESS is structured on the basis of IRES.The model considers the existing device running restrictions and the RE uncertainty restrictions.
The rest of this study is organized as follows.In Sect.3, we describe the system architecture of the IRES and present the operation strategy of the regional system.In Sect.4, we present the proposed algorithm and compare and test it with other intelligent algorithms.In Sect.5, the results of two different cases are analyzed and discussed.In Sect.6, we present the conclusions and further research directions of this study.

System Modeling
Community-based IRES has the advantages of multi-energy complementarity and improved energy utilization efficiency.In this section, on the basis of the current research status of active distribution grid hierarchical energy management and community-based IRES, the distributed user groups inside the microgrid are equated to user aggregators, and the community-based IRES consists of the microgrid operator, the user aggregator, and the ESS.Temperature sensors inside a house can help monitor the temperature of the thermal energy storage system and better utilize the electric heating equipment, and energy sensors can provide detailed information on electrical energy usage, as shown in Fig. 1.
Meanwhile, we introduce the construction method of the hierarchical energy management model and the specific characteristics of the hierarchical energy management model, and lay the foundation for the specific case studies in the subsequent sections.

Microgrid operator system
The microgrid operator system serves as an intermediate link between the users and the grid and is able to trade energy with both parties; at the same time, the microgrid operator is partially equipped with a gas turbine to provide electrical and thermal energy directly to the users. (3)he loads of the user aggregator mainly consist of electrical and thermal loads.In this paper, it is considered that the users only purchase power from the microgrid manager and sell the power uniformly to the grid when energy is abundant, and the users can not only purchase power from the microgrid manager, but also keep the power imbalance by discharging through the ESS. (14)For the heat load, part of it is provided by the micro-gas turbine on the operator side of the microgrid, and the other part can be provided by the electric heating equipment on the user side.In this model, there is more flexibility in energy use.
In this study, the microgrid operator sets reasonable prices for purchasing and selling electricity, and the user side optimizes the allocation of electricity and heat loads in a day on the basis of heat and electricity prices.

Microgrid operator model
We divide the 24 h day into multiple time periods, and the microgrid operator uses the price of electricity sold and the price of heat sold as decision variables, with the corresponding constraints of where C ADN,b and C ADN,s are the purchasing price and selling price of the main grid, respectively, C MG,s is the selling price of the microgrid to the user aggregator, and , MG s h λ is the selling price of are the lower and upper limits of the microgrid heat price, respectively.
The microgrid operator side is equipped with a micro-gas turbine fueled with natural gas to provide heat and electricity to the user side.During the day, the relationship between the fuel cost and the unit output power can be represented as where P MT,e (t) is the electric power output by the micro-gas turbine at the t-th hour of a day, C ng is the unit price of natural gas, Q LH is the low calorific value of natural gas, and η MT is the power generation efficiency of the micro-combustion unit.
The relationship between the electric and thermal outputs of the micro-gas turbine at the t-th hour can be expressed as where P MT,h (t) is the thermal power output by the gas turbine at time t, MT l η is the heat loss rate, and η h is the heating coefficient.
Considering the balance of thermal energy, the thermal energy demand on the user side is equal to the thermal power generated by the microgrid, which is represented by In summary, the one-day revenue of the microgrid system can be expressed as where , l e MG C and , l h MG C represent the revenue generated by the microgrid operator from user-side electricity transactions and user-side heat supply in one day, respectively. ,

C
represents the electricity transactions between the microgrid system and the grid, and C MT represents the cost of gas for the microgrid operator in one day.

Energy storage system model
The ESS mainly provides electrical energy storage/supply for the user side, (15) and the amount of stored energy at the t-th moment of the day can be represented as ( ) ( ) ( ) ( ) ( ) ( ) where P c (t) and Pd(t) are the charging and discharging of the user aggregator in the community in the t-th time period, respectively.η c and ηd represent the transmission efficiency of the user in the charging and discharging processes, respectively and are both taken to be 0.95 in this study.
The state of charge (SOC) is an important argument for the remaining capacity of the ESS and is shown as where where ES min is the minimum value of the capacity and ES max is the maximum value in the ESS.

User aggregator model
User-side loads have some flexibility and schedulability, and the user side can be equipped with electric heating equipment to supply the user's thermal load. (16)The electrical load of the user aggregator at point t in a day can be represented as where L le (t) is the total electrical load of the user aggregator, L ls (t) and L lf (t) represent the flexible electrical load and rigid electrical load on the user side, respectively, and L t is the additional electrical load consumed by the electric heating equipment on the user side to produce thermal energy.
With the inclusion of an energy storage system on the user aggregator side, the user aggregator can store or take a certain amount of electrical energy at each time period.
Considering the electrical load demand response on the user side, the net electrical load of the user aggregator at time t of the day can be obtained and expressed as where L lpv (t) represents the predicted output of the PV installation of the user aggregator of the day, and L e lES (t) represents the electricity stored or withdrawn by the user aggregator to the ESS of the day, with positive/negative values for storage/retrieval.A positive/negative value of L lc (t) indicates that the user aggregator buys/sells electricity from the microgrid operator during that time period.For the heating side, the only source of thermal energy for the user in the traditional model is the microgrid operator.With the development of electric home appliances, most of the user-side thermal energy can be obtained using electric heating equipment, so it is assumed that the user side has the capability to convert electrical energy to all thermal demands.In this study, we placed temperature sensors in various key locations, including rooms and corridors.These sensors will measure the temperature in different areas.When the temperature is low, the user can produce heat using electric heating equipment when grid electricity prices are low, thereby reducing the heat price for the user.The thermal load of the user aggregator during a day with the corresponding constraint can be expressed as ( ) ( ) where L Ih (t) is the thermal power provided by the electric heating equipment on the user side of the user aggregator at time t, ( ) is the maximum value of the thermal load that can be abated with the actual abatement in t, μ h is the heating coefficient of the microgrid operator selected by the user aggregator as the heating provider at time t of the day, μ h is 0 when indicating the load of the user using the electric heating equipment, and 1 when indicating the thermal energy purchased entirely from the microgrid operator side on the user side.
In this study, electric heating equipment is added to the user aggregator side, and the corresponding constraints for the electric heating equipment at the t-th moment of the day are denoted as where L uh (t) is the user-side electric heating equipment output at t moments in a day, ΔL le (t) is the maximum heat output that the electric heating equipment can allow in the process of electric heating, and η l is the heat production efficiency of the electric heating equipment.represents the cost of purchasing thermal energy from the microgrid operator, and βΔL l,he (t) represents the penalty cost of reduced user comfort due to the electric heating load that the user can cut in one day. 1 Here, L af (t) represents the electric load of the user aggregator after adjustment at time t; x, y, and c are the parameters of the electricity consumption utility function of the user aggregator.

Model Solving Method
In this study, the interaction variables between the microgrid operator and the user aggregator are electricity price, heat price, and electricity and heat purchases.When the microgrid operator's price is too high or too low, the user aggregator will dynamically adjust its own electricity and heat purchases.The revenues of microgrid operators and aggregators are in conflict, so microgrid operators and aggregators can be regarded as a master-slave game model.The model can be expressed as where MG is the leader in this optimization model, L load is the follower, ΔL lh is the strategies of the user aggregator for thermal energy reduction, L l,ES is the strategies of the user aggregator for ESS, and E l is the gain of the user aggregator in one day.E MG represents the revenue of the microgrid operator in one day, calculated using Eq. ( 6).In this study, for the user aggregator, the objective function is to maximize the user gain within one day.For the microgrid operator, we solve for the optimal thermal and electric price for one day.The COA is a newly proposed intelligent optimization algorithm that has gradually started to be applied to the study of power system optimization.In this study, the ICOA is chosen as the solution method for the upper model, and the CPLEX solver is used in the lower layer to solve for the maximum revenue of the user aggregator. (17)

COA
The COA optimization method is meta-heuristic based on a raccoon population, where co is considered a member of the algorithm.The value of the decision variable is the position of co in space.Thus, in COA, the location of co describes a candidate solution to the solution matter. (18)t the start of a COA operation, the co's location in the space is initialized using ( ) where X a is the location of the a-th co, x a,b is the value of the b-th decision variable, m is the number of decision variables studied, and ub b and lb b are the upper and lower bounds of the b-th decision variable, respectively.In the COA method, the location of the best part of the co population is presumed to be that of the igu.It is also assumed that half of the co population climbs up the tree and the other half waits for the igu to fall to the ground.The co position from the tree is represented as ( ) After the igu hits the ground, it can be placed at any position in space.From these random positions, the co on the ground moves in space to better approach the igu.The update process of the igu drop location and the co movement can be represented by ( ) If the new location of each co enhances the value, the update process is accepted; otherwise, co remains at the original position, and the update condition applies for a = 1, 2, ..., N. The above equation can be expressed as where 1 L a X is the new location computed for the a-th co, 1 F is the value of the objective function corresponding to co, igu represents the igu's position in the space, which actually refers to the best positioned member of the space, igu b is its corresponding b-dimension, I randomly selects an integer in the set, igu G is the igu's randomly generated position on the ground, igu is its b-dimension, F iguG is the value of its objective function, and ⌊-⌋ is the bottom function.
To simulate the behavioral characteristics of co when avoiding predators, a random location was generated near the location of each co according to , , where 1, 2, , If the newly calculated location enhances the value, then the new location can be accepted and the above update condition can be expressed as

Chaos initialization
Chaotic sequences have the characteristics of ergodicity and unpredictability, so chaotic sequences can be used to replace the random array initialization of the population.To enhance the search space distribution of co and enhance the range of the global optimal solution search of co, the chaotic initialization is chosen to update the position of co.The chaotic initialization is shown as where r is the chaos parameter and μ m is the chaos value of the m-th time.

Dynamic inertia weighting factor
In the position update formula of the co population, co does not make full use of the original position, which has an impact on the diversity of co individuals.In this study, we balance the search process of the COA method in the early and late iterations by introducing the dynamic inertia weight factor, which is added to / max max Ter t Ter where θ represents the dynamic inertia weight factor and Ter max is the largest iteration of the COA method.

Algorithm performance testing
To verify the algorithm performance and improvement strategy of the study on ICOA, we used the six test functions to test the performance of ICOA.The performances of the particle swarm optimization algorithm, whale optimization algorithm, sinusoidal cosine algorithm, and Harris hawk algorithm are used for comparison with those of the COA and ICOA.Among the test functions, ICOA is optimal in terms of optimal value, variance, and mean.

Case Analysis
The case in this study is a community with five residential buildings, the electrical and thermal loads and PV output curves for which are shown in Fig. 2. It is assumed that each residential building is equipped with photovoltaic power generation and electric heating equipment for 24 h, and a micro-gas turbine is installed on the operator side of the community microgrid.The lower and upper limits of the thermal load are set to 0.02 and 0.08 kW/$, respectively. (19)The elastic load variation on the user side is about 15%, and the comfort factor on the user side is taken as 0.014 $/kW2.To prove the effectiveness of the model, different example models are represented in Table 1.The above two models are simulated in Matlab, and the optimal heat and electricity prices of the microgrid operator are found using ICOA.The optimal revenues of the microgrid operator and the user aggregator are found using the Cplex algorithm, and the results of the revenues of the two models are shown in Table 2.
In this study, Models 1 and 2 are analyzed.The optimized prices of electricity and heat sold by the microgrid operator in a day for Models 1 and 2 are shown in Figs. 3 and 4, respectively.Compared with Model 2, the heat load on the user side of Model 1 can only be supplied by the microgrid operator, and the price of heat supply is higher.Since electric heating equipment and flexible loads are involved in the regulation of thermal and electric loads on the user side in Model 2, the price of thermal loads from the microgrid operator is appropriately lowered, and the price change further promotes the game between the user side and the microgrid side.Figures 5 and 6 show the changes in the original electric load and the original thermal load on the user side under different modes, where Fig. 5 shows the electrical and thermal loads at the user side in Mode 1.In Fig. 6(a), the user side tends to increase the electricity consumption during 0:00-6:00, 22:00, and 24:00, decrease the electricity consumption during 8:00-22:00, and increase the electricity consumption most during 13:00, when the microgrid operator's tariff is the lowest, which is favorable for the user aggregator to obtain the most benefit.
Compared with the microgrid operator trading electricity and heat with users individually (Model 1), the overall revenue of the user-side aggregator is substantially improved owing to the flexibility of load shedding and the introduction of electric heat production equipment on the user side, and although the revenue of the microgrid operator is appropriately lowered, the userside aggregator's revenue is improved to a greater extent.The microgrid operator's heat price will be higher in Model 1 than in Model 2 because there is no electric heating equipment on the user side, and the operator raises the heat price to increase revenue.The introduction of the ESS also improves the electric load regulation capability on the user side, and when the electricity price is high, the user side can be recharged from the storage system, which reduces the electric energy dependence between the user and the microgrid operator, and the revenue of the user aggregator under Model 2 increase by $53.4 and the microgrid operator's gain decreased by $24.54 compared with Scenario 1.This is due to the fact that the user side is equipped with an independent electric heating device under Model 2, which improves the flexibility of the user side's heat demand, and the introduction of the master-slave game results in a higher gain for both parties.
Figures 5 and 6 show the electric and thermal load regulations under Models 1 and 2, respectively.In Model 2, when the heat load can be reduced, the user aggregator takes into account the reduction of heating costs and user comfort.Model 2 considers the case of time-ofuse electricity tariffs and appropriately increases the heat supply of the electric heating equipment on the user side when the electricity tariffs are lower to meet the user's heating  demand.Figure 7(a) shows the user aggregator heat load profile for Model 2. Figure 7(b) gives the variation curve of the consumer-side electricity quantity in a day.At the time of lower tariff, the energy storage system absorbs energy during 0:00-8:00, 12:00-16:00, and 23:00-24:00.In Model 2, the thermal energy captured by the user-side electric heating equipment varies by time of day, and the use of a lower heating cost scheme to increase revenue helps to reduce the operating costs on the user aggregator side.

Conclusions
In this study, we took community-based IRES as the background and proposed optimal decision-making schemes for electric heating equipment and the electric heating load demand response mechanism for the user side.The adopted two-tier game theory can maximize the interests of the lower-level user aggregators while maintaining the interests of the upper-level microgrid aggregators, achieving a win-win situation for both microgrid operators and user aggregators.The conclusions of this study are as follows.1.A master-slave game model considering a microgrid operator and a user aggregator is developed, with the upper level solving for the optimal electricity and heat sales prices for the microgrid operator and the lower level solving for the optimal revenue of the IRES.2. ICOA is proposed to solve the optimal price of the microgrid operator, and the proposed algorithm is verified to have better convergence and convergence speed by testing the function 3. The proposed model integrates the participation of user-side electric heating equipment and ESS with upper and lower electric couplings.The inclusion of sensors makes the considered scenarios more specific.In this study, we provided a reasonable analysis of the operation and dispatch optimization of the IRES, but there are still some shortcomings.First, the modeling of the IRES in this study is relatively simple.Second, the user satisfaction on the user side after considering the electric and thermal demand response is not analyzed.In the future, the scale of the system can be further expanded to an integrated cooling, heating, and power system, and the model can be analyzed in more detail.Also, internal transactions between multiple user aggregators are considered to achieve a better distributed management of the IRES.
electrical load of the aggregator at time t of the day, and ue l C is the energy utility benefit function on the user side.

XF
is the new location of the a-th co, 2 , L a b x is its b-dimension due to the update of the second stage co, 2 L a represents the value of the new location of co, t is the iteration counter, and loc b lb and loc b ub are the lower and upper bounds of the position of the b-th optimization variable, respectively.

Fig. 2 .
Fig. 2. (Color online) User aggregator side electric and thermal loads and PV output curve.

Fig. 7 .
Fig. 7. (Color online) Model 2: User aggregator electric heating equipment output curve (a) and electric load balance diagram of user aggregator in IRES (b).(a)(b)

Zhongtao
Li received his B.Eng. degree from Qingdao University of Science and Technology in Qingdao, Shandong, China.He is an M.S. student in electrical engineering at Hebei University of Technology.His research interests include hybrid smart grid optimization operation and renewable energy grid integration.(202131404123@stu.hebut.edu.cn)Lingling Li received her M.S. degree in control theory and control engineering in 2001 and her Ph.D. degree in electrical machinery and appliances in 2004 from Hebei University of Technology.She is currently a professor at the School of Electrical Engineering, Hebei University of Technology.Her research interests include power systems and new energy.(lilingling@hebut.edu.cn) is the power level of the battery t at this time in the ESS, and ES ccps is the starting rated capacity.The charge and discharge of the ESS at any moment T should meet

Table 1
Two different models in IRES.

Table 2
Optimized revenue values for the microgrid operator and user aggregator.