Dynamic Operating Envelopes Embedded Peer-to-Peer-to-Grid Energy Trading
Abstract
A novel decentralized peer-to-peer-to-grid (P2P2G) trading mechanism considering distribution network integrity is proposed. In order to direct prosumers’ peer-to-peer (P2P) trading behavior to be grid-friendly, the proposed method incorporates Dynamic Operating Envelopes (DOEs) into the existing P2P2G trading. Moreover, DOEs are determined through negotiations between the distribution system operator (DSO) and prosumers alongside the process of P2P trading, avoiding compromising prosumers’ privacy and network parameters leakage. To reduce communication costs during P2P trading, a variant of the alternating direction method of multipliers (ADMM), i.e., communication-censored ADMM (COCA) is used to solve the P2P2G trading problem. Finally, the DOE price is shown to be comprised of several economically interpretable components. Simulations validate the effectiveness of the proposed mechanism.
Index Terms:
Peer-to-peer-to-grid energy trading, distributed algorithm, DOE, energy pricing.I Introduction
I-A Background and Motivation
IN recent years, the penetration of distributed energy resources (DERs) has grown rapidly, especially for renewable energy sources (RESs). Thus, traditional passive consumers with these active assets are becoming prosumers. Under the most dominant renewable energy compensation scheme based on Feed-in-Tariff (FiT) and Time-of-Use (ToU), these prosumers can make decisions to sell or buy power from the distribution network at given prices, which is called P2G energy trading. As a supplement to the existing P2G scheme, P2P trading emerges, allowing prosumers to transact energy with each other in a platform via bilateral contracts anonymously and autonomously. Typically, prosumers may set P2P prices between FiT and ToU to make P2P trading more beneficial than their transactions with the grid.
I-B Related Works
Different decentralized methods for solving P2P trading problems have been proposed. In these methods, P2P problems are usually modeled as non-cooperative games [1], or formulated as a social welfare maximization problem and solved by distributed algorithms, e.g. consensus-based ADMM [2, 3, 4, 5] or Relaxed Consensus+Innovation [6]. Although above decentralized methods preserve the privacy of prosumers, they cannot consider the network integrity in detail. Network integrity in this paper refers to nodal voltage magnitudes and line powers are within safe ranges in the distribution network. Authors of [7, 8, 9] demonstrate the impact of P2P energy transactions on the distribution network, concluding that P2P trading may cause voltage limit violations at prosumers’ nodes and increase the overall network loss.
To ensure network integrity during P2P trading, centralized approaches have also been proposed. These approaches require the DSO to directly intervene in participants’ trades, including blocking trades and assigning P2P matching to prevent potential network constraint violations. Reference [10] enables the DSO to do network sensitivity analysis after gathering each pair of prosumers’ P2P trading contracts, after which it rejects ones that may jeopardize network integrity. Authors of [11] present an electrical-distance-based P2P matching mechanism, which matches those prosumers located physically close in priority to reduce line power overloading. However, these approaches rely on the DSO to directly manage P2P trades, thus contradicting the requirement for privacy preservation of trade information.
To integrate the strengths of the two previously mentioned techniques, designing integrity-informed decentralized methods for P2P trading decisions is an effective approach. We can apply distributed algorithms to incorporate network constraints into prosumers’ decision models. Reference [12] uses a fast ADMM (F-ADMM) method to add network constraints into prosumers’ trading models. Authors of [13, 14] formulate the P2P trading as a Nash Bargaining model considering network constraints to ensure voltages and currents are within permitted ranges. Then several distributed algorithms are used to solve it. However, these papers simply use the linearized power flow model to characterize the distribution network, neglecting the increased power loss caused by unexpected P2P trades. To improve the accuracy, reference [15] uses sensitivity analysis to evaluate the change of nodal voltage and network power loss arising from P2P trading, followed by a fast dual ascent method to internalize operational constraints into prosumers’ trading decision problems. The drawbacks of these methods are prosumers are actually not willing or capable to consider network constraints during the trading stage, which has nothing to do with their individual surplus. Moreover, it is also impractical for the DSO to share network parameters with prosumers.
Apart from applying distributed algorithms to incorporate network constraints, during the trading process, the DSO can ask prosumers to pay the corresponding grid utilization charge (GUC) for their P2P trades, thus directing trades to be grid-friendly. In [12, 16, 17, 18], an electrical distance-based GUC is presented to charge each pair of prosumers. Reference [19, 20, 21] intend to associate P2P trading interactions with distribution network operations, computing GUC through the difference of distribution locational marginal price (DLMP) between two prosumers’ nodes. One of the major drawbacks of these DLMP-based GUC mechanisms is that these prosumer-specific DLMPs are broadcasted to all entities at each round of P2P trading negotiation, which compromises the anonymity of prosumers’ participation in P2P trading. In addition, as GUC is announced before trades happen, these methods cannot consider the DLMP’s variation with amounts of P2P trades.
While the mentioned P2P trading models effectively address network constraints, they typically optimize for a single power operating point among P2P participants to ensure network integrity. The more general and easy-to-implement approach is to optimize the pre-defined time-variant network access limits for P2P participants, which has been realized in practical use as Dynamic Operating Envelopes. DOE is defined as “operating envelope that varies export limits over time and location based on the available capacity of the local network or power system as a whole” in [22]. Once DOEs are calculated and allocated to different prosumers, voltages will not exceed permissible bounds when net injections of all prosumers are within the DOEs. However, traditional DOEs calculation methods in [23, 24, 25, 26] do not consider P2P tradings, which means they only limit prosumers’ P2G behaviors. Extending the calculation of DOE to further apply it to P2P trading is promptly needed.
In the course of composing this paper, the investigations presented in [27] and [28] have undertaken preliminary efforts to integrate DOEs into P2P trading markets. These studies employed a direct incorporation of DOE calculations prior to P2P trading negotiations, utilizing the centralized DOE calculation methodology as proposed in [23]. However, these approaches overlook the incorporation of trading intentions into DOE calculations, thus neglecting the potential for adapting trading strategies to alter prosumers’ export limit requests. Furthermore, the method outlined in [23] assumes comprehensive observability of prosumers’ DER information by the DSO for improved network capacity utilization in DOE calculations, thereby compromising prosumers’ privacy. In light of the inherent flexibility of P2P trading mechanisms, there is an imperative need for the development of a novel DOE calculation framework that accounts for P2P trading, alongside an exploration of decentralized DOE computation methodologies.
Furthermore, existing literature on DOE calculation predominantly features the direct issuance of export limits by the DSO according to prosumers’ asks. An inherent concern arises, wherein prosumers may provide untruthful requests for their intended export limits. In response to this challenge, some work has undertaken preliminary inquiries into the pricing mechanisms associated with DOE allocation. Notably, reference [29] introduces the concept of Locational Allocation Price, yet lacks specificity regarding the DSO’s cost function and overlooks the P2P2G trading. This highlights the imperative for comprehensive explorations of such pricing schemes.
Ref. | Network Constraints | P2P Trading | DOE Calculation | DOE Price |
---|---|---|---|---|
[10, 11] | Centralized approach | ✔ | ✘ | ✘ |
[12, 13, 14, 15] | Distributed algorithms | ✔ | ✘ | ✘ |
[12, 16, 17, 18, 19, 20, 21] | GUC | ✔ | ✘ | ✘ |
[23, 24, 25, 26] | DOE | ✘ | Centralized | ✘ |
[27, 28] | DOE | ✔ | Centralized | ✘ |
[29] | DOE | ✘ | Centralized | ✔ |
This paper | DOE | ✔ | Decentralized | ✔ |
Table I provides a summary of the features of the relevant existing papers reviewed above, highlighting the differences between this paper and others regarding to the way to consider network constraints, P2P trading, DOE calculation method and DOE prices.
I-C Contributions
In this paper, the DOE is embedded in the P2P2G trading mechanism to ensure network integrity. To take injection caused by P2P trades into consideration, this paper modifies the calculation of DOEs. Also, the DOE is determined through the negotiation between the DSO and prosumers. Therefore, prosumers’ privacy is preserved and network integrity is guaranteed.
Main contributions are summarized as follows.
1) By incorporating DOE into the P2P2G trading, a novel decentralized trading mechanism is proposed to keep distribution network integrity. Because P2P trading amounts are contained in the net power injection of prosumer-specific nodes, prosumers’ trading behaviors can be directed to be grid-friendly through the DOE issued by the DSO, which is easy to implement in the existing distribution network.
2) In the proposed mechanism, DOEs are determined through the negotiation between the DSO and prosumers based on ADMM, simultaneously alongside the P2P trading process among prosumers. The DOE negotiation is bilaterally privacy-preserving by establishing a clear separation between prosumers’ privacy information (i.e. P2P trading amounts and devices parameters) and any grid parameters owned by the DSO. For maximizing individual surplus, prosumers will adjust their P2P trades to satisfy DOEs or pay for enlarging DOEs to allow more P2P trading amounts in each round of negotiation.
3) A COCA technique is leveraged to solve the trading problem, reducing the cost of communication for prosumers to the largest extent.
4) An interpretable DOE price is derived by duality analysis, which cannot only be utilized as a kind of price signal through DOE negotiation but also as a component of P2P trading price.
The remainder of this paper is organized as follows: Section II introduces DOE, the entities envolved and the P2P2G framework. Section III formulates the DOE calculation model with P2P2G trading, prosumers models and the DSO’s model. Section IV gives the solution algorithm. Also, we elaborate the DOE negotiation and P2P2G trading process in it. Section V shows case studies and section VI concludes this paper.
II Preliminary and Framework
In this section, we first provide a conceptual overview of DOE. Then we introduce roles of different entities in the proposed mechanism and describe the overall framework.
II-A Concept of Dynamic Operating Envelope
DOE provides a specific feasible range for each prosumer’s power injections while considering the DSO’s objective for preserving the network integrity by ensuring voltages and line power are within permissible bounds. As illustrated in Fig. 1, the feasible region (FR), represented as a polytope,varies during different time intervals due to diverse network operational states. These variations may arise from factors such as time-variant demands at nodes where no prosumer is located. As it is hard to explore the exact high-dimensional FR, the DSO can internally allocate it to different prosumers (rectangles) according to a given objective function. The combination of different time allocations forms the admissible power injection range for a prosumer (shadow). In doing so, prosumers can operate independently when their power injections are within their given DOEs.

