A Distributed Two-Stage Economic Dispatch for Virtual Power Plant Based on An Improved Exact Diffusion Algorithm

To manage a large scale of distributed energy resources (DERs) dispersed geographically and reduce the impact of DER uncertainties, this paper proposes a distributed two-stage economic dispatch for virtual power plant (VPP) to track a specified VPP schedule curve. In the look-ahead stage, a distributed economic dispatch strategy is proposed to optimally allocate the scheduled power among DERs. In the real-time stage, a distributed VPP schedule curve tracking problem is modeled to balance the fluctuation of wind farms and/or PV stations. The two-stage distributed optimization problems are solved by an improved exact diffusion algorithm which is proved to be robust to local communication failure. Case studies validate the performance of the algorithm proposed.


INTRODUCTION
In recent years, the penetration rate of renewable energy especially for wind and solar power is rapidly increasing. However, the power fluctuation of wind and solar power pose great challenges for the operation and control of the evolving power system, such as frequency control and peak-load regulation (Bouffard and Galiana 2008). In reality, there are large number of DERs including wind farms and PV parks, micro turbine generator, storage, different types of flexible demand resources like EV, thermal pump load, air-conditioner, etc. (DING Yi 2016), dispersed geographically to provide flexible power supply. To manage these DERs, the virtual power plant (VPP) is introduced as an aggregator to manage and dispatch these DERs to achieve an resource sharing and overall benefit target, which has attracted great attention in power industry (Koraki and Strunz 2018).
Usually, VPP manages DERs in two modes: centralized and distributed. In centralized way, DERs in VPP are managed and dispatched by a central system operator (CSO). In this way, the most challenging issue for the CSO is how to manage uncertainties from various DERs. There have been massive efforts devoted to this issue. For example, in (Baringo, Baringo, and Arroyo 2019), a combination of scenario-based stochastic programming and adaptive robust optimization is developed for VPP to participate in the day-ahead energy and reserve electricity market, where the wind power uncertainty is represented by confidence bounds. In (Vahedipour-Dahraie et al., 2021) a two-stage risk-averse stochastic framework is proposed for optimal schedule of energy and reserve services for VPP, in which a Monte Carlo method is developed considering the probability distribution of the market prices, renewable energy power, flexible loads as well as the reserve requirement. In addition to the uncertainty issue, due to the user privacy, some DER information cannot be shared with CSO and thus how to model flexible loads with incomplete information and conduct decision-making is another issue in this centralized framework. To overcome this problem, in (Zhou et al., 2021) each DER is represented by an automatic response model based on Markov decision process and an event-driven stimulusfeedback control scheme is proposed to guide DERs with limited information via self-approaching optimization. However, since DERs are dispersed geographically, so in the centralized mode there always exist some risk of communication failure and transfer delay considering large scale of DER communication network.
On the other hand, in a distributed VPP each DER has limited information exchange with neighboring DERs and is less dependent on communication compared with the centralized VPP, and thus the VPP communication burden can be decreased. In distributed VPP, a basic issue is how to realize each DER's distributed economic dispatch (DED) operation. In existing works, there are mainly three strategies to solve the DED problem (Yuan et al., 2019a): 1) the consensus strategy, 2) the diffusion strategy and 3) the alternating direction method of multipliers (ADMM). In these DED strategies, each DER exists an independent iteration process to approach its own optimal solution. The main differences are as follows: In the consensus strategy, in each iteration every DER will exchange information with neighboring DERs and then its incremental cost is updated, and finally all DERs will reach consensus with a common the incremental cost (Nedic and Ozdaglar 2009). In comparison, in the diffusion strategy, the incremental cost is first updated and then followed by the information exchange, i.e., the difference is mainly on the procedure order, which has proved to be more stable and effective (Tu and Sayed 2012). Furthermore, an improved diffusion algorithm called the exact diffusion algorithm (the standard EDA) is proposed in (Yuan et al., 2019a) which can accelerate the convergence speed and can approach to the exact optimal solution. A common point for the former two methods is that each DER will finally approach to the equal increment principle (EIP) consensus in mechanism. On the other hand, the algorithm mechanism of ADMM is different from the former two, in which the DER optimization problem is decomposed into several subproblems including some primal and dual problems, which are solved in sequence and coordinated to find a global solution (Boyd 2010). (Xia et al., 2019) presented a distributed hierarchical framework based on ADMM to manage multiple DERs in an economic way.
The main contribution of this paper is summarized as follows: 1) A distributed two-stage economic dispatch is proposed to track the generation schedule curve. During the economic dispatch, DERs make determinations independently only with the limited information from their neighboring DERs, which can protect user privacy. The proposed two-stage distributed economic dispatch can well adapt to the future power system dispatch framework considering the rolling ultra-short-term forecasting of renewable generation. 2) Local communication failure is carefully considered and the treatment proposed enables each agent to react to the communication failure independently and the algorithm can still converge to the optimal point without interrupting the optimization process. Compared with the existing works that consider the communication failure treatment in systemlevel, the treatment proposed is more practical in distributed optimization. 3) An improved EDA is developed to solve the distributed problem, which can accelerate the convergence speed with the penalty term and reduce the communication burden compared with the standard EDA. The penalty term only involves the information from neighboring DERs which doesn't need extra effort to achieve global information and can increase convergence efficiency.
The remaining part of the paper is organized as follows: The Dispatch Framework of Virtual Power Plant introduces the framework of VPP's dispatch framework and its topology; in The Two-Stage Distributed Economic Dispatch for VPP a distributed two-stage economic dispatch optimization model for VPP is formulated and an improved EDA is developed; Case Study includes the case study to validate the effectiveness of the algorithm proposed; Conclusion concludes the paper.

