Local Energy Communities in Spain: Economic Implications of the New Tariff and Variable Coefﬁcients

: The European Union advocates for legislative support to local energy communities. Measures include the promotion of dynamic energy allocation and discriminatory electricity tariffs such as the recent Spanish framework. However, the impact of these normative changes is not yet evaluated. This paper inquires into the impact of dynamic allocation coefﬁcient and different electricity tariffs on the proﬁtability of local energy communities. To do so, a linear optimisation model is developed and applied to real consumer data in Spain around a variable capacity photovoltaic generation plant. Comparing the economic performance of the static or variable power allocation under the effect of changing electricity tariffs. While both measures are beneﬁcial, the new electricity tariffs result in larger proﬁtability increases than the planned variable coefﬁcients. The combination of measures allows for proﬁtability improvements of up to 25% being complementary measures. However, installations that maximise the potential for electricity generation are still not as proﬁtable due to the low purchase price of surplus energy. While discriminatory electricity price tariffs and variable allocation coefﬁcients are positive measures, further measures are needed for these communities to install generation plants as large as the potential that each case allows.


Introduction
Local energy communities (LEC) will be an essential cornerstone for the success of the Energy Transition [1]. The European Union (EU) acknowledges in the "Clean Energy for all Europeans" package the need for regulatory frameworks that empower renewable-based self-consumers (commonly referred to as prosumers) to generate, consume, store, and sell electricity back to the grid [2]. Thus, the EU introduces the notion of renewable energy communities as entities managed by natural persons, local authorities, or small enterprises.
Interest in LECs rises from the various benefits the concept of LEC presents. First of all, on the economical side, LECs produce reductions on the electric bills of residential and commercial consumers [3]; this even has the potential to fight against energy poverty [4][5][6]. In addition, deployment of self-generation installations enhances competition and reduces wholesale market prices [7]. Small enterprises can profit from these schemes to reduce their environmental impact and rise energy efficiency in their supply chain management [8][9][10].
On the technical side, LECs produce power generation closer to the consumption point. Thus, reducing power losses [3], leverages the potential flexibility existing at the residential level [7], and increasing the resilience of the users without having to overinvest in grid expansions [11,12].
On the social side, LEC allows an energy system with more participation and democratic control by citizenship [5,13,14], a new source of funding for renewable energy projects, energy-related knowledge generation, expertise and cohesiveness among the members of the community [13] and increase community awareness on sustainable issues [6,13]. Moreover, LECs promote renewable energy production by energy users that did not have access to the necessary space or funds to undertake the installation of renewable installation [15]. Thus, LECs are capable to deliver the benefits of low carbon technologies to lower-income socioeconomic groups compared with individual installations [16]. This has great potential since cities consume two-thirds of the energy supply worldwide, and 70% of CO 2 emissions come from urban environments, making cities a key player in the energy transition [17,18].
Spain has introduced the concept of shared self-consumption in Royal Decrees 244/2019 and 23/2020 [19,20] after eliminating the controversial self-generation legal framework know as "tax to the sun" [21]. However, the current normative only allows sharing generated power under static allocation coefficients. Meaning that the same coefficients are employed during all the hours of the year regardless of the demands of the members. Nonetheless, it is expected that new regulations will allow the use of variable allocation coefficients and, therefore, the power-sharing between users can be adjusted to their different demand curves during the day or the year [22]. This change could improve the process of matching generation with demand and, therefore, increase the self-consumption rates of LEC members. Besides, in June 2021, came into force a new electricity tariff that accentuates the differences between high and low electricity price periods. In it, central hours of the day experience tariff prices over ten times more expensive than night hours. This new billing regulation, together with the introduction of variable allocation coefficients, affects the profitability of LEC, and their efficient performance.
However, the extent of the individual and combined effects of both measures (tariff and variable coefficients) in future LECs is unknown. Understand these effects is vital to both installers and citizens in their decision making around new LECs, their dimensioning, expected performance, and optimal size. To address these questions, we develop a mathematical model of a LEC based on rooftop PV solar generation. In it, we define a Linear Program (LP) problem to minimise the overall electricity costs of LEC consumers by optimising the sharing coefficients (both static or variable) under different scenarios (new and old tariff schemes). With the model, we inquire three main questions. First, which are the effects on the LEC profitability of the sharing coefficient types. Second, which effect would produce the new tariff structures in the profitability of the LEC under the Spanish legislative framework. Third, how these two effects combine depending on the Solar PV generation capacity of the LEC. To do so, we apply the model and analysis to a case study in the city of Valencia with real consumers data.
In the case study, we assume a LEC of 20 residential members. The energy demands from these users employed in the model are real load curves of residential users of Valencia. Then, we have simulated the LEC under different configurations. We study 200 scenarios with capacities from 2 to 100 kWp, the use of fix or variable allocation coefficients and the enforcement of the old or the new electricity tariff. Thus, we can evaluate the economic and self-consumption implications of each variable independently and, also, the synergies they create.
The rest of the paper is organised as follows, Section 2 discusses the current literature around energy communities and their modelling, Section 3 presents the mathematical formulation to optimise and assess the community performance. Section 4 shows the Case Study analysed. Section 5 shows the results from the different simulations and discusses them and their implications. Finally, Section 6 concludes by summarising the main findings of the paper.

