# Optimal Scheduling of Microgrids Based on an Improved Dung Beetle Optimization Algorithm
## 5 Case Simulation
### Case Simulation with DR and Uncertainty of Wind and Solar Power
Figure 12 shows the comparison results of convergence curves considering DR and uncertainty, using IDBO for optimization. It can be seen that compared to the traditional scheduling model, which does not consider DR and uncertainty, this approach results in a significant reduction in the MG's daily total cost by CNY 58.28. This substantial cost reduction is mainly attributed to the flexible adjustment of the load curve by the DR and the uncertainty factors. The DR incentivizes users to reduce electricity consumption during peak time and increase consumption during valley and normal time, achieving a peak load \begin{table}
\begin{tabular}{c c c c c c c} \hline \hline \multirow{2}{*}{**Scenario**} & \multicolumn{2}{c}{**IDBO**} & \multicolumn{2}{c}{**DBO**} & \multicolumn{2}{c}{**GWO**} \\ \cline{2-7}  & **Avg Final** & **Standard** & **Avg Final** & **Standard** & **Avg Final** & **Standard** \\  & **Value/CNY** & **Deviation** & **Value/CNY** & **Deviation** & **Value/CNY** & **Deviation** \\ \hline
1 & 953.68 & 89.21 & 1312.24 & 114.3 & 1426.87 & 23.94 \\
2 & 988.25 & 92.3 & 1415.20 & 120.22 & 1433.31 & 27.85 \\
3 & 994.32 & 93.02 & 1361.79 & 124.91 & 1427.26 & 31.56 \\
4 & 962.88 & 91.25 & 1344.55 & 116.78 & 1428.45 & 26.51 \\
5 & 984.57 & 90.33 & 1422.31 & 119.85 & 1462.65 & 21.2 \\ \hline \hline \end{tabular}
\end{table} 
Table 11: Average final value comparison of different algorithms after 100 runs in different scenarios. Figure 11: Five PV and WT output scenarios after K-means clustering reduction. shifting, thereby reducing the operational pressure on the system. Meanwhile, the IDBO improves the system's economy and reliability through precise prediction and optimization scheduling of wind-solar output fluctuations. Figure 13 shows the output of the MG at the lowest total cost when considering DR and uncertainty of wind and solar power. Through the figure, it is proved that after the DR and uncertainty, the system's scheduling strategy becomes more flexible and intelligent. It can dynamically adjust the operating mode based on the characteristics of different periods, thereby improving the system's reliability and independence while ensuring economic efficiency. It can be seen that while the scheduling strategy of the MG remains consistent with Section 5.2, significant differences exist at the execution part. The most noticeable change is that the MG reduces its dependence on the grid, indicating that the system places greater use of DGs in the optimization scheduling process. By leveraging the DR and uncertainty, the MG is better able to coordinate its internal resources, reduce the need for electricity purchase from the grid, and, thereby, increase the system's independence and self-sufficiency. Furthermore, the activity level of the BESS is significantly enhanced in the optimized scheduling, particularly notable at 8:00 a.m. At this time, the electricity price remains in the normal time, and the PV output is relatively abundant, so the BESS actively utilizes the PV output to charge. This strategy not only reduces charging costs but also improves the consumption of RE, avoiding the waste of solar energy. Simultaneously, the discharging behavior of the BESS during peak time further mitigates the power supply pressure on the system, achieving a peak load shifting. Figure 12: Comparison of convergence curves considering DR and uncertainty.