THE DISPATCH FRAMEWORK OF VIRTUAL POWER PLANT
VPP is a network of decentralized, medium-scale DERs such as wind farms, PV stations, micro turbine and flexible loads (residential, commercial and industrial) and storage systems, etc. The objective of introducing VPP is to relieve the load requirement/capacity of the individual units during periods of power generation shortage. In short, VPP can aggregate DERs dispersed in various areas as a whole virtual generator unit dispatched by the power system. VPP is responsible for the generation scheduling and benefit allocation among each DER. To reduce the impact of DER uncertainty, the following two-stage VPP dispatch is considered: 1) In the look-ahead dispatch, the initial VPP schedule curve will be determined by the VPP aggregator firstly and then be submitted to CSO. After executing the system-level economic dispatch, CSO will issue the corrected VPP schedule curve (considering transmission congestion, VPP capacity limits, etc.) to VPP. Finally, VPP will allocate the scheduled VPP power among all dispatchable DERs based on the forecasting wind and solar power; 2) In the real-time stage, VPP can further adjust each dispatchable DER power if there is any update of wind and solar power information from the ultrashort-term forecasting (i.e., the real-time forecasting) so that the look-ahead VPP schedule curve can be well tracked.
For the purpose of managing a large scale of DERs dispersed geographically and dealing with the uncertainty of DERs, in this study the DER power schedule will be determined by a distributed two-stage economic dispatch in a multi-agent communication framework.

