Multiobjective Demand Double-Layer Energy Consumption Optimization Strategy for Microgrid Based on Improved HPSOFA

In order to optimize the economy and environmental protection of microgrid, this paper establishes a demand response model based on comprehensive satisfaction, combines the advantages of the classical multiobjective particle swarm algorithm and multiobjective frefy algorithm, and proposes a hybrid particle swarm optimization and frefy algorithm (HPSOFA) to solve the joint economic and environmental dispatch problem of microgrid and improve the wind and light consumption capacity. Te proposed improved algorithm introduces a random perturbation term and adaptive learning coefcients, and the algorithm is selected by the dominance relationship of individuals, which improves the diversity of populations and increases the possibility of the algorithm to solve the global optimum. Te proposed algorithm is used to solve the test functions of diferent dimensions, and the results show that the Pareto front of HPSOFA has better distribution and accuracy, which verifes the efectiveness of the proposed algorithm. Simulation analysis is carried out using power data from a region of Liaoning Province, China, and experiments conclude that the operating cost and environmental cost of HPSOFA are signifcantly lower than other algorithms.


Introduction
Nowadays, the world is facing the serious problems of fossil energy depletion and harsh climate conditions, and in order to cope with these problems, the development and use of renewable energy sources are being realized globally.Microgrids, as a small integrated power system combining distributed energy, distribution devices, load management, energy storage devices, substation devices, and safety monitoring devices [1][2][3], can realize the transition from nonrenewable to renewable energy with their fexible power control and energy distribution technologies, efectively curbing the energy crisis caused by the scarcity of fossil energy and the environmental problems caused by the emission of hazardous substances.Te vigorous development of microgrids has become one of the important means of solving the global energy crisis and environmental problems and achieving sustainable human development [4].However, renewable energy such as wind power and photovoltaic power are greatly afected by the natural environment, and how to efectively deal with the intermittency and fuctuation of renewable energy has become a key technology to improve the ability to absorb renewable energy.
Demand-side response (DR) guides users' electricity consumption behavior by implementing incentive strategies on the demand side of the microgrid system to match the electricity consumption characteristics of the demand side with the generation characteristics of the supply side and to optimize the operational performance of both source-load sides to the maximum extent [5][6][7].Te application of demand response plays an important role in reducing the power supply burden of the microgrid and reducing the load peak-to-valley diference and efectively improves the distribution fexibility and operational stability of distributed energy in the microgrid system.In [8], demand response and integrated demand response programs are added to a two-stage stochastic model for the design and operation of storage systems for electrical and thermal energy, and the results show that demand response reduces operating costs by 15.1%.In [9], a rolling optimization planning framework and model for integrated energy systems considering compressed air energy storage and integrated demand response based on sliding time windows for electricity and heat are proposed to obtain optimal resource allocation and energy management strategies simultaneously.In [10], an incentive-based demand response model for community microgrids is developed and provides fexibility to community microgrids through an aggregator that minimizes the cost of fexibility management.In [11], a joint framework is proposed to integrate a new incentive-based demand response and reconfguration method into the microgrid energy dispatch problem in the day-ahead time frame with the optimization objective of minimizing the fuel cost of distributed generation and the power purchase cost of the grid.Although the above papers introduce a demand response mechanism to optimize the operational performance and economic objectives of microgrids, it is difcult for a single demand response mechanism to accurately refect the comfort of electricity consumption on the user side.Tis paper helps to improve the rationality and applicability of demand-side response by establishing a comprehensive satisfaction assessment model that considers the rate of change of electricity and the rate of change of electricity price on the user side and adjusts the incentive strategy according to the user's comfort of electricity consumption.In addition, it can optimize the energy consumption characteristics from the load side and promote the ability to absorb renewable energy.
Te economics and environmental protection of microgrid operation is one of the important indicators to assess the superiority of the system.Te problem is defned to optimize the output power of each distributed energy source to achieve the symmetry of economic benefts and pollutant emissions under satisfying the constraints of the microgrid and the electric load demand.With the increase of optimization objectives, the multiobjective joint economic and environmental dispatch problem of microgrid is gradually complicated, showing nonlinear, high dimensional, nonconvex, and nondiferentiable characteristics, and the traditional mathematical optimization methods [12][13][14][15] are difcult to deal with such NP [16] problems although they have higher accuracy.To solve such problems, heuristic algorithms [17][18][19][20][21][22] are often used.In [23], the multiobjective problem is transformed into a single-objective function using a price penalty factor to minimize the operating cost and emission level.In [24], a hybrid algorithm based on particle swarm optimization (PSO) and gravitational search algorithm (GSA) is proposed to improve the overall economic and emission benefts of power systems.In [25], the multiobjective problem of fuel cost and pollutant emission of a thermal power plant is transformed into a single-objective problem using penalty function and solved by particle swarm algorithm and genetic algorithm.In the above papers, the multiobjective problem is mainly transformed into a single-objective problem in the form of weighted sum or penalty function to reduce the solution difculty and improve the solution efciency, but only one optimal solution can be obtained in one operation, which leads to a more single result for complex nonlinear problems, and decision makers cannot choose the optimal solution fexibly according to the multiple demands of different objectives.To this end, a hybrid multiobjective particle swarm optimization and multiobjective frefy algorithm (HPSOFA) is proposed in this paper, which combines the respective advantages of the two algorithms, and is compared with the test results of the classical multiobjective particle swarm algorithm (MOPSO) and multiobjective frefy algorithm (MOFA) by solving the test functions in diferent dimensional objective spaces, which verifes that the HPSOFA has better solution ability.In addition, the HPSOFA is applied to the combined economic and emission dispatch of microgrid.In order to determine the superiority of iterative results in multiobjective problems, the Pareto front [26] is used to visualize the economic cost and environmental cost, and the economic and environmental multiobjective optimal Pareto front surface is derived.Te comparative analysis of the Pareto front surface of MOPSO and MOFA concludes that the HPSOFA efectively promotes the consumption of wind and solar energy and improves the economic and environmental benefts of the microgrid system.
In summary, this paper proposes a multiobjective optimization strategy for double-layer wind-solar absorption in microgrids based on improved HPSOFA.Te upper layer optimizes the demand side of the microgrid system by considering the demand response mechanism of comprehensive satisfaction, and the lower layer uses improved HPSOFA to solve the multiobjective problem of power dispatching, maximize the system's ability to absorb wind and solar energy, and optimize the system's economy and environmental protection.

