Modelling the redistribution of benefits from joint investments in community energy projects

Given the widespread adoption of renewable generation, storage and new loads like electric vehicle charging, there has been a growing effort to enhance local energy resilience, particularly at the community level. This has led to increasing interest in the development of local or community energy projects, in which individual prosumers are able to generate, store and trade energy within the community — enabling a shift in market power from large utility companies to individual prosumers. Such schemes often involve a group of consumers investing in community-owned asset such as community-owned wind turbines or shared battery storage. Yet, developing methods to enable efficient control and fair sharing of jointly-owned assets is a key open question, of both research and practical importance. In this paper, we provide a method inspired from game theory concepts to fairly redistribute the benefits from community owned energy-assets such as community wind turbines and storage. We propose a heuristic-based battery control algorithm for maximization of behind-themeter self-consumption, which considers the effect of battery life degradation. Using real consumption and production data to model a community of two hundred households, we assess and compare technical and economic benefits of investment in individually-owned or community-owned assets such as chemical storage. We show that battery storage simple pay-back period can be considerably reduced by sharing the asset within a community. Finally, we compare several redistribution and benefit allocation schemes for community-owned assets, and show that the proposed scheme based on principles from cooperative game theory achieves the fairest redistribution.


Introduction
The ongoing effort to tackle climate change and the drive towards a low-carbon economy have led to an exponential growth in the deployment of renewable energy sources (RES). In different countries around the world, the rapid growth in RES has been facilitated by technological advances in renewable energy generation and storage, but also by financial incentives and ambitious policies that target adoption of renewable energy [1].
In recent years, the number of distributed energy resources (DERs) connected to the low voltage distribution network has rapidly increased, partly due to the incentives offered (such as guaranteed feedin-tariffs (FITs)). This has led to interest in the development of a more decentralized energy system, enabling a significant shift in market power from large producers to individual prosumers (i.e. small-scale being phased out as a support mechanism, i.e. they are gradually reduced or are well below retail tariffs available from large operators [3]. For instance, in the UK, FITs are no longer available to producers of  [4]. This has led to the emergence of local or community energy systems where prosumers aim to maximize behind-the-meter self-consumption from local renewable generation, thereby reducing the need for both exports, but also imports and hence, dependence on the central power grid. An energy community is made up of a number of prosumers, who are defined to be consumers but also producers [5]. Prosumer assets (renewable generation capacity and storage) can be either distributed at individual households or centralized and thus shared within the community. A key research area in this context is the development of appropriate community schemes and control strategies for optimal scheduling of end-user production and consumption. Therefore, there is an increasing interest from academics and industry in community energy models for the optimization of self-consumption [6] in community microgrids.
Recently, the number of deployed and planned community energy projects has increased rapidly in the UK and worldwide. In the UK, Community Energy Scotland (one of the largest organization involved in developing community energy projects) lists more than 300 community energy projects [7]. An area of focus for policy makers is empowering communities with the development of innovative and integrated local energy systems and networks as identified in the Scottish Energy Strategy [8]. In a similar fashion, the UK government has committed to an extensive program to support community energy projects to reduce, purchase, manage and generate energy by identifying clean growth as one of the four grand challenges in the UK's Industrial Strategy [9]. These policy initiatives show that governments have an instrumental interest in community energy and seek to facilitate consumer-led, transformational and sustainable energy transitions. A number of projects are looking at low-carbon decentralized energy systems, including CESI (The UK National Centre for Energy Systems Integration) [10] and the ReFLEX (Responsive Flexibility) project that aims to develop a large-scale demonstrator for community energy integration in Orkney, Scotland, UK [11]. Similar rising trends in smart energy community initiatives can be seen across the United States (such as the Brooklyn Microgrid project [12]), and across Europe (see [13] for an overview).
The concept of energy communities is equally important -arguably even more so -in developing countries, where access to central power grid is limited or even non-existent, hence investments in community energy projects provide an alternative way for consumers to gain access to electricity. Examples of settings where households have limited and sometimes no access to a central power grid include many communities in sub-Saharan Africa [14] and even some in South Asia [15]. Given the lack of central grid access, rural communities often form off-grid or stand-alone microgrid energy systems, where communities invest in local embedded micro-generation and storage assets to satisfy their energy needs. Hence, for such developing country settings, novel methods to share the costs of investments, and also the benefits from community energy projects (such as the ones we develop in this paper) are very relevant. Community energy projects are seen as a way to reduce poverty, stimulate the local economy and bring additional environmental, social and financial benefits 1 [17].
Given the above challenges, there is an urgent need for methods to increase energy access, resilience and reliability of communities. One way is for the community to invest in its own energy generation assets like solar PV and wind turbine, and battery energy storage systems. But, this raises the question of discovering benefits/drawbacks when investment in energy assets is performed individually or jointly on a community level. In other words, renewable generators and storage could be installed either individually at a household level, or jointly-owned, which all households in the community could use on a pre-agreed sharing basis. A literature survey on previous techno-economic analyses of 1 Numerous energy projects deal with the issues of enabling resilient energy communities in developing countries. One such project that the authors are involved with is CEDRI (Community-scale Energy Demand Reduction in India) [16], a large-scale joint UK-India collaboration into smart energy systems.
such schemes reveals that community-owned assets could provide more savings (higher benefits) compared to distributed individually-owned assets. A possible reason for better performance is due to identified economies of scale in the community investment model, because of better sizing (as it avoids over-sizing of individual units). Examples of sharing of resources in energy communities are emerging peerto-peer (P2P) energy exchanges between prosumers but also energy coalitions [18], where an aggregator or community energy operator is responsible for managing and distributing the benefits from shared assets to members of the community. One such successful scheme is the ''Ecovillage'' of Findhorn in Scotland, UK [19]. An important challenge that energy community schemes raise is the need for reaching agreements that ensure fair allocation of revenues and benefits earned by jointly-owned assets.
Another challenge is that management of energy community assets consisting of renewable generation and storage (hybrid energy systems) require careful consideration of assets' cost, sizing and operation, such as to maximize their Remaining Useful Lifetime (RUL), and hence return on investment. Technically, for instance, the depth to which a battery is discharged, the discharge current and the chemistry used has a direct effect on its remaining useful lifetime. This translates into a considerable impact on the total cost of operation and maintenance of the battery, especially as energy storage is one of the most expensive component of a hybrid energy system. Moreover, the frequent charging and discharging operations leads to cyclic ageing and incurs an extra cost as it accelerates the depreciation of the battery. Along with the fact that batteries' lifetime is comparatively shorter than that of renewable generators, this highlights the importance of using an appropriate battery control mechanism to extend the system's useful life.
In most of the literature reviewed, studies show that the community battery storage system offers higher benefits as compared to individual household distributed batteries [3,20]. However, most of existing studies, to our knowledge, do not consider the battery degradation cost when determining the optimal battery capacity. The battery lifetime depends on the charge/discharge cycles, which in turn are shaped by the control scheme. Thus, there is a need to accurately estimate the depreciation of the battery from the operating profiles and therefore assess the operational cost and overall economic value of the hybrid renewable energy system. Furthermore, although higher benefits can be achieved by investing in community assets, how to redistribute these benefits among the individual households in the community still remains a key open question, of both research and practical interest. Hence, there is a significant knowledge gap in how to design efficient and fair redistribution mechanisms to incentivize energy communities to invest in joint renewable energy assets, especially when incorporating physical asset constraints or the physical degradation during use of community assets.
In this paper, we provide a redistribution mechanism based on the marginal contribution of an individual household in the benefits from the community-owned assets, incorporating physical assets degradation. The mechanism proposed uses principles from mechanism design and cooperative game theory. Game theory provides an insightful analytical and conceptual framework along with mathematical tools to study and analyse the complex interaction among independent rational players (in our case the households) [21]. Cooperative (or coalitional) game theory has been identified as a useful tool in designing incentive mechanisms and business models in decentralized energy systems. In a cooperative game, players form coalitions to maximize a common objective for mutual benefit. Then, the benefit is distributed equally or fairly among themselves using incentive-based solution concepts, such as the Shapley value. One major challenge faced by community energy scheme utilizing coalition game theory is the issue of scalability [18,22]. Specifically, when determining the Shapley values in a coalition, the computation becomes highly complex and time-consuming, as the number of players increases in the coalition. To address this computational challenges, we propose in this work a more computationally tractable (and hence more practically applicable) redistribution mechanism based on the marginal contribution of each players. Another gap identified in the literature, is that techno-economic analysis of individual versus community assets is mostly focused on battery and solar PV only, and wind turbines have not been adequately investigated. Inclusion of wind-battery systems though is very important, especially in a country with remarkable wind resources like the UK.
Given the above challenges, in this paper we utilize real wind and demand data over a full year and develop a mechanism for fair redistribution of benefits from community assets (battery and wind turbine) to individual prosumers. Findings of this work are related to a number of strands including community energy system research and cooperative game-theoretic applications for energy systems, but also to the area of electrical engineering and physical asset health monitoring of batteries. In more detail, the key contributions of our paper can be summarized as follows: • First, we provide a principled model of community investment and sharing of energy assets, such as renewable generation and battery storage for both fixed and dynamic time of use (ToU) tariffs. • Second, we incorporate physical battery degradation into community energy optimization models, including its effect on redistribution schemes. To achieve this, we employ a battery state of health degradation model based on the battery depth of discharge in each control cycle. • Third, we investigate and propose redistribution schemes for sharing the benefits of community energy assets, based on principles from cooperative game theory, an established methodology for designing redistribution schemes in a number of practical domains [18,21]. These are assessed in different scenarios and on a number of criteria, ranging from costs and financial benefits to each prosumer, and correlation with intermittent renewable output. • Finally, we discuss the savings of the proposed redistribution schemes for different sizes of prosumers, and assess their fairness and effect of different redistribution schemes on potential renewable uptake in energy communities.
The novelty of our work is twofold. First, the paper models the control of energy community assets from an economic and technical perspective with an unprecedented level of detail, to the authors' best knowledge. This includes for example, incorporating real state-of-theart battery control and degradation functions, using real commerciallyavailable, dynamic tariffs from the UK market, as well as a whole year of high-granularity demand and renewable generation data. Second, inspired by coalitional game theory methods, this paper provides a novel algorithm to fairly redistribute among community members the benefits from community owned assets, which is shown to have desirable redistribution and computational benefits, compared to existing methods for sharing output of community energy assets.
The rest of the paper is structured as: a review of different areas of relevant prior literature is presented in Section 2. Single prosumer model along with the battery control algorithm, and deprecation model is described in Section 3. Techno-economical analysis of individual versus community assets, and the various redistribution schemes of benefits achieved from community assets is presented in Section 4. Finally, Section 5 concludes with a discussion and outlines some topics for future work.

Related work
Given the practical challenge that needs to be addressed, our work addresses several areas of research, discussed in the paragraphs below. First, we highlight state of the art research that model prosumers and energy communities with renewable generation and storage assets, as this is the base of the work proposed in this paper. Then, we describe state of the art approaches for redistribution of benefits from community owned assets among energy communities. We highlight that there is currently a gap that could be filled with a fair and tractable redistribution process for energy communities.

Home energy management system (HEMS) and prosumer optimization for maximization of behind-the-meter self-consumption
In existing literature, self-consumption from renewable generators is mostly achieved at individual household level through HEMS [23][24][25]. In most HEMS systems reviewed, matching of generation and demand profiles is optimized through the integration of battery energy storage systems (BESS) with demand side management (DSM) strategies and flexible tariffs. Thus, BESS has become an indispensable asset in HEMS for maximization of self-consumption, which is mostly defined in terms of reduction of the energy bill. In the work of Golmohamadi et al. [26] battery is integrated with HEMS to minimize the bill by reducing the energy consumption of thermostatically controllable appliances. Mehrjerdi et al. [27] proposed a unified HEMS that coordinates a hybrid system of renewable generators (solar and wind), BESS, demand response and flexible demand, including electrical and hydrogen vehicles. It recommends that BESS should be optimally sized in order to maximize self-consumption. Hemmati & Saboori [28] presented a HEMS with optimal BESS scheduling for optimal utilization of solar PV generation, while also taking into account the uncertainty associated with solar irradiation. In the work of Castillo-Cagigal et al. [29], the BESS is integrated with DSM to maximize the self-consumption from solar PV generation. Various optimization techniques are applied by HEMS to reduce energy bills. An extensive review on various optimization techniques employed in HEMS is presented by Qayyum et al. [24] and Beaudin & Zareipour [30].
Optimization and control incorporating the physical degradation of assets, especially battery degradation models Useful battery lifetime depends on the frequency of charging/ discharging and depth of discharge (DoD). Most existing and emerging battery degradation models are focused in developing a methodology for estimating the useful life of a battery due to cyclic degradation. Ke et al. [31] have proposed an equivalent charge cycle estimation method to evaluate the effect of providing the energy balancing service on battery life. Yan et al. [32] incorporated dynamic battery life degradation in cost accounting model of energy storage system used for providing grid frequency regulation in the ancillary services market. Similarly, Ju et al. [33] proposed a hybrid energy storage system incorporating the degradation cost of battery and supercapacitor based on DoD and lifetime, while Xu et al. [34] developed a semi-empirical battery degradation model that assesses battery-cell life loss from operating profiles. In the work of Wang et al. [35], battery degradation and windbattery optimization models are integrated and used for operation and bidding in real-time electricity markets. Recently, Terlouw et al. [36] have proposed a multi-objective optimization framework for energy arbitrage using community energy storage incorporating battery degradation in the optimization problem. However, developing a detailed battery degradation model for determining the optimal battery capacity using real data, is still an open question. Furthermore, the need to include battery degradation models in the real time decision process of an Energy Management System has not been discussed until now.
Community energy schemes As discussed in the introduction, several energy community projects have been developed worldwide, including both in the UK and the EU. For instance, Seyfang et al. [37] have conducted a detailed UK-wide survey on energy community projects, and concluded that projects are diverse and rapidly growing. Recently, community energy has gained increased attention from a social perspective angle emphasizing on: social innovations and dynamics [38], socio-technical energy transitions [39], social entrepreneurship [40], grassroots innovation [41], social acceptance and participation [42] and social investments [43]. Mendes et al. [44] have surveyed various optimization and simulation tools for the planning and operation of micro-grids and integrated community energy systems. Batteries, along with renewable generators (solar PV, wind turbine) are the most common assets considered in community energy schemes.
Techno-economic comparisons between energy models with individual prosumer assets and models with centrally-shared community assets have recently gained increased attention in the literature. Most of the studies focus on comparing battery storage adoption at the individual household scale to storage adoption on the community scale. Barbour et al. [20] have compared household energy storage (HES) to community energy storage (CES). Their results show that the community battery performs better compared to individual household batteries as it requires less storage capacity overall and increases the selfconsumption rate. Similarly, techno-economic analysis of household and community energy storage was assessed by Stelt et al. [3]. Here, the CES was owned and operated by the utility company. The economic value of both HES and CES was assessed by considering the cost of energy imported from the grid. Results shows that economic feasibility of both the HES and CES is largely determined by the investment cost of the storage capacity per kWh. Similar assessment of household level versus CES at grid-scale level is conducted by Sevilla et al. [45]. However, their study primarily focused on solving the issue of PV curtailment.
Virtual community energy storage, similar to the concept of virtual power plant (VPP), is proposed by Schlund et al. [46]. Individual household batteries are linked together to form a virtual community storage aiming to improve self-consumption by minimizing imported power from the grid, and thereby reducing the stress on the grid. Recently, Koirala et al. [47] have provided an overview of the state of the art in community energy storage. Similarly, an overview of the economic potential and current research on community energy storage was outlined by Sardi & Mithulananthan [48] and Strickland et al. [49]. The review states that CES have huge potential to minimize the stress on the grid by reducing import and maximizing self-consumption. However, to our knowledge, previous works on techno-economic analysis of individual vs. community assets, while considering both renewable generation and batteries, have not included a battery degradation and control model in their calculation. Moreover, there is still a need for mechanisms designed to fairly redistribute the benefits from jointly-owned assets.

Benefits redistribution approaches
Coalitional game theory and redistribution mechanism in energy communities In the context of decentralized energy systems, coalitional game theory has been identified as a promising solution for designing incentive mechanisms for community energy trading and sharing. For instance, Alam et al. [18] proposed an energy exchange mechanism in rural communities that aimed to reduce battery usage and where approximated Shapley value was used for the distribution of benefits among agents. Recently, Tveita et al. [50] compared annual electricity cost allocation among prosumers and consumers using solution concepts from cooperative game theory. Both nucleolus and Shapley solution concepts were used to determine the annual electricity cost deviations as key asset parameters vary. While various operational scenarios were studied, only four players were considered, thereby raising scalability issues associated with increasing players and effects on coalition formation. Similarly, Chakraborty et al. [51] investigated the sharing of storage systems among consumers in a time of use (TOU) price set-up using cooperative game theory. Sharing mechanism is designed based on the solution concept of core and illustrated using only the five households which raises the issue of the scalability and practicality as the household increases in the coalition. Moreover, the storage is considered ideal thereby neglecting the degradation aspect of the battery. In the work of Marzband et al. [52], cooperation among energy communities was studied in order to reduce the annual electricity cost, and profit redistribution mechanisms were designed based on solution concepts from coalitional game theory. Furthermore, Robu et al. [53] considered coalition formation for minimizing group buying risk. Here, consumers cooperate to form a group to buy electricity under one or several tariffs. Lately, a blockchain-based coalitional formation algorithm for trading energy was proposed by Thakur & Breslin [54]. Various community energy trading schemes based on coalitional game theory can also be found in [22,[55][56][57]. One of the major challenges in redistribution schemes based on coalition game theory is the issue of scalability. Specifically, when determining the solution concepts such as Shapley values in a coalition, the computation becomes highly complex and time-consuming as the number of players increases in the coalition. Thus, there is still a need to develop a redistribution mechanism that is fair, but also computationally tractable and hence more practically applicable.
To address these limitations, we propose a study that first assesses the techno-economic benefits of community-owned energy assets compared to individual energy assets. Then, using a methodology from cooperative game theory, this paper proposes a new distribution mechanism based on the marginal contribution that fairly shares these benefits from community-owned assets. In order to assess the benefits from community-owned assets including a comprehensive model of battery degradation, we propose an approach based on real timeseries data of a community, and compare the benefits provided by community-owned assets with the benefits expected from individual assets. We start first by modelling each agent (prosumer) in a community, as described in the following section.

Single prosumer study
In this section, we propose a comprehensive model of a single prosumer, with the objective to determine the benefits a prosumer can expect from owning a RES and/or a BESS.

Model overview
The model of a single prosumer includes the following assets owned by the prosumer: A power flow diagram of the single prosumer model is shown in Fig. 1. The overall power balance of the system at any given time is given by: where corresponds to the end of the considered time period for the operation of the system. For example, if the operation window [0, ] consists of a full calendar year with half-hourly time steps, then |[0, ]| = 365 × 48 = 17520 time steps. wind/solar ( ) is the power (or energy as fixed time interval is considered) generated by the renewable generator (either wind turbine or a solar PV installation). grid ( ) represents the power that a prosumer can buy/sell power from/to the grid. bat ( ) represents the power of the storage system, which is considered negative when the battery is charging (battery considered as load), and positive when the battery is discharging (battery considered as generator). ( ) is the power consumed by the prosumer.
The battery is used to store the excess power from the intermittent power source (wind or solar). The prosumer demand ( ) is considered inflexible and needs to be satisfied at all times by these three power sources (RES, BESS and the grid). The control algorithm for the battery to meet the demand ( ) with these three power sources is defined in the following subsection.

Battery control algorithm
The operation of the battery is constrained by the state of charge (SoC) levels, and a maximum power ( bat,max ) that the battery can be charged or discharged at, which corresponds to its maximum C-rating.
At any given time of a charging phase, the battery is charged with an efficiency ( ) until it reaches the maximum battery capacity ( max ). Charging constraints are defined as: Similarly, the battery can be discharged with an efficiency ( ) until it reaches its minimum battery capacity ( min ). Discharging constraints are defined as: The minimum battery capacity corresponds to the maximum allowable depth of discharge (DoD). A battery control scheme consists of operational real-time decisions to charge or discharge the battery. In this subsection, we propose a heuristic-based battery control algorithm that aims to charge the battery when there is excess of power, and discharge the battery when there is a deficit of power. The algorithm can be described as follows: If wind/solar ( ) > ( ), there is excess of power generated from the intermittent source. The control strategy of the battery dictates the following: i Excess power is stored in the battery (charging operation).
ii If the battery is full or if available power is greater than the maximum acceptable charging power, the prosumer sells the excess power to the utility grid at a selling price equal to ( ).
The resulting SoC profile and the energy exported ( ) to the grid during the identified duration of excess generation are determined as: where corresponds to the duration of the considered time step. Similarly, if wind/solar ( ) < ( ), then there is a deficit in power supplied by the intermittent source and the battery will operate as follows: i Discharge the battery to meet the demand. ii If the battery energy or power are not enough to compensate the power deficit at this time step, the prosumer buys the remaining deficit power from the utility grid at a buying price equal to ( ).
Hence, the SoC profile and energy imported ( ) from the utility grid during the identified duration of deficit in energy are determined as: A flowchart of the proposed control strategy is shown in Fig. 2. Algorithm 1 outlines this heuristic if-then rule based control strategy. The proposed control algorithm is generic in nature and can be easily extended to incorporate decisions based on price signals, although our extensive experiments showed that incorporating current ToU price signals in the algorithm did not provide greater benefits to the prosumer.
The performance of the heuristic-based battery control strategy was compared with an optimization-based battery control [58] based on Mixed Integer Linear Programming (MILP) that determines the optimal battery schedules for a future period (day-ahead for example) based on forecasts of future renewable generation, demand and electricity prices. Fig. 3 shows the comparison of the bill of a prosumer for different battery control algorithms, such as the proposed heuristic based algorithm (in yellow), and 2 optimization based control algorithms with different time horizon. One can see that the longer the optimization time horizon is, the better the control decisions will be. However, this does not include the risk of forecast uncertainties.
Hence, results show that in the case of electricity import prices ( ) always greater than electricity export prices ( ), heuristic-based battery control and optimization-based battery control for arbitrage give comparable benefits to the prosumer, yet with a much greater complexity and uncertainty observed for the optimization-based battery control algorithm. Therefore, the rest of our study only considered the heuristic-based battery control scheme.

Battery degradation model
To determine the economic viability of hybrid power systems that include battery energy storage system, it is important to assess the depreciation (degradation) of the battery, since the battery lifespan is much shorter than the one of other assets such as renewable generators [34,35]. The useful battery lifetime depends on the frequency of charge/discharge cycles, and on the depth of discharge (DoD) [32,59]. Indeed, frequent deep charging and discharging operations lead to cyclic ageing inflicting additional costs, as the depreciation of the battery is accelerated [60]. Thus, there is a need to accurately estimate the depreciation of the battery to assess the operational cost and overall economic value of the battery energy storage system.
Calendar life refers to the number of years a battery is expected to last until it reaches its end of life (EoL). EoL is normally defined as a state of the battery when the maximum capacity of the battery reduces to 80% of its rated initial capacity. It is independent of its cycling behaviour, and thus it is normally regarded as constant [60]. Predominantly, the service life of the battery usually degrades when subjected to repeated charge/discharge cycles. Furthermore, battery life not only depends on total number of cycles, but also to the depth of discharge (DoD) of the cycles as specified by the manufacturers. Therefore, most of the emerging and existing battery degradation models assess the useful life of a battery by considering cyclic degradation [31][32][33][34][35][60][61][62].
A battery cycle life corresponds to the number of charge/discharge cycles the battery can undergo based at a certain DoD as specified by S. Norbu et al. the manufacturer. Typically, the number of cycles in a battery lifetime versus the cycle's DoD is specified in the battery data sheet as shown in Fig. 4. For instance, if the total number of permitted battery cycles is 2000 with 80% DoD, it means that every cycle from 100% state of charge (SoC) to 20% SoC consumes 1/2000 = 0.05% of the total life. Fig. 4 shows that, as the DoD of the charging/discharging cycle increases, the expected cycle-life of the battery decreases. This means, a battery that is exposed to shallow charging/discharging cycles is expected to have a longer cycle-life than the battery that is exposed to deeper discharges [61]. It is important to note that the number of cycles versus DoD curve provided by manufacturers is obtained at specific temperature and C-rating.
A cycle is defined to have been completed when the battery depth of discharge has returned to the starting point of the cycle. We can distinguish full cycles that consist in equal discharging and charging depth or half cycles that consist in either a charging or discharging phase. We can also distinguish regular and irregular cycles, depending on the starting and ending SoC of the cycle, as defined below: • Regular cycles: in this cycling process the starting SoC is 100%, then it is discharged to a certain SOC corresponding to a specific DoD and recharged back to 100% SoC. For example, 100% SoC-to −50% SoC-back to 100% SoC corresponds to 50% DoD cycle. • Irregular cycles: in this case, the starting SoC is not other than 100% SoC, i.e. cycles start at any arbitrary SoC value. For example, 80% SoC-to −30% SoC-back to 80% SoC, which also corresponds to a 50% DoD cycle, relatively to the starting SoC.
In both cases, the DoD may be same, but the battery degradation is sensitive to the starting SoC. Note here that the number of cycles versus DoD specified in manufacturer data-sheets are based on regular cycles only. In real-life applications, the battery can hardly run regular cycles from 100% SoC to a specific DoD [31,35]. Thus, an important aspect when integrating battery storage degradation in the economic analysis of a prosumer, is to assess the impacts of irregular cycles. In this paper, a rainflow cycle counting algorithm [63,64] is adopted to count half and full cycles. Then, the algorithm is further modified S. Norbu et al.  to determine regular and irregular cycles. This algorithm was initially proposed by Socie and Downing [63] for material fatigue estimates, and has been widely used for extraction of full or partial cycles in battery degradation models [31,34,35,60,65]. In this paper, we only consider Lithium-ion battery technology and used the battery cycle life data from [34]. Fig. 4 shows the number of cycles, noted cycles , that a battery cell can perform before the battery capacity reduces to 80% of its initial capacity.
The input to the rainflow cycle counting algorithm is the SoC profile resulting from the simulated operation of Algorithm 1. Outputs include the number of cycles the battery experienced, which are classified by type (full or half cycles, regular or irregular) [34]. The number of cycles is also classified by their DoD and starting/ending SoC.
The depreciation factor (DF) is then determined to estimate the battery lifetime. The expression of the battery depreciation factor for a certain operating period can be expressed as follows: DF = DF regular + DF irregular (12) where DF regular and DF irregular correspond to the depreciation factor for regular and irregular cycles respectively. When the Depreciation Factor value is equal to 1, this means the battery remaining capacity is below 80%, hence the battery needs to be replaced. For, regular cycles the depreciation factor is calculated as: where DoD,regular corresponds to the number of regular cycles at the specific DoD experienced during operation, and DoD,max is the number of permitted regular cycles in the life time of the battery (for a specific DoD) as specified by the battery manufacturer and shown in Fig. 4. For, irregular cycles the depreciation factor is calculated with the following process, inspired from the work of Ke et al. [31]. Irregular cycles start from a state of charge different than 100% and end at a state of charge . The depreciation factor ( ) due to one irregular cycle from to is then given by: where corresponds to the maximum number of cycles allowed in the battery life time (given in Fig. 4) for an equivalent DoD, ( ) corresponding to a fictitious cycle starting at 100% SoC, and ending at a SoC equal to . ( ) is given by: The same applies to . Finally, is defined as follows: Then, the depreciation factor for all irregular cycles DF is defined as: where is the set of all irregular cycles.

Economic study of residential batteries
The aim of the economic study for a single prosumer is to determine the conditions that make the battery most profitable. To achieve this goal, the presented algorithm 1 is implemented using different parameters (battery characteristics, prices, production and demand time-series) that can be changed in order to realize a sensitivity study on the profitability of a battery at a prosumer level. The resulting bills for a single prosumer are then compared in order to identify what parameters have the greatest impact on the battery profitability.
Broadly speaking, the yearly bill of a prosumer ( ) can be expressed as the sum of the cost of the annual energy consumption, sum of revenues earned by exports to the grid and the depreciation cost of the assets , as shown below: where the energy import ( ) at time step is given by Eq. (11), and the energy export ( ) at time step is given by Eq. (8). However, as many countries have reduced or removed export prices under the form of feed-in tariffs, our analysis will not include revenues from energy export. Hence, the yearly bill without feed-in tariff is determined as: In Eqs. (18) and (19), represents the depreciation cost which is due to the usage of the asset within the considered period. For example, for a considered period equal to one year in which the asset is used following the manufacturer's recommendations, ( ) corresponds to the annualized cost of the asset, given as follows:

Asset cost Life time (in years)
.
Taking into consideration the depreciation inflicted by battery operation and control algorithm 1, the computation of the depreciation cost must be updated as follows:

Asset cost Life time (in years)
) .  [66] provided by British Atmospheric Data Centre (BADC) is used for the analysis. The MIDAS dataset consist of meteorological observations from weather stations located at various parts of the UK. Wind data from the Kirkwall airport weather station located in Orkney, Scotland was specifically chosen to align with the objective of setting a community local energy system. Wind data obtained consist of hourly mean wind speed measured from anemometers at a nominal height of 26 m above the ground, rounded to the nearest knot (1 Kn = 0.5144 m/s). Wind data is cleaned and the missing data is replaced by double spline interpolation function. Similar methods adopted by Fruh [67,68] and Andoni et al. [69] are applied for converting wind speed to power.
A power curve is adopted based on an Enercon E-33 [70] Wind power estimated in kW is converted to W and one hour resolution data is converted to half hourly data (using double spline interpolation function). Conversion of wind power was performed to make it compatible with the resolution of demand data. The wind power estimated from the power curve of the Enercon E-33 wind turbine is shown in Fig. 5. [71] project was used for the analysis. The dataset includes consumption data for 220 UK Elexon profile class-1 and class-2 customers. Demand data consist of half hourly consumption load in Watts (W). In this paper, the demand dataset for 200 houses of class-1 profile, which corresponds to domestic unrestricted customers, was used for the prosumer model. The range of demand across the 200 prosumers varies from a household with the lowest annual consumption of 1001 kWh to the highest annual consumption of 18736 kWh. A typical daily load curve of a prosumer with annual consumption of 1833 kWh is shown in Fig. 6. The daily load curve varies with a peak load of 199 W, average load of 105 W and a minimum load of 37 W.

Tariff structure data.
A pricing scheme was considered only for the imported energy from the grid, while no feed-in tariff was considered (zero export tariff to grid). Two types of pricing schemes, a flat tariff and a dynamic time of use (ToU) tariff were considered. A flat tariff of 16 pence/kWh was adopted after comparing current flat electricity tariff prices offered by various electricity suppliers based S. Norbu et al.  in UK, using [72]. The dynamic ToU tariff was based on Agile Octopus [73] offered by Octopus Energy, a UK-based electricity supplier. Agile Octopus tariff consist of a maximum price of 35 pence/kWh, an average price of 15.9 pence/kWh, and a minimum of 2.8 pence/kWh. Both the flat and dynamic ToU pricing schemes corresponds to real tariffs applied in 2019.

Optimal sizing of the battery and sensitivity analysis
Optimal battery sizing: using the billing expression defined in Eq. (19), we can determine the optimal battery capacity that minimizes Eq. (19) by running a sensitivity analysis on the battery capacity.
To illustrate the sensitivity analysis, we considered a prosumer with an annual demand of 18736 kWh, 1.8 kW rated wind generator, and different battery capacities ranging from 0 to 35 kWh capacity. The tariff considered was a flat grid import tariff of 16 pence/kWh, adopted after comparing the fixed electricity prices offered by various UK-based electricity suppliers using web-tools in price comparison site Money Supermarket [72], without feed-in tariff. The simulation was performed for one year. A battery cost of 150 £/kWh was assumed in this work based on 2019 Lithium-ion battery forecasts estimated by BloombergNEF [74,75]. According to BloombergNEF [75] and PV Europe-Energy Storage [76], battery costs are expected to drop even further in the following years with an estimated cost of less than $100/kWh expected in 2023. The chosen battery cost of 150 £/kWh for the year 2019 is consistent with the Lithium-ion battery cost forecasts for 2020 and 2025 published in the McKinsey quarterly report [77].  A cost of 1072 £/kW for wind generation capacity was assumed based on the development and installation cost of wind turbine according to EIA, Annual Energy Outlook 2020 [78]. This cost reflects the average values of levelized cost of electricity (LCOE) and levelized avoided cost of electricity (LACE) for wind power generating technologies entering service in 2022, 2025 and 2040. Fig. 7 shows the evolution of the bill as a function of the battery capacity and shows that the optimal capacity in this particular case, is close to the battery capacity of a Tesla battery. In addition, the annual bill is reduced by almost £90.
Sensitivity analysis of the battery cost: the cost of the battery and electricity prices are important parameters that affect the profitability of a battery. Fig. 8 shows the evolution of the annual bill of a prosumer as a function of the size of the battery that the prosumer buys and for different battery costs. Simulation results clearly show that there is an optimal battery capacity that minimizes the annual bill, although the benefit in terms of bill reduction highly depends on the battery cost. Furthermore, one can see that the higher the cost of batteries is, the smaller the optimal battery capacity is. This information is extremely useful as it allows a company to size a prosumer's battery based on their particular consumption and production profiles. Nevertheless, it is worth noting that the bill reduction is still quite low (£183) even in the most advantageous case of a battery cost of 50 £/kWh. Sensitivity analysis of the electricity price: the grid buying electricity price ( ) is the third parameter included in the economic analysis of the battery. To realize the sensitivity analysis on the electricity price, we selected a scenario with a battery cost of 150 £/kWh, as recommended in [74]. The baseline electricity buying price is the flat grid import tariff of 16 pence/kWh, adopted after comparing the fixed electricity prices offered by various UK-based electricity suppliers using web-tools in price comparison site Money Supermarket [72]. This website is one of the several price comparison sites approved and accredited by the Office of Gas and Electricity Markets (Ofgem) [79], the government regulator for the electricity and downstream natural gas markets in UK. The chosen baseline electricity buying price from grid is consistent with the average cost for the standard electricity in the UK as per the quarterly energy prices, quarter 1 (January-March) 2019 report [80] published by Department of Business, Energy & Industrial Strategy [81]. Similar flat rate is adopted in the works of Zhou et al. [5], and Luth et al. [82]. To conduct the study, different scenarios were analysed, each one corresponding to a specific electricity buying price, as shown in Fig. 9. The simulation results shows that annual bills increase with the increase in electricity price. This increase in annual bills is expected as the prosumer spends more money to satisfy his electricity consumption.
Results show that the higher the price of electricity is, the more advantageous it is to install a battery system. For instance, for the scenario of a buying price equal to 24 pence/kWh, the decrease in annual bill is £200 with an optimal battery size of 18 kWh, while it is £15 in the case of a buying price of 8 pence/kWh and a battery capacity of 5 kWh.
Thus, this study shows that the increase of electricity prices along with the decrease of battery costs can make batteries profitable for prosumers. Furthermore, as shown in Figs. 7-9, increasing the battery capacity too much will increase the annual bill. Indeed, if a prosumer buys a battery that is much larger than the required size, the extra capacity will not be used, and will correspond to a loss of revenue.
Finally, the simulations show that with current market prices, the batteries are not profitable for most prosumers, unless economic parameters such as the battery cost and electricity price change, as it might be expected in the next decade [74]. The result is similar to the findings by Stelt et al. [3], who concluded that the economic feasibility of batteries depends largely on the battery cost, and that the current battery cost is found to be economically infeasible. However, it is worth noting that in our model, we have not considered any benefits obtained from energy or grid services that could be provided by the battery, such as frequency and demand response services.

Energy community configuration
In this section, we provide a comparative study of benefits provided by DERs and BESS to prosumers between a scenario where every prosumer installs his own assets, which corresponds to the case presented in Section 3, and a scenario where prosumers join together to invest in community assets. Furthermore, we provide a novel approach to share the revenues generated by community assets to the members of the community.

Energy community modelling
In this scenario, we consider a community of 200 prosumers with real half hourly demand profiles based on the dataset provided by the Thames Valley Vision End Point Monitor [71] project. These 200 demand profiles are further aggregated [20] to represent a single community demand profile. A community is formed by connecting all individual prosumers or individual agents into a system that is collectively referred to as a multi-agent system.
Specifically, for an agent with = 1 … and = 200 in our case, ( ) represents the generation from the intermittent renewable source and ( ) the demand at time ∈ [0, ]. The energy bill of agent at time is represented by ( ), whereas if the considered period is equal to one year, then ( ) represents the total annual bill as outlined by Eq. (19).
The community , i.e. the set of all agents , is formally defined } where = 200 agents. Accordingly,  ( ) and  ( ) represent the generation and demand of the community  at time . Similarly, the community bill at time is represented by  ( ), and the annual bill is given by  ( ). The model inputs, battery control algorithm 1, battery depreciation aspects and the economic setting of the single prosumer model described in Section 3 are applied to the community setting. We consider renewable generation from wind as outlined in Section 3.2.1.1 along with a battery energy storage system. The cost of energy assets are assumed to be 150 £/kWh for the battery [74], and 1072 £/kW for the wind turbine [78]. As outlined by Eq. (19), the annual bill for agent and the community  are defined as: where, ( ) ( ) is the cost of energy imports from the utility grid by agent at time and ( ) is the depreciation cost of assets owned by agent in the considered period . Similarly,  ( ) ( ) is the cost of energy imported from the utility grid by the community as a whole at time and  ( ) is the depreciation cost of community assets for the considered period .

