Microgrid Operations Planning Based on Improving the Flying Sparrow Search Algorithm

: Microgrid operations planning is crucial for emerging energy microgrids to enhance the share of clean energy power generation and ensure a safe symmetry power grid among distributed natural power sources and stable functioning of the entire power system. This paper suggests a new improved version (namely, ESSA) of the sparrow search algorithm (SSA) based on an elite reverse learning strategy and ﬁreﬂy algorithm (FA) mutation strategy for the power microgrid optimal operations planning. Scheduling cycles of the microgrid with a distributed power source’s optimal output and total operation cost is modeled based on variables, e.g., environmental costs, electricity interaction, investment depreciation, and maintenance system, to establish grid multiobjective economic optimization. Compared with other literature methods, such as Genetic algorithm (GA), Particle swarm optimization (PSO), Fireﬂy algorithm (FA), Bat algorithm (BA), Grey wolf optimization (GWO), and SSA show that the proposed plan offers higher performance and feasibility in solving microgrid operations planning issues.


Introduction
Emerged microgrid technology will enhance the share of clean energy power generation, ensuring safe and stable functioning of the entire power system, maximizing the use of scattered power sources, and coordinating and optimizing control [1]. The microgrids can be considered an area's internal power system and an internal load that has power generation, transmission, and distribution capabilities to fulfill the dynamic load and power quality [2]. As a result, several countries have used it as a research focal point for power growth in the coming years [3]. Microgrid technology may not only improve the power supply quality in remote regions, e.g., mountainous locations, islands, and other areas [4], but it can also efficiently prevent large-scale power outages caused by accidents and disasters [5]. Furthermore, as clean energy power-generating technologies become more widely integrated, the composition and structure of power sources will become more complicated and diversified, causing challenges with reactive power balance and power quality across the entire power generation system [3].
Optimal operations planning for power supply systems would bring economic, safety, reliability, and low pollution, which is considered a microsystem [4,6] group composed of distributed a power supply, load, energy storage, control device system, and control device [7,8]. The traditional methods for a large power grid show a burden that suffers from greater computational complexity in its optimization [9,10]. Fortunately, the metaheuristic algorithm effectively deals with these issues of traditional optimization approaches for the optimal operation of large power grid systems [11,12].
Most metaheuristic algorithms are inspired by physical phenomena or natural species [13], e.g., the Firefly algorithm (FA) [14] and Sparrow search algorithm (SSA) [15] are from the behavior of finding prey and escaping threat or avoiding enemies. There are typical metaheuristic algorithms, such as Genetic algorithm (GA) [16], Particle swarm optimization (PSO) [17], Harmony search algorithm (HS) [18], Ant colony algorithm (ACO) [19], Bat algorithm (BA) [20], Grey wolf optimization (GWO) [21], and other evolutionary algorithms [22]. Scholars in several engineering domains are interested in metaheuristic algorithms because of the simple parameters, ease of understanding, and implementing procedures. The challenge is tackled by targeting optimization using a program that simulates a natural process iteratively.
A metaheuristic algorithm finds the best solution by allowing it to evolve naturally among populations of possible solutions. Because of the high chance of a successful search and the fast convergence speed, metaheuristic algorithms are increasingly used to solve complex engineering, healthcare, finance, and military issues [13]. The SSA [15] is a recent and excellent metaheuristic algorithm; it still faces the optimum local issue or can drop in the trap of the optimum local when dealing with complicated problems like the microgrid scheduling cycles problem.
This paper suggests a new enhanced SSA (ESSA) based on an elite reverse learning strategy and FA mutation strategies for optimal operations planning of microgrid schedule cycles with a distributed power source's optimal outputs to enhance the share of clean energy power generation and ensure a safe symmetry power grid among distributed natural power sources and stable functioning of the entire power system. The microgrid scheduling cycle running of the economy as the target and considering the differences of impact parameters, e.g., load demand, season, timesharing, and electricity price, is given as each unit's mathematical model in a power microgrid.
The contributions are highlighted as follows: • A new optimization method (called ESSA) is proposed based on the SSA by applying elite reverse learning and FA's mutation strategies.

•
The proposed ESSA's performance is evaluated by testing the selected benchmark functions.

•
The microgrid scheduling cycle running of the power microgrid is mathematically modeled as the economy as the objective function for the optimization planning problem.

