A comprehensive optimal energy control in interconnected microgrids through multiport converter under N (cid:0) 1 criterion and demand response program

Nowadays, the local distribution grids have been facing technical, economic, and regulatory challenges, because of the increased integration of renewable energy sources (RESs) and electrification of vehicles. The traditional solutions to the grid expansion, e.g., to build an additional power line, are utility-centered solutions, i.e., the distribution grid operators (DSOs) are the only party involved to tackle grid issues. The DSOs have to engage grid users with technology providers to develop innovative solutions that tackle one problem and overcome several cost-effectively. This paper presents a holistic solution to optimally control cross-sectoral energy flow between interconnected microgrids (MGs) consisting of different RESs, hydroelectric power plant (HPP) and wind turbines (WTs) to meet electric vehicles (EVs), residential, commercial and industrial demands with the main grid contribution. This issue will provide the advantages of community-based MGs for local energy trading which causes for an active and engaged system, however, an adequate control strategy for proper operation is required. The proposed solution is based on a new interconnection line between two MGs through a multiport converter (MPC) with the techno-economic consideration of newly installed components such as MPC, cables and the required battery energy storage system (BESS). The proposed case study is evaluated under three different conditions e.g., load increment, demand response (DR) and N-1 criterion in separate, interconnect and island modes. The CPLEX solver of GAMS software is employed to solve the mixed-integer linear programming model. The results show that the applied interconnection line for MGs compared to the separated operation mode can decrease the system ’ s total costs, reduce the applied peak to the upstream grid, and enhance the system ’ s reliability under different conditions. Furthermore, the applied solution provides the ability for MGs operation even in island mode under different conditions for a full day (24 h).


Introduction
The commitment to cut down CO 2 emissions has led to drastic changes in the global energy system, especially in the electricity sector, in which a significant amount of wind and solar plants have been installed, and in the transport sector, in which the electrification of vehicles is growing in an unprecedented way [1].In order to accommodate both changes, the local distribution grids have been facing not only technical but also economic and regulatory challenges.The traditional solutions to the grid expansion, e.g., to build an additional power line, have one feature in common: the distribution system operators (DSOs) are the only ones responsible for the grid reliability and voltage quality, and thus they are the only party being involved to tackle grid issues.The DSOs have to engage grid users together with technology providers in order to develop innovative solutions, which should not only tackle one problem at a time, but to overcome several problems in a cost-efficient way [2].
There are some projects that they focused mainly on one sector or one technical aspect without focusing on cross-sectoral energy flow, and thus cannot give a holistic view of the key issues concerned by the DSOs and the society at large.There is no one integrated modular technology solution that can interconnect different energy carriers.Consequently, the system design at the best falls into an optimal solution within one sector, and a cross-sectoral cost-optimal solution becomes almost impossible to achieve.In general, they have a strong focus on the market aspects of trading flexibility sources to the power grid by integrating a set of the existing mature technology.Hence, a real microgrids (MGs) case study consisting of hydroelectric power plant (HPP) and wind turbines (WTs) with different loads for optimal energy control has been considered in this paper and then a comprehensive tecno-economic solution to consider this gap is applied in the following two phases.
In the first phase, the case study is investigated in three modes, namely separated, interconnect and island modes.In separated mode, each part is considered as a single grid-connected MG, while there is not any path to connect MGs.However, in interconnected mode, MGs are connected to each other through an exclusive Multiport Converter (MPC).The MPC provides several outstanding advantages to the case study, e.g., enormous peak and cost reduction, energy resiliency and flexibility, and the ability to host extra equipment such as battery energy storage system (BESS) and Electric Vehicles (EVs).Finally, in island mode, the connection of the main grid to one of the MGs is interrupted for a certain amount of time (1 h and 24 h).
In the second phase, the case study is evaluated under three scenarios, load increment, N-1 criteria, and Demand Response (DR) strategy.In load increment scenario, the load demands increase up to 100% to evaluate the behavior of the system in sudden peaks in all three modes.In the second scenario, the capacity of the transformers reduces by 50% and reaches 28.5 MW in MG1 and 15.2 MW in MG2 because one of two parallel transformers connected to the main grid is interrupted to apply the N-1 criterion.It is noticeable that the N-1 criterion is not applied in island mode due to the lack of required power for loads.In the last scenario, a DR strategy is implemented for load shifting for energy management as well as cost reduction purposes.In this scenario, a percentage of load profile (maximum 10%) is allowed to shift within 24 h, hence, in high price hours the load moves to the time with the excess power of HPP and WT and/or low-price hours, and the peak demand is reduced considerably.To have a full vision of the present work, the applied scenarios in different modes are summarized in Table 1.

