Abstract
Connecting microgrids has some benefits such as operation cost reduction and increasing sales revenue of their owners. To exploit these benefits, an energy management system with diverse and efficient capabilities is required. In this paper, a multi-layer system has been proposed to improve the energy management system in multi-microgrid systems. The purpose of the multilayer system is to optimize the cost of energy supply for the producer with the ability to activate one or more layers to improve the energy management system. Layers are modules that may contain the data required for optimization, like generation volume, load consumption, and operational plan. The appropriate mathematical model of the proposed seven-layer structure is used to optimize the operation cost of the multi-microgrid system. To verify the performance of the energy management system, the proposed method is implemented by GAMS and MATLAB software and the results are analyzed for a sample multi-microgrid system.
Keywords
Introduction
Microgrids are building blocks of the future smart grid and facilitate entering a lot of distributed generations (DGs) into the conventional power systems. Some DGs are renewable with intermittent output power which is highly dependent on weather conditions. The variable and uncertain power generation will greatly affect the performance of the network. So, using an energy management system (EMS) is necessary to manage variability and reduce the negative effect of renewable energy resources (RESs).
Demand-side management, coordinating interactions between generation and demand in a power system and using energy storage systems (ESSs) have been used in some researches to improve the energy management system (Strbac, 2008; Zafirakis et al., 2013). Along with the benefits such as avoiding power outages due to the high cost of power supply at peak times, the energy management system can prevent load congestion at peak hours on the demand side (Albadi and El-Saadany, 2007). Demand response program has been used in a multi-objective optimization system with considering flexible and inflexible load in a microgrid. In the above optimization problem, non-homogeneous objective functions has been used, showed that energy exchange with the main grid, carbon dioxide emissions, and operation cost in the microgrid has been reduced (Karimi and Jadid, 2020). A similar study was performed by the Augmented Epsilon constraint method in (Sohrabi Tabar et al., 2017) with considering air pollution and operation cost as an objective function. Microgrid cost optimization based genetic algorithm has been used in a paper with considering shiftable and adjustable loads in demand response program and shows it is economically very suitable for microgrid operator, the households and plug-in electric vehicles owners participating in the program (Sabzehgar et al., 2020). A three-level home energy management system is suggested in paper (Mehrjerdi, 2019) and it is shown that the energy cost of the system is reduced. In this paper, the energy exchange level with the network, resource exchange level including renewable, and diesel generator and energy exchange level with buildings have been used to manage diesel generator operation, charge and discharge status of energy storage, and energy exchange between levels. In Morsali et al. (2017), the impact of customer satisfaction on residential consumer programs has been studied. It has been shown that interacting with consumers to optimize energy consumption will indirectly affect social welfare, costs, and customer satisfaction.
Connecting autonomous Microgrids creates a multi-microgrid system which has some advantages like higher power quality and efficiency (Bagherian and Tafreshi, 2009; Choi et al., 2011). Also, the combination of microgrids can reduce the complexity of the whole system to manage a large amount of distributed generation (Lasseter, 2011). In Joung et al. (2017), an energy management system has been proposed to optimize the use of diesel generators and the operating cost of a microgrid.
Energy management in Sohrabi Tabar and abbasi (2019) has been used to overcome the high penetration of RES by the storage system. Also cost, pollution, and storage optimization are the objective function for this paper. To manage supply, demand, and power balance, an optimization method has been proposed based on game theory. In the proposed strategy, each microgrid should employ its own local strategies concerning the adjacent microgrid or the global network so that every buyer’s priority is using the adjacent microgrid energy capacity (Logenthiran et al., 2011). Day-ahead planning, instantaneous energy dispatching, and model predictive control are three major areas of EMS. In Zhai et al. (2017), a mixed-Integer programming energy management system has been used so that the energy planning method has been evaluated online for microgrids. Model predictive control has been used to optimally schedule microgrid include combined heat and power and renewable generation (Zhang et al., 2019). In this paper to coordinate its load mixed integer linear programming in a power management system has been used. In Ji et al. (2017), the tensile control method is described to reduce the complexity and volume of heavy transactions and to overcome the shortcomings of the centralized optimization. The proposed method uses a local market for microgrids so that the market announces the market point after interpolating the curve, aggregating all RES, demands and loads. In the distributed situation, each microgrid with constrained management plans increases its profits. By comparison, the benefits of centralized mode are greater in both islanding and grid-connected modes (Khavari et al., 2017). In Ding et al. (2013), EMS based on a multi-agent system has been proposed and Particle Swarm Optimization (PSO) method has been used to optimize the cost of microgrid operation. The EMS decides on the forthcoming schedule, including days or hours ahead, in the reference period of 48 hours, 24 hours and, 15 minutes (Cheah et al., 2011; Stluka and Godbole, 2011, Guan et al., 2010). In Shahryari et al. (2019), Karimi and Mohammadi (2019), multipurpose optimization models have been presented to reduce microgrid consumer costs. In Ross et al. (2015), the amount of transmission power to the main grid was modified. In this paper, the increasing complexity of nonlinear operations is one of its deficiencies. In Kang et al. (2017), a nonlinear optimization planning model has been developed to minimize the operation cost of multi-microgrid systems. This type of optimization can be attributed to mixed-integer nonlinear programming.
In this paper, an optimal multi-layer system is proposed to improve energy management and subsequently minimizing operating costs in single or multi-microgrid systems. Next Section outlines the general structure of the multilayer system. Then, the performance of each layer in the multi-microgrid multilayer system is described. This section presents the objectives of each layer and its functions and constraints. In the following, a case study is presented and the simulation result is shown on it. At the end, the conclusion section is presented.
Structure of the multilayer system
The suggested multi-layer structure of the multi-microgrid system is presented in Figure 1. Each layer is responsible for implementing one goal of the EMS. Layers can be activated as a stand-alone module for a microgrid or they can be applied as a regional/distributed pervasive tool for the other microgrids. All or part of the layers can be used in the optimization processes and objective functions regarding the requirements of the microgrid owners. Such a multi-layered hybrid design in the multi-microgrid system will be welcomed by both consumers and microgrid owners to minimizing operation costs.

