Energy Sharing for Interconnected Microgrids with a Battery Storage System and Renewable Energy Sources Based on the Alternating Direction Method of Multipliers

Abstract: In order to facilitate the local sharing of renewable energy, an energy sharing management method of multiple microgrids (MGs) with a battery energy storage system (BESS) and renewable energy sources (RESs) is developed. First, a virtual entity named the energy sharing provider (ESP), which acts as an agent for MGs, is introduced to minimize the power loss cost. Second, a distributed optimal model and a two-level iterative algorithm for the MGs and ESP are proposed, which minimize the total operation cost including purchasing electricity cost, energy storage cost and power loss cost. Based on the energy sharing framework, considering the local objectives of MGs and the objective of ESP, the optimal scheduling can be achieved through the bidirectional interaction between MGs and ESP. During the optimization, the shared information between MGs and ESP is limited to expected exchange power, which protects the privacy of MGs and ESP. Finally, the effectiveness of the proposed model and algorithm in different scenarios is verified through a case study.


Introduction
The distribution management system (DMS) [1,2] is regarded as one of the most essential factors of the development of the smart grid.A new smart DMS with distributed energy resources (DERs) [3], increasing various loads [4], the amounts of data and devices, is facing more challenges.To reduce the complexity of a distribution system, a smart DMS can be considered as many coupled microgrids [5].That is, conventional DMS can be transformed to a multi-microgrid (MMG) distribution system.
In recent years, with the increment of the permeability of DERs [6], microgrids (MGs) [7] have grown rapidly worldwide due to flexible generation, environmentally-friendly characteristics, etc.In general, MGs can be operated by connecting to the utility grid, as well as in island mode [8].The neighboring MGs can form an MG cluster, in which several MGs can exchange energy with one another [9].On the one hand, forming a cluster can improve operation stability and reliability in power delivery [10], which is beneficial to realize the failure recovery of a distributed network.On the other hand, it is useful to reduce operation cost and realize the energy complementation of MGs [11].Recently, the energy management of prosumer community groups [6,12] has become an attractive issue in order to improve the operation efficiency and encourage local consumption of RESs.In addition, the development of integrated community groups [13][14][15] based on the combined heat and power (CHP) [16] system contributes to the cost reduction and energy conservation.In these cases, the energy management of the group including multiple MG prosumers considering the CHP system becomes an important problem to be addressed for cost reduction and energy sustainability.Therefore, the energy sharing management for interconnected MGs would be promising for application.
In the existing literature, the optimal dispatch [17] of interconnected multi-microgrids in island mode is studied.A distributed convex optimization framework and a cost minimization model and algorithm based on the subgradient method are developed in [18] for energy trading between islanded MGs.Unlike the aforementioned studies, in this paper, an energy sharing framework is constructed at the distribution grid level.
Until recently, numerous studies have worked on the energy management [6] of multi-microgrids, and there are different considerations for diverse purposes and specific problems.For the reduction of environmental pollution, an increasing number of distributed generation (DG) units has attracted more attention.The long-term DG placement and short-term DG placement are optimized in an MMG system considering the randomness of load demands and DG power generation [19].Recently, renewable energy sources (RESs) have been exponentially growing to reduce carbon emissions and the operation cost of systems.However, it is difficult to control them due to their stochastic behavior.A bilevel optimal control scheme is proposed for stochastic optimal operation of interconnected microgrids characterized by renewable and traditional power production, bidirectional power flows, dynamic storage systems and stochastic modeling issues [20].Moreover, the reliability is regarded as an important indicator for interconnection of MGs.The optimal planning in [21] takes into account various factors including the economics, reliability and variability of renewables, network and resource-based uncertainties.In addition, the battery energy storage system (BESS) [22,23] is the key component to improve the utilization of RESs.A privacy-preserving distributed optimal scheduling method is proposed for the interconnected microgrids in [24].In the optimization, the optimization objectives are commonly set as minimizing the operation cost or maximizing energy efficiency.Multi-objective optimization was used in [25] to solve operation optimization.In a distribution grid, the power loss should be further studied, which is rarely considered for simplicity.
In order to reduce operation cost, improve renewable energy consumption and enhance system reliability, many optimal schemes for energy management [15] of interconnected MGs have been proposed by some researchers, which can be classified into centralized and decentralized schemes [26].The centralized scheme would be to solve the optimization problem by means of a coordinating entity (CE) with global operational data.In this context, [27] proposes a centralized scheme for energy management of multiple MGs by taking the cost minimization as the objective.However, a centralized scheme presents a number of weak points since MGs may belong to different economic entities.Moreover, it is difficult to meet the huge data communication requirements.In contrast, the decentralized method not only can protect the critical information of MGs, but it also would reduce the optimization complexity for CE.A distributed robust energy management scheme for an MMG system in the real-time energy market is proposed in [28].
For optimal operation of the MMG system, a coordinator is necessary to facilitate the arrangement of energy sharing; thus, we propose an energy sharing provider (ESP) to minimize system power loss cost.The relationship between ESP and multiple MGs is a bidirectional interactive process.In this regard, distributed optimization can be achieved with bidirectional interaction between ESP and MGs by using the alternating direction method of multipliers (ADMM).However, other distributed optimal schemes may solve the problem differently without the interaction process, which also means that the energy sharing management may be difficult for applications.The objective of energy sharing management of the MMG system can be regarded as having two parts, that is the cost of MGs and the cost of ESP, which are convex functions and in accordance with the condition of using ADMM.In particular, the alternating iteration of variables in the ADMM algorithm can describe the bidirectional interaction between ESP and MGs.Therefore, it is suitable to model the energy sharing management of the MMG system by using ADMM.
To this end, the energy sharing framework of multiple MGs based on ADMM has been highlighted in this paper, which can reduce power loss and operation cost.Based on the energy sharing framework, optimal scheduling can be achieved through the bidirectional interaction between MGs and ESP.First, considering the local operation cost, each MG decides the expected exchange power and submits it to ESP.Combined with the data from MGs, the ESP decides the adjusted expected exchange power taking into account its objective.The optimal scheduling can be realized until the expected exchange power decided by the MGs is equal to the adjusted expected exchange power decided by the ESP.Only the expected exchange power is required during iterations, which safeguards the local information of MGs.Motivated by the above facts, we propose a distributed optimal dispatching method of interconnected MGs with BESS and RESs based on ADMM.The main contributions of this paper are as follows.
(1) An energy sharing structure is proposed to integrate the neighboring MGs into an energy sharing zone.Besides, a virtual entity called ESP, which acts as an agent for multiple MGs, is introduced to minimize power loss cost.(2) Based on the framework of ADMM, a distributed optimal scheduling model and a two-level iterative algorithm for the MGs and ESP in coalition are proposed, which minimize the total operation cost including purchasing electricity cost, energy storage cost and power loss cost in coalition.The power loss cost can be decreased by the proposed method effectively.(3) An energy sharing framework at the distribution network level is proposed.Through bidirectional interaction between MGs and ESP, the optimal scheduling can be achieved until the expected exchange power decided by MGs is equal to the adjusted expected exchange power decided by ESP.During the optimization, the shared information is limited to expected exchange power, which protects the privacy of MGs and ESP.(4) An optimal framework is proposed, which is capable of taking into account the local objectives of MGs and the objective of ESP with regard to their interaction.
The rest of the paper is organized as follows.In Section 2, the studied system structure with coalitions of MGs is illustrated, and the energy sharing structure of MGs in the coalition is described.In Section 3, the RESs and BESS in MGs are modeled.In addition, the power loss model and basic optimal dispatching model of MGs and ESP are introduced in this section.Section 4 describes the distributed optimal scheduling model and a two-level iterative algorithm based on ADMM for the MGs and ESP in coalition.In Section 5, numerical results are given for a coalition consisting of 3 MGs and an ESP, and the effectiveness of proposed model and algorithm in different scenarios is verified.Finally, the conclusion is drawn in Section 6.