Multi-Agent Communication Framework
The distributed optimization of DERs in VPP in this study is implemented in a multi-agent communication framework, as illustrated in Figure 1. Each DER is assigned to an agent who is responsible for communication with the other agent, controlling the DER power, and detecting the measurement changes (e.g., power deviation, changes in temperature). In this study, only five kinds of DER/agents are considered, but the proposed method can be easily extended to other DERs if any: wind power agent (WPA), photovoltaic agent (PVA), micro turbine agent (MTA), storage agent (SA), flexible load agent (FLA). What's more, among the agents mentioned above, one agent with reliable communicate connection with CSO is specified as the connection agent who takes extra responsibility for external communication and internal information publishing.
For simplicity, in this paper the agent index system is identical to the DER index system, i.e., each DER has the same index as its corresponding DER agent as described below. The communication network of the agents can be described using an undirected graph G {ϕ N , ϕ E , ϕ W }, which is consisting of three types of elements: 1) an agent index set ϕ N {1, 2, /n}, and the 1st agent represents the connection agent 2) an edge set ϕ E where each edge (i, j) ∈ ϕ E is an unordered pair of distinct agents, and 3) the topology graph ϕ W {w ij i, j ∈ ϕ N } and w ij is the edge weight. If agent i and agent j can communicate with each other, i.e. (i, j) ∈ ϕ E , then w ij > 0, and they are considered neighboring. If (i, j) ∉ ϕ E , then w ij 0. In this study, w ij is given by (Lin and Boyd 2003): where n i and n j denotes the number of the neighboring agents of agent i and agent j, respectively.
In the communication framework above, the agents have the following characteristics (McArthur et al., 2007): 1) n agents in above definition means there are n DERs in VPP, vice versa. 2) Each dispatchable DER is a controlled unit and assigned to an agent that is responsible for communication and control. The agents of non-dispatchable DERs (wind farms or PV stations) only have the duty of communication. 3) Each agent has the functions of bidirectional communication, self-determination and sensing the environment. All the agents in VPP can coordinate and control DER through mutual communication to achieve the optimization goal of the whole system.

DER Economy Model
For the three typical dispatchable DERs in VPP mentioned above, the classic quadratic function is adopted to define the DER operation costs: In above economy models, the variable subscripts "MT," "S," and "FL" denote the micro turbine, storage and flexible loads, Frontiers in Energy Research | www.frontiersin.org October 2021 | Volume 9 | Article 734801 respectively; C(·) is the cost function; P t is the power output or consumption at time t; a, b and c denote the coefficients of quadratic cost function; P and P represent the upper and the lower limits of the power; SOC t is the storage state of charge; SOC and SOC are its upper and the lower limits; S represents the storage capacity; η is the discharge and charge efficient; Δt is the time interval between t and t + 1; P B,t FL is the baseline load. In Eq. 2c, the incentive cost is adopted here for flexible load adjustment cost which is the function of the load power change (Wang et al., 2019).

The Two-Stage Dispatch Framework
To accommodate renewable power integration and reduce the impact of prediction error, a multiple time-scale rolling dispatch framework is adopted (Li et al., 2015), which includes the following two stage process: 1) the look-ahead dispatch, which will execute VPP dispatch in a receding horizon every 1 h in the upcoming 4 h, with a time resolution of 15 min and 2) the real-time dispatch, which will perform in a receding horizon every 5 min in the upcoming 1 h, with a time resolution of 5 min.

THE TWO-STAGE DISTRIBUTED ECONOMIC DISPATCH FOR VPP
According to the VPP framework discussed in The Dispatch Framework of Virtual Power Plant, a look-ahead and real-time two-stage distributed economic dispatch is developed in this section.

The Look-Ahead Economic Dispatch Model
In the look-ahead dispatch, VPP is responsible for allocating the 4 h VPP power schedule with a time resolution of 15 min issued by CSO to each DER based on the look-ahead forecasting wind and solar power.

