Fully Distributed Optimal Economic Dispatch for Microgrids under Directed Communication Networks Considering Time Delays

: Distributed generation and demand-side management are expected to play a more prominent role in future power systems. However, the increased number of generations and load demands pose new challenges to optimal energy management in a microgrid. In this paper, an economic dispatch model for microgrids considering Traditional Generators (TGs), energy storage units, wind turbines (WTs), and ﬂexible loads is established. To tackle the Economic Dispatch Problem (EDP) over directed communication networks, a fully distributed algorithm developed by leveraging a two-step state information exchange mechanism is proposed. In addition, by employing a ﬁxed stepsize, the proposed algorithm demonstrates rapid convergence. Furthermore, our algorithm is well-suited for nonquadratic convex cost functions. Subsequently, we extend our algorithm to address imperfect communication scenarios. Even in the presence of arbitrarily large yet bounded time delays, our algorithm exhibits robustness. Finally, several numerical examples are given to verify the correctness and effectiveness of the developed results.


Introduction
Microgrids are important parts supporting the operation of modern power systems [1][2][3][4][5].The increasing distributed generations and fluctuating load demands have made economic dispatch for microgrids a great challenge.In order to address the characteristics of microgrids, which are flexibility, scalability, and resilience, many researchers have focused on a multi-agent-based distributed framework [6][7][8][9][10].In recent years, consensus-based algorithms have been widely used to solve the Economic Dispatch Problem (EDP) for microgrids.In [11], a consensus + innovation algorithm with model prediction is designed to realize the dynamic economic dispatch.In [12], based on peer-to-peer communication, a consensus algorithm is used to solve the EDP involving flexible loads.A distributed bisection method is presented in [13] to solve the EDP with general convex cost functions.In [14], a distributed algorithm based on leader-follower consensus is designed to solve the EDP without the need for initialization.In [15], a distributed algorithm is proposed to obtain optimal dispatch results within finite-step iterations.
However, the mentioned methods are only applicable under the undirected graph, which requires that information be exchanged bidirectionally among agents.In an actual communication network, one link may be damaged or data packet loss may occur [16,17]; the condition of an undirected graph is hard to satisfy.In addition, directed networks offer lower cost, better privacy preservation, and improved robustness [18][19][20][21][22].For the EDP under a directed graph (digraph), a push-pull algorithm is proposed in [23].A distributed algorithm using the weight matrix of row stochastically is presented in [24].Based on the push-sum algorithm, a modified algorithm in [25] is proposed to solve the EDP over time-varying digraphs.A robust algorithm considering the packet drops is provided in [26].Most existing methods use decaying stepsize, resulting in slow convergence.A fixed stepsize can accelerate convergence, but it leads the results to oscillate in an interval.In the power system application, achieving exact optimal results is necessary.In [27], a novel consensus-based algorithm with fixed stepsize is proposed to solve the social welfare maximization problem.However, it is only applicable to the undirected graph.Inspired by the method proposed in [28], we design a distributed consensus-based algorithm using the fixed stepsize to solve the EDP under the unbalanced digraphs.
In modern power systems, the imperative integration of renewable energy generators has emerged as a strategic response to pressing challenges in the realms of energy security and environmental sustainability.Among various kinds of renewable energy generators, wind turbines (WTs) have garnered particular attention, owing to the advantages such as the free availability and environmental friendliness of wind energy, as well as the maturity of turbine techniques [29][30][31][32].With the increasing penetration of stochastic wind power into microgrids, it is essential to reformulate the Economic Dispatch (ED) problem, incorporating not only Traditional Generators (TGs) but also accounting for the presence of renewable energy generators like WTs.However, the intermittent and stochastic nature of wind speed leads to uncertainty in wind power output, which poses a considerable challenge in designing effective distributed economic dispatch strategies.Due to the integration of energy storage units into wind farms, the gap between the scheduled wind power and the available wind power can be eliminated, and then random wind power can be scheduled like TGs.In [33], a deterministic model was adopted to describe the cost function of wind power, where the underestimation and overestimation costs of available wind power are included.Based on the dispatch model, a distributed strategy using the projected gradient algorithm is proposed in [34].In [35], a prime-dual consensus algorithm is proposed to solve the EDP considering random wind power.However, the cost functions of wind power are not quadratic anymore, as described in [36].Hence, some of the distributed methods mentioned above may fail to work.It is necessary to devise a distributed method for solving the EDP with more generalized cost functions.
All the aforementioned distributed algorithms are implemented in a perfect communication network.However, in an actual communication network, the information received from neighbors is always subject to time delays induced by the physical distance between them.Therefore, it is desirable to analyze the effects of nonideal communication conditions on the existing algorithms.In [37], the simulation results show that delays may cause instability when using the consensus algorithm to solve the EDP.In [38], a theoretical upper bound of time delays is obtained, ensuring that distributed EDP can be solved.In [39], both communication delays and measurement delays are considered in designing a distributed algorithm for EDP.Nonetheless, it should be noted that these findings are based on the utilization of quadratic cost functions for modeling the EDP.The effectiveness of the proposed algorithm extends to scenarios where the cost function is nonquadratic.Furthermore, an extension of our algorithm is introduced to enhance its robustness in the presence of communication delays.The main contributions of this paper are as follows: (1) An economic dispatch model for microgrids considering random wind power and flexible loads is established.A fully distributed consensus-based algorithm using fixed stepsize is proposed, which is suitable for unbalanced directed communication networks.Different from the traditional distributed methods, where the update of the state information only depends on the information of the previous instant, the latest two-step information is used to iterate, ensuring convergence.(2) Our algorithm is initialization-free so that it can converge to the optimal results with arbitrary initial power values.In addition, for nonquadratic convex cost functions, such as the nonlinear function including integral terms that are used to describe the expected cost of wind power, our algorithm is also effective.(3) The proposed algorithm can solve the EDP with arbitrarily large but bounded time delays if the upper bound of time delays is preknown.Due to its fast convergence even under delays, our algorithm can be applied to the practical operations of microgrids.
The rest of this paper is organized as follows: Section 2 describes the EDP model for microgrids.A fully distributed algorithm for EDP under the directed networks with time delays is proposed in Section 3. Case studies are carried out in Section 4 to demonstrate the effectiveness of the proposed method.Finally, Section 5 concludes this paper.

