Real-Time Optimal Control Strategy for Multienergy Complementary Microgrid System Based on Double-Layer Nondominated Sorting Genetic Algorithm

Because of the problems of low operation efficiency and poor energy management of multienergy input and output system with complex load demand and energy supply, this paper uses the double-layer nondominated sorting genetic algorithm to optimize the multienergy complementary microgrid system in real-time, allocating reasonably the output of each energy supply end and reducing the energy consumption of the system on the premise of meeting the demand of cooling, thermal and power load, so as to improve the economy of the whole system. According to the system load demand and operation mode, the first layer of this double-layer operation strategy calculates the power required by each node of the microgrid system to reduce the system loss. &e second layer calculates the output of each equipment by using nondominated sorting genetic algorithmwith various energy values calculated in the first layer as constraint conditions, considering the operation characteristics of various equipment and aiming at economy and environmental protection. In this paper, a typical model of energy input-output is established.&is model combines with the operation control strategy suitable for multienergy complementary microgrid system, considers the operation mode and equipment characteristics of the system, and uses a double-layer nondominated sorting genetic algorithm to optimize the operation of each equipment in the multienergy complementary system in real time, so as to reduce the operation cost of the system.


Introduction
Multienergy complementary microgrid system is a multiinput and multi-output energy system, which generally covers integrated power supply, gas supply, heating supply, cold supply, and other energy systems as well as related communication and information infrastructure. e efficient economic and environmental protection operation of multienergy complementary system is the development direction of the energy industry in the future. For the energy efficiency to further be improved and the large-scale utilization of various new energy source's to be promoted, the deep integration and close interaction of multienergy sources, networks, and loads are the inevitable trend of future energy system development. erefore, the research on multienergy complementary collaborative optimization has prospective and huge engineering application value [1].
Due to the differences in the development of different energy systems, the energy supply is often planned, designed, and operated independently, and there is a lack of coordination among them, which results in low energy utilization rate, weak overall security, and self-healing ability of energy supply system. e multienergy complementary system is a nonlinear system with the characteristics of equipment diversity, complex operation characteristics, and variable load; therefore, the problem of collaborative optimization is more important. e energy consumption mode of multienergy complementary microgrid system mainly includes three types, cooling, heating, and electricity; since the energy consumption side of the multienergy complementary microgrid system is not controllable, only by regulating and controlling the energy supplied by the equipment at the energy supply side of the system, that is, the energy input end, can achieve the purpose of efficient and economic operation of the system. At present, some researches have been done on the optimal energy allocation of multienergy complementary microgrid system at home and abroad, such as Jose L et al. considered the cost of system life cycle and pollutant emission as the objective equation to optimize the system [2]. Abbe S et al. considered three objectives at the same time to optimize the system; the methodology combined life cycle cost, embodied energy, and loss of power supply probability [3]. Diaf et al. studied the optimal sizing of stand-alone hybrid PV/ wind system in Corsica Island based on technical-economic optimization [4]. Ding M. et al. established the scheduling model, which is based on three different operation strategies, to optimize operation scheduling through the environmental benefits of the two objectives [5]. Aghaei et al. developed a multiobjective self-scheduling optimization for CCHP (combined cooling, heating, and power system) based microgrid.
e optimization considered minimizing the operational cost and emission [6]. Nwuluand Xia proposed the optimal dispatch strategy for hybrid PV/wind diesel system incorporated with the demand response program [7]. Some of these studies focus on static optimization of multienergy complementary system with cost or environment as the goal; some real-time optimization strategies are only for microgrid but do not optimize the control strategy of multienergy complementary system with cooling, heating, and power.
In this paper, a real-time optimal control strategy of multienergy complementary microgrid system based on double-layer nondominated sorting genetic algorithm is proposed to optimize the multienergy complementary microgrid system in real-time and reasonable distribute the output of each energy supply end [8,9]. In this paper, a typical multienergy complementary microgrid system is studied. e structure of the multienergy complementary microgrid system is shown in Figure 1, which mainly includes wind turbine (WT), photovoltaic power generation (PV), internal combustion engine (GE), absorption chiller (AC), electric refrigerator (EC), electric boiler (EB), battery storage (BS), and cooling/heating storage (HS) equipment [10]. Firstly, the first layer of nondominated sorting genetic algorithm model is established to calculate the power demand of each node in the microgrid system to reduce the system loss by considering the operation mode and load demand of the system [11]. Secondly, the second layer uses the nondominated sorting genetic algorithm to calculate the output of each equipment through taking the calculation results of the first layer as the constraint, considering the operation characteristics of various equipment and taking the economy and environmental protection as the goal [12,13]. Finally, the control strategy studied in this paper is applied to the multienergy complementary microgrid system in a certain area. e results of the example show that the performance, economy, reliability, and environmental protection of the multienergy complementary microgrid system are greatly improved by the double-layer nondominated sorting genetic algorithm.

