You are on page 1of 12

EAI Endorsed Transactions

on Energy Web Research Article

Increasing photovoltaic self-consumption with game


theory and blockchain
Matthieu Stephant1,∗ , Dhaker Abbes1 , Kahina Hassam-Ouari2 , Antoine Labrunie3 , Benoît
Robyns1
1 Univ.Lille, Arts et Metiers Institute of Technology, Centrale Lille, Junia, ULR 2697 - L2EP, F-59000 Lille, France
2 HEI,Junia, 13 Rue de Toul, 59000, Lille, France
3 Greenbirdie, 13 rue Raymond Losserand, 75014 Paris, France

Abstract

INTRODUCTION: This paper presents a distributed approach to optimise self-consumption on a local energy
community containing photovoltaic generators, electric vehicles, loads and a storage system.
OBJECTIVES: The goal is to maximise energy sharing between users while preserving the indivual objectives
of each user.
METHODS: Game theory is employed to model users’ behavior and preferences. A distributed algorithm
is used to solve the optimisation problem. In addition, a physical model of the grid is built to verify if
the solutions respect grid constraints. Finally, a private blockchain environnement is deployed to concretely
implement this distributed framework with a smart contract.
RESULTS: It is shown that the proposed approach effectively leads to an increase of self-consumption rate on
the local grid.
CONCLUSION: The proposed distributed framework, combining game theory and blockchain, shows real
potential to improve energy sharing on energy communities.

Received on 17 July 2020; accepted on 22 October 2020; published on 27 October 2020


Keywords: Photovoltaic self-consumption, Game theory, Blockchain, Energy communities
Copyright © 2020 Matthieu Stephant et al., licensed to EAI. This is an open access article distributed under the terms of
the Creative Commons Attribution license, which permits unlimited use, distribution and reproduction in any medium
so long as the original work is properly cited.
doi:10.4108/eai.27-10-2020.166770

1. Introduction panels. This situation corresponds to self-consumption.


The overall electrical grid can benefit from self-
Due to environmental concerns, many countries
consumption behaviour with a decrease of energy flows
have promoted the development of photovoltaic (PV)
on the lines, leading to a decrease of investments costs
generators through diverse financial incentives, leading
[3]. Self-consumption rate is defined as the part of
to an increase of the worldwide PV capacity from about
the electricity produced by the PV generators that is
10 GWp in 2008 to more than 500 GWp at the end of
locally consumed over the total local production, while
2018 [1]. PV generators differ from traditional power
self-production refers to the part of the total energy
plants: their capacity is much lower so they are spread
consumption that is locally produced [4].
on large geographical areas and often connected to
low or medium voltage grid. For example, small PV France, Sweden and the Netherlands now also
generators of less than 4 kWp counted for 21% of allow collective self-consumption, in which a group
the total PV capacity installed in the UK in 2016 [2]. of consumers shares the local PV production on the
As a result, new uses of electricity networks appear low voltage grid over a small area, creating a local
with the development of PV generators. The continuous energy community [5]. The idea is to benefit from the
decrease of PV installation costs encourages consumers flexibility of all the consumers in order to maximise the
to produce their own electricity from rooftop solar self-consumption and self-production rates. However,
collective self-consumption projects and local energy
communities are still at an early stage and a large-scale
∗ Corresponding author. Email: matthieu.stephant@yncrea.fr development requires a new framework to optimise the

EAI Endorsed Transactions on


1
Energy Web
05 2021 - 07 2021 | Volume 8 | Issue 34 | e1
M. Stephant et al.

self-consumption rate and thus to make collective self- In [12], authors introduce a bargaining game to
consumption attractive for all participants. manage a micro-grid both in connected or islanded
In the objective of developing collective self- mode, introducing a balance between the different
consumption frameworks, research is required to objective functions. The optimisation problem is solved
develop novel energy management strategies in order to with a distributed gradient algorithm, leading in a
improve energy exchanges and take advantage of load global costs decrease for the micro-grid.
flexibility at a local scale. An energy community can Some articles propose peer-to-peer (P2P) energy
contain diverse types of users, including PV producers, exchanges mechanisms based on game theory. For
tertiary or residential consumers, electric vehicles, stor- example, [13] introduces a P2P structure in order
age systems. In this perspective, distributed methods to minimise the electricity costs among consumers.
for energy management are more relevant than tra- A relaxed consensus+ algorithm is used to solve
ditional centralised computation. Indeed, centralised the optimisation problem in a distributed way, with
methods need to collect all data about the system, limited exchanges of information between users. In
including physical parameters of the lines, but also [14], authors use a combination of 3 different games to
consumption data of users. On the contrary, distributed maximise the total welfare inside an energy community.
approaches consist of several sub-problems that can be Proposed approach ensures economic benefits for all
solved in parallel with a limited number of informa- users.
tion. Consequently, distributed methods can reduce the As mentioned by [10], game theory is a promising
need of extensive communication network and improve tool for energy management, but lacks of practical
robustness in case of failure of one agent [6]. But most implementation. In this perspective, the application
importantly, distributed methods guarantee privacy of of blockchain technology to support P2P structures
users data and consumption habits [7]. In addition, is currently a topic of growing interest, as this
distributed methods enable to build user centred strate- technology shows promising features for collective
gies, that take into account users habits and let them act self-consumption and energy sharing. Blockchain
as they want [8]. is basically a distributed and secured database,
Therefore, the question this article deals with is: how supporting the execution of distributed algorithms
to practically optimise energy exchanges on a local called smart contracts [15]. Mengelkamp et al. propose
energy community in a distributed way, taking into a methodology to design blockchain P2P markets in
account users preferences ? order to improve energy sharing [16]. In [17] and [18],
To answer this question, an innovative distributed authors use blockchain to implement local markets with
approach is proposed to improve the self-consumption an auction scheme, where producers and consumers
and self-production rates on a local energy community. publish demand offers and sell offers with smart
The study is based on the energy community of Lille contracts, and blockchain automatically matches the
Catholic University, France, which combines PV gener- offers. In [19], the authors present a method to solve
ators, a battery, charging stations for electric vehicles an optimal power flow problem in micro-grid networks.
(EV) and tertiary buildings. A global optimisation prob- The global problem is first divided in local problems
lem is defined to increase the energy exchanges inside and then blockchain aggregates all the local solutions to
the energy community. In order to take into account the provide the overall optimum. These examples show that
preferences of each participant, this global problem is blockchain has the potential to implement distributed
decomposed in several smaller local problems, using approaches for energy sharing among communities and
game theory. Game theory is gaining popularity in enables to get rid of a central agent.
the literature as a distributed optimisation method for However, two lacks appear from a review of the
smart grid, as it reflects its distributed and heteroge- current literature. Firstly, most studies consider utility
neous nature [9]. In [10], authors give an overview of functions that take into account only electricity costs.
the potential applications of game theory for the grid. Yet to build real user centred methods, it is necessary
They underline that game theory is a promising tool as to include users preferences about their consumption.
it models users behaviour and thus can be used to build Authors in [20] consider such preferences about the
users centred tools. Game theory is used to decompose origin of electricity for prosumers on a local grid, but
an optimisation problem into several sub-problems, but they use the same utility function for all users and do
it needs to be combined with distributed algorithms. not include other users such as electric vehicles, storage
Nguyen et al. use game theory for demand side system and pure consumers. Secondly, [9] underlines
management in a system containing storage devices the necessity to include physical constraints of the
[11]. The authors use a proximal decomposition grid network in the energy strategy, and this point is
algorithm to solve the problem. Results show a decrease rarely present in current studies. The present article
of energy costs and of the load peak compared to a aims to answer to these lacks, by building a framework
centralised approach. including individual goals for diverse kinds of users,