System Structure
Consider that the sources, loads, etc., in distribution grids are regarded as multiple MGs, such as household MGs, building MGs, etc.In each time slot, if the generation of an MG is more than its required energy, it can export energy to other MGs; if the generation of an MG cannot satisfy the load demands, it would import energy from other MGs or purchase electricity from the main grid.From the viewpoint of transactive energy, the MGs can be considered as sellers or buyers, which depend on the net load curves.We assume that the import price of MGs is higher than the export price in this paper, which can promote the consumption of renewable energy.
With the objective of reducing power loss, the adjacent MGs tend to form coalitions, which is mainly due to the relatively close distance.Thus, the MGs try to transfer as much energy as possible locally inside the coalition before trading with the main grid.Therefore, in this paper, we restrict our attention to the exchange of power inside the coalitions and the power between coalition and the main grid.An illustration of the studied system structure with coalitions of MGs is shown in Figure 1.

Energy Sharing Structure of MGs
To clarify the structure inside a coalition, the energy sharing structure of MGs in the coalition is introduced.Each MG is composed of a photovoltaic (PV) system [29], an energy management system (EMS), loads, etc.Based on this structure, the MGs can participate in the energy sharing zone, and their surplus power or insufficient power can be exchanged among MGs or traded with the main grid directly.
We need a coordinator in the coalition to facilitate the organization of energy sharing and reduce the power loss.Therefore, a virtual entity called the ESP is introduced, which acts as an agent for the MGs in the coalition.The ESP is responsible for computing the cost caused by power loss and minimizing the power loss cost as much as possible.In addition, the ESP is in charge of ensuring the power balance.
Each MG is assumed to have an EMS that can collect the data of sources and loads and receive the adjusted expected exchange power information from the ESP.Besides, the optimal scheduling of each MG is achieved in EMS, which can decide the expected purchased power from the main grid, the charge/discharge power of BESS and the expected exchange power among MGs.