In this paper, we adopt the same approach as described in [24, 30] where only use one-side DOE to limit prosumers’ export behaviors, because the reverse power flow arising from too much export power usually causes more problems in a distribution network. The envelope for the import limit can be solved using the same method in this paper. Based on this assumption, the key to obtaining DOEs is to solve the time-variant export limits (red curve) for the -th prosumer, given selected time horizon . Then, the injection region given as for all is formed and sent to the -th prosumer, where is the set of indices for prosumers. represents a predetermined power import limit. Since there are no constraints on power import behavior, this limit can be significantly greater than and is not treated as a variable subject to optimizations in this paper.
II-B Entities Description
There are two kinds of entities involved in the problem of P2P2G trading, i.e., prosumers and the DSO. Prosumers located at distribution networks may be equipped with RESs, energy storage systems and non-flexible loads. They can sell or buy energy from the distribution network at FiT and ToU respectively, as well as trade energy with each other in a P2P platform. Their objectives are maximizing individual surplus under operational constraints.
Another important role in P2P2G trading is the DSO. The DSO is obligated for DOE calculation whose objective is to minimize the operation cost of the distribution network under the power injection pattern associated with a DOE allocation. We also assume the DSO does not know each P2P trading amount and the price. Through the introduction of DOEs, there is no need for the DSO to decide or monitor each P2P trade, which separates the DSO from P2P trading.
II-C P2P2G Framework
In this work, we focus on the day-ahead market, without considering the uncertainty of RES outputs and loads. It is also assumed that each prosumer is aware of others’ trading requests. The overview of the proposed mechanism is given in Fig. 2(a).


