Increasing photovoltaic self-consumption with game theory and blockchain

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


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

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

Optimisation framework using game theory
A local university grid is considered as case study: it contains loads (buildings), a storage system (an electrochemical battery), rooftop PV generators and several charging stations for electric vehicles. There is a connection point to the distribution grid. Each actor can adjust its energy consumption or production profile in order to maximise its own satisfaction. Thus, the goal of the global optimisation problem is to maximise the overall satisfaction of users, while a global constraint links all users.
More specifically, game theory is chosen, because it defines a mathematical framework for distributed optimisation in which each element of the system aims to optimise its own individual situation [21]. Game theory is a relevant method in this case for several reasons. First, it models a situation where players are in competition. This reflect the case of a local energy community where players are in competition to reach their individual objectives. Second, game theory enables to take into account not only cost objectives, but also other considerations like comfort or the will to consume locally produced electricity [22]. This is interesting as few studies integrate non economic objectives in their energy strategy [20]. Finally, game theory is interesting because each agent has to solve a simpler problem, in comparison to the global optimisation problem.

Problem formulation
A non-cooperative game is defined, in which each element tries to reach its personal objectives by adjusting its production or consumption profile, without any coordination with the other elements. Parameters for preferences are introduced so that each user is able to adjust its objective function (called utility function) according to its own preferences. Such weighting coefficients are classically used in multi-objective optimisation [23]. These preferences can represent the cost paid (or earned) for electricity consumption (or production), the users' comfort, or the will to consume the local PV production. The benefit of such an approach is that it only requires that the participants locally optimise their behaviour, without any cooperation. Thus, it does not require a central agent to coordinate all the participants. As mentioned previously, this situation reflects the reality of a local grid where participants have limited knowledge about the structure of the grid and do not necessary communicate between them to meet their goals. Thus, a game is introduced with N players, which are the N elements of the grid (loads, PV generators, battery, electric vehicles charging stations). The game is defined by the set G = {N , (S i ) i∈N , (U i ) i∈N }, where S i is the strategy set of the player i and U i its utility function. Here, the strategy set is defined as S i = {x i }, where x i is the production or consumption profile of the user. The users adjust their profile x i one day ahead, between t i and t f , with a time step ∆t. So, for each user i, x i (t) = P i (t) * ∆t, with P i (t) the average power consumed or produced between t and t + ∆t. The price of electricity (written c in the following) is supposed to be imposed by the distribution grid.
In the rest of the article, x i > 0 corresponds to an energy consumption and x i < 0 to a production.

Utility functions
This section details the utility function used for each kind of user. The utility function, or objective function, mathematically translates the goals of the player and measures user's satisfaction. The players tend to maximise their utility function by adjusting their strategy, here their energy consumption or production profile. 3 EAI Endorsed Transactions on Energy Web Online First EV user. For an EV user connected to the charging station, the following function is proposed : The term α 1 ln(1 + x EV (t)) represents the objective to charge the vehicle. The natural logarithm function is classically used for energy buyers as it models users' satiety [17]. With the term α 2 c(t) x EV (t), the user aims to minimise the cost to pay. Then the term 2 is introduced to represent the objective to preferentially use the local PV production.
The weighting coefficients α 1 , α 2 and α 3 are used so that each user can adjust its preferences. These coefficients are commonly used in the literature for multi-objective optimisation to combine different objectives into a unique objective function. These coefficients should be positive and verify: α 1 + α 2 + α 3 = 1 [23].
For each EV, some constraints need to be taken into consideration. According to the current situation of the case study, discharge is not allowed and the charging power is limited by the maximum power of the charging station: Moreover, the state of charge (SOC) has upper and lower bounds, which are characteristics of the vehicle battery: In addition, the user specifies a minimal SOC value SOC required EV to be reached at the end of the charging time, in order to guarantee a minimum level of comfort: Battery. The battery can have two objectives: first to maximise its income, and second to maximise the consumption of the local PV production. Thus, the following utility function is used: Here also, the positive coefficients β 1 and β 2 are used to specify the user's preferences with β 1 + β 2 = 1.
The charging power and discharging power of the battery are limited: Moreover, similarly to the EV, the SOC has boundaries: (8) Finally, at the end of the day, the SOC should reach the intial value, in order to form a cycle: PV generators. PV generators simply tend to maximise their production, because their marginal production cost is equal to zero [19]. So their goals are to optimise their payoff, and to limit the production curtailment. Therefore, the following utility function is written with the two respective terms: The positive coefficients γ 1 and γ 2 model the user's choice, and we impose γ 1 + γ 2 = 1.
PV generators can only curtail their production from the maximal production, which is the forecasted production one day ahead: Loads. Loads can have some flexibility (written f ), which means that they can decrease their consumption compared to their forecasted consumption profile x f orecast l . However, to ensure a minimal level of comfort, the total energy consumed at the end of the day should be equal to the forecasted consumption for the entire day. In other words, loads can delay their consumption but do not globally decrease it. Then the objectives are to minimise the cost paid for electricity, to consume the local PV production and to minimise the change of the forecasted consumption, that would represent a loss of comfort for the user. Therefore, inspired by [12] the following utility equation is used, with a quadratic term to model comfort: Each user can specify its preferences by adjusting δ 1 , δ 2 and δ 3 (with δ 1 + δ 2 + δ 3 = 1).
The constraint on the flexibility f imposes:

EAI Endorsed Transactions on Energy Web Online First
Increasing photovoltaic self-consumption with game theory and blockchain Moreover, as mentioned previously, the total energy consumed in one day should not change, so:

Nash equilibrium
An important concept in game theory is the Nash equilibrium, a situation in which no player can increase its utility by being the only one to change its strategy [9]. Mathematically, if X * = {x * 1 , ..., x * N } represents the strategy of the players at the Nash equilibrium and ., x N } the strategy of all players except player i, the Nash equilibrium corresponds to: This Nash equilibrium is important as it guarantees that when all players individually maximise their utility function, the global system reaches an equilibrium point. All the utility functions U i specified in this article are concave and continuous in x i . Moreover, all the constraints impose that for each player, the strategy set is a segment: ∀i ∈ N , ]}, so it is a convex set. This guarantees the existence of at least one Nash equilibrium for the global problem [21].
If in a first approach the cost function c does not depend on the consumption and production profiles of the players. Indeed, the price of electricity is imposed by the distribution grid (with for example EPEX SPOT prices). Thus, electricity prices are completely independent from the users' strategies. As a result, [24] ensures the unicity of the Nash equilibrium.

Distributed algorithm
In the game previously defined, each user tends to maximise its satisfaction, according to its preferences and individual objectives. Therefore, the game leads to the maximisation of the global satisfaction, which corresponds to the following global optimisation problem: max with the local constraints (2), (3), (4), (6), (7), (8), (9), (11), (13), (14). Moreover, a global constraint links all the users of the community: the total imported power from the distribution grid should not exceed a precise value P max , specified in the energy contract. Therefore: To solve the global problem (16) under the local and global constraints, a distributed algorithm is required. Among the diverse algorithms available in the literature, ADMM (Alternating Direction Method of Multipliers) is a good candidate. This distributed algorithm has been notably used in [19] and [20], and is well suitable for energy exchanges frameworks [25]. The ADMM algorithm is based on the Lagrangian decomposition and enables to divide the global problem into several sub-problems. In practice, all the users optimise their own utility function while respecting their own local constraints, and then a penalty parameter ρ is calculated to force the users to respect the global constraint, as illustrated on Figure 1. The ADMM converges towards a final state, which corresponds to the Nash equilibrium of the system [26].
More precisely, all the steps are described in Algorithm 1. The variable x is the mean of all x i : Algorithm 1 ADMM algorithm 1: while ||r k || 2 > primal and ||s k || 2 > dual do 2: x k+1 In the first step (line 2), each user optimises its utility function, with a penalty term 2 ). The lines 3 and 4 correspond to the aggregation steps, where the global variables z and u are calculated. The function g is a convex function that mathematically transcribes the global constraint (17). If this constraint is respected, then g(N z) = 0. If not, g takes a very high value to ensure that the constraint will be respected. The parameter ρ is the penalty parameter. So, at each iteration, users optimise their utility with a penalty term in order to converge towards a state where the global constraint will be respected. The algorithm stops when the primal residual r k+1 = x k+1 − z k+1 and of the dual residual s k+1 = ρ(z k+1 − z k ) verify a stop criterion, which means that we have reached the Nash equilibrium of the system.
The aggregation steps (lines 3 and 4 of Algorithm 1) could reintroduce a central aggregator and thus be an obstacle to a fully distributed implementation. However, the following section explains how blockchain is used to avoid this problem.