The Look-Ahead CED Model
The wind and solar power are non-dispatchable DERs whose cost are regarded as constant, so only the overall VPP cost minimization of micro turbine, storage and flexible loads is considered: where n is the number of DER; P t MT,i , P t S,i and P t FL,i are the power of micro turbines, storage and flexible loads, respectively (Note: an uniform DER index is used and i denotes the ith DER, P t S,i P t FL,i 0, and the storage DER and flexible load DER follow the similar rule). For clean expression, the symbol t is omitted when there is no confusion in the context.
The constraints in the look-ahead stage include: (1) Flexible load power limits: The minimum and maximum power limits of all flexible loads are considered constant values in this paper. It should be noted that the limits in Eq. 3b can be adjusted with the real environment parameters in different periods, such as temperature, air pressure, etc. (Lu 2012) 2) Storage power and SOC limits: 3) Micro turbine power limits: 4) Power flow limits: where P l is the power flow in line l; P l and P l represent the power flow limits of line l; m is the number of lines. Based on DC power flow, P l can be transformed to a linear combination of DERs power (Christie et al., 2000).
where ρ li is the sensitivity of power injection at DER i to the power flow on line l. Denote Db[ρ li ] ∈ R m×n , D is the power transfer distribution factor matrix, which can be obtained as follows (Šošić et al., 2014): where B f is the matrix of branch network susceptances; B r is the matrix of nodes' susceptances.
(5) Power balance: where P lk W,i and P lk V,i are the wind and PV look-ahead forecasting power, respectively; P VPP is the scheduled VPP power output.
The optimization model (3a)-(3f) is called a typical centralized economic dispatch (CED) for VPP. To derive the DED model, the dual counterpart of (3a)-(3f) is further organized as: where λ, z l ≥ 0 and z l ≥ 0 are the Lagrangian multipliers; the notation S[ · ] denotes the constraint projection operator, which can bound the argument within the constraint [P, P].

The Look-Ahead DED Model
To transform the centralized model into the distributed model (Mateos-Nunez and Cortes 2017), the Lagrangian multiplier λ in Eq. 4a is separated as following: For a communication-connected system, Eq. 5b means that all multipliers are equal, which makes (5a) holds. In Eq. 5a, since P VPP is not the power output of any DER, here the connection agent's Lagrangian multiplier λ 1 will be used for P VPP . z l and z l can be separated similarly to become z l [z l,1 , /, z l,k , /z l,n ] and z l [ z l,1 , /, z l,k , / z l,n ]. z l,k and z l,k are the Lagrangian multiplier of line l at kth DER. And in terms of power flow constraints, and are used for and in (6a) z l,1 , z l,1 are used for P l and P l . In this way, all DERs can be decoupled with each other so that the centralized model is transferred into a distributed model. Finally, the distributed model of the look-ahead economic dispatch is formed: s.t. λ i λ j , z l,i z l,j , z l,i z l,j i, j ∈ φ E L d λ 1 , z l,1 , z l,1 C MT,1 P p MT,1 + C S,1 P p S,1 + C FL,i P p FL,1 − λ 1 P p MT,1 + P p S,1 + P p FL,1 + P lk W,1 + P lk V,1 − P VPP + ρ li z l,1 − z l,1 · P p MT,1 + P p S,1 + P p FL,1 + P lk W,1 + P lk V,1 − z l,1 · P l + z l,1 · P l (i 1) The Real-Time Economic Dispatch Model In the real-time stage, VPP will adjust DER power through rolling optimization if there is any update of wind and solar power information from the ultra-short-term/real-time forecasting to track the look-ahead VPP schedule curve in a receding horizon every 5 min in the upcoming 1 h.

The Real-Time CED Model
In the real-time stage, suppose at each timer interval t, the lookahead VPP schedule curve can be completely tracked, the following minimum cost objective function is considered (3a)-(3f): where P lk MT,i , P lk S,i and P lk FL,i are the latest look-ahead scheduled power of micro turbines, storage and flexible loads respectively; ΔP GOAL represents the expected regulation of VPP to track the VPP schedule curve; P real W,i and P real V,i are the real-time forecasting power of wind and PV; ΔP W,i and ΔP V,i are the power deviation of wind and solar, respectively.

