## 2 MG Concept and Requirements  
### MG Structure  
MG, according to the definition proposed in the introduction to the paper, includes DER, which can be RE as conventional resources, ESS as an infrastructure of energy market contribution, or AS in the absence of DER, loads, and finally a breaker at the point where MG connects to the main grid. This collection of elements has two modes of operation, specifically, grid-connected and islanded mode. In grid-connected mode, they receive services or provide services for the main grid, whereas in islanded mode, they should be able to manage all control, stability, and protection requirements. Achieving these characteristics requires a smart structure for MG, and its elements should be developed with these requirements in mind. It is noted that the penetration and integration of smart MGs should be in the form of tiles facilitating the implementation of SG. Figure 1 is a visualization of this idea, where MG structure meets the conceptual model of SG. SG has seven sectors [28]: Customer, Service Provider, Transmission, Distribution, Bulk Generation, and Market. Adapting the MG structure to SG structure, while the role of generation, transmission, distribution, operator, and consumer is clear, as can be seen in Figure 1, the maintainer acts as a service provider and the aggregator is in the market domain. The performance of each entity is clarified here. * **MG Aggregator**: This participant is in charge of gathering information about energy marketing participants for MG.
* **MG Operator**: This party monitors MG and controls its performance through local and remote services. * **MG Maintainer**: This agent is responsible for the accurate performance of MG by providing maintenance services in case of failure according to the received reports. * **MG Controller**: Aggregator, Maintainer, and operator interact through this part with each other and DER, facilitating the Energy Management System (EMS) control level. * **Local Utility**: Local utility is the MG utility neighbor who connects to MG through the Point of Common Coupling (PCC) and interacts with MG to coordinate the provision of AS in grid-connected mode. As well as embedding MG in SG domain, Figure 1 conveys a hierarchical control strategy of smart MG by introducing three supervisory levels, namely advanced metering interface (AMI), EMS, and DMS. * **AMI**: The first control level is related to load control. In this paper, this control level is considered in the scope of MG. Energy consumption of smart appliances is monitored through smart meters and the AMI control level is responsible for sending this information to the higher level, which is EMS. AMI makes it possible to cooperate with RL in load shedding, peak shaving, and other services. * **EMS**: The second control level of MG is EMS, which is responsible for control demand and supply in MG based on information receives from DER, ESS, and loads. EMS has a key role in MGMS and provides a schedule for each MG element operation through the optimization algorithm in both grid-connected and islanded modes of MG. EMS decides MG contribution in AS provision for the utility grid in a way that determines the contribution portion of each source. * **DMS**: The third control level is responsible for the control, monitoring, and reliability of the distribution network. This supervisory control level reveals when MG will be able to work in grid-connected and supply loads from the main grid or provide AS for utility and, in case of any failure in MG, it will disconnect from the main grid. There could be several MGs in DMS territory as shown in Figure 2.  
The hierarchical control level of MG can be implemented through a centralized or decentralized approach. In the centralized approach, each element receives setpoints from a central controller and follows a global objective, while in decentralized approach decision making in each level control is distributed.