Operationally-Safe Peer-to-Peer Energy Trading in Distribution Grids: A Game-Theoretic Market-Clearing Mechanism

In future distribution grids, prosumers (i.e., energy consumers with storage and/or production capabilities) will trade energy with each other and with the main grid. To ensure an efficient and safe operation of energy trading, in this paper, we formulate a peer-to-peer energy market of prosumers as a generalized aggregative game, in which a network operator is only responsible for the operational constraints of the system. We design a distributed market-clearing mechanism with convergence guarantee to an economically-efficient and operationally-safe configuration (i.e., a variational generalized Nash equilibrium). Numerical studies on the IEEE 37-bus testcase show the scalability of the proposed approach and suggest that active participation in the market is beneficial for both prosumers and the network operator.


page 8

page 9


Optimal Network Charge for Peer-to-Peer Energy Trading: A Grid Perspective

Peer-to-peer (P2P) energy trading is a promising market scheme to accomm...

Risk-Averse Equilibrium Analysis and Computation

We consider two market designs for a network of prosumers, trading energ...

Peer-to-Peer Energy Trading with Sustainable User Participation: A Game Theoretic Approach

This paper explores the feasibility of social cooperation between prosum...

Towards Harmonious Decentralization of Energy Systems: A Vision of Interoperable Peer-to-Peer Energy Markets

We present a hierarchical framework aimed at decentralizing the distribu...

Challenges and Prospects of Negawatt Trading in Light of Recent Technological Developments

With the advancement of the smart grid, the current energy system is mov...

Transforming Energy Networks via Peer to Peer Energy Trading: Potential of Game Theoretic Approaches

Peer-to-peer (P2P) energy trading has emerged as a next-generation energ...


Variables and Cost Functions
[€] cost of the dispatchable units
[€] cost of trading with the main grid
[€] cost of the storage units
[€] cost of trading with other prosumers
[€] total cost function of each prosumer
[€/kWh] dual variable for grid trading constraints
[€/kWh] dual variable for power balance constraints
[€/kWh] dual variable for grid physical constraints
[€/kWh] dual variable for reciprocity constraints
[kW] power generated by dispatchable units
[kW] real power line of two neighboring busses
[kW] power traded with the main grid
[kW] power delivered to/from the storage units
[kW] power exchanged between bus and main grid
[kW] power traded with another prosumer
[kVAr] reactive power line
[kW] aggregate of active load on the main grid
p.u. voltage magnitude
[] state of charge of the storage units
[rad] voltage angle
- efficiency of storage units
- step sizes of the proposed algorithm
[kW] aggregate of passive consumer demand
[ohm] line susceptance
[€/kWh] linear coefficient (coeff.) on the cost
of dispatchable units (DU)
[€/kWh] trading tariff
[€/kWh] per-unit cost of trading
[€/kWh] coeff. on the cost of trading with
the main grid
[kWh] max. capacity of the storage units
[ohm] line conductance
- time horizon
[kW] max. charging power of the storages
[kW] power demand
[kW] max. discharging power of the storages
[kW] max. and min. power generated by DU
[kW] max. and min. total power
traded with the main grid
[kW] max. power traded between prosumers
[€/kWh] quadratic coeff. on the cost of DU
[€/kWh] coeff. on the cost of storage units
[kVA] max. line capacity
[hour] sampling time
p.u. max. and min. voltage magnitude
p.u. max. and min. state of charge
[rad] max. and min. voltage angle
set of busses in the electrical network
set of busses connected to main grid
coupling constraint set
set of links in the trading network
graph representing trading network
graph representing physical network
set of discrete-time indices
set of power lines (links)
set of prosumers
set of prosumers and network operator
set of trading partners of prosumer
set of prosumers of bus
set of passive consumers
set of passive consumers of bus
local constraint set

I Introduction

In recent years, there has been a fast growing penetration of distributed and renewable energy sources as well as storage units in distribution networks [24]. The parties who own these devices are called prosumers, i.e., energy consumers with production and/or storage capabilities. Unlike traditional consumers, prosumers can have a prominent role in achieving energy balance in a distribution network, since they can contribute to energy supply. Therefore, currently there is a large research effort to study potential evolutions of electricity markets and decentralized energy management mechanisms that can enable active participation of prosumers [24, 30, 19, 28].

