*6.3. Simulation Results*

In this paper, MATLAB R2019a is used for simulation and comparison of results. The response comparison of the microgrid system under di fferent algorithms is shown in Figures 8 and 9. It can be seen from Figure 8 that using the GWO algorithm to solve the optimization scheduling problem of the microgrid is faster than the standard PSO algorithm, and it is easier to obtain the optimization results. Figure 9 shows the comparison of the parameter space of the two algorithms. It can be seen from Figures 8 and 9 that GWO has a faster convergence speed, and it is easier to obtain optimization results, and there is no local optimal situation in the figure. Table 4 shows the standard and average solutions of GWO are better than PSO, and compared with the PSO algorithm, GWO does not show the worst solution with a large deviation from the optimal solution. Its standard deviation is also much smaller than the standard deviation of PSO. As seen in Figure 8, GWO convergence speed is faster than PSO, it is not easy to fall into the local optimal, obtaining the global optimal solution is faster, the result is better, and the e fficiency of the algorithm is higher.

**Figure 8.** A comparison between algorithms.

**Figure 9.** The parameter space of the two algorithms.


**Table 4.** Simulation Results of Test System Error.

The simulation results of the algorithm are better than PSO, which verifies that this paper is e ffective in optimizing the scheduling of microgrid system with GWO, and has superiority in convergence speed and optimization results compared with PSO.

### *6.4. Analysis of Optimal Dispatching Results of Microgrid*

In Section 5, the optimized scheduling strategy proposed in this paper is presented, and the optimized scheduling strategy of microgrid with multiple time periods is used to divide the optimized scheduling strategy into 6 scenarios. In this part of the study, the output of each group of equipment in these 6 scenarios will be demonstrated, and the costs and pollutant emissions in each scenario will be compared.

Scenario 1 will determine whether the battery energy storage system needs to be charged when the power generated by WT and PV can meet the load demand. When the battery is in a su fficient state of charge and does not need to be charged, the power output of WT and PV is limited by abandoning wind and light. The predicted and the actual wind and solar values at each moment in Scenario 1 are shown in Figure 10. Under the condition of the Load1 which indicates the normal load size, the best output under constraints in Scenario 1 is shown in Figure 11. It can be seen from the figures that when the wind and solar resources are su fficient, while the ess system does not need to be charged, and the load demand is not large, the output of WT and PV can meet the load demand, so it does not need to run the diesel generator.

In Scenario 2, it is carried out under the same normal load demand as in Scenario 1 while the battery has insu fficient power and needs to be charged. It is necessary to further determine whether the wind and solar power generation has excess power after supplying the load to charge the battery, Scenario 2 shows that there is excess electric energy to charge the ess, so the ess is charged after the load demand is met. The predicted wind and solar values are the same as shown in Figure 10. The best output of WT and PV under constraints in Scenario 2 is shown in Figure 12.

**Figure 10.** The predicted and actual value of WT and PV in Scenario 1.

**Figure 11.** The best output under constraints in Scenario 1.

**Figure 12.** The best output under constraints in Scenario 2.

It can be found in Figure 12 that part of the wind and solar power generation capacity can charge the ess when the load demand is not large, which can consume more clean energy and the ess plays a role in the coordinated control of the system.

Scenario 3 shows that when the load demand is not large and the energy storage system needs to be charged, but if there is no excess electric energy to charge the energy storage system, the output of WT and PV only needs to meet the power supply demand of the load. The predicted and the actual wind and solar values at each moment in Scenario 3 are shown in Figure 13. Under the condition the best output under constraints is shown in Figure 14.

**Figure 13.** The predicted and actual value of WT and PV in Scenario 3.

**Figure 14.** The best output under constraints in Scenario 3.

Different from the first three scenarios, scenarios 4–6 are carried out when the load demand is large. In Scenario 4, the wind and solar power generation is insufficient to meet the load demand, so it is necessary to determine whether the ess can discharge to give the load power supply, when ess does not have enough power to power the load, then need to start the diesel generator to power the load. Figure 15 shows the predicted and the actual wind, solar and DG power at each moment in Scenario 4. Figure 16 shows the best output under constraints.

**Figure 15.** The predicted and actual value of WT, PV and DG in Scenario 4.

**Figure 16.** The best output under constraints in Scenario 4.

In Scenario 5, the load demand is large but ess has energy storage to supply power to the load and WT, PV and ess can meet the load demand. In this scenario, the predicted output value and actual output power of the scenery are shown in Figure 17, the best output under the conditions is shown in Figure 18.

**Figure 17.** The predicted and actual value of WT and PV in Scenario 5.

**Figure 18.** The best output under constraints in Scenario 5.

Scenario 6 is the last scenario of the study, and it is carried out under the condition of large load demand like Scenarios 4, 5, but at this time, ess has no electrical energy to power the load, so it is necessary to start the diesel generator to meet the load demand. The predicted wind and solar values are the same as shown in Figure 15. The best output of WT and PV under constraints in Scenario 6 is shown in Figure 19.

**Figure 19.** The best output under constraints in Scenario 6.

Under Load2, the wind power, PV power generation and energy storage systems can no longer meet the system load demand. The diesel generator in the system must be started, in order to make up for the power shortage of the system. The operating conditions are closely related, that is, there is a minimum output power and an optimal output power. In addition, the charge and discharge state of the ess under Load 2 is switched more frequently. From Figure 15, it can be seen that the diesel

generator reaches full-running state from 19 to 20 o'clock. Compared with Load1, the consumption of wind power and photovoltaic power generation is higher under Load2 conditions, so the total cost is higher than the total cost under Load1. However, as Load2 requires more energy, making wind power and photovoltaic power generation so the energy utilization rate is also higher.

The comparison of the optimized scheduling results in 6 different scenarios is shown in Figure 20 and Table 5. As can be seen in Figure 20, when the load demand is larger, the utilization rate of clean energy is also higher, but from Table 5 it can be seen that the larger the load demand, the higher the total cost of the microgrid system, and the more environmental pollution emissions caused by starting the diesel generator. Among these 6 different scenarios, Scenarios 1, 3, and 5 are more ideal scenarios. In our daily life, diesel generators are often used to supply power to the load, so the emission of polluting gases is inevitable. The environmental cost of the system will increase accordingly. The comparison of optimized scheduling results in 6 different scenarios is shown in Figure 20.

**Figure 20.** The comparison of optimized scheduling results in 6 different scenarios.



Table 5 shows the comparison of the system optimal scheduling results under 6 different scenarios. As can be seen from the table, when the load demand is large, the system's total power generation is the largest, but the total cost is also the highest, because the diesel generator is started. Therefore, the emission of polluting gas is also the most, so the cost of environmental governance will increase. However, on the other hand, due to the increase in electrical energy required, the utilization rate of renewable energy has reached a maximum of 92.96%, reducing wind and light, and the battery energy storage system has also played a role in cutting the valley and filling the peak effect.