The Expected Regulation Correction
In reality, the expected regulation ΔP GOAL should also consider the VPP regulation limits and dead zone for further corrections: where ΔP up,i is the up-regulation capacity of ith DER; ΔP down,i is the down-regulation capacity; M VPP is the regulation dead-zone. In Eq. 8, two particular cases related to wind/solar power uncertainty are considered: 1) If the total real-time forecasting power is less than the total look-ahead forecasting values i.e., ΔP W,i + ΔP V,i < 0, the dispatchable DERs need to increase their power up to ΔP up,i to correct the deviation; 2) On the other hand, the real-time forecasting power is higher than the total look-ahead one, i.e., ΔP W,i + ΔP V,i > 0, the dispatchable DERs need to reduce their power down to ΔP down,i .

The Real-Time DED Model
Like the look-ahead DED model, the real-time DED model is constructed as follows: It is noted that Eq. 9 doesn't mean the expected regulation of each DER is ΔP GOAL /n. It only reflects the total regulation requirement for VPP. Since ΔP GOAL is the VPP-level regulation, for each agent how to achieve ΔP GOAL /n based on the local information is an important concern, which will be discussed in The Real-Time DED Procedure.
The two-stage DED problems Eqs 6, 9 are convex optimization problems with equality constraint, which can be solved by the method explained below.

Solution Methodology Based on the Improved Exact Diffusion Algorithm
To solve the distributed optimization problems above, an improved EDA is developed.

The Standard Exact Diffusion Algorithm
In the distributed convex optimization problems Eqs 6, 9, the three Lagrangian multipliers λ, z l and z l are independent and they can be updated alternatively in each iteration (Mateos-Nunez and Cortes 2017). Taking λ as example, the standard EDA in (10a)-(10c) can be applied for updating the Lagrangian multipliers (Yuan et al., 2019a), z l and z l can be done similarly: where for the ith DER at iteration k, λ i (k) represents a Lagrangian multiplier and can be regarded as the incremental cost of the ith DER to be updated; μ is the step size, which is set to 0.1 in the study; ϕ i (k) represents the local incremental cost by a gradient-descent type iteration, similar to consensus iteration; φ i (k) is the local incremental cost considering bias correction (Yuan et al., 2019a); L(λ i ) stands for L d (λ i ) in the look-ahead DED and L r (λ i ) in the realtime DED, respectively; w ij is the edge weight introduced in Eq. 1. More explanations about (10a)-(10c) are added as follows: 1) In Eq. 10a, usually the gradient at optimal point λ p of each DER is not zero (for instance, zL d (λ)/zλ i is the power output of ith DER which is not zero in general). It will cause oscillation when λ i reaches near the optimal point and slow down the convergence. A correction term λ i (k) − ϕ i (k) is added in Eq. 10b to remove the bias incurred by the gradient item, as is proved by Eq. 11. When λ i converge to λ p : 2) In Eq. 10c, information exchange between the neighboring agents occurs. Each agent will exchange its φ i (k) with all neighbors and the weighted average cost in Eq. 10c is used to evaluate the next incremental cost λ i (k + 1). During the whole iteration, the incremental cost of any DER will be diffused to other communication-connected DERs through Eq. 10c and λ i (k) will finally converge and reach the global optimal point (Yuan et al., 2019b).

The Improved Exact Diffusion Algorithm Convex Penalty Term
To increase the cost for the equality constraints violation of λ i λ j and accelerate the convergence speed, a convex penalty term (i,j)∈ϕ E β(λ i − λ j ) 2 is added to the DED objective function Eqs 6, 9, β is the penalty parameter, which is set to 0.7 in the study. And the exact-diffusion-based formulas to be updated in each iteration become: where The designed penalty term only involves the information from neighboring DERs which doesn't need extra effort to achieve global information during the iterations and can increase convergence efficiency, while the ADMM need the information of the whole VPP (Xia et al., 2019).

