Consensus Algorithm-Based Distributed Operation of Microgrids During Grid-Connected and Islanded Modes

The existing distributed operation schemes for microgrids lack the ability to determine the power selling to the grid during normal operation mode and are unable to provide service reliability to critical loads, during islanded operation mode. In order to overcome these issues, in this study, we have proposed a distributed operation method for both grid-connected and islanded modes of microgrids. Unlike the existing studies, where the utility grid is considered as a dispatchable generator, the bi-directional flow of power with the grid is considered in this study. Similarly, different load agents are considered for different priority loads to assure the service reliability to the critical loads during islanding. A two-step operation method is proposed for both grid-connected and islanded mode operations. During the first step, each agent in the network shares information with its neighboring agents to determine the total load and available renewable power in the network. Whereas, in the second step, each agent in the network determines the optimal operation points based on the local information received from the neighboring agents. Moreover, a modified cost function for the battery is also proposed in this study, which utilizes the information of market price and load to enhance the battery operation. A comparison is made between the centralized method, conventional distributed method, and the proposed distributed operation method. Simulation results have proved the effectiveness of the proposed method for realizing distributed operation for microgrids in both grid-connected and islanded modes.


BESS
The trend of adopting low carbon generation technology and high-efficiency devices in the power system has encouraged to adopt more renewable generation, distributed generation, and energy storage system. Due to the ability to sustain the high penetration of renewables, microgrids are gaining popularity [1]- [3]. A microgrid can operate in both grid-connected and islanded modes and can assure service reliability to the critical loads during system contingencies [3], [4]. During grid-connected operation, the power balance is maintained by trading power with the utility grid [5]. However, due to the intermittent nature of renewables and the limited capacity of storage, load shedding may be expected during peak load intervals while operating in islanded mode [6]. In addition to maintaining the power balance in the network, it is necessary to assure that the microgrid network is operating at an optimal cost. There exists plenty of literature on the optimal operation of microgrids [7]- [10]. Most of the studies make use of centralized approaches that have been effective so far for conventional power systems. However, the centralized approach may face several challenges in its application in microgrids. The centralized approach requires a central controller to collect all required information, hence the computation burden on the central controller gets increased significantly [11]. Moreover, the system becomes more fragile to single point failure and protecting the privacy of the consumer becomes the main concern [11]. In order to overcome these issues, another approach is considered, where the decisions are made in a decentralized/ distributed way [12], [13]. In decentralized approach, each unit is controlled by its local controller and the actions are based only on local information. In addition, the distributed methodologies are more adaptive to configuration changes and are feasible to implement on large scale systems [11].
Recently, researchers have proposed various distributed strategies to determine the optimal operation of the microgrid network [8], [14]- [17]. In [8], authors have proposed an alternating direction method of multipliers (ADMM) based distributed operation for an islanded microgrid. In [14], authors have proposed an incremental cost consensus algo-rithm to solve the economic dispatch problem in a microgrid. It requires a leader to collect the power mismatch to determine the optimal scheduling of components in the microgrid. Authors in [15] have proposed a consensus + innovations framework, for the distributed operation of a microgrid, where agents participate in a collaborative process of neighborhood information exchange and local computation. In [16], the authors have proposed a consensus algorithm-based operation method to solve the power allocation between distributed energy storage systems. The proposed algorithm is not fully distributed as a leader agent is deployed to determine the network's power mismatch. Authors in [17] have proposed a gradient method for distributed resource allocation. Authors have focused on determining the proportional weights on the edges (scaling factors for the gradient method), to make the distributed algorithm convergence as fast as possible. Authors in [18] have considered communication delays while studying the economic dispatch for a microgrid network.
Although several types of research have been carried out on distributed operation of microgrids but still have some limitations and are not appropriate to implement on certain networks. Most of the existing studies have focused on the distributed operation of islanded microgrids [6], [8], [19] where the power trading with the utility grid is not possible. The existing studies for islanded microgrid, have not considered the critical and non-critical nature of loads. During islanding, it is necessary to provide service reliability to critical loads, the critical loads should always be served first followed by the non-critical loads. The algorithms developed in the literature for the distributed operation of islanded microgrids lack the ability to provide service reliability to critical loads thus the main purpose of islanding is not achieved. Some of the existing studies have focused on grid-connected microgrids but have only considered power buying form grid. Such studies have considered the utility grid as a large-scale distributed generator with a quadratic cost function. Power bought from utility grid is determined using the cost function on the other hand it is not possible to determine power selling to the utility grid. In literature, different cost functions have been proposed to model battery's operation [9], [10], [20]. These functions utilize the information of only state of charge (SOC) and/or charging/ discharging power. However, this limited information is not enough and limits the operation of the battery.
In this paper, a distributed operation method for both gridconnected and islanded microgrids is proposed. In case of connection failure with the main grid, the microgrid network operates in an islanded mode and load shedding is performed because of power shortage. For grid-connected mode operation, a grid agent is considered in this study, which diffuses the information of market price into the microgrid network. The optimal operation point for each physical device is determined based on the convergence of the marginal cost. Whereas, for islanded mode operation, a welfare maximization-based distributed operation method is proposed. Unlike the grid-connected mode operation, two load agents are considered for critical and noncritical loads and are modeled using a welfare function. The operation methods for both grid-connected and islanded modes are divided into two main steps which are information sharing and optimal operation. The total demand and renewable power generation is determined through the process of information sharing, in the first step via consensus algorithm. Whereas, in the second step, the optimal scheduling of each component is determined using the consensus algorithm. In order to determine the effectiveness of the proposed distributed operation method, the results of the proposed method are compared with the centralized operation method and the conventional distributed operation method. The main contribution of this study are as follows.
• In existing studies, the algorithms proposed for the distributed operation of grid-connected microgrid lacks the ability to determine power selling to the main grid [21]- [23]. However, the proposed distributed algorithm can determine the bi-directional power trading with the main grid.
• In contrast to the existing distributed operation studies [6], [8], [17], where critical nature of loads is not considered, this study uses welfare function to model the critical and noncritical nature of loads. The proposed algorithm can assure the service reliability to critical loads during islanding.
• In the existing studies [9], [10], [20], the cost functions of battery utilize the information of SOC and/or charging/discharging power only. This information is not enough and limits the battery's operation. Therefore, we have proposed a modified cost function for battery and the battery's operation is enhanced by utilizing the proposed cost function.
The paper is organized as follows. Section II gives the detailed modeling of system and participating agents. In the end of section II, tradition economic dispatch problem for microgrids is also discussed. In section III, the proposed distributed operation for grid-connected and islanded modes is explained. Simulation results are included in section IV, whereas in section V, a comparative study between the proposed distributed operation method, centralized operation method, and the conventional distributed operation method is discussed and analyzed. Section VI concludes the paper.