Double-Layer Multiobjective Optimization Model for Wind-Solar Energy Consumption
With the substantial increase in installed capacity of wind power and photovoltaic power, the intermittent and fuctuation of wind power and photovoltaic power has increased the pressure of deep participating in peak regulation on microgrid.Nowadays, the common ways of wind-solar energy consumption include demand response, energy storage technology, multienergy complementary technology, and cross-regional energy consumption; because crossregional energy consumption on the regional environment and transmission line construction costs have greater requirements, cross-regional energy consumption is not considered in this paper.

Deep Participating in Peak Regulation considering Price-Based Demand Response (PBDR).
Te price-based demand response is to rationalize the load-side electricity consumption characteristics through the time-of-use tarif adjustment mechanism, to stimulate users to take the initiative in deep participating in peaking of renewable energy, to efectively improve the capacity of wind and photovoltaic energy consumption, and to form an upper-layer consumption mechanism for wind power and photovoltaic power.

Multitime Price-Based Demand Response Model.
From the economic theory analysis, the rate of change of electricity consumption of customers will vary relatively according to the rate of change of time-of-use tarif, and the 2 International Transactions on Electrical Energy Systems mathematical model of its relative change is represented by the price elasticity coefcient of demand [27].
where ∆q/q is the rate of change of customer electricity consumption; ∆p/p is the rate of change of time-of-use tarif; and ∆q, q, ∆p, and p, respectively, denote the change in customer electricity consumption, initial electricity consumption, electricity price change, and initial price in the current period.
For the PBDR peak regulation mechanism, diferent sampling intervals and relative impact ranges have diferent degrees of guiding efects on the change rate of customer electricity consumption in the current period.By considering the above two aspects, the electricity price guiding relationship to customer electricity consumption in diferent time periods can be divided into self-elasticity coefcients and cross-elasticity coefcients.
Te self-elasticity coefcient ε ii in equation ( 2) represents the relative infuence of the electricity price change rate in the i-th period on the electricity consumption rate of change in the current period, and the cross-elasticity coefcient ε ii represents the relative infuence of the electricity price change rate in the j-th period on the electricity consumption change rate in the i-th period.Te bias sign here is intended to indicate that the function for any single time period is jointly determined by the decision variables of multiple time periods [28].
In this paper, a typical day is divided into 24 hours.For a certain period 1∼n, equation ( 4) can be obtained from equations ( 2) and (3) as the price elasticity matrix of demand, in which the main diagonal is the self-elasticity coefcient and the rest is the cross-elasticity coefcient.
According to the defnition of price elasticity matrix of demand, the following formula is derived.
From equation ( 5), it can be deduced that the rate of change of the customer electricity consumption can be calculated by the rate of change of time-of-use tarif and the price elasticity matrix of demand.
where q n,cur is the electricity consumption on the user side during the current period and zq n,cur is the change amount of electricity consumption at the current period.Te formula represents the change amount of electricity consumption at the current period, which is obtained by the matrix composed of the user's electricity consumption in current period and the rate of change of the customer electricity consumption in current period.
where q n,resp is the electricity consumption on the user side during the response period, which can be obtained according to the electricity consumption of the user side in the current period and the change amount of the user's electricity consumption in the current period.
To sum up, the relative function expression of real-time electricity price and whole-day electricity consumption can be deduced as follows.
According to the above expression, elastic matrix can be used as a function of electricity price in multiple time periods for analysis, improving the sensitivity and accuracy of demand-side electricity consumption.

User Comprehensive Satisfaction Model of PBDR.
For price-based demand response, a single electricity price adjustment method usually cannot reasonably regulate the change of electricity consumption on the customer side, and too much tarif regulation will reduce the customer's comfort of electricity consumption, while too little tarif regulation cannot achieve the efect of deep peak regulation of the microgrid.In order to develop a suitable tarif where S comp is the comprehensive satisfaction; ξ p and ξ e are the tarif regulation coefcient and electricity regulation coefcient, respectively; ∆p t , p t , ∆q t , and q t are the electricity price change, initial electricity price, electricity change, and the initial electricity in time period t, respectively; and T is the total number of time periods divided in a day, and T is taken as 24 in this paper.
According to user habits, one day is used as the basic unit to judge users' satisfaction with electricity consumption.Terefore, in the model, the rate of change of customer electricity consumption in 24 hours on the same day and the rate of change of time-of-use tarif are accumulated to achieve preliminary statistics of users' satisfaction.Ten, according to the actual situation, the corresponding electricity price and electricity consumption adjustment coefcient are used to allocate the proportion of satisfaction, so as to better conform to the evaluation of diferent emphasis of demand-side users on electricity price and electricity consumption.Finally, comprehensive user satisfaction evaluation is obtained by a basic calculation method.
Tis evaluation model solves the diferent efects caused by too much and too little electricity price regulation, supplements the feedback of electricity consumption changes to user experience, and achieves the self-adaptive adjustment of electricity price range and electricity consumption range demand.
In [29], the change of electricity consumption cost is taken as the customer satisfaction index, which is too simple and cannot comprehensively refect the customer satisfaction with electricity consumption.In [30], although the sum of the change of electricity price, electricity consumption, and load reduction was used as the index of user satisfaction, simple linear combination evaluation would result in a large deviation from the actual user satisfaction.
Te comprehensive customer satisfaction evaluation model proposed in this paper not only integrates the evaluation of the changes of electricity price and electricity consumption but also adopts the nonlinear combination method to make the evaluation results more in line with the actual user experience and feedback.