Mechanism for a fair redistribution of benefits achieved from community shared assets
Community assets lead to a reduction in the electricity bills of all the members of the community. However, this raises the key question of how these financial benefits from the joint assets can be fairly shared between agents. In this section, we propose a new methodology for fair redistribution of cost savings from community energy assets that utilizes the marginal contribution principle, often used in cooperative game theory.
Savings of the community after one year ( = 1 year), noted as  ( ), are defined by the difference between the sum of all agents annual bills before the community assets were installed (which corresponds to the baseline scenario shown in Table 1), and  ( ) i.e. the energy bill for the whole community after one year with community assets. Hence, the community savings over time period correspond to the bill reduction for the whole community over that period, as shown below: where 0 ( ) is the baseline bill for prosumer before any asset was installed, which corresponds to the values displayed in Table 1. In order to compute a fair redistribution of the community savings among the individual agents, we propose to compute the contribution ( ) of each agent to these community savings. To compute the marginal contribution of an agent , we remove agent from the community of 200 agents (total community), and recompute the community savings consisted of 199 agents (reduced community). The marginal contribution ( ) of agent is defined as the difference between the total community savings  ( ) and the savings of the reduced community ⧵{ } ( ), as shown below: where  is the community of 200 households. Once the marginal contribution ( ) is computed for all the agents, we distribute community savings  ( ) among the individual agents based on the following equation: where ( ) is the amount of money redistributed to agent after period . Hence, the new bill of agent for the time period , noted * ( ) can be computed as follows: * ( ) = 0 ( ) − ( ) ∀ ∈  Intuitively explained, the marginal contribution ( ) of agent represents the difference that an agent makes to the value of a given coalition in the community. Specifically, the marginal contribution ( ) is a metric that help us understand how much each agent contributes to Table 1 Baseline scenario: the sum of individual agents yearly bills and community yearly bill without the assets (wind turbine and battery) for both the flat tariff of 16 pence/kWh [72] and dynamic Agile Octopus ToU tariff [73]. the reduction of the energy bill and overall community savings, leading to an equal and fair redistribution of savings as shown by Eq. (29). Existing coalitional game theory redistribution mechanism based on solution concepts like the Shapley value use marginal contributions at their core, but present issues of scalability as the number of agents in a coalition increases. Particularly, computing the Shapley value is computationally challenging [18,83], as it requires the computation of the marginal contribution of each agent to every possible subset of a given coalition. The proposed redistribution mechanism ( ) is faster as it computes only the marginal contribution ( ) of an agent with respect to the grand coalition, therefore it scales better as the number of agents increases. The proposed sharing mechanism refereed as Method 1 based on marginal contribution, is aligned with the fundamental concept of cooperative game theory that concentrates on the division of payoffs from the community coalition, and not so much on what agents do to achieve those payoffs.