II. SYSTEM MODEL AND PROPOSED DISTRIBUTED OPERATION METHOD A. SYSTEM MODEL
The microgrid network consisting of N components, where n can be any finite number, is considered in this study as shown in Fig.1, where the microgrid network can operate both in grid-connected and islanded modes. The microgrid network contains a battery energy storage system (BESS), a dispatchable generator (DG), renewable energy generators (RDGs), and different priority loads. Each unit in the micro- grid network is controlled by a local controller i.e. agent. Each agent is responsible for sharing required information with its neighboring agents and to determine the optimal set points for its unit, based on local information. A ring topology communication network is considered for communication between agents in this study, as shown in Fig.1.

B. AGENTS DESCRIPTION AND MODELLING 1) GRID AGENT
Grid agent (GA) controls power trading between the utility grid and the microgrid network and is only active when the microgrid network is operating in grid-connected mode. Additionally, this agent is responsible for sharing the market price information to its neighboring agents. The market price being offered by the utility is modeled as a linear function, with a constant marginal cost, as described in Equations (1) and (2), respectively.
where, ρ is the market price offered by the utility grid, P Grid is the power bought (P Grid > 0) and sold (P Grid < 0) to the utility grid. C Grid is the cost of power bought from the utility grid (P Grid > 0) or the profit of selling power to the utility grid (P Grid < 0).

2) DISPATCABLE GENERATOR AGENT
Dispatchable generation agent (DGA) is associated with conventional distributed generation units such as a diesel generator. This agent is able to control the power generated by DG, in order to meet the power demand of the network. In addition, this agent is also responsible for sharing the current marginal cost and local power mismatch with the neighboring agents. The generation cost associated with a DGA is modeled as a quadratic function, as given in Equation (3). DGA has linear marginal cost function (4), which is the derivative of its quadratic cost function and its current value is shared VOLUME 8, 2020 with the neighboring agents. In the case of multiple DGAs in the network, each agent is modeled with a different cost function, which is not shared with other agents in the network. The maximum and minimum operation bounds for a DG are given in Equation (5).
where, C DG is the generation cost of a DG, a, β, γ are the quadratic cost coefficients, P DG is the power generated by DG and ∂C DG /∂P DG is the marginal cost of DG. P min DG and P max DG are the lower and upper generation limits for power generation from DG.