Wind-Solar Consumption Approach Based on Distributed
Multienergy Complementation.Distributed multienergy complementation refers to deep participating in peak regulation of the power grid by the introduction of multiple energy units in order to reduce the phenomenon of abandoning wind and photovoltaics caused by the intermittent and unstable problems of wind power and photovoltaics in the distributed energy generation system.In this paper, we select common generating units including fuel cell (FC), diesel generator (DG), micro-gas turbine (MT), and energy storage system (ESS) to participate in the wind-solar energy consumption strategy.

Distributed Energy Generation System Model. (1) Wind Power Model
where P WT is the total power output of the wind turbine in a day; P t WT is the power output of the unit at time t; and v min and v max represent the minimum and maximum wind speed of the turbine during normal operation, respectively.
(2) Photovoltaic Power Generation Model where P PV is the total output power of the PV generator set; P t PV, max is the maximum allowable output power of the PV generator set at time t; L cur and L up are the light intensity and the maximum allowable light intensity of the PV panel at the current period, respectively; T ac and T st are the actual temperature of the current period and the standard ambient temperature of the normal operation of the generator, respectively; and ξ l is the temperature infuence factor of the PV generator set.
(3) State-of-Charge Model of the Energy Storage System.Charging: Discharge: where SOC t+1 and SOC t are the state of charge of the energy storage system at time t + 1 and time t, respectively; σ sd and η oper represent the self-discharge coefcient and charge/ discharge efciency of the energy storage system, respectively; P t ESS is the charge/discharge power of the energy storage system at time t; ∆t is the unit time interval; and SOC max is the maximum state of charge.

(4) Wind Power Cost Model
where C WT is the operating cost of the wind turbine; C t WT,unit is the unit price of wind power in period t; λ WT is the 4 International Transactions on Electrical Energy Systems maintenance factor of the wind turbine; and P t WT is the output power of the unit in period t. (

5) Photovoltaic Power Cost Model
where C PV is the operating cost of the PV generator set; C t PV,unit is the unit price of photovoltaic power in period t; λ PV is the maintenance factor of PV generator set; and P t PV is the output power of the unit in period t.
where C FC is the operating cost of the fuel cell; C gn is the unit cost of natural gas consumed by the fuel cell; and LHV is the low heat value of natural gas.In this paper, C gn and LHV are 2.4 E/m 3 and 9.7 kW۰h/m 3 , respectively; P t FC and η FC are the output power and power generation efciency of the fuel cell in period t, respectively; and ∆t is the unit time interval.

(7) Micro-Gas Turbine Cost Model
Te cost models of micro-gas turbine and fuel cell are similar, and both use natural gas as the fuel for power generation, so C gn and LHV take the same values as in the fuel cell model.C MT is the operating cost of MT; P t MT and η MT are the output power and power generation efciency of MT in period t, respectively.

(8) Diesel Generator Cost Model
where C DG is the operating cost of the diesel generator; C df,unit and C m are the fuel cost and maintenance cost per unit of DG generation, respectively; and P t DG is the output power of DG in period t.

(9) Energy Storage System Cost Model
where C ESS is the operating cost of the ESS; C ESS,unit and C m are the unit operating cost and maintenance cost of the ESS, respectively; c cd is the charging and discharging coefcient of the ESS, in which charging is 1 and discharging is −1; η oper is the operating efciency of the ESS; P t ESS is the charging and discharging power, in which charging is positive and discharging is negative; and ∆t is the unit time interval.

Distributed Energy Generator Set Constraints.
(1) Power Balance Constraints where N is the number of types of distributed energy units; P t i is the output power of the i-th generator set at period t; P t ESS is the output power of the ESS at period t (when the ESS is discharged, P t ESS > 0; otherwise, P t ESS < 0); and P t load is the electricity load at period t.
(2) Unit Output Constraint where P t i, min and P t i, max denote the minimum and maximum output power of the generator set i in time period t, respectively.
(3) Climbing Constraints where P cli, min is the minimum allowable climbing output of the unit and P cli, max is the maximum allowable climbing output of the unit.
where SOC min and SOC max denote the minimum allowable state of charge and maximum allowable state of charge in the ESS, respectively, and SOC t is the state of charge in period t.
(5) Comprehensive Satisfaction Constraint where S min and S max denote the minimum and maximum allowable values of user satisfaction after demand response, respectively.

Multiobjective Deep Participating in Peak Regulation
Model.Te wind-solar energy consumption strategy proposed in this paper is to achieve the goal of deep participating in peak regulation of the microgrid through source-load side coordination optimization.Trough rational dispatching of distributed energy and considering the economy and environmental protection of distributed energy utilization, a multienergy multiobjective lower-layer optimization mechanism of wind-solar energy consumption is formed.

