Optimal Energy Scheduling and Transaction Mechanism for Multiple Microgrids

In this paper, we propose a framework for optimal energy scheduling combined with a transaction mechanism to enable multiple microgrids to exchange their energy surplus/deficit with others while the distributed networks of microgrids remain secure. Our framework is based on two layers: a distributed network layer and a market layer. In the distributed network layer, we first solve optimal power flow (OPF) using a predictor corrector proximal multiplier algorithm to optimally dispatch diesel generation considering renewable energy and power loss within a microgrid. Then, in the market layer, the agent of microgrid behaves either as a load agent or generator agent so that the auctioneer sets a reasonable transaction price for both agents by using the naive auction-inspired algorithm. Finally, energy surplus/deficit is traded among microgrids at a determined transaction price while the main grid balances the transaction. We implement the proposed mechanism in MATLAB (Matlab Release 15, The MathWorks Inc., Natick, MA, USA) using an optimization solver, CVX. In the case studies, we compare four scenarios depending on whether OPF and/or energy transaction is performed or not. Our results show that the joint consideration of OPF and energy transaction achieves as minimal a cost as the ideal case where all microgrids are combined into a single microgrid (or called grand-microgrid) and OPF is performed. We confirm that, even though microgrids are operated by private owners who are not collaborated, a transaction-based mechanism can mimic the optimal operation of a grand-microgrid in a scalable way.


Introduction
On 12 December 2015, in Paris, France, the 21st session of the Conference of the Parties (COP 21) to the United Nations Framework Convention on Climate Change (UNFCCC) adopted the Paris Agreement.Now, each country needs to achieve the submitted greenhouse gas (GHG) reduction targets and thus implements eco-friendly policies that encourage the use of eco-friendly energy such as renewable energy.Accordingly, conventional vertical energy industries based on fossil fuels are being gradually replaced by horizontal energy industries, and intensive studies on microgrids are ongoing these days.A microgrid is a power system that has distributed energy resources (DERs) to serve its internal load [1].DERs include renewable energy such as photovoltaic (PV) and wind turbine (WT), distributed generators (DGs) and energy storage systems (ESSs) [2].Microgrids are expected to maximize energy efficiency, be self-sufficient in electricity and thus be considered as one of the key technologies to resolve environmental problem concerns [3].
One of the most important problems in power systems is to supply high-quality power in a stable manner by matching supply and demand to sustain system reliability while minimizing operational cost.Note that it inevitably requires solving an optimal power flow (OPF) problem.However, acquiring a general solution of OPF for a large power system is very challenging because it is essentially a nonconvex optimization problem where some of equality constraints in the power balance equation are not affine.Previously, several algorithms such as mixed integer linear programming [4] and particle swarm optimization [5] were proposed but could not guarantee achieving optimality.Recently, the authors of [6][7][8] provided an optimal solution, which is computationally feasible and scalable, by relaxing the second order equality constraints into convex inequality constraints.They showed that the solution is exact, i.e., the solution is indeed on the boundary of the inequality constraints under some conditions [6,7].
Then, a series of their work focused on transmission networks [9] and also distribution networks [10].However, careful consideration is required in applying the techniques into microgrids, which is the horizontal energy industry and thus there are more uncertainties from distributed, renewable generations and fluctuating loads.For example, PV generation may vary rapidly and load profile of small customers are less predictable or controllable [11].Hence, to avoid additional difficulties in distribution networks, some of the existing works assume that all generators and loads are connected to one bus and ignore the associated power flow in distribution networks [12], i.e., just solving an economic dispatch problem.However, ignoring power flow in microgrids may lead to infeasible solutions in practice.In [13], the authors considered an energy management system (EMS) that performs load side management and schedules diesel generation as well as ESS charging/discharging.In doing this, they proposed a distributed optimization algorithm to effectively control local load and DG within a short time.Specifically, the distributed EMS consists of a microgrid controller and local controllers that jointly operate ESS, diesel generators and demand response in solving the OPF problem.
Besides power security issues, microgrids are being built in various facilities that need large power; complex buildings, hospitals, hotels, schools, unstable power supply areas, and military facilities require their own power sources [14].With the proliferation of renewable generation and unbundling of the electrical power system industry, market-based energy management becomes more viable to meet their local objectives [15,16].For example, transactive energy is introduced in New York state as an economic principle and control technique to manage the flow or exchange of energy.Consequently, one microgrid can sell its energy surplus to maximize its own profits by strategically bidding in a market.The other microgrid may also want to buy energy from another microgrid to minimize its operational cost by strategically bidding in the market.Designing a market mechanism for energy transaction among multiple microgrids is an active research area.For example, the work in [12] solved the problem by implementing an agent-based virtual market.They modeled energy transaction as a two-level problem.At an upper level, an auction agent (AA) solves a social welfare maximization problem, and at a lower level, microgrids try to minimize their operation costs.Thus, the upper level transaction problem is constrained by the lower level decision-agents.However, previous work assumed that all generators or loads in a microgrid are connected to a single bus and thus optimal power flow within the microgrid was not considered.In this regard, we investigate a transaction-enabled OPF problem to combine efficient energy transaction with optimal power flow.To the best of our knowledge, this is the first attempt to leverage energy transaction between microgrids considering OPF within a microgrid.Table 1 represents a comprehensive literature review that contrasts the previous approaches and the proposed one.
We summarize our key contributions as follows.We provide a framework for energy transaction combined with OPF.Each microgrid first solves its own OPF problem using a predictor corrector proximal multiplier (PCPM) algorithm and determines whether it is in the state of energy surplus or deficit, initially assuming that surplus/deficit energy can be balanced with the main grid/distribution system operator (DSO).In a market, a microgrid with energy surplus becomes a generator agent and a microgrid with energy deficit becomes a load agent.Then, energy transaction between microgrids is performed using the naive auction-inspired algorithm that indifferently determines the transaction price.