3) RENEWABLE AGENT AND LOAD AGENT FOR GRID-CONNECTED MODE
During the process of information sharing, renewable agent (RA) is responsible for sharing the forecasted renewable power information to its neighboring agents. Renewable energy generation is free of cost; therefore, there is no cost associated with renewable power generation. For the sake of simplicity, renewable power is taken as a negative load. The information of renewable power is required for the initialization variables, before the second step i.e. optimal operation. However, during the second step, the RA helps the network reach consensus, by sharing the information of marginal cost and local power mismatch. The RA updates and shares the information of marginal cost and local power mismatch in a similar way as other agents in the network. However, RA does not update the power, which remains zero at each iteration. The information of renewable power is utilized to determine the net demand and the information of net demand is utilized in determining the initial conditions for optimal operation. However, the load agent (LA) is assigned the task of sharing the information of forecasted values of the load to its neighboring agent, during the process of information sharing. Whereas, in the second step the LA works in a similar way as RA, during the grid-connected mode operation.

4) RENEWABLE AGENT AND LOAD AGENT FOR ISLANDED MODE
In islanded mode operation, in order to enhance service reliability to the critical loads, two LAs are considered, which are critical load agent (CLA) and non-critical load agent (NLA). However, a single RA is considered, as in gird-connected mode operation. During the process of information sharing, these agents are assigned the task of diffusing the information of renewable and load in the network. During the second step, RA works in a similar way as in grid-connected mode. However, LAs are responsible for sharing the information of marginal benefit and local power mismatch to neighboring agents. For islanded mode operation, the LAs are modeled using a quadratic utility function. The utility function describes the satisfaction level of a consumer, on consuming a certain amount of power. The utility function is a concave non-decreasing function, as described in Equation (6), which implies that the consumer is always interested in consuming more power. Equation (7) implies that the marginal benefit is a decreasing function and the level of satisfaction gradually gets saturated.
In literature, numerous welfare functions have been proposed, but due to the suitability of quadratic welfare functions to mimic the satisfaction level of consumers, they are widely used [24], [25]. Therefore, in this study, we have utilized a quadratic cost function, as illustrated in Equation (8), with a linear marginal benefit as illustrated in Equation (9). The constraint for minimum and maximum power served to load is described in Equation (10). , where, w is load priority determining parameter, v is a predetermined parameter and P Load is the amount of power consumed. P min Load and P max Load are the minimum and maximum power served to the load, respectively. With the help of utility function, we can distinguish loads according to their priority i.e. critical and non-critical loads.

5) BATTERY AGENT
Battery agent (BA) monitors the discharging and charging power of the battery, i.e. a dispatchable agent. It is also responsible for sharing its current marginal cost with neighboring agents. Ideally, a battery should charge when the market price is low and discharge when the market price is high. In literature, different models have been proposed for the distributed operation of battery [9], [10], [20]. In [9], [10], a model is proposed for the cost function for the battery to determine charging and discharging power. This model considers only battery charging/discharging power to determine cost of the battery operation. In [20], authors have proposed a modified cost function of battery that considers both state of charge (SOC) and charging/discharging power of the battery. Taking our literature review in account, we have concluded that the cost function for battery still needs more improvements. Therefore, in this study we have proposed a model to represent the cost of battery operation, which provides better results as compared to cost functions discussed earlier. The proposed cost function utilizes the information of market price window and load low for grid-connected mode and islanded mode, respectively. The concept of utilizing a window of information is illustrated in more detail in Fig.2.
A quadratic cost function with the linear marginal cost is proposed for grid-connected and islanded modes. Equation (11) and (12) describe the cost function and marginal cost function of battery for grid-connected operation, respectively. Whereas, Equation (13) and (14) describe the cost function and marginal cost function of battery for islanded mode operation, respectively. The limiting constraint for battery operation is given in Equation (15), where P min B and P max B are the minimum and maximum discharging and charging capacity of the battery, respectively.
In Equation (10), a, β, γ are the coefficients of the quadratic cost function, P B is the charging power (P B < 0) or discharging power (P B > 0) of battery, SOC is the state of charge, P max B is the capacity of the battery. MP max is the maximum value of the market price. MPR is the ratio of the average market price of the window (illustrated in Fig.2.) to the current market price. For grid-connected mode operation, BA has access to market price information like the GA. Equation (12) illustrates that the marginal cost is inversely proportional to SOC but directly proportional to battery power and MPR. The cost function is formulated in such a way that the battery charges when the market price is low and discharges otherwise.
In Equation (12), a, β, γ , P B , SOC and P max B are similar as in Equation (10). Whereas, D max is the maximum value of load and DCR is the ratio of the total demand of the window to the total capacity of the window (illustrated in Fig.2.). Equation (14) illustrates that the marginal cost is inversely proportional to SOC but directly proportional to battery power and DCR.