Focusing on spot markets, i.e., day-ahead and intra-day markets, each prosumer has to decide its energy production and consumption over a certain time horizon, with the objective of minimizing its own economic cost while satisfying its physical and operational constraints. Most of existing works formulate such peer-to-peer (P2P) markets via game-theoretic or multi-agent optimization frameworks [30, 31, 11, 12, 34, 2, 27]. For instance, the authors of [30] provide a literature survey of early works on game-theoretic P2P market models. More recently, [31] considers a coalition game approach for peer-to-peer trading of prosumers with storage units. Furthermore, [11, 12, 34, 2, 27] propose economic dispatch formulations where energy trading is incorporated as coupling (reciprocity) constraints and each prosumer has an objective that depends on local decision variables only.

Generalizing the previous papers, our preliminary work in [7] does not only consider multi-bilateral trading but also trading with the main grid, which extends the coupling to both constraints and objective functions. Mathematically, clearing the resulting P2P market corresponds to finding a generalized Nash equilibrium (GNE), namely, a configuration in which no prosumer has an incentive to unilaterally deviate. Similarly, [32] formulates a generalized Nash game of energy sharing or a multilateral (instead of bilateral) trading among prosumers, and moreover, a distributed GNE seeking algorithm is designed to find a solution of the market equilibrium problem. In parallel, we note that operator-theoretic approaches have been effectively exploited to design distributed methods that solve GNE problems under the least restrictive assumptions [23, 6, 14, 9, 10].

In practice, however, direct trading among prosumers might jeopardize system reliability, for which network operators are responsible. Therefore, when designing energy management mechanism for a distribution grid, one must also consider the role of network operators and the reliability of the system itself. For example, [26, 22] treat decentralized markets and operational reliability separately, and propose market-clearing mechanisms where decentralized market solutions must be approved by a network operator based on the system operational constraints. An alternative is based on incorporating network charges, which may reflect utilization fees and network congestion, into the market formulation, as discussed in [3, 25]. Differently, [21, 34] include network operators as players in the market and impose operational requirements of the network as constraints in the market problem, which is formulated as a multi-agent optimization. Nevertheless, none of these works simultaneously consider coupled objectives and constraints, implying the inapplicability of their decentralized mechanisms to our market formulation.

In this paper, we consider a P2P energy market in which each prosumer is capable of not only generating and storing energy but also directly trading with other prosumers as well as with the main grid. Similarly to [21], we include a network operator, whose objective is to ensure safe and reliable operation of the system. However, we formulate the market clearing as a GNE problem, in which the players (i.e., prosumers and network operators) have coupling objective functions and constraints (Section II). Our market formulation extends our preliminary work [7] by including nonlinear network operational constraints and system operators in the model, which considerably complicate the analysis.

The main advantage of our decentralized market design is that its equilibria are not only economically-optimal but also operationally-safe and reliable. Furthermore, we propose a provably-convergent, scalable and distributed market-clearing algorithm based on the proximal-point method for monotone inclusion problems [4, § 23] (Section III). Finally, we investigate via extensive numerical studies: (i) the effectiveness of the proposed market framework; (ii) the impact of distributed generation, storage and P2P tradings in distribution grids; and (iii) the scalability of the proposed market-clearing mechanism with respect to both the number of prosumers and the number of P2P tradings in the distribution network (Section IV).

Basic notation

denotes the set of real numbers, denotes the set of natural numbers, and (

) denotes a matrix/vector with all elements equal to

(); to improve clarity, we may add the dimension of these matrices/vectors as subscript. denotes the Kronecker product between the matrices and . For a square matrix , its transpose is , represents the element on the row and column . () stands for positive definite (semidefinite) matrix. Given vectors , .

Operator theoretic definitions

For a closed set , the mapping denotes the projection onto , i.e., . A set-valued mapping is (strictly) monotone if for all , , .

Ii Peer-to-peer markets as a Generalized Nash Equilibrium Problem

We denote a group of prosumers connected in a distribution network by the set . Each prosumer might have the capability of producing, storing, and consuming power, depending on their devices and assets. Furthermore, each prosumer might also trade power directly with the main grid and with (some of) the other prosumers, which we will refer to as trading partners. The trading partners of an agent might be defined based on geographical location or on bilateral contracts [28]. We model the trading network of prosumers as an undirected graph , where is the set of vertices (agents) and is the set of edges, with . The unordered pair of vertices if and only if agents and can trade power. The set of trading partners of agent is defined as .