References Algorithm for Solving Energy Transaction
(This Paper) Naive auction-inspired algorithm [17] Stochastic modeling, stochastic dynamic programming [18] Pattern search algorithm [19] Hybrid stochastic, robust optimization [20] Auction theory, weighted majority algorithmm [21] Sequentially coordinated operation [22] Robust optimization The agreed price incentivizes microgrids to exchange their energy with other microgrids so that distributed resources can be fully exploited.The virtue of employing the naive auction is that it maximizes the social benefits of all market participants.The proposed mechanism enables all microgrids to be better off by reducing operating cost within their own distributed network.To verify the transaction-enabled OPF algorithm, we compare four scenarios in case studies: (i) economic dispatch; (ii) OPF within microgrid; (iii) OPF combined with energy transaction; and (iv) finally all microgrids are assumed to be managed by a single owner, and thus OPF is solved across all microgrids, called grand-microgrid.Our results show that combining OPF with energy transaction, which is practical to preserve the privacy of each microgrid, achieves almost the same performance to the case of grand-microgrid; the gap of operational cost is only 0.063%, which shows the effectiveness of the proposed mechanism.
The rest of the paper is constructed as follows.We present the system model in Section 2. In Section 3, we provide a framework to obtain optimal energy scheduling combined with negotiated transaction price.Then, we present the case studies with real topology of microgrids and evaluate the proposed mechanism in Section 4. Finally, we conclude the paper in Section 5.

System Model
We consider a system model for a multiple microgrids environment.In the proposed model, there are two layers as illustrated in Figure 1.The lower layer is a distributed network layer, which is responsible for energy management within each microgrid, and the upper layer is a market layer, which is designed to trade energy among microgrids.In Section 2.1, we first describe the distributed network layer, and in Section 2.2, we describe the market layer.

Distributed Network Layer Model for Energy Scheduling
We consider a microgrid energy management system (µEMS) that has the objective of minimizing the operational cost of the microgrid while supplying reliable power.The distribution network layer is responsible for DG management within a microgrid.Note that there are two types of DG: dispatchable DG such as diesel generation and non-dispatchable DG such as renewable generation.To obtain optimum energy scheduling in the presence of the uncertain DG units, its prediction is crucial.The system model within a microgrid without considering transaction is based on the model of [13] as will be described shortly.Our model will be extended to the case of energy transaction across microgrids in Section 2.2.We assume that the prediction is reasonably accurate so we focus on the control of dispatchable DG in this paper.Indeed, the combination of two types of DGs is desirable to mitigate the uncertainties of non-dispatchable DG.