C. ECONOMIC DISPATCH PROBLEM
In a microgrid network, there usually exist multiple power resources. The economic dispatch problem (EDP) in the microgrid is essentially an optimization problem, which is to minimize the total operation cost. The cost functions associated with each unit are described in the previous section. The EDP for a grid-connected microgrid can be described as follows: (16) subject to the power balance constraint and the generation limits of individual generation source: where, equation (17) is the power balance equation and which describes that the total power of all dispatchable agents must be equal to net demand D. The net demand of the network is obtained by subtracting total renewable power R form total load L. In case of power selling and battery discharging the values P Grid and P B are negative. Whereas, for power buying and battery discharging, values of P Grid and P B are positive. The upper and lower bounds of generation capacity are described in Equation (18). However, in case of an event causing connection failure with the main grid, the microgrid network should switch to islanded mode operation. During islanding, the microgrid network lacks the ability to trade power with the external system such as the utility grid. Therefore, due to the limited capacity the load shedding may be expected in order to maintain the power balance in the network. The objective function for islanded mode operation is described in Equation (19), which is to minimize the total operation cost and load shedding P shed in the network. (19) Subject to the constraints described in Equation (20) - (22).
where, equation (20) is the power balance equation, which describes that the total power of all dispatchable agents and load shedding power must be equal to net demand D.
The sign conventions for P Grid and P B are similar to gridconnected mode. The upper and lower bounds of generation capacity are described in Equation (21). The limiting constraint for the load shedding amount are described in equation (22), where P shed_ min is the minimum load shedding power and P shed_ max is the maximum load shedding power.

III. PROBLEM FORMULATION
In this section, the mathematical model of the proposed distributed operation of microgrid is presented. The proposed method is framed for a scheduling horizon of T , with a time interval of t, which can be any uniform interval. The microgrid operation is divided into two main steps, namely information sharing and optimal operation. Prior to the second step i.e. optimal operation, it is necessary for each agent in the microgrid network to have information of total load and renewable power for T horizon of time. Therefore, in the first step, each agent communicates with its neighboring agents, in order to diffuse the information of total load and renewable power in the microgrid network. At the end of the first step, each agent has the information of total load and renewable power, for the T horizon of time.
After the process of information sharing, the second step is to determine the optimal scheduling of each component in the microgrid network. For this purpose, consensus algorithmbased distributed operation of microgrid is proposed, for both grid-connected and islanded mode operations. In this study, grid-connected mode operation is considered as a normal operation mode; however, due to any unusual event causing connection failure with the main grid, the microgrid is forced to operate in islanded mode. During the process of optimal operation, each agent in the network determines the optimal operation points for physical devices associated with it. For this, each agent in the network shares limited information with its neighboring agents, in a distributed way. Based on the information received from the neighboring agent each agent updates its state (marginal cost) and continues to share the information until the state of all agents in the network reach a consensus. This process requires some iterations in order to determine the optimal operation points.
Several methods are available in literature for the distributed operation of microgrids [11], [14], [15], [19]. Consensus algorithm is widely used in literature, as it has benefit of fast convergence and it requires a limited amount of information to determine the optimal solution. Moreover, the consensus algorithm is adaptive to changes in system configuration, such as addition or removal of agents [26]. In case of the removal of an agent, it only requires to update the communication matrix, and the remaining agents will continue to operate in a similar way. In this study, all types of agents generally utilized in the distributed operation of microgrid, are discussed. In the case of the addition of an agent, the commination matrix needs to be updated and the new agent is modeled in a similar way as discussed in this study. The schematic block diagram of the consensus algorithm is shown in Fig.3. This figure explains the information sharing between the agents and the process of determining the optimal solution. Based on the initial values and information received from neighboring agent j, the agent i determines the optimal operation point. Agent i updates its local information based on the optimal operation point and informs the associated physical device. Fig.3 is valid for all agents in the network, each agent shares the information current marginal cost/benefit with neighboring agents. During gridconnected mode, BA and DGA update their power estimates using the marginal cost/benefit function. However, RA and LA do not update their power, which remains at zero at each iteration. For islanded mode operation all agents works in a similar way as grid-connected mode. However, LAs determine the power estimates using marginal benefit function. In [14], authors have discussed the convergence analysis of the consensus algorithm in detail, considering different communication topologies. In this study, we have implemented two different consensus algorithm based processes, which is information sharing and optimal operation.

A. INFORMATION SHARING
The process of information sharing is formulated to broadcast the information of total renewable power and load to each agent in the microgrid network. The communication network for agents in the microgrid network is modeled as an undirected graph as described in [8]. In this work, the communication matrix A = a ij(nxn) associated with the undirected graph is determined using metropolis rule [27], according to Equation (23).
where a ij is the element of matrix A, n i and n j are the number of neighboring nodes of agent i and j, respectively.
In consensus algorithm-based information sharing, each agent combines the current states of neighboring agents according to the weights assigned by matrix A, as described in Equation (24). (24) where q k i is the state of agent i at iteration k, and a ij is the element of matrix A. Consensus is achieved when the state of all the agents in the network converges to a single point, which is the average of the values q 0 .