•
The new proposed ESSA approach is applied to solve the microgrid scheduling cycle with the power source planning's optimal output and total operation cost.
The remaining paper is structured as follows. Section 2 presents the model description of the power grid problem. Section 3 proposes the ESSA and tests its validation and performance. Section 4 presents a case simulation on the power microgrid system to verify the effectiveness of the proposed ESSA. Section 5 concludes.

A Microgrid Optimizing Model
The requirement of the microgrid fulfils the dynamic load and power quality, efficiently preventing power outages that improve the power supply quality in isolated or remote regions [4]. A typical microgrid structure is composed of distributed power sources, such as mainly including wind turbines (WTs), photovoltaic (PV), energy storage systems (ESs), microturbines (MTs), fuel cells (FCs), and various parts of a load set, which is connected to the distribution network through the point of common coupling (PCC) voltage control of a grid [23]. In isolated island operation, the distributed power supply and generator set the microgrid load demands [24]. Figure 1 illustrates a typical microgrid structure schematic of distributed power sources. WT power generation has characteristics that the actual wind speed mainly determines the wind turbines' output. The characteristics output values have several factors of the wind turbine's output power related to the wind speed as a piecewise function modeled following the output power model: where v ci is the cut wind speed; v r is the rated wind speed; v co is the cutting wind speed; P x is the rated power of the fan; and A, B, C are the power characteristic curve parameters of the WT. PV power supply as the output power supply can be expressed as follows: where P pv is the output power value of the photovoltaic power supply; P rpv is the rated power value of the photovoltaic system; I F (t) is the actual illumination intensity at the sampling point t in the optimized operation; λ t is the power-temperature coefficient; T(t) is the ambient temperature value of the photovoltaic cell sampling point at time t; T sc is the temperature value under the standard test; and η pv is the output efficiency of the photovoltaic power supply.
ES is a kind of electric energy storage that plays peak-cutting and valley filling for the grid's load and ensures the system's continuous power supply. Power is electric energy storage that can charge and discharge for a short time, so the dispatching interval is not long. The electric energy storage model's relationship between the energy storage capacity and charge-discharge power can be expressed as follows: where P ES (t) is the energy storage capacity in period t; P EES,ch (t), P EES,dis (t), and η EES,ch , η EES,dis respectively, t time to charge and discharge power and efficiency; τ is the selfdischarge rate of stored energy.
MT is also called a miniature gas turbine that can be a small thermal generator with a power range of 25~300 kW, which uses natural gas, gasoline, and diesel. Its output power is controllable. Typically, the power output of a micro-gas turbine is related to the amount of fuel it uses, and the more fuel there is, the greater the power output. The mathematical model of the fuel cost of a micro gas turbine [15] is expressed as: where C MT (t) is the fuel cost of the miniature gas turbine in period t, $; c f uel is the price of natural gas, $/m 3 ; c f uel is set to 0.025 $/m 3 ; P MT (t) is the output power of the micro gas turbine in period t, kW; LHV is the low calorific value of natural gas, e.g., LHV is set to 9.7 kWh/m 3 ; and η MT (t) is the efficiency of the micro gas turbine in period t. The relation function between the output power of MT and the power generation efficiency in the experiment section is expressed as follows: FC is fuel cell power generation, which is a device that directly converts the chemical energy of the chemical reaction into electric energy with high efficiency. The power generation efficiency is much higher than other power generation methods, and it has broad prospects for application to microgrids. The fuel cost mathematical model of FC [16] is expressed as follows: where η FC (t) and P FC (t) are respectively the efficiency and output power of the fuel cell in the period of t. The relationship between the fuel cell power generation efficiency and output power according to empirical experience [17] is expressed as follows: An implementing microgrid needs to consider the safety grid and power balance under several constraints, consisting of the output power constraint of the. distributed power supply, the constraints of the unit generators climbing rate, and power interaction constraints. The load of the system in period t is expressed as a power balance equal constraint as follows: P load (t) = P WT (t) + P PV (t) + P MT (t) + P FC (t) + P ES (t) + u·P EX (t) (9) where P load (t) is the load of the system in period t; the power load is a system supply's output power as a vector P i (t) loads of WT, PV, . . . , EX, or i = 1.2 . . . n. The output power constraint of the distributed power supply is exppessed as follows: where P i,min ,P i,max are the minimum and maximum active power output of the i-th power supply.
The constraint of the unit climbing rate is: where P MT (t), P MT (t − 1) are the active power output of the MGT in periods t and t − 1 respectively; P FC (t), P FC (t − 1) are the active power output of the fuel cell in period t and period t − 1, respectively; and P max MT , P max FC are the upper power limit of the fuel cell and MGT under climbing constraints, respectively.
The power interaction constraints when the microgrid and large grid are connected are: (13) where P EX,min (t), P EX,max (t) is the minimum and maximum power exchanged between the microgrid and the large grid in the period of t.