Therein, prosumers need to determine their desired DOE and P2P trades together, then negotiate with the DSO and other peers. When both prosumers and DSO reach a consensus, negotiations terminate. As shown in Fig. 2(b), the negotiation process includes two loops:
1) Left loop: This loop describes the DOE negotiation process. While trading with peers, prosumers need to submit their intended export limits to the DSO. The first round submission of the initial intended export limits is based on a preset DOE price from the DSO. When the DSO gathers all prosumer-side export limits, it will run an Optimal Power Flow (OPF) to decide DSO-side export limits. Thanks to the use of ADMM, the multiplier for DOE reciprocity constraints can be updated and broadcast to prosumers, regarded as DOE prices. Corresponding to the DSO’s feedback, prosumers will change their P2P2G trading amounts to meet the last-round DOE allocation.
2) Right loop: Another loop is mainly about the P2P trading process. In this loop, prosumers determine their intended P2G trading amounts, P2P trading amounts and export limit, accounting for the last round DOE allocation and DOE price issued by the DSO. Then, each prosumer exchanges its P2P trading amounts with its partners. Note that COCA is used to solve the optimization, prosumers will not need to send the updated trading amounts if they are not sufficiently different from the previous one. After receiving all peers’ trading amounts, the prosumer will update trading amounts and trading prices locally.
It is crucial to emphasize that these two loops influence each other. For prosumers, they intend to adjust their operations and P2P2G trading amounts in each negotiation following the newest DOEs issued by the DSO. Thus, the DSO guarantees network integrity via DOEs, without directly monitoring P2P trading amounts.
III Prosumers, DSO and DOE calculation Model with P2P2G Energy Trading
In this section, we first introduce a simplified symbolic representation of the DOE calculation model with P2P2G trading. Then we illustrate the prosumers’ and the DSO’s models. Elaborate model decomposition and the solution algorithm will be expounded upon in the ensuing sections.
III-A DOE calculation model with P2P2G trading
The determination of DOE is based on the methodology presented in [29]. Better than [29], the model is incorporated with the P2P2G trading process. The DOE calculation model with P2P2G trading can be formulated as follows:
(1) | |||
(2) |
where represents the cost of the DSO for providing export limits and the -th prosumer’s cost for P2P2G trading if it is given such export limits. and are the variables and cost function for the -th prosumer. The feasible region of the prosumer’s P2P2G trading problem, denoted as , is determined based on the allocated export limits, as implied by constraint (1). is the feasible region of the distribution network, which is represented by the power flow equations, bounded voltage and line power constraints. Constraint (2) enforces the robustness of the model, ensuring that if any power injection of prosumers falls within the provided , the integrity of the distribution network is maintained.
The solution to (I) yields the time-variant export limits for prosumers (DOE), denoted as , and is issued to the -th prosumer. The robust constraint (2) can be further simplified into:
(3) |
This transformation can be justified for a balanced radial network, where more injections from nodes will result in higher currents running towards the root of the network, which in turn leads to higher voltages along the network lines. So when is permissible for the network, any injection within is also permissible [31].
Notice that constraint (1) incorporates the P2P2G trading problem of prosumers. Subsequent sections will elucidate the P2P2G trading problem among prosumers, incorporating DOE negotiations between prosumers and the DSO to solve (I).
III-B Prosumers models
Without loss of generality, we acknowledge the following assumptions in our study:
-
1.
As shown in Fig. 3, each prosumer is equipped with RESs and energy storage, and they connect with each other through the distribution network, with each node accommodating only one prosumer.
-
2.
Each prosumer is capable to derive the optimal operation and trading plan by solving its local problem.
-
3.
For simplicity of the following price properties statement, we ignore the charging and discharging efficiency of storage.
-
4.
Consistent with policies, prosumers are prohibited from buying or selling power at the same time with the distribution network.
The unordered pair means agents and can trade with each other, where is the set of possible trading pairs. The set of trading partners of prosumer is defined as .