B. OPTIMAL OPERATION
In this study, we have proposed an operation method for the optimal operation of a microgrid network, for both grid-connected and islanded mode operations. The proposed method can optimally determine the power trading with the utility grid, for grid-connected mode operation. Additionally, for islanded mode operation, the proposed method can determine the optimal power allocated to loads based on their priorities. Moreover, a modified cost function is proposed to enhance the battery operation.

1) GRID-CONNECTED MODE
The system configuration of grid-connected mode is shown in Fig.4. The agents participating in grid-connected mode operation are GA, BA, RA, DGA, and LA. For communication between the agents, ring topology is considered. Each agent is responsible for determining the optimal operation point of its unit. In order to determine the optimal scheduling of each unit in the network, each agent should have information of forecasted load and renewable power in the network. Therefore, the process of information sharing is carried out initially by each agent in the network, so that each agent has the load and renewable power information of T intervals.
During grid-connected mode, the main operation objective is to minimize the operation cost of microgrid, while maintaining the power balance in the network. Since the network is operating in grid-connected mode, power can be bought and sold to/from the utility grid to maintain the power balance and to maximize the profit, respectively. The optimal operation of the grid-connected microgrid is a point where each dispatchable agent's marginal cost converges to market price as illustrated in Equation (25).
In order to determine the optimal solution for (16), while considering constraints described in (17) and (18), consensus algorithm is used, as given in Equation (26).
where, λ k i is the state of agent i at iteration k and is the marginal cost of agents cost function and a ij is the element of matrix A. ε is a nonnegative parameter that determines the convergence speed of algorithm and is termed as feedback gain. P k i is the estimated local power mismatch of agent i at iteration k and is determined using Equation (27).
where P k i is the power estimation of dispatchable agent i at iteration k and can be determined using Equation (4) and (12) for DG and battery, respectively. As described in [10], the optimal solution depends on the initial values which are λ 0 i , P 0 i and P 0 i . For grid-connected mode operation, the initial values of the algorithm are as follows: After initializing the values, as described in Equation (28), each agent continues to communicate with its neighboring agent, until all agents reach a consensus, as described in Fig.3. The details about the working of the proposed method for gird-connected mode operation are given in Algorithm 1. Step 1: Information sharing 4: Initial values for information sharing 5: Determine the total amount of renewable power and load for T intervals in the system using Equation (24) 6: Step 2: Distributed operation 7: while t < T do 8: for all i < N do 9: Initial values according to Equation (28)

2) ISLANDED MODE
A microgrid is considered a key component of the power system as it provides service reliability to critical loads during system outages and contingencies. While operating in islanded mode, the microgrid cannot trade power with the utility grid. Hence, during the peak load intervals, the load shedding could occur due to limited generation and storage capacity. In such a case, it is necessary to provide service reliability to critical load, which is to allocate power to critical loads first, followed by the power allocation to non-critical load. Moreover, the battery charging should only be considered when there is no critical load shedding in the microgrid network. Therefore, in this study, we have considered two different load agents which are CLA and NLA for critical and non-critical loads, respectively. The other agents participating in islanded mode operation are DGA, BA and RA, as shown in Fig.5. Additionally, the cost function for battery operation is modified, as discussed in the previous section, to enhance the battery operation. For islanded mode operation, we have proposed a welfare maximization-based operation of microgrid.
Similar to the grid-connected mode operation, the process of information sharing is carried out initially. However, in islanded mode operation, only the total renewable power for T intervals is determined. The main objective for islanded mode operation is to minimize both operation cost and load shedding. In this study, we have proposed a welfare maximization based distributed operation for islanded microgrids. The individual welfares of DGA, BA and, LA are described in Equation (29)-(31), respectively. The optimal operation of the islanded microgrid, described in Equation (32), is a point at which the marginal benefit of each agent converges to λ * , which is also the Lagrange multiplier [19], associated with power balance equation.
Consensus algorithm as described for grid-connected mode Equation (26) and (27), is used to determine the optimal operation of islanded mode operation. However, the power served to critical load and non-critical load is determined using Equation (9), which is the marginal benefit of load agents. The LAs are modeled in such a way that the minimum marginal welfare of CLA is always greater than the maximum welfare of NLA. In this way, critical loads are always served first and non-critical loads are served with the remaining available power. Moreover, the battery cost function for islanded mode operation is modeled in such a way that it only charges when there is no critical load shedding. For the islanded mode operation, the initial values of the algorithm are as follows: After initialization, as illustrated in Equation (33), each agent continues to communicate with its neighboring agent, until all agents reach a consensus, as described in Fig.3. The details about the working of the proposed method for islanded mode operation are given in Algorithm 1.