RESs Model
Due to abundant resources, renewability and environmental friendliness [30], RESs are becoming increasingly important [31], such as PVs and wind turbines (WTs).In order to facilitate engineering application, the output power P PV of the PV module can be described as the following model [32].
where G AC is light intensity.P STC is the maximum test power under the standard testing environment, in which solar incident intensity is 1000 W/m 2 and ambient temperature is 25 • C. G STC denotes the light intensity under standard testing environment.k t is the power temperature coefficient.T c is temperature of the photovoltaic cell.T r is the reference temperature.The relationship between the output power of WT and wind speed v can be represented as [33,34]: where P WT is the output power of WT; P r is the rated power of WT; a, b, c and d are fit parameters; v ci is the cut-in wind speed; v r is the rated wind speed; v co is the cut-out wind speed.The RESs should be made full use of for the reduction of the operation cost.The output power of RESs including PVs and WTs can be given as: [35].
where P uc denotes the output power of RESs; P PV and P WT are the forecasting output power of PV and WT, respectively.

BESS Model
According to [24,36], in order to simplify the model, the total loss of the charging and discharging process is calculated in the discharging process considering that the charging and discharging process are alternately cyclic.The cost of BESS during each discharge stage can be expressed as: where I denotes the investment cost of BESS; P is the discharging power; ∆T is the length of the time period with P; h and l are two coefficients; Q is the battery capacity; A total is the total cumulative Ah throughput in the life cycle, whose unit is kWh; S OCinit is the initial state of charge (SOC).It is obvious that this cost function is a quadratic polynomial with regard to discharging power P, which lays a good foundation for optimal scheduling of MGs in coalition.

Model of CHP System
CHP systems can provide the thermal and electrical energy for MGs simultaneously, which can improve the energy efficiency effectively.Its fuel cost can be described as [13]: where C chp denotes the fuel cost of CHP; p gas is the price of natural gas; ∆T is the length of the time slot; P chp is the electric power of CHP; L HV NG is the low calorific value of natural gas.The relationship between electric power and heat power is: where H chp is the heat power of CHP; η L is the heat loss coefficient; δ heat is the heating coefficient of the LiBr chiller.

Power Loss Model
Any power transfers among MGs and power transfer between MGs and the main grid are accompanied with a cost corresponding to the power loss over the distribution lines.Let S be the set of MGs in a coalition.The total power loss over the distributed lines can be represented as follows [37]: where P loss S is the total power loss; P loss nm denotes the power loss over the distributed line between MG n and MG m; P loss n0 is the power loss over the distributed line between MG n and the main grid.The transfer of power P nm between MG n and MG m incurs a power loss P loss nm expressed by [37]: where U is the voltage of the distribution line in the coalition; R nm is the resistance of the distribution line between MG n and MG m.If the tie line power P nm is transferred from MG n to MG m, then the power loss cost is borne by MG m.
The power loss incurred by the power transfer P n0 between MG n and the main grid can be calculated as: where U 1 is the voltage of the distribution line between MG n and the main grid, which is larger than U; R n0 is the resistance of the distribution line between MG n and the main grid.
The cost caused by transferring power can be described as: where C loss S is the total power loss cost; λ is the price of per unit of power energy.

Optimal Dispatching Model of MG
As for each MG, the generation strategies of BESS and exchange power can be made by taking the minimum total cost as the objective based on the forecasting power of PV, WT and loads.The optimal dispatching problem of MG n can be given as: where x gridn ] is a vector composed of charge-discharge power x BESSn of BESS and the exchange power x gridn between MG n and the main grid; the cost of purchasing electricity from the main grid can be calculated as C gridn (x gridn ) = P gs x gridn ; P gs denotes the selling price of the main grid; d n is the load demands of MG n; x in n is the exchange power between MG n and other MGs in the coalition, whose value is positive when the exchange power is output; η denotes the charge-discharge efficiency of BESS.Equation ( 12) is the power balance constraint of individual MG.The maximum limitations of the charge-discharge power of BESS are expressed by (13).P max charge and P max discharge are the maximum and minimum charge-discharge power; S OCmax and S OCmin are the upper and lower bounds of SOC, respectively.
Note that if there are other generation units (such as CHP) in MGs, the cost of the generation units should be added in (11).Equation (11) corresponds to Scenario 1 in the case study, in which there are only BESS and RESs in MGs.As for Scenario 2, in which the CHP system is considered, we need to add the cost of the CHP system in (11), that is x chpn is the output power of CHP in MG n.

Basic Optimal Dispatching Model of MGs and ESP
During optimal scheduling of multi-microgrids in coalition, we assume that all MGs agree to cooperate with one another in order to minimize the total operation cost including purchasing electricity cost, energy storage cost and the cost caused by power loss.MGs and ESP make optimal scheduling strategies with the consideration of purchasing electricity cost, the discharging cost of BESS and the power loss cost.Consider a coalition consisting of N MGs through a communication network and a power interconnection infrastructure; the optimal dispatching problem can be described as [38,39]: where C n is the cost function of in MG n; g(w) is the power loss cost, which is the optimal objective function of ESP; P lossn is the power loss borne by MG n; w is the vector composed of tie-line power P nm , which is transferred from MG n to MG m and tie-line power P n0 of transferring power from MG n to the main grid.

