A Multi-Market-Driven Approach to Energy Scheduling of Smart Microgrids in Distribution Networks

In order to coordinate the economic desire of microgrid (MG) owners and the stability operation requirement of the distribution system operator (DSO), a multi-market participation framework is proposed to stimulate the energy transaction potential of MGs through distributed and centralized ways. Firstly, an MG equipped with storage can contribute to the stability improvement at special nodes of the distribution grid where the uncertain factors (such as intermittent renewable sources and electric vehicles) exist. The DSO is thus interested in encouraging specified MGs to provide voltage stability services by creating a distribution grid service market (DGSM), where the dynamic production-price auction is used to capture the competition of the distributed MGs. Moreover, an aggregator, serving as a broker and controller for MGs, is considered to participate in the day-ahead wholesale market. A Stackelberg game is modeled accordingly to solve the price and quantity package allocation between aggregator and MGs. Finally, the modified IEEE-33 bus distribution test system is used to demonstrate the applicability and effectiveness of the proposed multi-market mechanism. The results under this framework improve both MGs and utility.


Introduction
The smart microgrid (MG) is one of the most efficient platforms to integrate distributed energy resources (DERs), such as solar photovoltaic, wind turbine, fuel cell, diesel generator, and microcombined heat and power units [1].In current distribution systems, with the aid of the advanced information communication technologies (ICT), the smart MGs enable bi-directional flow of power and information to facilitate optimal dispatch and energy transaction [2].Meanwhile, activation of the DERs by the electricity market mechanism is considered as one of the ways to compensate the intermittent behavior of renewable energy sources (RESs) and to decrease the reserve capacity provided by conventional power plants [3].Therefore, with the increasing proportion of MGs and DERs in the distribution network, new dispatch theories and market designs are becoming a research hotspot [4][5][6][7].

Problem Statement
MG owners desire to gain benefits through energy transactions and scheduling.However, there are requirements (such as minimum bid size volume) to take part in the wholesale market, e.g., the minimum contract in the Nordic day-ahead market is 0.1 MWh/h-these requirements might not be met by many small-scale MGs that desire to participate in the wholesale market [8,9].Hence, it is possible to participate in wholesale market transactions through an active resource portfolio.
From the perspective of the distribution network, the high penetration of local DERs, such as storage, electric vehicles (EVs), and controllable loads, has changed the traditional conception of the grid and increased the complexities of the distribution system [10].For instance, the gradually increasing small resources cannot be connected to the supervisory control and data acquisition (SCADA) system in the distribution network, and the distribution system operator (DSO) is thus facing new challenges to handle these small scale resources that may influence the overall running of the system [11].Therefore, the stability requirement of the system's operation increases.The work presented in this paper aims to achieve the MG's economic desire of energy scheduling by multi-market coordinated participation and to encourage them to provide ancillary services for distribution networks by coordinated multi-market participation.

Previous Work
There is a wide range of research covering the issue of energy scheduling for MGs in distribution networks.For economic energy dispatching, the vital parts mainly include the design of energy management system and the cost model, and various optimization methods and models have been already applied [12][13][14].In previous studies, the multi-agent approach and various game theories have been widely applied to the decision-making of energy scheduling.According to review of the literature [15], the multi-agent system paradigms have been advocated as a useful and promising tool.The authors in [16] propose a bi-level architecture for distributed management with MGs using multi-agent systems, and naive auctioning is used to match the buyers and sellers in a market environment.Moreover, game theory is an accepted theory to capture the MGs' competition in the energy transaction.For instance, cooperative game theory in [17] is studied to encourage MGs to participate in the regulated electricity market.The authors in [18] proposed a retail electricity market mechanism based on game theory for the optimal operation of MGs within active distribution networks.In [19], a coalitional game is formulated for power transfer among MGs, and the simulation shows the power loss was reduced by 31% relative to the non-cooperative case.Demand-response frameworks can also be established with game models, where MGs make bids, schedule power, and control load [20].
In the recent studies on energy management and transaction, the concepts of aggregator and virtual power plant (VPP) have received much attention for performing the optimal dispatching of DERs and demand response in the liberty electricity markets.In [21], aggregators manage the portfolio of DER in order to obtain the maximum benefit through participating in the day-ahead wholesale electricity market.In [22], a bi-level problem is chosen to formulate decision-making process for an EV aggregator considering different uncertain resources.Moreover, in the current distribution systems, considering the composition of multiple resources, the aggregator and VPP can use various strategies to achieve their objectives in the process of energy transactions in markets [23].
Regarding the ancillary services of the distribution grid, there are several studies that elaborate on the relationship between MGs and grid stability.The MGs with energy storage systems (ESSs) can undertake additional tasks, e.g., keeping the local voltage at a certain level, having a backup system for local critical loads, etc. [24].In [25], MGs are utilized to provide the ancillary service of voltage control, and a Stackelberg game bidding system is studied for decision-making.The optimal DER and energy storage management proposed in [26] can benefit power balance of grid.In recent research, a state-of-the-art technology named transactive energy was proposed for operational scheduling of resources with the aim of reducing energy cost and improving the stability of the distribution system through mechanisms of market or price control [27].
From the previous work, the strategies of MG energy scheduling are mostly focused on economic operation, and seldom consider the impact on the grid.In addition, the potential of MG energy dispatching and transactions have not been fully stimulated and the incentive mechanisms need to be improved.