IV. NUMERICAL SIMULATIONS
In order to realize the effectiveness of the proposed distributed operation method, a microgrid network is considered as shown in Fig 3 and 4 for grid-connected and islanded  operation, respectively. The microgrid network includes a DG, a BESS, RDGs (wind turbine and photovoltaic arrays), electric load and different agents. GA is only active during grid-connected mode however, two different LAs are considered for islanded mode operation for critical and non-critical loads. All agents in the network can share information with their neighboring agents in a distributed way. The proposed method is formulated for 24-h scheduling horizon, with 1-h being a time step. For this study, the communication system is considered a reliable system. Therefore, the effect of communication delays is not considered. However, effective of consensus algorithm with respect to communication delays is discussed in the literature [18], [28]. The simulations were carried out in MATLAB environment, on a laptop (Intel Core i7-7500U CPU @ 2.70GHz, 8GB RAM).

A. INPUT DATA
DGs have a key role in optimizing the operation cost of the microgrid network. The parameters related to the generation cost of DG are given in Table I. A BESS can store surplus power during low peak intervals and can discharge during the high peak load intervals. The parameters related to BESS are tabulated in Table II. The forecasted values of the market price are taken from [29], for the summer season and are scaled, as shown in Fig.6. The forecasted values of load and renewable power are taken from [30] and are given in Fig.7a and 7b, respectively. In this study, for islanded mode operation, the critical load is considered as 20-40% of the total load.

B. GRID-CONNECTED MODE
The battery plays a key role in optimizing the operation cost by charging when the market price is low and discharging when the market price is high. For battery cost function, the proposed method utilizes the information of market price window in terms of MPR. In this study, the window consists of three intervals and the value of MPR is between 0.93 to 1.05. In order to illustrate the effect of market price on charging and discharging of battery, we have considered two different cases. In the first case (case1), the effect of the market price on battery charging is discussed. Whereas, in the second case (case2), the effect of market price on battery discharging is discussed. VOLUME 8, 2020

1) CASE 1
For battery charging during the grid-connected mode, interval 4 is taken as a representative interval. The simulation results for this interval are given in Fig.8. Fig.8a shows the convergence of marginal cost of all agents. The marginal cost of each agent has converged to the current market price which is 95.42 Korean Won (KRW). As the optimal operation of grid-connected microgrid is a point where each dispatchable agent's marginal cost converges to market price. The convergence of marginal cost validates the effectiveness of the proposed method for grid-connected mode operation. Since the market price is low, the power is bought from the grid (68.8kW) to fulfill the net demand (35.1kW) and to charge the battery (33.68kW). The results for this interval are tabulated in Table 3 and are illustrated in Fig. 8b. It is obvious from (11), that the battery power is directly proportional to SOC and inversely proportional to MPR. The market price at interval 4 is low and soon after the interval 4, the market price starts to increase, as shown in Fig.6. Therefore, the MPR at this interval is high (1.0209). Since the MPR is high at this interval and surplus power is available, the battery is charged. In addition to the effectiveness of the proposed to determine the better operation of the battery, the proposed method can optimally determine the power buying from the main grid, as shown in Fig.8b.

2) CASE 2
For battery discharging during the grid-connected mode, interval 19 is taken as a representative interval. The results for this case are shown in Fig.9. The convergence of marginal cost is shown in Fig.9a, where all agents have converged to the current market price which is 112.25 KRW. The convergence of marginal cost at market price shows the effectiveness of the proposed method. Since the market price is high, no power is bought from the grid. The power generated by DG (42.4kW) and battery (21.7kW) is utilized to serve power to load. The reaming surplus power (6.4kW) available in the network, is sold back to the utility grid, to maximize the profit. The results for this interval are tabulated in Table 3 and are illustrated in Fig.9b. The MPR is low (0.98), as the market price is maximum at interval 19 and is decreasing after interval 19, as shown in Fig.6. Since the battery power is directly proportional to SOC and inversely proportional to MPR, the battery is discharged. In addition enhancement in battery's operation, the proposed method can optimally determine the power selling to the main grid, as shown in Fig.9b. The results validate the contribution of this study to optimally determine the power selling to the main grid.

C. ISLANDED MODE
During islanding, the microgrid network lacks the ability to trade power with the main grid and the load shedding might be carried out in order to maintain the power balance in the network. Moreover, the service reliability to critical load is also a main concern. BESS helps in reducing the load shedding amount by charging during low load intervals and discharging in high load intervals. The proposed cost function for battery utilizes the information of the load window, in terms of DCR. The window consist of three intervals and the value of DCR is between 0.18 to 1.0761. In this study, two cases are considered to illustrate the effect of variation in load in battery operation. In the first case (case 1), the effect of load variation on battery charging is discussed, while in the second case (case 2), the effect of load variation on battery discharging is discussed. In addition, the effectiveness of the proposed method, in terms of providing service reliability to critical loads is considered in the third case (case 3).