Next, we present the objective function and detailed constraints for each prosumer’s decision-making model. Greek alphabets given in brackets before each constraint are Lagrange multipliers.
1) Objective function: A prosumer’s objective is to maximize the total surplus in such P2P2G trading. So the objective function is given by (for minimization):
(4) |
where , and mean ToU, FiT and P2P price respectively. and denote the power of purchase and sale with the distribution network, and is the power selling from prosumer to . The first two terms represent the cost of P2G trading. The last term gives the P2P trading revenue, is agreed by trading partners through the negotiation process, which will be discussed later in detail.
2) Battery constraints: Each prosumer may own local energy storage. The storage system is restricted by the following constraints:
(5) | |||
(6) | |||
(7) |
where and denote a prosumer’s battery net charging power and measured state of charge (SoC) respectively. For simplicity, we do not split the battery power into charging and discharging. are rated charging power and measured SoC limits of the storage. Constraint (7) gives the relationship between measured SoC and net charging power. This model is simplified and does not account for the different modes of charging and discharging.
3) Local power balance constraint: The local power balance of each prosumer is represented by the following equation:
(8) | |||
(9) |
where and denote the prediction of non-flexible local power demand and RES output respectively. denotes the total P2P trading amounts of prosumer . In this work, we avoid the tedious work of assigning buyers and sellers beforehand[5, 32, 6]. Instead, the role of prosumers in the P2P market is determined by the sign of . If , prosumer is viewed as a seller at time , but it can alter into a buyer in another time interval.
4) P2G trading constraints: Prosumers’ P2G behaviors are limited by:
(10) | |||
(11) |
where are binary variables characterizing P2G trading mode. are trading limits. However, these constraints can be exactly relaxed into:
(12) | |||
(13) |
We provide a concise overview of the exact relaxation method. Initially, we consider and to be strictly greater than zero. By applying the Karush-Kuhn-Tucker (KKT) condition to the prosumers’ models discussed in Section IV, we observe a contradiction with the aforementioned assumption. Therefore, we conclude that the relaxation is exact, implying that and cannot both be larger than zero simultaneously.
5) P2P trade constraint: The trading constraint is given by:
(14) |
For each P2P trade, it must satisfy the constraint (14), where is the decision variable of prosumer , while is that of partner . This constraint is called reciprocity constraint, indicating the trading agreement of each pair of prosumers. Moreover, the multiplier of the reciprocity constraint is taken as the P2P trading price.
6) DOE constraint: Focusing on the connection point where a prosumer trades with other peers, the net power injection can be split into two parts: interaction with the distribution network (P2G behavior) and power traded with peers (P2P behavior).
(15) |
According to the definition of DOE, each prosumer should restrict their net power injection below the given export limit (with the assumption that the import limit is not exceeded):
(16) |
Remark 1: Traditional DOE representation excludes P2P trading power injection, thus ignoring the P2P trading effects on the network [23, 24, 25, 26]. By (16), network integrity is taken into consideration when prosumers trade with each other. is taken as a variable, which means prosumers can adjust their P2P trades to change their intended DOE ask.
III-C DSO’s model
In the following, we first use implicit functions to model network constraints, in which network state variables like voltage magnitudes are not directly expressed as decision variables. Instead, they are functions of each prosumer node’s export limits and fixed loads at other nodes. We prefer to use the implicit function because, in later analysis, the so-called DOE price can admit an economical interpretation.
Consider a tree network , where is the set of all nodes, gives the set of lines. Setting root node connected with the upstream grid (node 0) as the reference, , where is the set of nodes where no prosumer is located. Take the prediction of reactive power injection for , prediction of active power injection for and voltage magnitude of the root node as the input, the distribution network constraints are:
(17) | |||
(18) | |||
(19) | |||
(20) | |||
(21) |
where . are the line active power, reactive power, and square of the current magnitude at . is the voltage magnitude. are active and reactive power injections at the root node at . Constraints (17) and (18) limit lines power within range, and constraint (19) limits voltage magnitudes. Power balance is ensured by constraints (20) and (21). Constraint (17)-(21) depicts the in (3), which indicates that when power injections are the same as export limits, the voltage and line power are in the admissible range. Further, the power injections in the envelope for all also ensure the network integrity.
The cost incurred by the DSO to provide export limits, denoted as , is defined as in this paper, where is the energy price at the root node of the distribution network. We build by following the approach introduced in [33], wherein the authors partition the envelope interval into uniform segments and determine the loss cost when all prosumers’ power injections occur simultaneously within the same segment. Here, is the set of indices for scenarios, with being the total number of given scenarios. In this context, scenario indicates a power injection at of the export limit, and denotes the corresponding square of the current magnitude. The defined cost function represents the expectation of the network loss cost when power injections are below the specified export limits.
IV Model Decomposition and Solution Algorithm
In this section, we first reformulate (I) and use ADMM to decompose it into DSO’s DOE determination problem and prosumers’ P2P2G trading problem. Then the prosumers’ P2P2G trading problem is further decomposed into the individual level. At last, the P2P2G trading negotiation and DOE negotiation process are given, and the corresponding prices are analysed.
IV-A Model reformulation and decomposition
Having clarified the prosumers and DSO’s model, (I) can be transformed into:
(22) | |||
(23) |
As demonstrated in (I), the DOE calculation model considering P2P2G trading necessitates the integration of both P2P2G trading and network constraints. In order to avoid the DSO compromising prosumers’ privacy, ADMM is employed to decompose (II).
The export limit is regarded as a decision variable for the -th prosumer, which means prosumers are required to determine their intended export limits based on their real-time trading preferences. Similar to P2P trading, we formulate a reciprocity constraint requiring prosumers’ intended export limits and that calculated by the DSO to be equal when negotiation terminates:
(24) |
where denotes the DSO-side export limit. Adding constraints (24) into (II) and relaxing it using ADMM, we can decompose (II) into the following two subproblems :
(25) | |||
where is an empirical parameter. In , when the optimal solution is obtained, there is , so the term for trading revenue in the individual objective function is eliminated in .
IV-B COCA-based distributed algorithm for P2P2G trading
Note that different prosumers’ decision variables are coupled by the reciprocity constraint (25), taking advantage of the distributed algorithm can decompose into the individual level. In this paper, our algorithm is based on the consensus ADMM, advanced by a censored communication segment to reduce communication costs.
First, we introduce consensus variables into constraint (25) as:
(26) |
the consesus variable can be regarded as local trading amount estimation of prosumer .
Then we use Lagrange multipliers of constraint (26) to formulate the augmented Lagrangian, after which the subproblem for each prosumer can be written as:
In the -th iteration, prosumer solves local optimization problem based on the local estimations of trading amount and price , then it obtains the updated P2P trading amount with its partner . At the same time, prosumer calculates and sends its corresponding decision to prosumer . Thereupon, prosumer can update the local estimations of trading amount and price as follows, which coincides with the updating rules of ADMM:
(27) | |||
(28) |
where is an empirical parameter. The update continues until the algorithm converges, as the total residuals fall below the criteria:
(29) | ||||
where is the presetted threshold.
However, the proposed consensus ADMM method may lead to a heavy communication burden, especially when a lot of iterations are required. By adding a censored strategy into the communication process, the COCA algorithm can effectively reduce communication costs without compromising the convergent rate. Applying the strategy in P2P2G trading, a prosumer is not allowed to send its updated trading amounts to partners if they are not sufficiently different from the previous one. The threshold for communication in -th iteration can be described as:
(30) | |||
(31) |
where measures the change of the locally derived trading amount of prosumer , and compares such change with adaptive threshold . If (31) is satisfied, prosumer can communicate with its partners and vice versa. By properly choosing threshold , the convergence of the algorithm can be guaranteed [34].
In summary, in the proposed P2P2G trading model, prosumers only need to communicate their updated P2P trading amount with each other, and P2P prices are estimated locally. Therefore, the mechanism is totally decentralized. Combined with a communication censored strategy, prosumers’ communication costs can also be saved compared to most distributed optimization-based methods. The total cost of prosumers obtained by this method also turns out to be the same as that of the centralized problem, which is proved in [34].
IV-C ADMM-based DOE negotiation
In this subsection we depict the DOE negotiation process. Take a panoramic view of the mechanism, in -th iteration, prosumer solves to submit to the DSO and P2P trading amounts to its potential P2P trading partner . According to others’ trading response, prosumer updates and . Simultaneously, the DSO solves to calculate and update by:
(32) |
Remark 2: It is difficult to derive network functions (17)-(21) in closed form, so this nonconvex model cannot be easily solved. Many methods such as second-order conic programming (SOCP) relaxation, semi-definite programming (SDP) relaxation can be used to solve it, and they are proven to be exact under certain conditions. In this paper, we use the SOCP relaxation of the DistFlow model to solve the above optimization problem, and the result is shown to be exact. The network variables like voltage magnitudes in the case study are derived from solving the SOCP relaxed model. But in price analysis, we do not base on the SOCP model to illustrate because the formulation of DOE price is not that interpretable compared with that obtained from the model using implicit function constraints.
After the DSO broadcasting and to prosumers, the next iteration begins and repeats until convergence. It is crucial to mention that two negotiations influence each other, as whenever the DSO issues updated DOEs and price signals, by refreshing DOE constraints, prosumers will fine-tune their P2P2G trading behaviors to satisfy DOE limits.
The overall pseudocode of the proposed market mechanism for P2P2G trading is presented in Algorithm 1. Algorithm 1 converges when (29) is satisfied along with following inequalities:
(33) | ||||
where is presetted threshold.
IV-D Components of DOE and P2P Price
Assuming that we have already found the optimal solution, from Envelope Theorem we can get the DOE price as:
(34) |
where is the Lagrangian of the DSO subproblem , and is the lagrange multiplier of the DOE reciprocity constraint (24). Next, we illustrate the components of such DOE price.
From KKT condition, we can obtain . Combined with (34), we can show the DOE price as:
After Algorithm 1 converges, the first term on the right-hand side in the above equation is equal to zero. The second and third terms are related to the lines’ power limits. The fourth term is related to voltage magnitudes limits. The fifth term is related to power at the root. The last two terms are related to network power loss.
Expressing in this way, it can be transparently interpreted as the sum of the congestion component, voltage component, energy component and loss component. Passing such a DOE price signal to prosumers is reasonable, as it indicates the potential marginal cost for the DSO to maintain the network integrity of the distribution network when prosumers ask for a larger DOE at its node.
Furthermore, we can calculate the Lagrangian of the prosumer subproblem , and use KKT condition to deduce:
(35) | ||||
From the fourth equation, we can see that the prosumer’s P2P trading price is internally influenced by the DOE price. Therewith, prosumers’ trading behaviors will be guided to be grid-friendly.
V Case Study
V-A Simulation Setting
All numerical studies were performed in Python and used the Gurobi solver. Actual power flow after P2P2G trading was simulated using PyPSA [35] in Python. A 15-bus test system in Fig. 5 was used to analyze the proposed P2P2G trading mechanism. The network parameters were taken from reference [19]. We assumed only one prosumer locates at Node 2,7 and 12, and they participate in P2P2G trading and need to obey DOE limits. All remaining nodes were viewed as consumer nodes with fixed active and reactive loads. In terms of prices, we set ToU twice the value of FiT. With respect to algorithm parameters, we set the initial P2P trading price to the average of FiT and ToU, and initial trading amounts are set zero. Initial DOE is set larger than the maximum RES output. The convergence thresholds in stopping criteria of the algorithm were set .
V-B 15-bus system test
Without considering DOE, the P2P2G problem solution takes 93 iterations to converge, and the result shows voltages and line powers are out of limits. After incorporating DOE, the proposed mechanism solution is obtained after 187 iterations, and the network integrity problems are eliminated. Next, we compare these two results and reveal the superiority of the proposed mechanism.
1) Impact of DOEs on the network integrity: In this part, we first compared the network integrity before and after incorporating DOEs into P2P2G trading.
Fig. 4 shows the voltage profile after P2P2G trading without consideration of network constraints. Due to unlimited trading, there are problems of voltage limit violations, especially for those nodes far from the root. After introducing DOEs into P2P2G trading, the voltages are within a safe range.