Comparison of individual and energy community schemes
Energy communities are able to maximize the behind-the-meter selfconsumption by investing in the individual or joint community-shared renewable energy assets. In order to assess the most profitable investment options, the benefits (savings) obtained from the investment in the distributed individually-owned assets are compared to the benefits obtained from the investment in the community-shared assets. The yearly savings are determined by comparing annual bills after investing in the assets (as described by Eqs. (24) and (25)) with the yearly bills before the assets were installed (i.e. without assets).
First, we define a baseline scenario. In this baseline scenario, yearly bills for individual agents and the community are computed without generation or storage assets (DER and BESS) for both the flat tariff of 16 pence/kWh [72] and dynamic Agile Octopus ToU tariff [73]. Table 1 shows the community annual bill (  ( )) and the sum of individual agents annual bills ( ∑ =1 ( ), where = 200). It can be observed that without these local assets, annual bills are equal, which can be expected as the community represents the aggregated demand profiles of the individual agents. This baseline scenario is used for comparing the savings (benefits) from investing in generation and storage.
• Individual wind turbines versus community wind turbine First, we compare the benefits provided by a community DER to the benefits provided by distributed DER, without considering any storage system. In this scenario, only the investment cost of the wind turbine is considered. Also, we assume the operations of the DER follow the manufacturer operations. Hence, the depreciation cost of the wind turbine operation is not included. We also assume that every prosumer owns a wind turbine with a rated power equal to the optimal rated power for this prosumer, which is the most conservative scenario for individual wind turbines. Optimal rated capacity of the wind turbine corresponds to that rated power that achieves the minimum annual bill given by Eqs. (24) and (25). Simulations are performed for one year, without a battery energy storage system, and for both flat and ToU pricing schemes.
The sum of individual agents optimal wind turbine capacities and the corresponding sum of individual annual bills are determined. Table 2 Sum of individual agents optimal wind turbine capacities, sum of individual agents annual bills, and community optimal wind turbine capacity and corresponding annual bill for both the flat tariff of 16 pence/kWh [72] and dynamic Agile Octopus ToU tariff [73].  Table 3 Sum of individual agents optimal battery capacities, sum of individual agents annual bills, and community battery capacity and corresponding annual bill for both the flat tariff of 16 pence/kWh [72] and dynamic Agile Octopus ToU tariff [73]. Similarly, the community optimal wind turbine capacity and the corresponding annual bill are determined. Results are shown in Table 2.

