Alyssia Dong

Thomas Baroche

Roman Le Goff Latimier

Hamid Ben

Convergence analysis of an asynchronous peer-to-peer market with communication delays

Keywords: Peer-to-peer market, Asynchronous resolution, ADMM, Communication delays

With the growing number of distributed energy resources, the number of agents partaking in an electricity market is also bound to increase, which highlights the need of a scalable algorithm to clear the market. The interest towards distributed economic dispatch algorithms has grown in the last years as they were found to be scalable, unlike their centralized counterpart. However, these algorithms rely on communication between computational agents during the resolution of the problem. In the case where those computational agents are located far away from each other, the resolution may be impacted by the various hazards that can occur in the communication network. The asynchronous resolution of the algorithm provides a solution to the large variations in communication delays as it allows the agents to carry on with their computation despite not having received every messages from their market partners. This paper focuses on a peer-to-peer market clearing algorithm based on the alternating direction method of multipliers (ADMM) and its asynchronous version. Two communication delay models are introduced in order to study the effect of communication on the convergence of the synchronous and asynchronous versions of the algorithm. In a 110 agent testcase study, we show that the asynchronous resolution can speed up convergence by 40%, while also being more robust to delay variations.

Introduction

As the power network includes more and more distributed energy resources such as renewables, the number of producers participating in the electricity market significantly increases. This market consists of an agreement upon the amount of power that each agent, producer or consumer, will respectively deliver to or withdraw from the grid at a given horizon in the future. This economic dispatch problem can be extended by taking into account various degrees of physical constraints, as with the optimal power flow (OPF) problem [START_REF] Panciatici | Advanced optimization methods for power systems[END_REF].

Nowadays the market clearing mechanism is being solved as close as 15 minutes before the power delivery [START_REF] Baringo | Virtual power plants[END_REF]. However, because the proportion of highly uncertain renewable energy is bound to increase significantly in the future, it may be interesting to push the market clearing closer to the delivery time in order to be more precise with the production forecasting. Indeed, reducing the production forecast error helps minimizing the power reserves set aside to compensate for these errors. It also reduces the risks of blackout of the power system. Hence, it becomes necessary to speed up, scale and strengthen the process of market clearing in order to solve the energy dispatch problem within a timely manner.

Although the market clearing is historically centralized, it can also be distributed or fully decentralized. In the distributed case, a central agent gather information from all market participants whereas in the fully decentralized case, there is no central agent and the participants communicate directly with each other. The interest for a fully decentralized peer-to-peer market has increased throughout the years as demonstrated by the research and development projects listed in [START_REF] Sousa | Peer-to-peer and community-based markets: A comprehensive review[END_REF], including, but not limited to, the Enerchain1 project, a peer-to-peer platform allowing trading at different scales, from the wholesale market in Europe to local community exchanges, and the Energy Collective2 project in Denmark, which investigates market designs for local energy communities. Indeed, peer-to-peer markets allow heterogeneous preferences, which gives flexibility on the choice of the trading partners, as well as direct communication between partners to speed up the trading process and ensure prompt transmission of energy [START_REF] Jogunola | State-Of-The-Art and Prospects for Peer-To-Peer Transaction-Based Energy System[END_REF]. The decentralization of the market clearing problem makes it much more scalable while introducing information exchanges between market agents [START_REF] Molzahn | A Survey of Distributed Optimization and Control Algorithms for Electric Power Systems[END_REF].

In comparison to the distributed approach, the peer-to-peer market resolution needs much more message exchanges to arrive to completion, since instead of having to send one message to an unique central agent, each market participant has to send and receive messages directly to and from their commercial partners. Considering that in theory the peer-to-peer market will include hundreds or thousands of participants, the problem of idle time between each iteration presents an added challenge regarding the overall convergence time of the algorithm. In particular, communication hazards can have a bigger impact on the resolution. Provided that the communication protocol does not allow any message loss, the main drawback to distributed and decentralized market resolution lies within the variations in computation and communication delays. Indeed, the algorithms require that all agents compute and communicate their results to the other agents at each iteration. The late arrival of only one message will slow down the iteration for the entire market. Hence, despite the inherent scalability of the distributed and decentralized algorithms, their resolution time are very sensitive to delay variations, be it from computational delays or communication delays.

We will be focusing in this article on a peer-to-peer market clearing algorithm, using the alternating direction method of multipliers (ADMM), based on [START_REF] Baroche | Exogenous Cost Allocation in Peer-to-Peer Electricity Markets[END_REF], in which all agents communicate to each other via a network protocol that provides ordered, lossless, bi-directional connections such as the Transmission Control Protocol/Internet Protocol (TCP/IP), and where computation delays are neglected. In order to make the convergence time of the resolution less sensitive to the various communication delays, we will propose an asynchronous resolution of the peer-to-peer algorithm in which the various agents perform their calculations asynchronously. A simple parametric communication delay model is introduced in order to analyze the impact of the communication network over the convergence time of this asynchronous market clearing algorithm.

We will start in section 2 by presenting the state of the art concerning distributed and decentralized asynchronous algorithms used for power networks. Then, in section 3, we will present the synchronous market clearing algorithm, before introducing the asynchronous version in section 4. The simulation framework for the new algorithm will be presented in section 5, while the related results will be explained in section 6.

Related work

The distributed resolution of an algorithm to solve power network based problems like OPF, constrained economic dispatch or phase estimation has been widely studied [START_REF] Wu | Coordinated multilateral trades for electric power networks: Theory and implementation[END_REF][START_REF] Pourbabak | Fully Distributed AC Optimal Power Flow[END_REF][START_REF] Kim | A comparison of distributed optimal power flow algorithms[END_REF], including with ADMM based algorithms [START_REF] Erseghe | Distributed optimal power flow using ADMM[END_REF].

These algorithms are meant to be distributed over several computational agents that communicate with each other at every iteration. The speed up resulting from the distribution of the problem is limited by agents with longer computation and communication delays. This is why the asynchronous versions of these algorithms are introduced. The difference between the synchronous and asynchronous versions lies in the idle time between each iteration of the algorithm. In the synchronous version, an agent has to wait for the arrival of the messages of all its neighbors, whereas in the asynchronous version the agent is allowed to carry on with the next iteration after only receiving partial information.

The asynchronous distributed algorithms were first studied from a computer science approach, as the ADMM consensus algorithm is widely used in machine learning applications. In [START_REF] Iutzeler | Asynchronous distributed optimization using a randomized alternating direction method of multipliers[END_REF][START_REF] Abboud | Distributed optimization in large interconnected systems using ADMM[END_REF] the asynchronous character of the resolution is performed by choosing for each iteration an agent at random. This agent is then the only one updating its local problem for the iteration considered. In [START_REF] Zhang | Asynchronous distributed ADMM for consensus optimization[END_REF][START_REF] Chang | Asynchronous Distributed ADMM for Large-Scale Optimization -Part I: Algorithm and Convergence Analysis[END_REF], a central master agent collects information from the distributed workers in an asynchronous way, meaning that it does not wait for the results of every workers. The master launches its computation after receiving a minimum number of updates and with a bounded delay condition i.e. each variable information used by the master must be at most τ iterations old. Given this bounded delay condition, the proof of convergence of the asynchronous algorithm is provided in [START_REF] Zhang | Asynchronous distributed ADMM for consensus optimization[END_REF]. In [START_REF] Zhu | Asynchronous and Distributed ADMM Algorithm for General Form Consensus Optimization[END_REF], the algorithm is distributed block-wise with several servers and workers. The asynchrony comes from the fact that the consensus variable is updated incrementally at each reception of a worker's update. The workers use the latest version of the consensus variable that they have received.

In [START_REF] Zhang | Asynchronous decentralized consensus ADMM for distributed machine learning[END_REF][START_REF] Bastianello | Asynchronous distributed optimization over lossy networks via relaxed admm: Stability and linear convergence[END_REF], the problem becomes totally decentralized. In both papers, the asynchronism comes from a given bounded delay, and it is shown that it allows to significantly improve the total convergence time. However, the final objective function differs from the synchronous solution. Also, the communication delays are either empirical or drawn randomly from a uniform distribution, so there is no added communication delay coming from a designated model introduced in these papers, which seems reasonable given that the calculation times are predominant over the communication times in computer science.

In a power network context, the distributed agents are not located on the same machine, so the communication hazards can affect the algorithm's ability to run smoothly. There have been several studies of asynchronous algorithm applied to power networks. In [START_REF] Zhang | ADMM Optimization Strategies for Wide-Area Oscillation Monitoring in Power Systems under Asynchronous Communication Delays[END_REF], the mode estimation problem, which consists of the estimation of the phase and frequency oscillations in the various nodes of the power network, is solved by a distributed asynchronous ADMM with bounded delay thresholds for the central agent and the local agents. They used the same advanced communication delay model as [START_REF] Xu | ADMM-based Distributed OPF Problem Meets Stochastic Communication Delay[END_REF], and found out that the convergence error was not monotonous anymore as more asynchrony was added.

The optimal power flow problem is also solved with asynchronous algorithms in [START_REF] Xu | ADMM-based Distributed OPF Problem Meets Stochastic Communication Delay[END_REF][START_REF] Guo | Impact of communication delay on asynchronous distributed optimal power flow using ADMM[END_REF][START_REF] Huang | Asynchronous decentralized method for interconnected electricity markets[END_REF][START_REF] Ullah | Distributed Energy Optimization in MAS-based Microgrids using Asynchronous ADMM[END_REF]. In [START_REF] Guo | Impact of communication delay on asynchronous distributed optimal power flow using ADMM[END_REF], the general non-linear constrained optimization problem (AC-OPF) is solved with asynchronous ADMM in a completely decentralized manner. The iterations threshold comes from the number of messages that an agent receives, and the communication delays are randomly generated within a range. The AC-OPF is also solved in [START_REF] Huang | Asynchronous decentralized method for interconnected electricity markets[END_REF] using an asynchronous Lagrangian relaxation method. The global market is split into several local markets that communicate asynchronously with each other. The order of the messages correspond mostly to the difference of computation delays of the agents. The convergence rate of the asynchronous algorithm is higher than the synchronous one if there is a significant difference in computation speed of the agents. [START_REF] Xu | ADMM-based Distributed OPF Problem Meets Stochastic Communication Delay[END_REF] also tackles the OPF problem in a distributed approach with a limited coordination of neighboring nodes. They used an advanced communication delay model and tested several delay-robust strategies to improve their results. The best strategy they found consisted of estimating the missing information due to the asynchronous threshold with a weighted autoregressive model.