EAI Endorsed Transactions on


2
Energy Web
05 2021 - 07 2021 | Volume 8 | Issue 34 | e1
Increasing photovoltaic self-consumption with game theory and blockchain

and by proposing a practical implementation of this to reach their individual objectives. Second, game
framework. theory enables to take into account not only cost
This paper presents a distributed strategy for energy objectives, but also other considerations like comfort
management on a local energy community. Users or the will to consume locally produced electricity
preferences are taken into account to build a real [22]. This is interesting as few studies integrate non
user centred method. A blockchain implementation is economic objectives in their energy strategy [20].
proposed for real development. To verify the relevance Finally, game theory is interesting because each agent
of this work and take into consideration the physical has to solve a simpler problem, in comparison to the
constraints of the power grid, the results of the global optimisation problem.
proposed optimisation framework are tested on a
physical model of the grid, including real production 2.1. Problem formulation
and consumption data, in order to guarantee that the
A non-cooperative game is defined, in which each
real grid can support the energy flows between the
element tries to reach its personal objectives by
different users.
adjusting its production or consumption profile,
The novelty of this work consists in the combination
without any coordination with the other elements.
of a theoretical mathematical framework with a
Parameters for preferences are introduced so that each
practical implementation to build a concrete and fully
user is able to adjust its objective function (called
distributed method for increasing energy exchanges in
utility function) according to its own preferences.
a local energy community. Different complementary
Such weighting coefficients are classically used in
tools are used to form a complete framework (game
multi-objective optimisation [23]. These preferences
theory, physical model of the grid and blockchain). The
can represent the cost paid (or earned) for electricity
distributed nature of the grid and of the blockchain
consumption (or production), the users’ comfort, or
is exploited to get rid of a central optimisation agent
the will to consume the local PV production. The
and let the users optimise their consumption or
benefit of such an approach is that it only requires
production profiles according to their own individual
that the participants locally optimise their behaviour,
goals. Moreover, the test of the proposed approach on
without any cooperation. Thus, it does not require
a physical model of a real grid, provided with real
a central agent to coordinate all the participants.
production and consumption data, shows the feasibility
As mentioned previously, this situation reflects the
of such an approach.
reality of a local grid where participants have limited
This paper is divided as follows. In the second
knowledge about the structure of the grid and do not
part, the optimisation problem and the game theory
necessary communicate between them to meet their
framework are introduced. The third part details how
goals. Thus, a game is introduced with N players, which
the three tools (optimisation algorithm, physical model
are the N elements of the grid (loads, PV generators,
of the grid, blockchain) are combined together. Then,
battery, electric vehicles charging stations). The game
some results on simple scenarios are presented.
is defined by the set G = {N , (Si )i∈N , (Ui )i∈N }, where
Si is the strategy set of the player i and Ui its utility
2. Optimisation framework using game theory function. Here, the strategy set is defined as Si = {xi },
where xi is the production or consumption profile of
A local university grid is considered as case study:
the user. The users adjust their profile xi one day ahead,
it contains loads (buildings), a storage system (an
between ti and tf , with a time step ∆t. So, for each
electrochemical battery), rooftop PV generators and
user i, xi (t) = Pi (t) ∗ ∆t, with Pi (t) the average power
several charging stations for electric vehicles. There is
consumed or produced between t and t + ∆t. The price
a connection point to the distribution grid. Each actor
of electricity (written c in the following) is supposed to
can adjust its energy consumption or production profile
be imposed by the distribution grid.
in order to maximise its own satisfaction. Thus, the goal
In the rest of the article, xi > 0 corresponds to an
of the global optimisation problem is to maximise the
energy consumption and xi < 0 to a production.
overall satisfaction of users, while a global constraint
links all users.
More specifically, game theory is chosen, because
2.2. Utility functions
it defines a mathematical framework for distributed This section details the utility function used for each
optimisation in which each element of the system aims kind of user. The utility function, or objective function,
to optimise its own individual situation [21]. Game mathematically translates the goals of the player
theory is a relevant method in this case for several and measures user’s satisfaction. The players tend
reasons. First, it models a situation where players to maximise their utility function by adjusting their
are in competition. This reflect the case of a local strategy, here their energy consumption or production
energy community where players are in competition profile.

EAI Endorsed Transactions on


3
Energy Web
05 2021 - 07 2021 | Volume 8 | Issue 34 | e1
M. Stephant et al.

EV user. For an EV user connected to the charging