Assets
As it is shown by the results, the community wind turbine provides more savings (higher benefits) compared to distributed individually-owned wind turbines. These results highlight multiple advantages that can be obtained by investing in the community wind turbine. Firstly, a community wind turbine requires a substantially lower optimal capacity for the same services. Secondly, lower annual bill is achieved by investing in the community wind turbine for both the flat tariff and dynamic ToU tariff.

• Individual batteries versus community battery
In this scenario, we assume that agents invest in battery storage systems, and compare the benefits of individual versus community batteries. The wind power rating for individuals and for the community are the optimal ratings obtained in the previous scenario with wind turbines only. Similarly, we assume each agent (individuals or the community) invest in a battery of the optimal size, as described in Section 3.2.2. Furthermore, we consider investment costs for the battery and the optimal wind turbine. The depreciation factor of the battery is included to account for the battery usage cost based on Eq. (12). Simulations are performed using the battery control algorithm 1 for one year for both the pricing schemes and with consideration of the battery depreciation cost. The sum of individual agents optimal battery capacities and corresponding sum of individual annual bills are determined. Similarly, the community optimal battery capacity and the corresponding annual community bill are estimated. The results are shown in Table 3. Similar to the wind power case, results show that the community battery provides more savings (higher benefits) compared to the distributed individually-owned batteries. Multiple advantages can be expected from investing in a community battery. First, community battery requires a lower optimal rated capacity while providing the same service. Second, a lower annual bill is achieved by investing in a community battery in both cases of a flat and dynamic ToU tariffs. However, it is important to note that a consequent part of the financial savings obtained from community assets are attributed to the aggregation of the community consumption. Finally, these results were obtained with the same battery cost (per unit of storage) for the community battery as for individual batteries, which might not be the case in a real-world scenario, whereas in practice, the community battery cost might be lower due to the economies of scale effect.