The linear approximation of the aforementioned AC-OPF (DC-OPF) was asynchronously solved in [START_REF] Ullah | Distributed Energy Optimization in MAS-based Microgrids using Asynchronous ADMM[END_REF] in a totally decentralized manner for microgrid applications. They made the agents randomly skip some iterations and found out that the more iterations they skipped, the farther from the optimal solution their results were compared to the synchronous algorithm.

An asynchronous version of the peer-to-peer economic dispatch problem is studied in [START_REF] Moret | Negotiation algorithms for peerto-peer electricity markets: Computational properties[END_REF] using both consen-sus+innovation and ADMM. Computation and communication delays are randomly sampled from a random variable. They found out the asynchronous version took longer to converge as oscillations appeared during the resolution.

The communication delay models in the presented related works are varied. Because asynchronous consensus algorithms were first studied from a computer science approach, the communication delays were considered uniformly across all workers. Indeed, the distributed workers are either on the same computer using message passing interface (MPI) to communicate or are located within the same communication sub-network. Thus, simple communication models such as a fixed probability to arrive at each iteration [START_REF] Chang | Asynchronous Distributed ADMM for Large-Scale Optimization -Part I: Algorithm and Convergence Analysis[END_REF][START_REF] Zhu | Asynchronous and Distributed ADMM Algorithm for General Form Consensus Optimization[END_REF] or a probability to lose the message [START_REF] Bastianello | Asynchronous distributed optimization over lossy networks via relaxed admm: Stability and linear convergence[END_REF] were used. Some even used empirical communication delays as they directly implemented their algorithms on hardware [START_REF] Zhang | Asynchronous distributed ADMM for consensus optimization[END_REF][START_REF] Zhang | Asynchronous decentralized consensus ADMM for distributed machine learning[END_REF]. Extending the asynchronous algorithms to power network related problems, some papers have chosen to keep using simple communication delay models: [START_REF] Guo | Impact of communication delay on asynchronous distributed optimal power flow using ADMM[END_REF] samples a delay from a uniform distribution and [START_REF] Huang | Asynchronous decentralized method for interconnected electricity markets[END_REF] uses a unique fixed delay of 10 ms and relies on the empirical computation delay differences. However, considering the application of distributed algorithm to power network where the computational agents might not be located in the same areas, these aforementioned communication delays might be limited in regards to real world application. Hence, some papers have used more complex communication delay models as in [START_REF] Moret | Negotiation algorithms for peerto-peer electricity markets: Computational properties[END_REF] using an exponential distribution, or in [START_REF] Zhu | Asynchronous and Distributed ADMM Algorithm for General Form Consensus Optimization[END_REF][START_REF] Zhang | ADMM Optimization Strategies for Wide-Area Oscillation Monitoring in Power Systems under Asynchronous Communication Delays[END_REF] using an advanced delay model for wide area communication. These models account for larger communication delays being sampled more frequently, as experienced in real world application.

This article is a continuation of the work presented in this section in which it presents an asynchronous decentralized algorithm used to solve a power network dispatch problem. We particularly focused on extending the communication model by using a communication delay model which depends on the geographical location of the market participating agents. We first had to try several configurations of the asynchronous algorithm to find the one which leads to the right solution. Then, we empirically showed that the asynchronous version of the algorithm allowed for up to a 40% convergence time saving, while also making it more robust to communication delays variations.

Peer-to-peer electricity market algorithm

The classical algorithm used in this paper performs an economic dispatch between all participating agents. Each agent negotiates contracts to trade power with other agents, its commercial or trading partners. The sum of all trades of one particular agent represents the power that this agent will produce or consume.

One of the benefits of using trades, besides enabling a fully decentralized economic dispatch, is the possibility to add preferences to promote or penalize certain exchanges. For example, a consumer can choose to favor renewables producers even if their price is a bit higher than that of a traditional producer. In [START_REF] Baroche | Exogenous Cost Allocation in Peer-to-Peer Electricity Markets[END_REF], the tariffs are used to favor exchanges within a region, thus avoiding congestion of weak power lines between regions.

Optimization problem

The economic dispatch of the market is solved by finding the solution to the following optimization problem: minimize

[p i ] i∈Ω i∈Ω f i (p i ) (1a) subject to i∈Ω p i = 0 (1b) p i ≤ p i ≤ p i i ∈ Ω (1c)
where:

• p i represents the power exchanged by agent i, counted as positive if actually produced by the agent and negative if consumed,

• the cost functions f i (.) are convex functions representing the production/consumption costs of agent i,

• p i and p i are limits for production or consumption of agent i.

Equation (1b) represents the global power balance in the network, and equation (1c) sets the physical limits of production/consumption of the agents. The scope of this contribution is to focus on the impact of the communication network. Therefore for the sake of clarity when interpreting the outcomes, we chose to focus on the simplest problem of economic dispatch. On the basis on the here presented results, we could apply the principles presented in this paper to an OPF problem in future work.

Trades are introduced to describe the commercial exchanges between agents. Let ω i be the set of trading partners of agent i. If we consider agents to be either electricity producer or consumer, then we can assume that a producer will only have consumers as trading partners, and vice versa. The case where a producer purchases power from another producer to increase its capacity is not covered in this paper. Furthermore, if j ∈ ω i , i.e j is one of i's trading partner, then i ∈ ω j .

The trade between agent i and its trading partner agent j is noted as t i j , and it indicates which proportion of the power p i is dedicated to agent j ∈ ω i .

p i = j∈ω i t i j (2)
The balance equation (1b) is fulfilled when there is a trade reciprocity for each trade:

t i j = -t ji i ∈ Ω j ∈ ω i (3)
i.e. when agent i sells a quantity t i j to agent j, then agent j buys the same quantity from agent i. Each trade exchange then assures the power balance. If j ω i , then we set t i j = t ji = 0.

Strict convexification

The problem becomes non strictly convex with respect to the variables (t i j ) (i, j)∈Ω 2 because there can be multiple combinations that are solution to the minimization problem [START_REF] Panciatici | Advanced optimization methods for power systems[END_REF]. A regularization term is added in the cost function (4a) so as to make the problem strictly convex with respect to the trade variables.

minimize i∈Ω         f i (p i ) + γ j∈ω i t i j 2         (4a) subject to t i j = -t ji i ∈ Ω j ∈ ω i (4b) p i = j∈ω i t i j i ∈ Ω (4c) p i ≤ p i ≤ p i i ∈ Ω (4d)
This added term resembles the one in [START_REF] Baroche | Exogenous Cost Allocation in Peer-to-Peer Electricity Markets[END_REF] in as it represents an added cost attributed to the bilateral trade t i j . In this paper, this added cost enforces a more uniform distribution of trades for a given power production or consumption. Hence, it deters the market agents to buy large power quantities at a low cost. In a circumstance where the market agents do not have any limitations on their market partners, it prevents the arbitrage phenomenon where they buy large quantities to then sell at a higher price. We can refer to the added term in (4a) as an arbitrage penalty. We will show in section 6.1 how to properly set the arbitrage penalty factor γ.

Local algorithm

The distribution of problem ( 4) is done via the ADMM method, and detailed in [START_REF] Baroche | Exogenous Cost Allocation in Peer-to-Peer Electricity Markets[END_REF]. The resolution of the problem is done iteratively in a fully decentralized way. Each agent i computes the following iterations:

(p i , t i ) k+1 = arg min (p i ,t i ) f i (p i ) + . . . ( 5a
) j∈ω i          γ t i j 2 + ρ 2        t k i j -t k ji 2 -t i j + λ k i j ρ        2          s.t. p i = j∈ω i t i j p i ≤ p i ≤ p i λ k+1 i j = λ k i j -ρ t k+1 i j + t k+1 ji 2 j ∈ ω i (5b)
with k being the global iteration number, ρ being the penalty factor of the algorithm, and λ i j being the dual variable associated with the element i j of the trade's reciprocity constraint (4b).

Note that (5b) can be written as:

λ k i j = λ k-1 i j -ρ t k i j + t k ji 2 j ∈ ω i k ≥ 1 (6)
Thus, the process performed by each agent is presented in Algorithm 1.

Algorithm 1 Synchronous Algorithm

: Agent i local process procedure SynchronousAgentProcess(t 0 i , λ 0 i ) t i ← t 0 i Initialization λ i ← λ 0 i k ← 0 send t 0 i j to all j ∈ ω i repeat Proceed until convergence receive t k ji from all j ∈ ω i if k ≥ 1 then update λ k i with (6) end if update t k+1 i with (5a) send updated t k+1 i j to all j ∈ ω i k ← k + 1 until local residual ≤ ε end procedure 3.4. Residuals
The convergence of the algorithm is characterized by primal and dual residuals. Local residuals are defined for each agent i by:

r k i = j∈ω i (t k i j + t k ji ) 2 (7a)
s k+1 i = j∈ω i (t k+1 i j -t k i j ) 2 (7b)
The primal residual r i reflects the equilibrium of the agent i's trades with its trading partners: the quantity of energy that agent i buys from agent j must correspond to the quantity of energy that agent j sells to the agent i. Thus, r k i ----→ k→∞ 0.

The dual residual s i is a measure of the variation rate of the trades offered by agent i from one iteration to the next. When the algorithm converges, there are no more variations:

s k i ----→ k→∞ 0.
Global residuals are defined by:

r k = i∈Ω r k i (8a) s k = i∈Ω s k i (8b)
For the sake of simplicity, we can determine the convergence of the algorithm with the primal global residual (8a) only. We consider that the algorithm has converged at iteration k conv when:

r k conv ≤ ε (9)
with ε depending on the agents physical limits:

ε = ε 2 rel • i∈Ω max(p i 2 , p i 2 ) ( 10
)
This expression of ε takes into account the squared value of the maximum produced or consumed power in the market. It introduces the relative value ε rel which lets us compare the convergence of different testcases.

Limits of the synchronous algorithm

We can observe in Algorithm 1 that at the beginning of every iteration, every agent stays inactive because it has to wait for all of its partners' messages before continuing iteration calculations. The various communication hazards therefore have a direct effect on the course of the algorithm resolution. The communication protocol used is assumed to take into account message loss and corrupted messages, such as the TCP protocol, which re-send messages when it realizes that they have been lost. A lost or corrupted message then simply leads to a longer communication delay.

If we consider even one communication channel with a high failure rate, then the majority of the waiting time for the entire market would have been spent waiting only for the last message passing through that channel. The more agents that participate in the peer-to-peer market, the longer the expected time of each iteration will be. It means that in terms of overall execution time, this algorithm is not scalable, even though in theory it is completely scalable thanks to the ADMM distribution in operational context. For example, let us consider the 110 agents testcase used in 5.4. For each iteration, 4800 messages in total are sent on the communication network. A 0.1 % loss rate leads to 4.8 lost messages on average per iteration. Using the TCP timeout-based retransmission, the sender re-sends a message after a delay a bit larger than the average round time trip if it does not receive acknowledgment of this message from the receiver. Thus, assuming that the second message does not get lost, the total communication delay for sending one message is going to be on average 3 times what the average communication delay is. Because during an iteration all message exchanges are done in parallel, the longest communication delay will be 3 times slower. Thus, on average, the synchronous algorithm will be 3 times slower to reach convergence than in the case where no messages are lost. The asynchronous algorithm allows the agents to cut this excess idle time by not waiting for all messages to arrive. This is why we are studying the asynchronous version of the aforementioned algorithm in this paper. The next section will present the principles of asynchrony and the different strategies that can be applied.

Another way to speed up the resolution that is not considered here is to partition the market into regions instead of having each market participant solve its own problem. This reduces the number of exchanges during the resolution, thus limiting the added communication delays discussed above. As demonstrated in [START_REF] Guo | Intelligent Partitioning in Distributed Optimization of Electric Power Systems[END_REF] for an OPF problem, a spectral clustering based method can be used to find the optimal partition of the problem in order to speed up the convergence. This partition relies on the computational and physical coupling between nodes. For an economic dispatch problem, the market agents can be grouped into connected communities [START_REF] Baroche | Prosumer markets: A unified formulation[END_REF] with agents who share the same economic interests. These communities, however, may not be optimally partitioned to speed up the convergence time since the computational and physical coupling is a priori not correlated to the economic interests.

Asynchronous peer-to-peer algorithm

Principle of an asynchronous algorithm

The basic principle behind what is referred to as an asynchronous algorithm is that the computations do not take into account all the information at every iteration. In the asynchronous version of our algorithm, local agent i does not have to wait for each of his trading partners update message before proceeding to its calculation, which then reduces the delays of each iteration. Figure 1 represents the message exchanges over time in the synchronous and asynchronous cases for a three agent market. In the asynchronous case, the frequency of agent j's calculations doubles compared to the synchronous version.

i j m t ij 0 t ij 1 t ij 2 t ij 3 t ji 0 t
However the lack of information that arises from the asynchronism makes the algorithm slower to converge in terms of number of iterations, that is to say it needs more communication. Therefore, a balance must be found between asynchronism and number of exchanged messages.

Test of the various strategies of the asynchronous algorithm

Because every agent is now advancing at its own pace, a global iteration counter k is no longer relevant in an asynchronous resolution. We define the local iteration counter k i that corresponds to agent i number of computations. In addition, many resolution schemes are possible because we now dissociate the trade update and the price update of Algorithm 1. We introduce a linkwise iteration counter k i j which indicates the number of updates the trade t i j has been through. Likewise, we introduce the counter l i j for the number of updates of the dual variable λ i j . Let us note Φ k i i the subset of ω i from which agent i received updates at the beginning of iteration k i .

The asynchronous versions of equations ( 5) are then given by the following equations:

(p i , t i ) * = arg min (p i ,t i ) f i (p i ) + . . . ( 11a
) j∈ω i           γ t i j 2 + ρ 2          t k i j i j -t k ji ji 2 -t i j + λ l i j i j ρ          2           s.t. p i = j∈ω i t i j p i ≤ p i ≤ p i λ i j * = λ l i j i j -ρ t k i j +1 i j + t k ji +1 ji 2 j ∈ ω i (11b)
We observe in (11a) that the whole vector t i can possibly be updated. Two strategies can be implemented: only update the variables t i j such that j ∈ Φ k i i (partial trades update), or update all t i j for j ∈ ω i (total trades update). Likewise, the same kind of choice can be made for the dual variable λ i j : partial or total prices update. All these possibilities have been tested empirically and compared in Table 1. While some configurations have converged to a solution, there is only one configuration which reached the optimal solution of problem 4: the partial trades and partial prices update configuration. We will be focusing on this configuration for the rest of the manuscript. This configuration has been tested on several IEEE testcases and reached convergence with the condition of bounded communication delays. The obtained results are equal to the synchronous version of the algorithm, which we can consider optimal since the objective function is convex. While we do not provide a mathematical proof of convergence for this particular asynchronous algorithm, a proof of convergence for a distributed asynchronous consensus ADMM problem is provided in [START_REF] Zhang | Asynchronous distributed ADMM for consensus optimization[END_REF], given a bounded delay condition. Another proof of convergence is provided in [START_REF] Bastianello | Asynchronous distributed optimization over lossy networks via relaxed admm: Stability and linear convergence[END_REF] for a decentralized relaxed ADMM asynchronous algorithm, following the assumption that every message has a non zero probability to arrive to destination at each iteration and that those probabilities are mutually independent over time. Let us note that in our case, the communication models presented in 5.2 respect the bounded delay condition, but that the order of exchanged messages can not ensure the independence of the random variables describing the arrival of messages. It follows that the linkwise iteration counters for the trades and for the dual variables are equal k i j = l i j and that they are increased when j ∈ Φ k i i . Another constraint makes the algorithm perform better: Φ k i i is set in a way that the received trade update message t ji is associated to the tradewise iteration k ji = k i j . If a message is received where k ji > k i j , it is stored in memory and will be taken into account in the next iteration when k ji = k i j . The resulting equations are then given as follows:

λ k i j i j = λ k i j -1 i j -ρ t k i j i j + t k ji ji 2 j ∈ Φ k i i k i j ≥ 1 (12a) (p i , t i ) * = arg min (p i ,t i ) f i (p i ) + . . . ( 12b
)
j∈ω i           γ t i j 2 + ρ 2          t k i j i j -t k ji ji 2 -t i j + λ k i j i j ρ          2           s.t. p i = j∈ω i t i j p i ≤ p i ≤ p i t k i j +1 i j = t * i j j ∈ Φ k i i (12c)
and the asynchronous version of the algorithm is given in Algorithm 2.

Algorithm 2 Asynchronous Algorithm : Agent i local process procedure AsynchrounousAgentProcess(t 0 i , λ 0 i )

t i ← t 0 i Initialization λ i ← λ 0 i k i j ← 0 for j ∈ ω i k i ← 0 send t 0 i j to j ∈ ω i repeat Proceed until convergence receive t k ji ji from j ∈ Φ k i i such as k ji = k i j update λ i j with (12a) for j ∈ Φ k i i if k i j ≥ 1 update t i with (12b-12c) send updated t k i j +1 i j to j ∈ Φ k i i k i j ← k i j + 1 for j ∈ Φ k i i k i ← k i + 1 until local residual ≤ ε end procedure 4.3. Determination of the set Φ k i i
The order of arrival of the messages sent by agents j ∈ ω i to agent i defines the set Φ k i i . In the synchronous algorithm, Φ k i i = ω i therefore agent i must wait for the messages coming from all of its partners in order to proceed to the next iteration, which results in long idle times waiting only for a few messages, thus delaying the entire market.

In the asynchronous version, we have to determine the set Φ k i i for each of agent i iteration k i . In related works, the set is either determined by:

• the arrival of messages within a given delay between each local iteration k i [START_REF] Zhang | ADMM Optimization Strategies for Wide-Area Oscillation Monitoring in Power Systems under Asynchronous Communication Delays[END_REF][START_REF] Xu | ADMM-based Distributed OPF Problem Meets Stochastic Communication Delay[END_REF],

• the arrival of a given number of messages since the previous iteration [START_REF] Guo | Impact of communication delay on asynchronous distributed optimal power flow using ADMM[END_REF],

• the first condition to be fulfilled between both of the above [START_REF] Zhang | Asynchronous decentralized consensus ADMM for distributed machine learning[END_REF][START_REF] Chang | Asynchronous Distributed ADMM for Large-Scale Optimization -Part I: Algorithm and Convergence Analysis[END_REF],

• a probability that the message arrive to the agent [START_REF] Bastianello | Asynchronous distributed optimization over lossy networks via relaxed admm: Stability and linear convergence[END_REF][START_REF] Zhang | Asynchronous distributed ADMM for consensus optimization[END_REF].

The first three points aforementioned necessitates a communication delay model while the last one is more simple to implement.

Let j ∈ ω i and let us note X k i ji the random boolean variable describing if j ∈ Φ k i i , i.e. if the message t ji sent by j arrived to agent i to be processed during its iteration k i . Thus:

Φ k i i = j ∈ ω i | X k i ji = 1 ( 13
)
The proof of convergence of the asynchronous algorithm in [START_REF] Zhang | Asynchronous distributed ADMM for consensus optimization[END_REF], where there is a central master agent M that collects the workers variables, requires all the random variables X k M jM to be independent and identically distributed. Which means that at each of the master iteration k M , all the workers updates have the same chance to be processed by the master.

This condition might be correct in the case of parallel computing where the communication takes place on a local network (as with MPI communication), but it is limited when it comes to communication between agents that are located far away (for example if they are not part of the same local network). In fact, the order of arrival of the various messages and their delays depends on the communication network, which cannot be properly modeled by a random variable such as X k i ji . If two agents are really close to one another compared to the rest of their trading partners, then they will have a lot more updates on their common trade.

In [START_REF] Zhu | Asynchronous and Distributed ADMM Algorithm for General Form Consensus Optimization[END_REF] however, the convergence is proved with the assumption of bounded delays for each link. We will introduce a communication delay model that respects this assumption.

The iteration trigger chosen in this study is the number of messages arrived since last iteration. The messages that arrive after the trigger (i.e. during the computation) are kept in a local buffer and considered as received messages for the next iteration.

We can note that this choice of trigger makes the random variable X k i ji dependent from the other variables X k i j i with j ∈ ω i \{ j} because the chance that a message sent from agent j to i arrives in time to participate in iteration k i depends on the number of messages that agent i already received since its last iteration. It also needs a communication delay model in order to compute the order of arrival of the messages.

Let us note N trig,i the number of messages received by agent i that triggers the calculations of the iteration. Given that agent i has |ω i | trading partners which it communicates with, and that it only counts messages that have k ji = k i j , there can only be one message per partner, thus N trig,i ≤ |ω i | messages.

The case where N trig,i = |ω i | for all i ∈ Ω refers to the synchronous algorithm.

Considering one market Ω, it would be inconceivable to study all possibilities of N trig,i for each i ∈ Ω for combinatorial considerations. We therefore set a ratio δ ∈ [ 0, 1] such that:

N trig,i = δ • |ω i | i ∈ Ω (14)
with • being the ceiling function. The ceiling function has been preferred over the floor function so that N trig,i is at least equal to 1. For example, if agent i has a total of 100 partners, δ = 0.1 would set N trig,i to 10 messages. The case δ = 1 corresponds to the synchronous resolution as

N trig,i = |ω i | = |ω i |.
We will refer to δ as the asynchronism parameter.

Simulation framework

Simulation environment

The simulation of the optimization problem resolution given all the exchanged messages was implemented in the Julia language. The package SimJulia was used as a discrete-event simulation environment, whereas the sub-problems given by (12b) were solved by the package OSQP, which stands for operator splitting quadratic program. This package solves convex quadratic problems [START_REF] Stellato | OSQP: An Operator Splitting Solver for Quadratic Programs[END_REF].

The use of Julia, which is a just-in-time compiled programming language, made the final code efficient and fast enough that it allowed the computation of many market resolutions in a short amount of time, as is necessary when realizing a Monte-Carlo simulation. The calculations were performed with a Intel Core i7-8850H CPU@2.60GHz and each simulation took 5 seconds on average to compute with the 110 agents testcase presented in 5.4, and the gaussian communication model presented in 5.2.

The values of the variables during the resolution are saved at a given sampling frequency. This allows post-processing calculations.

Communication delay models

Among all the communication hazards, we only take into account communication delays in this paper. Indeed, we can assume that the communication protocol that is used handles retransmission and error-detection, as with the TCP/IP protocol. Thus, communication hazards such as packet loss or corruption results in the application layer as an added delay.

We introduce two stochastic communication delay models: a gaussian based model and a more advanced model which presents a distribution that fits real Internet communication delays. Our models are very simple and only depend on three parameters, which allows us to have a better interpretation of the results based on these parameters.

Let d i j be the distance between agents i and j. This distance is not directly associated with physical distance, but more with distance in terms of the communication network (e.g. number of routers that the message go through). The first communication delay model consists of a random gaussian variable, presented in [START_REF] Zhu | Asynchronous and Distributed ADMM Algorithm for General Form Consensus Optimization[END_REF], which represents the communication delay between agents i and j.

∆T * i j ∼ N α D i j + β, σ i j (15)
The gaussian model was chosen for its simplicity and sampling speed.

• The mean of the communication delay E[ ∆T *

i j ] = α D i j + β takes into account the distance D i j but also a constant minimum delay β. If α = 0, then all communication delays have the same mean value.

• The standard deviation is proportional to the mean communication delay. Let us set the parameter σ ∈ [ 0, 1] such that when σ = 1, then 3

σ i j = E[ ∆T * i j ] . Thus : σ i j = σ 3 E[ ∆T * i j ] .
Because the presented gaussian variable can be negative, the real random variable considered for communication delay is ∆T i j = max(∆T * i j , 0).

The proposed communication delay model takes into account the global communication network state:

• network congestion is associated to the linear delay parameter α;

• whereas the minimum communication delay is associated to the constant delay parameter β;

• finally, added communication delays due to packet retransmission can be seen as the stochastic delay parameter σ, but it appears that the gaussian model is quite limited in that regard.

In section 6.4, we chose to compare the gaussian delay model with a more advanced model ∆T i j , inspired by [START_REF] Zhang | ADMM Optimization Strategies for Wide-Area Oscillation Monitoring in Power Systems under Asynchronous Communication Delays[END_REF][START_REF] Xu | ADMM-based Distributed OPF Problem Meets Stochastic Communication Delay[END_REF], which has a long tail distribution that showcases longer delays at a higher probability. This model features four parameters which take into account the Internet traffic delays as well as the routers processing delays. The probability density function (PDF) φ(t) of the end-to-end communication delay is given as follows:

φ(t) = p φ 2 (t) + (1 -p ) φ 1 (t) * φ 2 (t), t ≥ 0 ( 16
)
where φ 1 (t) is the PDF of the Internet traffic delay, φ 2 (t) is the PDF of the router processing delay and

φ 1 (t) * φ 2 (t) = t 0 φ 2 (u)φ 1 (t -u)du.
Here, p is the probability of open period of the path with no Internet traffic, it is set to p = 0.58 for all communication links in the market, following the numerical value of [START_REF] Zhang | ADMM Optimization Strategies for Wide-Area Oscillation Monitoring in Power Systems under Asynchronous Communication Delays[END_REF]. The Internet traffic delay is approximated by a gaussian PDF with expected value µ and variance σ 2 . The router processing delay is modeled by an alternating renewal process with exponential closure period when the Internet traffic is on, with the PDF φ 2 (t) = λ e -λ t where λ -1 represents the mean length of the closure period. For comparison purposes, the parameters (λ , µ , σ ) are tuned to fit the mean value and variance of the gaussian communication delay model for each communication link:

(λ i j , µ i j , σ i j ) = arg min (λ , µ , σ ) αD i j + β -E ∆T i j (λ , µ , σ ) 2 + σ 2 i j -V ∆T i j (λ , µ , σ ) 2 (17)
Finally, the delays are sampled with an inverse transform sampling method, using the cumulative distribution function given in [START_REF] Zhang | ADMM Optimization Strategies for Wide-Area Oscillation Monitoring in Power Systems under Asynchronous Communication Delays[END_REF]. It takes on average 130 ns to sample a delay with the gaussian model, whereas it takes on average 30 µs to sample a delay with the advanced model, which makes the simulation about 200 times slower. We will investigate in what extent the gaussian model can be a simpler yet representative alternative to the advanced model regarding the convergence time of the algorithm.

Computation delays

We consider in this article that the computation delays are negligible compared to the communication delays. Indeed, after a short survey of ping requests to various servers, we can approximate the order of magnitude of the end-to-end Internet communication delay from 10 ms to 100 ms. However, the measured computation delays at each iteration for the testcase presented in section 5.4 are at most equal to a few milliseconds for the agents with the most trading partners, and equal to 0.2 ms for the other agents. For simplicity sake, we decided to neglect the computation delays, but it would be interesting to study their influence on the convergence time when the computation delays and the communication delays share the same order of magnitude.

Testcase presentation

The testcase used in this article is composed of 110 agents including 30 producers and 80 consumers. Their parameters were randomly generated and are given in the appendix. In this testcase, the set of trading partners ω i of each consumer i is equal to the set of all producers. Therefore, every producer's set of trading partners is equal to the set of all consumers. Each agent is given a randomly generated 2D location. The distance d i j between agents i and j is then computed as the euclidean distance between both agents' locations. The ADMM penalty factor is set to ρ = 10.

Convergence requirement

We consider that the algorithm has reached convergence when the primal residual invalidates the relation given by ( 9), with ε 2 rel = 10 -9 . The values of the problem's variables at convergence are noted p * i and t * i j .

Simulation results

Influence of the arbitrage penalty factor γ

We will illustrate the role of the arbitrage penalty term in (4a). Let us first set the arbitrage penalty factor γ to zero. As explained in 3.2, when γ = 0, the problem ( 4) is not strictly convex with respect to the trade variables t i j , whereas it is strictly convex with respect to the power variables p i . This results in solutions that are distinct from one another when the problem is solved synchronously or asynchronously. Yet, we need all solutions to be equal in order to compare the performances of the algorithm.

At convergence, the power variables are all very close to the synchronous solution (δ = 1) for any value of the asynchronism parameter δ. However, the trade variables are different, as illustrated in Table 2. This table shows the power variable value of agent 32 and its first four trade variables for two values of δ. As we can see, the power variable is equal for all values of δ, whereas the trade variables are different from one another. The initial problem ( 1) is effectively solved by the peer-topeer algorithm, be it synchronous or asynchronous. However, we want the trade solutions to be equal for any value of δ. Let's set the synchronous solution as reference for comparison : p * i,δ=1 and t * i j,δ=1 for i ∈ Ω and j ∈ ω i . Two quantities are plotted in Figure 2 as a function of the arbitrage penalty factor γ:

• the global cost value at optimum