Layers of multilayers hybrid systems in multi-microgrid.
Duty of hybrid multilayered in microgrids
Economic layer for consumer or supplier
This layer is designed to optimize the cost of energy supply. To implement this layer, a suitable mathematical model must be obtained, with high flexibility and accuracy. So, the mixed integer linear programming (MILP) method is used to plan the operation of the multi-microgrid system in the day ahead of schedule.
Equations of economic layers
The operation cost of microgrids includes DE fuel cost, maintenance costs, startup costs (hot start and cool start), unit exit costs (shut down and trips), reserve energy removal costs, renewable surplus removal costs, and the cost of removing the load (controllable and uncontrollable). The objective function to minimize the cost in this layer is expressed as equation (1).
Output1 is the cost of fuel consumption for all generating units in the multi-microgrid system as expressed in equation (2). The expression
The term output2 in equation (1) is related to the start-up cost and the output of the generation units whose details are expressed in equation (4). The first part is related to the start-up cost and the second part is related to the shutdown cost.
Starting units instantly after a shutdown or unit exit will be considered a hot start. Therefore, the costs associated with the stress applied to the equipment in the hot start process should be calculated separately from a cold start, as stated in equation (5a). According to equation (5b), if the unit stays out longer than the cooling process, the cost of a cold start should be considered. If a little time has elapsed since the unit shutdown (less than the time which is required to cool the unit), the cost of a hot start is assumed according to equation (5c). According to the equation (5d), the cooling time is assumed to be equal for all generation units of microgrids and their exit time will be part of unit cooling time.
Assumption 1: Minimum unit exit time will be part of unit cooling time.
Assumption 2: The cooling time of the microgrid units is equal.
The cost of the generation unit shut down and the trip can be formulated like equation (6). Therefore, the cost calculated of normal and planned exit is expressed as the cost of normal exit and when unit outages caused by the accident, it will be expressed as the cost of the trip.
Assumption 3: All units have the same trip cost.
The third part of costs in a multi-microgrid system includes maintenance costs (equation (7)). These costs may vary for different generation’s units.
According to equations (8) and (9a) if the amount of the energy generated from renewable sources exceeds the load demand, inevitably the consumption of this energy would have to be taken into account in the economic costs of energy supply. Equations (9b) and (9c) show the amount of solar and wind generation. In these equation, the “k” and “w” indexes represents the number of solar and wind units in each microgrid, which finally the total output of each resource will be obtained for 24 hour program.
Within hours ahead of schedule, diesel, and renewable resources may not be able to supply all loads. In this regard, the cost of removing the load corresponding to equation (10) is added to the operating costs. Reserve elimination cost is another part of the economic cost of the multi-microgrid system. This cost, according to equation (11) includes two parts: the cost of eliminating the upward reserve and the cost of eliminating the downward reserve.
Constraints for economic layers
Constraints in the economic layer can include start-up or shutdown of generating units, power generation capacity, ramp rate, minimum unit on-off time and related logistics, upward and downward reserve, and power balance constraints, which are derived in equations (12)–(20).
Constraints in the economic layer can include several equation. Each generation unit must be start and shutdown at a specified with logic considered in equation (12). Minimum and maximum limit for each distributed generation unit and total generation constraint for each microgrid are considered as equations (13a) and (13b) respectively. The minimum generation of diesel generation resources per microgrid will be constrain to generation limit of each unit as shown in equation (13c). Ramp down/up power limit for each generation unit at each microgrid is shown in equations (14) and (15). The constraints of equations (16) and (17) indicate that the status of the units remains constant at a specific time. In this case, the time for the unit to be turned on is denoted by
Up and down reserve power of diesel generator unit is limited to microgrid reservation constraint accordance with equations (18) and (19). Due to the above constraints, in order to maintain the power balance in the multi-microgrid system, equation (20) is established.
Protect and emergency layer
This layer is used when the generating units of a microgrid are not capable of supplying their own loads and the surplus capacity of adjacent microgrids would be used. This layer determines which microgrid should be exploited to maximize its generation. The cost of operating and transmitting power from the transmitting microgrid to the receiving microgrid should be added separately in equation (1). Of course, a specific microgrid can be connected to one or more adjacent microgrids as needed.
Objective function of emergency layers
The objective function of this section is shown in equations (21)–(23). In equation (21), the expression
Constraint for emergency layers
Upward and downward reserve constraint, power generation capacity constraint, and minimum on-off time of units and related logistics constraints are the same as previous scenarios in each set of microgrids. The only constraint to be addressed in this section is the actual power balance in the receiving and transmitting microgrids. The equations (27a) and (28) are considered for the receiving and transmitting microgrids, respectively. The cost of transferring power from the microgrid (m) to microgrid (n) will be in accordance with equation (27b).
Weather forecasting layer
Given the patterns of load in the past day, week, month, and year, the growth of load and the new conditions ahead, the impact of weather circumstances on a load of each consumer will be significant. This layer also creates an expert system with the help of weather forecasting information as well as with experimental data and values recorded at similar times. With the help of this layer, the information can indirectly and partially prevent the volume of switches, excessive and unnecessary start and shutdown of some resources and consumers within the framework of EMS. This layer is one of the input data for load and generation forecasting layers.
Control layer in multi-microgrid system
The control layer utilizes both centralized and decentralized control functions. From the hierarchical perspective of Figure 2, three types of controllers play the role of the master controller for EMS in a multi-microgrid set according to the current conditions. Centralized energy management by MCCU, using the local controller to replace the central controller (as a stand-by controller or SCCU), and self-controlling each microgrid (LCU) by the local controller are the control methods used at this layer. By activating the central control layer and executing the optimization program, the status of the main breakers (MPCC) and microgrids breakers (PCC1, 2...) is determined in such a way that the operating cost is minimized.