Distributed Optimal Dispatching Model of MGs and ESP Based on ADMM
Due to the excellent performance in robustness and convergence, ADMM has been widely applied in large-scale distributed optimization problems recently [40].The standard form of ADMM can be presented as: where According to (12), the objective function is decomposed into two parts including s(x) and t(z), and the constraint denotes the equality constraint of decision variable x in s(x) and decision variable z in t(z).The algorithm can converge to the optimal solution under the condition that the convex function s is fit with R n → R ∪ {+∞} and t is a convex function in accordance with R m → R ∪ {+∞} [40].In addition, functions s and t can take the value of +∞.Therefore, s and t not only can express specific optimization objectives, but they also can represent some equality constraints or inequality constraints.When variables dissatisfy these constraints, the function takes the value of zero; otherwise, the function takes the value +∞.
The optimization problem including objective function and constraints in this paper can be converted into the standard form of ADMM, which is shown as follows: where B is a matrix with 2N rows and 2N columns and B 1 and B 2 are matrices with N rows and N columns.As for B 1 , the diagonal elements are −1; the last element of first row is one; the (n − 1)-th (n = 1) column element of the n-th row is one; the other elements are zero.In terms of B 2 , the diagonal elements are −1, and the other elements are zero.The constraint (18) ensures that the expected exchange power decided by MGs is equal to the adjusted expected exchange power decided by ESP, which indicates that optimal scheduling is achieved with a comprehensive consideration of purchasing electricity cost, energy storage cost and power loss cost.
According to the basic principle of ADMM [40], the final iteration form of the distributed optimization problem in this paper can be expressed as follows: where ρ is the penalty parameter; k is the iteration number; u k is the Lagrange multiplier at the k-th iteration.
According to (20), the scheduling strategy of BESS and expected exchange power x gridn between MGs and the main grid can be easily decided.Combined with the power balance constraint, we have expected exchange power x in n among MGs in coalition.Referring to (21) and considering the expected exchange power from MGs, the tie-line power w will be updated by ESP after optimization of power loss cost.Therefore, we have adjusted expected exchange power Bw in the case of minimum network loss.Only expected exchanged power is needed to update the Lagrange multiplier and complete the optimization process, which is beneficial to protect the privacy of MGs and ESP.

Convergence Condition and Distributed Optimal Algorithm
(1) Overall description of the Algorithm Distributed optimal scheduling of MGs in coalition considering power loss is further studied in this paper.First, distributed optimal scheduling considering power loss is carried out by MGs taking the minimum sum of purchasing electricity cost and energy storage cost as the objective, which can decide expected exchange power x in n among MGs in the coalition and expected exchange power x gridn between MG n and the main grid.Then, MGs inform about expected exchange power x in n and x gridn of ESP.Second, considering the expected exchange power from MGs, ESP decides adjusted expected exchange power Bw by minimizing the power loss cost in coalition and recalculates the power loss.If the power loss is different from the previous result, a new power loss will be added to the power balance constraint.Then, we conduct the distributed optimization calculation again until the power loss converges to the optimal solution.
The bidirectional interaction flowchart between MGs and ESP can be illustrated as Figure 2. The bidirectional interaction between MGs and ESP is achieved taking into account the local objective of each MG and the objective of ESP.
(2) Convergence condition a. Convergence condition of the ADMM algorithm As for distributed optimal calculation at each iteration, we will refer to s k as the dual residual at iteration k and r k as the primal residual at iteration k according to the principle of ADMM, which can be expressed as follows: where ε pri and ε dual are the convergence error of the primal residual and dual residual, which take the value of 1 × 10 −2 and 1 × 10 −4 in this paper, respectively.
b. Convergence condition of power loss cost If the difference of power loss cost between the last iteration and the current iteration is limited to a small positive value, we conclude that the power loss cost converges to the optimal solution.The convergence condition can be described as follows: where ε is the convergence error of the power loss cost.