Literature Review
LEC concept can involve very different legal and financial models of ownership that undertake a variety of activities within the energy sector [13]. Therefore, to describe them involving all the existing possibilities is a non-trivial task. A reason for the diversity of projects embraced by the LEC concept is that community energy projects have emerged for decades in many countries with no specific regulation [5]. Nonetheless, some characteristics are usually associated with LECs. In general, LECs are local and cooperative: all the members of the community are situated close to the renewable energy installation they own and that are managed with open and voluntary participation by all the members. LECs members can be natural persons, local authorities or small enterprises that manage the community autonomously and whose participation is not their primary commercial or professional activity.
To unlock the potential of LECs, a normative framework that promotes these projects is needed. For this purpose, the European Union (EU) enforced the "Clean Energy for all Europeans" package to define a regulatory framework that empowers renewable-based self-consumers (commonly referred to as prosumers) to generate, consume, store, and sell electricity back to the grid [2]. Inside this package, the EU recasts Renewable Energy Directive [23] and Electricity Market Directive [24] and all Member States have to transpose into national law. Therefore, Spain enforced the Royal Decree 244/2019 completing the new regulation for renewable self-consumption promoted by Royal Decree-Law 15/2018. This regulation introduced a compensation mechanism for prosumers with installed power until 100 kW, establishing an offset price for self-consumption surpluses supplied to the national grid [3]. Next year, the Royal Decree 23/2020 introduced the LEC concept into the Spanish regulation. This regulation established that LEC members should be within 500 m from the generation point and the generated power should be allocated employing coefficients fixed in time. Nonetheless, regarding the allocation coefficients, the Royal Decree anticipates the future regulation to allow the use of variable allocation coefficients, so prosumers can adjust each hour the power allocated to each of them following their variable power demand. In this line, in April 2021 a proposal of regulation for this feature was issued by the Spanish regulators that would allow prosumers to establish at the beginning of each year the allocation coefficients of each hour for each LEC's member.
On the other hand, since June 2021 new network tariffs and levies apply to electricity consumers in Spain, including small residential and commercial consumers (less than 10 kW). The new electricity tariff aims to incentivise changes in consumption patterns to reduce consumption peaks in the hours of maximum consumption (midday and evening during weekdays) by moving it to hours with historical valley consumption. Thus, this tariff reduces the capacity charge and moves from one volumetric charge to three volumetric charges [25,26]. Previous work has simulated shared self-consumption between residential users to minimize electricity costs. Models simulate a group of prosumers sharing their resources [27,28] or considering a group of common renewable generators [29]. One step further is considering these prosumers not just as collaborators, but as members of a LEC. On this line, Dorotić et al. [30] simulated a community energy system on an island employing only intermittent renewable energies, Chakraborty et al. [31] simulated a LEC under different billing mechanisms, Awad et al. [32] developed a model to simulate the LEC demand and a method to maximise self-consumption and minimise the energy cost, Lilla et al. [33] modelled mathematically the day-ahead scheduling power allocation of a LEC and Grzanic et al. [34] developed a method to share and bill energy within a LEC in a fair way for all members. On the Spanish framework, Gallego-Castillo et al. [35] performed a regional analysis of optimal self-consumption for energy communities under the new energy Spanish regulation passed in 2019 concluding that self-consumption is cost-effective in all territory. A summary of the literature review compared with our work is presented in Table 1. On this table, the references are compared by their novelties, whether they evaluate different regulatory frameworks, different sharing strategies, present a case study or it is applied to the Spanish context. However, to the best of our knowledge, no work assessed the economic implications that would have for the LECs in Spain the application of variable allocation coefficients or the recent change in the tariff regulations. Probably, this has not being done because the allocation coefficients change has not yet taken place and the tariff regulation is very recent. In any case, we consider that these are relevant questions that deserve proper study to provide a concise answer to help LEC developers and users to understand and optimise their generation facilities. Table 1. Summary of the literature review , using keywords like "Local energy communities"; "Regulatory framework"; "Variable coefficients"; "Electriciity sharing strategies"; "Electricity tariff".

