Abstract
Considering the characteristics of distributed power in microgrid, in order to maximize the advantages of distributed power generation technology in economy, environment, and energy, a multiobjective dispatching model of microgrid is proposed under the condition of satisfying system constraints and considering the operating costs and environmental costs of microgrid. The crow search algorithm (CSA) has the advantages of less parameter setting, simple implementation, and strong optimization ability and is often used in theoretical analysis and practical engineering applications. However, its disadvantage is that crows only search for candidate solutions according to their own experience, and their development ability is poor, especially for solving highdimensional functions. In order to overcome these shortcomings, an improved crow search algorithm (CSAPSO) is proposed based on the particle swarm optimization (PSO) algorithm. The two main improvements are as follows: (1) in order to avoid the blind selection of crow in search, the global optimal solution is adopted to modify the solution search equation to guide the search of new candidate solutions, so as to improve the development ability; (2) introducing a levy flight strategy to improve the single search mechanism of the CSA. In order to verify the performance of the CSAPSO algorithm, 17 benchmark functions are simulated with other intelligent algorithms. The results show that the CSAPSO algorithm has a good optimization effect in search accuracy, convergence speed, and robustness. Finally, this algorithm and other five algorithms are applied to the optimal scheduling problem of microgrid. By solving the objective function, the optimal scheduling output scheme of each distributed power supply is obtained. By using the CSAPSO algorithm, the total operating cost of microgrid is reduced by at least 21.5%, which further verifies the effectiveness of the CSAPSO algorithm.
1. Introduction
Due to environmental problems and energy crisis, renewable energy and other distributed energy sources are developing rapidly all over the world. However, due to the intermittency and uncertainty of renewable energy output power, largescale distribution power generation connected to the grid presents many challenges such as power quality and system stability [1]. The emergence of microgrid brings new and effective technologies to solve the current problems. Microgrid is a new type of distributed energy organizational structure, which is considered to be an effective platform for integrating renewable energy, enabling the renewable energy system to access the distribution network more conveniently, and realizing the integrated operation of distributed power generation to load [2–4]. As one of the core technologies of microgrid, optimal scheduling has laid a solid foundation for the development and promotion of microgrid, and has an important engineering value.
The solution of optimal scheduling of microgrid is essentially a nonlinear optimization problem with multiobjective and multiconstraint conditions [5, 6]. In view of the optimization scheduling problem of microgrid, scholars at home and abroad have carried out a lot of research work, and intelligent algorithms instead of traditional optimization algorithms are generally adopted recently. At present, common intelligent algorithms include particle swarm optimization [7], gray wolf algorithm [8], evolution algorithm [9], and selflearning discrete Jaya algorithm [10], which are widely used. It provides a new idea to solve the problem of microgrid operation optimization.
The crow search algorithm is a metaheuristic algorithm proposed by Iranian scholar A. Asarzadeh in 2016 [11]. The CSA shows good performance in multiobjective, multiconstraint, and nonlinear optimization, and its fitness function has few constraints, simple structure, simple coding, and fast convergence speed. Therefore, the CSA is widely popular in the optimal operation of microgrid. In the literature [12], the crow search algorithm is used to solve the optimal size and location of capacitors in the distribution network. The experimental results show that the CSA has more accurate solution than other search methods. Literature [13] applied the CSA to reactive power optimization scheduling problem, and the CSA performed better than the comparison algorithm in the test of a benchmark test system, successfully solving the reactive power optimization scheduling problem. Literature [14] uses the CSA to optimize conductor selection in a radial distribution network, and the experimental results show that the CSA performs better than the traditional optimization algorithm. However, the primary crow search algorithm has some defects compared with other swarm intelligence algorithms, including low search accuracy, high possibility of entering local optimum, and premature convergence, especially for multidimensional optimization problems. Many improvements have been made to overcome the shortcomings of the CSA [15–20]. In literature [15–17], the chaos theory is used to improve the master crow search algorithm, and it is used to solve multiobjective optimization problems. The above measures improve the optimization performance of the crow search algorithm to a certain extent, but all the improvement work is focused on the standard CSA based on single memory search mode. They did not take into account other searching behaviors in the crows’ intelligent behavior. When solving complex and highdimensional problems, there are still some defects such as slow convergence speed, low solution accuracy, and insufficient robustness. Literature [18] adds adaptive inertia weights to the original CSA position update mechanism. In the initial stage of the search, larger inertia weights can enhance the global search capability, while in the final stage, the reduction of inertia weights can enhance the local exploration capability, avoiding repeated jumps in position caused by oversearching, so that the crow can quickly move to the extreme value point. The test results show that the optimization performance and convergence speed of the improved algorithm are significantly improved. The test results show that the optimization performance and convergence speed of the improved algorithm are improved obviously. Literature [19] proposed a rough crow search algorithm (RCSA), which combined the CSA with rough search mechanism (RSS), which effectively solved the problems of inaccuracy and roughness of available information when searching for global optimal solutions of highdimensional optimization problems. When realizing optimization, the CSA was used to search for approximate solutions of global optimization problems, and then, RSS was introduced to improve accuracy. The test results show that the RCSA performs better in calculation accuracy. Literature [20] proposed a crow search algorithm (NICSA) based on neighborhood search of a noninferior solution set. This algorithm makes crows automatically select memory search mode or neighborhood search mode in the evolution process through the determinant of noninferior solution. Through this strategy, the local search and global search of the algorithm become more balanced. Function tests show that the algorithm is superior to the CSA in search accuracy and convergence speed.
To sum up, the ultimate purpose of many improved algorithms is to improve the search accuracy and global optimization ability of the algorithm, and speed up the convergence of the algorithm. In this article, an improved crow search algorithm (CSAPSO) is proposed based on the optimization mechanism of particle swarm optimization (PSO). The two main improvements are as follows: (1) in order to avoid the blind selection of crow in the search, the global optimal solution is adopted to modify the solution search equation to guide the search of new candidate solutions, so as to improve the development ability; and (2) the single search mechanism of CSA is improved by introducing the levy flight strategy to avoid falling into local optimum effectively.
This article is organized as follows: Section II “Problem Formulation” describes the objective function and power constraints. Section III studies different operation strategies of energy storage devices. Section IV discusses the improvement and verification of the algorithm and its application in microgrid. Finally, Section V “Conclusion” summarizes the research results of the study.
2. Microgrid Optimization Model
2.1. Distributed Generation Model
The structure of a microgrid generally consists of distributed energy sources, energy storage devices, controllers, and loads. In order to take full advantages of microgrid, scholars around the world have devoted significant efforts on the optimal operation of microgrid [21]. Microsources are divided into the following two types according to whether their output power can be controlled:(1)One is uncontrollable microsource such as photovoltaic cells (PVs) and wind turbines (WTs).(2)The other is controllable microsource including microturbines (MTs), internal combustion engine (ICEs), and fuel cells (FCs).
A typical microgrid system architecture is shown in Figure 1.
2.2. Objective Function
With the deepening of research, the decisionmaking of power generation scheduling changes from a single consideration of economic benefits to the consideration of the coordination between economic benefits and environmental protection, and thus. the objective function becomes a multiobjective problem, which is mutually restricted and coordinated between the two. The general model is shown in the following formula:where x is the optimization variable; F_{i} is the ith optimization objective; is the solution space of feasible solutions; and G(x) and H(x) are the constraints of the equality and inequality in the feasible region.
Based on the above general model, this article only considers the lowest economic cost and the best environmental benefit as the objective function, where the economic cost includes the fuel cost, operation and maintenance cost, and interaction cost with the main network; the environmental cost is the treatment cost of pollutants (CO_{2}, NOx, SO_{2}) emitted during the operation of the micropower source.where F is the total operating cost; F_{1} andF_{2} are the economic cost and environmental treatment cost respectively; and both ϕ and μ are taken as 0.5.•Objective function 1: Economic costswhere T is a dispatch period; N is the type of distributed power source; are the fuel coefficient and operation and management cost of each micropower, respectively; is the output power of the ith micropower source; are the electricity price at time T and the operation and management cost of the battery, respectively; and are the interaction power with the grid and the output power of the battery at moment t, respectively.•Objective function 2: Environmental costswhere is the cost of treatment of pollutant type; is the emission factor of pollutant category for the jth micropower source; is the output power of the micropower source; is the emission factor of pollutant type for the main grid; and is the output power of the main grid.
2.3. Constraints
(1)Power balance constraintwhere is the system load in the time period ; is the output power of each microsource; and is the interaction power with the main network.(2)Constraint on the power output of each micropower sourcewhere are the upper and lower limits of the output power of the micropower supply, respectively.(3)Power constraints between microgrid and main gridwhere are the upper and lower power limits for the interaction between the microgrid and the main grid, respectively; if, it indicates that the microgrid system can output power to the main grid.(4)Battery operating constraintswhere are the upper and lower power limits of the battery, respectively.
3. Improvement of Crow Search Algorithm
3.1. Principle of the Crow Search Algorithm
The CSA was proposed by an Iranian scholar A. Asarzadeh in 2016 [11]. Suppose there is Ddimensional search space, the number of crows is N, and the position vector of crow i in time in the search space determines , if and only if . And it stands when the maximum number of iterations is reached. Each crow hides its food and remembers the location of the food. Suppose that at the iteration, the crow wants to visit its hidden food location . And the crow decides to follow the crow to approach the crow’s food hiding place. At this point, the following two states may occur:•State 1: the crow is unaware that the crow is following behind, at which point the crow updates its position towhere is the random number between; is the distance flown by the crow in the th iteration; and is the location of the best food remembered by the crow in the th iteration.•State 2: The crow realizes that the crow is chasing it. In order to make the location of the hidden food undetected, the crow will find a random location to trick the crow.
In summary, states 1 and 2 are represented as follows:where represents the perceived probability.
3.2. Analysis of Defects in the Crow Search Algorithm
The CSA has the advantages of simple operation, few parameters, and strong search capability, but it lacks diversity and poorly developed performance when searching for candidate solutions based only on its own experience, which is especially obvious for the optimization of highdimensional functions, and the search is updated iteratively according to equation (10). Figure 2 shows the schematic diagram of the CSA search with the following limitations:
3.3. Basic Particle Swarm Algorithm
PSO is a metaheuristic algorithm first proposed by James Kennedy and Russell Eberhardt in 1995 for solving nonlinear optimization problems [7]. In PSO, we start with a random set of candidate solutions, called a “swarm” of particles. Each particle can be visualized as a point in a Ddimensional space, where D is the dimension of the candidate solution. Each particle then searches the space (and thus explores different possible solutions) based on its position and velocity. The motion of a particle is influenced by three components—its “momentum,” its optimal position (the position with the highest value of particle fitness, called the local optimal position), and the most suitable position for the particle (called the global optimal position). This facilitates the particles to move closer to the optimal solution. Figure 3 shows the schematic diagram of the particle swarm algorithm for finding the optimum.
The particle swarm algorithm is more capable of exploitation, and the new candidate solution is to find the global optimal solution by sharing information about itself and all particles within the population, and in the next iteration, the particles decide the next movement based on the guidance of the global optimal solution.
Suppose there is a Ddimensional space, the individual extremum of particle , the individual extremum of particle i is denoted as , and is the velocity vector of the particle i, that is, the distance the particle travels, is the global optimal position searched by the particle, and the particle adjusts its motion in the next step according to Equations (11)(12), thus continuously iterating toward the optimal solution.where V_{i} and X_{i} are the velocity and position of the particle, respectively; c_{1} and c_{2} are learning factors; r_{1} and r_{2} are random numbers between [0,1]; P_{besti} and P_{Gbest} are the individual optimal extrema and the global optimal extrema.
3.4. Principle of Improved Crow Search Algorithm
Through the above analysis of advantages and disadvantages of the CSA algorithm, in order to further improve the performance of the CSA algorithm, after knowing the mechanism of the particle swarm optimization algorithm, this article mainly discusses the improvements made by CSA: (1) to avoid the crow choice blindness during the search, each a crow in the search for the optimal solution, and the other partner’s information sharing in the population, thus in the global optimal solution found in the population as a whole has the optimal individual extremum, population according to the information update the raven iteration. We modify the solution search equation by using the global optimal solution to guide the search of new candidate solutions, so as to improve the development ability. The crow search algorithm retains the crow of the main features of the search algorithm, but the crow search algorithm and particle swarm are different obviously, improve the crow search algorithm for the solution to the old and new candidate solutions, and then save the better solution, and the particle swarm is not involved in the selection process. Secondly, the single search mechanism of the algorithm is improved by introducing the levy flight strategy. According to the random update strategy adopted by the standard crow search algorithm in state 2, in the case of no leader, it is possible to be around the poor solution when searching for an optimal solution, thus falling into local optimal. Based on this situation, the levy flight search strategy is introduced. Levy flight is a random walk process, which involves a large number of short walks at short distances, followed by long walks at long distances. Levy flight is applied to the swarm intelligence optimization algorithm, which ensures that individuals will not stay in the local range when they move by means of longdistance migration in the early stage of search, thus enlarging the search range and effectively jumping out of the local optimum. The algorithm tends to converge after the close walk.
3.4.1. Global Optimal Solution Guiding Search Mechanism
When the crow is in state 1, the new candidate solution for crow optimization is generated by moving the old solution toward (or away from) another solution randomly selected from the population. However, the probability of a randomly chosen solution being a good solution is the same as that of a randomly chosen solution being a bad solution, so the new candidate is not necessarily a better solution than the previous one. In this way, the algorithm will fall into the local optimum and fail to find the global optimal solution, while the PSO algorithm determines the next motion according to the guidance of the global optimal solution during particle iteration. Based on this idea, we modify the solution search equation by using the global optimal solution to guide the search of new candidate solutions, so as to improve the search ability. The update mechanism is as follows: where is the random number between[0,1]; is the global best position; denotes the flight distance of the crow in the th iteration; and denotes the position of the best food remembered by the crow j in the th iteration.
3.4.2. Levy Flight Strategy
When the crow is in state 2, it will randomly choose a new position to confuse the stalker, which may lead to blindness in searching for optimal direction in the absence of a leader. Based on this defect, the levy flight search strategy is introduced to replace random search. Levy flight is a random walk process, which contains a large number of short walk and long walk. Levy flight is applied to the swarm intelligence optimization algorithm, which ensures that individuals will not stay in the local range when they move by means of longdistance migration in the early stage of search, thus enlarging the search range and effectively jumping out of the local optimum. In the later stage, the close walk makes the algorithm tend to converge, and the improved formula is as follows: where is a random number in the interval (0,1); obeys a normal distribution; n is the dimension; a is the step size factor to be 0.01, and the constant is to be 1.5; and is the standard Gamma function.
In summary, the improved update formula is as follows:where is the random number between[0,1]; is the global best position; denotes the flight distance of the crow in the th iteration; and denotes the position of the best food remembered by the crow j in the th iteration;
3.4.3. Algorithm Flow
The CSAPSO algorithm flow is shown in Figure 4. The specific pseudocodes of the CSAPSO algorithm are as follows (Algorithm 1):