Moreover, we also consider the electrical distribution network, to which the prosumers are physically connected. This network consists of a set of busses, denoted by , connected with each other by a set of power lines, denoted by . Thus, we represent the physical electrical network as a connected undirected graph . In , each prosumer is connected to a bus and, in general, one bus may have more than one prosumer. Figure 1 illustrates an example of trading and physical electrical networks. Furthermore, we assume that a distribution network operator (DNO) is responsible to maintain the reliability of the system, i.e., to ensure the satisfaction of the physical constraints of the electrical network [26, 22, 21].

Fig. 1: A modified IEEE 37-bus network with 12 prosumers (boxes) and 15 passive loads (black triangles). Busses are represented by black circles, physical lines in by solid lines, whereas trading relations () by dash-dotted blue lines.

We focus on P2P spot markets, i.e., day-ahead and intra-day markets, similarly to [28, 11, 21]. Thus, we denote the time horizon for which the decisions are computed by . For instance, in a day-ahead market, typically, the sampling period is one hour and the time horizon is hours. Moreover, as in [21], we also include the physical constraints of the distribution network to ensure that a solution is not only economically optimal but also meets the standards of the DNO.

Let us model such a P2P market as a generalized game. Specifically, we assume that each prosumer, or agent, aims at selfishly minimizing its cost function, which might involve decisions of other agents, subject to local and coupling constraints. Furthermore, we consider the DNO as an additional agent, i.e., agent , whose objective is to ensure the constraints of the physical network are met. In this regard, let denote the decision of agent , for all , for the whole time. Furthermore, we denote by the decision profile, namely, the stacked vectors of the decisions of all agents, i.e., , and by the decision of all agents except agent , i.e., .

Each agent wants to selfishly compute an optimal decision, , of its local optimization problem, as follows:


where is the cost function of agent , is the local constraint set, and is the set of coupling constraints.

In the remainder of this section, we describe , , and , upon which we postulate standard assumptions, as formalized in the next statement.

Assumption 1

For each agent , the function is convex and continuously differentiable, for all fixed ; the set is nonempty, closed and convex. The global feasible set satisfies the Slater’s constraint qualification [4, Eq. (27.50)].

Ii-a Model of prosumers in the network

In this section, we introduce the prosumer model. We consider that power might be generated by non-dispatchable generation units, e.g. solar and wind-based generators, or dispatchable units, e.g. small-scale fuel-based generators. Moreover, we also consider the slow dynamics of storage units. We restrict the model of each component such that Assumption 1 holds, that is, we avoid non-convex formulations and provide a convex approximation instead. Not only this approach is common in the literature, see e.g. [21, 1, 20], but also practical especially for real-time implementation, which requires fast and reliable computations.

First, we suppose that the components of the decision vector of prosumer , , are the power generated from a dispatchable unit (), the power delivered to/from a storage unit (), the power traded with the main grid (), and the power traded with its neighbors (), for all . For simplicity of exposition, we assume that each prosumer only owns at most one dispatchable unit and/or one storage unit. Next, we present the model for these devices.

Dispatchable units

The objective function of a dispatchable unit, denoted by , is typically a convex quadratic function [1, 15, 27], e.g.


where and are constants. Furthermore, the power generation is limited by


where denote maximum and minimum total power production of the dispatchable generation unit, and the subset of agents that own dispatchable units.

Storage units

Each prosumer might also minimize the usage of its storage units, for instance, in order to reduce its degradation. The corresponding cost function is denoted by , defined as in [15]:


where . The battery charging/discharging profile is constrained by the battery dynamics


where denotes the state of charge (SoC) of the storage unit at time , denotes the efficiency of the storage and and denote sampling time and maximum capacity of the storage, respectively. Moreover, denote the minimum and the maximum SoC of the storage unit of prosumer , respectively, whereas and denote the maximum charging and discharging power of the storage unit. Finally, we denote by the set of prosumers that own a storage unit.

Local power balance

The local power balance of each prosumer is represented by the following equation:


where denotes the local power demand profile over the whole prediction horizon. The power demand is defined as the difference between the aggregate load of prosumer and the power generated by its non-dispatchable generation units, e.g., solar or wind-based generators111If a component of is positive, then the load is larger than the power produced by its non-dispatchable units.. Finally, it is worth mentioning that a prosumer that does not own a dispatchable nor storage unit can satisfy its power balance (6) by importing (trading) power from other prosumers and/or the main grid.

Passive consumers

In addition, we assume that some busses in the distribution network might also be connected to some (traditional) passive consumers that do not have storage nor dispatchable units, and do not trade with other prosumers. Let us denote the set of such passive consumers by . For each passive consumer , its power demand is balanced conventionally, namely, by importing power from the main grid. Nevertheless, these passive loads will play a role in the trading process between prosumers and main grid, and in the power-balance equations of the physical network.