Contribution
This work aims to address the aforementioned issues by designing a new multi-market participation framework to coordinate energy transactions and ancillary service support while focusing on fulfilling both the profits of MGs and the stability requirement of the distribution grid.The main contributions are as follows.
(1) The proposed multi-market-driven framework closes the gap between the internal ancillary services and external wholesale market participation.(2) Distributed MGs support the stability of services and centralized MGs participate in the wholesale market.(3) A distribution grid service market (DGSM) is designed to encourage the MGs to provide system operation stability services at the distribution level, and a dynamic Cournot-Bertrand auction is used to complete the clearing price and quantity.(4) How the aggregated MGs participate in the wholesale market is described, and a Stackelberg model is established to complete the price and energy quantity package allocation.
The rest of the paper is organized as follows: Section 2 introduces the proposed multi-marketdriven framework and the function of each component.MGs' transaction cost is modeled here for the preparation of price bidding and quantity allocation in market participation.The responsibilities of the DSO and the aggregator are also discussed in this section.Then, Section 3 describes the operation and auction process of the DGSM.Dynamic Cournot-Bertrand auctioning is studied in the whole competitive process, aiming to encourage the MGs to support ancillary services of the distribution grid.Based on the multi-market framework, MG participation in the wholesale market via an aggregator is described in Section 4. Bi-level bidding between aggregator and MGs is modeled to calculate the trading price and quantity allocation, and the equilibrium solution is found through the transformation of Karush-Kuhn-Tucher (KKT) condition.Furthermore, the tests and simulation are presented in Section 5, the results of which include clearing price, quantity allocation, and revenue of MGs.Finally, the key findings of this work and the future directions are summarized in Section 6.

The Multi-Market-Driven Framework for MGs
This section presents the general overview of the proposed market-driven framework (Figure 1) and introduces the main components of the framework.
The distribution grid service market (DGSM) organized by the DSO aims to address the negative impacts of intermittent DER integration and EV operation, e.g., voltage deviations, power unbalance, and transformer aging [28].Energy storage is an excellent choice as reserve power to enhance the system's robustness.The product requirement will be announced in the DGSM after the DSO finishes identifying the power qualities of the whole distribution grid.Then, the players can bid on the price and supply quantity in the market through an auction in the DGSM.The detailed process of the auction is discussed in Section 4.
In this study, the MGs participate in the wholesale market via an aggregator.A Stackelberg game is applied to complete the quantity allocation and trading price/tariff determination prior to MGs entry the wholesale market.The trading execution needs to be checked by the TSO and DSO to ensure the system's security.Section 5 will discuss the model and solution.
For encouraging MGs to contribute to the stability of the grid, the priorities of the DGSM are shown in Figure 2. At the first stage, the MGs run an internal auction after the DSO announces the product requirements.At the second stage, the MGs are aggregated to run the internal bidding for wholesale market participation.
MGs. Finally, the key findings of this work and the future directions are summarized in Section 6.