1) CASE 1
For islanded mode operation, interval 6 is taken as a representative interval for battery charging. The results for interval 6 are given in Fig. 10. The convergence of the marginal benefit of all agents is shown in Fig.10a. The results for this interval are tabulated in Table IV and are illustrated in Fig. 10b and Fig.10c. During this interval, no load shedding is carried out, as the generation capacity is enough to meet the demand. The power generated by DG (44.28kW) and RDG (10kW) is utilized to serve power to load (48.6kW) and to charge the battery (5.75kW). It can be seen from (13), that the battery power is directly proportional to SOC and inversely proportional to DCR. The DCR at interval 6 is low (0.77) as the net demand is low. However, the battery is charging because of low SOC and available surplus power. During this interval, enough power is available to meet the demand of the network, no load is shed at this interval. 2) CASE 2: For battery discharging during the islanded mode, interval 10 is taken as a representative interval. The convergence of marginal benefit is shown in Fig.11a. The results for this interval are tabulated in Table IV and are illustrated in Fig.11b and Fig.11c. Due to high demand, the DG is generating maximum power (50kW) and the power stored in the battery (15.9kW) is utilized to server power to load. No load is shed during this interval, as enough power was available to fulfill the load. During this interval, the DCR is high (1.03). However, because of high SOC and demand, the battery is discharged to reduce the load shedding. By utilizing the information of load, in terms of DCR, and SOC, the battery is operating more effectively. 3) CASE 3: In this study, we have utilized the utility function (8) to model the load agents. The LAs are modeled in such a way that the minimum marginal welfare of CLA is always greater than the maximum marginal welfare of NLA. In this way, power is always served first to the critical loads. To demonstrate the effectiveness of the proposed method, interval 16 is taken as a representative interval. During this interval, the demand is 78.39kW, where the critical load is 31.35kW and the non-critical load is 47.03kW. The SOC for this interval is 10%, as the battery cannot discharge below 10%. Therefore, only DG can serve power to loads. The results for this interval are tabulated in Table IV and are illustrated in Fig.12b and Fig.12c. DG is generating maximum power (50kW), whereas the battery is already fully discharged and it cannot discharge any power. The critical load is served first with 31.35kW power and noncritical load is served with remaining power (32.15kW). Due to the limited capacity of the system, the non-critical load shed in this interval is 14.89kW. From the results, it can be seen that the proposed operation method provides service reliability of critical loads, as no critical load is shed. This satisfies the contribution of this paper to provide service reliability to critical loads.

V. DISCUSSION AND ANALYSIS
In order to determine the effectiveness of the proposed method, the results of the proposed method are compared with the centralized method and conventional distributed operation method. In the centralized method a central controller is utilized, which collects all required information and determines the optimal solution for each component in the network. Whereas, in conventional distributed methods, the battery agents only utilizes the information of SOC and charging/discharging power. Moreover, the conventional distributed operation method does not consider the critical nature of loads. In this section, a comparison is made between the centralized method, conventional distributed operation method, and the proposed distributed operation method for VOLUME 8, 2020 24-h scheduling time. The model for centralized method is taken from [31] and the model for conventional distributed method is taken from [20]. The results of each method for grid-connected mode operation and islanded mode operation are given in Fig.13 and Fig.14, respectively.

A. GRID-CONNECTED MODE
The simulation results for the centralized operation of the grid-connected microgrid, for 24-h time horizon, are given in Fig.13a. Where PDG is power generated by DG, PB is the charging/discharging power of battery and PGrid is the power traded with the utility grid. The discharging power of battery and power selling to the utility grid are taken as negative. During the first 8 intervals, the market price is low. Therefore, most of the power is bought from the utility grid. At interval 4, the market price is the lowest so the battery is charged. The demand and the market price during the intervals 9 to 17 is high and most of the power is generated from DG during these intervals. During the intervals 19 to 21, the market price is high but the demand is low. Therefore, some of the power generated by the DG is sold back to the utility grid. In the last three intervals, the market price is decreased, thus some of the power is bought from the grid. The simulation results for the conventional distributed method for grid-connected microgrid operation are given in Fig.13b. Since the cost function for the battery considers only SOC and charging/discharging power. Therefore, the battery is charging during the first interval as the SOC is low (10%). During the intervals 1 to  8, the market price is low. Therefore most of the power is bought from the grid. The battery discharges at interval 19 as the market price is high but soon after discharging the battery charges again at interval 20 as the battery had fully discharged and the SOC is low. The power is sold back to the grid at intervals 19 and 21 because of low demand and for the last three intervals, the market price is decreased and power is bought from the grid. The simulation results for the proposed distributed method for microgrid operating in grid-connected mode are given in Fig. 13c. According to the proposed method, the battery model uses the information of market price to determine the operation of the battery. The battery is charging at interval 4 which resembles the centralized method. Whereas, in the conventional distributed method, the battery is charged during the first interval because of low SOC, even though the market price was high. Moreover, the battery is not charged again at interval 20, soon after being fully discharged at interval 19. Whereas, the battery was charged again at interval 20 in conventional distributed method, due to low SOC, resulting increase in the operation cost. By utilizing the proposed cost function, the battery's operation is improved significantly. By enhancing the battery's operation, the distributed operation of the microgrid is improved and operation cost is improved significantly as compared to conventional distributed operation method. The results of the proposed operation method are much similar to centralized operation. The comparison of the operation cost of all three methods is given in Table V. The results of the centralized method are taken as reference. The increase in the operation cost for conventional distributed method is 3.17% whereas, for the proposed distributed method the increase in operation cost is just 0.2%.