C δ = i∈Ω f i (p * i,δ ) (18)
• the normalized tradewise difference between the synchronous solution and other asynchronous solutions

v δ = v T * δ , T * δ=1 = i∈Ω j∈ω i |t * i j,δ -t * i j,δ=1 | i∈Ω j∈ω i |t * i j,δ=1 | (19)
We observe in Figure 2 that the optimal cost value is always equal to the synchronous solution whatever the value of δ, which is expected considering that all power variables p i are equal. The tradewise difference decreases towards zero along with γ increasing, which means the trades solutions t i j tends to be equal. However, the global cost increases with γ which means the optimal solution is different from the case where γ = 0. This figure can help us pick which γ value lets us have the smallest tradewise difference v T * δ , T * δ=1 for all δ, without modifying the optimal cost value too much. For the following results, the γ variable will be set to 1.0. This value allows to have a maximum normalized tradewise difference v 0.2 = 0.4% for a 8% increase in the global cost compared to the case γ = 0, as shown in Table 3.

Influence of the communication network state on the global convergence time

The state of the communication network is modeled by the parameters linear and constant delay parameters α and β in Eq. [START_REF] Zhu | Asynchronous and Distributed ADMM Algorithm for General Form Consensus Optimization[END_REF]. As communication delays increase, the convergence time of the algorithm increases too.

Figure 3 shows the influence of the linear and constant delay parameters α and β on the convergence time for different values of the asynchronism parameter δ, in the deterministic case i.e. σ = 0, and with the arbitrage penalty factor set to γ = 1.0. As we can see in all four figures, the convergence time varies almost linearly with α and β.

Table 4 presents the median values of the gradient of the convergence time (CT) with respect to α and β. We can observe in the fourth column that the ratio between the derivatives is approximately equal to 1 except when the asynchronism parameter δ = 1.0. This shows that both parameters α and β have the same impact on the convergence time of the algorithm for the asynchronous resolutions. However, for the synchronous resolution, there is a greater impact of the parameter α which makes the synchronous algorithm more sensitive to markets where communication delays are varied.

In the next section, we will study the influence of the asynchronism parameter δ on the convergence time.

Influence of the asynchronism parameter δ on the global

convergence time and on the number of exchanged messages From this point forward, we will consider that the parameters of the communication model (α, β) are equal to fixed values (α 0 , β 0 ), and we will study the influence of the asynchronism parameter δ and of the stochastic parameter σ on the algorithm for both the gaussian and the advanced delay model presented in 5.2.

The chosen simulation parameters are (α 0 , β 0 ) = ( 5.0, 1.0) which gives an average communication delay between all agents of α 0 • 1 + β 0 = 6 time units = 60 ms. We set the time unit to 10 ms, which corresponds to the lower order of magnitude of the end-to-end Internet communication delay, as shown in section 5.3. The fact that σ is no longer equal to 0 means that the simulation becomes stochastic with regards to communication delays. Therefore, we need to compute several simulations for a given σ and study the statistics of the results, as we would in a Monte-Carlo simulation. The number of draws for each parameter group value is N draws = 50.

Let us set as reference the convergence time of the synchronous and deterministic resolution of the peer-to-peer market. The normalized convergence time is a stochastic variable defined in Eq. ( 20) and its centered version is defined in Eq. [START_REF] Huang | Asynchronous decentralized method for interconnected electricity markets[END_REF].

ct(δ, σ) = CT(δ, σ) CT(δ = 1, σ = 0) (20) ct (δ, σ) = ct(δ, σ) -E [ct(δ, σ)] (21)
The reference convergence time value is equal to CT(δ = 1, σ = 0) = 440 time units = 4, 4 s. Given that the average communication delay is equal to 60 ms and that the computation delays have been neglected, it takes approximately 73 exchanges between agents before convergence of the algorithm.

We focus at first on the gaussian communication delay model. The average value of ct(δ, σ) is plotted as a function of δ in Figure 4a for several values of σ. The box plot of the centered variable ct (δ, σ) is shown in Figure 4b.

Several remarks can be made from Figure 4:

• E(ct) is strictly increasing with the asynchronism parameter δ, except in the synchronous case δ = 1.

• E(ct) < 1 for δ ≤ 0.8, which means that the asynchronous cases are faster at reaching convergence compared to the synchronous algorithm. However, E(ct) > 1 for δ ≥ 0.9, which means that the synchronous case is faster. This can be explained by the fact that when δ ≥ 0.9, the waiting time of each agent is almost as long as in the synchronous case, but they have to compute more iterations in order to compensate for the lack of information.

• E[ct(δ = 0, σ = 0)] 60% resulting in a 40% speedup against the synchronous reference case is obtained for the smallest possible δ, which corresponds to N trig,i = 1 for all i ∈ Ω. As soon as an agent receives a message, it proceeds to make an update and send back the computed value to the original sender.

• For a given δ, E(ct) increases with the stochastic parameter σ, i.e. the variations of the communication delays.

• The box plot in Figure 4b shows that the normalized convergence time dispersion gets smaller when δ gets smaller. This implies that the convergence time becomes more predictable when the algorithm gets more asynchronous, and that it is less affected by the variations in communication delays.

Comparison of the gaussian and the advanced communication delay models

The communication delay model that has been used in section 6.3 was the gaussian model, which is faster to compute than the more realistic model presented in section 5.2. In this section, we want to compare the convergence time results and discuss the advantages and drawbacks of both the gaussian and the more advanced models.

To do so, the stochastic delay parameter is set to σ = 0.2. As described earlier, the model parameters are chosen so that the expected value and the variance of both models match. The average values of the normalized convergence time are displayed in Table 5 for various values of the asynchronous parameter δ. First we observe that the convergence time is greatly underestimated when using the gaussian model instead of the advanced one for the synchronous version (δ = 1). This can be explained by the fact that the advanced model has a long tail distribution, which means that longer delays have more chance to be sampled than with the gaussian model. This slows down the synchronous resolution since the agents have to wait for every messages to arrive before they can resume their computation. This does not affect as much the asynchronous resolution, hence we do not see a big discrepancy in convergence time when using the gaussian or the advanced model.

Figure 5 represents a boxplot of the centered normalized convergence time ct (δ, σ = 0.2), comparing both communication delay models. The same comments as for Table 5 can be made here: the use of the gaussian model gives similar results as the advanced model for the asynchronous algorithm, however it underestimates the dispersion of the convergence time for the synchronous algorithm.

In conclusion, the gaussian communication delay model is a good alternative to the more advanced model when simulating the asynchronous resolution of the algorithm. However, it underestimates both the average value and the dispersion of the convergence time of the synchronous resolution. For the rest of this article, the gaussian model will be used but we must keep in mind that the more realistic convergence time of the synchronous resolution is going to be larger than approximated by the gaussian model.

Influence of the asynchrony on the number of exchanged messages

We showed in Figure 4 that the more asynchrony the better in terms of convergence time. However, this decrease in convergence time is traded off against an increased number of exchanged messages.

Let us set the reference number of exchanged messages as before:

n(δ, σ) = N mes (δ, σ) N mes (δ = 1, σ = 0) ( 22
)
with N mes being the number of exchanged messages to achieve convergence, and N mes (δ = 1, σ = 0) = 158 400 messages, which corresponds to an average of 66 messages per commercial link. The number of exchanged messages may be smaller considering other stopping criteria as in [START_REF] Goff Latimier | Mitigation of communication costs in peer-to-peer electricity markets[END_REF]. We present in Figure 6 the normalized number of exchanged messages as a function of δ. The gain in convergence time is achieved at the expense of an increase of communication exchanges. There is a balance to find between the number of messages and the convergence time. Moreover, the number of messages increases when the global convergence time decreases, thus resulting in a higher network congestion that might increase the communication delays.

Figure 6 also shows that the stochastic parameter σ, which represents the variations of communication delays, does not affect significantly the number of exchanged messages for a given convergence time.

Influence of distance on the tradewise final convergence

Up to this point we have studied the effect of the communication network state on the global convergence time. We are going to study the local, trade by trade, algorithm progress at the time of convergence.

For every agent i ∈ Ω and every partners j ∈ ω i , the tradewise primal residual (TR) is computed at the time of convergence:

TR(i, j) = t k i,conv i, j + t k j,conv j,i 2 (23)
We can note that it corresponds to a single term in the equation (7a). The various values of TR(i, j) are shown in Figure 7 as a function of the normalized distance d i j between the agents i and j:

d i j = D i j max i , j D i j (24)
with D i j as introduced in Eq. ( 15). In the case δ = 1.0, i.e. the synchronous case, the distance between agents has no impact on the tradewise residuals at convergence because whatever the communication delays, agents take into account everyone of their trading partners at every iteration.

In the case δ = 0.1, we can see that the agents that are located closer to each other could communicate back and forth more frequently, thus reducing their local residuals faster. We can also notice that the dispersion of the tradewise residuals has greatly increased. Because we consider the global convergence as presented in Eq. ( 9), the fact that the closer agents' residuals are small allows for the global algorithm to converge sooner, despite the furthest agents' residuals being higher than in the synchronous case. This shows that a stopping criteria as in [START_REF] Goff Latimier | Mitigation of communication costs in peer-to-peer electricity markets[END_REF] could stop exchanges between closely located agents, thus diminishing the total number of messages.

From a market perspective, the participation of an agent to the market could take into account communication delays criteria.

Conclusion and future work

The asynchronous version of the peer-to-peer market clearing algorithm presented some challenges concerning the variables' updates, and the non-strictly convex formulation, that were discussed in this paper. We showed that a strictly convex formulation was necessary in order to obtain identical results in the asynchronous formulation as in the synchronous one. A simple gaussian communication delay model has been proposed and used to compare the performance of the asynchronous algorithm to its synchronous version. This model follows the assumption of bounded delays for each communication link. A more realistic communication model has also been used to assess the limits of the gaussian model. The gaussian model provides good estimation of the convergence time for the asynchronous version of the algorithm, however it is slightly more optimistic regarding the convergence time of the synchronous algorithm. The asynchronous algorithm converges towards the optimal solution, and it does so faster than the synchronous algorithm. It has been shown that the gain in convergence time was due to the frequent communications between agents that are close in regards to the communication network. This gain in time is made at the expense of the number of messages exchanged.