DG Model
A dispatchable DG unit such as diesel plays an important role in the power system connected with PV since it matches supply better than non-dispatchable PV.The cost function of diesel can be expressed in a linear form at each time t ∈ T as Equation (1): where α g and β g are constants, and ∆t is a discrete time unit.The output power of diesel generator is constrained as follows: where p max g is the maximum generation.In order to consider the characteristics of the diesel generator, its maximum ramping rate is bounded by: where r g is a ramping parameter, r g ∈ (0, 1], and we have: where p g , q g and s g denote active power, reactive power and apparent power of generator, respectively [6].

Distribution Network Model of a Microgrid
Consider a distribution network of a microgrid modeled by a connected graph G(N , E ), which is a tree topology for radial distribution systems where each node in N represents a bus and each edge in E represents a distribution line.Note that we use bus and node interchangeably and line and edge interchangeably.We denote a node by i, j ∈ N where i, j = 0, 1, ..., n and a line by (i, j) ∈ E .Bus 0 is usually used to denote a slack bus of which voltage is given, and power injection is variable.To emphasize that the slack bus of a microgrid is also responsible for energy transaction, we will denote the slack bus of the microgrid by e instead of 0 in the sequel.For each bus i ∈ N , let V i be the complex voltage and s i = p i + iq i be the net complex power injection on bus i.For each line (i, j) ∈ E , let z ij = r ij + ix ij be the complex impedance on the line, I ij (t) be complex current from buses i to j and S ij (t) = P ij (t) + iQ ij (t) be the complex power flowing from buses i to j.
We assume that the complex voltage V e at the slack bus is given and the complex power injection s e is a variable.A set of generators and a set of loads connected to bus i ∈ N \ {e} are denoted by G i and L i , respectively.The net power at each bus i satisfies: where For power flow analysis of radial networks, voltages, currents and net powers satisfy the following three physical laws for all branches (i, j) ∈ E and all t ∈ T .Given the power flow definition: and power balance at each bus: The following is referred to as the branch flow model (BFM) equations: where Equations ( 5)-( 12) define a system with the variables (S(t), l(t), v(t), s(t)), where S(t) (s i (t), i ∈ N ) will be used as optimization variables of OPF in Section 3. Delivering reliable and high-quality power is very important in the microgrids.However, the integration of DERs may increase the voltage significantly.In the microgrids, thus, we consider the following voltage tolerance constraint: where v min i and v max i represents to the minimum and maximum voltage, respectively.

Net Power Model of a Microgrid
In the proposed µEMS model, the microgrid is connected with the main grid.Hence, the microgrid is operated in a grid-connected mode.The microgrid can export/import power to/from the main grid in accordance with power surplus/deficit.If generated power is higher than load, the microgrid can sell its surplus power at a selling price.On the contrary, if load is higher than generated power, the microgrid can buy its deficit power at a buying price.Note that, throughout the paper, we use selling/buying terminology from the microgrid perspective, not the main grid.The cost function of trading C e is defined as follows: where p e (t) is trading power (p e (t) > 0 for importing and p e (t) < 0 for exporting) and ρ(t) denotes transaction price, respectively.Note that this trading can be with the main grid or other microgrids.If this trading is with the main grid, ρ(t) is given by the time of use (TOU) of DSO.If this trading is with other microgrids, ρ(t) is determined at the market layer considering the bidding of all microgrids.The net power injected from the main grid to the microgrid is given by: where e is the slack bus of the microgrid, and j is a bus connected to generators in the microgrid.