Operation Strategy
e load demand and external environment resources in different time periods are different, and the priority of cooling and heating demand is also different. erefore, the real-time operation control strategy of multienergy complementary microgrid system can improve the economy of the whole system.
Based on the characteristics of multienergy complementary microgrid system, this paper proposes two different operation strategies: power load priority and cooling and heating load priority, so as to optimize the operation mode of each equipment in the microgrid system.

Power Load Priority.
In order to reduce the pollutant emission of the system, this strategy is that clean energy power generation is given priority, which gives priority to meet the power load demand of users. e operation principle is as follows: (i) When the power load is lower than the total power generation of clean energy, clean energy such as wind power and solar energy is used to generate electricity; the surplus electricity is used to charge the electric energy storage, and the cooling and heating load demand is met by electric refrigeration. (ii) When the power load is higher than the renewable energy generation capacity, the wind turbine and photovoltaic power supply directly to the power load, and the excess load is supplemented by electric energy storage discharge. At this time, the cooling load is met by electric refrigeration. (iii) If the electric energy storage is at the minimum level or the discharge is not enough to supplement the electric load, the internal combustion engine is started to the rated power to generate electricity. e excess power is used to charge the electric energy storage. At this time, the cooling load is met by LiBr unit. If the cooling load's output power of lithium  2 Complexity bromide unit is insufficient, the additional cooling load can be supplemented by electric refrigeration. If the electric energy storage has reached the maximum state of charge, the internal combustion engine will start power tracking. (iv) When the power load is higher than the renewable energy and internal combustion engine, the wind turbine of photovoltaic internal combustion engine directly supplies the power load, and the excess load is supplemented by electric energy storage discharge. e cooling load is met by LiBr unit. If the cooling load's output power of lithium bromide unit is insufficient, the additional cooling load can be supplemented by electric refrigeration.

Cooling and Heating Load Priority.
is strategy gives priority to meet the user's cooling load demand and gives priority to the use of internal combustion engine for CCHP. e operation strategy is as follows: (i) If the cooling load demand is less than the rated power of the absorption chiller and the renewable power generation resources are less, the internal combustion engine power will track the load for power generation, and the cooling load will be provided by the absorption refrigeration unit. (ii) If the cooling load demand is less than the rated power of the absorption refrigeration unit and the renewable power generation resources are larger, the cooling load is provided by the absorption refrigeration unit and the electric refrigeration. (iii) If the cooling load demand is larger than the rated power of absorption refrigeration unit, the internal combustion engine runs at full power, and the insufficient cooling load is provided by electric refrigeration. If the power generated by the internal combustion engine is larger than the electric load, the excess power will charge the electric energy storage.
Under this operation strategy, the charge and the discharge of energy storage are the same as those in scheme i.

Mathematical Description of Multiobjective Optimization
Algorithm. Taking the minimization multiobjective problem with constraints as an example, the multiobjective optimization problem can be described as follows: where f(X) denotes a vector space with n objective functions, g i (X) denotes the i th inequality constrained function, h j (X) denotes the j th equality constraint, and . , x m ) denotes a vector space with m decision variables [14].