Proposed ESSA Algorithm
This section presents an improved version of the sparrow search algorithm (ESSA) based on the elite reverse learning strategy and FA mutation strategy [14]. Before presenting the approach details, we will review the original algorithm of SSA [15].

Sparrow Search Algorithm
The sparrow search algorithm (SSA) is a swarm intelligence optimization algorithm based on sparrows' feeding and predator avoidance behavior [15]. It mainly simulates the process of the sparrow group foraging: the sparrow individuals who find better food act as finders, and the other individuals act as followers. Simultaneously, a certain percentage of the population is chosen to conduct reconnaissance and early warning. If danger is identified, they will give up food, and safety comes first. The position of individual sparrows is represented by the matrix below: where n is the number of sparrows and d is the dimension of the variable to be optimized. Then, the fitness values of all sparrows can be expressed by the following vector: where F(X), n are the fitness values of all sparrows, and the value of each row represents the fitness value of an individual and the number of sparrows. The finders are the discoverer responsible for finding food and guiding the entire population with higher fitness scores, and prioritizing obtaining food during the search. As a result, the discoverers can search for food over a much wider area than the participants. Once the sparrow detects a predator, the individual begins to sing as an alarm signal. It means when the alarm value is greater than the safety value, the finder will take the participants to other safe areas for foraging. In each iteration, the location of the sparrow finder is updated as follows: where X t i,j is the location of the sparrow finder; t is the current iteration; j = 1, 2, . . . , d is the dimension of the i-th sparrow in iteration t; iter max is the constant with the max iterations; α ∈ (0, 1] is a random number; R 2 (∈ [0, 1]) and ST ∈ [0.5, 1] represent alarm values and safety thresholds, respectively; Q is a random number that follows a normal distribution; and L is set to 1 if every entry of a dimensioned matrix is 1. When R 2 < ST, this means there are no predators around and the finder goes into extensive search mode; otherwise, if R 2 ≥ ST, this means that some sparrows have encountered danger with predators, and all sparrows need to quickly fly away for safety.
The lesser an entrant's energy, the worse their chances of foraging in the group as a whole. Some hungry newcomers are more inclined to flee to find more energy elsewhere. Entrants can always look for the finder during foraging, which can obtain food or forage around it. Some entrants may keep a close eye on the finders to boost their predation rate and compete for food. On the other hand, some entrants keep a closer eye on the finders if they notice that the good food discoverer will leave their current place to compete for food. If they win, they will receive the finder's food right away. The formula for the enrollees' position updates is as follows: where X worst is the worst position in the search space at the current moment; A + is a random variable that has a dimension d with each element randomly [1, −1]; and A + = A T AA T −1 . If i > n/2, it indicates the entrant i-th has a poor fitness value and is most likely to starve. About 10% to 20% are assumed to be danger aware of the sparrow population, which randomly generates the sparrows' initial positions. The sparrows at the edge of the group of the danger aware will quickly fly to the safe area to obtain a better position, while the sparrows in the middle of the group will move around randomly to get close to other sparrows. The mathematical model of the scout can be expressed as follows: where X best is the current global optimal location; β is a step size control parameter as a normal distribution of random numbers with a mean of 0 and a variance of 1; and K is the direction of sparrow movement as the step size control coefficient that is a random number ∈ [−1, 1]. The f is the fitness function of the optimization problem, where f i , f g , and f w are the current, global best, and worst sparrow fitness values, respectively; ε is the minimum constant to avoid zero division error. For simplicity, f i > f g means sparrows are at the edge of the group, when it is safe, X best , around the center; otherwise, f i = f g indicates that sparrows in the middle of the population are aware of the danger sparrows.

Enhanced Sparrow Search Algorithm-(ESSA)
Although having several advantages, e.g., easy implementation, local search ability, and faster convergence, still, whenever dealing with a complicated problem like the grid operation scheduling cycles, the SSA algorithm also encounters the issue of a weak global search capability or jumping out of the optimal local operation or vulnerability to a local optimum. The cause means the SSA algorithm efficiency is not stable. Reverse learning and mutation are effective ways in group distribution problems to solve these limitations of the SSA algorithm [6].