Cyber-Physical System Architecture for Microgrids
A microgrid can be effectively represented as a cyber-physical system (CPS).Leveraging advanced communication and computing equipment, the implementation of distributed economic dispatch within a microgrid becomes more feasible.The CPS architecture, as shown in Figure 1, comprises both a physical layer and a cyber layer.Each generator or load node corresponds to an agent equipped with communication and computing capabilities.The communication links among these agents exhibit flexibility and may not necessarily mirror the physical connections.

Generator nodes
Load nodes Generator agents Load agents

Dimensional mapping line Physical link
Communication link In microgrids, the security and stability of system operation rely on the coordination and cooperation of each CPS unit.The structure of a CPS unit is illustrated in Figure 2. The peer-to-peer communication mode is utilized to establish the connection between different CPS units.Within this framework, communication units are responsible for transmitting and receiving information from their neighboring units.The pivotal role in achieving global control is played by the information processing unit.These units, on the one hand, continuously monitor and sample the operational states of physical devices.On the other hand, they analyze information from neighboring units, compute outgoing information, and generate control instructions.In the following sections, we use this framework as the foundation for our discussion on distributed economic dispatch.

Directed Communication Networks
Usually, the undirected communication topology is considered for the sake of algorithm design.In our work, the unbalanced directed topology is considered.A typical example is shown in Figure 3.A directed graph is denoted by G = (V, E ) with a set of nodes V = {1, . . ., N} and edges E .(i, j) ∈ E indicates there exists a directed path from the node i to j.The set of nodes that can receive information from node i are called out-neighbors of node i, denoted by