Information Exchange Relief and Stop Criteria
Each agent will exchange the following information with its neighbors: 1) φ i (k + 1); 2) X i (k); 3) the agent status, any of these three types (Normal, Idle, or Failure) (as explained in The Look-Ahead DED Procedure). To reduce the information exchange burden of communication during the distribution optimization process, the following conditional communication rule in Eq. 14 will be applied when there is minor incremental cost difference between consecutive iterations: Thus, the conditional communication rule becomes: If Eq. 13 is satisfied, then X i (k) X i (k − 1), φ i (k + 1) φ i (k) When the conditional communication rule is satisfied with a pre-specified accuracy level ε (10 −5 in the study), agent i will stop information exchange and set the agent status Idle, and accordingly the agents that receive Idle from agent j will update X with the last φ j and X j they received from agent j. It should be noted that when agent i and its neighbors are all Idle, agent i will stop the iteration.

Local Communication Failure Treatment
In distributed communication network, the information transfer distance is short, and the impact of delay and bit errors is limited compared with communication failures. So, the treatment of local communication failures is studied in this paper.
When there is local communication failure happened (the dotted line in Figure 2) and provided that the communication network keeps connected, the proposed algorithm still works according to the following treatment Eqs 1-3: 1) If agent i and agent j cannot receive the next updated information from each other within the maximum datatransfer waiting time, they will set the agent status Failure.
2) Then in the next iteration, the number of the neighboring agents for the involved agent i and agent j (i.e., the shadowed agents in Figure 2) will be less one in Eq. 14 and then Eq. 1 will be recalculated to update w ij . n i n i − 1, n j n j − 1 3) When the communication recovers, agent i and agent j can receive information from each other, and the agent status will be set to Normal, and update n i , n j and w ij similarly.
It is worth mentioning that the proposed algorithm also has some error tolerance for communication delay, when the datatransfer time exceeds the maximum waiting time, then the algorithm iteration will turn to above local communication failure treatment Eqs 1-3. In addition, the proposed improved EDA is robust to occasional bit errors. The false data due to bit errors can be regarded as another new initial data and the algorithm can still reach convergence as long as the remaining data is correct during the iterations, since one advantage of EDA is that its convergence performance is insensitive to the initialization setting (Yuan et al., 2019b).

The DED Solution Procedure
The Look-Ahead DED Procedure For each agent, the look-ahead DED algorithm in pseudo-code form is summarized in Table 1, in which 2.2 represents the conditional communication strategy, 2.3 represents information exchange and 2.4 represents the communication failure treatment, respectively. The maximum data-transfer waiting time is set to 3 ms in the study.