Ii-B Modelling the P2P trading

In this section, we present the cost and constraints of bilateral tradings between prosumers.

Power traded with neighbors

Recall that each prosumer has a set of trading partners denoted by . The corresponding cumulative trading cost is


where is the power that prosumer trades with prosumer , is the per-unit cost of trading [11], and is a tariff imposed by the DNO for using the network [2]. In practice, the parameters can be agreed through a bilateral contract [28] or model taxes to encourage the development of certain technologies [11]. Furthermore, for each P2P trade it must hold that


where denotes the maximum power can be traded with neighbor . Equations (8b), commonly known as reciprocity constraints [28], impose the agreement on the power trades.

Power traded with the main grid

Let be the power prosumer imports from the main grid at time . As in [1], we assume that the electricity unit price at each time step depends on the total consumption and is defined as a quadratic function, i.e.,


where and denotes the aggregate active and passive load on the main grid, respectively, i.e.,


and is a constant. Therefore, the cost incurred by prosumer over for trading with the main grid is


where and . Finally, we bound the aggregative loads (10) as follows:


where denote the upper and lower bounds. Typically, the latter is positive to ensure a continuous operation of the main generators that supply the main grid.

Ii-C Physical constraints

To ensure that the solutions to our decentralized market design are not only economically-efficient but also operationally-safe and reliable for the entire system, we impose the physical constraints of the electrical network, namely, power-flow-related constraints.

Firstly, recall that is a graph representation of the physical electrical network that connects the prosumers. We denote by the set of neighbouring busses of bus , whereas we denote by and the set of prosumers and passive consumers that are connected to bus , respectively. Additionally, we denote the set of busses that is connected to the main grid by .

Secondly, we define decision variables, for each bus , which are used to define the physical constraints. Denote by and the voltage magnitude and angle over . Moreover, denotes the real power exchanged between bus and the main grid, whereas and , for each , denote the real and reactive powers of line over , respectively.

We consider a linear approximation of power-flow equations, which is standard in the literature of P2P markets, e.g., [33, 21]. Specifically, for each bus , it must hold that


which indicates local power balance of bus , similarly to (6) although now it relates power generation, consumption and line powers. Moreover, it must hold that


which represent the power flow equations of line from the perspective of bus , with and denoting the susceptance and conductance, respectively, of line . Note that by (14a) and (14b), for each pair , it holds that and .

Furthermore, we also impose reliability constraints for each bus , i.e.,


where (15a) represents the line capacity constraint at each line, with maximum capacity of line denoted by , and (15b)-(15c) represent the bounds of the voltage phase angles and magnitudes, respectively, with denoting the minimum and maximum phase angles and denoting the minimum and maximum voltage magnitude. Note that, when linearizing the power flow equations, we take one of the busses as reference bus. Without loss of generality, we suppose the reference is bus and assume .

Finally, related with the power exchanged with the main grid, we impose the following constraints:


where (16a) is imposed by definition that the busses that are not directly connected with the main grid do not exchange power with the main grid, whereas (16b) ensures that the power traded by the prosumers with the main grid (in the trading network) corresponds to the power exchanged between the whole distribution network and the main grid.

Iii A Distributed Market-clearing Mechanism

By letting the decision variables related to the physical constraints handled by a DNO (agent in the game), the P2P market model can be compactly written as the problem of finding in (1), for all , where the decision variable is defined as

the cost function is defined as


whereas222Here, we assume that the DNO does not have preferences on the outcome, provided that it is a feasible solution for the network. ; the local action set is


and finally, the set of coupling constraints is

Remark 1

Our definitions of , and satisfy Assumption 1. Moreover, these definitions can be expanded by incorporating additional cost terms, for example, related to the degradation of storage units and constraints (e.g. ramping constraints of dispatchable generation units), as long as Assumption 1 remains satisfied.

From a game-theoretic perspective, the inter-dependent optimization problems in (1) constitute a generalized game [13] and a set of decisions that simultaneously satisfy (1), for all , corresponds to a GNE [13, § 1]. In other words, a set of strategies is a GNE if no agent (prosumers and DNO) can reduce its cost function by unilaterally changing its strategy to another feasible one, i.e., s.t. .

Note that, the cost functions in (17) are not influenced by some specific prosumers, but only by the local decisions and by the aggregative quantity in (10), namely, the active load on the main grid. Therefore, for each agent , we can define a function such that


