Optimal Economic Modelling of Hybrid Combined Cooling, Heating, andEnergyStorageSystemBasedonGravitationalSearch Algorithm-Random Forest Regression

Faculty of Automation, Huaiyin Institute of Technology, Huai’an 223003, China Department of Electrical Engineering, NAMAL Institute Mianwali, Mianwali 42250, Pakistan College of Mechatronics and Control Engineering, Shenzhen University, Shenzhen, China Faculty of Electronics Information Engineering, Huaiyin Institute of Technology, Huai’an 223003, China CTiF Global Capsule (CGC), Department of Business Development and Technology, Aarhus University, Herning Campus 7400, Denmark


Introduction
e government and legislative authorities incentives to use new energies, concerns about the high and rising price of fossil fuels including its scarcity, and environmental issues are the most important motivations for the integration of renewable energy resources into conventional power systems [1,2]. In these circumstances, new technologies such as the combined cooling, heating, and power (CCHP) technology can organically combine heating, cooling, and power supply to realize the cascade utilization of energy, help to improve the utilization rate of energy, and reduce the emission of pollutant gases [3,4]. In the context of promoting the rapid development of clean energy and the energy coupling with the microgrid (MG) the CCHP system and MG technology are combined [5,6]. Many researchers dealt with this concern but the considerable research gap still needs to fill with the impact of the energy coupling of the CCHP and the optimization problem of the MG [7]. e traditional heat-fixed electricity can no longer meet the scheduling requirements as the peak-valley load difference continues to increase. How to realize the coordinated optimization of the three kinds of energy of the CCHP system and improve the flexible adjustment capability of the system is considered as the key issue for the proliferation of these useful systems [8,9]. e CCHP system can make better advantages of the MG platform. e network mainly includes renewable energy units, energy conversion, and storage units [10]. Its object-oriented areas are smart buildings, isolated islands, and other areas. ese systems integrate multiple energy inputs and outputs, and the comprehensive energy utilization rate of the system can reach 80%, which is important for promoting the coordination and complementarity of advantages among multiple energy sources, improving the efficiency of energy use and reducing the emission of undesirable gases [11]. Authors in [12] took the energy supply of commercial buildings as an example, taking the three indicators of the operating cost, energy utilization rate, and C02 emission reduction of the CCHP system as the objective function modelling and detailed analysis of the system's sensitivity to changes in various indicators. Authors in [13], based on the characteristics of the CCHP system and mathematical model, accurately characterized the conversion relationship between the three types of energy in the network, such as cold, heat, and electricity, and optimized the operation of the CCHP system under different scheduling strategies. Authors in [14] established the optimal flow model of the energy flow of the MG parameter under the two typical operating modes of the CCHP system and reflected the coupling of the power and natural gas parameter through the energy supply rate index.
A component-based analysis for the CCHP system outlined by [15] includes energy generation units, heat recovery units, and thermal storage systems. Authors in [15] presented comprehensive comparisons of technology and proposed a general method of selecting the correct CCHP program for different applications. Authors in [16,17] included a detailed overview of the energy system and the requirements for selecting an appropriate system structure. In this study, authors in [18] have discussed the CCHP method with two or more renewable sources of electricity. Authors in [19] reviewed the progress of small-scale energy system production within trigeneration systems. e authors stressed the energy and environmental advantages of small-scale systems and pointed out that the main obstacle to market penetration is the high initial cost [20]. It is found that optimizing micro-and small-scale system operations is harder than large-scale systems due to technical, law, and policies restrictions. Authors [21] had identified the profits of polygeneration systems concerning zero energy constructions. In this study, authors [22] presented the CCHP system equipment evaluation, planning, operation, and component modelling. However, the CCHP system can cool and heat during power supply and these energy sources cannot be absorbed in the system at the same time, resulting in low energy utilization or waste [23]. erefore, to meet the constraints of the distributed microsource and energy storage unit operating characteristics, energy supply, and demand balance, the advantage of the proposed GSA-RFR model is its generalization ability. However, due to the different energy source characteristics of different systems, the input characteristics of the prediction model should be selected according to the actual condition of energy source so as to improve the accuracy of the model in specific period. So, this paper proposes the GSA-RFR approach in the CCHP operation scheduling model including heat pumps and energy storage units into the MG system. e detailed scheduling model for MGs with heat pumps and energy storage including wind turbines, photovoltaic cells, microgas turbines, ground source heat pumps, and energy storage units is presented. Considering the energy coupling characteristics in the grid and the operating characteristics of each distributed microsource and energy storage unit, the optimum output of each microsource and energy storage unit and the total cost of the system compared with optimized approaches, proposed GSA-RFR based approach, shows comparatively better performance.