A few points of the proposed algorithm deserve further inspections. This algorithm may be implemented on hardware with actual communication between agents. This will add real computation and processing delays, which can be used to justify, or not, the negligible computation delays assumption made in this paper. Thanks to the asynchronous algorithm, the computation can continue even if one agent is disconnected from the communication network. It can be interesting to demonstrate how to handle such a disconnection in a safe way using the hardware implementation. Also, the arbitrage penalty term may be replaced as in [START_REF] Baroche | Exogenous Cost Allocation in Peer-to-Peer Electricity Markets[END_REF] with different tariffs for each trades in order to give preference to some exchanges over other ones. As explained in the introduction, the aim of our proposed asynchronous algorithm is to reduce convergence time in order to get closer to real-time market resolution. The natural continuation of this work would then be to implement a time varying optimization with a warm-starting strategy. Another continuation of this work would be to find the conditions relative to the communication network to allow or not allow a new agent to enter the peer-to-peer market, i.e. to prevent a slow down of the market resolution.

Figure 1 :

 1 Figure 1: Message exchanges diagram in a three agents market : i, j and m,where ω i = { j, m} and ω j = ω m = {i}, in the synchronous and the asynchronous cases. The diagonal arrows represent the message exchanges over time and the colored rectangles represent the processing time of a local iteration. The asynchronous case here consists of agent i only waiting for one message instead of two before performing its calculations.

Figure 2 :

 2 Figure 2: Global cost value at convergence and tradewise distance v δ from the synchronous solution as a function of the arbitrage penalty factor γ (log scale).

Figure 3 :

 3 Figure 3: Convergence time (in time units) as a function of the communication network parameters α and β for several values of the asynchronism parameter δ. Fixed parameters : γ = 1.0 and σ = 0.

  Normalized average convergence time E(ct(δ, σ)) as a function of δ (b) Boxplot of the centered normalized convergence time ct (δ, σ)

Figure 4 :

 4 Figure 4: Values of the convergence time as a function of the asynchronism parameter δ for several values of σ, using the gaussian communication delay model. Figure (a) represents the average value of ct(δ, σ) while figure (b) represents the quartiles of ct (δ, σ).

Figure 6 :

 6 Figure 6: Normalized number of messages to complete the optimization n(δ, σ), as a function of the normalized convergence time ct(δ, σ), and for several values of the stochastic parameter σ.

Figure 7 :

 7 Figure7: Values of the tradewise primal residuals TR(i, j) for i ∈ Ω and j ∈ ω i at the time of convergence as a function of the normalized distance between agents d i j . The blue lines represent the 25%, 50% and 75% quantiles.

  52 cons 0.0416 50.0 -1021 0 1,9288 1,2116 107 cons 0.0351 76.0 -1487 0 1,8821 1,7931 53 cons 0.0424 70.0 -99 0 1,2611 1,5065 108 cons 0.0381 61.0 -476 0 1,6693 0,7555 54 cons 0.0402 80.0 -960 0 1,7170 1,3035 109 cons 0.0398 60.0 -1091 0 1,6574 1,8177 55 cons 0.0334 67.0 -117 0 0,1476 0,7530 110 cons 0.0308 76.0 -1035 0 1,4468 0,1260

Table 1 :

 1 Asynchronous algorithm configurations under partial communication

		Partial trades update Total trades update
	Partial prices update	Convergence : yes Optimality : yes	Convergence : yes Optimality : no
	Total prices update	Convergence : no Optimality : no	Convergence : yes Optimality : no

Table 2 :

 2 Values of the optimization variables at convergence for various values of δ, γ = 0 and ε rel = 10 -12

	Optimization variable	Value for δ = 1	δ = 0.7	δ = 0.2
	p 32	-44.03	-44.03	-44.03
	t 32,1	-1.58	-1.69	-1.73
	t 32,2	-1.73	-1.94	-1.72
	t 32,3	-1.44	-1.31	-1.31
	t 32,4	-0.52	-0.10	-0.00

Table 3 :

 3 Global cost increase compared to the case γ = 0 and the associated normalized tradewise difference

	γ	Global cost increase	Tradewise difference
	0	0	21%
	1.0	+8%	0.4%
	9.0	+48%	0.03%

Table 4 :

 4 Gradient of the convergence time with respect to the parameters α and β

	Asynchronism parameter δ	∂ CT ∂α	( * )	∂ CT ∂β	( * )	∂CT ∂α	/	∂ CT ∂β
	1.0	80.0		33.3		2.40
	0.8	60.0		53.3		1.13
	0.6	53.3		46.7		1.14
	0.4	46.7		40.0		1.17
	0.2	40.0		40.0		1.00
	( * ) Median value over all points.

Table 5 :

 5 Average normalized convergence time comparison between both communication delay models, at a fixed stochastic delay parameter σ = 0.2. Boxplot of the centered normalized convergence time ct (δ, σ = 0.2) comparing the gaussian and the advanced delay models.

	δ	Gaussian model	Advanced model
		E [ct]	E [ct]
	0.2	0.588	0.593
	0.6	0.714	0.722
	1.0	1.348	1.015
	Figure 5:

https://enerchain.ponton.de/

http://the-energy-collective-project.com/

Appendix A. Coefficients of the market agents

The following table contains numerical data of the market agents, including the cost function coefficients as in (A.1) and the agent location used in (A.2).

D i j = (loc x,iloc x, j ) 2 + (loc y,iloc y, j ) 2 (A.2)


Alyssia Dong

Thomas Baroche

Roman Le Goff Latimier

Hamid Ben

Asynchronous algorithm of an endogenous peer-to-peer electricity market

Asynchronous algorithm of an endogenous peer-to-peer electricity market Dong Alyssia, Baroche Thomas, Le Goff Latimier Roman, Ben Ahmed Hamid

SATIE Laboratory Ecole Normale Superieure of Rennes

Rennes, France {alyssia.dong, tbaroche, roman.legoff-latimier, benahmed}@ens-rennes.fr chronous versions of an optimal power flow (OPF) were studied. In [START_REF] Guo | Impact of communication delay on asynchronous distributed optimal power flow using admm[END_REF], the asynchronous, ADMM based, distributed OPF reduced significantly the convergence time while also increasing the gap of the objective function. In [START_REF] Xu | Admm-based distributed opf problem meets stochastic communication delay[END_REF], an ADMM based distributed OPF was also studied, but this time on a lateral branching network. Different strategies were investigated to replace the loss of information due to the asynchrony, which lead to fluctuations in the solutions. A Lagrangian relaxation based decentralized OPF was studied in [START_REF] Huang | Asynchronous decentralized method for interconnected electricity markets[END_REF], in which individual markets communicate with each other asynchronously. The asynchronous updates lead to the optimal solution with up to 50% time reduction. The convergence of the asynchronous resolution of a multi-time step energy optimization problem in a microgrid, using ADMM is discussed in [START_REF] Ullah | Distributed energy optimization in masbased microgrids using asynchronous admm[END_REF]. The results may deviate from the optimal solution if the communication delays are too high. In all of these decentralized schemes, there is a communication link between agents that are physically connected by a power line, as opposed to our algorithm in which the communication links are independent of the power network topology.

After formulating the endogenous peer-to-peer market in II, we propose in III an asynchronous algorithm to avoid communication or computation latencies. The simulation platform presented in IV is based on a 31 agents testcase. The simulation results discussed in V confirm that the asynchronous algorithm converges towards the same solution as the synchronous one regarding the power dispatch. The impact of various delays and asynchronism parameters are further investigated.

II. ENDOGENOUS PEER-TO-PEER MARKET A. AC regularized peer-to-peer electricity market

The problem addressed in this paper is an optimal power flow based on a peer-to-peer market clearing algorithm described in [START_REF] Baroche | Peer-to-peer electricity markets in power systems[END_REF], consisting of N agents part of a community Ω, performing multi-bilateral trades with each other. A system operator (SO) is added here to verify that the AC networks constraints are respected and to induce the market peers to change the solution otherwise. In order to account for the network losses, a new agent is added to the peer-to-peer market, called the loss provider. This agent is buying the losses to the producers of the market. We note the extended set of peer-to-peer market agents Ω * = Ω ∪ {Loss} with Abstract-As the number of actors in the electricity market increases, peer to peer decentralized markets gain interest despite facing two challenges. First, the amount of exchanged messages increase significantly, w hich m akes t he r esolution d ependent on communication delays, as well as computation delays. Second, the physical limitations of the power network are not taken into account. An asynchronous implementation of an endogenous peerto-peer market is here introduced to address these difficulties. The proposed algorithm is tested on a 31 agents testcase and a study of the influence o f t he v arious a lgorithm p arameters on the convergence time is performed.

Index Terms-peer-to-peer, market, endogenous, optimal power flow, a synchronous, delays

I. INTRODUCTION

The economic dispatch problem allows the producers and consumers of an electrical network to schedule in advance the production and consumption plan. As the number of distributed energy resources (DERs) grow, it can be argued that a decentralized clearing mechanism is more suited to the problem than a centralized one. Indeed, decentralization allows scalability and data privacy, in exchange of communication between agents. The ADMM based peer-to-peer market clearing algorithm proposed in [START_REF] Baroche | Peer-to-peer electricity markets in power systems[END_REF], from which we base our study, also enables agents to express heterogeneous preferences.

Yet, the market clearing alone is not sufficient as it does not take into account the physical limitations of the network. A system operator (SO) needs to verify the physical feasibility of the solution in terms of line congestions and voltage limitations. Involving the SO into the resolution to ensure feasibility is thus mandatory. However, the resolution of the problem still needs to be decentralized. This induces a significant increase of exchanged messages both between peers and with the SO. Therefore, the convergence rate of the peer-to-peer algorithm heavily depends on the state of the communication network and the computation time of the various agents.