The Real-Time DED Procedure
As mentioned in The Expected Regulation Correction, in the realtime stage how to evaluate the expected regulation ΔP GOAL /n based on the local information should be finished before executing the improved EDA. For each agent, the local information given includes: 1) The forecasting power deviation Preparation: Calculate the power transfer distribution factor matrix D 1. Initialization: Let k 0, X i (0) ϕ i (0) 0, set the status of agent i and all its neighbors as Normal 2. While (agent i and its neighbors are not Idle) { 2.1 z l (k) max{0, z l (k)}, z l (k) max{0, z l (k)} 2.2 Apply (4b) and (12) to update P p i , ϕ i (k + 1) and φ i (k + 1) 2.3 If (14) is satisfied, then set agent i as Idle 2.4 If the data-transfer waiting time of agent j is greater than 3 ms { Set the status of agent j as Failure;} Else { Set the status of agent j as Normal Send X i (k), φ i (k + 1) and the agent status to agent j and receive agent j updated information; } 2.5 Traverse agent status of agent i and all the neighbors 2.4.1 If agent j is Failure [n j n j − 1 and recalculate (1); ] 2.4.2 If agent j is Idle { set X j (k) X j (k − 1), φ j (k + 1) φ j (k); } 2.6 Apply (10c) to update X i (k + 1) 2.7 k k + 1 } 3. End 1. Initialization: Let k = 0, calculate D i (0) with real-time forecasting and real-time measurement data and set agent status of agent i as Normal 2. While (agent i and its neighbors are not Idle) { 2.1 Apply (15b) to update δ i (k + 1) 2.2 Handling information exchange, communication failure and conditional communication if any 2.3 Apply (15c) to update D i (k + 1) 2.4 k k + 1 } 3. Set ΔP GOAL based on (8) from the final D i (k) according to (15d)-(15e) 4. Early algorithm termination evaluation 4.1 If ΔP GOAL equals zero; then stop and end 4.2 If ΔP GOAL is equal to its upper or lower limits, { Set the dispatchable DERs power equal to their limit values Stop and end;} 5. Execute the real-time DED similar to Step 1-2 in the look-ahead DED Frontiers in Energy Research | www.frontiersin.org October 2021 | Volume 9 | Article 734801 ΔP W,i + ΔP V,i , for the DER without any wind or solar power, ΔP W,i + ΔP V,i 0; 2) The regulation capacity ΔP up,i and ΔP down,i , for non-dispatchable DERs, ΔP up,i 0 and ΔP down,i 0. The information diffusion strategy in (de Azevedo et al., 2017) is adopted for each agent to get the global information in Eq. 8, which can be regarded as an algorithm preparation for the improved DEA to solve the real-time DED problem, here some important procedures are explained below.
In (15b)-(15c), the information diffusion iteration can be regarded as a specific form of the standard EDA iteration where D i (k), 0.65D i (k) and δ i (k) correspond to λ i (k), ϕ i (k) and φ i (k) in (10a)-(10c), respectively. In this way, the similar information exchange, stop criteria and local communication failure treatment in The Improved Exact Diffusion Algorithm and Local Communication Failure Treatment can be applied.
2) When the algorithm converges and let D i (∞) denotes the final regulation vector, thus each agent can achieve the global information as follows: 3) Each agent can achieve the average expected regulation of VPP ΔP GOAL /n using Eq. 8.
For each agent, the whole real-time DED algorithm including the expected regulation evaluation is summarized in Table 2, in which the details of the information exchange and communication failure treatment is similar to those in the look-ahead DED procedure, Step 1-3 represents the information diffusion strategy for algorithm preparation.

CASE STUDY
To validate the performance of the algorithm proposed above, we use a modified IEEE 14-bus topology to represent the VPP internal topology, as illustrated in Figure 3. There are 14 DERs deployed separately in the system. Two wind farms are deployed at bus 3 and bus 8, respectively, one PV station at bus 6 and the rest buses are deployed with dispatchable DERs. The dispatchable DERs data are given in Table 3, where the positive value means the power is injected and the negative value means the power is absorbed. The power flow constraints are excluded in the case. As mentioned in Multi-Agent Communication Framework, the bus indices in Table 3 are used to represent the DER indices and each DER agent has the same index as its corresponding DER; and the connection agent is located at bus 1 which is connected to the main grid. The communication network topology is identical to the physical network topology. The battery storage parameters and the improved EDA parameters are summarized in Table 4 and Table 5, respectively.  Suppose the look-ahead VPP dispatch is executed at t 8:00 and the corresponding real-time VPP dispatch is executed at t 9: 00. Figure 4A gives the 4 h look-ahead forecasting data from 8:00 to 12:00, including the wind power at bus 3 (PW3) and bus 8 (PW8), the solar power at bus 6 (PV6). Figure 4B shows the VPP schedule curve issued by CSO, in which the negative value means VPP need to absorb power, considering some specific operation scenario that the wind and solar power is low. Figure 4C gives the total baseline flexible loads profiles initially (before dispatch).

Dispatch Results
The look-ahead DED is finished based on the improved EDA in Solution Methodology Based on the Improved Exact Diffusion Algorithm. For comparison purpose, the CED model (3a)-(3f) is also solved. The total cost of each dispatchable DER from the DED solution and the CED overall cost are presented in Figure 5A, it is very clear that the total DED cost is very close to the CED overall cost, which can confirm the effectiveness of the DED model. Further, the resultant time-series VPP power exchange with the main grid is plotted in Figure 5B which can well track the VPP schedule curve in Figure 4B. The resultant total battery storage power and the total flexible loads after the look-ahead dispatch is shown in Figure 5C. The micro turbine doesn't provide any power output in the look-ahead dispatch due to its high cost.
The real-time tracking performance of VPP from 9:00−10:00 is shown in Figures 6A,B. Due to the deviation between the look-ahead forecasting and the real-time forecasting, there exists obvious tracking errors, comparing the VPP power output (the dot dash line) with the VPP schedule curve (the solid line) in Figure 6B. In addition, the real-time DED can further correct the deviation (the dash line) and improve the tracking performance.