Elite Reverse Learning Strategy
For reverse solutions of total collection from the best fitness value of sparrows by the elite strategy, a reverse group learning process [25] and an elite learning strategy group [26] have merged into a new solution set, the solution set of the fitness value of the worst sparrows, forming a new solution set. For the d-dimensional search space, let S(x 1 , x 2 , . . . , x i . . . , x D ), and x i ∈ [a i , b i ], (i = 1, 2, . . . , d) is the forward solution of the problem. If a vector x is in the range [a, b], then the opposite sparrows of x in the d-dimensional space can be expressed as follows: The corresponding inverse vector as S x 1 , x 2 , . . . , x D , can be expressed as The inverse vectors of all the solutions in the optimization space are calculated, and the original forward solution set and the reverse solution set are regarded as a sort of fitness value according to the forward sparrow and the reverse sparrow as a whole. In the d-dimensioned solution space, sparrows with the best fitness value can be selected as a new optimization group through direct screening or other optimization strategies, making the sparrows in the optimization space quickly converge to the optimal solution's location. The original solution and reverse solution vectors of collection using the elite strategy generate new solutions with a specific rate to join the original solution and inverse solution set, thus obtaining the new optimization group. A new solution X inew is produced for the optimized mathematical form as follows: where Q 1 is the change factor for generating new solutions; D is the dimension of the solution space; R istar is the Euclidean distance between the optimal solution and the nearest solution to the optimal solution; and rand(−0.5, 0.5) is a random number between −0.5 and 0.5. After sorting the fitness values of the solution vectors in the new set, the 20% and d-dimension solutions X iWorst with the worst fitness values are eliminated to generate a new optimization group.

Firefly Algorithm Mutation Strategy
In the firefly algorithm (FA) [14], individual fireflies emit light, which acts as a signal to attract other individual fireflies. The FA shows several advantages of optimization processing that can be used for enhancing SSA's performance, e.g., search ability with its mutations, fast convergence, and fewer parameters easy to operate. A mutation strategy equation is one of the FA's characteristics used to hybridize SSA's updating formula in Equation (18), which generates new solutions as follows: where X best is the global optimal position of the current sparrow; β 1 is the step size control parameter; K∈ [−1, 1] is a random number; f i f g , and f w are the current fitness value, current global optimal fitness value, and current global worst fitness value; ε is a minimum constant to avoid zero division error; α ∈ [0, 1] is a step size factor; and rand ∈ [0, 1] is uniformly distributed random numbers.