Also, before using DOEs, the network power loss is high, because frequent P2P trades inject more unexpected power into the grid. Regulated by the DSO through DOEs, the loss of energy during the whole day in the distribution network reduces from 1.175MWh to 0.245MWh.
As for line congestion, the line statuses before and after using DOEs are illustrated in Fig. 5. Not taking DOEs into consideration, we observed that several lines suffer from congestion, which is harmful to the grid and will cause further maintenance. However, after using DOEs, the congestion is eliminated.

The negotiated DOE is shown as bars in Fig. 6. The result follows the intuition that the furthest prosumer suffers the most severe network problem. So, prosumer 7 and 12 who are located at the terminal of this radial network are allowed the thinnest DOE, while prosumer 2 close to the root enjoys the most.

All results above imply that when the DOE is incorporated into P2P2G trading, trading behaviors are regulated, thus network integrity problems are eliminated.
2) Economical Performance: As shown in Fig. 7, the P2P trading price lies between FiT and ToU, which can motivate prosumers to trade with peers. The result shows that the surplus of prosumers increases from 101.73$ in P2G trading only to 126.38$ after P2P trading. Thus, prosumers can collectively reduce their total purchase cost from the distribution network.

We also plotted the DOE price of three prosumers in Fig. 6. Consistent with the results of DOE allocation, the prosumer at the terminal node is asked for the most expensive DOE charge, which means DOE requirement of this node will lead to more costs for the DSO to keep distribution network integrity than other nodes.
Fig. 8 shows the cost profile of prosumers and the DSO respectively before and after using DOEs. It is obvious that without DOEs, the DSO’s operation cost is high, especially in the mid of the day. The reduction of power loss lightens that burden for the DSO.