Reference
Novelty Regulatory Framework

Sharing Strategies Case Study Spanish Context
This work Assessment of economic implication of the new Spanish electricity tariff regulation and the implementation of variable coefficients in LEC.
X X X X [36] An integrated cost optimisation model of PV BESS systems including system sizing and battery ageing.
X [27] Design of an online algorithm to tackle cost-aware energy sharing among a cooperative community.
X X [32] Develop a generic and systematic framework that analyses, simulates, and optimises community dwellings equipped with community shared solar PV systems.
X [28] New energy cost minimisation strategy for cooperating households. [31] Conditions under cooperative energy sharing that decreases total cost, the development of allocations rules and comparative analytical of the main billing programs (feed-in-tariff, net metering, net purchase and sale).
X X [30] Analysis of the island system with 100% intermittent renewable energy sources.
X [29] A mathematical framework to optimize the use of renewable energy across households and two approaches to solve the optimisation problem. [37] Development of a model to estimate the cost-optimal large-scale economic potential of shared rooftop PV systems based on LECs.
X [33] Designing a specific distributed procedure based on the alternating direction method of multipliers (ADMM) to plan the day-ahead operation of a gridconnected LEC.  [35] Regional analysis of optimal selfconsumption installations under the new legal framework recently passed in Spain.

X
X X [34] Centralised post-process sharing method by introducing a twostage mechanism and impact of different flexible appliances on electricity cost reduction. X X

Methodology
This section presents the methodology used in this paper. To answer the research questions, we model a LEC to simulate and optimise its performance. A scheme of the method followed is presented in Figure 1, which results in a Linear Problem due to the specific physical and economic objective and constraints of the optimisation. The methodology starts by defining the case study where it is going to be applied and the different scenarios. The case study is defined by the location and size of the LEC, meaning the number of consumption points that the renewable installation will provide with energy, the curve of the loads in those consumption points and the capacity factors of the PV installation, determined by factors as the orientation, inclination and power losses.
The scenarios are determined by three variables, related to each research question: the type of allocation coefficients that will be employed, the electric tariff under which the LEC will perform and the peak power of the PV installation. The different possibilities for each variable will be established and combined generating all the scenarios to evaluate. A summary of the scenarios is depicted in Figure 2. Thus, for each scenario allocation coefficients are optimised. For that, we use the modelling language for mathematical optimisation JuMP, embedded in Julia [38]. When the scenario involves static coefficients, the best set of coefficients is obtained for all the hours of the year while, if the scenario employs variable coefficients, the best set of coefficients is optimised for each hour of the year. To establish which is the best set of coefficients we measure the cost of electricity for the LEC. To do that, the process on Figure 3 is followed. Thus, on each hour the allocated power to each user is compared with their demand to evaluate if all demand can be supplied by the allocated power. Furthermore, if some surplus is generated or only a part of the demand is self-consumed and there is a power deficit. In any case, this generated deficit or surplus is balanced with the grid buying or selling power, respectively. This will ultimately determine the cost of electricity for the LEC giving us an objective metric to compare scenarios. Hence, for each scenario, we obtain independent results that are assessed and compared in the discussion of results. Once we have processed all the scenarios and have discussed the results, conclusions are drawn.