discharge,max
station, the following function is proposed : 0 ≥ Pb (t) ≥ Pb (7)
Moreover, similarly to the EV, the SOC has
UEV (xEV (t)) = −α1 ln(1 + xEV (t)) − α2 c(t)xEV (t) boundaries:
f orecast
− α3 (abs(xP V (t)) − xEV )2 (1) SOCbmin ≤ SOCb (t) ≤ SOCbmax (8)

The term α1 ln(1 + xEV (t)) represents the objective Finally, at the end of the day, the SOC should reach
to charge the vehicle. The natural logarithm function the intial value, in order to form a cycle:
is classically used for energy buyers as it models
users’ satiety [17]. With the term α2 c(t) xEV (t), the SOCb (t = tf ) = SOCb (t = ti ) (9)
user aims to minimise the cost to pay. Then the term
f orecast PV generators. PV generators simply tend to maximise
α3 (abs(xP V (t)) − xEV )2 is introduced to represent
the objective to preferentially use the local PV their production, because their marginal production
production. cost is equal to zero [19]. So their goals are to optimise
The weighting coefficients α1 , α2 and α3 are used their payoff, and to limit the production curtailment.
so that each user can adjust its preferences. These Therefore, the following utility function is written with
coefficients are commonly used in the literature the two respective terms:
for multi-objective optimisation to combine different
objectives into a unique objective function. These
coefficients should be positive and verify: α1 + α2 + UP V (xP V (t)) = −γ1 c(t)xP V (t)−
α3 = 1 [23]. f orecast
γ2 (xP V (t) − xP V (t))2 (10)
For each EV, some constraints need to be taken into
consideration. According to the current situation of the
The positive coefficients γ1 and γ2 model the user’s
case study, discharge is not allowed and the charging
choice, and we impose γ1 + γ2 = 1.
power is limited by the maximum power of the charging
PV generators can only curtail their production
station:
from the maximal production, which is the forecasted
EV production one day ahead:
0 ≤ PEV (t) ≤ Pmax (2)
Moreover, the state of charge (SOC) has upper and f orecast
0 ≥ xP V (t) ≥ xP V (t) (11)
lower bounds, which are characteristics of the vehicle
battery: Loads. Loads can have some flexibility (written f ),
min max which means that they can decrease their consumption
SOCEV ≤ SOCEV (t) ≤ SOCEV (3) compared to their forecasted consumption profile
f orecast
In addition, the user specifies a minimal SOC value xl . However, to ensure a minimal level of comfort,
SOCEV
required
to be reached at the end of the charging the total energy consumed at the end of the day should
time, in order to guarantee a minimum level of comfort: be equal to the forecasted consumption for the entire
day. In other words, loads can delay their consumption
SOCEV (t = tdeparture ) ≥ SOCEV
required
(4) but do not globally decrease it. Then the objectives are
to minimise the cost paid for electricity, to consume
Battery. The battery can have two objectives: first to the local PV production and to minimise the change of
maximise its income, and second to maximise the the forecasted consumption, that would represent a loss
consumption of the local PV production. Thus, the of comfort for the user. Therefore, inspired by [12] the
following utility function is used: following utility equation is used, with a quadratic term
to model comfort:
f orecast f orecast
Ub (xb (t)) = β1 c(t)xb (t) − β2 (abs(xP V (t)) − xb (t))2 Ul (xl (t)) = −δ1 c(t)xl (t) − δ2 (xl (t) − xl (t))2
(5) f orecast
− δ3 (abs(xP V (t)) − xl (t))2 (12)
Here also, the positive coefficients β1 and β2 are used
to specify the user’s preferences with β1 + β2 = 1. Each user can specify its preferences by adjusting δ1 ,
The charging power and discharging power of the δ2 and δ3 (with δ1 + δ2 + δ3 = 1).
battery are limited: The constraint on the flexibility f imposes:
charge,max expected expected
0 ≤ Pb (t) ≤ Pb (6) xl (t)(1 − f ) ≤ xl (t) ≤ xl (t)(1 + f ) (13)

EAI Endorsed Transactions on


4
Energy Web
05 2021 - 07 2021 | Volume 8 | Issue 34 | e1
Increasing photovoltaic self-consumption with game theory and blockchain

Moreover, as mentioned previously, the total energy To solve the global problem (16) under the local
consumed in one day should not change, so: and global constraints, a distributed algorithm is
required. Among the diverse algorithms available in
tf tf the literature, ADMM (Alternating Direction Method
f orecast
X X
xload (t) = xload (t) (14) of Multipliers) is a good candidate. This distributed
t=ti t=ti algorithm has been notably used in [19] and [20],
and is well suitable for energy exchanges frameworks
2.3. Nash equilibrium [25]. The ADMM algorithm is based on the Lagrangian
decomposition and enables to divide the global problem
An important concept in game theory is the Nash into several sub-problems. In practice, all the users
equilibrium, a situation in which no player can increase optimise their own utility function while respecting
its utility by being the only one to change its strategy their own local constraints, and then a penalty
[9]. Mathematically, if X ∗ = {x1∗ , ..., xN ∗
} represents the parameter ρ is calculated to force the users to respect
strategy of the players at the Nash equilibrium and the global constraint, as illustrated on Figure 1.
x−i = {x1 , ..., xi−1 , xi+1 , ..., xN } the strategy of all players The ADMM converges towards a final state, which
except player i, the Nash equilibrium corresponds to: corresponds to the Nash equilibrium of the system [26].
More precisely, all the steps are described in
Ui (xi∗ , x−i
∗ ∗
) ≥ Ui (xi , x−i ), ∀xi ∈ Si (15) Algorithm
P 1. The variable x is the mean of all xi :
x = N1 N i=1 xi .
This Nash equilibrium is important as it guarantees
that when all players individually maximise their utility Algorithm 1 ADMM algorithm
function, the global system reaches an equilibrium
point. 1: while ||r k ||2 > primal and ||sk ||2 > dual do
ρ
All the utility functions Ui specified in this article 2: xik+1 ← argminxi (Ui (xi ) + 2 ||xi − xik + xk − zk + u k ||22 )

