## 2 Background of Microgrids
### Benefits and Challenges of MGs  
One of the key benefits of MGs is their ability to improve the reliability and resilience of the energy system. This section elaborates on how MGs achieve enhanced reliability and resilience through various mechanisms. MGs mitigate the risk of a single point of failure by distributing energy generation and storage across multiple sources. In traditional centralized grids, a disruption in one location can lead to widespread blackouts. In contrast, MGs can isolate specific areas and continue to provide electricity even if the main grid experiences an outage. This capability is particularly valuable in critical infrastructure facilities such as hospitals, military bases, and data centers, where uninterrupted power supply is essential. MGs have the ability to operate in \"island mode\" during emergencies or when intentionally disconnected from the utility grid. By leveraging local generation and storage resources, MGs can continue to provide electricity to connected loads even if the main grid fails. This grid independence enables MGs to support crucial services during natural disasters, severe weather events, or other disruptions. The ability to isolate and operate independently enhances the resilience of the energy system and reduces dependence on external sources. Islanding refers to the ability of an MG to operate autonomously and independently from the main power grid. MGs are mainly designed to detect disruptions in the utility grid, such as power outages or faults, and swiftly disconnect from the grid to operate in island mode. When disconnected, the MG relies on its local energy resources, including generation and storage, to meet the energy needs of connected loads. The ability to seamlessly transition into islanding mode ensures a continuous power supply to critical loads during grid disturbances [31; 63; 80; 81]. Islanding provides an additional layer of resilience and reliability to the energy system. In the event of a major grid failure or natural disaster, MGs can continue to function independently, supplying electricity to critical facilities such as hospitals, emergency response centers, or water treatment plants. By isolating from the main grid, MGs are less vulnerable to widespread outages caused by cascading failures or external disturbances, ensuring the continuity of essential services. Islanding enables MGs to have greater control over their energy management. When operating independently, MGs can optimize the use of available energy resources based on local demand, renewable energy generation, and storage capacity. This flexibility allows MGs to prioritize renewable energy utilization, reduce reliance on fossil fuels, and optimize energy generation and consumption patterns without the constraints imposed by the main grid. Once the main grid is restored, MGs can seamlessly transition from island mode back to grid-connected operation. The reconnection process involves synchronization with the utility grid's voltage and frequency levels to ensure a smooth and safe transition. The ability to synchronize and seamlessly reconnect to the main grid allows MGs to benefit from grid-supplied electricity, import or export surplus energy, and participate in grid services such as ancillary services or demand response programs. Islanding enhances energy security and independence by reducing reliance on the main grid. MGs can deploy local energy resources, including renewable energy generation and energy storage, to meet their energy needs. This reduces vulnerability to external disruptions such as fuel supply interruptions, grid failures, or geopolitical factors that may affect centralized energy systems. By diversifying energy sources and promoting local generation, MGs contribute to a more resilient and self-sufficient energy infrastructure. Islanding is particularly valuable in remote or off-grid areas where extending the main grid is logistically or economically challenging.