Economic Optimization Objective.
Te economic objective is one of the important indicators for the rationalization of distributed energy dispatch, and its objective function is composed of the operating cost of each generating unit, as shown in the following equation. min International Transactions on Electrical Energy Systems where C total is the total cost of the distributed energy system; C t i is the operating cost of the generating unit i in period t; C t PV,loss is the abandonment cost of the PV cell in period t; and C t WT,loss is the abandonment cost of the wind turbine in period t.

Environmentally Friendly Optimization Objective.
Te environmental optimization target is determined by the pollutant emissions of each type of generating unit, and the main types of pollutants emitted by the generating units used in this paper include CO, CO 2 , and NO x .Since wind power and photovoltaic power generation are clean energy, their pollutant emissions are negligible, and the specifc functions are shown in the following equation: where G total is the total pollutant emission of each generator set; μ i is the pollutant emission factor of the generator set of category i; and P t i is the output of the generator set of category i in time period t.

Multiobjective Particle Swarm Optimization Algorithm.
Te particle swarm optimization algorithm was proposed by Eberhart and Kennedy in 1995 [31].It is a metaheuristic algorithm simulated based on research on predation strategies of focks.Te most important parameters in the PSO evolution process include the inertia weights, the individual optimal position of the particles, and the global optimal position of the group.Te inertia weight will be decreasing with the number of iterations, alleviating to a greater extent the balanced relationship between exploration and search capabilities [32].Te individual optimum is the optimal position that each particle continuously updates and records itself in the historical path, while global optimality is the optimal location of the population recorded by the entire population by constantly sharing data and moving.Te individual optimum and the global optimum simultaneously guide the population toward the optimal position and improve the convergence rate of the population.Te current individual's speed will determine the distance and direction it moves, and the relationship equation is shown as follows.
where v k nd denotes the particle velocity of the d-th dimensional individual n after the k-th iteration; v k−1 nd and x k−1 nd denote the particle velocity and particle position of the d-th dimensional individual n after the k − 1-th iteration, respectively; ω is the inertia weight, and the value is 0.4; c 1 , c 2 are the individual learning coefcients and social learning coefcients, respectively, and both are set to 2; and r 1 , r 2 are the individual random coefcients and social random coefcients, respectively, which are random numbers between 0 and 1. Te update speed of the current iteration individual plus the current position information is the position of the next generation individual.Te specifc formula is as follows: where x k nd , x k−1 nd denote the particle positions of individual n in the d-th dimension after the k-th and k − 1-th iterations, respectively.
With the continuous development of evolutionary algorithms, the demand for multiobjective optimization problems has gradually increased, and due to the fast convergence of single-objective particle swarm optimization, it has become an inevitable trend to extend them to multiobjective algorithms [33].Te difculty of multiobjective optimization algorithm compared with singleobjective optimization algorithm is the reasonable selection of individual and global optima, and since the same decision variables map diferent objective vectors, how to compare the advantages and disadvantages of multiple objective vectors becomes the key problem of the algorithm.Coello et al. proposed a multiobjective particle swarm optimization (MOPSO) in 2004 [34], which sets an external repository, where the nondominated individuals obtained from each iteration are stored in the repository, and the diversity of the population is maintained according to the adaptive grid method [35], by dividing the repository into several hypercubes, and the globally optimal individuals are selected from the hypercube with a lower number of particles.Te velocity update equation of MOPSO is as follows.
where rep hd is the h-th nondominated solution in the repository and index h is the particle in the hypercube with fewer particles selected according to roulette; the remaining parameters are the same as equation (27), and the position update formula is the same as equation ( 28).

Multiobjective Firefy Algorithm.
Te frefy algorithm [36] is a metaheuristic swarm intelligence algorithm proposed by XinShe-Yang in 2008 based on the luminous properties of frefies in nature.Each frefy in the frefy algorithm moves according to the light intensity of other individuals.Te functional relationship between light intensity and distance can be approximated as a Gaussian expression as follows.
where I ij is the light intensity received by individual i from individual j; I 0 is the initial light intensity, set to 1; c is the light coefcient of the frefy, set to 0.1; and r ij is the Cartesian distance between individual i and individual j.Te light intensity between individuals is proportional to the attraction, and the functional relationship is as follows. 6 International Transactions on Electrical Energy Systems where β ij is the attraction of individual j to individual i and β 0 is the initial attraction, and its value is set to 1. Te Cartesian distance equation between each individual is shown as follows.
where x id and x jd denote the positions of individual i and individual j in the d dimension, respectively.Te position update formula of individual i under the attraction of individual j is shown as follows.
where x k i is the position of individual i after the k-th iteration; x k−1 i and x k−1 j are the positions of individuals i and j after the k − 1-th iteration, respectively; α is the perturbation factor of frefy movement, usually a constant (this paper takes 0.97); and ε i is the random parameter of individual i movement, usually a randomly distributed value in the range of [−0.5, 0.5] or a standard normal distribution in the range of G (0, 1).
In 2013, XinShe-Yang proposed a multiobjective frefy algorithm (MOFA) [37] based on the single-objective frefy algorithm, which uses the weight ratio strategy to select the optimal frontier solution when the global optimal individuals cannot be obtained and increases the movement direction of individuals, which is benefcial to improve the population richness.In the absence of an undominated solution, the position update formula of frefies is shown as follows.
where x k i is the position of individual i after the k-th iteration; * is the global optimal individual selected by random weight ratio in the k − 1-th iteration of the population; and α k− 1 is the perturbation factor of frefies in the k − 1-th iteration, which is diferent from α in FA because the perturbation factor in MOFA adopts a nonlinear reduction strategy, and the specifc relationship is shown in the following equation.
where α 0 is the initial random number, which is usually a constant.