Optimisation implementation
This section presents how the proposed optimisation process is concretely deployed, and more specifically how the physical model of the grid and the blockchain 5 EAI Endorsed Transactions on Energy Web Online First Local optimisation of energy profiles

User 2 User 3
Penalty parameter ρ preferences (α, β, γ or δ) and forecast preferences (α, β, γ or δ) and forecast ? Figure 1. Distributed optimisation overview translates the theoretical game theory framework. The combination of these three parts constitutes a new tool which gives a concrete distributed framework for optimising self-consumption on real local energy community grids.

Role of blockchain
Blockchain is a distributed and secured database divided in chronological blocks. A block contains data and some additional information related to the previous block. Thus, all blocks form a chain [15]. Each user holds a copy of the database. Adding a new block to the existing chain requires a consensus between all users, so the blockchain works without any central supervisor nor trusted third-party. In addition, blockchain supports the execution of specific algorithms, called smart contracts, that enable to automatically proceed to previously defined tasks, such as triggering a transaction between two users [27]. Practically, a smart contract is a piece of code defining some functions that is deployed over the blockchain and interacts with every node of the network. Thanks to its distributed architecture, blockchain and smart contracts are interesting tools to support smart grids decentralisation. Indeed, authors in [19] have already employed smart contract to perform a distributed optimisation for energy sharing.
Different consensus mechanisms exist in order to create new a new block and add it to the chain. Currently, the most used one is the Proof-of-Work (PoW). It was initially used on Bitcoin and Ethereum public blockchains. In PoW, each node competes with the others to find a solution to a difficult mathematical puzzle. This process is called mining. The node that first finds the solution creates the new block and spreads it to the rest of the network. The other nodes verify the integrity of the new block and then it is definitely added to the blockchain. The miner that has created the new block receives an income to compensate the energy spend for mining. The difficulty of the puzzle and the competition between the miners guarantee the integrity of the blockchain [28]. However, this process requires large amount of energy, and therefore it is not relevant for energy management applications.
Proof-of-Authority (PoA) is another consensus mechanism that is more interesting for local blockchains. In this process, a new block is added after a vote between the nodes of the network. The nodes that can vote are initially declared at the creation of the blockchain. Since PoA gets rid of the intensive calculation of PoW, it consumes very few energy in comparison. It is suitable 6 EAI Endorsed Transactions on Energy Web Online First for private blockchains where a small number of users interact, and where these users can be trusted to create new blocks [29]. In the proposed system, blockchain serves as the communication layer between the users and aggregates the results. It replaces the role of a central optimisation agent. More precisely, a private Ethereum blockchain is deployed between all the elements of the grid. Thus, each player of the game holds one node of a peer-topeer communication network. The blockchain works with a PoA mechanism. Each user's node is combined with a Python client which automatises the interactions with the blockchain and has more specifically the following three tasks. First, it assigns the right utility function to the user, depending of its type (electric vehicle, storage system, PV generator or load). Second, it collects the coefficient preferences of the user. Finally, it performs the local optimisation of the utility function and automatically sends the results to the blockchain.
A smart contract deployed on the blockchain implements the aggregation steps of the ADMM algorithm presented in the previous section. It collects the results of all users and calculates the global variables z and u, and sends the results to the users for a new iteration.
The blockchain framework is illustrated on Figure 2 for 3 users. An additional agent is created only in order to deploy the smart contract and maintain the network. It does not perform any other operation and does not receive any users' data.  The main interest of this implementation is that, through the smart contract, blockchain gets rid of the need for a central optimisation supervisor that would know the production and consumption details and the preferences of all the grid elements. Moreover, blockchain has the benefit to be built with a distributed structure, so it guarantees security and trust between the elements of the grid. Blockchain is also more resilient to changes than a unique central agent: new element can simply be added to or deleted from the blockchain without any consequence on the overall framework.