Games with such special structure are known as aggregative games [17, 8], and have received intense research interest, within the operations research and the automatic control communities [23, 9, 6, 14, 10].

Iii-a Nash Equilibrium Seeking in Aggregative Games

Several semi-decentralized and distributed algorithms are available in the literature to find a solution of the generalized aggregative game in (1), e.g. [23, 9, 6, 14, 10]. Among these methods, semi-decentralized ones [9] have been shown to be particularly efficient in terms of convergence speed.

Here, we tailor Algorithm 6 in [9] for our P2P market game in (1). Before presenting the algorithm, let us introduce, for each prosumer , the dual variable , for all , which are associated with the trading reciprocity (8b). For the DNO, we introduce , , which are dual variables associated with the grid constraints (12) and (16b), respectively; moreover, for all , let us introduce , namely, the dual variable associated with the power balance constraint on bus (13).

The proposed market-clearing algorithm is summarized in Algorithm 1 and its information flow is illustrated in Fig. 2. In the following proposition, we state the global convergence of Algorithm 1 to a variational333Variational GNEs (v-GNEs) are a special subclass of GNEs that enjoys the property of “economic fairness”, namely, the marginal loss due to the presence of the coupling constraints is the same for each agent, and coincides with the solutions to a specific variational inequality [18]. GNE of the P2P market game in (1).

Proposition 1

The following statements hold:

  1. There exists a variational GNE of the game (1), with cost functions and constraints sets defined in (17)-(19).

  2. The sequence generated by Algorithm 1 converges to a variational GNE of (1).

Fig. 2: Information flow of Algorithm 1 for each prosumer (top boxes) and the DNO (bottom box).
2:     Prosumers. For all : set , , ; , , .
3:     DNO. Set , , , , ; , , , , .
4:end initialization
5:While convergence is not achieved do:
6:     for all  do
7:          Prosumer routine
8:               primal update generation, storage, main grid, trades
9:                     auxiliary vector
10:                     quadratic programming
11:               end
12:               communication (to DNO and trading partners)
13:                     auxiliary vector: local load unbalance
14:                     forward to DNO
15:                    for all prosumer  do

forward trade estimate to prosumer

17:                    end for
18:               end communication
19:               dual update reciprocity constraints
20:                    for all  do
21:                          auxiliary vector
22:                          reflected dual ascent
23:                    end for
24:               end
25:          end prosumer routine
26:     end for
27:     DNO routine
28:          primal update angels, voltages, power on grid and buses
29:                auxiliary vector
30:                solved via Algorithm 2 (see Appendix)
31:          end
32:          aggregation update
33:                aggregate active load, eqn. (10)
34:                aggregate grid-to-buses power
35:          end
36:          dual update
37:                auxiliary vector
38:                grid constraints
39:               for all buses  do
40:                     auxiliary vector
41:                     local power balance of bus
42:               end for
43:                auxiliary vector
44:                grid-to-buses constraints
45:          end
46:          communication (broadcast to all prosumers)
48:               for all buses  do
49:                     only to prosumers on bus
50:               end for
51:          end communication
52:     end DNO routine
53:end while
Algorithm 1 Distributed P2P Markets Clearing Mechanism
Remark 2

The main properties of the proposed market-clearing mechanism (Algorithm 1) are listed below:

  1. The step sizes are fully-uncoordinated, i.e., they can differ across the prosumers. Moreover, each prosumer can set the local step sizes based on local information only (see lines 2–3);

  2. Algorithm 1 is semi-decentralized, i.e., the prosumers rely on a reliable central coordinator (i.e., the DNO) that gathers local variables in aggregative form and then broadcasts signals, such as dual variables, to all prosumers, see Figure 2. Such communication architecture is particularly efficient to design fast and scalable equilibrium seeking algorithms in games [9];

  3. The local primal update of each prosumer (lines: 8–11) involves the solution of a quadratic programming problem444Up to a fairly-standard reformulation of the absolute value term in (7)., for which very efficient solvers are available, e.g. [29];

  4. The primal update of the DNO (lines: 26–29) requires projecting onto , which is a convex but nonlinear set. This operation can be computationally expensive if naively solved. Therefore, we propose and use an efficient ad-hoc algorithm to calculate based on the celebrated Douglas–Rachford splitting for monotone inclusion problems [4, §. 26.3], [5, § 4.3].

Iv Numerical Studies