Optimization Solution of MGs in the Iteration Process
According to (20), the optimal dispatching model of MG needs to be solved during each iteration of the distributed optimization of MGs in coalition.As mentioned before, in order to simplify the calculation, we conclude that the cost of BESS can be calculated according to (4) during the discharging stage, while the cost of BESS can be seen as zero during the charging stage.In order to find the optimal exchange power of MGs in the coalition, it is necessary to determine the state of charge and discharge of BESS effectively.According to (4)-( 22), the scheduling strategy of MG n can be solved as follows: s.t.max(P max charge , Figure 3 shows the flowchart of the optimization solution for individual MGs.First, we assume that the output power of BESS is negative during the charge state, then we have C BESSn (x BESSn ) = 0. Combined with (11) and (12), the optimal scheduling strategy can be made by solving (26) and (27).Although the cost of BESS during the charge stage can be ignored, if BESS still adopts the charging scheme in the case of the power shortage of WT and PV, the power purchased from the main grid will increase, which adds to the cost of MG.Therefore, it is obvious that the charging power after optimization must be zero under the circumstances of the power shortage of WT and PV.If x BESSn < 0 in the optimization results, we can conclude that the output power of WT and PV is surplus.Therefore, it is necessary to charge the BESS to absorb excess energy, the solution x k+1 n under which case is the optimal scheduling result of the current iteration.

Optimization Solution
Optimize BESS with charging constraint, As for the charge stage, if x BESSn = 0 in the optimization results, we can infer that the output power of WT and PV may be insufficient, which leads to the scheduling strategy in the charge state not being optimal.Thus, the scheduling scheme in the discharge state of BESS needs to be further calculated.Combined with (12), the optimal scheduling scheme can be formulated by solving (26) and (28).The optimal solution x k+1 n is the optimal scheduling strategy of the current iteration.

Distributed Optimal Algorithm
Algorithm 1 summarizes the distributed optimal algorithm of MGs and ESP in coalition, which is shown as follows.
Algorithm 1 Distributed optimal dispatching algorithm.MG makes scheduling strategy using ( 26)- (28) 7: Compute expected exchange power x in k+1 n combined power balance constraint Update Lagrange multiplier referring to (22) 10: Compute primal residual and dual residual according to (23) and (24) 11: end while end for 17: end procedure Algorithm 1, which is a two-level iterative algorithm, has a good performance for minimum total cost including purchasing electricity cost, energy storage cost and power loss cost.Procedures ( 5)-( 12) belong to the inner layer.In Procedures ( 5)-( 12), MGs make optimal scheduling considering the power loss of the last iteration and taking minimum purchasing electricity cost and energy storage cost as the objective.In addition, power loss is updated through the inner layer.If the power loss of the current iteration and the last iteration is eventually the same in the case of limited error, the distributed optimal algorithm converges to the optimal solution.
More specifically, ADMM is adopted for optimal scheduling of MGs in coalition in Procedures ( 5)- (12), in which electricity cost (the sum of purchasing electricity cost and energy storage cost) and power loss cost are optimized alternately.First, the scheduling scheme is made by minimizing the local cost of each MG based on the power loss of the last iteration.Second, expected exchange power x in n and x gridn can be calculated combined with the power balance constraint, which are informed by the ESP.Third, we have adjusted expected exchange power Bw by taking the minimum power loss cost as the objective considering the expected exchange power from MGs.At last, the Lagrange multiplier is updated according to expected exchange power x in n and x gridn and adjusted expected exchange power Bw until the convergence condition is satisfied.
In general, on the basis of the satisfaction of power demand, optimal scheduling is achieved with a comprehensive consideration of purchasing cost, energy storage cost and power loss cost.In addition, only expected exchange power is needed in the bidirectional interaction between MGs and ESP, which protects the privacy of MGs and ESP.

Basic Data in Scenario 1
In order to evaluate the effectiveness of the proposed model and algorithm, a coalition composed of three MGs and an ESP is studied in this paper, which is shown in Figure 4.The parameters of RESs and BESSs are presented in Tables 1 and 2, respectively.The other parameters are set as follows: the voltage of the distribution line among MGs is set to U = 380 V; the voltage of the distribution line between MGs and the main grid is set to U 1 = 10 kV; the resistance of unit length distribution line between MGs or MG and the main grid is set as 0.2 Ω/km; h = −1.5;l = 1.3; for a lead-acid battery with capacity of Q, we have A total = 390Q.In order to better evaluate the effectiveness of proposed method in this paper, we have collected the data for one week, including load, PV power and wind power of each MG.The simulation was conducted in MATLAB2015b (the MathWorks, Natick, MA, USA) for each day of this week with a time resolution of 15 min, thus there are 96 optimization periods in each day.Based on the forecasting method proposed in [41], we obtain the forecasting results in each time slot of days for one week.

Optimal Results on Different Days for One Week
According to the proposed method in this paper, the optimal results in different days for one week are obtained by simulation based on forecasted data, which are shown in Table 3.
In a week, there may be variations of weather and load characteristics, and the optimal scheduling can be achieved, which indicates the proposed method has better performance and can be applied to different days.
Due to the space constraints, here we choose two typical days (Day 1 and Day 2), whose optimal results are given in detail, respectively.Figure 5 represents the net electric load of each MG and the total net electric load of the coalition.The PV power, wind power and load power in each MG are shown in Figure 6.Obviously, the total net load of this coalition in the periods of 1-17, 36-61 and 91-96 is negative, when BESS needs to absorb the excess renewable energy.While in the remaining periods when total net load is positive, it is necessary to choose to discharge by BESSs or purchase electricity from the main grid to satisfy the total load demand with comprehensive consideration of the purchasing electricity cost, discharging cost of BESSs and power loss cost.As shown in Figure 5, in the periods 1-17, 36-61 and 91-96, the total load demand is less than the total output power of RESs including WTs and PVs; thus, the BESSs are used to store the surplus energy by means of charging.In other periods, when there is a shortage of RESs, each MG can choose to purchase electricity from the main grid or discharge by BESS to meet the load demands for reduction of total operation cost in coalition with a comprehensive consideration of purchasing electricity cost and energy storage cost.
Considering that there is less cost in discharging of BESS, it is obvious to find out that BESSs are used to discharge as the first priority in Periods 18-19 and 62-69 when the renewable energy is insufficient.The charge-discharge power of each BESS is optimized based on distributed optimal scheduling algorithm.In Periods 20-35 and 70-90, the output power of BESS is inadequate to satisfy the load demands of MGs in coalition, so that MGs purchase electricity from the main grid.
In addition, Figure 8 shows the decided exchange power among MGs of each optimal scheduling period.As shown in Figure 8, we find that the sum of decided exchange power of MGs is zero, which ensures the power balance of the system.When the renewable energy of MG is insufficient, it would import energy from the MG with surplus power as the first priority.For instance, in Periods 1-17, the net load of MG2 is greater than zero, while the RESs in MG1 and MG3 are abundant.Then, the excess power in MG1 and MG3 would be exported to MG2 for the reduction of power loss and operation cost.If RESs of all MGs are surplus, there exists no exchange power generally, such as Periods 41-46.Through distributed optimization based on ADMM, the optimal problem can be solved effectively while satisfying the load demands of MGs in coalition by just sharing the expected exchange power, which protects the privacy of the MGs and ESP.The efficiency of BESS in this study is set as 95%.The SOC of BESS in each optimization period is presented in Figure 9. Combined with Figure 5 and 7, BESS can absorb the surplus renewable energy and discharge to meet the load demands of MGs.In the periods 1-17 and 36-61, the renewable resource is surplus, and MGs give priority to charging their BESSs.If there is energy left after a full charge, it will be delivered to other MGs.Though only expected exchange power is communicated in coalition during the distributed optimization process, BESSs can be effectively scheduled according to the operation state of MGs in coalition, which ensures operating economy.Having gained insight into the optimal scheduling, Figure 10 shows the optimal variables and net load in MG1.Obviously, after convergence, the sum of power purchased from the main grid, charge-discharge power of BESS and exchange power with other MGs is equal to the net load of MG1 with the consideration of power loss.Based on the satisfaction of load demands, each MG can choose to purchase electricity from the main grid, charge or discharge by BESS or exchange power with other MGs to reduce the total operation cost with a comprehensive consideration of purchasing electricity cost, energy storage cost, load characteristic and power loss cost.
In order to illustrate the effectiveness and benefits of the proposed method in this paper, the power loss cost comparison between with and without optimization of power loss in each period is presented in Figure 11.As shown in Figure 11, in Periods 18-32 and 71-90, the exchange power among MGs and the exchange power between each MG and the main grid are greater; thus, the power loss cost is higher in these time slots.After optimization of the power loss, the exchange power is lowered; therefore, the power loss cost in each period is decreased.
From Table 3, it can be seen that the power loss cost is reduced by 22.56% compared to the case without optimization power loss cost.It is clear that the proposed method in this paper can lower power loss effectively.
To clarify the efficiency of the proposed distributed optimization algorithm based on ADMM, we use a personal computer with Intel Core i7-6700K CPU 4.0 GHz (Intel Corporation, Santa Clara, CA, USA), 8 G memory and MATLAB 2015b, as the testing environment.The convergence of the primal residual and dual residual is shown in Figure 12. Figure 12 represents that the algorithm can achieve convergence in 40-60 iterations for most optimization periods, which indicates that the ADMM shows a faster convergence rate and better performance for the solution of this problem.The net power curve of each MG and total net power curve on Day 2 of Scenario 1 are represented in Figure 13. Figure 14 shows the PV power, WT power and load power in each MG.Compared to Day 1, there is more wind power and less PV power on Day 2 because of weather variations; thus, the total net load power is lower on this day.Apparently, the net load in Periods 5-20, 32-46, 49-57 and 92-96 is negative, when the excess renewable energy needs to be stored by BESS.In other periods, the MGs would choose to discharge by BESS or purchase power from the main grid.
When the renewable energy cannot meet the power demands, discharging by BESS or purchasing electricity from the main grid would be selected by MGs for stable operation.The scheduling results of BESS and purchasing electricity based on ADMM in Scenario 2 are shown in Figure 15.In Figure 15, we can find that the storage energy of BESSs is utilized as the first priority when there is a shortage of RESs, such as Periods 21-31, 47-48 and 60-71.Then, the MG should purchase power from the main grid to satisfy its local demands, such as Periods 67-91.In addition, Figure 16 shows the decided exchange power via the distribution line among MGs.The optimal variables and net load in MG1 are represented as Figure 17.As shown in Figure 17, we find that MG1 can satisfy its local load by exchanging energy with other MGs, discharging by BESS or purchasing electricity from the main grid considering purchasing electricity cost, energy storage cost, load characteristic and power loss cost.
In order to clarify the advantages of proposed method in this paper, the power loss cost comparison between with and without optimization of power loss is represented in Figure 18.According to Figure 18 and Table 3, we find that the power loss is reduced by 5.39% compared to the case without optimization of power loss cost based on the same basic data.Through the method in this paper, the power loss cost can be reduced effectively.
Figure 19 represents the iterative process of the primal residual and dual residual.It is clear that the algorithm can achieve convergence in 30-60 iterations for most time slots, which shows that ADMM has a better convergence performance.5.2.Scenario 2

Basic Data in Scenario 2
To better evaluate the effectiveness of the proposed method, we conduct simulations on different MGs, including differences in the sizes, parametrization, generators, as well as grid topologies.Due to the space constraints, here we choose one typical scenario, whose optimal results are given in detail.Compared with Scenario 1, the load of MGs is smaller, and the parameters of the RESs and BESSs are different.Moreover, the CHP is considered in this scenario, and there is a CHP system in MG1.This scenario is called Scenario 2.
In Scenario 2, the parameters of the RESs, BESSs and CHP are given in Tables 4-6, respectively.Figure 20 shows the net load of each MG and the total net load of the coalition in Scenario 2. The PV power, WT power and load power in each MG are represented in Figure 21.
Obviously, the net load in Periods 15-16 and 32-60 is negative, so the surplus renewable energy is used for charging.In remaining time slots, the MGs choose to generate power by CHP, discharge by BESS or purchase power from the main grid.

Results and Analysis of the Distributed Optimal Dispatching in Scenario 2
The generated power of CHP, the output power of BESSs and the power purchased from the main grid of each MG are represented in Figure 22.In Figure 22, as for MG1, the CHP operates in following thermal load (FTL) mode, which means that the CHP system generates the thermal power according to heating demands of MG1, and the electric power is a supplementary product.When there is a shortage of RESs, the power generated by CHP can be used to satisfy the load demands of MG1, and then, MG1 chooses to discharge by BESSs or purchase electricity from the main grid.Moreover, for MG2 and MG3, we find that the storage energy of BESSs is utilized as the first priority when RESs are insufficient, such as Periods 61-78.Then, the MGs purchase electricity from the main grid, such as Periods 74-96.In addition, Figure 23 shows the decided exchange power among MGs.The optimal variables and net load in MG1 are shown in Figure 24.As shown in Figure 24, MG1 can satisfy its local load by generating power by CHP, exchanging energy with other MGs, discharging by BESS or purchasing electricity from the main grid considering the generation cost of CHP, the energy storage cost, the purchasing electricity cost, the load characteristics and the power loss cost.
Moreover, the power loss cost comparison between with and without optimization of the power loss is represented in Figure 25.The total power loss cost comparison between with optimization and without optimization of the power loss cost in the objective is shown in Table 7.According to Figure 25 and Table 7, we find that the power loss is reduced by 9.98% compared to the case without the optimization of power loss cost based on the same basic data, which indicates that the power loss cost can be reduced effectively through the proposed method.Figure 26 represents the iterative process of the primal residual and dual residual.We find that the algorithm can achieve convergence in 30-60 iterations for most time slots, which indicates that ADMM has a better convergence performance.consideration by the model, which is beneficial to improve energy efficiency and make the optimal results more realistic with respect to the practical applications.As for the algorithm, in this paper, the shared information among MGs is limited to expected exchange power, which protects the privacy of MGs.In addition, the proposed algorithm shows a better convergence speed and a relatively superior solution.

Scalability Analysis
Having gained insight into the algorithm performance, we apply the model in cases with more MGs in order to verify the scalability of the proposed method.The iterative process of the operation cost in Period 23 is shown in Figure 27.Table 9 shows the comparison of the total operation cost and the average iteration number between coalitions with different numbers of MGs.As shown in Figure 27 and Table 9, the algorithm with different numbers of MGs converges to a stable state in about 40 iterations.The result indicates that the model can also be applied to a larger cluster of MGs, and the algorithm has a better performance.
Furthermore, we evaluate MGs of different sizes to demonstrate scalability.Take three MGs as an example: we have conducted simulation on three MGs of different sizes.Figure 28 shows the iterative process comparison of the operation cost in Period 23 between three MGs of different sizes.The total operation cost comparison between three MGs of different sizes is represented in Table 10.
As shown in Figure 28 and Table 10, the algorithm can be applicable to scenarios with MGs of different sizes, which shows a good performance.

Conclusions
In this paper, a distributed energy sharing management method for interconnected operation of MGs with BESS and RESs based on ADMM is presented.We define an entity named ESP to minimize the power loss cost.A day-ahead optimal scheduling model is built by taking the minimum total operation cost including purchasing electricity cost, energy storage cost and power loss cost as the objective.Moreover, a two-level iterative algorithm based on ADMM for the MGs and ESP in coalition is proposed.The simulation was conducted in different scenarios, which indicates that the proposed method has a better performance and can be applied to different scenarios.From numerical simulations, we have shown that each MG can choose to purchase electricity from the main grid, charge or discharge by BESS or exchange power with other MGs to reduce total operation cost with a comprehensive consideration of purchasing electricity cost, energy storage cost, load characteristics and power loss cost.In addition, only the expected exchange power is needed to implement optimal scheduling, and the privacy of MGs and ESP can also be guaranteed.The bidirectional interaction between MGs and ESP is achieved taking into account the local objective of each MG and the objective of ESP.Moreover, it is clear that the power loss cost can be decreased by the proposed method effectively.Compared with the related studies, we have also shown the advantageous features in the proposed method on modeling and algorithm performance.
There is a potential limitation for the proposed method.During the operation, we assume that the reactive power is balanced locally in each MG.However, if one MG lacks the ability to adjust the reactive power, it is possible to request for support from other MGs.Thus, how to achieve the distributed optimization with both active and reactive power is a difficult problem.Furthermore, if the MG can also provide ancillary and balancing services for the coalition, how to integrate the ancillary services into the distributed optimization model is another interesting topic to be addressed.Besides the technique contributions, we can discover that the direct energy trading between MGs can effectively improve the local utilization of renewable energy.In order to facilitate the practical applications, the energy sharing among MGs should be supported by energy market policy in the future development.

Figure 1 .
Figure 1.An illustration of the studied system structure with coalitions of microgrids (MGs).ESP: energy sharing provider.

Figure 2 .
Figure 2. The bidirectional interaction flowchart between MGs and ESP.

Figure 3 .
Figure 3.The flowchart of the optimization solution for individual MG.BESS: battery energy storage system.

Figure 5 .
Figure 5. Net power curve of each MG and total net power curve of the coalition on Day 1 of Scenario 1.

Figure 7
Figure 7 represents the output power of BESSs and the power purchased from the main grid of each MG.

Figure 8 .
Figure 8. Decided exchange power among MGs on Day 1 of Scenario 1.

Figure 9 .
Figure 9.The state of charge (SOC) of BESSs in MGs on Day 1 of Scenario 1.

Figure 10 .
Figure 10.The optimal variables and net load in MG1 on Day 1 of Scenario 1.

Figure 11 .
Figure 11.Power loss cost comparison between with and without optimization of power loss on Day 1 of Scenario 1.

Figure 12 .
Figure 12.Iterative process of the primal residual and dual residual on Day 1 of Scenario 1 ((a) Primary residual; (b) Dual residual).

Figure 13 .
Figure 13.Net power curve of each MG and total net power curve of coalition on Day 2 of Scenario 1.

Figure 16 .
Figure 16.Decided exchange power among MGs on Day 2 of Scenario 1.

Figure 17 .
Figure 17.The optimal variables and net load in MG1 on Day 2 of Scenario 1.
loss cost (Yuan) Without optimization of power loss With optimization of power loss

Figure 18 .
Figure 18.Power loss cost comparison between with and without optimization of power loss on Day 2 of Scenario 1.

Figure 19 .
Figure 19.Iterative process of primal residual and dual residual on Day 2 of Scenario 1 ((a) Primary residual; (b) Dual residual).

Figure 20 .
Figure 20.The net load of each MG and the total net load of the coalition in Scenario 2.

Figure 22 .
Figure 22.The generated power of combined heat and power (CHP), the output power of BESSs and the power purchased from the main grid of each MG in Scenario 2 ((a) MG1; (b) MG2; (c) MG3).

Figure 25 .
Figure 25.Power loss cost comparison between with and without optimization of the power loss in Scenario 2.

Figure 26 .
Figure 26.The iterative process of primal residual and dual residual in Scenario 2 ((a) Primary residual; (b) Dual residual).

Figure 27 .
Figure 27.The iterative process of the operation cost in Period 23 for coalitions with different numbers of MGs.

Figure 28 .
Figure 28.The iterative process comparison of the operation cost in Period 23 between three MGs of different sizes.

Table 1 .
Parameters of the renewable energy sources (RESs).

Table 2 .
Parameters of the battery energy storage systems (BESSs).

Table 3 .
Optimal results on different days for one week.

Table 4 .
Parameters of the RESs.

Table 5 .
Parameters of the BESSs.

Table 6 .
Parameters of combined heat and power (CHP) in MG1.

Table 7 .
Total power loss cost comparison between with and without optimization of the power loss cost in Scenario 2.

Table 9 .
The comparison of the total operation cost and average iteration number between coalitions with different numbers of MGs.

Table 10 .
Total operation cost comparison between 3 MGs of different sizes.