are concave and continuous in xi . Moreover, all the 3: zk+1 ← argminz (g(N z) + 2 ||z − u k − xk+1 ||22 )
constraints impose that for each player, the strategy set 4: u k+1 ←u +x k k+1 −z k+1
is a segment: ∀i ∈ N , Si = {xi |xi ∈ [ximin , ximax ]}, so it is a 5: end while
convex set. This guarantees the existence of at least one 6: return X = [x1 , ..., xN ]
Nash equilibrium for the global problem [21].
If in a first approach the cost function c does not In the first step (line 2), each user optimises its utility
depend on the consumption and production profiles of ρ
function, with a penalty term 2 ||xi − xik + xk − zk +
the players. Indeed, the price of electricity is imposed u k ||22 ). The lines 3 and 4 correspond to the aggregation
by the distribution grid (with for example EPEX steps, where the global variables z and u are calculated.
SPOT prices). Thus, electricity prices are completely The function g is a convex function that mathematically
independent from the users’ strategies. As a result, [24] transcribes the global constraint (17). If this constraint
ensures the unicity of the Nash equilibrium. is respected, then g(N z) = 0. If not, g takes a very high
value to ensure that the constraint will be respected.
2.4. Distributed algorithm The parameter ρ is the penalty parameter. So, at each
In the game previously defined, each user tends to iteration, users optimise their utility with a penalty
maximise its satisfaction, according to its preferences term in order to converge towards a state where the
and individual objectives. Therefore, the game leads global constraint will be respected. The algorithm
to the maximisation of the global satisfaction, which stops when the primal residual r k+1 = xk+1 − zk+1 and
corresponds to the following global optimisation of the dual residual sk+1 = ρ(zk+1 − zk ) verify a stop
problem: criterion, which means that we have reached the Nash
X equilibrium of the system.
max Ui (X) (16)
X∈S The aggregation steps (lines 3 and 4 of Algorithm 1)
i∈N
could reintroduce a central aggregator and thus be an
with the local constraints (2), (3), (4), (6), (7), (8), (9), obstacle to a fully distributed implementation. How-
(11), (13), (14). ever, the following section explains how blockchain is
Moreover, a global constraint links all the users of used to avoid this problem.
the community: the total imported power from the
distribution grid should not exceed a precise value Pmax , 3. Optimisation implementation
specified in the energy contract. Therefore:
X This section presents how the proposed optimisation
xi (t) ≤ Pmax , ∀t ∈ [ti , tf ] (17) process is concretely deployed, and more specifically
i
how the physical model of the grid and the blockchain

EAI Endorsed Transactions on


5
Energy Web
05 2021 - 07 2021 | Volume 8 | Issue 34 | e1
M. Stephant et al.

User 1 User 2 User 3

preferences (α, β, γ or δ) preferences (α, β, γ or δ) preferences (α, β, γ or δ)


and forecast and forecast and forecast

ADMM algorithm

Local optimisation of Local optimisation of Local optimisation of


energy profiles energy profiles energy profiles

x1 x2 x3

Global optimisation (variables z and u)

No

Penalty parameter ρ

Yes

Final state

Figure 1. Distributed optimisation overview

translates the theoretical game theory framework. The employed smart contract to perform a distributed
combination of these three parts constitutes a new optimisation for energy sharing.
tool which gives a concrete distributed framework Different consensus mechanisms exist in order to
for optimising self-consumption on real local energy create new a new block and add it to the chain.
community grids. Currently, the most used one is the Proof-of-Work
(PoW). It was initially used on Bitcoin and Ethereum
3.1. Role of blockchain public blockchains. In PoW, each node competes with
the others to find a solution to a difficult mathematical
Blockchain is a distributed and secured database puzzle. This process is called mining. The node that first
divided in chronological blocks. A block contains data finds the solution creates the new block and spreads
and some additional information related to the previous it to the rest of the network. The other nodes verify
block. Thus, all blocks form a chain [15]. Each user the integrity of the new block and then it is definitely
holds a copy of the database. Adding a new block to the added to the blockchain. The miner that has created the
existing chain requires a consensus between all users, new block receives an income to compensate the energy
so the blockchain works without any central supervisor spend for mining. The difficulty of the puzzle and the
nor trusted third-party. competition between the miners guarantee the integrity
In addition, blockchain supports the execution of of the blockchain [28]. However, this process requires
specific algorithms, called smart contracts, that enable large amount of energy, and therefore it is not relevant
to automatically proceed to previously defined tasks, for energy management applications.
such as triggering a transaction between two users [27]. Proof-of-Authority (PoA) is another consensus mech-
Practically, a smart contract is a piece of code defining anism that is more interesting for local blockchains. In
some functions that is deployed over the blockchain this process, a new block is added after a vote between
and interacts with every node of the network. Thanks the nodes of the network. The nodes that can vote are
to its distributed architecture, blockchain and smart initially declared at the creation of the blockchain. Since
contracts are interesting tools to support smart grids PoA gets rid of the intensive calculation of PoW, it
decentralisation. Indeed, authors in [19] have already consumes very few energy in comparison. It is suitable

EAI Endorsed Transactions on


6
Energy Web
05 2021 - 07 2021 | Volume 8 | Issue 34 | e1
Increasing photovoltaic self-consumption with game theory and blockchain

for private blockchains where a small number of users blockchain without any consequence on the overall
interact, and where these users can be trusted to create framework.
new blocks [29].
In the proposed system, blockchain serves as the 3.2. Game theory framework
communication layer between the users and aggregates
the results. It replaces the role of a central optimisation As mentioned in the previous paragraph, each player of
agent. More precisely, a private Ethereum blockchain is the game constitutes one node of the blockchain. This
deployed between all the elements of the grid. Thus, node locally optimises the user’s utility for the specified
each player of the game holds one node of a peer-to- time period through the Python client.
peer communication network. The blockchain works The ADMM process is illustrated on Figure 3 from
with a PoA mechanism. Each user’s node is combined the point of view of one user.
with a Python client which automatises the interactions Electricity
For one user : PV forecast Global constraint
with the blockchain and has more specifically the prices
(Pmax)