The convergence of asynchronous ADMM based consensus algorithms have been studied in [START_REF] Zhang | Asynchronous distributed admm for consensus optimization[END_REF]- [START_REF] Bastianello | Asynchronous distributed optimization over lossy networks via relaxed admm: Stability and linear convergence[END_REF], whether it be distributed or fully decentralized. In both cases, convergence of the algorithm was proven under the assumption of either bounded delays, or that the probability of each message to arrive was non null. Moreover, in several papers the asyn-Loss representing the loss provider agent. The AC regularized peer-to-peer electricity market problem is written in [START_REF] Baroche | Peer-to-peer electricity markets in power systems[END_REF]. The variables p n (resp. q n ) represents the active (resp. reactive) power injected or consumed by agent n ∈ Ω * in the network. It is positive if the power is actually produced, negative if consumed. The variable p nm represents the active power traded from agent n to agent m. We note ω n the set of all market partners of agent n. min (pn) n∈Ω * ,(qn) n∈Ω * ,P n∈Ω * c n (p n , q n ) + ζAC (P, Q) (1a)

s.t. P = P T (1b) p n = m∈ωn p nm n ∈ Ω * (1c) p min n ≤ p n ≤ p max n n ∈ Ω * (1d) q min n ≤ q n ≤ q max n n ∈ Ω * (1e) p Loss = - n∈Ω p n (1f)
Equation (1a) consists of minimizing the cost function of all the agents in the community, while remaining within the physical constraints. The regularization function ζAC is equal to zero if the AC network constraints are respected, and +∞ if they are violated. The bilateral trades constraint (1b) ensures that the trades are symmetrical: p nm = -p mn . The total power produced or consumed by agent n is equal to the sum of all its trades, as stated in (1c). Equations (1d)-(1e) account for the physical limitations of the producers and consumers, whilst the network losses are estimated in (1f).

B. ADMM problem resolution

The problem described in (1) is decomposed into smaller problems using the ADMM method, which leads to [START_REF] Zhang | Asynchronous distributed admm for consensus optimization[END_REF]. The mathematical steps leading to these equations are detailed in [START_REF] Baroche | Peer-to-peer electricity markets in power systems[END_REF]. Each smaller problem is local to an agent n ∈ Ω * . Iteratively, each agent n ∈ Ω * solves its own problem, described in (2a)-(2d), and communicates the latest results with its trading partners m ∈ ω n and the SO. At the same time, the SO performs its own computations described in (2e)-(2g), and in turn communicates the latest results with the market peers in Ω * . Equations (2h)-(2j) refer to the ADMM dual variables updates performed by market peers and the SO. The superscript k represents the global iteration counter. For readability reasons, the function σ ρ is introduced in (3). It represents the augmented lagrangian part of the new objective functions, with ρ being the ADMM penalty factor.

(p n , q n , P n ) k+1 = argmin pn,qn,Pn=(pnm)m∈ω n c n (p n , q n ) (2a) + m∈ωn σ ρ pnm, p k nm -p k mn 2 ,λ k nm + σ ρ pn, p SO,k n +p k n 2 ,η p,k n + σ ρ qn, q SO,k n +q k n 2 ,η q,k n s.t. p n = m∈ωn p nm (2b) p min n ≤ p n ≤ p max n (2c) q min n ≤ q n ≤ q max n (2d) (P SO , Q SO ) k+1 = argmin P SO =(p SO n )n∈Ω, Q SO =(q SO n )n∈Ω ζAC (P SO , Q SO ) (2e) + n∈Ω σ ρ p SO,k n +p k n 2 ,p SO n ,η p,k n + σ ρ q SO,k n +q k n 2 ,q SO n ,η q,k n + σ ρ p SO,k n -1 |Ω| p SO,k Loss +p k Loss 2 ,p SO n -1 |Ω| p SO,k Loss , 1 |Ω| η p,k Loss p SO,k+1 Loss =- n∈Ω p SO,k+1 n (2f) q SO,k+1 Loss = q k Loss (2g) λ k+1 nm = λ k nm -ρ p k+1 nm + p k+1 mn /2 (2h) η p,k+1 n = η p,k n + ρ p SO,k+1 n -p k+1 n /2 (2i) η q,k+1 n = η q,k n + ρ q SO,k+1 n -q k+1 n /2 (2j) σ ρ (x, y, z) = z(y -x) + ρ/2 (y -x) 2 (3)
It should be noted that (2e) is equivalent to performing a classical optimal power flow computation in which the objective function of each agent n ∈ Ω is as follows in (4):

p SO n , q SO n →σ ρ p SO,k n +p k n 2 ,p SO n ,η p,k n + σ ρ q SO,k n +q k n 2 ,q SO n ,η q,k n + σ ρ p SO,k n -1 |Ω| p SO,k Loss +p k Loss 2 ,p SO n -1 |Ω| p SO,k Loss , 1 |Ω| η p,k Loss (4)
The SO performs the OPF near the latest solution of the trading peers (p k n ) n∈Ω , (q k n ) n∈Ω which allows each agent n ∈ Ω to keep their cost function private. The losses are then estimated by the SO using (2f).

The algorithm stops once the global primal and dual residuals reach a given value, as stated in [START_REF] Guo | Impact of communication delay on asynchronous distributed optimal power flow using admm[END_REF].

n∈Ω * p,k+1 n ≤ p,tol 2 and n∈Ω * d,k+1 n ≤ d,tol 2 (5)
The global residual is made up of the sum of the local residuals, which are described in ( 6) and [START_REF] Huang | Asynchronous decentralized method for interconnected electricity markets[END_REF] for the primal and dual local residuals respectively.

+ 1 4 p SO,k+1 n -p k+1 n 2 + 1 4 q SO,k+1 n -q k+1 n 2 d,k+1 n = m∈ωn p k+1 nm -p k nm 2 (6)
+ p SO,k+1 n -p SO,k n 2 + q SO,k+1 n -q SO,k n 2 (7)

C. Communication considerations

The variables p n , q n , (p nm ) m∈ωn , (λ nm ) m∈ωn , η p n and η q n are local to the peer agent n ∈ Ω * . In order to perform its calculations in (2a)-(2d) and (2h)-(2j), agent n also needs to know the latest values of the variables (p mn ) m∈ωn , (q mn ) m∈ωn which are communicated by all its trading partners m ∈ ω n and also p SO n , q SO n which are communicated by the SO. Moreover, the variables (p SO n ) n∈Ω * , (q SO n ) n∈Ω * , (η p n ) n∈Ω * and (η q n ) n∈Ω * are local to the SO. In order to perform its calculations described in (2e)-( 2g) and (2i)-(2j), the SO also needs to receive messages from the market peers that contain the latest values of the variables (p n ) n∈Ω * , (q n ) n∈Ω * . The various data exchanges are represented in Fig. 1 using an example market constituted of two peer agents and the SO.

At the beginning of every iteration, each agent has to wait for the arrival of l + 1 messages: l = |ω n | messages from the other peers and one from the SO. The waiting period depends solely on the last message to arrive, which can be troublesome if one of the agents takes longer to perform its computation or if part of the communication network is experiencing a slowdown due to congestion. As the market size increases, so does |ω n |, thus these issues might considerably slow down the global convergence time of the algorithm.

III. ASYNCHRONOUS IMPLEMENTATION

As discussed in II-C, the synchronous version of the endogenous peer-to-peer algorithm presented in the previous section is very sensitive to communication and computation delays. To overcome this issue and make the algorithm more resilient to delay variations, an asynchronous implementation of the algorithm is introduced in this section. The asynchronous version is based on waiting for only part of the messages to arrive before continuing to perform the calculations described in [START_REF] Zhang | Asynchronous distributed admm for consensus optimization[END_REF]. Not waiting for the last messages to arrive is going to significatively reduce the waiting period at every iteration. In addition, the asynchronous version allows the SO to perform fewer costly calculations.

In order for the asynchronous implementation to successfully converge, a few modifications need to be done in comparison to the synchronous version.

Firstly, the fact that not all messages are taken into account within the same iteration makes the superscript k, which was the global iteration counter, obsolete. To replace it, we introduce the local iteration counters (k n ) n∈Ω * for each of the market peers and k SO for the SO. This counter represents the number of computations performed so far respectively by each agent n or by the SO.

Secondly, as discussed in section II-C, the values p SO n , q SO n , (p mn ) m∈ωn received by a peer agent n ∈ Ω * are stored in local copies. These local copies are obviously only updated if a message from either the SO or agent m ∈ ω n arrives to agent n. The same goes for the SO local copies of (p n , q n ) n∈Ω * . send p n , q n to the SO for n ∈ Φ k SO SO do 10:

update p n , q n from message 11:

η p n ← (2i), η q n ← (2j)
12:

(P SO,temp , Q SO,temp ) ← (2e)

13:

for n ∈ Φ k SO SO \ {lossProvider} do 14:

p SO n ← p SO,temp n , q SO n ← q SO,
k SO ← k SO + 1 22:
until global convergence Thirdly, the local variables don't need to be updated at every local iteration. Let n ∈ Ω * be a market peer. Its local variables p nm and λ nm are updated only if a message from agent m has been received since the last local iteration. In the same way, its local variables p n , q n , η p n and η q n are updated only if a message from the SO has been received since the last local iteration. The same update condition is applied for the SO to the variables p SO n , q SO n , η p n and η q n for any n ∈ Ω * . Lastly, let us define a linkwise iteration counter k nm which represents the number of updates of the variable p nm if m ∈ Ω * , and of the variable p n if m = SO. When agent n receives a message from agent m ∈ ω n , the local copy p mn only gets updated if k nm = k mn . The same applies to the local copies p SO n and q SO n . We define Φ kn n as followed in (8):