Mathematical Model
The objective is to minimise the total energy cost of the energy community: The energy cost of the LEC is established by adding the variable term of electricity price, which depends on how much electricity each user acquires from the grid, with the price of the contracted electricity term, which depends on the contracted power of each user and subtracting the price of the electricity sold to the grid, that will depend on the surplus power generated on each hour.
The optimisation will run subject to the following restrictions: The previous constraints establish that no power variable can have negative values.
The coefficients can only take on values between 0 and 1, as they represent fractions of generated power.
This constraint indicates that purchased and self-consumed power by a certain user will always cover the demand from the user.
The power purchased from the grid will never be higher than the contracted power for any member of the LEC.
Depending on whether allocation coefficients on each scenario are static or variable Equation (10) will be applied, respectively.

Metrics
To evaluate the results of this work, we will employ the annual savings generated by the LEC and the simple payback period required for each PV installation. Annual savings, Equation (12), are obtained as the difference between electricity cost in the original situation, Equation (11), and the cost once the LEC is in operation.

Limitations and Assumptions
The model aims to use consumption and generation data to evaluate the economic performance of a LEC. The data used in it can include projected consumption, past real consumption or statistical consumption. As explained after, in this study we use historical hourly patterns of Spanish residential consumers. The data is provided by consumers from the Distribution System Operator webpage, in the case of Valencia, Iberdrola [40].
Regarding the generation, we use PVSyst to generate hourly capacity factors in the case study [41]. With them, we apply it to different nominal power capacities. Real installations with divergent nominal capacities may differ in their capacity factor due to different configuration installations such as the PV capacity inverter relationship. These potential variations are not considered and all installations have equal capacity factors.
When comparing historical demand and hypothetical generation, we may miss the potential flexibility or consumption changes associated with having on-site generation. Nevertheless, it is important to note that demand is inelastic and even under determined incentives, demand faces social and technical constraints to become more flexible [7,42]. The potential for studying flexibility measures associated with LEC is out of the scope of this paper.
In regards to the economic analysis, the model optimises a year-long performance. Then these values (profit, cost reduction. . . ) are used to compare the presented metrics without considering possible variation between years. The assessment of multi-year demand periods is out of the scope of the document. Furthermore, financial risks are not considered. Thus, we do not consider any potential financial risks or electricity price volatility.
Finally, all case studies have been solved using Gurobi under Julia.JuMP [38], while the data treatment has been performed in MATLAB. We have used an Intel (R) Core (TM) i7 computer at 1.99 GHz and 16 GB of RAM.

Studied Scenarios
To assess the impact of the new tariff regulation and the use of different allocation coefficients, we have defined 200 scenarios. These scenarios are defined based on the variables and values indicated in Table 2. The PV installation for the LEC will be assayed for values from 0 kW to 100 kW in steps of 2 kW. The maximum 100 kW is related to the maximum power capacity allowed in the legislation to use the simplified selling mode [19]. This way we will be able to evaluate the impact of the changes in tariff and coefficients for different relations among consumption and generation.