ESSA Algorithm Evaluations
To verify the feasibility and potential of the proposed ESSA algorithm, we selected several specific test functions of the CEC2019 test suit [27]. The proposed ESSA algorithm is fully investigated through various benchmark functions that include multi-modals with high single-peak, high multi-peak, and low-dimensional multi-peak to test its performance. The selected test function set parameters are listed in Table 1.
We compared each of the two mechanisms of the elite reverse-learning (strategy 1) and FA mutation (strategy 2) with the original SSA and the ESSA (both strategies 1 and 2) in the average outcomes and executed time to verify their effect on the proposed ESSA. Table 2 depicts the comparison of average outcomes and executed time of each of the two mechanisms of elite reverse-learning (strategy 1) and FA-mutation (strategy 2) with the original SSA and the ESSA. For the high single-peak benchmark functions, the execution time of the ESSA is longer than the other strategy-applied algorithms. Still, its execution time is the same as the different methods for the multi-modals and dimension multi-peak.  Figure 2 shows the effective applied equation strategies of each of the two mechanisms of the elite reverse-learning (strategy 1) and FA-mutation (strategy 2) with the original SSA for the selected test functions. Strategy 1 of the elite reverse-learning could enhance the algorithm's exploiting ability as the local search. In contrast, strategy 2 of the FA-mutation makes more diverse solutions and increases the algorithm's exploring ability. The obtained results of the proposed algorithm are compared with the other methods in the literature, e.g., PSO [17], GA [16], FA [14], BA [20], GWO [21], and SSA [15] algorithms. The setting parameters for the algorithms in the experiment with the same condition and platform environment, e.g., population size N set to 30, maximum iteration times T is set to 500, dimension D of the test function, and upper and lower bounds u b and l b of the initial value are set according to the reference functions in Table 1. The PSO's weight parameter is set to 0.4 to 0.9; the factors of c 1 and c 2 are set to 1.7 [17]. The FA's randomization parameter α ranges in [0 to 1], attractiveness β 0 is set to 0.02, and the absorption coefficient γ is set to 0.7 [14]. The BA's frequency f min , f max is set to the range [0, 5], A 0 is set to 0.92, and α and γ are set to 0.9 and 0.98, respectively [20]. The GWO's coefficient of the prey and search wolf position vectors are initialized in the range [0, 1]; the variables of the arbitrary values r 1 and r 2 are set to drop from 2 to 0 over the iteration courses. The number of finders pNum and the number of the reconnaissance and warning sparrows sNum are both 20% of the population size [15].
The evaluation indexes of the comparable outcomes are the obtained mean and standard deviation values from the algorithms for the selected benchmark functions. The experimental results are an average of the obtained results of 30 independent runs for each benchmark function to avoid the contingency of the optimization results and prove the stability of the suggested algorithm, so the number of runs is set to 30. Tables 3-5 show the experimental data of the obtained results of the proposed algorithm compared with the other methods, e.g., PSO, GA, FA, BA, GWO, and SSA algorithms. It can be seen that the proposed algorithm produces the optimization results of functions, e.g., F1-F5, F8, and F10-F11, better than the other algorithms in terms of the optimization accuracy, and the optimization results of F1-F4 and F10-F12 of ESSA are significantly improved compared with the original algorithm.   To reflect the dynamic convergence characteristics of ESSA, the convergence curves of the algorithms for the selected benchmark functions are obtained. Figure 3 shows the comparison of the proposed ESSA convergence curves with the other algorithms, e.g., SSA, BA, GWO, FA, PSO, and GA, obtained on the selected benchmark functions. It can be seen from the convergence curve that ESSA is significantly better than the other algorithms in terms of the convergence speed and optimization precision. The compared results indicate that ESSA could be a potential method with a searching ability while ensuring the exploration ability without losing the diversity of the population and optimization stability.

Applied ESSA for Power Microgrid Operations Planning
The microgrid's mathematical model of optimal operation is established based on the total operation cost in a microgrid scheduling cycle [23,24]. The objective function by the mathematical modeling of a power microgrid is implemented to find out the feasible optimization area in the problem search space by applying the proposed ESSA. A flowchart of the ESSA for planning microgrid operations is shown in Figure 4.

The Objective Function
The objective function is modeled based on the lowest power generation cost (considering the sum-up of fuel cost, depreciation cost, maintenance cost, energy interaction cost, and environmental cost) in the grid optimization cycle. The output of the micropower supply is calculated according to the unit of the microgrid of the daily load curve and the wind-scene output curve with the time interval with the period. The operation parameters relate to each treatment cost and emission coefficient of various pollutants, and the time-ofuse price. The day of the time interval and year times is divided into 24 h periods (each optimization period is an hour) and 12 months.
The data values or curves of the wind speed and light solar intensity are found from the predicted weather forecast of a certain day and place. The active power's electricity price with the large power grid and the variable electricity price change synchronously within each optimization period. The mathematical modeling of a power microgrid in establishing microgrid optimization operation for the objective function can be expressed as follows: where F is the objective function; C 1 and C 2 are the power generation and environment deployed costs, respectively, in the optimization model; and ω is the weight variable (ω is set to 0.5 in the experiment). The power generation cost of a microgrid is distributed loads as follows: where µ = 1 for grid-connected operation; µ = 0 for off-grid operation; and C FC (t), C DP (t), C ME (t), C EX (t) are the fuel cost, investment depreciation cost, maintenance cost, and interaction power cost with the large power grid in the period of t, respectively. A microgrid development environment's conversion cost is calculated as follows: where C 2 is the cost of treating pollutants discharged from a microgrid; K is the serial number of pollutants discharged by each distributed power source; b k is the cost of treatment of class K pollutants, $/kg; and a i,k is the coefficient of class K pollutants discharged by the ith distributed power source, g/KWh. Figure 4 shows the flowchart of the ESSA for planning microgrid operations. It means that the proposed approach is applied to solve microgrid scheduling cycles with the power source's optimal output and total operation cost.