Φ kn n =    message received from m m ∈ ω n ∪ {SO} during iteration kn and knm= kmn    (8)
The local computation of agent n is triggered as soon as enough messages have been received in compliance with the k nm = k mn constraint. The local iteration k n can be incremented once |Φ kn n | hits a threshold whose influence will be discussed in V.

The asynchronous version of the decentralized endogenous negotiation mechanism are summarized in Algorithm 1 and Algorithm 2 for the market peer process and the system operator process respectively. We can use the equations as written in (2) so long as any variable with the superscript k is replaced by the latest updated version of the variable.

IV. SIMULATION PLATFORM

The asynchronous implementation of the endogenous peerto-peer market algorithm has been written in Julia. The opensource code can be found on Gitlab 1 . The various message exchanges have been simulated using a discrete event simulator: SimJulia. This simulation framework allows to add communication and computation delays between each iteration of every agent. The local peer problem written in (2a) being a convex quadratic problem, it is solved using OSQP [START_REF] Stellato | Osqp: An operator splitting solver for quadratic programs[END_REF]. As for the SO problem in (2e), it is solved using the PowerModels [START_REF] Coffrin | Powermodels. jl: An open-source framework for exploring power flow formulations[END_REF] package in Julia as an AC optimal power flow model with polar bus voltage variables. All simulations were run on a Ryzen 9 3950X 16 core 3.5GHz/4.7GHz processor.

The algorithm is applied on a testcase inspired by the IEEE 39-bus test system, which was adapted in order to make the consumers flexible, as in [START_REF] Baroche | Peer-to-peer electricity markets in power systems[END_REF], [START_REF] Baroche | Exogenous cost allocation in peer-to-peer electricity markets[END_REF]. This testcase is composed of 21 consumers and 10 producers, which each have a quadratic cost function written as follows:

c n (p n ) = 1 2 a n p 2 n + b n p n ( 9
)
Every consumer is a trading partner to every producer, and vice versa. This hypothesis allows the final results to be equivalent to that of a traditional optimal power flow. To model the communication delays between two agents, every agent gets randomly assigned a 2-dimensional coordinate. The farther two agents are from each other, the slower the communication delay. The distance between any two agents is defined as the euclidean distance of their coordinates. Within this illustrative testcase, the distance d nm should not only be seen as a representation of the geographical distance. It can also be interpreted as proportional to the number of communication nodes that add latency -e.g. routers.

The communication delay model is posed as a simple deterministic parametric model such that:

∆T nm = α d nm + β (10)
where ∆T nm represents the communication delay of a message sent by agent n to agent m. The parameters (α, β) represent the state of the communication network. The communication parameter β is the minimal delay of all communications, whereas α accounts for the variations of delays between every communication link. These parameters are set to have delays ranging from 10 ms to 100 ms, which is roughly the delays experienced for an internet connection.

As for the computation delays, the market peer local problem resolution is 1000 times faster than the AC OPF performed by the SO, according to Table I. Only the SO computation delays will therefore be taken into account thereafter. The following results hold as long as the computation delays of every market peer is negligible compared to that of the SO. This hypothesis should be readily validated even if peers have modest computing capabilities, considering the difference in complexity between the two problems.

V. SIMULATION RESULTS

A. Results with communication delays

First of all, let us compare the solutions of the endogenous problem with the reference solution given by Matpower AC OPF in Fig. 2. We can observe that the endogenous solutions, whether synchronous or asynchronous, are similar with respect to the active power injections. The same remark can be made for the reactive power injections and for any value of δ peers and δ SO . The substantially small, but observable difference between solutions are due to the various precision errors that are carried over the few hundreds iterations for each local agents.

The main focus of our study is the variations of the convergence time of the algorithm and the number of computations regarding to the asynchronous implementation. A single value p,tol 2 = 10 -3 is thus chosen for the stopping criterion on the primal residual. Similar results can be performed with different values or a dual residual criterion.

The peer asynchronous parameter δ peer is defined as the minimum proportion of messages that any peer must receive before beginning the local iteration calculations: For the sake of interpretability of the results, all peers are set to the same δ peer value although they might differ in a real implementation. Likewise, the SO asynchronous parameter δ SO is defined as the minimum proportion of messages that the SO must receive before performing the local iteration calculations:

δ peer = |Φ kn n | |ω n | + 1 n ∈ Ω * (11
δ SO = |Φ k SO SO |/|Ω * |.
The case δ peer = δ SO = 1 corresponds to the synchronous case because every agent and the SO must wait for the maximum possible number of messages.

Fig. 3 shows the normalized convergence time of the asynchronous algorithm for various values of δ peer and δ SO . Here, we only take into account the communication delays, which means that all computation delays are set to zero. The convergence time has been normalized by the average communication delay, which is equal to 60 ms for this case study. We can observe that the convergence time increases with the peer asynchronism parameter δ peer , except when δ peer = 1. The convergence time also increases with the SO asynchronism parameter δ SO as long as δ peer is not close to 1. However, δ SO has a smaller impact on convergence time than δ peer . The configuration that seems to minimize the convergence time is the one that has the smallest values of δ peer and δ SO . This configuration make the agents perform a computation every time a message is received, which significantly increases the number of local peer computations, and of SO computations, which we will define as k * SO . As we can observe in Table II, the average number of computations k * SO increases as the SO asynchronous parameter δ SO decreases. There is a five times increase in the number of SO computations k * SO for δ SO = 0.2 compared to the synchronous case. This significant increase leads to a large computational workload for SO, which means that its processing time needs to be taken into account throughout the subsequent study.

B. Results with communication and computation delays

In this section, we add various values of computation time for the system operator. On the basis of Table I and II, the SO will not have enough time to compute a full OPF between each received message if his computation time has the same order of magnitude than communication delays. Thus, the real number of SO's computation will probably be smaller the one in Table II. Let us note c SO the computation to communication ratio, which is equal to the SO computation time normalized by the average communication delay. Figure 4 shows heatmaps of normalized convergence time with respect to both asynchronous parameters δ peer and δ SO , and for three values of the c SO ratio. The first heatmap, with c SO = 0, represents the same case study as the previous section where there were no computation time, for comparison. The second and third heatmaps show c SO = 1 and c SO = 3 respectively. We can observe that the convergence time is still the lowest for low values of δ peer and δ SO . The peer asynchronism parameter δ peer has a bigger impact on convergence time than the SO asynchronism parameter δ SO , whatever the value of c SO .

Understandably, as the SO computation time increases, so does the convergence time. However, when the computation time is bigger than the average communication delay (e.g. c SO = 3), both asynchronous parameters do not have much of an impact on the convergence time. This is due to the fact that almost all messages are arriving at the SO during its computation, so the next iteration is equivalent to an almost synchronous update, whatever the value of δ SO .

This phenomenon is also visible in Figure 5, which shows the influence of the computation to communication ratio c SO on the convergence time and the total number of SO iterations k * SO . We can see that when c SO < 1, the SO asynchronism parameter δ SO does have an effect on the convergence time of the algorithm, as a counterpart of a significant increase in the number of SO calculations k * SO . However, as c SO increases, the SO computation time becomes larger and larger, thus limiting the amount of performed computations and the time reduction between δ SO = 0.2 and δ SO = 1.0. The number of SO iteration decreases towards the value at δ SO = 1.0 as the computation time increases.

VI. CONCLUSION

The asynchronous implementation of an endogenous peerto-peer market has been studied on a 31 agents testcase. We verified that the solution of the asynchronous problem was the same as performing an OPF. We showed that the peer asynchronous parameter δ peer had an impact on the convergence time of the algorithm, whereas the SO asynchronous parameter δ SO had an impact on the number of calculations performed by the SO to reach convergence. However, as the computation time of the SO increases, the number of computations that it can perform decreases and all values of δ SO lead to the same performance. The proposed algorithm still calls for further validation, in particular an implementation on an experimental power system. In addition, with the increase of the number of participating agents, the SO computation time is bound to increase too. This makes mandatory to consider decentralizing the SO. Further studies will be done on the asynchronous implementation of this endogenous peer to peer market in the case of a decentralized SO.

Fig. 1 .

 1 Fig. 1. Diagram of the various data exchanges between peers and between the SO and the peers during the k-th iteration. In this example, agents n and m are the only two market peers, and the SO represents the system operator.

Algorithm 1

 1 Market peer n ∈ Ω * asynchronous process Require: ρ, σ ρ , ω n , c n , p min n , p max n p n , q n , (p nm ) m∈ωn local variables 3: initialize (p mn ) m∈ωn , p SO n k n , (k nm ) m∈ωn , k nSO local counters 6:send p nm to m ∈ ω n 7:

Fig. 2 .

 2 Fig. 2. Power injection comparison between Matpower and endogenous negotiation mechanisms. Asynchronous case with δpeers = δ SO = 0.2.

  ) with | • | being the number of elements in the set. If a peer receives as many or more messages as δ peer • (|ω n | + 1) , with • being the ceiling function, it triggers his local update.

Fig. 3 .

 3 Fig. 3. Convergence time normalized by the average communication delay versus the peer asynchronism parameter δpeer and the SO asynchronism δ SO .

Fig. 4 .Fig. 5 .

 45 Fig. 4. Heatmaps of normalized convergence time with respect to asynchronous parameters δpeer and δ SO for three values of the SO computation time c SO .

TABLE I AVERAGE

 I AND STANDARD DEVIATION OF COMPUTATION DELAYS IN JULIA

		PowerModels	OSQP peer
		AC-OPF	producer consumer
	E[computation delay]	75 ms	77 µs	58 µs
	σ(computation delay)	15 ms	22 µs	18 µs

TABLE II AVERAGE

 II AND STANDARD DEVIATION OF THE SO'S NUMBER OF COMPUTATIONS k * SO W.R.T THE SO ASYNCHRONOUS PARAMETER δ SO

	δ SO E[k * SO ] σ[k * SO ]	1.0 325 1.6	0.6 544 14.6	0.2 1603 82.9