4. Experimental Simulations
In order to verify the effectiveness of CSAPSO, 17 benchmark functions from references [22–24] are tested in this article and solved with the crow search algorithm (CSA) [11], particle swarm algorithm (PSO) [7], gray wolf algorithm (GWO) [8], particle swarm genetic algorithm (PSOGA) [25], and integrated learning particle swarm algorithm (CLPSO) [26]for the 17 benchmark functions.
4.1. Baseline Functions
The sequence numbers, expressions, dimensions, search ranges, and theoretical optima of the 17 test functions are shown in Table 1. The test functions are diverse and can reflect the search performance of the algorithm more objectively, fairly, and comprehensively. The 17 benchmark functions can be divided into three types: (1) f_{1}∼f_{7} are singlepeaked highdimensional functions to study the search accuracy of the algorithm; (2) f_{8}∼f_{11} are multimodal highdimensional functions with many local extremes for testing the global search performance of the algorithm; and (3) f_{12}∼f_{17} are multimodal lowdimensional functions.
4.2. Analysis of the Results of CSAPSO Compared with Other Intelligent Algorithms
The parameters were selected by experimental comparison and are shown in Table 2. Also, for each test function, 3000 evaluations were performed and each algorithm was run independently 30 times. Four metrics, optimum, mean, worst, and variance, were used to measure the performance of the various algorithms, and the experimental statistics are shown in Tables 3 to 5.
From Table 3, it can be seen that CSAPSO has good performance for solving singlepeaked highdimensional functions, where for functions f_{1}, f_{2}, f_{3}, f_{4}, f_{5}, and f_{7}, it outperforms the other 5 intelligent algorithms in terms of both optimal, worst, mean, and variance values, with strong robustness. For function f_{6}, the PSOGA shows good performance, indicating that PSOGA is suitable for solving such function problems, whereas the CSAPSO algorithm is not effective for solving such problems. For the overall comparison, CLPSO has the worst overall performance, larger variance, weaker stability, and larger variance.
From Table 4, CSAPSO has good performance for solving multimodal highdimensional functions. CSAPSO easily finds its global optimum in solving two functions, f_{8}、f_{9} and f_{11}, and outperforms the other 5 intelligent algorithms in terms of optimum, worstcase, mean, and variance, and has good stability. In solving the f_{10} function, CSAPSO, although it can find the global optimum, the variance is larger compared to CSAPSO and slightly more unstable than PSOGA. Overall, CSAPSO has a clear advantage over the other 5 algorithms when it comes to such functions.
From Table 5, it can be seen that CSAPSO has the same good performance for solving multimodal lowdimensional functions, especially for functions f_{12}, f_{15}, f_{16}, and f_{17}, the mean, optimum, worst value, and variance are better than other intelligent algorithms. This shows that the search accuracy and stability of CSAPSO are better. And for f_{13} and f_{14}, CSAPSO is slightly lower than CLPSO in all aspects, but on the whole, CSAPSO has stronger search performance and robustness.
Figures 5 to 21 represent the optimal convergence graphs of the 6 intelligent algorithms for solving the 17 test functions. From Figures 5–21, it can be seen that CLPSO has the lowest convergence speed but the best search accuracy for the (f)_{13} and (f)_{14} functions, and the convergence speed of the other 5 algorithms subsequently varies with the test function characteristics. The PSOGA also has good convergence performance. However, for the other test functions, the search accuracy of CSAPSO is significantly higher than the other 5 algorithms except for the (f)_{6}, (f)_{13}, and (f)_{14} functions. Therefore, different algorithms have different advantages in terms of convergence speed, but CSAPSO has a more comprehensive advantage.
In summary, the optimal result statistics of each function are shown in Table 6.
It can be seen from Table 6 that for lowdimensional functions with 30 dimensions, CSAPSO shows better search results than 5 algorithms except for f_{6}, f_{13}, f_{14}. However, the PSOGA has a small solving effect for these three types of functions, indicating that it is suitable for solving such functions. However, in general, the algorithm proposed in this article is obviously higher than the other five algorithms in both search accuracy and convergence algorithm, thus demonstrating the superiority of the algorithm proposed in this article.
4.3. HighDimensional Function Tests
In order to verify the search performance of CSAPSO for highdimensional functions, 11 highdimensional test functions were also tested independently, including f_{1} to f_{11}. Meanwhile, the dimensionality has been changed from 30 to 50 and 100 dimensions for testing. The parameter settings of each intelligent algorithm are shown in Table 2. The optimal, worst value, mean, and variance of each intelligent algorithm are shown in Table 7.
As can be seen in Table 7, for highdimensional functions of 50 and 100 dimensions, CSAPSO shows better search results than the other 5 algorithms, except for f_{8}. For f_{9} and f_{11}, both CSAPSO and GWO searched for the global optimum, but for variance and mean, CSAPSO was more stable. For f_{8}, CSAPSO slightly underperformed PSOGA for 30, 50, and 100 dimensions, but CSAPSO outperformed PSOGA for best, mean, worst, and variance for the other tested functions. Thus, CSAPSO has better performance for higher dimensional functions.
4.4. CSAPSOBased Microgrid Energy Dispatch
4.4.1. Data Underlying the Algorithm
In this article, taking Guangdong as an example and based on the simulation platform, the specific parameters of each micropower supply are shown in Table 8. Pollutant discharge parameters are shown in Table 9, and output power of PV, WT, and load is shown in Figure 22. When connected to the grid, the price of electricity purchase and sale is shown in Figure 23.
4.4.2. Analysis of Results
In this article, the mathematical model is established with the objective function of the lowest economic cost and best environmental benefit, and the microgrid dispatching model is solved using PSO, CLPSO, CSA, GWO, PSOGA, and CSAPSO, and the output of micropower sources is shown in Figure 24.
As can be seen from Figure 24, PV and WT are clean energy, so they are always in full production state. FC has low generation cost, so it always gives priority to output. When the power generation cost of MT is lower than the power purchase cost from 8 : 00 to 22 : 00, MT outputs. If MT and FC are at the maximum output power, but still cannot meet the needs of the load, ICE output is considered to meet the needs of the load. BT at 1 : 00–5:00, when the electricity price is in the trough, it chooses to buy power from the grid and charge the battery for the excess. With the increase of electricity consumption, considering the price of electricity, it will help the power grid to discharge at 10 : 00–11 : 00, 16 : 00–22 : 00, and 23 : 00–00 : 00 to reduce the operation cost.
The comparison of the six intelligent algorithms adopts the same parameter setting for the test: particle swarm size is 50, and the maximum iteration number is 3000. The CSAPSO algorithm begins to converge at about 100 generations, whereas PSOGA, GWO, CLPSO, and other algorithms begin to converge at about 500 generations. It can be seen that the convergence speed of the CSAPSO algorithm is significantly higher than that of other intelligent algorithms. For the search accuracy of the algorithm, the specific optimization results are shown in Table 10. The results show that the CSAPSO can find a better solution while reducing economic cost and environmental cost. The total cost of the CSAPSO algorithm was $1789.9, which improved the economic benefit by 21.5% compared with the PSO algorithm with the worst optimization result. To sum up, the CSAPSO algorithm is superior to the other five intelligent algorithms in convergence speed and search accuracy, thus demonstrating the superiority of the CSAPSO algorithm. Figure 25 describes the convergence curves of six intelligent algorithms for economic and environmental costs. From these data, it can be seen intuitively that CSAPSO has better search ability and convergence speed than the other five algorithms in the optimal operation of microgrid.
5. Discussion and Conclusions
Based on the shortcomings of the crow search algorithm, this article proposes an improved crow search algorithm (CSAPSO) to understand the optimization mechanism of the particle swarm optimization (PSO). Major improvements are as follows: (1) in order to avoid the crows in the process of search blind choice, every raven when searching the optimal solution, to share information with other partners in the population, so as to find the global optimal solution in the population as a whole has the best individual extremum, according to the population information update crow iteration, so as to improve development ability; and (2) the levy flight strategy was introduced to improve the single search mechanism of CSA and effectively avoid falling into local optimum. The experimental results show that the algorithm is better than other swarm intelligence algorithms in search accuracy and convergence speed. At the same time, the algorithm is applied to energy dispatching of microgrid. Taking the lowest economic cost and the best environmental benefit of microgrid as the objective function, a mathematical model is established to reduce the total operating cost of microgrid by reasonably arranging the output of micropower. The validity of the algorithm is verified.
Data Availability
The data that support the findings of this study are available from the corresponding author upon reasonable request.
Consent
Not applicable
Conflicts of Interest
The authors declare that they have no conflicts of interest.
Authors’ Contributions
Zhao is mainly responsible for the experiments, Chen and Wen are responsible for organizing the data, and Zhang is responsible for writing. All authors have read and agreed to the published version of the manuscript.
Acknowledgments
This work was supported by the Foshan Scientific and Technological Innovation Team Fund, Project no. FS0AAKJ91944020062.