following three tasks. First, it assigns the right utility Optimised profile
Preferences coefficients
function to the user, depending of its type (electric Python client
xi
Smart contract
Final optimised profile
xi

vehicle, storage system, PV generator or load). Second, Individual parameters


(forecast, charging time,...)

it collects the coefficient preferences of the user. Finally, Penalty term

it performs the local optimisation of the utility function


and automatically sends the results to the blockchain. Figure 3. Optimisation for one user
A smart contract deployed on the blockchain
implements the aggregation steps of the ADMM
algorithm presented in the previous section. It collects The agent deploys the smart contract and specifies
the results of all users and calculates the global the period of optimisation and the electricity prices c
variables z and u, and sends the results to the users for and the total PV production forecast for the next day.
a new iteration. Each user reads these information, and then indicates
The blockchain framework is illustrated on Figure 2 its preferences and physical parameters in the Python
for 3 users. An additional agent is created only in order client, depending on its type (charging time and SOC
to deploy the smart contract and maintain the network. limits for EV, SOC limits for the battery, production
It does not perform any other operation and does not forecast for PV generators, flexibility and consumption
receive any users’ data. forecast for loads). The Python client computes the local
optimisation step and automatically sends the result
into the smart contract. Then it receives the global
User 1 Python client Blockchain node
results to perform another iteration if needed, until the
final state is reached by the overall system.

3.3. Physical model of the real grid


Smart contract
User 2 Python client Blockchain node Blockchain node Agent
(ADMM)

In the theoretical framework defined in section 2, the


physical constraints related to the grid have not been
taken into account. More precisely, the proposed game
User 3 Python client Blockchain node
theory framework implicitly assumes that the grid is
able to transfer all the power flows according to the
optimisation results. However, the grid elements are
Figure 2. Blockchain framework connected through lines that have a limited capacity.
Therefore, it may be possible that the consumption
and production profiles processed by the optimisation
The main interest of this implementation is that, algorithms lead to some over-currents or over-voltages
through the smart contract, blockchain gets rid of the on the lines.
need for a central optimisation supervisor that would For this reason, a physical model of the grid at
know the production and consumption details and stake is build, in which the physical properties of the
the preferences of all the grid elements. Moreover, lines are included (see figure 4), with PowerFactory.
blockchain has the benefit to be built with a distributed This software is used by grid operators for grid
structure, so it guarantees security and trust between modelling and analysis [30]. The local network contains
the elements of the grid. Blockchain is also more 4 buildings considered to be loads, 2 PV generators, one
resilient to changes than a unique central agent: new battery and 6 EV charging stations (figure 4). Buidling
element can simply be added to or deleted from the this model requires to obtain all needed electrical data

EAI Endorsed Transactions on


7
Energy Web
05 2021 - 07 2021 | Volume 8 | Issue 34 | e1
M. Stephant et al.

of the energy community, especially the architecture Table 1. Parameters of grid elements for scenario (a)
and the lines capacity.
Element Preferences coefficients
EVa α1 = 0.1 α2 = 0.1 α3 = 0.8
Distribution grid

Terminal_HTA
EVb α1 = 0.1 α2 = 0.1 α3 = 0.8
Battery β1 = 0.2 β2 = 0.8 -
Transformer

PV generatora γ1 = 0.5 γ2 = 0.5 -


PV generatorb γ1 = 0.5 γ2 = 0.5 -
AGBT_HEI

Loada δ1 = 0.1 δ2 = 0.1 δ3 = 0.8


Loadb δ1 = 0.1 δ2 = 0.1 δ3 = 0.8
AGBT_Ext TGBT_HA

Loadc δ1 = 0.1 δ2 = 0.1 δ3 = 0.8


Load_A Load_B Load_C

Loadd δ1 = 0.1 δ2 = 0.1 δ3 = 0.8


TGBT_TDN001

~ Load_D ~ ~ ~ ~
~ ~

Battery EV_A EV_B EV_C


PV_A PV_B EV_D

global constraints applied to the entire community.


~ ~
Theses solutions are then sent in a second step to the
EV_E EV_F
physical model of the grid to ensure that they do not
lead to over-voltage or over current on the lines.
Figure 4. Physical model of the grid As the physical model is specific to the energy
t Modèle îlot V1 Projet: community studied, a replication of the proposed
Graphique: Réseau-globa

SP1
Da t e: 0 9/ 04/ 2019
Annexe:
approach would require to build a new electrical model.
The consumption and production profiles of all the However, the blockchain environment can be easily
players provided by the optimisation process are tested deployed on other situations, because it take into
on the grid model in order to check if they create line accounts diverse kinds of actors (generators, battery,
congestion or over-voltages. In this case, the problems tertiary loads and EV).
that occur can be precisely identified on the physical
model. Then additional constraints can be imposed to 4. Results
the optimisation process (for example curtail the PV
production) in order to obtain profiles that will respect To illustrate the developed approach, this section
the grid constraints. The combination of the theoretical presents some preliminary results. The grid of Lille
optimisation framework with the simulations on the Catholic University (whose PowerFactory model is
physical model ensures that the solutions are realistic represented on figure 4) is used as case study, with only
and will not damage the grid. two electric vehicles respectively connected between
09:30 and 12:20, and between 10:40 and 19:10 and with
initial SOC of 20% and 45% respectively. The battery
3.4. Combination of tools
has an initial SOC of 35%. Loads are assumed to have a
To summarize, the proposed approach combines a flexibility of 25%.
distributed optimisation based on game theory and For electricity prices, data from the EPEX SPOT
solved by ADMM, a practical implementation with European market [31] are used. The global power
blockchain and a physical model of the grid. Figure 5 constraint is set to Pmax = 350 kW and the timestep ∆t
illustrates the overall system. to 20 minutes.
This framework is here specific to the case study, but Two cases are presented: in the first one, the
could be adapted to other situations. The distributed users prefer to consume the locally produced energy
optimisation algorithm has been detailed in section (scenario (a)) ; in the second one (scenario(b)), they
2.4. The Ethereum blockchain only implements this have a preference to minimise their costs (or maximise
algorithm, with a P2P network that reflects the their income). Tables 1 and 2 show the preferences
electrical network. As mentioned previously, Python coefficients used for the simulations, respectively for
clients are used in combination with each Ethereum scenario (a) and scenario (b).
node (each user) to perform local optimisation of Both scenarios converge after 73 iterations. Figures 6
utility functions. The smart contract only computes and 7 illustrate the results obtained respectively for
the aggregation step of the algorithm. At the end of scenarios (a) and (b), from the users point of view.
the algorithm, each user obtains a power profile that The comparison of these two figures shows that
maximises its utility function while respecting the the proposed approach enables the users to reach