Economic Dispatch Model in Microgrids
Generally, microgrids consist of generators, storage devices, and load units.In this paper, we consider an ED model which involves random wind power.The EDP for microgrids is minimizing the operation cost of generation sides and maximizing the benefit of demand sides.In some issues, the carbon emission cost is also considered in the EDP [40,41].All these cost functions or benefit functions can be unified as a general function f i (•) for each agent i.Here, we assume that f i (•) is strictly convex and continuously differentiable.
For conventional generators, the cost function is usually modeled as the following quadratic function: where P G,i denotes the output power of the ith generator.P min G,i and P max G,i are the lower and upper limits of output power, respectively.a i , b i , and c i are the corresponding cost coefficients.
In this paper, we define the utility benefit function for users based on the aggregation of diverse tasks, rather than focusing on individual appliance power consumption.It is important to note that, from a user perspective, the ability to accomplish more tasks often necessitates a higher power consumption.Therefore, it is reasonable to postulate that the utility benefit function exhibits a nondecreasing trend and eventually reaches a state of saturation, a concept well supported by prior studies [42,43].User demand requests typically comprise two components, schedulable and nonschedulable loads, which can be effectively represented by appropriately defining the demand lower bound.
where P L,j denotes the load demand of the jth user.P min L,j and P max L,j are the lower and upper bounds, respectively.a j , b j are the corresponding benefit coefficients.
For the energy storage units, the cost function is modeled in the following form [11]: where P B,k denotes the power value of the kth energy storage unit.P min B,k and P max B,k are the lower and upper bounds, respectively.a k and b k are the corresponding cost coefficients.
For TGs, the scheduled and actual power outputs are always the same.However, owing to the stochastic nature of wind speed, the generated power P W,l,av at the lth WT is a random variable, deviating potentially from the scheduled power P W,l .The integration of Energy Storage Systems (ESSs) into the WT units offers a solution to ensure that the total WT output aligns with the scheduled value.For instance, if the scheduled power output P W,l exceeds P W,l,av , the ESSs can compensate for the disparity.Conversely, if the scheduled power output P W,l is less than P W,l,av , the WT should limit its output to P W,l , and the surplus wind power can be utilized to charge the ESSs.To quantify the cost associated with the WT, a methodology involving overestimation and underestimation costs has been proposed in [36].Therefore, the overall cost for the lth WT can be expressed as where the first term is the direct cost of wind power with the cost coefficient d l .The second and third terms are the underestimation and overestimation costs.η ue l and η oe l are the corresponding coefficients.P r W,l is the rated wind power of the lth WT.The definitions of E W ue l and E W oe l are described as follows: where f W (P W,l,av ) denotes the probability distribution function of the available wind power P W,l,av , which is described by Weibull distribution in this paper.The closed forms of E W ue l and E W oe l are given as follows: where v r , v in , and v out are the rated, cut-in, and cut-out wind speeds.κ and c denote the scale factor and shape factor of the Weibull distribution, respectively.Γ(•) is a standard incomplete gamma function.v l is an intermediary variable, which is defined as The aim of the optimal dispatch for microgrids is to coordinate all the participants to maintain the active power balance and maximize social welfare.Therefore, the EDP is modeled as where Ω G , Ω L , Ω B , Ω W denote the sets of the TG units, load units, the energy storage units, and the WT units, respectively.In order to describe the optimization model in a unified form, let P i denote the power of agent i, which denotes the TG unit the load unit, the storage unit, or the WT unit, i.e., i ∈ Ω G Ω L Ω B Ω W . Assume that N denotes the number of all participants in a microgrid.For TG agents, P i > 0. For load agents, P i < 0. For energy storage agents, P i > 0 when discharging and P i < 0 when charging.For WT agents, P i > 0. Mathematically, the EDP for microgrids is modeled as a unified form, min subject to two constraints: (1) The capacity constraint where P min i and P max i represent the lower and upper limits, which are presented in Equations ( 1)-( 4).The capacity constraint of agent i can also be written as a box constraint Then, the Lagrangian function is defined as follows: where λ is the Lagrange multiplier, that is, the incremental cost.The dual problem of the EDP is where Θ i (λ) = min The subproblem ( 16) is minimized when satisfying , where where is continuous and strictly monotonic.The gradient of Θ i (λ) is ∇Θ i (λ) = −P i (λ).Obviously, the gradient ∇Θ i is bounded and Lipschitz-continuous.The gradient ascent method ( 18) is applied to solve the dual problem.
where ρ(k) is the stepsize at iteration k.Assume that λ * is the optimal solution to the dual problem.Accordingly, the optimal solution of the primal EDP is

Distributed Algorithm for EDP under the Unbalanced Directed Graph with Time Delays
In this section, we propose an agent-based distributed algorithm to solve the EDP under the unbalanced digraph with random but bounded time delays.