We perform an extensive numerical study on the IEEE 37-bus distribution network to validate the proposed game-theoretic market design and market-clearing algorithm. Specifically: (a) we evaluate the importance of having physical constraints in the model; (b) we evaluate the economical benefits of trading; (c) we show how storage units owned by prosumers might affect power consumptions; and (d) we test the scalability of the proposed algorithm. All the simulations are carried out in Matlab and use the OSQP solver [29] for solving the quadratic programming problems.

In all simulations555The codes and data sets used for all simulations are available at https://github.com/ananduta/P2Penergy., we consider heterogeneous networks, where the power demand profile of a prosumer or passive user is either that of single household, multiple household, restaurant, office, hospital, or school. Moreover, some prosumers may have solar-based power generation. The demand and solar-based generation profiles are based on [16]. We also arbitrarily select a set of prosumers to own dispatchable generation units with different sizes and to own homogeneous storage units. We randomly generate the trading networks and place each prosumer and passive user in one of the busses of the IEEE 37-bus network.

Some of the default cost parameters are set as in [1], i.e., , , for all , , , for all , and , whereas the trading cost parameters , for all , and . The parameter is set larger than to encourage trading between prosumers with and without dispatchable units, but is smaller than the average unit-price of importing power from the main grid. Note that, in some simulations, we vary these cost parameters.

Iv-a Achieving operationally-safe solutions

In the first simulation study, we compare the solutions obtained from solving a P2P market model with and without capacity constraints (15a). We specifically create an extreme case with prosumers, where the load of prosumer (see Figure 3) is very high. We solve both market designs using Algorithm 1. Figure 3 shows the resulting power-line saturations between busses for both designs. Some equilibrium solutions of the P2P market cause overcapacity in some lines when capacity constraints (15a) are not taken into account in the model, as illustrated in Figure 3 (b).

(a) With physical constraints
(b) Without physical constraints
Fig. 3: Power line capacities of the physical network. The solutions of the P2P market might cause overcapacity in some lines of the physical network when capacity constraints (15a) are not taken into account.

Iv-B Peer-to-Peer trading

In this section, we evaluate whether energy trading is economically beneficial for the prosumers. To this end, we generate a network of 50 prosumers and consider two scenarios: (a) where trading is not allowed, i.e., in (8a); (b) where trading is allowed with , and the default cost parameters are homogeneous. The other parameters of the network are kept constant in both scenarios. Figure 4 shows the individual costs difference between the equilibrium configurations of the market designs with (a) and without P2P tradings (b). In particular, all prosumers gain economical benefits when they can trade.

Fig. 4: Total cost improvement (€) of each prosumer by trading ().
Fig. 5: Aggregated P2P trading for different cost coefficients ( in €/kW).
Fig. 6: Aggregated P2P trading for different penalty coefficients ( in €/kW).

Then, we evaluate the sensitivity of the total traded power with respect to the trading cost parameter and the trading tariff, . Figure 5 shows that must be set appropriately to maximize trading among prosumers. In other words, when is either too high or low, trading is less attractive. On the other hand, the higher the tariff is, the less power is traded, as shown in Figure 6. Therefore, the DNO may adjust this tariff to encourage or discourage trading in the network. Discouraging trading might be needed when the capacity of the network is close to its limit.

Iv-C The impact of storage units

In this set of simulations, we investigate the advantages of distributed storage in the network. We generate a test case of 50-prosumer network and consider two extreme scenarios: (a) no prosumers own storage units and (b) all prosumers own storage units. Furthermore, we also allow some of the prosumers to own distributed generation units. Figures 7-8 summarize the simulation results. From Figure 7, we can see how the storage units help in shaving the peak of total power imported from the main grid and locally generated by distributed generators.

Interestingly, the trading between prosumers is also affected, as shown by the top plot of Figure 8. From this plot, we observe that the existence of storage units reduce the total power traded during the peak hours as the prosumers have reserved energy in their storages. Note that the prosumers charge their storage units during the first off-peak hours by buying energy from the main grid and/or from other prosumers that own dispatchable generation units (see the first six hours of the bottom plot of Figures 7 and those of the top plot of Figure 8). Additionally, the bottom plot of Figure 8 shows the cost difference between both scenarios. There, we observe that most of the prosumers gain economical benefits by owning a storage unit. The ones that have positive cost differences are those that also own dispatchable generation units. They gain more profit in scenario (a) since the prosumers that do not own any active components prefer to buy energy from their trading partners that own dispatchable generation units than importing from the main grid. This preference becomes less attractive when these buying prosumers own a storage unit.