EAI Endorsed Transactions on


8
Energy Web
05 2021 - 07 2021 | Volume 8 | Issue 34 | e1
Increasing photovoltaic self-consumption with game theory and blockchain

Blockchain : smart contract

User (node of the network)

User‘s preferences

Desired consumption / Consumption or


Consumption and Optimisation algorithm:
forecasted production production profile
production forecast game theory
for each player
Constraints for grid support

Consumption and
Blockchain : database production profiles for all
players
Blockchain stores data for each timestep

Electrical data of the grid


(currents, voltage, …)
Physical model of the local energy community

Figure 5. Overview of the overall optimisation process

Table 2. Parameters of grid elements for scenario (b)


Consumption/production
Consumption EV2 battery

consumption/production (kW)
0.045 50
6

consumption (kW)
0.04
Element Preferences coefficients 0
4
0.035

EVa α1 = 0.1 α2 = 0.8 α3 = 0.1 0.03


-50
2

EVb
0.025
α1 = 0.1 α2 = 0.8 α3 = 0.1
0.02 -100
0
00:00 06:00 12:00 18:00 00:00
Battery β1 = 0.8 β2 = 0.2 - Jun 05, 2019
SOC
SOCbattery
EV2
PV generatora -
0.045 1
γ1 = 0.8 γ2 = 0.2
0.04 0.8

PV generatorb γ1 = 0.8 γ2 = 0.2 - 0.035 0.6

SOC
Loada
0.03 0.4
δ1 = 0.8 δ2 = 0.1 δ3 = 0.1
0.025 0.2

Loadb δ1 = 0.8 δ2 = 0.1 δ3 = 0.1 0.02 0


00:00 06:00 12:00 18:00 00:00

Loadc
Jun 05, 2019
δ1 = 0.8 δ2 = 0.1 δ3 = 0.1
Loadd δ1 = 0.8 δ2 = 0.1 δ3 = 0.1 0.045
Total consumption from loads
500

consumption (kW)
0.04
400
0.035
300
0.03
their individual goals. Indeed, in scenario (a), energy 200
0.025
consumers (EV and loads) really follow the PV
0.02 100
production profile. Loads shift their consumption in the 00:00 06:00 12:00 18:00 00:00
Jun 05, 2019
middle of the day to consume a maximum of local PV 0.045
Total PV production
500

energy. On the contrary, their profiles follow exactly the


PV production (kW)

0.04 400

price function in scenario (b). Regarding the battery, its 0.035 300

SOC profile slightly follows the PV production profile 0.03 200

in scenario (a), but it is not enough to charge the battery. 0.025 100

In scenario (b), the SOC is correlated to the price of 0.02


00:00 06:00 12:00 18:00
0
00:00
Jun 05, 2019
electricity. For PV generators, each scenario results in a
maximisation of the production. This is an effect of the Figure 6. In red: power profiles scenario (a), for EV2, the battery,
utility function (equation 10) in which all terms tend to the aggregated loads and the total PV production (the green line
increase the production. shows the forecasted profile, and the red line the optimised one).
As a results, table 3 shows the costs or benefits for In blue: electricity prices.
all users. It illustrates that in scenario (a), users are
ready to pay more to consume preferentially the local
PV production. cases. Second, scenario (a) is more interesting for the
Figure 8 illustrates the power imported by the energy distribution grid, because it avoids the morning and
community from the grid in both scenarios. A negative night peaks, it decreases the power send back to the
value indicates that the community exports power to grid and the power imported show less fluctuations (the
the distribution grid. First, the global power constraint standard deviation is only 63 kW in scenario (a), and
(represented by the dotted line) is respected in both 105 kW in scenario (b)). This is due to the will of users

EAI Endorsed Transactions on


9
Energy Web
05 2021 - 07 2021 | Volume 8 | Issue 34 | e1
M. Stephant et al.

Consumption/production
Consumption EV2 battery

consumption/production (kW)
0.045 50
3 Imported power from the distribution grid
400

consumption (kW)
0.04
scenario (a)
0
2
0.035 scenario (b)
300 Pmax
0.03
-50
1
0.025

Imported power (kW)


0.02 -100
0
00:00 06:00 12:00 18:00 00:00 200
Jun 05, 2019
SOC
SOCbattery
EV2
0.045 1

0.04 0.8 100

0.035 0.6

SOC
0.03 0.4
0
0.025 0.2

0.02 0
00:00 06:00 12:00 18:00 00:00
Jun 05, 2019
-100

Total consumption from loads


0.045 500
-200
00:00 06:00 12:00 18:00 00:00
consumption (kW)

0.04
400
Jun 05, 2019
0.035
300
0.03

0.025
200
Figure 8. Imported power from grid in both scenarios
0.02 100
00:00 06:00 12:00 18:00 00:00
Jun 05, 2019
Total PV production
0.045 500
PV production (kW)

0.04 400
Self-consumption rate
100
0.035 300
scenario (a)
0.03 200 95 scenario (b)
0.025 100
90
0.02 0
00:00 06:00 12:00 18:00 00:00
Self-consumption rate(%)

Jun 05, 2019 85

Figure 7. In red: power profiles scenario (b), for EV2, the battery, 80

the aggregated loads and the total PV production (the green line 75
shows the forecasted profile, and the red line the optimised one). 70
In blue: electricity prices.
65

Table 3. Costs or benefits in scenarios (a) and (b) 60