Fair redistribution of benefits achieved from community shared assets
Results from the techno-economic analysis described in Section 4.2.1 show that the community assets provide more savings (higher benefits) compared to distributed individually-owned assets. Hence, individual agents can improve their profitability of investment by joining forces, regrouping into communities and by co-investing in community assets. In this section, we compare different methodologies for redistribution of cost savings from community energy assets, and assess the proposed new scheme that utilizes the marginal contribution principle.

• Implementation for a community wind turbine only
In Section 4.1.2, we presented a method to redistribute benefits from community-owned assets. To test the advantages of the proposed method (denoted below as Method 1), we compare its benefits with other state-of-the-art methods, denoted below as Methods 2, 3 and 4. In this scenario, we focus on the case where a single wind turbine is owned by the community. The following scenario addresses the case with a community wind turbine and a community battery. Energy bills of individual agents after redistribution of community savings from a community wind turbine can be computed by one of the methods listed below: In other words, the wind power allocated to agent at each time step is determined as: The bill of each agent is computed by Eq. (24), where ( ) replaces wind/solar ( ) in Eqs. (8) and (11). -Method 3: Individual bills are estimated after the instantaneous community wind power  ( ) is distributed equally among individuals, as shown below: with the number of households in the community. -Method 4: Individual bills are estimated after the instantaneous community wind power  ( ) is distributed among the individuals based on their annual energy consumption, as shown below: where  ( ) corresponds to the annual energy consumption of agent , and is given by: Finally, savings are determined by comparing the sum of annual bills over the community with the baseline total annual bill (without assets as shown in Table 1). In this study, a community wind turbine with an optimal capacity of 405 kW for a flat tariff, and a 456 kW wind turbine for the case of dynamic ToU tariffs were considered. These correspond to optimal capacities obtained from the scenario with wind turbines only in Section 4.2.1 and shown in Table 2). The investment cost of the community wind turbine was assumed to be shared equally among the agents. The sum of individual agents annual bills and total annual savings after redistribution based on the different methods are shown in Table 4 for a flat tariff, and Table 5 for a dynamic ToU tariff. Savings are determined as the difference between annual bills obtained from the considered redistribution method and the annual bills from the baseline scenario (as shown in Table 1). Fig. 10 shows the individual agents annual bills after redistribution in the case of a flat tariff pricing scheme. In this figure, on the -axis we order the 200 agents (households) in our case-study community increasingly by their total annual energy consumption (over all half-hourly periods in a year), while the -axis gives the annual energy bill of that agent. This representation is useful to investigate the fairness effects. Intuitively, even in the case when investing in community generation/storage assets is better for the community on average, the 4 different redistribution methods may lead to savings being distributed differently across small and larger agents.
S. Norbu et al.  Results for both pricing schemes are shown in Tables 4 and 5. They clearly show that Method 1 and 2 yield to the lowest bill for the whole community, and thus the greatest savings for almost every agent. Yet, Method 1 and Method 2 should undergo further comparison to evaluate the economic fairness in the redistribution scheme. The comparison between the two methods is illustrated using the flat tariff pricing scheme shown in Fig. 11. The crossover point between the Method 1 and Method 2 curves shows that under Method 1 redistribution scheme, 67% of the agents can achieve lower annual bill, while only 33% of the agents obtain lower annual bills under the Method 2 mechanism. These agents (33%) correspond to households with higher annual consumption. However, according to Fig. 10, agents with higher annual consumption are the agents who already obtain the highest bill reduction. Since the cost of the community wind turbine is shared equally among agents, irrespective of their demand profiles, we argue that, overall, it would be fairer to adopt the redistribution mechanism provided by Method 1, rather than Method 2.
While it is true that the 1/3 of largest consumers would prefer Method 2, as shown in Fig. 11, these large consumers already make the largest bill savings from joint assets in both methods, and in practice, having the 2/3 of the smallest households in the community also making noticeable savings is likely to lead to greater social acceptance of the scheme (both in financial terms and in terms of e.g. planning consent to install a wind turbine).
S. Norbu et al.  Sensitivity analysis of the electricity price: the economic fairness and robustness in the redistribution scheme is further evaluated by comparing Method 1 and Method 2 for different electricity buying prices ( ) for the flat grid import tariff, ranging from 8 pence/kWh to 24 pence/kWh as shown in Fig. 12. The simulation results for each electricity import price clearly show that the bills curve for Method 1 and Method 2 cross at the exact same household number, as for the baseline tariff of 16 pence/kWh. Therefore, irrespective of the electricity buying prices, 67% of agents can achieve lower annual bills and thus higher annual savings under Method 1 redistribution scheme as compared to Method 2.
Finally, Fig. 13 shows the comparison between the Method 1 and Method 2 for the Agile Octopus dynamic ToU tariff. In Agile Octopus pricing scheme, the electricity import price varies with an average price of 15.9 pence/kWh, from minimum price of 2.8 pence/kWh to maximum price of 35 pence/kWh depending on the wholesale market prices. Similar to the case with flat tariff, the crossover point between Method 1 and Method 2 curves in Fig. 13 clearly shows that more than 67% agents can achieve lower annual bills and thus higher savings under Method 1 redistribution scheme compared to Method 2. Therefore, the proposed redistribution scheme (Method 1) is fairer than Method 2 for all import prices studied. • Implementation for a community wind turbine and community battery In this scenario, savings achieved from the community wind turbine and community battery along with the aggregation of the community consumption are redistributed based on the marginal contribution Method 1 only. Indeed, other methods as Method S. Norbu et al.