Distributed Algorithm for EDP Using Two-Step Information
Traditional distributed algorithms only use one-step information for iterations.This means the update of the state information only depends on the information at the previous instant.A fully distributed algorithm using the latest two-step information with a fixed stepsize is proposed.The update protocol of agent i is presented as follows: Then, we can rewrite Equations (19a) and (19b) into the following compact form: where r = [r 1 , . . ., r N ] T are the auxiliary variables to obtain the optimal solutions.y = [y 1 , . . ., y N ] T is utilized to address the unbalancedness of the digraphs.ρ is the fixed stepsize within a certain interval.W = {w ij } is the weight matrix, which is designed as follows: where ε is a positive constant close to 0. Only the out-degree of each agent i is needed.If agent i is aware of the out-degrees of its in-neighbors, the weight w ij can also be designed as The W = { w ij } is also a weight matrix related to the penultimate state, which is designed by where µ ∈ (0, 1  2 ], and the two weight matrices satisfy that W = µI N + (1 − µ)W.In the initialization of our proposed algorithm, r i (0) and P i (0) can be arbitrary, and y i (0) = 1 for i = 1, . . ., N. At the first iteration, let r i (−1) = 0 and P i (−1) = 0.The iteration is given by In our algorithm, there is no need for strict initialization.Due to the fixed stepsize, the proposed algorithm has an excellent convergence rate.According to definitions, the weight matrices W and W are row-stochastic, satisfying 1 T W = 0 T and 1 T W = 0 T .In Equation (20), let g i (λ i (k)) = P i (k).Summing the iterations in Equation ( 20) from 1 to k + 1, we can obtain r(k When k → ∞, lim k→∞ r(k) = r * = Wr * , and λ i reaches optimal consensus λ * due to the role of y.Then, we can obtain ρP(∞) = ∑ ∞ t=0 (W − W)r(t).Noting that 1 T (W − W) = 0 T , we have 1 T P(∞) = 0.
Thus, the power balance constraint is satisfied.The iteration process can be terminated as the error value satisfies P(k + 1) − P(k) 2 < , where > 0 is an error threshold.
Remark 1.The effectiveness of our proposed algorithm is ensured under two conditions: the objective function is strongly convex, and the directed communication network is connected.Firstly, the objective function being strongly convex implies that it has a unique global minimum.This ensures that there is only one optimal solution for the problem at hand.Consequently, any iterative algorithm designed to minimize this objective function will converge to this unique optimal solution.Secondly, the directed communication network being connected means that there is a path of communication between any two nodes in the network.This is crucial for the algorithm to function effectively, as information needs to be exchanged between different nodes to update their values iteratively.Without a connected network, certain nodes may be isolated and not receive or transmit important information, leading to suboptimal or incorrect results.By satisfying these conditions, our proposed algorithm guarantees convergence to the optimal results, regardless of the initial values chosen.This means that the algorithm is robust and reliable in solving the given EDP for microgrids.

Robustness to Communication Time Delays
In the digraph, τ ji denotes the time delays during the information transmission from the agent j to the agent i.We assume time delays are bounded by Specifically, self-delay τ ii is assumed to be 0, which means that the state update process depending on local information has no delays.Therefore, our algorithm under time delays is executed by An augmented digraph method is utilized to model the communication time delays.For each node, there are τ augmented virtual nodes to store the delayed information.As shown in Figure 4, the gray nodes are the virtual nodes.Information sent from the neighboring nodes first reaches the virtual nodes.The number of virtual nodes connected to the real nodes depends on the delay bound.Thus, for each link (j, i) ∈ E , there are |τ ji | augmented links.The information exchange under the original network with time delays is equivalent to the information exchange without delays under the augmented digraph.The modified update protocol in compact form as where where W (0) , W (1) , • • • , W ( τ) are the matrices relying on the values of time delays, which are defined as Accordingly, W τ is modified by W τ using (23).Note that W τ and W τ are still rowstochastic.Under the algorithm (17), the EDP can be solved over the augmented digraph.Therefore, our proposed algorithm is also efficient under time delays.

Simulation Results
In this section, several case studies are presented in order to illustrate and validate the proposed algorithm.The case studies are simulated in the MATLAB R2021a environment on a laptop with Intel Core i5-7300U CPU @2.60 GHz and 8 GB RAM.The test systems are based on the IEEE 14-bus system and the IEEE 118-bus system, considering both without and with time-delay scenarios.

Without Time Delays
In this case study, time delays are not considered.The proposed distributed algorithm is implemented in an ideal communication environment.Figures 6-8 show the simulation results of the optimal incremental cost, optimal power, and net power.After about 90 iterations, the optimal solutions are obtained.The incremental costs converge to the optimal value: λ * = 6.5912.The optimal power results are listed in Table 3.In addition, the convergence performance is compared with the algorithms in [24,25], which are shown in Table 4.The algorithms proposed in [24,25] adopt the decaying stepsize to make sure the results can converge to the optimum accurately.Our algorithm adopts a fixed stepsize.However, although a fixed stepsize can accelerate the convergence rate, it only ensures that the results converge within the neighborhood of the optimal value.Therefore, we propose a two-step state information exchange mechanism to address this problem.Due to the fixed stepsize rather than the decaying stepsize, our algorithm has a greatly faster convergence rate than the existing algorithms for EDP under digraph.As shown in Figures 9-11, after about 100 iterations, the optimal results can be obtained.The forms of the cost functions do not influence the convergence rate of our proposed algorithm.In a real economic dispatch model, the cost functions of battery storage and the benefit functions of demand sides are usually modeled as complex functions.If the functions are convex, or if they can be converted into convex functions, the proposed algorithm is still efficient.Therefore, our algorithm is more suitable for practical applications.

With Time Delays
Herein, the bounded communication delays are considered for the EDP.Assume that for each link in the digraph, random time delays bounded by τ = 3 exist.As shown in Figures 12-14, even under delays, our algorithm can converge to the same optimal results after about 2000 iterations.Due to the delay effects of the communication network, the iteration steps increase compared with those in a perfect communication environment.Then, a test with larger time delays is investigated.The delay bound is set as τ = 7.As shown in Figures 15-17, after about 4000 iterations, the optimal results can be obtained.It can be seen that the larger the delay bound, the more iterations the proposed algorithm requires.Fortunately, if the time delays are preknown in a bounded range, our algorithm can be designed for accurate convergence.Therefore, our algorithm is more suitable for practical applications, even when the communication environment is imperfect.

Tests on the IEEE 118-Bus Test System
In this section, we further apply our proposed algorithm to a larger test system, the IEEE 118-bus test system, which is composed of 50 conventional generators, 4 wind turbines, and 41 load units.Without loss of generality, the parameters of the wind turbines are chosen from Table 2.The cost coefficients of all conventional generators are chosen from the following ranges: The benefit coefficients of all load units are chosen by the following range: After about 5000 iterations, the optimal results can be obtained.The incremental costs converge to 5.6968.This verifies that our proposed algorithm can be applied in the actual large power system.

With Time Delays
In this case study, time delays are considered.The delay bound is set as τ = 3.The simulation results of incremental costs, optimal power, and net power are shown in Figures 21-23.As the system scales up, and considering the impact of communication delay, the number of iterations required for algorithm convergence also increases accordingly.After about 70,000 iterations, the optimal results can be obtained.The incremental costs converge to 5.6848.This verifies that our algorithm has good robustness to time delays, and it can adapt well to a nonideal communication environment in a large system.

Conclusions
In this paper, an economic dispatch model considering random wind power and flexible loads is established, which is described as a general convex cost function.A fully distributed consensus-based algorithm with a fixed stepsize using a two-step information exchange mechanism is proposed to deal with the EDP for microgrids over directed communication networks.Our algorithm is initialization-free and can converge the optimal results at a faster speed than the existing distributed approaches that adopt the decaying stepsize.Communication time delays existing during the data transmission process cannot affect our algorithm's effectiveness if the upper bound of the time delays is preknown.
Furthermore, we will focus on the resilient consensus-based algorithm for the EDP considering packet loss and channel noises.What is more, due to the need for information transmission among different agents, the privacy of distributed algorithms is compromised.Additionally, distributed algorithms are vulnerable to cyber-attacks, which pose certain risks.Therefore, our next focus of research will be on resilient distributed algorithms that can withstand cyber-attacks.In addition, the economic dispatch model considering the uncertainties of distributed generations and loads in microgrids is another focus in our future work.

Figure 18 .
Figure 18.Incremental cost results on the 118-bus system without delays.

Figure 19 .Figure 20 .
Figure 19.Optimal power values on the 118-bus system without delays.

Figure 21 .
Figure 21.Incremental cost results on the 118-bus system with time delays bounded by τ = 3.

Figure 22 .Figure 23 .
Figure 22.Optimal power values on the 118-bus system with time delays bounded by τ = 3.

Table 1 .
Parameters of the units in IEEE 14-bus system.

Table 2 .
Parameters of Wind and WT.

Table 3 .
The optimal power values.