LEC Characteristics
The location of the case study is a rooftop of a building in Valencia, Spain, South oriented. The LEC is composed of 20 households located at less than 500 m of the generation point, as established in the Spanish regulation [19]. These households are residential consumers for which we will use real data obtained directly from their smart meters that real consumers have retrieved from the distribution company. Figure 4 shows the average PV capacity factor and the LEC overall average demand during the year 2019. Figure 4 shows how demand and production shapes do not match; therefore, how produced energy is shared and the price of the purchased energy from the grid at each hour will have important economic implications on the LEC.
The PV installation specifications are described in Table 3. As explained before, the PV nominal power will vary from scenario to scenario between 0 and 100 kW in steps of 2 kW. We will estimate the installation cost from the PV residential LCOE and a life expectancy of 20 years for the overall installation. Figure 5 shows the PV investment required according to the power installed and the LCOE. Results show that investment rises with installed power while the cost of energy decreases, this implies that the energy produced grows faster than the investment required. Nonetheless, this effect is seen especially for reduced installed power and for big installed power the scale economy effect has very little impact.

Parameter Values
PV nominal power 0 to 100 kW Installation lifespan 20 years Storage system None

Electricity Tariffs in Spain
The new tariff regulation enforced on June 1st changed the volumetric charges of electricity depending on the hour of the day for small residential and commercial consumers (less than 10 kW) during weekdays. The goal is to reduce consumption in peak incentivising consumption in hours with historical valley consumption. The change in the volumetric charges over a weekday is depicted in Figure 6.
As the figure shows, the old tariff did not change its volumetric charges from one hour to the other. Thus, there was no incentive for the consumers to change their habits. Nonetheless, the new tariff regulation reduces the volumetric charges on valley consumption hours (late night) and increases it for peak hours (midday and beginning of the night). This aims to incentivise economically users to avoid consumption at peak hours and increase it on valley hours.

Allocation Coefficients
The allocation coefficients define how the produced power of a generator is distributed among the different participants of the LEC. Currently, the regulation only contemplates static coefficients, but it is expected to incorporate the possibility of using variable coefficients. Thus, we consider both possibilities to evaluate the economic implications that different coefficients would have on LECs. On one side, static coefficients imply that the same sharing among users would be applied every hour of the year, no matter the changes in demand. On the other side, variable coefficients mean that the power share among users can change from hour to hour.

Results and Discussion
This section shows the optimisation simulations for the presented data. After solving the model, we calculate the payback period and define all the variables for each scenario. The results are presented separated by the effect of each design variable; namely, the tariff regulation and the type of allocation coefficient employed. The base case is the old tariff and static coefficients as is the original situation and the starting point for this work.

Tariff Effect
The change in tariff regulation has an economic impact even if the LEC sharing process is the same. Figure 7 shows how the payback period changes based on the PV installation nominal power employing current static allocation coefficients for the old and the new tariff regulation. The impact indicated in the figure is calculated as the relative change of the value obtained with the new tariff with the corresponding value of the old tariff. These results indicate that the new tariff improves the economic performance of the LEC. This positive impact is very relevant to evaluate the convenience of the new tariff to promote local energy communities in Spain.
Nonetheless, the impact is not the same in all circumstances and three phases can be distinguished. The first phase, for under 10 kW installations, is marked by high payback periods and the relative great impact of the change in tariff. Payback periods are high because fixed prices are not compensated by revenues from electricity generation, economy of scale applies. In this phase, the impact of the tariff is noticeable because, as the power generation is low, most of the production is self-consumed by the users of the LEC, and corresponds to peak hours with a high price (see Figure 6). However, they still need to purchase a big share of their energy from the grid.
The second phase goes from 10 to 40 kW installations and, during this phase, the payback period improves slowly and the impact of the tariff is still important, though the impact decreases while installed power increases. The payback period decreases because the reductions in the electricity bill increase at a higher rate than investment costs as larger installations benefit from economies of scale. The impact of the new tariff regulation is significant due to the amount of electricity that users need to purchase to match their demands; nonetheless, as generation power increases, the amount of electricity purchased will decrease. The third phase is the one for installations with over 40 kW and it is characterised by an increase in the payback period and a reduction in the new tariff's impact. The increase in the payback is due to the increase of the electricity sold to the grid as generation surpluses. The energy is sold at a lower price than it is purchased and, therefore, to sell instead of consuming the electricity generated reduces the profitability of the investment. The reduction in the impact of the tariff is due to the reduction in the amount of purchased electricity from the grid, as in the second phase.