Improved Hybrid Particle Swarm Optimization and Firefy
Algorithm.Aydilek [38] proposed the hybrid particle swarm frefy algorithm for solving complex single-objective numerical problems, which combines the advantages of particle swarm optimization and frefy algorithm to determine the start of the local search process by checking the previous global optimal ftness value.Babbar et al. [39] applied this algorithm to the single-objective and bi-objective constrained optimization problems of magnetic abrasive fnishing process parameters and achieved a good optimization result.
For the classical multiobjective particle swarm optimization (MOPSO), because there are both individual optimal and global optimal parameters to guide the optimization of the population, the convergence speed of the population is accelerated.However, the accelerated convergence speed also leads the population to fall into local optimum more easily.In order to balance the convergence speed and search accuracy of MOPSO, the evolutionary idea of multiobjective frefy algorithm (MOFA) is introduced, and improved hybrid particle swarm optimization and frefy algorithm (HPSOFA) is proposed by combining the fast convergence property of MOPSO and the superior search ability of MOFA and introducing the random perturbation mechanism and adaptive learning factor in MOPSO with reference to the iteration mechanism of MOFA.
Te improved hybrid particle swarm optimization frefy algorithm (HPSOFA) has the characteristics of fast convergence and high local search accuracy and does not have the requirements of traditional mathematical optimization methods on model construction and transformation.Aiming at the multiobjective nonlinear microgrid mathematical model constructed in this paper with economic and environmental objectives, HPSOFA can simplify the complexity of model solving process and improve the robustness of constraints such as power balance, unit climbing, and stored charge.

Random Perturbation Mechanism.
Te memory capability of MOPSO speeds up the movement of the population to the historical optimal position, but its search mechanism cannot guarantee the algorithm's ability to search for the global optimum.Terefore, this paper adds a random perturbation term to MOPSO, which can improve the diversity of particles in the search feld, strengthen the ability of the population to jump out of the local optimum, and increase the stability of the algorithm to solve the global optimum.
In this paper, the Gaussian perturbation N(μ, σ 2 ) is used as the perturbation mechanism of the new particle random perturbation term, where μ is the mathematical expectation of the perturbation term and σ 2 is the variance.In order to ensure the robustness of the algorithm and avoid the situation of failure to converge, a constraint factor ϕ is added to the perturbation term, and the velocity update formula with the random perturbation term is shown as follows.
where the mathematical expectation μ in N(μ, σ 2 ) is taken to be 0. Too large a perturbation will cause the population to lose the optimal solution, while too small a perturbation will cause the population to fall into a local optimum, so it is crucial to choose a suitable perturbation range.In this paper, the current particle movement speed is chosen as the variance σ 2 of the Gaussian perturbation, and the combination of the nonlinear constraint factor ϕ can efectively improve the ability to search for the optimal solution.
International Transactions on Electrical Energy Systems

Adaptive Learning Coefcients.
Learning coefcients are important parameters in MOPSO, which include individual learning coefcients c 1 and social learning coefcients c 2 .Te selection of reasonable individual learning coefcients can better utilize the historical position of each individual to deal with the complex optimization-seeking problem, and reasonable social learning coefcients are helpful to improve the recognition of the global optimal solution of the population and avoid the population from falling into the local optimum.
Te classical MOPSO uses a constant as the learning coefcient of the particles, and later some scholars have done more indepth research on the selection of learning coefcients through theoretical analysis [40], but the more common improvement methods are by linear or simultaneous changes of the two learning coefcients without considering the correlation between the iteration process and the learning ability, which leads to the population not being able to reasonably control the learning ability to the global optimum according to the iteration progress and reduces the convergence speed of the algorithm to solve the global optimum.To address this problem, this paper proposes an adaptive learning coefcient, which adaptively regulates the individual and social learning coefcients according to the iteration progress of the population, increases the diversity of population evolution through an asynchronous adjustment strategy, and improves the global search ability of the algorithm.Te improved learning coefcients are shown in the following equation.
where C 1, min , C 1, max are the minimum individual learning coefcient and the maximum individual learning coefcient, respectively, which are set to 2 and 4; C 2, min , C 2, max are the minimum social learning coefcient and the maximum social learning coefcient, respectively, and their values are set to 2 and 4; and θ ind , θ soc are individual change factors and social change factors, respectively, and the change factors here can be adjusted according to diferent models.Te smaller the value of θ ind , the stronger the individual learning ability of the population.Te same is true for θ soc .Terefore, under some specifc conditions, a stronger individual learning ability is required, and θ ind can be appropriately reduced, and the same is true for social learning ability.Here the two change factors do not have a fxed value.Tis article fnds that their values are acceptable between 1 and 20 through continuous testing.In this paper, θ ind is 7 and θ soc is 5; k and k max are the current and maximum iterations of the population, respectively.

