## 2 Background of Microgrids  
The immense and complicated electric power system is controlled by the power system organizations. Sharing a variety of renewable sources will continue to be the primary feature of utility grids, as has been in the past. The increased use of renewable energy sources (RESs) achieves global participation in electricity generation, and decreasing the dependency. The integration of RESs is becoming more important toward the distribution network due to the technological advancements and environmental concerns. MGs are small-scale local power systems that function inside larger distribution networks. MGs are gaining popularity because of their capacity to decrease environmental impact, increase energy stability efficiency, provide ride-through capability provided by energy storage, and to reduce consequences of sudden grid outages. RESs such as the wind, solar energy, and hydro are cost-effective in meeting their share of the energy requirement. In terms of power supply, microgrid technology offers significant possibilities in distant communities by improving local energy security. This technology plays a crucial role in enhancing energy security by minimizing the reliance on energy imports. The integration of renewable energy MGs with the utility grid eliminates the need for extra measures to regulate frequency. However, MGs face significant challenges, such as stability, bidirectional power flows, modeling, low inertia, the impact of load perturbations, and uncertainty. It is worth noting that the application of distributed generators (DGs) within MGs can sometimes create more issues than they resolve. MGs are advanced energy grids that incorporate renewable energy generation and storage technologies to ensure sufficient energy supply for meeting regional demand [1]. The MG system as a regulated power supply infrastructure utilizes the grid to connect various components such as loads, DG, energy storage devices, and power electronic converters. Unlike the traditional grid structure, the MG system operates independently as a standalone system. The external grid is linked to the MGs as a single control unit, responsible for self-regulation, protection, and management while meeting customer requirements for power quality and supply reliability. The MG system can either be connected to the grid or function as an isolated island. In practical terms, an MG represents a specific location where the management system oversees and controls the connection between DGs and loads, forming a smaller distribution grid. In this scenario, the regulation and control of DGs are achieved by the management system, which adjusts network structure or load capacity based on data collected, ensuring stability, adaptability, and reliability in the power supply of the distribution system. Additionally, RESs can be integrated into the MG system to reduce grid redundancy, resulting in higher economic benefits compared to traditional systems. This effectively guarantees the resilience of the power supply. In the case of a problem or security issue occurring in the grid, it solely impacts the MG system based on its location, without affecting the utility grid. There are two major ways that MGs are operated; the first is known as normal mode or grid-connected mode, and the second is known as islanded mode. In normal mode operation, power flows in both directions. By operating the MG in an islanded mode, isolation switches can prevent difficulties such as voltage dips, frequency drift, and other power quality issues. MGs can guarantee high power quality supply and easy switching between islanded and normal operation modes by using advanced control algorithms, as well as reducing or preventing the impact on key loads when the grid system fails [31]. MGs play a significant role in integrating DG, RES, and energy storage systems (ESSs). The development of infrastructure has been driven by the increasing penetration of RESs, enabling end users to generate, store, control, and manage a portion of their electricity needs.