Variable Coefficients Effect
The change in the type of allocation coefficients employed has economic impacts and it can be seen reflected in the payback period of the LEC investment, as depicted in Figure 8. The impact depicted in the figure is obtained as the relative change of the value obtained with variable coefficients with the corresponding value obtained with static coefficients. Results show that variable coefficients would improve the profitability of LECs for all the nominal power assessed and, hence, it is an interesting tool to promote the development of these entities.
At a more detailed level, we appreciate once again the abovementioned three phases. During the first phase, for under 10 kW installations, the impact of the different coefficients is significant, although the generated power is small because it can all be consumed when it is properly allocated and, hence, avoid selling energy to the grid that reduces profitability.
During the second phase, from 10 to 40 kW, the impact of the variable coefficients increases due to the balance between generation and demand. During this phase, there is enough power generated to cover the demand during many hours, but only if the allocation process is well adjusted. When static coefficients are employed the surpluses rise quickly, but with variable coefficients, the energy can be allocated to final users as there is still enough demand from the LEC.
In the last phase, installations with more than 40 kW, the relative importance of using variable coefficients decreases. The reason for this is that there is so much power generated that the allocation process is not so crucial to match the demands of the users and a great share of the energy is sold to the grid anyway.
These affirmations can be reinsured by taking a look into the degree of self-consumption achieved by the LEC and the energy sold to the grid. Thus, Figure 9 shows how the degree of self-consumption increases with the installed PV power. Nonetheless, this increase is fast during the two first phases but, from 40 kW on, it increases at a much slower pace, especially for variable coefficients. The reason for this is that, as explained before, for big power installed, the generation overtakes demand and most of the energy is sold to the grid instead of increasing the degree of self-consumption. Moreover, as can be seen in Figure 9, the use of variable coefficients improve the degree of self-consumption because it allocates the power generated based on the users' demands. This is especially true in the second phase when the generated power and the demand are balanced granting to the allocation process big importance to maximize the results.  Considering the energy sold to the grid, we obtain Figure 10 and we appreciate how the energy sold rises with the PV nominal power installed. It is important to ponder that the energy sold to the grid is paid at a lower price than the energy purchased and, therefore, it is not cost-effective to sell energy and should be avoided as much as possible. The use of variable coefficients manages to reduce the amount of energy sold by adjusting its allocation based on the demand of each user. This is especially relevant when the generation is smaller because the variable coefficients can almost completely avoid the selling of energy to the grid. In contrast, for larger generation capacities, variable coefficients are not able to avoid the selling of electricity to the grid as the generation surpasses the LEC demand no matter how it is allocated.

Overall Effect
The previous sections have shown how the new tariff regulation and the use of variable coefficients improve the profitability of the LEC investment. In this section, we are going to compare both impacts and the combined effect. For that, Figure 11 is presented. First, this figure shows that the combined effect of both changes generates the lower payback periods and, hence, improve the economic results of the LEC more than any effect individually. Indeed, for an installation of 12 kW, the combined effect of both variables improves LEC's profitability by up to 25%; while the individual effect never reached beyond an improvement of 16%. Second, when comparing each effect individually, we realise that the new tariff regulation, in general, has a greater impact on the economy of the LEC than the use of variable coefficients. However, for capacities installed between 13 kW and 40 kW, the effect of the variable coefficients is just as important as the new regulation. This is due to the increasing effect of the electricity surpluses. For a range of increasing PV power capacities, minimizing surpluses by correctly allocating the electricity generation competes with the effect of saving electricity at peak price periods. Gradually, as generation increases, the effect of the optimization of variable coefficients, as compared to the optimization of static coefficients, decreases and the effect of the new tariff prevails.