Three Agents in the Market Layer
The market layer of the proposed mechanism is responsible for maintaining fair market and power management among multiple microgrids.For this, we have load agent (LA), generator agent (GA) and an auction agent (AA).As noted above, the µEMS of each microgrid determines whether to behave as LA or GA to minimize the cost of each microgrid.Then, as a market participant, the µEMS discretizes the required export/import into energy units of equal size.Note that the minimum size of energy unit is arbitrary, and can be as small as possible unless it is a burden in the market layer.The details will be discussed in Section 3.2.The role of LA is to purchase energy units from the main grid or other microgrid.The role of GA is to sell energy units to the main grid or other microgrids.LA and GA submit this trading information reflecting supply-demand requirement to AA in the market.Upon receiving this information, AA runs an auction algorithm to determine transaction price as will be explained below.

The Naive Auction Mechanism
We introduce the naive auction mechanism, which is a well-known solution for the symmetric assignment problem [23].The virtue of the naive auction is to maximize the total benefit of all market participants.Inspired by this mechanism, in Section 3.2, we will show that AA sets a reasonable transaction price for LA and GA so that microgrids can be better off.The general symmetric assignment problem is as follows.Suppose that there are X persons and Y objects that need to be matched on the one-to-one basis.It is called symmetric because X = Y.Then, there is benefit u(l, m) for matching a person l ∈ X with an object m ∈ Y.The objective of the assignment problem is to find an assignment {(l, m)} for all persons and all objects that maximizes the total benefit, i.e., max ∑ l∈X u(l, m). ( In doing this, the persons compete for the objects.The price p m is associated with each object m and is updated by the bids of all persons during the auction.The actual value acquired by a person l allotted with an object m is the difference between the benefit u(l, m) and the price p m .Note that the actual value of a specific object m may be different depending on the person.
The bidding process for each person l ∈ X is to find an object m ∈ Y that maximizes the value, e.g., Then, the person l updates a bid increment b(l, m) for the object m as follows: where: Note that u l and w l represent the best object value and the second best object value.Here, > 0 is required to avoid infinite iterations in case two or more objects provide the same maximum value to the same person.In each iteration, p m is updated by the maximum bidding for the object m, and the person who bids the highest acquires the object.When all objects are allotted, the auction ends.

Transaction-Enabled OPF in Microgrid Energy Management (µEMS)
Now, we provide a general framework based on the distributed network layer, the market layer, and their interaction.

Solving OPF within an Individual Microgrid
To avoid unnecessary notational complexity, we do not use an additional notation to denote a specific microgrid, but the procedure in Section 3.1 should be done for all microgrids that want to participate in energy transaction.
µEMS of the microgrid aims to minimize the cost of generation, the cost of energy transaction from the main grid/other microgrids, and power losses.µEMS solves the following OPF problem at each time t ∈ T : Problem: OPF min subject to (2) − (4), ( 9) − (13), ( 15), where ξ g , ξ e and ξ p are weighting parameters.µEMS first considers the trading with DSO, so ρ(t) is initially given by TOU.We will see, however, that ρ(t) is updated in the market layer if energy transaction occurs at time t ∈ T .The OPF problem is nonconvex due to the quadratic equality constraint in Equation ( 12), and we relax the equality constraints to inequality constraints: Then, µEMS addresses the following convex relaxation problem, Problem: OPF-r min P(t),Q(t),v(t),l(t),s(t) subject to (2) − (4), ( 9) − (11), ( 13), ( 15), ( 22).
In case the branch thermal limit constraint is required, one can explicitly add the following convex inequality constraint: where S max ij is the branch thermal limit of branch ij [24].Note that the problem of OPF-r in Equation ( 23) is still a convex optimization.
In order to solve the problem in a distributed way as a scalable solution that can incorporate many DGs, we use the PCPM algorithm.PCPM is an iterative algorithm, and DGs and µEMS communicate to have an optimal scheduling.DG solves its optimal dispatch and µEMS solves the power flow including power losses and energy transaction.The optimization of energy scheduling is to obtain DG output power and net power imported/exported to have the minimum cost.Let k be an iteration index.At k = 0, DGs set their initial schedules randomly and communicate them to µEMS.µ i (t) and λ i (t) are the Lagrangian multipliers associated with the active and reactive power at bus i, respectively.At the kth iteration, µEMS sends two control signals μk to DGs where γ is a positive constant.Then, each DG solves the following problem for each t ∈ T , Sub-Problem: DG where μk i = ( μk i (t), t ∈ T ) and λk i = ( λk i (t), t ∈ T ).The optimal p * g and q * g (which are the solution of Sub-Problem: DG) are set as p k+1 g and q k+1 g , respectively.Then, µEMS solves the following problem for each time t ∈ T , Sub-Problem: µEMS min P(t),Q(t),v(t),l(t),s(t) ξ e C e (ρ(t), p e (t)) + ξ p ∑ (i,j)∈E r ij l ij (t) − ( μk (t) T p(t) − ( λk (t)) T p(t) subject to (9) − (11), ( 13), ( 15), ( 22), where μk (t) = ( μk i (t), i ∈ N \{e}) and λk (t) = ( λk i (t), i ∈ N \{e}).The optimal p * (t) and q * (t) are set as p k+1 (t) and q k+1 (t), respectively.At the end of the kth step, the generators communicate next schedules p k+1 g (t) and q k+1 g (t) to the µEMS, and the µEMS updates ) for all i ∈ N \{e}.Set k ← k + 1 and repeat the process until convergence.When the difference between the optimal s * g and the optimal s * (t) converges to zero, the above algorithm converges to an optimal solution to OPF, and it determines the optimal energy scheduling for an individual microgrid.

Setting Transaction Price for Microgrids
Before microgrids exchange their surplus/deficit energy with each other, since individual microgrid is a price-taker of TOU from the main grid, its energy scheduling and operating cost highly depend on the buying and selling prices of TOU.Then, the key task of AA is to determine a reasonable price on which all selling/buying microgrids in the market layer can agree.For example, where (x) + = max(x, 0), E(•) denotes the energy of LA/GA, and BP, SP, and MC represent the buying and the selling prices with DSO, and marginal cost of microgrids in GA, respectively.Intuitively, as the surplus energy of GA increases, new transaction price decreases, which, in turn, implies that microgrids in LA can reduce operating cost by paying less than the buying price with DSO through energy transaction.By doing so, all microgrids are certainly incentivized and better off by accepting the energy transaction.It does not change the result of OPF as long as the marginal cost of DG is constant because, as long as the offered price by AA is higher than the marginal cost of DG, the GA would be fully utilized.Similarly, from an LA perspective, as long as the offered price by AA is lower than the buying price with DSO, the LA would be fully utilized.We summarize the procedure of interaction between solving OPF and setting prices in the Algorithm [TE-OPF].In Section 4, we will demonstrate that the proposed combining approach successfully achieves operating cost reduction based on OPF and energy transaction.

Algorithm [TE-OPF]: Transaction-enabled optimal power flow
Solving OPF within an individual microgrid (distributed network layer)

Require:
The AA announces the initial buying and selling prices (TOU) to microgrids.Input: µ k i , λ k i and s k i (randomly initialized).

3:
The generator calculates its generation by solving the corresponding optimal dispatch problem.

4:
µEMS computes a new s k+1 (t) by solving the OPF problem.

5:
Generator reports a new schedule to µEMS.AA allows the main grid/DSO to supplement GA for the symmetrical assignment. 12: AA solves the symmetrical assignment problem and sets a transaction price.13: else if E(LA) < E(GA) then 14: AA allows the main grid/DSO to supplement LA for the symmetrical assignment.

15:
AA solves the symmetrical assignment problem and sets a transaction price.16: else E(GA) = E(LA)

Case Studies
So far, we have described the two-layer mechanism that involves both energy transaction and OPF.In this section, we present case studies based on the realistic topology of microgrids and system parameters, and then evaluate performances of different scenarios.
Figure 3a shows that two microgrids are connected to the main grid to reliably balance their own load and power generation.For example, microgrid 1 consists of a diesel generator, load, and PV, and microgrid 2 has a diesel generator, load, and WT.The marginal cost of diesel generators for microgrid 1 and microgrid 2 are $80 and $100, respectively.In our simulations, the time step is one hour, and we operate microgrids during the day, e.g., T = {1, ..., 24}.The maximum power of microgrid 1 and microgrid 2 are set to 4 MW and 1 MW, respectively.The ramping parameter r g is chosen to be 0.3 for all diesel generators in the microgrids.To be realistic, we use the DSO's electricity tariff from the Korea Electric Power Corporation (KEPCO), which reflects a TOU electricity pricing model [25].Microgrids can buy/sell their deficit/surplus energy directly from/to the main grid, and the buying and selling prices are shown in Figure 3b. Figure 3c shows detailed renewable generation information.It should be noted that our paper focuses on stationary analysis on optimal power flow within each microgrid and energy transaction among microgrids.For real operation, extreme scenarios and transient behaviors need to also be considered such as renewable energy outage or diesel generations in maintenance stage, etc., which are beyond the scope of this paper.
Based on power system parameters, we have four case studies as follows.Although microgrids solve economic dispatch by trading power with the main grid (Case 1), economic dispatch, per se, may result in electric overloads or inadequate voltage levels at local buses because it ignores the distribution line limits.In this regard, we solve an OPF of the microgrid to reduce unnecessarily high operating costs by optimizing the generation, while the distribution networks are considered to combine economic dispatch with power flow (Case 2).Note that Case 1 and Case 2 serve as two baselines, which correspond to the previous methods; Case 1 is the simplest one (economic dispatch) and Case 2 only considers OPF within a microgrid.Furthermore, Case 4 provides the minimum operational cost, which will be compared with our proposed algorithm.The transaction-enabled OPF algorithm enables the microgrids to exchange their local power with each other instead of trading power only with the main grid, especially when the microgrids can achieve cost-efficient and privacy-preserving operation (Case 3).Finally, the distributed scheme in Case 3 will be compared with a centralized energy system management (Case 4) in terms of system operating costs where two microgrids are assumed to be merged and collectively controlled.

Case 1: Without OPF nor Energy Transaction in Microgrids
In this baseline case, since microgrids cannot exchange their local energy with each other, TOU of DSO plays a main role in operating microgrids.In addition, considering only economic dispatch may possibly cause less economic or unreliable power system operation.Figure 4 shows 24 h energy scheduling when the microgrids are connected to the main grid.As can be seen, both microgrids have similar load patterns during the day.Note, however, that the generations of two microgrids are economically dispatched in different ways because it depends on TOU as well as different marginal cost and different renewable generation.Microgrid 1 is with PV and microgrid 2 is with WT, and their active generation times are also different: during a day vs. a night.Table 2 represents the operating costs for both microgrids.Next, we solve OPF to microgrids and evaluate the performance in terms of operating cost.Table 2. 24 hour operating cost in Case 1.

Case 2: Optimal Power Flow within Microgrids without Energy Transaction
In this case, microgrids consider the topological and electrical characteristics of power grid networks.Since energy transaction is not yet reflected between the microgrids, optimal energy scheduling is determined based on TOU of DSO.To consider the characteristics of a power distribution system, the voltage tolerance is set to be [0.95p.u., 1.05 p.u.].The parameters related to DG and power flow are chosen as ξ g = 1, ξ e = 1, ξ p = 1, and γ = 0.75.Figure 5 represents 24 h optimal energy scheduling based on the characteristics of the topology in Figure 3a.Microgrids utilize TOU of DSO and operate their internal network more efficiently and reliably, compared with Case 1.When the marginal cost of DG is more expensive than the buying price from DSO, the microgrid is willing to buy energy from DSO.When the microgrid has surplus renewable energy or the selling price of TOU is high, it optimizes power scheduling to minimize operating cost.Table 3 shows the operating cost of both microgrids.Compared with the baseline case, both microgrids reduce operating cost by $323.7 and $61.4,respectively, and total cost savings is $385.1.Next, we apply the transaction-enabled OPF algorithm to microgrids so that total cost can be reduced under a reliable system operation.Energy transaction between microgrids could lead to a considerable reduction of dispatch cost.In this case, we expect the synergy effect, which is achieved by combining OPF and energy transaction on microgrids.Given surplus/deficit generation in microgrids, we investigate energy transaction price between microgrids based on the naive auction-inspired algorithm.Figure 6 shows that the transaction prices incentivize microgrids to exchange their energy with each other instead of trading with the main grid/DSO.We notice that energy transaction between two microgrids occurs for 12 time slots during one day.For those slots that have no transaction record, we simply assign zero-prices for plotting purposes.Based on these transaction prices, the optimal energy scheduling for both microgrids is presented in Figure 7. Compared with Case 1 and Case 2, we can achieve further improvement of optimal energy scheduling for Case 3.This is possible because we not only consider diesel characteristics and voltage tolerance in the distributed network of microgrids, but also introduce a transaction process to reduce total operation cost.In the practical power system, Case 3 enables local microgrids to preserve their privacy information while securing power networks to avoid the voltage step change, which occurs on the sudden disconnection of a distributed generation or instantaneous over-current.Table 4 represents 24 h operating cost, which is certainly reduced compared with the previous cases.Suppose that an authorized entity has all information of components in microgrids to optimally balance load and generation while the distribution system is secured to combine economic dispatch with reliable power flow.Under the centralized OPF approach, Figure 8 shows 24 h optimal power scheduling, and Table 5 summarizes all the cases in terms of OPF, energy transaction, and total operating cost.Since the authorized entity does not necessarily need an additional transaction process, it can use information of marginal costs of microgrids as well as TOU of DSO.We notice that, although the centralized OPF is the ideal case, the proposed algorithm of Case 3 shows very close performance in terms of total operating cost, i.e., the gap is only 0.063%, which demonstrates the virtue of the proposed two-layer approach, i.e., transaction-based OPF operation.

Conclusions
In this paper, we proposed a novel framework for multiple microgrids, which is based on solving optimal power flow within a microgrid and energy transaction across microgrids.In doing this, we have used the PCPM algorithm for OPF and have proposed a naive auction-inspired algorithm for energy transaction.The transaction price is determined indifferently so that both microgrids can agree on the transaction price following the concept of the naive auction.To be realistic, we used a real topology of microgrids that have diesel generators, loads, and renewable generations such as solar and wind while considering TOU data from DSO.The transaction-enabled the OPF algorithm successfully reduced total operating cost while the distributed networks of microgrids remain secured.To validate the proposed approach, we compare the following cases: whether OPF is considered or not, whether energy transaction is considered or not, and, finally, all microgrids are combined into a single one (grand-microgrid).Our results showed that energy transaction based on the proposed transaction price successfully reduces the operational costs of both microgrids.Furthermore, the combined approach of OPF within a microgrid and energy transaction across microgrids achieve near-optimal performance compared to the case of the grand-microgrid; the performance gap is only 0.063%.This result is promising because while preserving the privacy of each microgrid, the total cost of microgrids can be kept as low as the ideal case.Our future work includes how to quantify the contribution of DSO in energy transaction and derive an appropriate transaction fee paid to DSO in order to acknowledge its role in balancing distribution networks.

Figure 3 .
Figure 3. (a) The topology of microgrids; (b) transaction price from the main grid; and (c) renewable energy profile.

Figure 8 .
Figure 8. Load profile and power scheduling based on the centralized optimal power flow.

Table 1 .
Summary of optimal power flow and energy transaction algorithm in literature.
AA determines the status of microgrids, e.g., either GA or LA.
i(t) are updated by the µEMS.7: end while 8: For each microgrid, surplus/deficit generation p k e (t) is calculated, and C k e is obtained by Equation (14).9: Every microgrid reports p k e (t) to AA. Setting prices for energy trading (market layer) Require: 10: if E(LA) > E(GA) then E(•) denotes the total surplus/deficit energy of GA/LA.11:

17 :
AA solves the symmetrical assignment problem and sets a transaction price.18: end if 19: AA announces new transaction price ρ * (t) to all microgrids.20: Surplus/deficit generation p * e (t) is exchanged between microgrids as well as the main grid/DSO.

Table 3 .
24 h operating cost in Case 2.

Table 4 .
24 h operating cost in Case 3.

Table 5 .
Summary of all cases.