Decision-Making in Multiobjective Optimization.
It is a series of discrete solutions obtained by multiobjective nondominated sorting genetic algorithm. How to choose an optimal scheme among these discrete points is the key to multiobjective optimization. In this paper, a method of selecting the optimal scheme based on geometric distance method is proposed, the central idea is that the geometric distance between the optimal scheme and the positive ideal scheme is the shortest, while the geometric distance between the optimal scheme and the reverse ideal scheme is the longest. e optimal scheme comes from the optimized Pareto frontier, positive ideal solution refers to the scheme that can optimal satisfy every objective function at the same time, and negative ideal solution refers to the scheme that does not optimal satisfy any objective function. e calculation of spatial/geometric distance (d + i ) of any scheme i from Pareto frontier to positive ideal solution is as follows: where m denotes the number of objective functions, j denotes the dimension, and S ij − S p−ideal j denotes the straight line distance from scheme i to the j dimension of positive ideal solution。 e calculation of spatial/geometric distance (d + i ) of any scheme i from Pareto frontier to negative ideal solution is as follows: where m S ij − S n−ideal j denotes the straight distance from scheme i to the j dimension of negative ideal solution. e coefficients ω i defined below are as follows: rough the formulae (2)-(4), any scheme of ω i from Pareto frontier can be calculated, then the scheme in which minimum ω i is corresponded is the final optimal solution.

Mathematic Model for Multienergy System
e multienergy complementary distributed energy system is the expansion of traditional distributed energy application and is the physical concept of integration [15]. It integrates multiple energy technologies to realize the collaborative optimization of multienergy sources. e multienergy complementary distributed energy system has a variety of energy resources input, but it is not a simple superposition of multiple energy sources. It uses the energy of different grades in a systematic way comprehensively and complementarily uses the energy of the system and makes overall arrangements for the coordination and conversion of various energies, so as Complexity 3 to achieve the most reasonable effect and benefit of energy utilization. e structure of the multienergy complementary system generally includes wind power, photovoltaic, internal combustion engine, absorption chiller, waste heat boiler, battery storage, heating storage, and ice storage.

Wind Power.
is paper mainly considers variable speed constant frequency wind power generation, whose output power expression is closely related to the operation mode of wind turbine [16]. According to the working principle of the wind turbine, when the wind speed is less than the cut-in wind speed, the wind turbine does not generate electricity, when the wind speed is larger than the cut-in wind speed and less than the rated wind speed, the wind turbine generates electricity,\ and the output power changes with the wind speed, when the wind speed is larger than the rated wind speed and less than the cut-out wind speed, the wind turbine outputs the rated power, and when the wind speed is larger than the cut-out wind speed, the wind turbine stops working and does not generate electricity. e output of wind turbine at time t P wt (t) is as follows: , V ci denotes the cut-in wind velocity, V co is the cut-out wind velocity, V r denotes the rated wind speed, and P r denotes the rated power.

Photovoltaic.
e output power of silicon solar cell module is related to many factors, including temperature and solar radiation intensity on the photovoltaic panel [17]. e photovoltaic power expressions in this paper that is expressed by the optimal operating point voltage and the optimal operating point current are as follows: where I pv denotes the optimum operating current, V pv denotes the optimum operating voltage, I sc denotes the short circuit current, I mp denotes the maximum power point current, V mp denotes the maximum power point voltage, V OC denotes the open circuit voltage, α denotes the temperature coefficient for current, β denotes the temperature coefficient for voltage, G t denotes the tilted solar irradiation on PV panel, G ref � 1000 W/m 2 is the reference solar irradiation, T a denotes the ambient temperature that changes over time, T ref � 25°C is the reference battery temperature, and ΔI, ΔV, and ΔT are the modified current, modified voltage, and modified temperature, respectively.

Internal Combustion
Engine. e internal combustion engine consumes natural gas for power generation, and the waste heat generated can be used for refrigeration of absorption refrigeration units. e internal combustion engine can supply power load and meet the user's demand for cooling and heating load at the same time.
e heating power output of the internal combustion engine at time tQ GE.heat (t) is as follows: where P GE (t) denotes the real-time rate of work of the internal combustion engine and η GE (t) denotes the real-time efficiency of internal combustion engines. e efficiency of internal combustion engine is related to its real-time load [18]. e fuel consumption of internal combustion engine at time t is as follows: where η gas denotes the natural gas utilization rate of internal combustion engine and LHV � 36.82 MJ/m 3 N denotes the low calorific value of natural gas.