Improved Hybrid Particle Swarm Optimization and
Firefy Algorithm.MOPSO and MOFA are quite diferent in evolution strategy and also have their own advantages and disadvantages in search ability.MOPSO has the characteristics of saving the historical optimal solution, and the optimization speed is fast, but it is easy to fall into the local optimum, and it is difcult to balance the convergence speed and the exploration accuracy.MOFA does not have memory function, but due to its iterative strategy, the attraction is nonlinearly reduced according to the light intensity, thus strengthening the algorithm's ability to search for local optima.In the common hybrid particle swarm optimization and frefy algorithm, the best population after iteration of the MOFA is used as the initial population in the MOPSO.Although this method can guarantee the quality of the initial population in the MOPSO, it does not make full use of the strategic advantage of the MOFA, and both algorithms run completely, which will greatly increase the amount of operations of the hybrid algorithm and reduce the feasibility and practicality of the algorithm.To this end, this paper combines the respective strategy advantages of MOPSO and MOFA and proposes an improved hybrid particle swarm optimization and frefy algorithm.
Te HPSOFA proposed in this paper departs from the macroscopic idea of merging and iterating the whole population and takes a microscopic perspective to maximize the search efciency and excellence-seeking accuracy of the hybrid algorithm by making full use of the positional advantage of each individual and the information perception ability among individuals.In the MOFA, a sufcient condition for an individual to be able to perform search operations is the existence of elite individuals within the perceptual range of the current individual to provide it with interactive information; however, the neighborhood of the optimal individual in the population lacks excellent individuals to attract it.For this reason, the memory function of the MOPSO is retained in the HPSOFA, and the historical optimal solutions during the iterative process are stored in the archive of elite individuals.When the MOFA cannot fnd an individual with higher light intensity than itself during the iterative process, it can continue the frefy search operation by accessing the archive of elite individuals.Because the MOPSO has the characteristics of fast convergence in the early stage, for the conventional optimization problem, the existence of dominated individuals in the early iteration process is more common; in order to make full use of the characteristics of rapid convergence of the MOPSO, MOPSO is implemented on the dominated individuals.Te latter part of the iteration is mainly local search, which can be used to optimize the nondominated individuals by using the strong local search ability of MOFA.Te combination of the two algorithms efectively increases the diversity of the group and avoids the algorithm from falling into local optimum.Te speed update formula of dominated individuals is the same as (36), and the position update formula of nondominated individuals is the same as equation (34).Te operation fow of the HPSOFA is shown in Figure 1.

Simulation and Application
In order to verify the efectiveness and feasibility of the proposed algorithm and models in this paper, in the experimental environment of Intel (R) Core (TM) i5-10400 CPU @ 2.90 GHz 2.90 GHz processor and 16 GB memory, the three algorithms of MOPSO, MOFA, and HPSOFA were International Transactions on Electrical Energy Systems compared through the simulation software MATLAB 2019b by using test functions Poloni, Kursawe, Viennet2, and Viennet3 simulation results..
Taking the historical data of a microgrid system in a region of Liaoning Province, China, as an example, the microgrid system in this paper includes several generating units and battery systems such as FC, DG, MT, and ESS.Te HPSOFA, MOPSO, and MOFA algorithms are used to solve the double-layer wind-solar absorption model proposed in this paper, and the optimal dispatch of the microgrid system in terms of economy and environmental protection is realized.By comparing the system simulation data with the historical power consumption data of the region, the superiority of the proposed method is verifed.Te pseudocode of the double-layer wind-solar absorption optimization strategy is shown in Algorithm 1.

Performance Test of HPSOFA.
Since the improved algorithm has been verifed from multiple test functions, one day's electricity consumption data can be randomly selected for simulation analysis in practical applications.In order to verify the general applicability and superior performance of the proposed algorithm, test functions with diferent dimensions and diferent geometrical structures are selected to provide a basis for proving the excellent performance of HPSOFA.Te types of test functions selected in this paper and their specifc parameters are shown in Table 1.
Tree algorithms, HPSOFA, MOPSO, and MOFA, were applied to solve the four multiobjective test functions in Table 1, respectively, and the Pareto fronts of their solutions are shown in Figure 2. In addition, the evaluation indexes of inverted generational distance (IGD) [41] and average running time (ART) obtained by 30 runs of several algorithms are also listed.

Inverted Generational Distance (IGD).
Te specifc calculation formula of IGD is shown in the following equation.
where d j ′ � min i∈P |j − i| represents the minimum Euclidean distance between point j on the Pareto optimal frontier and International Transactions on Electrical Energy Systems the obtained point i on the frontier and n is the number of individuals on the Pareto front.Te IGD can be evaluated comprehensively based on the convergence and distribution of the nondominated solution set, and the smaller the IGD, the better the comprehensive performance of the algorithm, and the specifc results are shown in Table 2. Te Pareto front of each group of test functions in Figure 2 shows that the HPSOFA has a more comprehensive optimization performance at diferent scales and in diferent dimensions.Te results of the comprehensive evaluation of the three algorithms in Table 2 show that HPSOFA obtain the Pareto front with better distribution and uniformity for diferent test functions, and it also better verifes that the HPSOFA has better applicability and robustness in solving complex problems.

Average Running Time (ART).
Te average running time of the three algorithms for the four multiobjective test functions is shown in Table 3.As can be seen from Table 3, for the four test functions selected, HPSOFA has the shortest average execution time among the three algorithms, which verifes the characteristics of faster convergence and better search ability of HPSOFA.
Due to the diferent number of objective functions, Poloni and Kursawe are set as one group, and Viennet2 and Viennet3 are set as the other.In the test function of the same group, it can be seen that HPSOFA has less average running time for calculating 30 times and has better algorithm solving performance.