Microgrid Energy System Description
In grid-connected insulated modes, the characteristics of MG are flexible operating and can improve grid efficiency and safety [24]. If the MG unit can acquire refrigeration power from the grid, the unit can maintain a stable system frequency if it monitors the voltage of the grid. However, the MG antennas are designed to be used on remote islands, where a primary concern is the control of this type of frequency [25]. e MG concept is proposed by the consortium for solutions in electric reliability systems (CERTS) [26].
e CERTS can be characterized as a decentralized entity consisting of multienergy resources and controllable electric and thermal charges. ese storage devices are connected to the upstream power generation grid using photovoltaic panels, wind farms, fuel cells, CCHP system, and microturbines (e.g., batteries or super-capacitor) [27]. e electrical grid can be seen as a regulated cell of the power system from an electrical utility perspective. As a part of the point of view of the customers, the MG can be designed carefully to meet the requirements for reliability as well as energy savings, improving efficiency, minimizing voltage sag, and powering a continuous current [28].
e MG with the energy storage system has become a promising component of future implementation of the smart grid [29]. Unlike grid power, however, the system's renewables do not supply a steady stream, matching supply needs as they change, and as a result, the MG system oscillators often do not lower loads or alter their frequency. erefore, to avoid sudden fluctuations in energy from renewable sources, storage systems are needed to help balance out low-power and high-power systems [30]. e MG structure and energy conversion process with heat 2 Complexity pump and energy storage in this paper are depicted in Figure 1. e wind turbines and photovoltaic cells belong to renewable energy units, which use natural energy to generate electricity, and natural gas consumption units including gas boilers, fuel cells, and microgas turbines are depicted in Figure 1. ey use natural gas combustion power to provide energy, and microgas turbines and bromine-cooled units have covert the CCHP system and can recycle high-temperature flue gas during power generation [31,32]. When the supply of cold (heat) power is insufficient, it can be used to make up the shortage while the gas boiler is used as auxiliary supply equipment for cold (heat) load [31,32]. e energy storage unit consists of three parts, battery, cold storage, and hot water storage tank. e voltage level of the MG system is 380 V, which is connected to the 10 kV medium-voltage distribution parameter through a common node.

e System Model Description.
e optimal scheduling model of the MG with heat pump and energy storage established is a mixed-integer nonlinear programming problem. e general solution expression of the model is as follows: where the optimized scheduling variable x represents the output of each microsource and energy storage unit, the power consumed by the ground source heat pump, the transmission power with the external power grid, and so on. e inequality constraints include the maximum power constraint of the power grid and the operating characteristics constraints of each microsource and energy storage unit. To maintain the safety of the operation process of the MG system, it is necessary to take into account the constraints of the system's energy balance, unit start-up and shut down, and so on in actual operation.
where F M is the total operating cost of the system, T is the optimization period, C F (t) is the unit fuel cost, C M (t) is the operation and maintenance cost, and C S (t) is the unit startup cost during the t period, respectively. e interactive cost of electric energy C E (t) and cooling (heating) C C (t) is presented.
e fuel cost is calculated as follows: where C NG and L NG represent the unit cost of natural gas and low calorific natural gas, Q GB (t) is the output thermal power efficiency of the gas-fired boiler, P FC is the fuel cell power, η FC is the fuel cell efficiency, respectively, while t is the output of the controllable unit at the time t. e operation and maintenance cost is calculated as follows: where K M,t is the unit maintenance cost for generating unit; K M,j is the number of controllable units; P CG,i (t) is the output of renewable energy unit t period; K ES is the unit maintenance cost of the energy storage device; and M indicates the controllable unit j in the start-stop state during time t. e unit start-up cost is calculated as follows: where V i (t) � 1 is the start-up state; otherwise, it is the shutdown state; C S,i is the controllable unit start-up cost. e electricity cost is calculated as follows: where P grid , sup (t) and P grid,dem (t) are the power supply and demand power of the power grid during the period t and K dem (t) is the electricity demand price. e refrigeration (heat) profit is calculated as follows: where K c and K h are the predicted costs of cooling and heat load during the period, respectively; Q co (t) is the unit cooling and Q he (t) is the heating source. e energy balance constraints are calculated as follows: where P BS (t) is the power of the storage battery, Q CS (t) is the cold storage, and Q HS (t) is hot water storage tank in the t period, while P load (t) is the predicted cost of the electric load in the t period. e grid power constraints are calculated as follows: where P sup, max is the maximum power supply and P dem, min is the demand power for the grid. e multiple energy sources coordinate the coupling and conversion to minimize the total operating cost of the system. e controllable unit constraints are calculated as follows: where T on i is the minimum start-up time and T off i is the minimum shutdown time of unit i and j, C ES is the capacity of the energy storage unit, P ch, max is the maximum input power, and P dis, max is the maximum output power of the energy storage. e energy storage unit constraints are calculated as follows: where λ max and λ min are the maximum and minimum state of the energy storage, respectively.