Absorption Chiller.
Absorption chiller unit is a kind of refrigerator driven by heat energy. Its heat energy is the use of exhaust heat of internal combustion engine. en, the cooling capacity at time t (Q AC.cool (t)) is expressed as follows: where Q AC.heat (t) denotes the heating power absorbed by absorption chiller and COP AC denotes the energy efficiency coefficient of absorption chiller unit and is related to the load rate of absorption chiller unit.

Electric Refrigerating Machine.
Electric refrigerator is a kind of refrigerator driven by electric energy. Since the refrigerating capacity of absorption refrigeration unit is limited by the residual heat of internal combustion engine, while the electric refrigeration unit is not constrained, it can effectively supplement the cooling capacity required by users 4 Complexity in time; the expression of cooling capacity at t time (Q EC(t) ) is as follows: where P EC (t) denotes the real-time power consumption of electric refrigeration and COP EC denotes the energy efficiency coefficient of electric refrigeration and also related to the unit load rate.

Electric Boiler.
Electric boiler is a kind of boiler equipment which takes electric power as energy and converts it into heat energy, then outputs the steam, high temperature water, or organic heat carrier with certain thermal energy. e expression of thermal output at time t is as follows: where P EB (t) denotes the real-time power consumption of electric thermal and COP EB denotes the energy efficiency coefficient of electric heat and also related to the unit load rate.

Electric Energy Storage.
e output power of battery is closely related to the operation state of the system, and there are many kinds of batteries. is paper assumes that the state of lead-acid battery at time t is related to that at time t − Δt [19]. In this paper, the energy storage capacity of the battery is considered, and the real-time capacity (C BS (t)) is shown as follows: where P BS.cha and P BS.discha are the charging and discharging powers of equipment, respectively, η cha and η discha are the charging and discharging efficiencies of equipment, respectively, and σ denotes the self-discharge rate of battery per hour.

ermal Energy Storage.
In the same way as electric energy storage equipment, the real-time capacity of thermal energy storage equipment (C HS (t)) is as follows: where Q HS.cha andQ HS.discha are the endothermic power and exothermic power of equipment, respectively, δ cha andδ discha are the thermal absorption efficiency and thermal release efficiency of thermal storage equipment, respectively, and τ denotes the self-loss rate of thermal storage equipment.

Double-Layer Multiobjective Optimization Algorithm
According to the system load demand and operation mode, the first layer of this two-layer operation strategy calculates the power required by each node of the microgrid system to reduce the system loss and the second layer calculates the output of each equipment by using nondominated sorting genetic algorithm with various energy values calculated in the first layer as constraint conditions, considering the operation characteristics of various equipment and aiming at economy and environmental protection.

First-Layer Optimization Algorithm.
In the multienergy complementary microgrid system, the load and the operation state of each equipment change at any time. Reasonable energy allocation can effectively improve the operation performance of the system and improve the economic efficiency of the system. erefore, the decision variables of the first layer are the demand capacity value of each node distributed generation [20]. According to the grid structure and power demand, reasonable configuration of DG capacity of each node can meet the energy demand of users and reduce the energy loss of the multienergy complementary microgrid system [21,22]. erefore, the objective of the first layer optimization algorithm is to minimize the power loss of microgrid system, and its objective function is as follows: where P loss denotes the active loss of power of multi-energy network, ΔU denotes the offset of load node voltage in multienergy network, N 1 denotes the number of branches in multienergy network, N d denotes the number of nodes in multienergy network, G k(i,j) denotes the conductance of branch (i, j) is the number of the nodes at both ends of branch k, U i andU j are the voltage amplitude of nodes i and j, respectively, δ ij denotes the phase angle difference of nodes i and j, U spec i denotes the expected voltage value of node i, and ΔU max i denotes the maximum allowable voltage deviation of node i, so ΔU max i . e energy transfer of multienergy complementary microgrid system is limited by the energy conservation of the network and the transmission capacity of the pipe network [23]. erefore, the power constraints in the system are as follows.