55
Costs (>0) or benefits (<0) Scenario (a) Scenario (b)
50
Consumers (EV and loads) 223 € 214 € 06:00 08:00 10:00 12:00 14:00 16:00 18:00 20:00 22:00
Jun 05, 2019
PV generators -71 € - 71 €
Storage 1€ -4€
Total 153 € 140 € Figure 9. Self-consumption rate for scenarios (a) and (b).

Table 4. Global self-consumption rate for scenarios (a) and (b)


physical model ensures that in the studied scenarios,
Scenario (a) Scenario (b) the university grid can support the consumption and
SC rate 99% 91% production profiles. Simulations on the physical grid
are necessary to guarantee that the algorithm provides
feasible solutions. This is a very important point as
to consume preferentially the local PV production: the idea behind the work is to provide a concrete
they adapt their consumption and thus they need less solution to improve energy sharing among a local
power from the distribution grid. As a result, the self- energy community.
consumption rate of the energy community is higher in To summarize, the results show that the proposed
scenario (a) than scenario (b), as shown in table 4. approach leads to a stable state where individual goals
In a second step, the obtained solutions of both of the users are met, while the global constraint is
scenarios have been tested on the physical model of the respected. It proves that this fully distributed approach
grid, but do not create any problem. Therefore, in these is relevant for energy management on an energy
scenarios, there is no need to add new constraints. The community.

EAI Endorsed Transactions on


10
Energy Web
05 2021 - 07 2021 | Volume 8 | Issue 34 | e1
Increasing photovoltaic self-consumption with game theory and blockchain

An interesting perspective is to include a price especially when a new player is added, for example
function that reflects in real time the production and when a new electric vehicle arrives at a charging station.
consumption on the local grid: when consumption
is higher than local production, the price will Acknowledgements. Authors want to thank the European
increase. This would encourage the grid elements to city of Lille (MEL) and Greenbirdie for their financial
preferentially consume the local production, even in support under the Smart Buildings as nodes of Smart Grid
case that they are only sensible to the electricity (SBnodesSG) Chair.
cost. This work will be also improved by a better
version of the ADMM algorithm, with for example a References
more sophisticated penalty parameter that would result [1] Snapshot of Global PV Markets. Tech. rep., IEA PVPS
in a negotiation between the users to decrease their (2019)
consumption when needed. [2] McKenna, E., Pless, J., Darby, S.: Solar photovoltaic self-
consumption in the UK residential sector: New estimates
from a smart grid demonstration project. Energy Policy
5. Perspectives and conclusion 118, 482 – 491 (2018). doi:10.1016/j.enpol.2018.04.006
[3] Villar, C., Neves, D., Silva, C.: Solar PV self-consumption:
In this paper, a concrete distributed framework to An analysis of influencing indicators in the Portuguese
improve energy sharing between producers and con- context. Energy Strategy Reviews 18, 224 – 234 (2017).
sumers is proposed among a local community energy. doi:10.1016/j.esr.2017.10.001
In this way, the use of local photovoltaic production is [4] Luthander, R., Widén, J., Nilsson, D., Palm, J.:
maximised as well as the self-consumption rate while Photovoltaic self-consumption in buildings: A
users’ objectives are respected. review. Applied Energy 142, 80 – 94 (2015).
doi:10.1016/j.apenergy.2014.12.028
The approach combines three tools: game theory
[5] Stephant, M., Hassam-Ouari, K., Abbes, D., Labrunie,
for distributed optimisation, a physical model of the A., Robyns, B.: A survey on energy management
grid to guarantee the stability of the grid, and a and blockchain for collective self-consumption.
communication layer with blockchain. The combination In: 2018 7th International Conference on Systems
of these tools is an innovative approach and constitutes and Control (ICSC). pp. 237–243. IEEE (2018).
a fully distributed method for better use of local doi:10.1109/ICoSC.2018.8587812
renewable energy sources on energy communities. The [6] Molzahn, D.K., Dörfler, F., Sandberg, H., Low, S.H.,
approach with game theory enables each actor to Chakrabarti, S., Baldick, R., Lavaei, J.: A Survey of Dis-
specify its particular preferences and to act freely to tributed Optimization and Control Algorithms for Elec-
reach these goals. Thus, the framework reflects the tric Power Systems. IEEE Transactions on Smart Grid 8(6),
2941–2962 (Nov 2017). doi:10.1109/TSG.2017.2720471
distributed nature of electric grids, where various actors
[7] Wang, Y., Wang, S., Wu, L.: Distributed optimization
are following very diverse goals.
approaches for emerging power systems operation: A
The first results are promising and show a conver- review. Electric Power Systems Research 144, 127 – 135
gence towards an equilibrium where the global con- (2017). doi:10.1016/j.epsr.2016.11.025
straints is verified while individual goals of users are [8] Immonen, A., Kiljander, J., Aro, M.: Consumer view-
met. However, this work will be continued, with a spe- point on a new kind of energy market. Electric
cific focus on the following tasks. First, a complete anal- Power Systems Research 180, 106153 (Mar 2020).
ysis of the blockchain and of its energy consumption is doi:10.1016/j.epsr.2019.106153
required. This article focused on the results obtained by [9] Saad, W., Han, Z., Poor, H.V., Basar, T.: Game-Theoretic
Methods for the Smart Grid: An Overview of Microgrid
the distribution framework deployed in the blockchain,
Systems, Demand-Side Management, and Smart Grid
but a study of the entire system is required in order
Communications. IEEE Signal Processing Magazine 29(5),
to conclude if the proposed framework is effectively 86–105 (Sep 2012). doi:10.1109/MSP.2012.2186410
relevant for an energy community. This analysis should [10] Tushar, W., Yuen, C., Mohsenian-Rad, H., Saha, T., Poor,
cover the energy consumption of the blockchain, but H.V., Wood, K.L.: Transforming Energy Networks via
also practical aspects like the communication speed Peer-to-Peer Energy Trading: The Potential of Game-
between users and the security of the solution. Theoretic Approaches. IEEE Signal Processing Magazine
Second, the price function needs to reflect in real 35(4), 90–111 (Jul 2018). doi:10.1109/MSP.2018.2818327
time the consumption and production inside the local [11] Nguyen, H.K., Song, J.B., Han, Z.: Distributed
grid. The creation of a small electricity market between Demand Side Management with Energy Storage
in Smart Grid. IEEE Transactions on Parallel and
the players is an interesting option to encourage loads
Distributed Systems 26(12), 3346–3357 (Dec 2015).
to consume when the PV production is high. In this doi:10.1109/TPDS.2014.2372781
perspective, interesting further results are expected [12] Dehghanpour, K., Nehrir, H.: Real-Time Multiobjective
Moreover, some additional questions regarding the Microgrid Power Management Using Distributed Opti-
overall stability of the system should be answered, mization in an Agent-Based Bargaining Framework. IEEE