B. ISLANDED MODE
The results for the islanded mode operation are given in Fig.14. During islanding, the microgrid cannot trade power with the main grid, as a result, load shedding is carried out to maintain power balance. Fig.14a shows the simulation results for the centralized operation of an islanded microgrid. During the first seven intervals, the net demand is low so the battery   is charged in these intervals. The DG is generating maximum power during the intervals 10 to 19 because of the high demand and load shedding is being performed during these intervals to maintain the power balance, as shown in Fig.10. The battery is discharging during the intervals 16, 17 and 19 to reduce the load shedding, as shown in Fig.15. The results of the conventional distributed operation method for the islanded microgrid are shown in Fig.14b. During the first three intervals battery is charging due to lower SOC level (10%) and availability of surplus power. The battery is discharged at intervals 10 and 11 in order to reduce the load shedding. During the interval 10 to 19, the DG is generating maximum power and some amount of load is also shed because of low capacity and high demand, as shown in Fig.15. The battery charges again at intervals 20 and 21 because of low SOC, as the battery has already fully discharged, and availability of surplus power in the network. As shown in Fig.14c, the battery is charging during the first seven intervals, whereas in the conventional distributed operation method, the battery charges more rapidly, causing an increase in operation cost. Unlike the conventional method, the battery is not charged again in the remaining intervals. It is because of the fact that the battery is utilizing the information of load in terms of DCR. By utilizing the information of load, the operation of the battery has been improved significantly.
As similar to the grid-connected mode operation, the islanded mode operation of microgrid is enhanced, by utilizing the modified cost function. Significant improvement in operation cost and load shedding is obtained as compared to the conventional distributed operation method. The results of the proposed method for islanded mode operation are much similar to centralized operation, as illustrated in Fig.14. The comparison between load shedding and operation cost for centralized, conventional distributed, and the proposed method is given in Table VI. The centralized method is taken as a reference and the results of conventional and distributed methods are compared with centralized method results. The difference in operation cost and load shedding using conventional distributed operation method is 3.4% and 13.6%, respectively. However, by using the proposed method the difference in operation cost and load shedding was reduced to 0.5% and 0%, respectively. The load shedding during the operation period of 24-h intervals is given in Fig.15.

VI. CONCLUSION
A novel distributed operation method for a microgrid network has been proposed in this study. The proposed operation method is based on the consensus algorithm. Unlike the conventional distributed operation method, the proposed operation method can determine the power selling to the utility grid for grid-connected mode. Moreover, the proposed method can assure the service reliability to the critical load, when operating in the islanded mode. In addition, the battery operation has been improved significantly by using the proposed cost function for the battery. For grid-connected mode, the comparison between the operation costs for conventional and proposed distributed operation method, shows that the proposed operation method is more effective. As the difference in the operation cost for the conventional distributed method is 3.17%; whereas, for the proposed method the difference is just 0.2%. Meanwhile, for islanded mode, a comparison was made between the amount of load shedding and operation costs for conventional and proposed distributed operation method. The difference in the load shedding for conventional and the proposed distributed operation method is 13.6% and 0%, respectively. Whereas, the difference in the operation costs for conventional and proposed distributed operation method is 3.4% and 0.5%, respectively. These results conclude that the proposed method for the distributed operation method is much better and effective than the conventional distributed operation methods. HAK-MAN KIM (Senior Member, IEEE) received the Ph.D. degree in electrical engineering from Sungkyunkwan University, South Korea, in 1998, and the Ph.D. degree in information sciences from Tohoku University, Japan, in 2011. From October 1996 to February 2008, he worked with the Korea Electrotechnology Research Institute (KERI), South Korea. He is currently a Professor with the Department of Electrical Engineering, Incheon National University, South Korea. His research interests include microgrid operation and control and dc power systems. VOLUME 8, 2020