## 3 Design and Operation of Microgrids
### Components and Configurations of MGs  
A microgrid consists of several components that work together to provide a complete and reliable power supply to the consumers. Although it can be further detailed, the four basic components of a microgrid are illustrated in Figure 3.  
Distributed Energy Resources (DERs): DERs are the primary source of energy in MGs. They include RESs such as solar panels, wind turbines, and hydroelectric generators, as well as nonrenewable sources such as diesel generators. These resources provide the power required to meet the energy demands of the microgrid. As MGs continue to grow, managing these resources has become a complex task [21; 89]. Energy Storage Systems (ESSs): ESSs are used to store energy generated by DERs during off-peak hours or when there is an excess supply of energy. The stored energy can be used during peak hours or when the DERs are unable to generate enough power. ESSs are typically batteries or flywheels that can store energy in the form of electrical or mechanical energy, respectively [3; 28]. Power Electronics: Power electronics are used to manage the flow of energy between the DERs, ESSs, and loads. They include inverters, converters, and controllers that convert DC to AC power, and regulate the voltage and frequency of the power supply [90]. Power electronics are critical in ensuring that the microgrid operates efficiently and safely. Figure 3: Four basic components of a microgrid. Control Systems: Control systems are used to monitor and control the operation of the microgrid. They include software and hardware systems that manage the flow of energy and ensure that the microgrid operates within safe and reliable limits [3; 11; 16]. MGs can be configured in several ways, depending on their size, the types of DERs used, and the energy demands of the consumers. Here are the most common configurations of MGs:  
Grid-Connected Microgrids: Grid-connected MGs are connected to the main grid and operate in parallel with it. In this configuration, the microgrid can either import or export power to the main grid, depending on the energy demand and supply [9; 91]. Grid-connected MGs provide backup power during power outages and reduce the energy demand on the main grid. Islanded Microgrids: Islanded MGs operate independently of the main grid and rely solely on their own DERs and ESSs to meet the energy demands of the consumers. Islanded MGs are typically used in remote areas where there is no access to the main grid [92; 93]. Hybrid Microgrids: Hybrid MGs combine renewable and non-RESs to provide a reliable and flexible power supply. They typically use RESs such as solar panels and wind turbines as the primary source of energy and nonrenewable sources such as diesel generators as a backup [15; 94]. The advantages and disadvantages of each type of microgrid can vary depending on the specific implementation and the needs of the community it serves. Factors such as the availability of renewable energy resources, the reliability of the main power grid, and the cost of infrastructure investment can all play a role in determining the most suitable type of microgrid for a particular community. Table 1 compares the different types of MGs, focusing on their basic advantages and disadvantages.