3) Computational Performance: To demonstrate the feasibility of the proposed P2P2G trading mechanism, we illustrated the computational performance of the 15-bus case study.

Primal residuals versus iteration are plotted in Fig. 9. As in each iteration, there are actually two ADMM-based negotiations carrying on, if one negotiation terminates much later than the other, the other one may conduct many redundant communications and lead to an unnecessary transmission burden. From Fig. 9, the convergence rate of DOE negotiation is much slower than P2P trading. Even though prosumers need to adjust trading behaviors to follow DOE negotiation, in abundant iterations the change of each prosumer’s trading amounts is slight. Taking advantage of COCA, in many iterations, prosumers need not send trading amounts to others. In the 15-bus system test, instead of using COCA, traditional ADMM takes 187 iterations to converge and overall P2P communication times are 1122. Replacing ADMM with COCA, the process also takes 187 times to converge, but the total P2P communication times are merely 860. Therefore, the communication cost for each prosumer is significantly reduced.
V-C 141-bus system test
To show that the proposed mechanism scales well with larger networks and more prosumers, we conducted the simulation on a 141-bus system. In this case, we ran for 24 hours and arranged 28 prosumers randomly at different nodes. RES outputs and storage system parameters are also set differently from each other. Before using DOEs, the 141-system mainly suffers from voltage over limits problems. For quicker convergence, we set convergence thresholds . Primal residuals versus iteration are plotted in Fig. 9.
The simulation result is shown in Table II.
Approach | #Overlimits | Total loss (MWh) | #Communication with peers | ||
---|---|---|---|---|---|
|
|
||||
M1: P2P2G trading without DOE | 45 | 11 | 9633 | 136836 | |
M2: DOE + P2P2G with ADMM | 0 | 0 | 6648 | 179172 | |
M3: DOE + P2PG with COCA | 0 | 0 | 6648 | 20731 |
From the comparison between M1 and M2/M3, we can see that the voltage and line power problems happening in the P2P2G trading are eliminated, and the total energy loss of the distribution network is reduced by one-third. From Fig. 10, prosumers’ revenues are shown. With a small ratio of DOE payment, the DSO can use DOE to direct prosumers to be grid-friendly.
Embedded with DOE, the M2/M3 takes more iterations to converge than M1, because there is DOE negotiation added, the communication times among peers increase from 136836 to 179172. However, many of them are unnecessary when DOE negotiation is far from the end. To deal with the communication burden, making use of the censored strategy, DOE embedded P2P2G trading only needs 20731 communication times among peers in M3 to carry on P2P trading negotiation, even less than that of M1.