Literature review
Due to the next generation of power systems, smart grids provide bidirectional energy and information [3] between the supply and demand sides to have an active distribution system [4].Real-time monitoring [5], demand response programming [6], high energy efficiency, flexibility and reliability are some benefits of smart grids [7].As a part of smart grids, an MG involves renewable energy sources (RESs), energy storage systems (ESSs) and loads in a medium/low voltage (MV/LV) system [8,9].
An MG can exchange energy with other MGs, or the main grid based on the techno-economic situation [10] to have a flexible, secured, and efficient condition.Since energy management is one of the main challenges in power systems, various studies are persuaded to deal with problems in MGs [11,12].
From the main grid point of view, an MG is a controllable set that can act as a load or a power supply and it can serve a residential or commercial building, industrial land, university campus [13], or a small scale as a testbed lab [14].The produced power from sources, e.g., PV and WT units can optimally exchange energy with other MGs or the main grid [15] to minimize the operational cost of the system [16], provides optimal power sharing [17,18] capabilities and energy management in interconnected MGs [19,20] for peak-shaving, load-shifting, energy management and maximizing RESs integration [21].Controlling [22] and operation (grid-connected or/and island mode) are some of the main research areas in MGs [23].However, with the high-level penetration of variable RESs, some technical issues such as voltage and frequency constraints impact the levels of investment and dispatch in electricity generation and storage technologies [24].
The MGs interaction with the main grid is one of the main challenges in this area [25].Different strategies for MGs interaction with the main grid in normal condition have been proposed [26].Among them, a back-to-back converter (B2B) is an effective method for full control of bidirectional power flow between MGs and main grid [27].However, some challenges must be fulfilled for MGs interconnection [28].Hence, this paper proposes a new solution for MGs interconnection through a multiport converter (MPC).Instead of using several dc-dc converters and components, a single MPC with interfacing different sources, storages, electric vehicles (EVs) and loads can be used.An MPC converter has the advantages of requiring fewer components and having a lower cost more compact size and better performance.The interconnection of MGs, through an MPC, with a shared energy storage system is another interesting application for the MPC that could reduce or eliminate the uncertainty of RESs [29].

Paper contributions
This paper aims to map local abilities to manage variations in local generation and demand to improve local security of supply as well as to reduce the need for upscaling of cables and transformers as the local electricity generation and demand increase with a new interconnection between MGs.The operation cost of the system and investment of the new components such as cable, MPC and BESS as a mixed-integer linear problem formulation has been solved by executing CPLEX solver in GAMS software.The MPC links the electricity sector and the transport sector as well as the separate MGs also hosts different EVs (due to the various ports with different rated voltage and power) and BESS to facilitate local variation management during N-1 criterion and island condition.Local variation management also is provided by loads in both MGs, which provide a range of energy services, with the inherent ability of load shifting based on time of use (TOU) DR program due to the vehicle battery.
Specifically, the main contributions of this paper include the following points.

Paper organization
The rest of this manuscript is organized as follows; the Lilla Edet MGs case studies are described in Section 2. In Section 3, the problem formulations for the main grid, generation units (WT and HPP) and also BESS in different operation modes are presented.The different operation modes of MGs including, separate, interconnect and island capability are explained in section 4. The applied scenarios in different conditions of MGs including DR, N-1 criteria and load variation are explained in section 5.The results for three operation conditions (separate, interconnect and island) of MGs, including sizing for new components e.g, cables, MPC and BESS in detail are investigated in Section 6.Finally, the conclusion to confirm the work is examined in Section 7.