Table 6
Sum of individual agents annual bills and annual savings obtained from Method 1 for flat tariff of 16 pence/kWh [72] and Agile Octopus dynamic ToU tariff [73].

Redistribution mechanism
Sum of individual agents annual bills after redistribution (£) 4 cannot be implemented as they would require to assess the battery use for each prosumer (corresponding to a percentage of  ( )), which is not straightforward as the use of a battery can correspond to a discharge due to the household's consumption needs, but also to a charge due to the lack of consumption from the household. In the analysis for a flat tariff, an optimal community wind turbine capacity of 405 kW and an optimal community battery capacity of 1342 kWh were considered. For dynamic ToU tariffs, we assumed an optimal community wind turbine of 456 kW and a community battery of 1690 kWh (see Tables 2 and 3 obtained for the scenario with wind turbines only). We also considered investment costs for both the community wind turbine and the battery and performed an annual simulation based on the battery control algorithm 1 and pricing schemes, while also integrating the battery depreciation cost as in Eq. (12). Investment costs for community energy assets were shared equally among agents. Savings ( ) from the community wind turbine and community battery are redistributed among the agents based on their marginal contribution ( ), then the bills for individual agents are determined by Eq. (29). Finally, the savings are determined by comparing the sum of these annual bills over the community with the baseline total annual bill (without assets as shown in Table 1). The overall sum of individual agents annual bills and total annual savings after redistribution based on Method 1 are shown in Table 6 for both pricing schemes. Fig. 14 shows the individual agents annual bills after redistribution for a flat tariff. In the case of the community-owned wind turbine only, various state-of-theart Methods 2, 3 and 4 listed in this subsection, are available to allocate the wind power to individual agents. But, these methods are not applicable to community-owned batteries, as there is no clear method to split the power from the battery. Yet, there is still a need to assure fair sharing of the jointly-owned community renewable generator and storage resources. Hence, the proposed Method 1 based on the marginal contribution provides an equal and fair redistribution mechanism to distribute savings from both the community wind turbine and community battery.