Power Balance Constraints
where P Gi , P DGi , and P Li are the active power of the generator, distributed generation, and load of node i, respectively, G ij andB ij are the conductance and susceptance between nodes i and j, respectively, and Q Gi and Q Li are the reactive power of the generator and load of node i, respectively.

System Inequality Constraints
(1) Node voltage constraint: where V i min and V i max are the voltage upper and lower limits of the i th node, respectively. (2) Upper limit constraint of DG active power: where P DGmax denotes the upper limit of DG active power and N DG denotes the number of nodes which can be installed in DG. (3) Branch transmission power constraint: where P k max denotes the upper limit of transmission power of the k th branch.

Second Layer Optimization Algorithm.
Based on the results of the first layer optimization algorithm and real-time and reasonable configuration of the cooling, heating, and power output values of each equipment in the multienergy complementary microgrid system can improve the system operation economy and environmental protection [24], so the real-time output of each equipment is the decision variable of the optimization algorithm in this layer [25,26]. e objective of this layer optimization algorithm is to optimize the economy and environmental protection, so the objective function is as follows: where C total denotes the total cost of system operation, C mainenance denotes the maintenance cost of system equipment, C operation denotes the operation cost of system equipment, it mainly includes system electricity purchase cost and natural gas purchase cost, EM plt denotes the environmental cost of power generation, α i denotes the i th pollutant emission per unit power of internal combustion engine, Q i denotes treatment fee for unit power of the i th pollutant emission, and P GE (t) denotes the real-time electric power output by the internal combustion engine [27]. Equipment maintenance costs are as follows: where type � WT, PV, GE, BS, AC, EC, EB, HS, u type denotes the maintenance factor of each equipment, and P type (t) denotes the electric power of each equipment at time t. Equipment operation costs are as follows: where P grid (t) denotes the power purchased from the grid for the system, Ct ele (t) denotes the real-time price of power grid, V GE (t) denotes the volume of natural gas consumed by the system, and Ct gas (t) denotes the real-time price of natural gas (0.36 $/m 3 ). e constraints of the optimization algorithm in this layer mainly include system constraints, technical constraints, and operation constraints.
System constraints mainly limit the upper and lower limits of each equipment capacity of the system, and this part of the constraint is expressed as follows: When the operation strategy is power load priority, P GS � P GS_min . When the operation strategy is cooling load priority, P GS_min needs to be set to meet 70% of maximum cooling load.
Technical constraints mainly include the technical limitation of equipment operation. When the internal combustion engine is running under variable conditions, the ramp rate constraint should also be met, which is as follows: 6 Complexity where ΔP U denotes the rate of rise limit and ΔP D denotes the rate of descent limit. e charge and discharge of electric energy storage should meet the following constraints: P BS.cha_min and P BS.cha_max are the maximum and minimum charging power of energy storage equipment, respectively, and P BS.discha_min and P BS.discha_max are the maximum and minimum discharge power of energy storage equipment, respectively. Furthermore, the battery capacity should also meet the following constraints: SOC min ≤ C bs (t) ≤ SOC max . SOC min and SOC max are the maximum and minimum storage capacity of power storage equipment, respectively. Operation constraints mainly refer to the energy exchange constraints and the system energy conservation constraint between the multienergy complementary microgrid system and the power grid system, which are expressed as follows.

Energy Exchange Constraints.
Energy exchange constraints are as follows: where P EL (t) denotes the real-time power of total electric load of the system, P ongrid_max denotes the maximum value of the energy that the system can be connected to the grid, and P grid_max denotes the maximum amount of electricity the system can purchase from the grid.

Energy Conservation Constraint
Power balance constraint is shown as follows: Heating power balance constraint is shown as follows: where Q L.heat (t) denotes the heating load of the system at time t. Cooling power balance constraint is shown as follows: where Q L.cool (t) denotes the cooling load of the system at time t.