Conclusions
This paper enquired about the impact of the new Spanish regulatory framework on local energy communities based on Solar PV. These changes are two-fold. The allowance for moving from static sharing coefficients to the possibility to share with variable coefficients the generated electricity between the users of the community. Furthermore, a new network tariff consistent in different time-varying volumetric charges moving from one with a constant volumetric charge.
The analysis builds on a linear optimization model. It minimizes the cost of the Local Energy Community under the possible different scenarios by optimizing the static or variable coefficients used to share electricity among the community consumers. Our results show how new regulation improves the situation and profitability of Local Energy Communities. Following the regulatory changes, this improvement can be decomposed into two main effects: the tariff regulation effect and the variable coefficients effect.
Regarding the tariff regulation, we concluded that the new tariff with a higher price during the midday, increases savings and it effectively reduces the payback period of the installation. Therefore, it has positive economic implications for the community. Especially for relations of around 2 kW or less of power installed for each user (on average, power installed: 40 kW and the number of users: 20). For greater power installed, as the generation increases and the substitution of energy purchased from the grid is compensated by higher surplus energy sold at a low price, the impact of the tariff regulation is gradually reduced too.
The impact of using variable coefficients is also positive for the local energy community as it reduces the payback period of the PV investment. This effect is more relevant for relations of around 1 kW of installed PV nominal power per user. For smaller relations, most of the generated power is consumed as it is exceeded by the consumers' demand. In contrast, for greater capacity installed per consumer, the generation exceeds the demand and the community consumption is mostly covered no matter how the generation is allocated. Hence, in both cases how the generated power is allocated losses relevance.
Overall, the combined effect of the tariff and the coefficients provide greater benefits than each effect. In the case study, benefits reach up to 25% reduction of the PayBack for installed power between 5 and 25 kWp However, the effect of the new tariff regulation is more relevant for the LEC than the use of variable coefficients. Moreover, the new tariff regulation is easier to apply effectively than to estimate the most optimal allocation coefficient for each user on each hour. These variable ratios must therefore be established continuously. For this, users, accountants and companies must be prepared, both conceptually and technologically, which currently makes real-time variable optimization difficult. In this sense, the model overestimates the saving associated with the variable coefficient compared with real applications. Hence, we believe that the impact of applying the new tariff regulation will be even more relevant than the results of this work indicate.
To sum up, the new Spanish regulatory framework favours the economic performance of local energy communities. However, these still present an optimal economic capacity below the environmental optimal. Installations are optimal with generation only displacing consumption and a small ratio of energy excess, which fails to capture all the potential benefits of decentralized generation. Thus, future regulatory frameworks should aim to further promote and incentivize local energy communities as they deliver benefits that energy markets are not currently capturing.
Finally, in this work, we do not consider the inclusion of energy storage systems into the community, the supply to different users as those with commercial or industrial loads, the use of other energy sources to hybridize as could be the wind or the possible electrification of loads. Therefore, further work should assess more in deep local energy communities by clustering the consumer typologies and include new energy technologies such as decentralized batteries or electric vehicles. Moreover, it would be interesting to evaluate the impact of different coefficients on the lifespan of energy storage systems and to integrate electric vehicles into energy communities looking for synergies that reduce the transport sector impact. Besides, it would be of interest to evaluate the impact of volatile prices on electricity and the use of different various billing mechanisms under these circumstances. Furthermore, the best strategies to fairly share power among LEC users and new regulations to promote the development of local energy communities should be researched.

Conflicts of Interest:
The authors declare no conflict of interest.

Abbreviations
The following abbreviations are used in this manuscript: Difference between electric bills before and after participating in LEC (€)