# Optimal Scheduling of Microgrids Based on an Improved Dung Beetle Optimization Algorithm
## 5 Case Simulation
### Case Simulation Without DR and Uncertainty of Wind and Solar Power  
To verify the proposed method, a basic MG system was selected as a simulation case study. The MG system includes MT, DE, PV, WT, BESS, and grid connection, without considering the uncertainty of wind and solar power output and the impact of DR on load. The parameters of DGs are listed in Table 4. The pollutant treatment coefficients for the MT and DE are shown in Table 5. The parameters of BESS are shown in Table 6, and the time-of-use pricing is shown in Table 7.  
energy sources are environmentally friendly, their operation costs are usually higher. In contrast, when an MG primarily relies on fossil fuels (such as gas and diesel), the fuel costs may be lower, but environmental costs significantly increase due to the large amount of pollutant emissions from the combustion of fossil fuel. Figure 6: _Cont._  
Figure 8 shows the output of the MG at the lowest total cost without considering DR and the uncertainty of wind and solar power, illustrating the output strategies of different DGs. The BESS charges actively during the valley time. By charging the battery at low electricity prices, the system prepares for the high demand in peak time. During the normal time, the BESS output fluctuates slightly, indicating that the system discharges based on electricity prices and load demand to meet the load. During peak time, the output power of the battery significantly increases, indicating that the system utilizes stored energy to supply power during high-demand periods. This aligns with the basic strategy of energy storage systems: charging when electricity prices are low or there is excess generation, and discharging when electricity prices are high or during peak load. Figure 6: Results comparison of different test benchmark functions. (**a**) Result of \(F_{1}\); (**b**) result of \(F_{2}\); (**c**) result of \(F_{3}\); (**d**) result of \(F_{4}\); (**e**) result of \(F_{5}\); (**f**) result of \(F_{6}\); (**g**) Pareto front of ZDT 1. Figure 7: Pareto fronts. The PV output is nearly zero during the valley time due to the lack of sunlight, but it gradually increases between 6:00 a.m. and 8:00 a.m., reaching higher generation levels between 2:00 p.m. and 4:00 p.m. This is related to the intensity and duration of sunlight, and as the sun sets, the output of the PV system drops quickly, which fits the typical characteristics of solar systems. The WT output exhibits significant fluctuations, as wind power generation largely depends on wind speed. In the morning, when the wind speed is low, WT output is minimal, whereas during the evening and midnight, as wind speed increases, WT output increases. The MT and DE have lower output during the valley time, as electricity prices are lower and the system tends to reduce fuel consumption, maintaining a low output. During the normal time, the output of the MT and DE gradually increases, meeting the load and maintaining a stable supply. During peak time, in response to high demand, the MT and DE are activated to provide backup or peak-load power, leading to a significant increase in their output. The grid interaction power fluctuates with changes in electricity prices. This indicates that the system is charging or purchasing cheaper electricity during the valley time to release the stored energy during peak time. During peak time, the power shows bidirectional fluctuations, indicating that the system has both the time to purchase electricity from the grid and the time to feed surplus electricity back into the grid. This dynamically balances the relationship between load and generation, which helps maintain the stability of the MG system. To further validate the performance of IDBO, GWO and DBO were selected for comparison with IDBO. The simulation experiments used an optimization step of 1 h, with a 24 h period as the optimization cycle. The minimum total cost was set as the objective function.