VI Conclusion
This work proposes a novel P2P2G mechanism considering distribution network integrity. By introducing DOEs, network integrity under P2P trading among prosumers can be guaranteed without the DSO interfering trading process. Solving by ADMM-based algorithm, DOEs are determined during negotiations between the DSO and prosumers, preserving prosumers’ privacy well. A COCA algorithm used in the P2P trading process reduces prosumers’ communication costs, which makes the mechanism more practical. Finally, DOE price and P2P trading price determination in this paper are shown to have an economical interpretation.
This work assumes prosumers have non-flexible loads and the mechanism works in the day-ahead market. Future research should focus on considering flexible loads, and try to apply the mechanism under a real-time condition. Some communication-efficient distributed algorithms like asynchronous ADMM can also be tested to avoid more communication problems.
References
- [1] G. Belgioioso, W. Ananduta, S. Grammatico, and C. Ocampo-Martinez, “Operationally-safe peer-to-peer energy trading in distribution grids: A game-theoretic market-clearing mechanism,” IEEE Transactions on Smart Grid, 2022.
- [2] D. H. Nguyen, “Optimal solution analysis and decentralized mechanisms for peer-to-peer energy markets,” IEEE Transactions on Power Systems, vol. 36, no. 2, pp. 1470–1481, 2020.
- [3] S. Lilla, C. Orozco, A. Borghetti, F. Napolitano, and F. Tossani, “Day-ahead scheduling of a local energy community: An alternating direction method of multipliers approach,” IEEE Transactions on Power Systems, vol. 35, no. 2, pp. 1132–1142, 2019.
- [4] C. Lyu, Y. Jia, and Z. Xu, “Fully decentralized peer-to-peer energy sharing framework for smart buildings with local battery system and aggregated electric vehicles,” Applied Energy, vol. 299, p. 117243, 2021.
- [5] Z. Guo, P. Pinson, S. Chen, Q. Yang, and Z. Yang, “Online optimization for real-time peer-to-peer electricity market mechanisms,” IEEE Transactions on Smart Grid, vol. 12, no. 5, pp. 4151–4163, 2021.
- [6] E. Sorin, L. Bobo, and P. Pinson, “Consensus-based approach to peer-to-peer electricity markets with product differentiation,” IEEE Transactions on Power Systems, vol. 34, no. 2, pp. 994–1004, 2018.
- [7] V. Dudjak, D. Neves, T. Alskaif, S. Khadem, A. Pena-Bello, P. Saggese, B. Bowler, M. Andoni, M. Bertolini, Y. Zhou, B. Lormeteau, M. A. Mustafa, Y. Wang, C. Francis, F. Zobiri, D. Parra, and A. Papaemmanouil, “Impact of local energy markets integration in power systems layer: A comprehensive review,” Applied Energy, vol. 301, p. 117434, 2021.
- [8] M. F. Dynge, P. C. del Granado, N. Hashemipour, and M. Korpås, “Impact of local electricity markets and peer-to-peer trading on low-voltage grid operations,” Applied Energy, vol. 301, p. 117404, 2021.
- [9] W. Tushar, T. K. Saha, C. Yuen, D. Smith, and H. V. Poor, “Peer-to-peer trading in electricity networks: An overview,” IEEE Transactions on Smart Grid, vol. 11, no. 4, pp. 3185–3200, 2020.
- [10] J. Guerrero, A. C. Chapman, and G. Verbič, “Decentralized p2p energy trading under network constraints in a low-voltage network,” IEEE Transactions on Smart Grid, vol. 10, no. 5, pp. 5163–5173, 2018.
- [11] J. Guerrero, B. Sok, A. C. Chapman, and G. Verbič, “Electrical-distance driven peer-to-peer energy trading in a low-voltage network,” Applied Energy, vol. 287, p. 116598, 2021.
- [12] M. H. Ullah and J. D. Park, “Peer-to-peer energy trading in transactive markets considering physical network constraints,” IEEE Transactions on Smart Grid, vol. 12, no. 4, pp. 3390–3403, 2021.
- [13] W. Zhong, S. Xie, K. Xie, Q. Yang, and L. Xie, “Cooperative p2p energy trading in active distribution networks: An milp-based nash bargaining solution,” IEEE Transactions on Smart Grid, vol. 12, no. 2, pp. 1264–1276, 2021.
- [14] Y. Jia, C. Wan, W. Cui, Y. Song, and P. Ju, “Peer-to-peer energy trading using prediction intervals of renewable energy generation,” IEEE Transactions on Smart Grid, 2022.
- [15] C. Feng, B. Liang, Z. Li, W. Liu, and F. Wen, “Peer-to-peer energy trading under network constraints based on generalized fast dual ascent,” IEEE Transactions on Smart Grid, pp. 1–1, 2022.
- [16] A. Paudel, L. P. M. I. Sampath, J. Yang, and H. B. Gooi, “Peer-to-peer energy trading in smart grid considering power losses and network fees,” IEEE Transactions on Smart Grid, vol. 11, no. 6, pp. 4727–4737, 2020.
- [17] A. Paudel, J. Yang, and H. B. Gooi, “Peer-to-peer energy trading in smart grids considering network utilization fees,” in 2020 IEEE Power & Energy Society General Meeting (PESGM), 2020, Conference Proceedings, pp. 1–5.
- [18] T. Baroche, P. Pinson, R. L. G. Latimier, and H. B. Ahmed, “Exogenous cost allocation in peer-to-peer electricity markets,” IEEE Transactions on Power Systems, vol. 34, no. 4, pp. 2553–2564, 2019.
- [19] J. Kim and Y. Dvorkin, “A p2p-dominant distribution system architecture,” IEEE Transactions on Power Systems, vol. 35, no. 4, pp. 2716–2725, 2020.
- [20] K. Zhang, S. Troitzsch, S. Hanif, and T. Hamacher, “Coordinated market design for peer-to-peer energy trade and ancillary services in distribution grids,” IEEE Transactions on Smart Grid, vol. 11, no. 4, pp. 2929–2941, 2020.
- [21] H. Haggi and W. Sun, “Multi-round double auction-enabled peer-to-peer energy exchange in active distribution networks,” IEEE Transactions on Smart Grid, vol. 12, no. 5, pp. 4403–4414, 2021.
- [22] DEIP, “Deip dynamic operating envelopes workstream: Outcomes report,” 2022. [Online]. Available: https://arena.gov.au/assets/2022/03/dynamic-operating-envelope-working-group-outcomes-report.pdf
- [23] K. Petrou, A. T. Procopiou, L. Gutierrez-Lagos, M. Z. Liu, L. F. Ochoa, T. Langstaff, and J. M. Theunissen, “Ensuring distribution network integrity using dynamic operating limits for prosumers,” IEEE Transactions on Smart Grid, vol. 12, no. 5, pp. 3877–3888, 2021.
- [24] Y. Yi and G. Verbič, “Fair operating envelopes under uncertainty using chance constrained optimal power flow,” Electric Power Systems Research, vol. 213, p. 108465, 2022.
- [25] M. Z. Liu, L. F. Ochoa, P. K. C. Wong, and J. Theunissen, “Using opf based operating envelopes to facilitate residential der services,” IEEE Transactions on Smart Grid, pp. 1–1, 2022.
- [26] M. Liu, A. Procopiou, K. Petrou, L. Ochoa, T. Langstaff, J. Harding, and J. Theunissen, “On the fairness of pv curtailment schemes in residential distribution networks,” IEEE Transactions on Smart Grid, vol. 11, pp. 4502–4512, 2020.
- [27] M. M. Hoque, M. Khorasany, M. I. Azim, R. Razzaghi, and M. Jalili, “Dynamic operating envelope-based local energy market for prosumers with electric vehicles,” IEEE Transactions on Smart Grid, pp. 1–1, 2023.
- [28] M. I. Azim, G. Lankeshwara, W. Tushar, R. Sharma, M. R. Alam, T. K. Saha, M. Khorasany, and R. Razzaghi, “Dynamic operating envelope-enabled p2p trading to maximise financial returns of prosumers,” IEEE Transactions on Smart Grid, pp. 1–1, 2023.
- [29] C. Chen, S. Bose, and L. Tong, “Dso-dera coordination for the wholesale market participation of distributed energy resources,” arXiv preprint arXiv:2211.16585, 2022.
- [30] L. O’Neil, L. Reedman, J. Braslavsky, T. Brinsmead, C. McDonald, A. Ward, and B. Williams, “Analysis of the vpp dynamic network constraint management,” 2021, allocation level.
- [31] B. Liu and J. H. Braslavsky, “Sensitivity and robustness issues of operating envelopes in unbalanced distribution networks,” IEEE Access, vol. 10, pp. 92 789–92 798, 2022.
- [32] Z. Guo, P. Pinson, Q. Wu, S. Chen, Q. Yang, and Z. Yang, “An asynchronous online negotiation mechanism for real-time peer-to-peer electricity markets,” IEEE Transactions on Power Systems, pp. 1–1, 2021.
- [33] A. Attarha, M. Mahmoodi, R. A. S. M. N, P. Scott, J. Iria, and S. Thiébaux, “Adjustable price-sensitive der bidding within network envelopes,” IEEE Transactions on Energy Markets, Policy and Regulation, pp. 1–11, 2023.
- [34] Y. Liu, W. Xu, G. Wu, Z. Tian, and Q. Ling, “Communication-censored admm for decentralized consensus optimization,” IEEE Transactions on Signal Processing, vol. 67, no. 10, pp. 2565–2579, 2019.
- [35] T. Brown, J. Hörsch, and D. Schlachtberger, “Pypsa: Python for power system analysis,” Journal of Open Research Software, vol. 6, 2017.