e GSA-RFR Algorithm.
e GSA algorithm needs to determine the fitness function to evaluate the advantages and disadvantages of the RFR model corresponding to each node. e crossover will produce a new particle as follows:  where r is a random number between 0 and 1; V i and V j are the velocities of particles X i and X j ; and X i new and V i new are the positions and velocities of the new particle, which will replace X i . For excellent particles, the strategy of dynamic updating inertia factor is adopted. In the early stage, w is selected to enhance the global searchability. e smaller w was selected in the later stage to achieve a more sophisticated search [33]. e update formula of the inertia factor is shown in the following equation: e mean square of residual was selected as follows: where σ 2 y is the variance of the predicted cost and R 2 RF is the mean square of residual error. e random forest can calculate the importance of each input feature [33], as shown in the following equation: where n k is the importance of node k; n j is the node with the feature I as the feature division; W k , W 1 , and W 2 are the proportion of the number of samples in node k and its subnodes to all the samples, respectively; and M k , M 1 , and M 2 are the mean square errors of node k and its subnodes. e procedure of the proposed algorithm is shown in Figure 2.

System Parameter.
In this paper, the MG system under grid connection is selected as a case study and is optimized. e network mainly includes wind turbine, photovoltaic cells, fuel cells, CCHP, and energy storage units. e specific model shows the advantages of clean energy, wind turbines, and photovoltaic cells which are given priority in their output, and the MPPT operation mode is adopted. Figure 3 shows the predictive curves of wind, photovoltaic output, cooling, heating, and electrical loads assuming that both the heating and cooling power in summer in the MG parameter are zero where the optimal scheduling period is T � 24 h and the unit time Δt � 1 h. e power generation cost of the unit is not included, only the operation and maintenance cost of the new energy unit is considered. For the different energy supply requirements in summer and winter in the MG parameter, two typical seasons were selected for analysis, and corresponding optimization scheduling strategies were formulated. e operating parameters of the microenergy parameter are shown in Table 1, the energy storage unit parameters are shown in Table 2, and the other parameters are shown in Table 3. Assuming that the microturbine, fuel cell, and ground source heat pump are in the shutdown state at the initial operation, the start-up costs of the unit are 1.94, 2.21, and 1.32 $, respectively.