Game theory framework
As mentioned in the previous paragraph, each player of the game constitutes one node of the blockchain. This node locally optimises the user's utility for the specified time period through the Python client.
The ADMM process is illustrated on Figure 3 from the point of view of one user.  The agent deploys the smart contract and specifies the period of optimisation and the electricity prices c and the total PV production forecast for the next day. Each user reads these information, and then indicates its preferences and physical parameters in the Python client, depending on its type (charging time and SOC limits for EV, SOC limits for the battery, production forecast for PV generators, flexibility and consumption 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 results to perform another iteration if needed, until the final state is reached by the overall system.

Physical model of the real grid
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 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 connected through lines that have a limited capacity. Therefore, it may be possible that the consumption and production profiles processed by the optimisation algorithms lead to some over-currents or over-voltages on the lines.
For this reason, a physical model of the grid at stake is build, in which the physical properties of the lines are included (see figure 4), with PowerFactory. This software is used by grid operators for grid modelling and analysis [30]. The local network contains 4 buildings considered to be loads, 2 PV generators, one battery and 6 EV charging stations ( figure 4). Buidling this model requires to obtain all needed electrical data 7 EAI The consumption and production profiles of all the players provided by the optimisation process are tested on the grid model in order to check if they create line congestion or over-voltages. In this case, the problems that occur can be precisely identified on the physical model. Then additional constraints can be imposed to the optimisation process (for example curtail the PV production) in order to obtain profiles that will respect the grid constraints. The combination of the theoretical optimisation framework with the simulations on the physical model ensures that the solutions are realistic and will not damage the grid.

Combination of tools
To summarize, the proposed approach combines a distributed optimisation based on game theory and solved by ADMM, a practical implementation with blockchain and a physical model of the grid. Figure 5 illustrates the overall system. This framework is here specific to the case study, but could be adapted to other situations. The distributed optimisation algorithm has been detailed in section 2.4. The Ethereum blockchain only implements this algorithm, with a P2P network that reflects the electrical network. As mentioned previously, Python clients are used in combination with each Ethereum node (each user) to perform local optimisation of utility functions. The smart contract only computes the aggregation step of the algorithm. At the end of the algorithm, each user obtains a power profile that maximises its utility function while respecting the  Theses solutions are then sent in a second step to the physical model of the grid to ensure that they do not lead to over-voltage or over current on the lines. As the physical model is specific to the energy community studied, a replication of the proposed approach would require to build a new electrical model. However, the blockchain environment can be easily deployed on other situations, because it take into accounts diverse kinds of actors (generators, battery, tertiary loads and EV).

Results
To illustrate the developed approach, this section presents some preliminary results. The grid of Lille Catholic University (whose PowerFactory model is represented on figure 4) is used as case study, with only 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 has an initial SOC of 35%. Loads are assumed to have a flexibility of 25%.
For electricity prices, data from the EPEX SPOT European market [31] are used. The global power constraint is set to P max = 350 kW and the timestep ∆t to 20 minutes.
Two cases are presented: in the first one, the users prefer to consume the locally produced energy (scenario (a)) ; in the second one (scenario(b)), they have a preference to minimise their costs (or maximise their income). Tables 1 and 2 show the preferences coefficients used for the simulations, respectively for scenario (a) and scenario (b).
Both scenarios converge after 73 iterations. Figures 6  and 7 illustrate the results obtained respectively for scenarios (a) and (b), from the users point of view.
The comparison of these two figures shows that the proposed approach enables the users to reach 8 EAI Endorsed Transactions on Energy Web Online First Increasing photovoltaic self-consumption with game theory and blockchain  Regarding the battery, its SOC profile slightly follows the PV production profile in scenario (a), but it is not enough to charge the battery. In scenario (b), the SOC is correlated to the price of electricity. For PV generators, each scenario results in a maximisation of the production. This is an effect of the utility function (equation 10) in which all terms tend to increase the production. As a results, table 3 shows the costs or benefits for all users. It illustrates that in scenario (a), users are ready to pay more to consume preferentially the local PV production.  Figure 6. In red: power profiles scenario (a), for EV2, the battery, the aggregated loads and the total PV production (the green line shows the forecasted profile, and the red line the optimised one). In blue: electricity prices.
cases. Second, scenario (a) is more interesting for the distribution grid, because it avoids the morning and night peaks, it decreases the power send back to the grid and the power imported show less fluctuations (the standard deviation is only 63 kW in scenario (a), and 105 kW in scenario (b)). This is due to the will of users 9 EAI Endorsed Transactions on Energy Web Online First  In red: power profiles scenario (b), for EV2, the battery, the aggregated loads and the total PV production (the green line shows the forecasted profile, and the red line the optimised one). In blue: electricity prices.  to consume preferentially the local PV production: they adapt their consumption and thus they need less power from the distribution grid. As a result, the selfconsumption rate of the energy community is higher in scenario (a) than scenario (b), as shown in table 4. In a second step, the obtained solutions of both scenarios have been tested on the physical model of the grid, but do not create any problem. Therefore, in these scenarios, there is no need to add new constraints. The physical model ensures that in the studied scenarios, the university grid can support the consumption and production profiles. Simulations on the physical grid are necessary to guarantee that the algorithm provides feasible solutions. This is a very important point as the idea behind the work is to provide a concrete solution to improve energy sharing among a local energy community.
To summarize, the results show that the proposed approach leads to a stable state where individual goals of the users are met, while the global constraint is respected. It proves that this fully distributed approach is relevant for energy management on an energy community. 10 EAI Endorsed Transactions on Energy Web Online First Increasing photovoltaic self-consumption with game theory and blockchain An interesting perspective is to include a price function that reflects in real time the production and consumption on the local grid: when consumption is higher than local production, the price will increase. This would encourage the grid elements to preferentially consume the local production, even in case that they are only sensible to the electricity cost. This work will be also improved by a better version of the ADMM algorithm, with for example a more sophisticated penalty parameter that would result in a negotiation between the users to decrease their consumption when needed.

Perspectives and conclusion
In this paper, a concrete distributed framework to improve energy sharing between producers and consumers is proposed among a local community energy. In this way, the use of local photovoltaic production is maximised as well as the self-consumption rate while users' objectives are respected.
The approach combines three tools: game theory for distributed optimisation, a physical model of the grid to guarantee the stability of the grid, and a communication layer with blockchain. The combination of these tools is an innovative approach and constitutes a fully distributed method for better use of local renewable energy sources on energy communities. The approach with game theory enables each actor to specify its particular preferences and to act freely to reach these goals. Thus, the framework reflects the distributed nature of electric grids, where various actors are following very diverse goals.
The first results are promising and show a convergence towards an equilibrium where the global constraints is verified while individual goals of users are met. However, this work will be continued, with a specific focus on the following tasks. First, a complete analysis of the blockchain and of its energy consumption is required. This article focused on the results obtained by the distribution framework deployed in the blockchain, but a study of the entire system is required in order to conclude if the proposed framework is effectively relevant for an energy community. This analysis should cover the energy consumption of the blockchain, but also practical aspects like the communication speed between users and the security of the solution.
Second, the price function needs to reflect in real time the consumption and production inside the local grid. The creation of a small electricity market between the players is an interesting option to encourage loads to consume when the PV production is high. In this perspective, interesting further results are expected Moreover, some additional questions regarding the overall stability of the system should be answered, especially when a new player is added, for example when a new electric vehicle arrives at a charging station.