Multiobjective Optimization Analysis of Double-Layer
Wind-Solar Energy Consumption.Combined with the comprehensive satisfaction evaluation mechanism proposed in this paper, the upper-layer optimization mechanism of wind-solar energy consumption is applied to the demand side of the microgrid system in the region, and the comparison results of the actual electricity load of customers and the electricity load after DR are derived, as shown in Figure 3.
Figure 3 shows that the peaks of electricity consumption are mainly distributed at 8 am-12 pm and 5 pm-10 pm, and the valleys are distributed at 1 am-4 am and 1 pm-3 pm.Te change rate of electricity consumption in the frst electricity consumption valley is lower than the change rate of electricity consumption in the second electricity consumption valley because the change rate of electricity consumption has a greater impact on the comprehensive satisfaction of customers during the early morning hours.Before implementing DR on the customer side, the maximum peak-tovalley diference in electricity consumption was as high as 55 KW, accounting for 51.81% of the average daily power load.After implementing the DR on the customer side, the maximum peak-to-valley diference of electricity consumption is reduced to 40 KW, accounting for 37.94% of the average daily power load.It is found that the DR proposed in this paper efectively reduces the peak-to-valley diference of electricity consumption on the load side.Te reduction of load fuctuation on the user side is conducive to increasing the consumption space of renewable energy and plays an important role in reducing the scheduling pressure on the supply side of the microgrid.
Te HPSOFA is applied to the second-layer multiobjective optimization of the microgrid system.Te specifc parameters of each generator set in the microgrid system are shown in Table 4.
Te predicted power generation from wind turbines and PV cells is shown in Figure 4.
In Figure 4, the predicted output of wind power fuctuates greatly throughout the day, while the predicted output of photovoltaic cells is mainly concentrated in 9 am-4 pm, and the output of photovoltaic cells is almost 0 at night.Te (1) Input the relevant power data of the microgrid, including P t WT , P t PV , P t load , P t i, max , P t i, min , P cli, max , P cli, min , SOC max , SOC min , k max , ω, c 1 , c 2 , β 0 , α, and other parameters (2) Demand-side optimization of user load P t load according to equations ( 1)-(5) (3) Evaluate the user's satisfaction S comp according to equation ( 6) and constrain its regulation range (4) Randomly initialize the power generation of each generator set (5) while gen < Iter_max (6) Evaluate population economic costs C total and environmental costs G total (7) for i, j � 1: n (all n individuals) (8) Nondominated sorting of populations (9) Update Elite Individual Archives (10) if (x i is the dominant individual)//Execute improved MOPSO (11) Set the global optimal gbest and individual optimal pbest (12) Update individual velocity and position by equations ( 33) and (34) (13) else//Execute MOFA (14) Calculate the Cartesian distance and attraction between individuals by equations ( 28) and ( 29) (15) Update the individual position by equation ( 31) and constrain out-of-bounds individuals ( 16) end (17) end ( 18) end (19) Export economic and environmental protection multiobjective optimal frontier ALGORITHM 1: Pseudocode for double-layer wind and solar consumption strategy.10 International Transactions on Electrical Energy Systems  International Transactions on Electrical Energy Systems large single-peak output of photovoltaics increases the difculty of the system to fully absorb light, and the uncertainty of photovoltaic power and wind power output will also aggravate the phenomenon of wind and light abandonment in microgrid.Terefore, the reasonable utilization of renewable energy such as wind power and photovoltaic power is important to reduce the environmental and economic costs of microgrid.Te improved HPSOFA proposed in this paper and the other two algorithms are used to optimally dispatch the microgrid system with economic and environmental costs for two scenarios before and after DR.Te data results under the two scenarios are shown in Figures 5-8, and the time required to solve the experiment operation is shown in Table 5.In scenario 1, the original power consumption data are optimized and solved, and in scenario 2, the microgrid system after DR is optimized and solved.Te Pareto front obtained is shown in Figures 5 and 6.
In Table 5, by comparing the solving time of microgrid optimization of the three algorithms before and after DR, it can be seen that the experimental operation time is consistent with the running time of the test function.HPSOFA proposed in this paper takes shorter time in the process of experimental calculation, has better convergence, and has stronger global search ability.In Figure 5, comparing the optimization results of the three algorithms for the original power data shows that HPSOFA is signifcantly lower than the other two algorithms in terms of operating and environmental costs.When solving multiobjective problems, since the result obtained is the Pareto front , the decision maker can choose the optimal solution of the frontier according to diferent needs.In Figure 5, a best compromise solution is selected in the frontier, and the decision maker can move up or down the best compromise solution according to the degree of emphasis on operating costs and environmental costs.In addition, due to the more concentrated electricity load before DR, it will increase the power load on the supply side and reduce the fexibility of power dispatching of each unit, which afects the optimization result of the objective function to a greater extent.In Figure 6, after the upper-layer demand response optimization of the original electricity load, the optimization algorithm is used to solve the microgrid system to form a two-layer wind and solar energy consumption multiobjective optimization strategy.Compared with scenario 1, the optimal integrated solution reduces the operating cost by 192,315 E and the environmental cost by 9,654 E due to the reduced peak-tovalley diference of power load and the increased disposable space for wind and photovoltaic.Te HPSOFA is signifcantly better than MOPSO and MOFA in terms of search capability and exploration accuracy, and the optimal day- International Transactions on Electrical Energy Systems ahead scheduling of each unit in scenario 1 using HPSOFA is shown in Figure 7.
In Figure 7, the peak power consumption of the whole day is around 10 am and 8 pm; due to the instability of renewable energy and the large peak-to-valley diference of the demand-side load, wind turbine and photoelectric cannot reasonably dispatch energy according to the power demand.In order to meet the load demand, the generation power of nonrenewable energy unit in the obtained dispatch result is increased accordingly, while the energy storage system is used to relieve the supply pressure of power consumption peak and improve the consumption capacity of wind power and photovoltaic power.Te optimization algorithm improves the scheduling capability of the microgrid system to a certain extent, but due to the large fuctuation of electricity load, it limits the peak regulation depth of each unit, increases the scheduling pressure of the ESS, and increases the start-stop cost of the ESS and the fuel cost of the nonrenewable energy units.To further reduce the environmental and operational costs of the system, the system is solved in scenario 2 using HPSOFA, and the optimal day-ahead dispatch of each unit is shown in Figure 8.
Comparing and analyzing Figures 7 and 8, it can be seen that after implementing the demand response strategy on the customer side, the power consumption fuctuation is relatively smooth throughout the day, which ensures the fexibility of energy dispatching of each unit.Te reduction of the power peak-to-valley diference reduces the power generation of each unit and increases the consumption capacity of renewable energy.Te charging power of the ESS is signifcantly reduced near 1 pm, which relieves the scheduling pressure of the ESS and improves the environmental friendliness of the microgrid.At the same time, the stable power output of each unit during the whole dispatching period reduces the operating loss of the system to a large extent and improves the economy of the microgrid.
By solving the two-layer multiobjective optimization of the microgrid system and considering the two scenarios before and after the demand response, respectively, the comparison results of wind power and photovoltaic consumption are shown in Figures 9 and 10.
As can be seen in Figure 9, the instability of wind power is large throughout the day, and the actual wind power output fuctuations are relatively fat in order to ensure the global scheduling stability of the microgrid.For the hours of 3 am-6 am and 11 am-1 pm, the predicted power fuctuation of wind power is large, which leads to the reduction of the system's consumption rate of wind power.However, after implementing the DR mechanism for users, the consumption rate of wind power throughout the day is signifcantly better than that before demand response.In Figure 10, the predicted PV output is mainly distributed from 9 am to 2 pm.During the period of 1 am-3 am and 10 pm-12 am, the photovoltaic output does not meet the minimum output constraint of the unit, and its photovoltaic consumption can be ignored.In the rest of the time, under the coordinated scheduling of the ESS, the PV consumption rate is maintained at a high level, with an average consumption rate of 97.83%, which is 9.24% higher than that before the demand response, and thus it can be seen that the double-layer wind and solar consumption strategy proposed   International Transactions on Electrical Energy Systems in this paper is of great signifcance for renewable energy consumption.
Table 6 shows that the load-side demand response can increase the consumption rate of wind and solar energy, and on this basis, the optimized scheduling strategy proposed in this paper can further increase the consumption capacity of wind and solar.
In addition, Table 7 compares the optimization results of each objective function before and after demand response in HPSOFA, MOPSO, MOFA, and the actual scheduling situation.
As can be seen in Table 7, the overall cost of the microgrid system decreases after the inclusion of demandside response.Te system economic and environmental costs are relatively high when the optimal dispatching strategy is not performed.In addition, the improved HPSOFA proposed in this paper has signifcant advantages over the classical optimization algorithm in terms of operating and environmental costs.