The Multi-Market-Driven Framework for MGs
This section presents the general overview of the proposed market-driven framework (Figure 1) and introduces the main components of the framework.The distribution grid service market (DGSM) organized by the DSO aims to address the negative impacts of intermittent DER integration and EV operation, e.g., voltage deviations, power unbalance, and transformer aging [28].Energy storage is an excellent choice as reserve power to enhance the system's robustness.The product requirement will be announced in the DGSM after the DSO finishes identifying the power qualities of the whole distribution grid.Then, the players can bid on the price and supply quantity in the market through an auction in the DGSM.The detailed process of the auction is discussed in Section 4.

MGs aggregator
In this study, the MGs participate in the wholesale market via an aggregator.A Stackelberg game is applied to complete the quantity allocation and trading price/tariff determination prior to MGs entry the wholesale market.The trading execution needs to be checked by the TSO and DSO to ensure the system's security.Section 5 will discuss the model and solution.
For encouraging MGs to contribute to the stability of the grid, the priorities of the DGSM are shown in Figure 2. At the first stage, the MGs run an internal auction after the DSO announces the product requirements.At the second stage, the MGs are aggregated to run the internal bidding for wholesale market participation.

DSO in the Market
The DGSM organized by the DSO encourages the MGs to supply the service for certain nodes.The DSO's responsibilities are: (1) Modelling the distribution system: the detailed model of the entire system (such as the buses, lines, transformers, the RES, etc.) will help to analyze the system's performance; (2) Power flow and quality identification: based on the system model and analysis software, the DSO solves the power flow and assesses the power quality (e.g., voltage imbalance, under-voltage, over-voltage); (3) Monitoring: the system's running data and users' terminal data need to be collected, stored, and analyzed; (4) DGSM organizing: the DSO is responsible for releasing the products of the stability in the DGSM and clearing the price in each auction.
In this work, we assume that the node voltages are controlled by the active power injected into the special nodes of the system, where the power factor of the loads (e.g., the prosumer's residential loads) is near 1.The power flow of node j can be seen in Figure 3. Hence, the DSO announces the product requirement, called "voltage-positive power control" in DGSM.

( )
V j S h is the power needed to be calculated and injected at the node to bring the voltage to the normal ( min max ( ) ) state.

DSO in the Market
The DGSM organized by the DSO encourages the MGs to supply the service for certain nodes.The DSO's responsibilities are: (1) Modelling the distribution system: the detailed model of the entire system (such as the buses, lines, transformers, the RES, etc.) will help to analyze the system's performance; (2) Power flow and quality identification: based on the system model and analysis software, the DSO solves the power flow and assesses the power quality (e.g., voltage imbalance, under-voltage, over-voltage); (3) Monitoring: the system's running data and users' terminal data need to be collected, stored, and analyzed; (4) DGSM organizing: the DSO is responsible for releasing the products of the stability in the DGSM and clearing the price in each auction.
In this work, we assume that the node voltages are controlled by the active power injected into the special nodes of the system, where the power factor of the loads (e.g., the prosumer's residential loads) is near 1.The power flow of node j can be seen in Figure 3. Hence, the DSO announces the product requirement, called "voltage-positive power control" in DGSM.S V j (h) is the power needed to be calculated and injected at the node to bring the voltage to the normal (V min ≤ V j (h) ≤ V max ) state.
The power balance constraint at node j is where S tran j (h) is the power of node j from transformer, the right side of the formula is the power exchange between grid and customers, it includes all electricity types of customers (e.g., EV, renewable, load, etc.) and power loss.
In this work, we assume that the node voltages are controlled by the active power injected into the special nodes of the system, where the power factor of the loads (e.g., the prosumer's residential loads) is near 1.The power flow of node j can be seen in Figure 3. Hence, the DSO announces the product requirement, called "voltage-positive power control" in DGSM.
( ) V j S h is the power needed to be calculated and injected at the node to bring the voltage to the normal ( min max ( ) ) state.

Aggregator
As shown in Figure 1, the aggregator's aim is to act as a global controller and broker for the MGs.Fast and reliable two-way communication channels can be developed as per the IEC 61850 standard, which standardizes the logical nodes and communication combinability of different DERs [29].The aggregator needs to provide a software platform to interface with both internal MG operators and external parties, such as the wholesale market, DSO, etc.The main functions include: (1) basic interface function: user loading and interface, database service, message and report service, monitoring and alarming, etc.; (2) calculation and configuration function as a broker: conducting the optimization process in each auction process, forecasting the bidding price in the wholesale market, clearing price calculation, configuration of the trading quantity and price, etc.; (3) control and dispatch function: the function is implemented as a closed loop control algorithm aiming at making the energy dispatch comply with the schedule.Meanwhile, the communication with the DSO and point of common coupling (PCC) is maintained.
In this work, the aggregator's final price-quantity block offers in the wholesale market are determined as follows: where the quantity block wE aggregator (h) offered by the aggregator in the wholesale market is the sum of the MGs quantity packages.To ensure the profit of the aggregator, the bidding price wP aggregator (h) in the wholesale market should be the multiplication of the coefficient α by the average bidding price of all MGs.As a broker and controller entirely serving for the MGs to participate the wholesale market, the aggregator needs to profit by the price margin, thus α is generally set to a number greater than one.

MGs Scheme
MGs are the main players in the proposed markets.They are normally connected to a bus of the underlying distribution network by the PCC in the distribution grid.The participants can be of various types and scales, e.g., commercial MG or residential MG.
The cost function of micro-generation sources in MGs depends on their various types and technologies, including fuel cells, diesel generators, wind turbines, solar panels, etc.As an example, a diesel generator can be modeled by a quadratic function [30].In this work, to abstract the cost function, we consider the general cost function of a MG as: where a i determines the rate of cost increase, b i is the cost variation, and c i represents the fixed cost.The cost function is in quadratic form when b i = 1.
An ESS equipped in an MG can absorb any surplus energy from the generators.Obviously, the state of charge (SOC) of the ESS needs attention during charging/discharging process.The SOC update function in time interval h can be described as: where Equation ( 5) represents the charging mode of an ESS at time slot h, when the charging power P ESS i (h) is positive.η c is the charging efficiency; Equation ( 6) represents the ESS in discharging mode at time slot h, when the discharging power P ESS i (h) is negative.η d is discharging efficiency.In this work, each MG develops its own charging and discharging strategy, but arbitrage operation of the ESS is out of the scope of this work.The excess energy of MGs is used for charging until the ESS is fully charged.The stored energy is used to meet the DGSM requirements and local demand when the generation is lower than the demand.The MG operator buys energy from the utility company when there is insufficient energy from the local generation and ESS.
In addition, when the aggregated MGs trade energy in the wholesale market, the available range of the trading quantity is where the right side of the equation represents the surplus energy of MG i for trading, ω i is the penetration rate of the controllable load in MG i, in practice, ω i is adjusted to match the trading quantity operation according to the demand response signal.Hence, the total revenue of the MG i is the sum of the revenues in both wholesale market and the DGSM:

Distribution Grid Service Market (DGSM) Operation
The aims of the DGSM not only provide the product to support the local system's stability but also provide a competitive price to encourage participation.In this section, the detailed operation and the auction algorithm in the DGSM are studied.

Problem Formulation in the DGSM
After the DSO announces the requirements in the DGSM, the players will submit their bid-quantity packages with the objective of maximizing profit: where DP i,j (h) is the price paid to MG i connected to node j for discharging 1 kW at time slot h.C ESS i,j is the average cost of ESS i for releasing 1 kWh energy.S V i,j (h) is the injected power of MG i to node j at time slot h.
Having received all the offers, the DSO will calculate the purchase quantities from each player based on the objective of minimization the total purchasing cost: In this study, the market operation problem defined by ( 9) and ( 10) can be mathematically described as (11) to maximize the MGs' revenue, and (12) to minimize the DSO's cost: where the MGs' objective is subjected to constraints ( 5) and ( 6) in Section 2.3.The purchased energy is subjected to the power balance constraints (1) in Section 2.3.In addition, the price bid DP i,j (h) of players is limited as: where the bid range normally depends on the ESS cost of MG i. Besides, the required energy for voltage support S V j (h) in the DGSM cannot exceed the available energy of the ESS injected to node j:

Dynamic Cournot-Bertrand Auction
Each MG (player) bids its price independently from the others and the quantity allocation accordingly needs to be completed during the auction process.Therefore, this kind of game can be modeled as production and price auctions using a dynamic Cournot-Bertrand auction.The auction process is shown in Algorithm 1. Having received all of the player's bids, the DSO starts an auction by solving the programing model mentioned in (12) and notifies each player with the accepted purchase quantity packages.Input: MG parameters (S V j (h), C ESS i,j , E ESS i,j (h), DP min i,j (h)/DP max i,j (h), N j ) 2.
For: MG i,j do

3.
DP i,j = DP 0 , End for 4. DSO solves (12) and broadcasts the S i,j (h) to each player

5.
For i = 1: MG i,j do
Player i updates its bidding using (15) 8.

End for 9.
For t = 0: do (Reaching Nash Equilibrium) 10.For i = 1: MG i,j do 11.player i estimates its profit change using ( 16 Each player calculates their profit with (11) and updates their bid as follow: where S rating i,j is the available power MG i can deliver, the value is normally set as the SOC.δ expresses an update speed adjustment parameter.After receiving the new bid from the MGs, the DSO resolves the game and posts a new S V i,j to each player.Each player can calculate the profit change with: When the change value ∆R i,j becomes very small, the player will stop bidding.When the players have no motive to update their bidding, we indicate that the game has reached the Nash Equilibrium, i.e.,DP i,j (h) = DP NE i,j (h).Finally, the DSO announces the market clearing price as:

Day-Ahead Wholesale Market Participation
The aggregator can represent MGs in the day-ahead wholesale market.In this work, the internal price and trading quantity allocation between the aggregator and each MG needs to be completed before the aggregator submits the schedule to the wholesale market.The process is shown in Figure 4.
The aggregator sets the initial tariff-in price and load price for each MG based on the historical price and prediction information.Moreover, the aggregator sets the internal bidding constraints for ensuring the profit.Stackelberg-type bidding is established in the internal bidding process, which includes the price bidding of the aggregator (leader) and the trading quantity of MGs (followers), i.e., the MGs' response to the trading quantity according to the tariff price that the aggregator made at time slot h.Then, the aggregator optimizes the tariff price based on the reaction of the MGs at time slot h.MGs optimize their trading quantity independently based on their respective cost models.After the equilibrium solution is reached, whether to break constraints will be negotiated.Renewed parameters of the model will be used to resolve the game if modification is necessary.Obviously, the time limit of the bidding is a strong constraint to end the bidding.before the aggregator submits the schedule to the wholesale market.The process is shown in Figure 4.
The aggregator sets the initial tariff-in price and load price for each MG based on the historical price and prediction information.Moreover, the aggregator sets the internal bidding constraints for ensuring the profit.Stackelberg-type bidding is established in the internal bidding process, which includes the price bidding of the aggregator (leader) and the trading quantity of MGs (followers), i.e., the MGs' response to the trading quantity according to the tariff price that the aggregator made at time slot h.Then, the aggregator optimizes the tariff price based on the reaction of the MGs at time slot h.MGs optimize their trading quantity independently based on their respective cost models.After the equilibrium solution is reached, whether to break constraints will be negotiated.Renewed parameters of the model will be used to resolve the game if modification is necessary.Obviously, the time limit of the bidding is a strong constraint to end the bidding.

The Model of Stackelberg
The trading price bidding strategy of the aggregator (leader) can be expressed as:

The Model of Stackelberg
The trading price bidding strategy of the aggregator (leader) can be expressed as: minF(wp i (h), E i (h)) (18) where wP i (h) =[wp 1 (h), wp 2 (h), • • •, wp n (h)] denotes a set of trading price bidding for each MG and E(h) is the equilibrium of trading quantity bidding.The utility objective is to minimize the running cost of the aggregator: where the cost F includes the total tariff fee of the MGs (F 1 ) and the revenue of the aggregator in the wholesale market (F 2 ).The price bidding is subject to: The MGs (followers) make the quantity decision according to the trading price broadcasted by the aggregator, and the following objective function can be expressed mathematically as: where is the set of the MGs' trading quantity, wp(h) is the equilibrium of price bidding model.The utility function of MGs is to maximize their profit, which can be mathematically written as where the cost C(E i ) has been formulated as (4), and E i (h) is subject to the constraint (7) in Section 2.3.

Equilibrium Solution
In this game model, the strategy space for leaders and followers has been defined as a non-empty compact convex set, i.e., given the leader's strategy, the optimal solution of the model ( 21) exists and is unique, and given the follower's strategy, the optimal solution of the model (18) exists and is unique.Therefore, the model has a unique equilibrium solution.The problem can be reformulated by replacing the lower-level optimization problem with its KKT conditions, resulting in the following problem: where h(wp i , E) is the constraints set of the followers in the model, and k(wp i , E) is the constraints set of the leader.λ l is the Lagrange multiplier, and The reformulation can be solved by the Mathematical Program with Equilibrium solver of General Algebraic Modeling System (GAMS) software [31].

Tests and Results
To test the mechanism proposed in this work, the IEEE 33-bus 12/66 kV radial distribution system, on the basis of appropriate modifications shown in Figure 5, is used to carry out the required analysis.
The technical information and data can be found in [32].Five distinct MGs are located at the 12th, 20th, 24th, 30th, and 32nd buses respectively.All MGs are all equipped with ESSs whose charge and discharge capacity are limited between 20% and 80% of total capacity for optimizing the performance.The detailed parameters of MGs can be seen in Table 1.In this test, the generator output data in MGs reference the Open Energy Information (Open EI) [33].As the buses from the 26th to 33rd are under a same primary transformer, the MGs hang on these buses can be as the participants in the DGSM when the DSO announces the products requirement for one of buses from 26th to 33rd.In this work, the DSO announces the "voltage-positive power control" product in the DGSM after the power quality of the distribution grid is identified.

For the DGSM Participating
The product requirement announced by the DSO is voltage support for the 31-bus.MG3 and MG4 thus are the suppliers in DGSM.The parameters

For the DGSM Participating
The product requirement announced by the DSO is voltage support for the 31-bus.MG3 and MG4 thus are the suppliers in DGSM.The parameters DP min i,j (h) and DP max i,j (h) are evaluated based on the cost recovery of the different ESSs and the incentive of the DGSM.We set the same values of 50 cents/kWh and 105 cents/kWh, respectively, for MG3 and MG4.In this test, the optimized charge and discharge of the ESSs for arbitrage are out of the scope, as the arbitrage operation may influence the market and price.Moreover, according to the operation of the ESS descried in Section 2.3, the capacity requirement is ensured before they begin to provide the products to the DGSM.
Taking 4 a.m. as an example, the required power is 56.4 kW.The dynamic Cournot-Bertrand auction shown in Algorithm 1 in Section 3.2 has been implanted with MATLAB codes; the Nash equilibrium is reached when the two players (MG3 and MG4) conducted 313 automatic bidding rounds.The final calculated market clean price is 79.52 cents.The purchase quantity packages are 25.9 kW from MG3 and 30.5 kW from MG4.From Figure 6, the auctions are repeated subsequently at 6 p.m., 10 p.m., and 11 p.m.The results are shown in Table 2.
Taking 4 a.m. as an example, the required power is 56.4 kW.The dynamic Cournot-Bertrand auction shown in Algorithm 1 in Section 3.2 has been implanted with MATLAB codes; the Nash equilibrium is reached when the two players (MG3 and MG4) conducted 313 automatic bidding rounds.The final calculated market clean price is 79.52 cents.The purchase quantity packages are 25.9 kW from MG3 and 30.5 kW from MG4.From Figure 6, the auctions are repeated subsequently at 6 p.m., 10 p.m., and 11 p.m.The results are shown in Table 2.

Wholesale Market Participants
To simplify this process, the penetration rate of the controllable load of each MG ω i is set as 25% and the cost is a quadratic function of the trading quantity.The result of the MGs' trading quantity is shown in Figure 7.The energy trading quantity includes the power generation of RES and controllable generators.Due to the randomness and uncontrollability of the new energy output in the microgrid, according to the strategy of trading quantity in this work, the situation of abandoning renewable energy sources may occur.

Wholesale Market Participants
To simplify this process, the penetration rate of the controllable load of each MG i  is set as 25% and the cost is a quadratic function of the trading quantity.The result of the MGs' trading quantity is shown in Figure 7.The energy trading quantity includes the power generation of RES and controllable generators.Due to the randomness and uncontrollability of the new energy output in the microgrid, according to the strategy of trading quantity in this work, the situation of abandoning renewable energy sources may occur.The aggregator optimizes the trading price (the values also can be considered as the tariff-in of MGs) and load price for MGs are shown as Figure 8.In the whole day, the bidding price of the various MGs presents different price ranges and the differentiation revenue has also been reflected accordingly.For example, with a higher cost function of MG5 in the Stackelberg model, the bidding The aggregator optimizes the trading price (the values also can be considered as the tariff-in of MGs) and load price for MGs are shown as Figure 8.In the whole day, the bidding price of the various MGs presents different price ranges and the differentiation revenue has also been reflected accordingly.For example, with a higher cost function of MG5 in the Stackelberg model, the bidding price ranges from 25 cents/kWh to 50 cents/kWh, which is always higher than other units.In some time periods, most MGs increase their bidding price, e.g., the market load price increases at 3-5 p.m., the aggregator changes the bidding range to encourage MGs to increase their trading quantity.Before entry to the day-ahead market, the strategies of bidding price and quantity should be completed as in formula (3) in Section 2.1.In this test, the coefficient of the aggregator's bidding price,  , is set to 1.1 to get appropriate differential profits from the wholesale market.The trading quantity is the sum of the final MGs' bidding results, which are shown in Figure 9.According to the results of the trading quantity and the price in the multi-markets, Figure 10 shows the contrast formation of revenues of how much MG3 and MG4 get in the single and multimarket.The revenues of MG3 and MG4 in the multi-market increased by 9.1% and 12.7% compared to only participating in the single wholesale market.Therefore, the MGs' owners can reduce the time to recoup their costs in the multi-market environment.Before entry to the day-ahead market, the strategies of bidding price and quantity should be completed as in formula (3) in Section 2.1.In this test, the coefficient of the aggregator's bidding price,  , is set to 1.1 to get appropriate differential profits from the wholesale market.The trading quantity is the sum of the final MGs' bidding results, which are shown in Figure 9.According to the results of the trading quantity and the price in the multi-markets, Figure 10 shows the contrast formation of revenues of how much MG3 and MG4 get in the single and multimarket.The revenues of MG3 and MG4 in the multi-market increased by 9.1% and 12.7% compared to only participating in the single wholesale market.Therefore, the MGs' owners can reduce the time to recoup their costs in the multi-market environment.Before entry to the day-ahead market, the strategies of bidding price and quantity should be completed as in formula (3) in Section 2.1.In this test, the coefficient of the aggregator's bidding price, α, is set to 1.1 to get appropriate differential profits from the wholesale market.The trading quantity is the sum of the final MGs' bidding results, which are shown in Figure 9.
According to the results of the trading quantity and the price in the multi-markets, Figure 10 shows the contrast formation of revenues of how much MG3 and MG4 get in the single and multi-market.The revenues of MG3 and MG4 in the multi-market increased by 9.1% and 12.7% compared to only participating in the single wholesale market.Therefore, the MGs' owners can reduce the time to recoup their costs in the multi-market environment.

Conclusions and Future Work
This paper presented a multi-market-driven MG energy schedule including distributed and centralized market participation, which closed the gap between the internal ancillary services market and external wholesale market.A DGSM organized by the DSO encourages the distributed MGs with ESSs to provide local grid stability services through the price incentive mechanism.Furthermore, the MGs could simultaneously trade their energy in the day-ahead wholesale market via an aggregator, for which the price and quantity bidding was formulated by a Stackelberg model before entry to the wholesale market.The results demonstrated that the proposed approach could not only mitigate the negative impacts of the intermittent resources, but also help to increase the revenue of MGs.
With the increasing number of small-scale MGs and prosumers in the distribution network, the proposed multi-market framework and schedule strategies may be of high applicability in a real environment.In addition, due to the characteristics of fast response and stable control in MGs, the products of MGs (such as demand response, balance services, reactive power injection, frequency regulation, etc.) could be developed within the market mechanism, which are our future research directions.

Figure 1 .
Figure 1.The proposed architecture of participating markets for microgrids (MGs).Figure 1.The proposed architecture of participating markets for microgrids (MGs).

Figure 1 .
Figure 1.The proposed architecture of participating markets for microgrids (MGs).Figure 1.The proposed architecture of participating markets for microgrids (MGs).

Figure 2 .
Figure 2. The process of market participation for MGs.

Figure 3 .
Figure 3.The power flow of the node with voltage deviations.

Figure 2 .
Figure 2. The process of market participation for MGs.

Figure 3 .
Figure 3.The power flow of the node with voltage deviations.Figure 3. The power flow of the node with voltage deviations.

Figure 3 .
Figure 3.The power flow of the node with voltage deviations.Figure 3. The power flow of the node with voltage deviations.

startFigure 4 .
Figure 4.The bidding process of price and trading quantity.

Figure 4 .
Figure 4.The bidding process of price and trading quantity.
h are evaluated based on the cost recovery of the different ESSs and the incentive of the DGSM.We set the same values of 50 cents/kWh and 105 cents/kWh, respectively, for MG3 and MG4.In this test, the optimized charge and discharge of the ESSs for arbitrage are out of the scope, as the arbitrage operation may influence the market and price.Moreover, according to the operation of the ESS descried in Section 2.3, the capacity requirement is ensured before they begin to provide the products to the DGSM.Taking 4 a.m. as an example, the required power is 56.4 kW.The dynamic Cournot-Bertrand auction shown in Algorithm 1 in Section 3.2 has been implanted with MATLAB codes; the Nash equilibrium is reached when the two players (MG3 and MG4) conducted 313 automatic bidding rounds.The final calculated market clean price is 79.52 cents.The purchase quantity packages are 25.9 kW from MG3 and 30.5 kW from MG4.From Figure 6, the auctions are repeated subsequently at 6 p.m., 10 p.m., and 11 p.m.The results are shown in Table 2 .
power to support the voltage at the node 31

Figure 5 .
Figure 5.The modified IEEE 33-bus distribution test system.

Figure 6 .
Figure 6.Required active power to support the regulated voltage for 31-bus.

Sustainability 2019 , 15 Figure 6 .
Figure 6.Required active power to support the regulated voltage for 31-bus.

Figure 7 .
Figure 7.The results of MGs' trading quantities.

Figure 7 .
Figure 7.The results of MGs' trading quantities.

Figure 9 .
Figure 9.The bidding strategies of the aggregator in the day-ahead wholesale market.

Figure 9 .
Figure 9.The bidding strategies of the aggregator in the day-ahead wholesale market.

Figure 9 .
Figure 9.The bidding strategies of the aggregator in the day-ahead wholesale market.

Sustainability 2019 , 15 Figure 10 .
Figure 10.Revenue comparison of two kinds of market participation.
Power purchase from each player S i,j (h), market clearing price DP MCP (h)

Table 1 .
The modified IEEE 33-bus distribution test system.Basic parameters of MGs.

Table 1 .
Basic parameters of MGs.

Table 2 .
Bidding results of MG3 and MG4 in the distribution grid service market (DGSM).

Table 2 .
Bidding results of MG3 and MG4 in the distribution grid service market (DGSM).
injected power of node j from the transformer, customers at time slot h S loss j (h) power loss of node j at time slot h wE aggregator (h) aggregator's trading energy quantity in the wholesale market at time slot h wP aggregator (h) aggregator's trading price in the wholesale market at time slot h E i (h) trading energy quantity of MG i at time slot h wP i (h) trading price of MG i at time slot h a i , b i , c i generator cost parameters in MG i Power generation of MG i at time slot h ω i penetration rate of controllable load of MG i R i,j (h) revenue of MG i connected to node j in DGSM at time slot h wR i (h) revenue of MG i in wholesale market R total i total revenue of the MG i in the multi-market DP i,j (h) price paid to MG(i) connected to node j for discharging 1 kWh at time slot h C ESS i average cost of 1 kWh power for ESS i S V i,j (h) the injected power of MG i to node j at time slot h DP min i,j (h), DP max i,j (h) limit of bidding price in the auction of DGSM reference power value that MG i can deliver