(e) Search for Prey

Grey wolves mainly rely on the information of α, β, and δ to find their prey. In the process of searching for prey, keeping the search agen<sup>t</sup> away from the prey can make the grey wolf perform a global search. In formula (b), the C vector composed of random values in the interval range [0, 2]. The random search behavior of grey wolves can make the optimization results more accurate and avoid falling into local optimum. C is a random value during the iteration process. This coe fficient is helpful for the algorithm to jump out of the local area, especially the algorithm is particularly important in the later stage of the iteration.

After the microgrid obtains real-time information on the system status, it begins to execute the GWO. First, it sets the number of wolves and initializes the wolves, and then calculates the fitness value of each wolf. The top three are recorded as α, β, δ each wolf updates its position by calculating the distance from α, β, δ and finally outputs the global optimal solution, according to whether the maximum number of iterations is reached. Some of the previous optimization algorithms are prone to fall into the shortcomings of local optimization, slow convergence, and optimization of the microgrid. The flow chart in Figure 4 is the microgrid dispatching process combined with the GWO.

**Figure 4.** Flowchart for microgrid dispatching process combined with the GWO.

### **6. Case Study and Simulation Results**

Sanya is located south of the Tropic of Cancer and has a tropical monsoon climate characterized by high temperature and rain. All relevant data are obtained from the official website of the local

meteorological bureau. The annual average temperature is 26.7 ◦C. The highest temperature month is June with an average of 29.7 ◦C. The lowest temperature month is January with an average of 22.4 ◦C. The sunshine time of the year is 2534 h. The average annual precipitation is 1347.5 mm. Known as the "natural greenhouse".