EAI Endorsed Transactions on


11
Energy Web
05 2021 - 07 2021 | Volume 8 | Issue 34 | e1
M. Stephant et al.

Transactions on Smart Grid 9(6), 6318–6327 (Nov 2018). A.and Heemels, M., Johansson, M. (eds.) Networked
doi:10.1109/TSG.2017.2708686 Control Systems, pp. 109–148. Springer London, London
[13] Sorin, E., Bobo, L., Pinson, P.: Consensus-Based (2010). doi:10.1007/978-0-85729-033-5_4
Approach to Peer-to-Peer Electricity Markets [22] Pilz, M., Al-Fagih, L.: Recent advances in local energy
With Product Differentiation. IEEE Transactions trading in the smart grid based on game–theoretic
on Power Systems 34(2), 994–1004 (Mar 2019). approaches. IEEE Transactions on Smart Grid (2017).
doi:10.1109/TPWRS.2018.2872880 doi:10.1109/TSG.2017.2764275
[14] Paudel, A., Chaudhari, K., Long, C., Gooi, H.B.: Peer- [23] Marler, R., Arora, J.: The weighted sum method for
to-Peer Energy Trading in a Prosumer-Based Community multi-objective optimization: new insights. Structural
Microgrid: A Game-Theoretic Model. IEEE Transactions and Multidisciplinary Optimization 41(6), 853–862 (Jun
on Industrial Electronics 66(8), 6087–6097 (Aug 2019). 2010). doi:10.1007/s00158-009-0460-7
doi:10.1109/TIE.2018.2874578 [24] Rosen, J.: Existence and Uniqueness of Equilibrium
[15] Sikorski, J., Haughton, J., Kraft, M.: Blockchain technol- Points for Concave N-Person Games. Econometrica 33(3),
ogy in the chemical industry: Machine-to-machine elec- 520–534 (1965). doi:10.2307/1911749
tricity market. Applied Energy 195, 234 – 246 (2017). [25] Sousa, T., Soares, T., Pinson, P., Moret, F., Baroche,
doi:10.1016/j.apenergy.2017.03.039 T., Sorin, E.: Peer-to-peer and community-based mar-
[16] Mengelkamp, E., Gärttner, J., Rock, K., Kessler, S., Orsini, kets: A comprehensive review. Renewable and Sus-
L., Weinhardt, C.: Designing microgrid energy markets: A tainable Energy Reviews 104, 367 – 378 (2019).
case study: The Brooklyn Microgrid. Applied Energy 210, doi:10.1016/j.rser.2019.01.036,
870–880 (2018). doi:10.1016/j.apenergy.2017.06.054 [26] S. Boyd, N. Parikh, E. Chu, B. Peleato, J. Eckstein, others,
[17] Kang, J., Yu, R., Huang, X., Maharjan, S., Zhang, Distributed optimization and statistical learning via the
Y., Hossain, E.: Enabling Localized Peer-to-Peer Elec- alternating direction method of multipliers, Foundations
tricity Trading Among Plug-in Hybrid Electric Vehi- and Trends® in Machine learning 3 (1) (2011) 1–122.
cles Using Consortium Blockchains. IEEE Transactions [27] Macdonald, M., Liu-Thorrold, L., Julien, R.: The
on Industrial Informatics 13(6), 3154–3164 (Dec 2017). blockchain: a comparison of platforms and their uses
doi:10.1109/TII.2017.2709784 beyond bitcoin. Work. Pap pp. 1–18 (2017)
[18] Foti, M., Greasidis, D., Vavalis, M.: Viability Analysis [28] Silvestre, M.L.D., Gallo, P., Ippolito, M.G., Sansev-
of a Decentralized Energy Market Based on Blockchain. erino, E.R., Zizzo, G.: A Technical Approach to the
In: 2018 15th International Conference on the Euro- Energy Blockchain in Microgrids. IEEE Transactions on
pean Energy Market (EEM). pp. 1–5. IEEE (2018). Industrial Informatics 14(11), 4792–4803 (Nov 2018).
doi:10.1109/EEM.2018.8469906 doi:10.1109/TII.2018.2806357
[19] Münsing, E., Mather, J., Moura, S.: Blockchains for [29] K. Christidis and M. Devetsikiotis, “Blockchains and
decentralized optimization of energy resources in micro- Smart Contracts for the Internet of Things,” IEEE Access,
grid networks. In: 2017 IEEE Conference on Control Tech- vol. 4, pp. 2292–2303, 2016.
nology and Applications (CCTA). pp. 2164–2171 (Aug [30] Gonzalez-Longatt, F., Rueda, J.: PowerFactory appli-
2017). doi:10.1109/CCTA.2017.8062773 cations for power system analysis. Springer (2014).
[20] Morstyn, T., McCulloch, M.D.: Multiclass Energy doi:10.1007/978-3-319-12958-7
Management for Peer-to-Peer Energy Trading [31] EPEX SPOT: EPEX SPOT Market Data, https://www.
Driven by Prosumer Preferences. IEEE Transactions epexspot.com/en/market-data
on Power Systems 34(5), 4005–4014 (Sep 2019).
doi:10.1109/TPWRS.2018.2834472
[21] Yang, B., Johansson, M.: Distributed Optimization
and Games: A Tutorial Overview. In: Bemporad,

EAI Endorsed Transactions on


12
Energy Web
05 2021 - 07 2021 | Volume 8 | Issue 34 | e1

You might also like