Summer Season.
To validate the economic and energysaving effects of the proposed model, the operation optimization model without heat pump and cold storage unit was selected for comparison. On a certain summer day, the optimization results without ground source heat pump and energy storage unit are shown in Figure 4. In Figure 4, the net load cost is the predicted cost of the electrical load minus the wind turbine and photovoltaic output without ground source heat pump and cold storage unit.
e CCHP system must first supply the demand for cooling load, and the microgas turbine operates in the mode of "fixing electricity with cold." If the cooling load is insufficient, the gas boiler will make up the shortfall. In this mode of operation, the CCHP system needs to follow the changes in cooling power at all times. Due to the restriction of the energy coupling relationship, the adjustment capability of its electric power is greatly restricted, and it cannot be added to the optimized operation of the system autonomously. erefore, the cost of the system in this operating mode is relatively high. e optimization results of electricity and cooling power of the MG with heat pump and cold storage in summer are shown in Figure 5.
e results show that the cooling load in the MG is jointly met by the CCHP system, energy storage unit, and heat pump device. e power required by the heat pump and the electrical load in the grid is composed of wind turbines, photovoltaic cells, grid power, CCHP systems, fuel cells, and battery equipment connect during the period of 0-7 and 23-24, and the demand for electricity and cooling load of the MG is relatively low. At this time, the electricity supply price of the external power grid is the lowest, and the power generation costs of distributed microsources (microturbines and fuel cells) in the grid are higher than the electricity supply price of the power grid. erefore, the electrical load is first to supply from the grid to supply the user's electrical energy needs, and the shortage is supplemented by the fuel cell, the cold load is supplied by the ground source heat pump, and the CCHP system is in a shutdown state during this period. Since the heat pump cooling consumes less electric power, the supply of electrical load can fully meet the requirements during the periods of 7-10, 15-17, and 20-22, and the supply and sale price of external power grids were moderate. e generation cost of distributed microsources in the grid is higher than the power supply price and lower than the price of power demand. e insufficient part chooses to supply power from the grid microsources of the system which is preferentially called to meet the user's electrical energy demand. If the demand for the cooling load is small, the heat pump is driven by electric energy for cooling; if the demand for the cooling load is large, the CCHP system will start for cooling energy during the period of 10-15 and 18-21, and the price of supply electricity and    sold by the external power grid is the highest. e electricity demand price of the power grid is higher than the generation cost of distributed microsources, and each microsource is at rated power as much as possible and demands electricity to obtain economic profits. e CCHP system is selected to supply the cooling load demand, and the heat pump equipment is shut down during the entire optimized dispatch period. When the external electricity price is low, releases the electrical energy is released; when the external electricity price is high, the battery stores electrical energy. e charging and discharging state is determined by the grid electricity price. e cold storage unit can absorb the cold energy output by the ground source heat pump at night and release it when the cold load demand is high during the day. e energy storage unit can realize the peak-valley difference transfer of the load within the grid, thereby reducing the total operating cost of the MG.

Winter Season.
According to the heating needs of users in winter, the operating state of the heat recovery device in the MG parameter CCHP system is switched to operate in the combined heat and power mode, and the cycle state of the heat pump compressor is changed for heating. On typical winter days, the optimization results of MG power and thermal power without heat pump and heat storage are shown in Figure 6, and the optimization results with the heat pump and heat storage are shown in Figure 7. A brief analysis of the operation optimization results of the winter MG system is presented in Table 4 and Figure 7.

Optimum of Economic.
To test the advantages of introducing ground source heat pumps and energy storage units in the MG, the peak-cutting, valley-filling, and energy utilization indexes in the grid were analysed. e peakcutting and valley-filling index F n is evaluated by the minimum square sum of various load change rates during the dispatch period, and the energy utilization index F m is evaluated by the total energy input and output ratio presented in (10). e heat pumps and energy storage units into the MG system have significant advantages in terms of economics, peak and valley filling, and energy utilization. e main energy source of the MG is the external power grid and natural gas power generation. e time-phase electricity cost curve of electric energy is shown in Figure 8, the unit cost of natural gas is 2.52 $/m 3 , and the low heating cost is 9.68 kW h/m 3 . e electricity cost curve of the microgrid indicated and authenticated the proposed GSA-RFR optimization, while without optimization and GA, PSO approaches show comparatively higher values, which are not in favour of system operation (Figure 8). e cost of the MG parameter under the two scheduling methods in summer is shown in Table 5. It can be seen from the comparison of the operating costs of the MG in Table 5 that the introduction of heat pumps and cold storage units has good economic profits for the MG. e gas cost of the microsource during the optimization period is reduced by 24.9%, and the total operating cost of the system is reduced by 15.8%. e demand for cold load in summer is low, and the demand for heat load in winter is high. ere is a certain difference between the two. If the heat pump is used to supply electricity from the power grid for heating at night and the CCHP system is not started, the energy supply needs of users cannot be met. If the unit capacity of the ground source heat pump is further increased, there will be a situation where the equipment utilization rate is low and the initial investment cost is higher. e costs of the MG parameter under the two scheduling methods in winter are shown in Table 5. From the optimization results in Table 5, it can be seen that the gas cost of the microsource during the winter optimization period is reduced by 18.9%, and the total operating cost of the system is reduced by 17.6%. e peak-shaving, valley-filling, and energy utilization indicators of the MG are shown in Table 4. On the analysis of the data, the peak-shaving and valley-filling index is higher than that of GSA-RFR presented in Table 4. e energy storage unit can shift a load of electricity, cooling, and heat from the peak period to the valley period, thus effectively reducing the load on the network peak-valley difference. e heat pump CCHP cost is higher, which can output heat energy that consumes three times the electrical energy. Its efficiency is much higher than that of common energy equipment, so the energy utilization rate is higher. Due to the high energy efficiency coefficient of CCHP cooling in summer, the cost of obtaining the same energy is lower, so      10 Complexity the energy utilization rate in summer is slightly higher than that in winter.
To analyse the advantages of the different modes, a comparative analysis of the comprehensive cost of the MG under the two scheduling modes is carried out, as shown in Figure 9. It can be seen from depicted results that GSA-FRFR brings significant economic profit to the MG parameters compared with other modes and reduces the operation cost by 3.6%.