Fig. 7: Incorporating storage units causes a peak-shaving effect on the aggregate demand on the main grid.
Fig. 8: Aggregated P2P trading (top plot), and individual cost difference (bottom plot), in scenarios (a) and (b).

Iv-D Scalability of the algorithm

Finally, we perform a scalability test for the proposed algorithm. Specifically, we evaluate the convergence speed, in terms of the total number of iterations required to meet a predetermined stopping criterion, when the size of the population of prosumers and the connectivity of the trading network (the number of trading links) grow. We carry out two sets of simulations. For the former, we consider five different values of and a fixed connectivity level of and we run ten Monte Carlo simulations for each , whereas in the latter, the connectivity of the trading network of prosumers varies in the range , where connectivity means that the trading network is a complete graph. Similarly, we also run ten Monte Carlo simulations for each connectivity value. Figure 9 shows the numerical results. We can see that Algorithm 1 suitably scales with respect to both the number of prosumers and the connectivity level of the trading network. These results highlight that our algorithm is suitable to be applied to large-scale systems.

Fig. 9: Total number of iterations for convergence of Alg. 1 vs number of prosumers (top) and the connectivity level (the number of trading links) (bottom).

V Conclusion

Energy management and peer-to-peer trading in future energy markets of prosumers can be formulated as a generalized aggregative game, where the network operator is an extra player in charge of handling the network operational constraints. A provably-convergent operationally-safe distributed market-clearing mechanism is obtained by solving the game with a Nash equilibrium seeking algorithm based on the proximal-point method. Numerical studies show that the computational complexity of the proposed mechanism is independent of the prosumer population size, and suggest that active participation in the market is economically advantageous both for prosumers and network operators.