Microgrid Operations Planning
The main steps of the ESSA algorithm for planning microgrid operations are listed as follows: - Step 1. Input system model parameters of a microgrid operation, daily load and microgrid output curves, unit generating set, time-of-use electricity price, and various pollution cost treatment coefficients. - Step 2. Initialize population sparrows randomly, and calculate the fitness value of each sparrow by using the objective function. A new solution set is formed by selecting sparrows with the best fitness value from the total set of forward and reverse solutions and combining them into the solution set according to the elite strategy. Selected sparrows with the worst fitness value in the solution set are removed to form a new set of solutions. - Step 3. Rank the fitness to find the current best fitness individual and the worst fitness individual. Step 7. Check the termination condition, e.g., if it reaches max-iteration, repeat steps 2 to 6; otherwise, output the best outcome value and best sparrow positions.

Analysis and Discussion Results
The setting parameters for the algorithms in the experiment with the same condition and platform environment are set, e.g., population size N set to 30, maximum iteration times is set to 1000, a number of runs are set to 25. Table 6 lists the operating parameters of each unit of the microgrid system. The operational parameters are used as the inputs with the boundary search space in the microgrid issue. Figure 5 displays a scenario of the demand daily local load curves of the entire power system on the island.  The other parameters, e.g., the treatment cost, emission coefficient of various pollutants, and price of the microgrid, are shown in Tables 6 and 7, respectively. The cost of purchasing electricity from the large grid in the grid-connected state is lower than the cost of generating electricity from the microgrid in the trough, so electricity is purchased from the large grid. The consumption power to the large grid during peak load times and during peak load times to meet the load demand generates revenue for the microgrid. Table 8 lists the microgrid TOU price meter. In the microgrid, the battery is charged at the trough to satisfy the peak load demand. During peak loads, miniature gas turbines and fuel cells work at maximum power. The micro-grid is powered by battery discharge when it is off the grid. When the system generates excess electric energy, the battery is charged to ensure the system's continuous power supply.
The operation scenarios include grid-connected and off-grid operations impacted by year seasons, such as windy and solar light, rainy and dry seasons, or capacity facilities, such as load shift on long-term capacity planning based on historical data and load demand curves. Seasonal and daily complimentary features of energy resources express the powergenerating output as a per-unit value. The benchmark capacity, on the other hand, is expressed in terms of the installed capacity. Wind and solar PV power create yearly and seasonal outputs that are highly dependent on wind and solar resources. The outcomes of the proposed scheme of the ESSA are compared with the other schemes in the literature, e.g., the PSO [28], FA [29], and SSA algorithms. Table 9 shows the comparison of the outcomes of the proposed scheme of the ESSA with the other schemes in the literature, e.g., the PSO, FA, and SSA algorithms. It can be seen that the grid connection and off-grid optimization results from the proposed scheme products of the figure outperform the other schemes. Figures 6 and 7 show the typical daily and monthly recourse load outputs of a microgrid system.    Figures 8 and 9 compare the optimization results obtained by the proposed ESSA with the FA, PSO, and SSA schemes for planning schedule cycles for daily and monthly scales, respectively. The curve of the obtained optimization results from the proposed ESSA has a faster archived convergence speed than the other schemes, e.g., FA, PSO, and SSA, in the scenario of the objective function in optimizing the grid operation planning.    In general, the observed tables and figures of the compared results show that the proposed plan reduces the net loss of the power system and the consumption of fuel generation sets. Conserved energy sources meet the power demand, safety system protection constraints, and stable power microgrid system.

Conclusions
This paper proposed an enhanced sparrow search algorithm (ESSA) using elite reverse learning and Firefly algorithm (FA) mutation strategies for optimal power microgrid operations planning. The operations planning in the microgrid of the power system is significant not only in dispatch economic but also in balancing distribution symmetry power sources, including wind turbines, photovoltaic, energy storage systems, microturbines, fuel cells, and various parts of the load set. We verified the proposed ESSA performance of enhancing search accuracy and convergence speed by testing the selected benchmark functions and compared the testing results with the other methods in the literature. The mathematical model of optimal operations planning of the microgrid schedule was established based on the grid-connected and off-grid microgrids for a distributed power source's optimal output and total operation cost in a microgrid scheduling cycle. The mathematical operating model considered as the objective function was calculated for the optimization by applying the ESSA. The compared results show the suggested method is feasibile and effective with high precision and a fast convergence speed regarding its optimization ability and outstanding application prospects.