Analysis on the Effect of Prediction Error
To analyze the effect of prediction error on dispatch performance, the look-ahead dispatch according to four prediction error level, ± 10, ± 15, ± 20, and ±25% are presented in Figure 7, where the real-time wind and solar power data here is represented by the look-ahead prediction plus prediction error. Based on the above two-stage dispatch, the tracking standard deviation from the schedule curve during 9:00−10:00 is used to measure the tracking effect is presented in Table 6.
It is observed that when the prediction error is within ± 20%, the VPP power output in this test system can well track the schedule curve. Nevertheless, the tracking performance will become worse when the prediction error is enlarged, because the total up-regulation capacity is not enough in this case. On the other hand, the dispatch performance can be satisfied when there is enough adjustment capacity in the real-time stage to compensate for the deviation.

Communication Robustness
To verify the algorithm robustness, it is supposed that the communication line between agent 1 and agent 2 fails at 9:15 during the real-time DED. The whole convergence process of agent 1 (at bus 1) for the 9:15−9:20 time interval with and without communication failure is plotted in Figure 8: It can be seen from Figure 8, when the local communication failure occurs, the proposed improved EDA still has enough robustness to converge to the same optimal solution without

Algorithm Performance Verification
To measure the accuracy and convergence performance of the improved EDA, a power residual based performance index Re is introduced (Tang, Hill, and Liu 2018): Re P(k) − P p 2 / P(0) − P p 2 where P(k) P 1 (k), P 2 (k)/P n (k) is the kth iteration DER power vector; P i (k) is the power of the ith DER at iteration k; P p is the optimal power obtained by the CED method; the less is the Re value, the more accurate will the method be.
For comparison purpose, here the look-ahead dispatch at 8:00 is performed using the proposed improved EDA, the standard EDA and the consensus-based algorithm (Tang, Hill, and Liu 2018). The results are given in Figure 9, where the convergence processes of all DERs are presented in Figure 9A and the power residual evolution comparison is presented in Figure 9B. It is very clear that the incremental cost of all DERs converge to the consensus value λ 2.625. Figure 9B also verifies the improved EDA have better accuracy and convergence performance than the standard EDA and the consensus-based algorithm. For the real-time DED, the improved EDA has similar observation and conclusion.

CONCLUSION
A distributed two-stage economic dispatch for VPP based on the improved exact diffusion algorithm is proposed in this paper to manage a large scale of DERs dispersed geographically and deal with the uncertainty of DERs. The centralized look-ahead dispatch and real-time tracking models are transformed to distributed ones by constructing dual problems and separating the Lagrange multipliers. The exact diffusion algorithm is improved by adding a convex penalty term and a conditional communication strategy. Case studies based on a modified IEEE 14-bus system validate that VPP power output can track the VPP schedule curve well and balance the power deviation using the improved exact diffusion algorithm with certain robustness against local communication failure.

DATA AVAILABILITY STATEMENT
The original contributions presented in the study are included in the article/supplementary material, further inquiries can be directed to the corresponding author.

AUTHOR CONTRIBUTIONS
YZ and ZW conceptualized the study; YZ and ZW performed the analysis; YZ, ZW, and HW performed investigations; ZW and PJ acquired resources; ZW and PJ acquired funding; YZ and ZW wrote the original draft; PJ and HW reviewed and edited the manuscript. All authors agree to be accountable for the content of the work.