Basic Data.
is paper takes the architecture and load data of a regional multi-energy complementary microgrid system as an example to verify the effectiveness of the algorithm.
e grid structure of the system is shown in Figure 2, the grid parameters (per unit value) are shown in Table 1, and the electrical load data of each node of the system are shown in Figures 3 and 4 (the reference capacity is 1 mW).
is multienergy complementary microgrid system uses the optimization strategy based on double-layer nondominated sorting genetic algorithm to control the cooling, thermal, and power output of each equipment in the system in real-time.
e economy and environmental protection of the system with and without this algorithm are compared and analyzed (assuming that the cooling, heating, and power load of the system remains unchanged and the meteorological parameters remain unchanged within one hour of the evaluation period).
In this paper, the first-layer optimization algorithm calculates the distributed generation capacity required by each node based on the grid structure and power load demand of multienergy complementary microgrid system. e second layer optimization algorithm calculates the output value of each equipment in the system through combining the results of the first layer algorithm, considering the cooling and thermal load demand of the system and the characteristics of each equipment. e parameters of wind turbine, photovoltaic and electric energy storage used in this system are shown in Tables 2-4. e power ramp rate ΔP U � 500 kW/h, the power ramp down rate ΔP D � 650 kW/h, and the minimum operating power P min � 130 kWof internal combustion engine in the system are shown in Table 5. Cop characteristic data of absorption chiller, electric refrigerator, and electric boiler used in the system are shown in Tables 6 and 7, respectively. e cooling and thermal load data, meteorological data, and real-time electricity price of the system on a certain day are shown in Figures 5-9. e power interaction between the multienergy complementary microgrid system and the power grid should meet the following requirements: P ongrid_max � 20 kW and P grid_max � 100 kW. e population size of the two-layer optimization algorithm in this paper is 200, and the number of iterations is 100. e result of the first layer optimization algorithm is Complexity that the node 8 needs 825 kW of electricity and the node 9 needs 713 kW. e maintenance cost of each equipment in the system is shown in Table 8, and the maintenance fee of pollutant emission t is shown in Table 9.
In this paper, different operation modes are used to optimize this example in real time based on double-layer nondominated sorting genetic algorithm. e results of power load priority operation are shown in Figure 9, and the results           Figures 10 and 11. e comparison of various indexes before and after optimization is shown in Tables 10 and 11. e results show that the active power loss and voltage deviation of the multienergy complementary microgrid system are reduced by 51.41% and 41.89%, respectively, after using the real-time optimal control strategy based on double-layer nondominated sorting genetic algorithm. e total operation cost and pollutant emission control cost of the multienergy complementary microgrid system are reduced by 9.37% and 20.81%, respectively, when the power load priority operation mode is used; when the cooling and       thermal load priority operation mode is used, the total operation cost of the system is reduced by 16.79% and the pollutant emission treatment cost is reduced by 2.90%. erefore, the control strategy effectively improves the operation conditions of the system, ensures the stability and economic benefits of the system, and improves the environmental protection benefits.

Conclusion
In this paper, a real-time optimal control strategy of multienergy complementary microgrid system based on double-layer nondominated sorting genetic algorithm can effectively solve the problems of low efficiency and poor energy management of multienergy input and multienergy output systems.
is strategy optimizes the multienergy complementary microgrid system in real time and distributes the output of each energy supply terminal reasonably. According to the load demand and operation mode of the system, the first layer of the double-layer operation strategy calculates the power required by each node of the microgrid system to reduce the system loss and the second layer calculates the output of each equipment by using nondominated sorting genetic algorithm with various energy values calculated in the first layer as constraint conditions, considering the operation characteristics of various equipment and aiming at economy and environmental protection. is paper firstly introduces two different operation modes of multienergy complementary microgrid system, nondominated sorting genetic algorithm, power load priority, and cooling and thermal load priority. Secondly, the model of typical equipment in the system is established, and then the specific expression form of double-layer optimization algorithm in the multienergy complementary microgrid system is studied. Finally, the control strategy for multienergy complementary microgrid system is applied into a certain area; the results show that the control strategy can effectively reduce the network loss, improve the system voltage, reduce the total cost of system operation, and increase the environmental benefits of the system.

Data Availability
e data used to support the findings of this study are included within the article.