Future research directions include: efficiently incorporating non-linear convex approximation of power flow in the algorithm; handling the physical constraints in a fully-distributed manner, i.e., without the action of a network operator; and dealing with uncertainties in the model, e.g., renewable energy production, as well as those from information exchange processes required by our algorithm.


  • [1] I. Atzeni, L. G. Ordóñez, G. Scutari, D. P. Palomar, and J. R. Fonollosa (2013) Demand-side management via distributed energy generation and storage optimization. IEEE Transactions on Smart Grid 4 (2), pp. 866–876. Cited by: §II-A, §II-A, §II-B, §IV.
  • [2] T. Baroche, F. Moret, and P. Pinson (2019) Prosumer markets: a unified formulation. In Proceedings of 2019 IEEE Milan PowerTech, pp. 1–6. Cited by: §I, §II-B.
  • [3] T. Baroche, P. Pinson, R. L. G. Latimier, and H. B. Ahmed (2019) Exogenous cost allocation in peer-to-peer electricity markets. IEEE Transactions on Power Systems 34 (4), pp. 2553–2564. Cited by: §I.
  • [4] H. H. Bauschke and P. L. Combettes (2011) Convex analysis and monotone operator theory in hilbert spaces. Vol. 408, Springer. Cited by: item iii, §-B, §-B, §I, item iv, Assumption 1.
  • [5] H. H. Bauschke and V. R. Koch (2015) Projection methods: swiss army knives for solving feasibility and best approximation problems with halfspaces. Contemporary Mathematics 636, pp. 1–40. Cited by: §-B, item iv.
  • [6] G. Belgioioso, A. Nedich, and S. Grammatico (2021) Distributed generalized nash equilibrium seeking in aggregative games on time-varying networks. IEEE Transactions on Automatic Control 66 (5), pp. 2061 – 2075. Cited by: §I, §III-A, §III.
  • [7] G. Belgioioso, W. Ananduta, S. Grammatico, and C. Ocampo-Martinez (2020) Energy management and peer-to-peer trading in future smart grids: a distributed game-theoretic approach. In 2020 European Control Conference (ECC), pp. 1324–1329. Cited by: §I, §I.
  • [8] G. Belgioioso and S. Grammatico (2017) On convexity and monotonicity in generalized aggregative games. IFAC-PapersOnLine 50 (1), pp. 14338–14343. Cited by: item iii, §III.
  • [9] G. Belgioioso and S. Grammatico (2020) Semi-decentralized generalized nash equilibrium seeking in monotone aggregative games. arXiv preprint arXiv:2003.04031. Cited by: item i, item ii, item iii, item iv, §-A, §-A, §-A, §I, item ii, §III-A, §III-A, §III.
  • [10] M. Bianchi, G. Belgioioso, and S. Grammatico (2020) Fast generalized Nash equilibrium seeking under partial-decision information. arXiv preprint arXiv:2003.09335. Cited by: §I, §III-A, §III.
  • [11] H. L. Cadre, P. Jacquot, C. Wan, and C. Alasseur (2020) Peer-to-peer electricity market analysis: from variational to generalized Nash equilibrium. European Journal of Operational Research 282 (2), pp. 753–771. Cited by: §I, §II-B, §II.
  • [12] S. Cui, Y. Wang, Y. Shi, and J. Xiao (2020) A new and fair peer-to-peer energy sharing framework for energy buildings. IEEE Transactions on Smart Grid 11 (5), pp. 3817–3826. Cited by: §I.
  • [13] F. Facchinei and C. Kanzow (2010) Generalized nash equilibrium problems. Annals of Operations Research 175 (1), pp. 177–211. Cited by: §III.
  • [14] D. Gadjov and L. Pavel (2020) Single-timescale distributed GNE seeking for aggregative games over networks via forward-backward operator splitting. IEEE Transactions on Automatic Control. Note: early access at https://doi.org/10.1109/TAC.2020.3015354 Cited by: §I, §III-A, §III.
  • [15] C. A. Hans, P. Braun, J. Raisch, L. Grüne, and C. Reincke-Collon (2019) Hierarchical distributed model predictive control of interconnected microgrids. IEEE Transactions on Sustainable Energy 10 (1), pp. 407–416. Cited by: §II-A, §II-A.
  • [16] JASM data platform. Note: Accessed: 25-11-2020 External Links: Link Cited by: §IV.
  • [17] M. K. Jensen (2010) Aggregative games and best-reply potentials. Economic theory 43 (1), pp. 45–66. Cited by: §III.
  • [18] A. A. Kulkarni and U. V. Shanbhag (2012) On the variational equilibrium as a refinement of the generalized nash equilibrium. Automatica 48 (1), pp. 45–55. Cited by: footnote 3.
  • [19] Y. Liu, L. Wu, and J. Li (2019) Peer-to-peer (P2P) electricity trading in distribution systems of the future. The Electricity Journal 32 (4), pp. 2–6. Cited by: §I.
  • [20] D. K. Molzahn, F. Dörfler, H. Sandberg, S. H. Low, S. Chakrabarti, R. Baldick, and J. Lavaei (2017) A survey of distributed optimization and control algorithms for electric power systems. IEEE Transactions on Smart Grid 8 (6), pp. 2941–2962. Cited by: §II-A.
  • [21] F. Moret, A. Tosatto, T. Baroche, and P. Pinson (2020) Loss allocation in joint transmission and distribution peer-to-peer markets. IEEE Transactions on Power Systems. Note: early access at https://doi.org/10.1109/TPWRS.2020.3025391 Cited by: §I, §I, §II-A, §II-C, §II, §II.
  • [22] T. Morstyn, A. Teytelboym, and M. D. McCulloch (2019) Designing decentralized markets for distribution system flexibility. IEEE Transactions on Power Systems 34 (3), pp. 2128–2139. Cited by: §I, §II.
  • [23] D. Paccagnan, B. Gentile, F. Parise, M. Kamgarpour, and J. Lygeros (2019) Nash and Wardrop equilibria in aggregative games with coupling constraints. IEEE Transactions on Automatic Control 64 (4), pp. 1373–1388. Cited by: §I, §III-A, §III.
  • [24] Y. Parag and B. K. Sovacool (2016) Electricity market design for the prosumer era. Nature energy 1 (4), pp. 1–6. Cited by: §I.
  • [25] A. Paudel, L. P. M. I. Sampath, J. Yang, and H. B. Gooi (2020) Peer-to-peer energy trading in smart grid considering power losses and network fees. IEEE Transactions on Smart Grid 11 (6), pp. 4727–4737. Cited by: §I.
  • [26] J. Qin, R. Rajagopal, and P. Varaiya (2018) Flexible market for smart grid: coordinated trading of contingent contracts. IEEE Transactions on Control of Network Systems 5 (4), pp. 1657–1667. Cited by: §I, §II.
  • [27] E. Sorin, L. Bobo, and P. Pinson (2019) Consensus-based approach to peer-to-peer electricity markets with product differentiation. IEEE Transactions on Power Systems 34 (2), pp. 994–1004. Cited by: §I, §II-A.
  • [28] T. Sousa, T. Soares, P. Pinson, F. Mo