Lilla Edet MGs case study
This study considers Lilla Edet city as a case study with two MGs, industrial MG as MG1 and a city MG (with residential, commercial     MGs case study which is located in Sweden (Fig. 2a).
The Swedish electricity market is divided into four price areas (SE1, SE2, SE3, and SE4) as shown in Fig. 2b to control the transmission of electricity between regions and to promote the construction of power generation and transmission capacity.The northern areas (SE1 and SE2) have excess electricity production due to the existing HPP resources and low power demand.In the parts SE3 and SE4, electricity consumption often exceeds production, which leads to relatively higher electricity prices in these areas [30].

Problem modeling and formulation
As mentioned before, Fig. 1 provides information according to the case study.The target is to minimize the total cost of the entire system (both MGs) in separate and interconnect and island modes including operation and planning costs.The following sections are related to formulation of various parts in the objective function (OF).

Main grid modeling
Due to variable electricity prices, the loads can supply from the main grid in case of shortage power from local DG units (HPP and WT) and/or BESS can be charged from the main grid in off-peak hours.The cost function of the main grid is modeled as follows: The main grid power distribution in separate and interconnect operation mode are modeled in eq. ( 2) and (3)respectively.

WT modeling
Here the generated power by WT is assumed as the given data and only its imposed cost is considered in Eq. ( 4).
The WT power distribution in separate mode, Eq. ( 5), interconnect and island modes, Eq. ( 6), are modeled.The WT power will be sent to load demands, BESS, EV, and other side, as it is expressed below.

Separated⇒P WT
m,s,t = P WT,LD m,s,t Interconnected and Island⇒P WT m,s,t = P WT,LD m,s,t

HPP modeling
The quantity and the head of falling water are the main factors in a hydroelectric generation [31].Besides, the cost function of a HPP is described in equation (7).The same as WT, produced power by HPP is considered as a given data, hence no production equation is provided.
The same as the WT, the following equations show the HPP power distribution in separate mode, Eq. 8, and interconnect and island modes, Eq. 9. Also, the HPP power will be sent to load demands, BESS, EV, and other side, as it is expressed below.
The reason to express two terms (one for separate mode, one for interconnect and island modes) for distributed power of main grid, WT and HPP is because of new load after interconnection, e.g., EVs and also adding the possibility for sharing power between two MGs.

BESS modeling
Nowadays energy storage technologies are able to takle the technoeconic problems in power system.For example, the BESSs are widely using for peak shaving and energy management [32], frequency regulation and energy arbitrage [33], and system reliability [34].In this paper, due to the excess power from the HPP and WT and electricity cost variation, the BESS store the required power and discharge to electrical demands to provide balance.The BESS is modeled by considering charging/discharging modes, and state of charge (SOC).The maximum C rate of the BESS in this study is allowed to be 1.The BESS formulation to cover the constraints are as follows.

Separated mode
In separate mode, each MG might need to a BESS, the 'm' indice is considered for Eq. ( 10)- (17).The total imposed cost by the BESS is modeled in Eq. (10).It can be seen in Eq. ( 13), the SoC in each hour is obtained by considering the charging and discharging amounts of the BESS.The SoC is limited by its bound in Eq. ( 14).The amount of

Interconnected mode
The differences for the BESS in separate and interconnect mode are provided below where there is not the m indice for the battery due to installed shared BESS thorough the MPC.Hence, Eq. ( 18)-( 25 ζ Ch,BESS s,t The important issue for the BESS sizing is the operation mode of the MGs.It means, in separated mode, each MG may need a BESS while in interconnected mode, a common BESS will be sized if required.This issue will affect the BESS costs, both operation and investment, which are explained in section 6.

Different operation modes of MGs
To evaluate the MGs operation, three main scenarios based on the different conditions (e.g., DR, N-1 criterion, and load increment) in three operation modes (separate, interconnect and island) have been considered in this paper.All the scenarios have been applied in separate and interconnect modes while DR and load increment are used in island mode and N-1 scenario is ignored.In all cases, the main objective is to optimize the total cost of the system.

Applied scenarios
The main applied scenarios including DR, N-1 criterion and Load increment in this study have been explained in the following parts in details.

Demand response strategy
Consumers can use DR programs for flexible load management to adjust their consumption regarding the volatility of the electricity pool market to minimize the total energy cost.They can decrease their consumption during peak hours and increase their consumption in off-peak hours instead.Consequently, there are some demand-side strategies reducing peak point value according to electricity price or other types of incentives, especially during peak hours.In this study, load shifting is considered as the DSM strategy to reduce the amount of imported power from the main grid for cost-saving purposes.
By increasing the percentage of DR, the imported power from the main grid will decrease enormously because DR shifts the peak power to off-peak hours.Moreover, according to the type of loads, critical, essential, and normal, the percentage of DR varies.The LDI and DR are the amounts of increased and decreased load for each hour, respectively.As a result, in all scenarios, optimization will be applied in both normal conditions and DR mode with various percentages [35].
For each 24 The new load demand can be selected among the electrical load of each MG, and EV demand in three levels, 0, 5 and 10%, to see how they affect the component sizing (cables and the MPC), BESS capacity, and the OF.

N-1 criterion
N-1 criterion is one of the criteria for checking reliability in power system which means that the system shall be capable of experiencing an outage of a transmission line, cable, transformer, or generation units without causing losses in electricity supply.The N-1 criterion states that a system which can endure continuously an unexpected failure or outage of the component, has an adequate reliability level.This implies that some simultaneous failures could lead to local or widespread electricity interruptions.However, the N-1 criterion has achieved acceptable results over the past decades [36].Component outage, double-line failures during adverse weather, N-0 during maintenance, stronger reliability criteria for cities are some types of the N-1 criterion [37].
Reliability assessment generally consists of power flow analysis on a network model.With the N-1 criterion, the contingency list consists of failures of single lines, transformers, generation plants, large loads, etc [38].The used N-1 criterion in this study is the transformer failure for each MG.In normal mode, the summation of two transformers capacity which come from HPP in MG1 or WT in MG2 with the main grid is the maximum transferred power to the loads.While in N-1 criterion, it will reduce to 50%, as an example, the maximum power of HPP and WT with    the main grid will be equal or less than 30 MVA and 16 MVA in MG and MG2 respectively.

Load increment
One of main scenarios in this study is evaluating the behavior of MGs against load increment.The load can increase up to 100% and the results of the whole system, including contribution of sources, BESS capacity, size of cables and MPC and finally OF, will be considered.Generally, to avoid encountering impossible optimization, existed sources are allowed to use their maximum capacity.Also, BESS can be implemented in case of higher load demand in comparison with provided power by sources.However, there is a possibility that the system cannot withstand the increase in load, so that the output result would be infeasible.

Results of the applied scenarios for different operation modes of MGs
To evaluate the MGs operation, three main scenarios based on the different conditions (e.g., DR, N-1 criterion, and load increment) in three operation modes (separate, interconnect and island) have been considered in this paper.

separated operation mode of MGs
As mentioned before, different situations for each scenario have been considered in this paper.Hence, to investigate the MGs operation in separate mode, the base case is Fig. 1 to elaborate both MGs conditions.In separate mode, the applied load increment is from 0 to 100%, N-1 criterion that one transformer on each side is failed as shown in Fig. 3.The main purpose of all conditions is to minimize the total cost of the system (including operation and planning costs) and consequently, sizing the required BESS capacity.Hence, these aims are defined in the OF in Eq. (31).Also, the load balance for electrical load balance (in MG1 and MG2) is formulated in Eq. (32).
Since the BESS should be sized for each MG, so two separate BESS is needed.Also, each BESS will be connected to the AC MV bus through the power conversion system (PCS) which this part increases the BESS cost instead of the DC bus connection.Hence, the fixed (investment) and variable (operation) costs of the BESS have been considered equal to 1042 M€/MWh and 1 €/MWh respectively [39].
The load demand for the MG1 and MG2 are illustrated in Fig. 4 (a) and (b), respectively.The details, including, peak, average and load factor is summarized in Table 2, however, the details are explained in section 6.The HPP and WT as the local DGs with the main grid contribution are the sources to meet the electrical demands.These input data are exported as historical data in 2018 as shown in Fig. 5 (a).Also, Fig. 5 (b) shows the electricity price from the main grid.It should mention that the results are based on selling cost equal to the 98% of the pool price and the rest is for losses (2%).

Separated mode in normal condition
N-1 criterion is one of the considered scenarios in this study.However, Table 3 provides information regarding the behavior of MGs in normal condition against load increment in separated mode.In normal operation, the N-1 criterion is not applied to the system and each MGs is allowed to use from the total transformers capacity.As it can be seen, despite the load increment to 100%, the BESS is not required.The results are evaluated with DR strategy (TOU method) with different percentages.For base load, the contribution of HPP, WT in MG1 and MG2 were 83% and 54% respectively and the rest are supplies from the main grid.

Separated mode with N-1 criterion
In a case of losing a transformer, to implement N-1 criterion, there will be more need for installing a BESS.In this regard, Table 4 (a) and (b) provide information about N-1 criterion scenario in MG 1 and MG2, respectively.
In case of N-1 in MG 1, load can be increased up to 59%, while it is allowed to reach 72% in MG 2. The reason is because of the load types, the industry load is located in MG1 with 20.2 MWh/h peak demand which is almost doubled of the city load in MG2 with 11.96 MWh/h peak power.

Interconnected operation mode of MGs
As the load can increase up to 59% in separated mode and N-1 condition, there are several procedures to overcome this limitation to enhance system flexibility and stability.The first method is installation of an extra parallel transformer on the load bus of each MG.As a result, the capability of system to outstand against load increase in case of N-1 criteria condition will enhance considerably because the extra transformer will act as the interrupted one.However, that causes congestion problem because the extra transformer imposes more pressure on the upstream network by importing high peak power.The second way is using a simple AC connection line.Its drawbacks are lack of a two-way energy transition path and controlling capability, so that exchange power cannot be managed.Also, the protection of the system would be complex due to transferred fault current to other side in case of occurring a fault in one side.To deal with mentioned problems the B2B converter might be the solution because that can control energy exchange and avoid transferring fault current.Nevertheless, the system is equipped with several devices such as various types of EVs and BESS, then several B2B converters will be needed, while their efficient management is complex and costly.Finally, to overcome these problems the MPC is the best solution due to its several multi-functional ports and easier management methods [40].Two main features should fulfill for the interconnection of MGs, first, selecting the same voltage buses and secondly the points with minimum distances between the MGs as are shown in the single line diagram in Fig. 6.
The following important points are involved in the OF as the new parts that should be optimized (minimized): 1.The optimal size for the required BESS for both normal and N-1 criterion.2.An optimal cross-section for the MV cable/cables for energy exchange between MGs. 3. The optimal size for the MPC by considering the maximum exchanged power between MGs.
The same as a separate condition, DR strategy, load increment and N-1 criterion are applied in this scenario to evaluate the required BESS capacity, cable cross-section and MPC size.
As it mentioned in the paper contribution part, the main novelty of this paper is to develop a holistic solution to optimally control crosssectoral energy and power flow between two MGs and demands within the electricity and transport.To achieve this, one of the key components is an MPC, which can provide multiple ac and dc connections, and can be located at a strategic location such as a fast-charging station or a substation.The proposed MPC is shown in Fig. 7 which consists of two main AC ports for connection to the AC buses of industry (A2) and city (B2) MGs and several DC ports to be used for the EVs charging stations, and common BESS.
The MPC can provide an integrated modular solution to interconnect multiple energy carriers and demands from different energy sectors.Instead of using several dc-dc converters and interconnecting, a single MPC with interfacing different sources, storages and loads can be used.An MPC converter has the advantages of requiring fewer components and having a lower cost more compact size and better performance.
Providing the possibility for the different EVs connection in the MPC is the main advantage.The MPC for EVs charging application can be used on a small [41] and large scale [42].An MPC infrastructure technologies development for medium and heavy EVs is deeply investigated in Ref. [43].Since the progress for EVs integration in the distribution system is increasing in Sweden, hence their impact on the electricity system [44] as well as cost minimization [45] and charging priority control [46] in the real case studies have been analyzed.Fig. 8 shows the load duration curve of EVs which is considered for the MPC connection in this project.
Regarding the availability of several ports with different rated power for the EVs charging through the MPC, three usual types of plugs including normal, fast and super-fast (ultra-fast) chargers are used as summarized in Table 7.There are already 5 EV charging stations in the Lilla Edet case study.Table 5 summarizes the rated power, charging time and other technical characteristics regarding normal, fast and super-fast EVs which are used.
The maximum number of EVs for charging at the same time (according to Fig. 8) for normal, fast and super-fast are 45, 20 and 8, since the peak demand is 1 MWh/h, respectively.However, this number for normal chargers with 3.7, 11 kW EV rated power regarding to available plugs in the case study (Fig. 9) are 270 and 90, respectively.
The OF in interconnected mode has some new terms for cable and MPC investments as defined in Eq. (33).The cables and MPC size directly rely on the maximum exchanged power between MGs, hence Eq. ( 34) present the different terms of this variable which is considered as P ET max .Also, the load balance in MGs is defined in Eq. (35).

Cable sizing
The selected cables for the interconnection line are MV XLPE with the cross sections between 50 and 630 mm 2 .Fig. 10 (a) shows the cost (in k€) of different cross sections (mm 2 ) XLPE cable per kilometer (k€/ km) and (b) represents the ratio of cost over power for the different cross sections in M€/MW.
As mentioned before, the optimal number of selected cables for the interconnection line should be determined considering the maximum transferred power between the two MGs which is considered as P ET max in Eq. (34), so, the following Eq.( 36) describes the number and power of selected cables to transfer the maximum transferred power.
∑ n i=1 N i × P i ≥ P ET max (36) In the following constraint, x = 0 means that the cable type i is not selected.
By selecting cable type i, e.g., x = 1, the following constraint determines the number of cables.
It is obvious that the number of cables should be limited to their maximums.Therefore, Eq. (39) limits the cables number.Finally, the investment cost of cables can be calculated as following in Eq. (40).

MPC sizing
The same as cable sizing, the main variable in the MPC size is the P ET max .It is assumed that one MPC type should be selected among candidate MPCs which are obeyed as Eq.(41).
The selected MPC should be able to transfer the maximum power between the two MGs as following.
∑ n j=1 ζ j × P j × η MPC ≥ P ET max (42) The investment cost of MPC after the optimal selection will be calculated in Eq. (43).
Due to a new interconnection line between MGs, cable, MPC and BESS (if needed) should optimally size regarding the annualized capital recovery factor (CRF) calculation in equation (44).In this equation, ir denotes real interest and lt is project lifetime.To calculate the ir in equation ( 45), if is the annual inflation rate and ir* is nominal interest of the project [47].
To have an overall vision of the interconnected MGs, including the distributed power between the sources to supply the electrical and EVs demand (which is add in this mode thorough the MPC with the DC ports), Fig. 11 shows all the details, especially for the variables, e.g., maximum transferred power P ET max which is the most important one because it directly effect on the size of cables and MPC.Also, the connection of BESS the same as the EVs is done thorough the MPC but in the AC port.

Interconnected operation mode of MGs without EVs
Generally, to make a comparison between separated and interconnect modes, to find out required BESS size, maximum amount of imported power from the main grid, and total imposed cost to the system, it is necessary to have the same conditions.In this regard, the loads' required power must be equal, and consequently, EV must be ignored in interconnected mode.Hence, the following results in Tables 5 and 6 show the results without EVs demand to be able to make a comparison with Table 3.
Determining the maximum requesting power from the main grid ) is one of the main variables of the MGs for interconnected mode.This variable has many terms, e.g., supplying both MGs loads and EVs demand and charging BESS during the low pool price.It should mention that there is also the possibility to transfer power from the main grid in both MGs to another MG from the interconnected line thorough the MPC as it can be seen in Fig. 11.Due to this capability (sharing power) in interconnected MGs, the N-1 scenario can be applied to the system up to 100% of load increment.Tables 8 and 9 provide information regarding N-1 scenario in MG1 and 2, respectively.By increasing load demand, the BESS needs to be installed in case of N-1 criterion in MG 1. While, by applying N-1 criterion in MG 2, there is no need to install the BESS even with doubling the electrical load demands.
The highlighted point regarding Table 6 is the DR impact.As it can be seen, with 100% of load increment without DR, the required BESS capacity is 6.17 MWh while with only 5% DR the BESS in not required.The maximum charging and discharging power for the sized BESS (100% load, 0% DR) are 6.17 MWh and 6.1 MWh respectively.
The are some noticeable points regarding the optimal sized for the components by applying same situation in MG2 in comparison to MG1.As it can be seen, with N-1 condition in MG2 without EVs demand the BESS is not required and that's because of the availability of 57 MW in MG1 to share with MG 2. The second point is the P ET max which is 8 MWh/h for 100% of load is exactly 50% of the same condition for MG1 which was 16 MWh/h.This issue caused a smaller cross section which is only one 500 mm 2 cable instead of two cables for MG1 (see Table 7).

Interconnected operation mode of MGs with EVs
An MPC allows multiple power inputs/outputs to be integrated through a single power processing stage to remove redundancies that exist with conventional converters.This feature provides more resiliency and flexibility for the entire system, e.g., load increment up to 100% for both MGs for interconnected MGs while it was not allowed to in separated mode.In this section, to exploit another advantage of MPC, the EVs demand (based on Fig. 8) add to compare and investigate the results.Tables 8 and 9 provide details information regarding N-1 scenario in MG1 and 2, respectively.With N-1 criterion in MG1, by increasing load demand, the BESS is needed to install in a few cases while, by applying N-1 criterion in MG2, there is no need to install the BESS even with doubling the electrical loads and EV demands.The most highlighted point regarding Table 8 is the impact of DR where with only 10% DR the BESS in not required in comparison to 100% load increment without DR.The maximum required capacity for BESS is 16.34 MWh with 16.3 MWh and 16.1 MWh maximum charging and discharging power respectively.
As the main aim of this research for optimal energy control between interconnected MGs thorough the MPC, and find final operation cost of the system, Fig. 12 reveals the size of MPC along with total cost of the system in various load levels, and with different percentages of DR strategy in case of applying N-1 criterion in MG 1.
The same as Fig. 12, the MPC size and total system's cost are evaluated in Fig. 13 in case of applying N-1 criterion in MG 2. In this case, the load is increased under three different DR strategy conditions.Also in this case, the BESS is not required at all due to the existing two transformers in grid 1 which is allowed to request power up to 57MVA.

Island capability
The island capability condition is the final evolution of resiliency and reliability of the interconnected MGs under extreme situation which is black start.The main assumption for the new results is considering MGs in island mode for 1 h and 24 h losing the connection of each MG with the main grid.The island mode is considered during high peak hours to obtain the worst case's required BESS size.Fig. 14.Shows the single line diagram of case study for island mode investigation.The goal is to check, first, the system ability to continue its operation by losing one grid connection and then, what are the new size for the MPC, cable and BESS for different load variations and DR program.

Island capability for 1 h
In case of experiencing 1-h island condition in MG 1 and MG 2, Tables 10 and 11 indicate the results, in array.It is noticeable that implementing N-1 scenario in island mode is not considered to present clearly island mode behavior with a 1-h duration.As it is shown, the 1-h island mode in MG 1 requires a BESS installation, while that in MG 2 withstands against load increment without need of BESS.The system with island mode in MG 1 requires installation of the battery after a 50% increase in load.
Also, DR scenario enormously affects the system to reduce the amount of consumed energy in both MGs.So that, with 60% of load increase in case of island condition in MG 1, system needs a 3.7 MWh M. Kermani et al.BESS in case of island mode in MG 1 reduces from 17.89 MWh to zero, for 0 and 10% of DR strategy.Tables 12 and 13 summarize the results of 24-h island condition for the cables sizing, as well as required MPC and BESS in MG1 and MG2 respectively.Fig. 15 indicates the impact of load increase on MPC size and OF system's cost.Also, the impact of DR scenario is highlighted.Fig. 16 reveals the required size of the BESS in different load levels.
The same as Fig. 15, the effect of increasing load on MPC size and OF by considering DR scenario is analyzed in Fig. 17.In general, interconnected MGs can decrease both operation and planning costs, maximize the self-consumption of the local generations, reduce the applied peak to the grid and enhance the resiliency and reliability.

Conclusion
In this paper, a real industry and city MGs case study for optimal energy management has been investigated.The problem is evaluated in three phases, separated, interconnected and island conditions with applying different scenarios e.g., load increment, N-1 criterion, and demand response strategy.In separate mode and load increment scenario, the MGs can withstand against increasing loads, while in N-1 scenario the system can tolerate against up to 60% load increase in case of N-1 criteria in MG1 and up to 75% load increase in case of N-1 criteria in MG2.Interestingly, the system operating N-1 scenario in interconnected mode, can tolerate load increment even two-fold of rated power with a much smaller BESS size compared with separated mode.By adding the MPC, the system can experience 100% load increase in island condition with a duration of 24 h, which imposes an extreme pressure on existed sources and BESS.It is noticeable that the applied DR strategy significantly reduced the OF cost as well as BESS capacity, cables and MPC sizes and enhance the system's flexibility.For instance, in case of load increase of 100% in 24-h island in MG1, the size of MPC decreases from 33 to 29 MW for 0 and 10% of DR strategy, respectively.Also, the BESS capacity experiences an almost 50% decline from 260 MWh to 136 MWh for same conditions.Moreover, by implementation of a 10% DR strategy, the number of used cables is reduced and one 150 mm 2 cable is totally skipped.

Declaration of competing interest
The authors declare that they have no known competing financial interests or personal relationships that could have appeared to influence the work reported in this paper.

Fig. 3 .
Fig. 3.The overall scheme of the Lilla Edet case study with the components.

Fig. 5 .
Fig. 5.The input data for MGs case study, power duration curve for HPP and WT in MG1 and MG2 (a) and the electricity cost of the main grid (b).

Fig. 8 .
Fig. 8.The load duration curve of EVs in the Lilla Edet case study.

Fig. 9 .
Fig. 9.The information of available of EVs charging station in the Lilla Edet case study.

Fig. 10 .
Fig. 10.The techno-economic curves for the different cross sections of cables.

Fig. 11 .
Fig. 11.The overall scheme of the interconnected MGs parameters for energy control.

Fig. 12 .
Fig. 12.The impact of DR on MPC size and OF cost based on load increment with N-1 in MG1.

Fig. 13 .
Fig. 13.The impact of DR on MPC size and OF cost based on load increment with N-1 in MG2.

Fig. 14 .
Fig. 14.Single line diagram of case study for island mode investigation.

Fig. 17 .
Fig. 17.The impact of DR on MPC size and OF cost based on load increment for island mode in MG2.

Table 1
A full vision of the applied scenarios in different operation modes.

Table 2
Summarized technical information of the loads related to Fig. 1.

Table 3
Separate mode in normal condition.

Table 5
Different types of EVs based on charging technology.

Table 6
Interconnected MGs with N-1 condition in MG1 without EVs demand.
) represent these terms as a new mode for the BESS.

Table 7
Interconnected MGs with N-1 condition in MG2 without EVs demand.
hours period :

Table 8
Interconnected MGs with N-1 condition in MG1 with EVs demand.

Table 9
Interconnected MGs with N-1 condition in MG2 with EVs demand.

Table 10 1
h Island condition in MG1 without N-1 criterion.