Conclusion
e perfection in the modelling of the energy storage system with economic optimization characteristics is the key features of next-generation energy technologies. Nonetheless, there are still issues to developing a physically attractive/ efficient and energy storage system that is cost-effective for electronic as well as hybrid vehicles. e model we are going to use to test this is a mixed-integer program. By given data, the integrated parameters, the output cost, and the total cost of the grid are obtained. e simulation verification shows that the integration of the heat pumps and energy storage units into the MG parameter can improve the coupling relationship of the three energy sources of the CCHP system. e MG sources including wind, photovoltaic, CCHP systems, fuel cells, and energy storage unit complementary and coordinated operation are also realized. According to the analysis of the peak-cutting, valley-filling, and energy utilization indexes, the heat pump can improve the energy utilization rate and reduce the natural gas consumption of the microgas turbine, and the energy storage unit has the function of realizing load peak cutting and valley filling. Energy efficiency's numerical costs validated the proposed GSA-RFR optimization, which is calculated as 93.2% and 93%, comparing 88.2% and 86.9% of heat pump and energy storage costs in the summer and winter season, respectively. Owing to the limitations of the RFR model, if the actual cost exceeds the range, the prediction result may produce a  is problem can be improved by expanding the range nodes. e proposed model provided a certain reference for the modelling planning and optimal scheduling of the MG parameter. is study is expected to be a significant contribution concerning the maturity of energy storage technologies for microgrid application, which is likely to dominate the electricity market need.

Abbreviations
C CH : Cooling (heating) profit of the system CCHP: Combined cooling, heating, and power C E : Interactive cost of electric energy CERTS: Consortium for solutions in electric reliability systems C ES : e capacity of the energy storage C F : Unit fuel cost C M : Operation and maintenance cost C NG , L NG : Unit cost of natural gas and low calorific natural gas C S : Unit start-up cost C S,i : Controllable unit start-up cost F M : Total operating cost of the system K c , K h : Predicted costs of cooling and heat load K dem : Electricity demand price K ES : Unit maintenance cost of the energy storage device K M,j : Number of controllable units M: Controllable unit MG: Microgrid P BS : Power of the storage battery P CGi : Output thermal power efficiency of the gasfired boiler P ch, max, P dis, max : Charging/discharging output power P dem, min : Demand power P grid : Active power P grid , pur , P grid,dem : Supply and demand power P load : Predicted cost of the electric load P pur, max : Maximum supply and demand of power PV: Photovoltaic Q co : Unit cooling Q CS : Cold storage Q GB : Low calorific cost of natural gas Q grid : Reactive power Q he : Heating source Q HS : Hot water storage tank t: Time T: Optimization period T off i : Shutdown time T on i : Start-up time λ max and λ min : Maximum and minimum state of the energy storage.

Data Availability
e data used to support this study are cited in the manuscript.

Conflicts of Interest
e authors declare that they have no conflicts of interest.

Authors' Contributions
M. S. N. was responsible for conceptualization, formal analysis, and methodology of the study and wrote the original draft. S. D. reviewed and edited the manuscript and developed software. W. A. S. validated the study and reviewed and edited the manuscript. M. A. performed formal analysis. A. Y. K was responsible for original draft preparation and investigation. A. N. A. was involved in conceptualization, investigation, formal analysis, and reviewing and editing of the manuscript. P .S. was involved in investigation and reviewing and editing of the manuscript.