**2. Mathematical Modeling**

The basic structure of the microgrid is shown in Figure 1. The structure of the microgrid system includes wind power generation system (WT), photovoltaic power generation system (PV), energy storage system (ess), diesel generator (DG), and four power loads. Among them, as the micro power source of the main output unit in the microgrid, wind and solar power generation units use natural energy to generate electricity [16], which does not produce any pollutants but as natural resources, they also have their own limitations [17]. Restricted by natural conditions, randomness, volatility and intermittent characteristics have also become the inherent attributes and di fficulties of clean energy power generation [18]. As an important coordination part of the system, the battery energy storage system is mainly used to coordinate the supply and demand balance of the microgrid, which plays a role in cutting peaks and filling valleys and smoothing fluctuations [19,20]. The backup power supply is used as a supplement to the microgrid power generation unit to ensure that some important loads in the microgrid system can be continuously and uninterrupted in the event of an emergency. Finally, each distributed unit in the microgrid is controlled by the microgrid energy managemen<sup>t</sup> system to coordinate to form a unified system and maintain safe and stable operation.

**Figure 1.** Basic structure diagram of islanded microgrid.
