**1. 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

**Citation:** Nguyen, T.-T.; Ngo, T.-G.; Dao, T.-K.; Nguyen, T.-T.-T. Microgrid Operations Planning Based on Improving the Flying Sparrow Search Algorithm. *Symmetry* **2022**, *14*, 168. https://doi.org/10.3390/sym14010168

Academic Editors: Youcef Gheraibia and Yunlong Shang

Received: 6 November 2021 Accepted: 13 December 2021 Published: 15 January 2022

**Publisher's Note:** MDPI stays neutral with regard to jurisdictional claims in published maps and institutional affiliations.

**Copyright:** © 2022 by the authors. Licensee MDPI, Basel, Switzerland. This article is an open access article distributed under the terms and conditions of the Creative Commons Attribution (CC BY) license (https:// creativecommons.org/licenses/by/ 4.0/).

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:


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.

#### **2. 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.

**Figure 1.** 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:

$$P\_{wt}(v) = \begin{cases} 0, & 0 \le v < v\_{ci} \\\ A + Bv + Cv^2, & v\_{ci} \le v \le v\_r \\\ P\_{\mathbf{x}\_{\prime}} & v\_r \le v \le v\_{co} \\\ 0, & v\_{co} < v \end{cases} \tag{1}$$

where *vci* is the cut wind speed; *vr* is the rated wind speed; *vco* is the cutting wind speed; *Px* 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:

$$P\_{pv} = P\_{rpv} \frac{I\_F(t)}{800} [1 + \lambda\_t (T(t) - T\_{st})] \eta\_{pv} \tag{2}$$

$$T(t)a = 25.5 + \frac{I\_F(t)}{800}(T\_{\text{sc}} - 20) \tag{3}$$

where *Ppv* is the output power value of the photovoltaic power supply; *Prpv* is the rated power value of the photovoltaic system; *IF*(*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*; *Tsc* 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:

$$P\_{\rm ES}(t) = (1 - \tau)P\_{\rm ES}(t - 1) + \left[P\_{\rm EES,ch}(t)\eta\_{\rm EES,ch} - \frac{P\_{\rm EES,dis}(t)}{\eta\_{\rm EES,dis}}\right]\Delta t\tag{4}$$

where *PES*(*t*) is the energy storage capacity in period *t*; *PEES*,*ch*(*t*), *PEES*,*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:

$$\mathcal{C}\_{MT}(t) = \frac{c\_{fuel}}{LHV} \cdot \frac{P\_{MT}(t)}{\eta\_{MT}(t)} \tag{5}$$

where *CMT*(*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; *PMT*(*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/m3; 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:

$$\eta\_{MT}(t) = 0.0753 \left( \frac{P\_{MT}(t)}{62} \right)^3 - 0.3095 \left( \frac{P\_{MT}(t)}{65} \right)^2 + 0.4174 \left( \frac{P\_{MT}(t)}{65} \right) + 0.1068 \tag{6}$$

*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:

$$C\_{FC}(t) = \frac{c\_{fuel}}{LHV} \cdot \frac{P\_{FC}(t) \cdot t}{\eta\_{FC}(t)} \tag{7}$$

where *ηFC*(*t*) and *PFC*(*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:

$$
\eta\_{F\text{C}}(t) = -0.0023 P\_{\text{FC}}(t) + 0.6735 \tag{8}
$$

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) + \nu \cdot P\_{EX}(t) \tag{9}$$

where *Pload*(*t*) is the load of the system in period *t*; the power load is a system supply's output power as a vector *Pi*(*t*) loads of *WT*, *PV*, ... , *EX*, or *i* = 1.2 ... *n*. The output power constraint of the distributed power supply is exppessed as follows:

$$P\_{i,min} \le P\_i(t) \le P\_{i,max} \tag{10}$$

where *Pi*,*min*,*Pi*,*max* are the minimum and maximum active power output of the *i-th* power supply.

The constraint of the unit climbing rate is:

$$|P\_{MT}(t) - P\_{MT}(t-1)| \le P\_{MT}^{\max} \tag{11}$$

$$|P\_{\rm FC}(t) - P\_{\rm FC}(t-1)| \le P\_{\rm FC}^{\rm max} \tag{12}$$

where *PMT*(*t*), *PMT*(*t* − 1) are the active power output of the MGT in periods *t* and *t* − 1 respectively; *PFC*(*t*), *PFC*(*t* − 1) are the active power output of the fuel cell in period *t* and period *t* − 1, respectively; and *Pmax MT* , *Pmax 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:

$$P\_{EX, \min}(t) \le P\_{EX}(t) \le P\_{EX, \max}(t) \tag{13}$$

where *PEX*,*min*(*t*), *PEX*,*max*(*t*) is the minimum and maximum power exchanged between the microgrid and the large grid in the period of *t*.

#### **3. 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].

#### *3.1. 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:

$$X = \begin{bmatrix} \mathbf{x}\_{1,1} & \mathbf{x}\_{1,2} & \dots & \dots & \mathbf{x}\_{1,d} \\ \mathbf{x}\_{2,1} & \mathbf{x}\_{2,2} & \dots & \dots & \mathbf{x}\_{2,d} \\ \vdots & \vdots & \vdots & \vdots & \vdots \\ \mathbf{x}\_{n,1} & \mathbf{x}\_{n,2} & \dots & \dots & \mathbf{x}\_{n,d} \end{bmatrix} \tag{14}$$

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:

$$F(X) = \begin{bmatrix} f([\mathbf{x}\_{1,1} & \mathbf{x}\_{1,2} & \dots & \dots & \mathbf{x}\_{1,d}]) \\ f([\mathbf{x}\_{2,1} & \mathbf{x}\_{2,2} & \dots & \dots & \mathbf{x}\_{2,d}]) \\ \vdots & \vdots & \vdots & \vdots \\ f([\mathbf{x}\_{n,1} & \mathbf{x}\_{n,2} & \dots & \dots & \mathbf{x}\_{n,d}]) \end{bmatrix} \tag{15}$$

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:

$$X\_{i,j}^{t+1} = \begin{cases} X\_{i,j}^t \cdot \exp\left(\frac{-i}{a \cdot inter\_{max}}\right) & \text{if } R\_2 < ST\\ X\_{i,j}^t + Q \cdot L & \text{if } R\_2 \ge ST \end{cases} \tag{16}$$

where *X<sup>t</sup> 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*; *itermax* 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:

$$X\_{i,j}^{t+1} = \begin{cases} \begin{array}{c} \mathcal{Q} \cdot \exp\left(\frac{X\_{\text{uvr}s1}^t - X\_{i,j}^t}{\bar{r}^2}\right) \\\ X\_P^{t+1} + \begin{vmatrix} X\_{i,j}^t - X\_P^{t+1} \end{vmatrix} \cdot A^+ \cdot L & \text{otherwise} \end{array} \tag{17}$$

where *Xworst* is the worst position in the search space at the current moment; *A*<sup>+</sup> is a random variable that has a dimension *d* with each element randomly [1, −1]; and *A*<sup>+</sup> = *A<sup>T</sup>AA<sup>T</sup>*−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 ge<sup>t</sup> close to other sparrows. The mathematical model of the scout can be expressed as follows:

$$X\_{i,j}^{t+1} = \begin{cases} \begin{array}{c} X\_{\text{best}}^{t} + \beta \cdot \left| X\_{i,j}^{t} - X\_{\text{best}}^{t} \right| \\\ X\_{i,j}^{t} + \mathcal{K} \cdot \left( \frac{\left| X\_{i,j}^{t} - X\_{\text{worst}}^{t} \right|}{(f\_{i} - f\_{w}) + \varepsilon} \right) & \text{if } f\_{i} = f\_{\mathcal{S}} \end{array} \tag{18}$$

where *Xbest* 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 *fi*, *fg*, and *fw* are the current, global best, and worst sparrow fitness values, respectively; *ε* is the minimum constant to avoid zero division error. For simplicity, *fi* > *fg* means sparrows are at the edge of the group, when it is safe, *Xbest*, around the center; otherwise, *fi* = *fg* indicates that sparrows in the middle of the population are aware of the danger sparrows.

#### *3.2. 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].

#### 3.2.1. 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 *<sup>S</sup>*(*<sup>x</sup>*1, *x*2,..., *xi* ..., *xD*), and *xi* ∈ [*ai*, *bi*], (*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:

$$\mathbf{x} = \mathbf{a} + \mathbf{b} - \mathbf{x} \tag{19}$$

The corresponding inverse vector as *<sup>S</sup><sup>x</sup>*1, *<sup>x</sup>*2,..., *<sup>x</sup><sup>D</sup>*, can be expressed as *xi* = *ai* + *bi* − *xi*. 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 *Xinew* is produced for the optimized mathematical form as follows:

$$X\_{inner} = X\_i \times Q\_1 \tag{20}$$

$$Q\_1 = R\_{istar} \times \frac{rand(-0.5, 0.5)}{D} \tag{21}$$

where *Q*1 is the change factor for generating new solutions; *D* is the dimension of the solution space; *Ristar* 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 *XiWorst* with the worst fitness values are eliminated to generate a new optimization group.

#### 3.2.2. 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:

$$X\_{i,j}^{t+1} = \begin{cases} \begin{array}{c} X\_{\text{best}}^{t} + \beta\_1 \cdot \left| X\_{i,j}^{t} - X\_{\text{best}}^{t} \right| + a \cdot \left( rand - \frac{1}{2} \right) \\\ \qquad X\_{i,j}^{t} + K \cdot \left( \frac{\left| X\_{i,j}^{t} - X\_{\text{worst}}^{t} \right|}{\left( f\_{i} - f\_{w} \right) + \varepsilon} \right) \end{array} & \text{if } f\_{i} = f\_{\text{\\$}} \end{cases} \tag{22}$$

where *Xbest* is the global optimal position of the current sparrow; *β*1 is the step size control parameter; *K*∈ [−1, 1] is a random number; *fi fg*, and *fw* 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.

#### *3.3. 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.


**Table 1.** Selected benchmark functions.

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.

**Table 2.** Comparison of average outcomes and executed time of each of the two mechanisms of the elite reverse-learning (strategy 1) and FA-mutation (strategy 2) with the original SSA and the ESSA (strategies 1 and 2).


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.

**Figure 2.** 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 in different problem dimension spaces.

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 *ub* and *lb* 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 *fmin*, *fmax* 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.

**Table 3.** Obtained optimization results comparison of the proposed ESSA with the PSO and GA for the benchmark functions.


**Table 4.** Obtained optimization results comparison of the proposed ESSA with the FA and SSA for the benchmark functions.



**Table 5.** Obtained optimization results comparison of the proposed ESSA with the BA and GWO for the benchmark functions.

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.

**Figure 3.** *Cont.*

**Figure 3.** *Cont.*

**Figure 3.** Comparison of convergence curves of seven algorithms obtained on the selected benchmark functions, e.g., F1–F4 and F11–F12.

#### **4. 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.

**Figure 4.** Flowchart of the ESSA for planning microgrid operations.

#### *4.1. 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:

$$\min F = \omega \times \mathbb{C}\_1 + (1 - \omega) \times \mathbb{C}\_2 \tag{23}$$

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:

$$\mathbf{C}\_{1} = \sum\_{t=1}^{T} \left[ \mathbf{C}\_{\rm FC}(t) + \mathbf{C}\_{DP}(t) + \mathbf{C}\_{\rm ME}(t) + \boldsymbol{\mu} \cdot \mathbf{C}\_{\rm EX}(t) \right] \tag{24}$$

where *μ =* 1 for grid-connected operation; *μ =* 0 for off-grid operation; and *CFC*(*t*), *CDP*(*t*), *CME*(*t*), *CEX*(*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:

$$\mathbf{C}\_2 = \sum\_{t=1}^{T} \sum\_{k=1}^{K} b\_k \left( \sum\_{i=1}^{N} a\_{i,k} \cdot P\_i \right) \tag{25}$$

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; *bk* is the cost of treatment of class *K* pollutants, \$/kg; and *ai*,*<sup>k</sup>* is the coefficient of class *K* pollutants discharged by the *i*th distributed power source, *g/KWh*.

#### *4.2. Microgrid Operations Planning*

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.

The main steps of the ESSA algorithm for planning microgrid operations are listed as follows:


#### *4.3. 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.


**Table 6.** Operating parameters of each unit of the microgrid system.

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.


**Table 7.** Pollutant treatment costs and emission coefficients.

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.

**Table 8.** 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.

**Table 9.** Grid-connected and off-grid operation optimization results.


**Figure 6.** Typical daily recourse load outputs of a microgrid system.

**Figure 7.** Typical 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.

**Figure 8.** Comparison of the optimization results obtained by the proposed ESSA with the FA, PSO, and SSA schemes in daily schedule cycles.

**Figure 9.** Comparison of the optimization results obtained by the proposed ESSA with the FA, PSO, and SSA schemes in monthly schedule cycles.

Figures 10 and 11 show the daily load and the microgrid component-distributed power sources' output curves of grid-connected and off-grid optimization.

**Figure 10.** The daily load and the microgrid component-distributed power sources' output curves of grid-connected and off-grid optimizations.

**Figure 11.** The daily load and the microgrid component-distributed power sources' output curves of off-grid optimizations.

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.