Conclusion and Discussion
In this paper, a multiobjective optimization strategy of double-layer wind and solar consumption based on the improved HPSOFA is proposed for the optimal operation of microgrid system, which mainly focuses on renewable energy consumption problem and economic and environmental optimization dispatching problems of microgrid, and the conclusions of the analysis are as follows.
(1) A demand response model based on a comprehensive satisfaction assessment mechanism is established in the upper-layer optimization strategy of renewable consumption, and the upper-layer optimization of wind and solar consumption problem is verifed by example analysis that the fuctuation of electric load is smoother after demand response, and the fexibility of energy dispatch of each unit is improved.(2) According to the classical MOPSO, MOFA proposes an improved hybrid HPSOFA optimization algorithm.By simulating and analyzing multiple test functions, the comparison concludes that the improved HPSOFA has a better optimizationseeking capability and verifes the robustness and applicability of the HPSOFA.(3) Considering the economic and environmental indicators of the microgrid system, the improved hybrid HPSOFA is used to solve the multiobjective optimal dispatching problem of a microgrid system in a region of Liaoning Province, China, and the optimal solutions obtained by diferent algorithms are compared, and fnally it is verifed that the day-ahead dispatching results obtained by HPSOFA are more economic and environmentally friendly.
Trough this study, we found some current problems, including the limitations of the proposed algorithm in practical applications.In addition, we also discussed future research, and the specifc problems and the content of future research discussion are as follows: (1) Te prediction of power data has always been a difcult problem in the power feld.Among them, the forecast power of wind power and solar power generation is included, and the power consumption forecast on the demand side is also one of the important factors to ensure the safe operation of the microgrid.Te multiobjective optimization strategy proposed in this paper is based on the existing power data, which indicates that the future power data cannot be predicted.In order to apply the optimization strategy proposed in this paper, future power data can only be obtained by other methods, which also leads to the limitation of this method in practical application.(2) In future research, we will consider adding a forecasting mechanism for wind and solar energy, which will make better use of our proposed wind and solar energy scheduling algorithm.In addition, in this study, we mainly considered the operating cost and environmental cost.In real applications, there are more infuencing factors to be considered, such as the uncertainty of renewable energy, the reliability of energy supply, and other factors.

Figure 3 :
Figure 3: Comparison of electricity load before and after DR.

Figure 9 :Figure 10 :
Figure 9: Comparison of wind energy consumption before and after DR.

Table 1 :
Specifc parameters of the test function.

Table 3 :
ART evaluation index.

Table 4 :
Specifc parameters of the generator set.

Table 6 :
Comparison of wind and solar consumption rate.

Table 7 :
Comparison of target costs for optimal scheduling.