Conclusions and future work
In this work we investigated a model of a community investment and sharing of energy assets, including renewable generation and battery storage in a market pricing regime of fixed electricity tariffs and dynamic time of use (ToU) tariffs. A model of a prosumer-based control algorithm was presented and assessed by incorporating the latest heuristics of battery state of health for both at an individual/prosumer level and at a community level. The control algorithm was implemented for different economic parameters that were altered in order to investigate and realize a sensitivity study on the profitability of batteries at a prosumer level. Results from this work display a good performance of the heuristic-based scheduling when electricity import prices are relatively higher than export prices. The simulation analysis (based on real demand profiles, generation data, physical asset profiles and import prices in the United Kingdom at the time of writing) shows that investment in batteries can be an economical feasible proposition, but this result depends on economic parameters such as the cost of the battery, the export prices of electricity, but also the type of services for which the battery can get revenues.
Results from the techno-economic analysis show that community assets provide more savings (higher benefits) compared to distributed, individually-owned assets. The advantages from community assets are multiple. First, community assets require a lower capacity for the same services, hence potentially a lower cost. Second, community assets achieve lower annual energy bills for both pricing schemes considered in the study. The study highlighted the importance for determination of fair redistribution or allocation of benefits achieved in community projects. In this vein, we explored a number of benefit redistribution schemes (four methods in total, based on current practices). We proposed a method based on the marginal contribution of each prosumer, a key concept that assures fair distribution in coalitional game-theory. We showed that the proposed scheme achieved better performance than other methods, while also providing the additional advantage of being computationally tractable.
In future work, our study can be extended to consider new revenue streams for batteries such as provision of ancillary services, like frequency and demand response. The current study assumed a negligible export tariff, that could be integrated in future work to provide a general case and holistic optimization for energy systems with renewable generation. Future work will also consider the exploration of emerging market structures for energy communities such as local and peer-to-peer energy markets. Consideration of flexibility services, integration of physical network constraints in the local energy system, and finally encoding redistribution schemes into smart contracts executed on blockchain systems [84] are also identified as promising avenues for future research. Finally, one direction of work we plan to pursue is exploring the use of our community energy control and redistribution methods for remote communities, or communities in developing countries or regions, such as those in sub-Saharan Africa or parts of Asia. In such settings, energy consumers often do not have access to a central power grid, or power grid supply is unreliable, hence community energy projects often provide the only way to access electricity. The methods proposed in this paper could also be very relevant for these settings, and we plan to explore their application to remote and developing regions communities in future work.