Relation between controllers in multi layers system.
Product forecasting layer
In this layer, with the help of fuzzy logic and fuzzy inference system, the generation rate of resources will be estimated annually, monthly, weekly, and daily proportion with the generation pattern. The EMS with the information that receives from forecasting systems can provide a predetermined program on the amount of generation available to the multi-grid users to improve energy management. Fuzzy rule and input data for this layer are described in section IV.
Load forecasting layer
Identifying the load side behavior and its pattern is also considered as one of the most important parameters in EMS. With the help of a fuzzy inference system (described in section IV) and using the pattern of consumption during different hours in one day as the fuzzy system input can estimate the amount of consumption in the forthcoming program.
Operation mode layer
Ingrid and stand-alone operation modes are selected based on the price of power transmission from the main grid. The best decision will be made about the mode of operation of the multi-microgrid system and how the PCC points will communicate with the grid or another PCC point in the mode of operation. The output of this layer determines the program for the 24-hour ahead operation modes of the multi-microgrid system.
Objective function for operation mode layer
This objective function in operation mode layer can be defined for each microgrid in the multi-microgrid system, individually in equation (29) as Output 10a. Also, accordance equation (30) it may be defined generally, following with output 10-b for the whole multi-microgrid system to be added to the equation (1).
Constraints for mode operation layers
The most important constraint in this layer is maintaining the active power balance (equation (31)) by adding the network power (
Case study for multi-layer system
To evaluate the performance of the system, the proposed method has been implemented on a five-zone multi-microgrid system shown in Figure 3. Zones one to three are considered as three microgrids. The fourth and fifth zones contain the storage system and loads, respectively. Parameters of the system are summarized in Appendix A. Load data announced in the program ahead of the multi-microgrid system are expressed in Figure 4.

Proposal microgrid system partition (zone by zone).

Total constant load consumption curve for micro M1, 2, 3.
Analysis and result
To investigate and compare the effect of each layer on the performance of the multi-microgrid system, they have been activated or deactivated for different scenarios. After the model implementation (GAMS Development Corporation, 2019), depending on the load situation, the amount of renewable energy generation, the share of diesel generator generation will be determined for each microgrid in the first layer. The amount of generation of diesel units for each microgrid is shown in Figure 5. MILP optimizer model is considered to achieve the lowest daily operation cost of microgrids. As can be seen, diesels have to supply part of the generation in accordance with the constraint set at different times of the day. In some hours there is no data because the renewable sources in this hour feed the load.

DG 24 hour generation curve in economic layer.
If we just consider fuel costs, startup costs and shutdown costs and ignore other costs, to optimize the cost of operation of the MILP model with enabling the emergency and economic layer, assume the power of generating units in steps of 5% downward and 2% upward. The cost of microgrids may increase in the emergency layer and in some capacities to meet surplus power consumption, they will be used to their maximum potential. But the relationship between maximum output power increasing isn’t always directly related to the cost of generation.
Figure 6 shows the operation cost with enable economic layer. In this Figure at the initial maximum power, the cost of operating diesel units is $278.2. In the second step of the maximum power, it would be $283.6. Also shows that at 106% of maximum capacity, the best response for a multi-microgrid system is $275.7. This trend is also specified in Table 1. The first line of the Table 1 shows the maximum possible power of each DG in different stages. The amount of cost and power of each diesel in total of 24 hours in each step is expressed. According to Table 1 in this case the power output in the 24-hour program would be 50,364, 29,430, 18,836 W for DG1, 2, 3 respectively. Now by adding all another cost, the amount of generation of each unit as well, as multi-microgrid cost of operating is shown in Table 2. According to this Table, in the same situation at 106% of maximum capacity the cost is $421.

DG operation cost with enable economic layer.
Operation cost and generation for each DG with enable of economic/emergency layers (fuel/start/shutdown cost only).
Operation cost and generation for each DG with enable of the economic layer (consider all cost).
With enabling only economic layer, operation cost is $529.12 with enabling economic and emergency layers, the best answer is in the fifth step in the upward direction, at 110% of the initial maximum with the optimal answer in the 24-hour schedule equals $401.79. Figure 7 shows the cost of using the plan ahead when the two economic and emergency layers are active in the multi-microgrid system. In the active economic layer by adding to the cost of load shedding and the penalty of renewable elimination of the system operation the cost would be $529.12 as the optimal point in the 24-hour plan ahead. In this case, the amount of diesel generation will be 59,970, 34,397, 189,569 W for DG1, 2, 3 respectively.

Operation cost with enable economic and emergency layer.
Fuzzy rules are adjusted to make the best decision in the load estimation layer. In this case study, gas pressure and temperature are parameters that directly affect the amount of load in the program ahead. According to the case study and investigating the behavior of the parameters affecting the load, the fuzzy system adjusts the load coefficient to generate the output of the load estimation layer as shown in Figure 8. In the case of using the estimation layer, the weather forecasting layer, and the economic layer simultaneously, the cost of operating a multi-microgrid system will reduce in the program ahead.

Load factor in the fuzzy inference system related to the load estimation layer.
As can be seen in Figure 9, if the resource generation reduces, due to load shedding, the high cost will be imposed on a multi-grid system. To reduce this cost, we can increase the amount of generation but this will be limited by the limitation on the ceiling of generation. The best response in this situation can be found at rated power (pmax). At this optimal point, the total operating cost is $382.24. Table 3 shows the cost and resource output at the optimal and non-optimal point around the generation capacity in this situation. To use the capacity of the generation forecast layer, we need to determine the parameters affecting the renewables in the multi-microgrid system apply as input to the fuzzy system and then estimate the output using fuzzy rules in accordance with Appendix B. As shown in Figure 10(a), the estimated output value for a solar cell at a specific temperature range will increase with increasing radiation levels, and after crossing the appropriate temperature limit, the quality of solar cell generation will decrease.

Operation cost with enable economic and emergency and load anticipation layer.
Operation cost and generation for each DG with enable of load forecasting layer.

Fuzzy output for renewable source: (a) wind source; (b) solar source.
Similar conditions for wind power generation are shown in Figure 10(b). With increasing wind speeds above cut-in speeds, the amount of energy generated will increase by the relative density of the air, and this will increase the unit generating power until the cut-out speed is reached. The estimated generation value for different input conditions in this layer is shown in Appendix C. The simultaneous use of the three layers of generation forecast, economic, and load forecast layers has led to the operation cost of $410. It is possible to use the layer of operation modes with access to the main grid for each microgrid, individually or simultaneously, in the proposed scheme. The effect of the microgrid number 1 breaker (pcc1) on the operation cost can be studied based on Table 4. Considering the fluctuating purchase price of electricity from the grid at different times, running an optimization program at an hour ahead will determine the number of microgrids to be connected to the grid. With the simultaneous use of four layers of economic, operating modes, weather, and generation forecasting, the operation cost in this situation has reduced to $359.63.
Microgrid No. 1 communication breaker status (PCC1) with network and cost of energy supply per hour.
Finally, according to Table 5, the operation cost status of a multilayer system can be given when one or more layers are enabled or disabled. The activation of each layer within the energy management system has reduced some of the operating costs and the simultaneous activation of the multilayer has significantly reduced the cost of operating the multi-microgrid system. For example, if the production forecast layer, the weather forecast, mode operation layer along the economic layer are enabled, the operating cost will reduce to $359.63. Also when the economic layer, weather forecast layer, protection forecast layer, and control layer are active at the same time, the operation cost will reduce by 37.02% to $333.22.
Comparison of operating costs of the system using different layers capacity.
Conclusion
To minimize the daily operating cost of microgrids in the day-ahead program, a multi-layer system in a multi-microgrid system with one or more layers activation is proposed. This multilayer system is implemented in a multi-microgrid system with the help of the MILP optimization model. Activating or deactivating one or more layers will have a significant impact on the cost of operating a multi-microgrid system. As can be seen from the case study, when using the economic layer alone, the cost of operating the sample system is estimated by $529.12. When the economic layer, the weather forecasting layer, the load forecasting layer, and the generation forecasting layer are used concurrently, the operating cost of the multi-microgrid system is $361.64. Simultaneous use of control layers, generation forecasting alongside with the economic layer, weather forecasting and emergency layer have significantly reduced costs. In fact, activating multiple layers reduced the operation cost to $333.22 compared to the case where no layer was active (nearly 8.1% differences(. Enabling each layer enhances the energy management system’s ability to optimize the cost of energy supply. It is observed that by activating each of the layers and thus improving the energy management system, the operating conditions of the multi-microgrid system are provided in such a way that the operating cost of the program ahead will be minimized. Optimizing the cost of microgrid operation by the proposed method and applying different layers to the optimization, will significantly reduce the operation cost of the system in the day ahead programing in the multi-microgrid system.
Footnotes
Appendix
Forecasted output using fuzzy inference system for use in production estimation layer.
| Hour | Input Data1 T/I | Output Factor | PV Output anticipation | PV Output Calculation | Input Data1 P/S | Output Factor | Wind Output calculation | Wind Output anticipation | ||
|---|---|---|---|---|---|---|---|---|---|---|
| 9 | 26.5 | 280 | 0.542 | 512.5 | 945.7 | 6.1 | 1.01 | 0.76 | 2063.9 | 1568.5 |
| 10 | 27.1 | 330 | 0.947 | 1983.1 | 2094.1 | 7.4 | 0.99 | 0.86 | 4495.1 | 3865.8 |
| 11 | 28.3 | 345 | 0.948 | 2945.6 | 3107.2 | 8.1 | 1.02 | 0.9 | 5044.7 | 4540.3 |
| 12 | 28.9 | 347 | 0.969 | 3141.8 | 3242.3 | 9.8 | 0.99 | 0.91 | 10570.5 | 9619.2 |
| 13 | 29.5 | 349 | 0.978 | 2972.8 | 3039.6 | 7.2 | 1.01 | 0.85 | 5044.7 | 4288.1 |
| 14 | 31.2 | 351 | 0.986 | 2930.5 | 2972.1 | 8.7 | 0.97 | 0.9 | 3459.2 | 3113.2 |
| 15 | 32.1 | 340 | 0.958 | 2006.1 | 2094.1 | 7.9 | 0.96 | 0.87 | 5044.7 | 4388.9 |
| 16 | 31.8 | 329 | 0.926 | 2001.6 | 2161.5 | 6.6 | 0.92 | 0.80 | 4767.3 | 3813.8 |
Notation
Declaration of conflicting interests
The author(s) declared no potential conflicts of interest with respect to the research, authorship, and/or publication of this article.
Funding
The author(s) received no financial support for the research, authorship, and/or publication of this article.
