Optimal Sizing and Environ-Economic Analysis of PV-BESS Systems for Jointly Acting Renewable Self-Consumers

: Future residential applications could beneﬁt from nanogrids that integrate photovoltaics (PV) and battery energy storage systems (BESS), especially after the establishment of recent European Community directives on renewable energy communities (RECs) and jointly acting renewable self-consumers (JARSCs). These entities consist of aggregations of users who share locally produced energy with the aim of gaining economic, environmental, and social beneﬁts by enhancing their independence from the electricity grid. In this regard, the sizing of the PV and BESS systems is an important aspect that results in a trade-off from technical, economic, and environmental perspectives. To this end, this paper presents an investigation on the optimal PV-BESS system sizing of a condominium acting as a JARSC community, which includes a common PV plant and EMS, operated by rule-based criteria. PV-BESS sizing results are investigated from economic and environmental perspectives, considering a case study located in Milan, Italy. In these regards, in addition to the common techno-economic criteria, carbon dioxide emissions are considered with particular attention, as their reduction is the driving ethos behind recent EU directives.


Introduction
In the current context of the energy transition, decarbonization is one of the key tasks to accomplish to mitigate climate change and its consequences.The thermal and electric power sectors, along with industry and land use, accounts for most of the global greenhouse gas emissions, causing a strong interest in understanding how to achieve a drastic emission reduction [1].Among the various strategies, electrification is considered to have the most potential, as it may become a common factor among different sectors, from transportation to industrial and residential buildings [2].However, the process of electrification must be paralleled by sustainable power generation, emitting the least amount of greenhouse gases over the life of the system.Of all types of generation, renewable sources are now a win-win solution in both economic and environmental terms, and solar photovoltaic (PV) systems are often the preferred solution due to their versatility.
Indeed, the issue of carbon emissions and the rising demand for energy from buildings are key factors that are often addressed by rooftop PV systems.PV systems are installed not only to reduce greenhouse gas emissions, but also to lower electricity costs and relieve the impact of the increased consumption on the national power grid.It is well-known that, when a PV system is installed on the roof of a grid-connected building, the energy produced is first used to power the building's electrical needs, while the energy exceeding the building load is sold to the main grid through different tariff schemes.As a result, annual household electricity costs are decreased.However, it is worth noting that, in this ideal situation, the main economic benefit comes from energy self-consumption, possibly is the appropriate sizing of the generator and storage system according to consumption, installation, and economic constraints.Thus, it is easy to understand how different variables influence component choices, and thus it is always possible to find an optimal compromise between cost and benefits obtained.
Several studies related to sizing PV-BESS systems to optimize a certain objective or cost function can be found in the literature.As an example, in [15,16] a general overview of different sizing approaches and techniques is proposed.These works show that optimal component sizing is of paramount importance as it can solve various issues such as aging, power quality, and environmental aspects which typically are not considered.In [17,18], the optimal sizing for PV and BESS in the residential sector are pursued through a MILP approach with the aim of minimizing the total annual electricity cost while considering the battery degradation process.However, the environmental aspect is not considered in the analysis.Through the clusterisation of numerous prosumers through a genetic algorithm (GA), in [19], an online tool for sizing PV and BESS is proposed for maximizing self-sufficiency and minimizing environmental impact in residential settings.The tool provides the optimal values of PV and BESS based on consumption and type of inhabitants.However, component degradation is not considered.In [20], a PV-BESS system for an all-electric household is designed for net present value (NPV) maximization.This scenario is compared with other different case studies with different combinations for electricity and heat generation, using a procedure based on the particle swarm optimization (PSO) method and a rule-based algorithm for energy management.
A different approach relies on iterative methods, which allow avoiding the numerical optimization process by varying the design parameters and evaluating the corresponding results.For example, in [21], the performance and lifetime economics of residential PV with lithium-ion batteries in all 50 U.S. states were modelled and analysed, showing a sensitivity analysis on different variables.The results show how levelized cost of energy (LCOE) varies significantly by changing installation costs, investment taxes, and loan interest.An optimal sizing for a hybrid system consisting of PV, lithium-ion battery, and super capacitor storage is shown in [22] in order to maximize self-consumption and self-sufficiency.The results show how using the super capacitor to make up for load fluctuations increases battery life and stress reduction by avoiding battery replacement.In [23], a techno-economic analysis of photovoltaic battery systems is performed by evaluating different synthetic residential load profiles.The results show how the values change greatly depending on the type of utility and maximum absorbed power.In [24,25], the profitability and sizing of a photovoltaic system with associated electricity storage are analysed from an economic perspective by showing how sizing varies in the case of a JARSC model.
However, none of these works consider the environmental aspect related to carbon intensity in the sizing process, which, on the contrary, represents a simple way to assess environmental impact and hence should be included in sizing procedures.
In this paper, an analysis for the optimal sizing of a PV-BESS system in a multiblock apartment building acting as a JARSC located in Milan, Italy, is presented.The proposed methodology is based on a numerical investigation of PV-BESS system sizing with a parametrized number of PV modules and battery units.The optimal sizing is then extracted from simulation data on the basis of a combination of CO 2 emissions, payback time, self-consumed energy, and shared energy.The proposed procedure is then applied to five scenarios in order to highlight the actual environ-economic benefits associated with the establishment of a JARSC group.This analysis follows previous research in which different control algorithms were compared in terms of economic and environmental benefits within JARSC groups with a PV-BESS system of fixed size [26].
The paper is structured as follows: Section 2 presents the considered system and its main components, along with load and generation profiles, electric energy price and incentives structure, and parameters for economic assessment.Section 3 presents the models used for system simulation, as well as the additional variable needed to perform the necessary analysis.Section 4 presents the proposed procedure for the determination of the environ-economic optimal sizing of PV-BESS systems.Section 5 presents the considered simulation scenarios, while simulation results are presented and discussed in Section 6. Lastly, some conclusions are reported in Section 7.

System Description and Parameters
In this section, the electrical system and its main components are described.Furthermore, a description of the generation and consumption profiles of the users is provided in addition to the common consumption profiles of the apartment building (lighting, EV wallbox, etc.).As outlined, this paper analyses a case study located in Milan, Italy, and all data and profiles presented were obtained from online databases taking into consideration consistency with geographic location.

System Description
The key components of the current JARSC system are outlined in Figure 1.It is assumed that the JARSC is established in a building in the centre of Milan and includes twelve apartments that are all occupied by different families.Each unit has a separate energy meter (UM), which is owned and operated by the DSO.A photovoltaic system is installed on the roof of the building, and the production meter (PM) monitors its produced energy.An "all-in-one" BESS has been considered as a possible addition to the system.This would allow storing excess photovoltaic energy generated during the times of lowest consumption and highest photovoltaic generation, and discharge it later during times of low or no photovoltaic generation in order to maximise self-consumption.The common meter (CM) is used to measure the energy exchanged with the grid by the common loads and PV-BESS systems, unitedly.The BESS system is assumed to include a battery management system (BMS) to balance the temperatures and the state of charge (SoC) of the battery unit, not discussed in this paper, and to be able to provide SoC measurements or estimates.Moreover, a maximum power point tracking function (MPPT) is supposed to be embedded in the PV-BESS system with the aim of maximising the performance of the photovoltaic generation.Consequently, the rule-based controls outlined in Sections 5.3 and 5.6 are assumed to produce a signal used to control the power exchanged by the BESS.
of the environ-economic optimal sizing of PV-BESS systems.Section 5 presents the considered simulation scenarios, while simulation results are presented and discussed in Section 6. Lastly, some conclusions are reported in Section 7.

System Description and Parameters
In this section, the electrical system and its main components are described.Furthermore, a description of the generation and consumption profiles of the users is provided in addition to the common consumption profiles of the apartment building (lighting, EV wallbox, etc.).As outlined, this paper analyses a case study located in Milan, Italy, and all data and profiles presented were obtained from online databases taking into consideration consistency with geographic location.

System Description
The key components of the current JARSC system are outlined in Figure 1.It is assumed that the JARSC is established in a building in the centre of Milan and includes twelve apartments that are all occupied by different families.Each unit has a separate energy meter (UM), which is owned and operated by the DSO.A photovoltaic system is installed on the roof of the building, and the production meter (PM) monitors its produced energy.An "all-in-one" BESS has been considered as a possible addition to the system.This would allow storing excess photovoltaic energy generated during the times of lowest consumption and highest photovoltaic generation, and discharge it later during times of low or no photovoltaic generation in order to maximise self-consumption.The common meter (CM) is used to measure the energy exchanged with the grid by the common loads and PV-BESS systems, unitedly.The BESS system is assumed to include a battery management system (BMS) to balance the temperatures and the state of charge (SoC) of the battery unit, not discussed in this paper, and to be able to provide SoC measurements or estimates.Moreover, a maximum power point tracking function (MPPT) is supposed to be embedded in the PV-BESS system with the aim of maximising the performance of the photovoltaic generation.Consequently, the rule-based controls outlined in Sections 5.3 and 5.6 are assumed to produce a signal used to control the power exchanged by the BESS.

Photovoltaic System
The purpose of the PV system is to supply energy to users and cover most of their energy consumption, in order to avoid the absorption of energy from the power grid when possible.The PV system consists of a certain number of modules, the optimal quantification of which is one of the purposes of this work.The PV system is divided in parallel-connected strings, each string being constituted by a number of series-connected modules.In particular, each string consists of three series-connected modules, in order to comply with the BESS input voltage and current specifications.This is not a limit for optimal sizing investigation, as little utility is seen in a single module variation in the system.Consequently, it is assumed that the PV system optimal sizing analysis can be performed through the variation of an integer number of strings n s .Given the constraints on the available roof area of the considered building, the number of strings n s will be varied from 1 to 30.Thus, the number of modules in the system will vary between 3 and 90.Considering the individual PV module specifications at the standard test conditions (STC) reported in Table 1 [27], the power output of the system will consequently vary from 1.2 kW to 36 kW, with increasing steps of 1.2 kW.The possible installation of a lithium-ion BESS is considered, with the aim of storing PV-generated energy during low-consumption energy periods.The PV energy generation excess is hence not sold to the grid, but released for later use.This allows the increase in the self-consumption of the JARSC community, possibly providing a significant economic benefit due to the large difference between the sale and purchase energy price.Regarding the investigation on optimal BESS sizing, the same approach used for the PV system is replicated.Consequently, a minimum capacity BESS unit is considered, whose specifications are detailed in Table 2.By taking into consideration the voltage and current limit of the DC section of the BESS/inverter system, the BESS is varied by changing the number of parallel-connected battery units n b in a range between 1 and 30.Consequently, the BESS total capacity is varied between 2.5 kWh and 75 kWh, with increasing steps of 2.5 kWh.Since the battery degradation is a crucial aspect to consider in order to increase battery lifetime, the maximum depth-of-discharge (DoD) value is set in all simulations to respect the manufacturer's technical requirements reported in Table 2 [28].The multi-block building considered includes twelve apartments, each occupied by different inhabitants or families with different habits.Therefore, different consumption profiles were considered to make the assessment as general as possible.The consumption profiles of the individual apartments were exported from a synthetic residential profile generator [29], which allows for choosing household habits and daily activities based on different lifestyles and behaviours and includes a large dataset of electrical devices to be considered within the dwelling.The list of chosen profiles with the corresponding values of annual energy consumption and contractual power can be found in Table 3. Figure 2, on the other hand, shows the corresponding energy profiles, as an example, during one week.The consumption profiles depend on both the type of household and the period under consideration, which may include vacation, illness periods, etc.Given the building structure under consideration, it is expected that a certain amount of annual electricity consumption is due to common services whose costs are then shared among the apartments.For simplicity, in this paper, the common costs are assumed to be divided among apartments in equal parts.
Typical shared services found in apartment buildings are lighting of common areas and elevators.Given the lack of data for these types of loads, consumption profiles are created for both lighting and elevators.Regarding lighting, LED bulbs are assumed to be used for common areas lighting.Between 5 a.m. and 9 a.m. and between 5 p.m. and midnight, lighting consumption takes place.In these timeframes, it is assumed that LED bulbs will absorb, in each 5 min interval, an instantaneous power between 50 W and 150 W, with a gaussian distribution and an average value of 100 W. Regarding the elevator, [30] investigates different types of consumption profiles, and it is found that standby consumption is higher than individual runs.In this work, an average power of 250 W was assumed for stand-by mode and an energy of 50 Wh for each individual run.The operating intervals are the same as for lighting with the addition of a lunchtime interval between noon and 2pm.Considering the total number of occupants in the building, from Energies 2023, 16, 1244 7 of 25 6 to 18 runs for the morning and evening intervals, and from 3 to 9 runs for the mid-day interval were simulated, with random (gaussian) variations around the average value.

Common Load Profile
Given the building structure under consideration, it is expected that a certain amount of annual electricity consumption is due to common services whose costs are then shared among the apartments.For simplicity, in this paper, the common costs are assumed to be divided among apartments in equal parts.
Typical shared services found in apartment buildings are lighting of common areas and elevators.Given the lack of data for these types of loads, consumption profiles are created for both lighting and elevators.Regarding lighting, LED bulbs are assumed to be used for common areas lighting.Between 5 a.m. and 9 a.m. and between 5 p.m. and midnight, lighting consumption takes place.In these timeframes, it is assumed that LED bulbs will absorb, in each 5 min interval, an instantaneous power between 50 W and 150 W, with a gaussian distribution and an average value of 100 W. Regarding the elevator, [30]  Given recent developments in the electric vehicles market, it is assumed that the apartment building installed a charging station (wallbox) for families with electric vehicles.In this regard, the real charging profiles of a wallbox with a rated power of 22 kW were included in the simulations so as to model the charging of two vehicles with a battery capacity of 50 kWh each.This specific cost is assumed to be divided equally among apartments.

Photovoltaic Generation Profiles
The photovoltaic geographical information system (PVGIS) [31], an online database run by the European Science Hub, provides statistical information about solar irradiance and air temperature.Both hourly profiles for entire years and aggregated values, including monthly average radiation, are available in the mentioned database.Using the equations presented in [32], photovoltaic generation can be computed as a function of solar irradiation and air temperature.Since 2016 is the most recent year for which all data are available for the location under consideration, the data of this year are used in this paper.

Electricity Price and Equivalent Carbon Intensity Profiles
Since the purpose of the paper is to evaluate the economic and environmental aspect as a function of plant sizing, it is necessary to obtain cost and CO 2 emissions data.The excess of generated energy that is not immediately consumed or stored is, of course, sold to the public grid.When considering the selling price, there are two different price-driven policies in Italy for selling electricity to the grid.The first involves the distributor paying a set minimum price (PMG-Prezzo Minimo Garantito) while the second method involves paying for energy by using real-time pricing (PO-Prezzo Orario).The real-time price varies hourly depending on the electrical zone, the day-ahead market bids, and the energy exchanged with other countries.This study assumes that the PO scheme is used in the energy-selling process.For consistency with irradiation data, the price profiles of 2016 in the ITA-NORTH electricity zone were calculated from the database of the European Network of Transmission System Operators for Electricity (ENTSO-E) [33].This also represents a caution choice, as the recent increase in electricity price is related to unforeseeable international issues and the future price trend is difficult to assess.Additionally, relying on lower prices ensures that economic margins may be larger, but not smaller, than the ones presented in this work.
Regarding the purchase cost, a variable cost was considered for the purchase energy cost based on the hourly zonal price.The PO was increased by the addition of system fees, network services, excise taxes, trader's commissions, and VAT at rates common for residential consumers.In addition to the energy buying price, each connection to the public distribution grid is also charged of some fixed costs.
Assigning numerical values to fixed costs, energy buying price, and energy selling price are thus important in order to move forward with the system sizing.The fixed costs in this calculation are determined using the Italian standard and are available from [34].They include two main components: a fixed cost and a cost commensurate to the contractual power.For each connecting point, the numerical values of these fixed costs are listed in Table 4.It is assumed that the selling price of energy is equal to the PO.The energy purchase price is calculated taking into account the fact that, on average, during 2016, the energy buying price was equal to an increase in selling price of 89%.In addition to the energy component, various fees and customs are to be added, which overall are equal, on average, to 0.0586 €/kWh.Lastly, VAT is equal to 10% for the 12 residential connection points, while it is equal to 22% for the last, non-residential connection point.Furthermore, energy absorbed from the grid implies an environmental cost, represented by the CO 2 emissions due to energy produced in that specific market zone and import/export energy exchange.In fact, each energy unit (kWh) carries a specific carbon dioxide content which depends on the energy mix of the country of production (and neighbouring countries, due to international energy exchange).This parameter, usually called carbon intensity [gCO 2 eq/kWh], is able to quantify the cleanliness level of the energy absorbed from the grid, and allows us to assess this environmental aspect.The carbon intensity varies hour-by-hour during the day depending on the renewable energy share in the electricity mix of that specific country, thus hourly profiles are needed.The carbon intensity of the electricity in the specific area can be evaluated considering the types of production sources, their emission factors, and the amount of energy produced.The hourly values and types of production are provided via the ENTSO-E platform, and the emission factors were collected from [35].To this end, the carbon intensity CI avg can be mathematically calculated as follows: where E i is the electricity generated (kWh) by the i-th source and CR i is the carbon-emission rate (or CO 2 emission factor) (g/kWh) for that same source.

Incentive Plan for Shared Energy
Recent directives from the European Community required that Member States encourage self-consumption in all its forms, including jointly acting self-consumption.From now, we shall refer to the Italian scenario with the assumption that, despite the fact that other transpositions of the European directives may be technically distinct, the fundamental principle guiding this incentive structure will yield results that are comparable.
This section aims to clarify how the incentive mechanism works and how it may be used to promote REC and RSC.In principle, two alternative regulatory models, physical and virtual [36], are possible.However, at present, regulation refers only to the virtual one, in which members of RECs or JARSCs share energy by exploiting the existing grid of the distribution system operator (DSO).In this setup, as depicted in Figure 1, each occupant is connected via their individual connection point (meter).The local self-consumption is rewarded by the electrical system operator GSE (Gestore Servizi Energetici), in order to encourage REC/RSCs.This incentive is calculated on the so-called "shared energy", which is defined as the hourly minimum between the electricity produced and fed into the grid by renewable sources and the electricity consumed by the set of subjects pertaining to the REC or by RSCs.
Shared energy is rewarded with: (a) a compensation due to avoided grid losses and distribution charges of about 11.5 €/MWh, and (b) an incentive of 100 €/MWh for groups of JARSCs (or 110 €/MWh for REC) [37].Furthermore, because the generated energy is actually exchanged virtually into the system, it is remunerated in accordance with the price of the electricity market.

Parameters for Economic Anaylsis
The economic assessment of the considered group of JARSC requires a number of parameters, the discussion of which lies outside the purposes of this paper.An example of suitable economic analysis can be found in [38].The required parameters are reported in Table 5 (for reference, see [38] and references therein).

System Modelling
In this Section, the main models used for the simulations discussed in Section 6 are presented.

Electronic Power Converter
An electronic power converter connects PV and BESS to the public distribution grid in the system under consideration.The system is assumed to be under quasi-stationary conditions; hence, a comprehensive model of the power converter and its management is not necessary.The converter is therefore modelled as an ideal converter with known efficiency (batteries to grid 95%, PV to grid 98%) [28].It is worth noting that, in principle, inverters efficiency depends on their respective rated powers [39].However, for the purposes of this paper, this aspect is not further discussed, and constant efficiency values are considered.

PV System Modelling
The PV modules' I-V characteristic can be used as steady-state models.This permits the calculation of the maximum power point as a function of the ambient temperature and solar irradiation.The equations used in this paper can be found in [32].

BESS Modelling
An advanced battery model is not required, given the focus of this paper.The only characteristics which are necessary to model are those related to energy balance, namely SoC and efficiency.The energy exchanged by the BESS E batt can be evaluated by means of the following: where η batt is the constant battery efficiency, P batt is the BESS exchange power positive if drained, and ∆t is the discrete time step.The BESS SoC variation over one discrete time step ∆t can then be calculated as follows: where C batt is the nominal BESS energy capacity.

Additional Variables for Environ-Economic Analisys
The proposed EMS controller is based on quite a simple model.However, the environeconomic analysis performed in the following will need to deal with different variables with non-trivial definitions.In the following, the necessary auxiliary variables which must be evaluated during each simulation are discussed.Since the sizing of PV-BESS systems should be evaluated over one year to account for yearly variations in temperature and irradiance, the following variables are defined over the number of sample intervals in one year N. Since the energy cost and carbon intensity are defined on an hourly basis, the sample interval used in this work is equal to one hour.However, this is left implicit in this section for generality.

•
Loads absorbed energy E loads [13xN] : each column of E loads is constituted by the energy absorbed, during one of the N sample intervals included in one year, by the 13 connection points reported in Figure 1

•
Exchanged energy E [13xN] : includes the battery and PV in energy balance over the N sample intervals included in one year.The first twelve elements of each column are equal to their counterparts in E loads , while the last element is obtained as follows: • Shared energy E shared[1xN] : energy shared over the N sample intervals included in one year, as defined in Section 2.3.Considering that the energy injected into the grid by the PV/ESS node is identified, for each k-th step, as −E(13,k), each element of E shared is defined as • Self-consumed energy E self[1xN] : self-consumed energy over the N sample intervals included in one year.Each element of E self is defined as note that self-consumed energy is included in exchanged energy E, but it is useful to define it as a separate variable for economic analysis.

•
Sold energy E sold[1xN] : energy sold over the N sample intervals included in one year, defined as • Cost matrix C [13xN] : defines the energy cost over the N sample intervals included in one year.The first twelve elements of each column, being residential users, are defined as follows: where C fix (i) represents the portion of yearly fixed cost of the i-th users associated with each hour of the year and VAT is a coefficient including the value added tax.The last element of each column is more complex to define, as the PV/ESS node can both buy or sell energy.This results in where Inc is the economic incentive [€/kWh] granted on shared energy.
• CO 2 total emission vector CO 2 total[13xN] : defines the total CO 2 emissions over the N sample intervals included in one year, defined as

Procedure for the Determination of the Environ-Economic PV-BESS Optimal Sizing
The proposed procedure is based on the numerical identification of the desired environeconomic optimal sizing.Consequently, the first step is to parametrize the PV sizing, typically in terms of number of modules or number of parallel connected strings, and the BESS sizing, if present.The parametrization range is usually chosen considering physical or economic constraints (e.g., maximum available surface for PV panels, or maximum initial investment).It is then necessary to simulate the system operation over one year for each PV-BESS combination.This process can be easily automated and not particularly time consuming (usually up to several hours, depending on the available hardware).
Once the simulation data are available, in order to provide useful tools for the determination of optimal sizing in the different considered scenarios, the most common performance indicators, covering energetic, economic, and environmental aspects, are calculated for each simulation.In particular: • the energetic analysis has been addressed on the basis of total bought energy consumption [kWh/year] (intended as total energy bought from the main grid, hence decreasing when PV is installed), total PV energy [kWh/year], self-consumed energy [kWh/year], and shared energy [kWh/year].

•
The economic analysis has been addressed on the basis of total bought energy cost [€/year], and payback time (PBT) [years], calculated according to [38].

•
The environmental analysis, as described in [26], has been addressed on the basis of the total CO 2 equivalent emissions [kg/year], evaluated according to Section 2.2.4.
Traditional optimal sizing is based on energetic and/or economic performance indexes.Usually, the energetic performance indicators do not allow to determine an optimal sizing on their own, but only in conjunction with economic indicators; indeed, energetic indicators such as self-consumption, shared energy, and sold energy are monotone quantities, increasing with increasing PV power and ESS capacity.Economic performance indexes can hence be included as constraints (e.g., maximum self-sufficiency within a limited initial investment or limited payback time) or as targets (e.g., maximum NPV) in order to formulate a well-posed optimization problem.
However, environmental indicators are not included directly or indirectly in the traditional optimal sizing procedure, which, if based on economic indicators, often leads to smaller sizing in order to reduce PBT.
In order to include environmental indicators in the sizing procedure, a different approach is proposed here.Indeed, the aims of balancing economic and environmental aspects during the design of the PV-BESS system can be pursued by combining two indicators, one economic and one environmental; functions of PV power; and BESS capacity.In order to obtain a well-posed problem, the aforementioned indicators should exhibit regular (ideally monotone) trends, but with differently oriented gradients, so that their intersection can be interpreted as an environ-economic trade-off, which is here considered the environ-economic optimal sizing of the PV-BESS system.To this end, the analysis of the results focused on the evaluation of two key parameters: PBT and the total amount of CO 2 emissions, which exhibit the desired features and represent the most common representation of the overall system economic and environmental performance.Other performance indicators can be used for further investigation (e.g., identification of the preferred solution among the different solutions coming from the intersection between PBT total amount of CO 2 emissions), but were revealed as less suitable for the identification of the optimal sizing.
The procedure used to identify the trade-off between PBT and CO 2 emissions selected as the optimal environ-economic sizing is articulated as follows: 1.
The required performance indicators (PBT, total CO 2 emissions, self-consumed energy, shared energy) are calculated for each simulation.

2.
PBT and total CO 2 emissions are normalized with respect to their average value in order to obtain quantities in a comparable numerical range.

3.
If the considered scenario does not include any BESS, the intersection of PBT and total CO 2 emissions lines is one point, representing the desired trade-off.4.
If the considered scenario includes a BESS, PBT, and total CO 2 emissions are surfaces, the intersection of which is a line of possible optimal points.This line allows for selecting the optimal BESS capacity as a function of PV power, but does not provide information on the optimal PV power to be selected.In order to obtain a single optimal point, an additional performance indicator must be evaluated.To this end, the maximum self-consumed energy is selected if the measures at each connection point are not shared.On the contrary, in the case of a JARSC group in which the measures at each connection point are shared, the optimal point is chosen on the basis of the maximum of the sum of self-consumed energy and shared energy.
A flowchart representing the proposed procedure is depicted in Figure 3.It is worth noting that the additional criteria exposed at point 4 (maximum self-consumed energy or maximum of the sum of self-consumed energy and shared energy) are selected considering the main purpose of JARSC and REC, which is to encourage local consumption of generated energy to support a transition towards a sustainable energy system, while reducing the induced stress of the public distribution grid.PBT with respect to CO2 emissions, resulting in a more economic but less environmentally friendly system.

Definition of Simulation Scenarios
In order to (a) determine the optimal sizing of the considered PV system, (b) determine the optimal sizing of the considered BESS system, if any, and (c) assess the economic and environmental convenience in realizing a group of JARSC, a comprehensive set of simulations have been performed.The considered simulation scenarios are reported in Table 6, where they are categorized on the basis of the presence of a PV system, presence of BESS, configuration of a JARSC group, and sharing of measurement data (applicable only when a JARSC group is constituted and a BESS is present).

Scenario
For each scenario, a number of simulations has been performed in order to numerically identify the optimal environ-economic solution.As mentioned, given the constraints on the available roof area of the considered building, the number of PV strings is varied Additionally, it is worth highlighting that the proposed method weights the PBT and CO 2 emissions equally.If the resulting payback time is considered too long, it is possible to introduce suitable coefficients in the normalization procedure to increase the weight of PBT with respect to CO 2 emissions, resulting in a more economic but less environmentally friendly system.

Definition of Simulation Scenarios
In order to (a) determine the optimal sizing of the considered PV system, (b) determine the optimal sizing of the considered BESS system, if any, and (c) assess the economic and environmental convenience in realizing a group of JARSC, a comprehensive set of simulations have been performed.The considered simulation scenarios are reported in Table 6, where they are categorized on the basis of the presence of a PV system, presence of BESS, configuration of a JARSC group, and sharing of measurement data (applicable only when a JARSC group is constituted and a BESS is present).For each scenario, a number of simulations has been performed in order to numerically identify the optimal environ-economic solution.As mentioned, given the constraints on the available roof area of the considered building, the number of PV strings is varied from 1 to 30 (3 to 90 modules, increased in steps of 3, resulting in powers from 1.2 kW to 36 kW, with increasing steps of 1.2 kW).Additionally, the BESS number of units is varied from 1 to 30 (2.5 kWh and 75 kWh, with increasing steps of 2.5 kWh).This results in 30 possible sizing combinations for systems with only PV, while systems including PV and BESS are evaluated with 900 possible sizing combinations.

Simulation Scenario 1
In this scenario, the multi-block apartment is considered as a standard set of households without a PV-BESS system, where the total energy consumption of the apartments and common loads are totally supplied by the main power grid.Thus, the household's electric energy costs are due solely to the PO purchase price, including system charges, excise taxes and VAT.
This scenario is intended to be the reference scenario for the evaluation of the advantages of a PV-BESS generation system for a multi-apartment block.

Simulation Scenario 2
In this scenario, it is assumed that a PV system is installed in the condominium, without any BESS system, and the set of apartment owners does not constitute any JARSC group.In this case, the incentives reserved to energy communities and JARSC groups are not available; hence, the revenues rely only on the sale of excess energy to the grid according to the PO selling price and on savings achieved through self-consumed energy from common loads.

Simulation Scenario 3
This scenario differs from Scenario 2 since a BESS is supposed to be installed and integrated with the PV system.The power drained from the battery at each instant k is calculated, according to [26], as follows: Consequently, the battery is charged and discharged in order to cover, if possible, the load at the 13th connection point, maximizing self-consumption.The excess of generation is stored in the BESS for later use, if possible, and otherwise injected into the distribution grid and sold.However, the price of the storage system increases the starting investment significantly with respect to Scenario 2, where only the cost of the PV system must be considered.Moreover, in this scenario, no incentives are available, and the revenues rely only on energy savings and energy sale.

Simulation Scenario 4
This scenario differs from Scenario 2 since the household owners establish a JARSC group.Thus, a PV system is installed on the roof of the building and the JARSC revenues also includes incentives, which are calculated according to the definition of shared energy shown in Section 2.3.No BESS is installed.

Simulation Scenario 5
This scenario differs from Scenario 4 since a BESS is supposed to be installed and integrated with the PV system owned by the JARSC group.Consequently, the self-consumed energy is increased, which implies increased savings in terms of electricity cost.In this scenario, the energy consumption measures at the 12 connection points are not shared within the JARSC community, and thus the battery is controlled by considering only the measurement available at connection point 13 (CM), shown in Figure 1.Therefore, the power drained from the battery at each instant k is calculated according to (11).
Consequently, the battery is charged and discharged in order to cover, if possible, the load at the 13th connection point, maximizing self-consumption.The excess of generation is stored in the BESS for later use, if possible, and otherwise injected into the distribution grid and sold.In this case, a portion of this energy is considered shared energy, depending on the absorptions of the other members of the JARSC group.However, in this scenario, the amount of shared energy is just a result of the momentary energy balance, with no planning in these regards.

Simulation Scenario 6
This scenario differs from Scenario 5, since the members of the JARSC group are assumed to share the energy consumption measures of the twelve connection points within the community.Consequently, the battery is controlled not only to increase selfconsumption at the 13th connection point, but also to increase shared energy, which can be evaluated on the basis of the sum of all available measurements.Thus, in this case, the power drained from the battery at each instant k is calculated, according to [26], as follows:

Simulation Scenario 1: No PV and No BESS (Benchmark)
This basic scenario represents the benchmark for performance evaluation.Based on this, the advantages of the PV and BESS utilization and, more importantly, the implementation of a JARSC community, are highlighted.
Since there are no PV and BESS, the simulation of this scenario consists of a unique simulation which considers the consumption profiles of the dwellers for the considered year.The total CO 2 emissions, the total cost of energy and the total bought energy for the entire multi-block apartment are listed in Table 7.This scenario is intended to quantify the possible advantage due to the PV generation which can be achieved with respect to Scenario 1.
Figure 4 represents the variation in the normalized PBT and total CO 2 emissions as a function of the installed PV power.As mentioned, the number of the PV modules is iteratively changed, as explained in Section 5.As expected, the CO2 emissions decrease as the number of PV modules increas ideally reaching a constant value when the PV generation covers all the electric load d ing day hours.In contrast, the PBT time increases as the number of PV modules increas This is due to the higher initial investment costs, which are not compensated by su ciently higher revenues (sold energy is paid much less than bought energy, hence a lar plant with lower self-consumption is economically penalized).Since the PBT discreti tion is on a yearly basis, different PV plant sizes may have the same payback time.
The trade-off point which optimizes both economic and environmental aspects is r resented, as discussed in Section 4, by the intersection of normalized PBT and CO2 em sions, highlighted with the red marker in Figure 4.This point corresponds to a PV pl of 42 modules with a total power of 16.8 kWp.Once the optimal sizing is identified, i reported in Table 7, along with the corresponding values of total CO2 emissions [kg/yea total bought energy cost [€/year], total bought energy [kWh/year], total PV ener [kWh/year], self-consumed energy [kWh/year], and PBT [years].
With respect to Scenario 1, the optimal sizing obtained from the proposed procedu implies that the total CO2 emissions are decreased by 20.3%, the total bought energy c is decreased by 12.1%, and the total bought energy is reduced by 46.5%, due to a total energy of 18.5 MWh.

Simulation Scenario 3: PV-BESS System and no JARSC Establishment
This scenario is intended to quantify the possible advantage due to the installation a BESS which can be achieved with respect to Scenario 2. Consequently, in this scenar the considered system includes a PV plant and a BESS, without the establishment o JARSC group.The surfaces representing the PBT as a function of PV plant size and BE capacity are reported in Figure 5a.The PBT surface presents some distinctive featur Firstly, its stepped structure shows how different sizing configurations can fall within same number of payback years.Secondly, for some configurations, the payback years ceed the maximum reference years (20 years in this work), which is clearly unacceptab This is not unexpected, as the sizing of some simulations includes a small PV plant an relatively large BESS capacity, which is clearly not a good choice from an economic p spective.Consequently, this sizing combination is excluded in the results.As expected, the CO 2 emissions decrease as the number of PV modules increases, ideally reaching a constant value when the PV generation covers all the electric load during day hours.In contrast, the PBT time increases as the number of PV modules increases.This is due to the higher initial investment costs, which are not compensated by sufficiently higher revenues (sold energy is paid much less than bought energy, hence a larger plant with lower self-consumption is economically penalized).Since the PBT discretization is on a yearly basis, different PV plant sizes may have the same payback time.
The trade-off point which optimizes both economic and environmental aspects is represented, as discussed in Section 4, by the intersection of normalized PBT and CO 2 emissions, highlighted with the red marker in Figure 4.This point corresponds to a PV plant of 42 modules with a total power of 16.8 kWp.Once the optimal sizing is identified, it is reported in Table 7, along with the corresponding values of total CO 2 emissions [kg/year], total bought energy cost [€/year], total bought energy [kWh/year], total PV energy [kWh/year], self-consumed energy [kWh/year], and PBT [years].
With respect to Scenario 1, the optimal sizing obtained from the proposed procedure implies that the total CO 2 emissions are decreased by 20.3%, the total bought energy cost is decreased by 12.1%, and the total bought energy is reduced by 46.5%, due to a total PV energy of 18.5 MWh.

Simulation Scenario 3: PV-BESS System and No JARSC Establishment
This scenario is intended to quantify the possible advantage due to the installation of a BESS which can be achieved with respect to Scenario 2. Consequently, in this scenario, the considered system includes a PV plant and a BESS, without the establishment of a JARSC group.The surfaces representing the PBT as a function of PV plant size and BESS capacity are reported in Figure 5a.The PBT surface presents some distinctive features.Firstly, its stepped structure shows how different sizing configurations can fall within the same number of payback years.Secondly, for some configurations, the payback years exceed the maximum reference years (20 years in this work), which is clearly unacceptable.This is not unexpected, as the sizing of some simulations includes a small PV plant and a relatively large BESS capacity, which is clearly not a good choice from an economic perspective.Consequently, this sizing combination is excluded in the results.The intersection curve, highlighted with a thick black line in Figure 5a, represents the set of optimal trade-offs considering PBT and total CO2 emissions.As mentioned in Section 4, the optimal solution is chosen in the aforementioned set on the basis of maximum self-consumed energy.
Considering Figure 5a, it is also worth noting that the black line defining the intersection between the two surfaces can map a function from PV power to BESS capacity (for each PV sizing value considered, there is always a single optimal point) but not the opposite (for some BESS capacities, two PV sizing values are found).The same happens with other quantities, such as self-consumed energy, used to determine the optimal point inside the set of optimal solutions highlighted by the intersection of PBT and total CO2 emissions, not shown here for brevity.
Consequently, in order to identify the optimal sizing, the total annual self-consumed energy corresponding to the set of potential optimal points identified by the intersection of PBT and total CO2 emissions (Figure 5a) is reported in Figure 5b.Additionally, the corresponding BESS capacity values are also reported in Figure 5b.It is possible to appreciate The intersection curve, highlighted with a thick black line in Figure 5a, represents the set of optimal trade-offs considering PBT and total CO 2 emissions.As mentioned in Section 4, the optimal solution is chosen in the aforementioned set on the basis of maximum self-consumed energy.
Considering Figure 5a, it is also worth noting that the black line defining the intersection between the two surfaces can map a function from PV power to BESS capacity (for each PV sizing value considered, there is always a single optimal point) but not the opposite (for some BESS capacities, two PV sizing values are found).The same happens with other quantities, such as self-consumed energy, used to determine the optimal point inside the set of optimal solutions highlighted by the intersection of PBT and total CO 2 emissions, not shown here for brevity.
Consequently, in order to identify the optimal sizing, the total annual self-consumed energy corresponding to the set of potential optimal points identified by the intersection of PBT and total CO 2 emissions (Figure 5a) is reported in Figure 5b.Additionally, the corresponding BESS capacity values are also reported in Figure 5b.It is possible to appreciate that the maximum total self-consumed energy value is obtained with 39 PV modules, corresponding to a PV power equal to 15.6 kWp.The optimal point is highlighted with a red arrow both in Figure 5a and in Figure 5b.The corresponding optimal BESS capacity is equal to 17.5 kWh.The resulting absolute values of total CO 2 emissions [kg/year], total bought energy cost [€/year], total energy consumption [kWh/year], total PV energy [kWh/year], self-consumed energy [kWh/year], and PBT [years] are reported in Table 7.
With respect to Scenario 2, as a result of the BESS installation, the total CO 2 emissions are decreased by 1.64%, the total bought energy cost is decreased by 3.8%, and the total bought energy is increased by 7.7%, due to a total PV energy of 17.2 MWh, smaller than the one obtained in Scenario 2. Furthermore, the payback time is increased by two years due to the additional cost of BESS.In these regards, the reduction in the size of the PV plant compared to Scenario 2 can be interpreted as a trade-off with respect to PBT.Indeed, while the BESS represents an additional cost, it also allows the increase in self-consumed energy, which represents the most remunerative aspects of PV-BESS systems.This leads to a smaller PV sizing, as (a) the smaller PV reduces initial investment, and (b) the BESS allows for obtaining a significantly larger amount of self-consumed energy with a smaller PV system.
Figure 5b is also useful for analysing the sensitivity of the considered system in the neighbourhood of the identified optimal solution.Indeed, the self-consumed energy as a function of PV power is quite flat in the range of 15-20 kWp, while the BESS capacity corresponding to possible optimal solutions decreases significantly.This implies that, with respect to the optimal solution reported in Table 7 for Scenario 3, a larger PV can be associated with a smaller BESS to provide a reduction in total CO 2 emissions, with no penalty in terms of PBT.On the contrary, reducing the PV size requires a larger BESS capacity, which negatively affects PBT.

Simulation Scenario 4: PV System without BESS (JARSC)
This scenario is intended to quantify the possible advantage due to the establishment of a JARSC group which can be achieved with respect to Scenario 2. In this case, the revenues are due to (a) energy savings related to self-consumption, (b) remuneration for energy sold to the grid, and (c) incentive granted for shared energy, as discussed in Section 2.3.The latter represents the significant difference from Scenario 2. Figure 6 shows the variation of the normalized PBT and total CO 2 emissions as a function of the installed PV power.With respect to Scenario 2, as a result of the BESS installation, the total CO2 emissi are decreased by 1.64%, the total bought energy cost is decreased by 3.8%, and the to bought energy is increased by 7.7%, due to a total PV energy of 17.2 MWh, smaller th the one obtained in Scenario 2. Furthermore, the payback time is increased by two ye due to the additional cost of BESS.In these regards, the reduction in the size of the plant compared to Scenario 2 can be interpreted as a trade-off with respect to PBT.Inde while the BESS represents an additional cost, it also allows the increase in self-consum energy, which represents the most remunerative aspects of PV-BESS systems.This le to a smaller PV sizing, as (a) the smaller PV reduces initial investment, and (b) the BE allows for obtaining a significantly larger amount of self-consumed energy with a sma PV system.
Figure 5b is also useful for analysing the sensitivity of the considered system in neighbourhood of the identified optimal solution.Indeed, the self-consumed energy a function of PV power is quite flat in the range of 15-20 kWp, while the BESS capac corresponding to possible optimal solutions decreases significantly.This implies th with respect to the optimal solution reported in Table 7 for Scenario 3, a larger PV can associated with a smaller BESS to provide a reduction in total CO2 emissions, with penalty in terms of PBT.On the contrary, reducing the PV size requires a larger BE capacity, which negatively affects PBT.

Simulation Scenario 4: PV System without BESS (JARSC)
This scenario is intended to quantify the possible advantage due to the establishm of a JARSC group which can be achieved with respect to Scenario 2. In this case, the re nues are due to (a) energy savings related to self-consumption, (b) remuneration for ergy sold to the grid, and (c) incentive granted for shared energy, as discussed in Sect 2.3.The latter represents the significant difference from Scenario 2. Figure 6 shows variation of the normalized PBT and total CO2 emissions as a function of the installed power.The CO2 values are the same as in Scenario 2, since the physical energy exchang not different.Conversely, the PBT values are different from Scenario 2, where the JAR group is not considered, due to the additional incentive granted to the latter.In particu the PBT curve is stretched and lowered, and many more sizing combinations fall un the same return year mainly due to the economic incentive granted to JARSC groups.T trade-off sizing can be obtained through the intersection of the two curves as in the pre The CO 2 values are the same as in Scenario 2, since the physical energy exchange is not different.Conversely, the PBT values are different from Scenario 2, where the JARSC group is not considered, due to the additional incentive granted to the latter.In particular, the PBT curve is stretched and lowered, and many more sizing combinations fall under the same return year mainly due to the economic incentive granted to JARSC groups.The trade-off sizing can be obtained through the intersection of the two curves as in the previous cases, resulting in a PV plant of 36 modules, with a total power of 14.4 kWp.The optimal point is highlighted with a red arrow in Figure 6.The resulting absolute values of total CO 2 emissions [kg/year], total bought energy cost [€/year], total bought energy [kWh/year], total PV energy [kWh/year], self-consumed energy [kWh/year], shared energy [kWh/year], and PBT [years] are reported in Table 7.
With respect to Scenario 2, as a result of the establishment of a JARSC group, the total CO 2 emissions are increased by 1.7%, the total bought energy cost is decreased by 6.6%, and the total bought energy is increased by 12.4% due to a lower total PV energy of 15.89 MWh for this new design configuration.However, the payback time drastically decreased to nine years due to the reduction in the size of the PV plant and the economic incentives.While this may seem counterintuitive, as the optimal solution as the JARSC group leads to higher CO 2 emissions, it is worth noting that the optimization is a trade-off between economic and environmental parameters, so that a smaller sizing is convenient as it results in a smaller initial investment.As can be appreciated from Figure 5, it is possible to increase the installed PV power up to 25 kWp, resulting in lower CO 2 emissions, and a larger initial investment, but the same PBT.

Simulation Scenario 5: PV-BESS System without Measurements Sharing (JARSC)
This scenario is intended to quantify the possible advantage due to the installation of a BESS, which can be achieved with respect to Scenario 4, and the possible advantage due to the establishment of a JARSC group, which can be achieved with respect to Scenario 3. In this scenario, individual user consumption measurements are not shared with the BESS control system, and therefore, the battery operation is determined only by PV generation, SoC, and common loads absorption, according to (11).
The surfaces representing the PBT as a function of PV plant size and BESS capacity are reported in Figure 7a, where the black line highlights the trade-off sizing values.Similarly to Scenario 3 (and according to the procedure proposed in Section 4), in order to identify the optimal sizing, the total annual self-consumed energy corresponding to the set of potential optimal points identified by the intersection of PBT and total CO 2 emissions (Figure 7a) is reported in Figure 7b.Additionally, the corresponding BESS capacity values are also reported in Figure 7b.
It is possible to appreciate that the maximum total self-consumed energy value is obtained with 60 PV modules, corresponding to a PV power equal to 24 kWp.The optimal point is highlighted with a red arrow both in Figure 7a and in Figure 7b.The corresponding optimal BESS capacity is equal to 25 kWh.The resulting absolute values of total CO 2 emissions [kg/year], total bought energy cost [€/year], total bought energy [kWh/year], total PV energy [kWh/year], self-consumed energy [kWh/year], shared energy [kWh/year], and PBT [years] are reported in Table 7.
Comparing Scenario 5 (Figure 7a) with Scenario 3 (Figure 5a) and Scenario 4 (Figure 6), it is possible to appreciate that the set of possible optimum points obtained in Scenario 5 corresponds to higher battery capacities.This is a result of the economic incentives granted to JARSC groups, which allows larger initial investments with no significant penalization in terms of PBT.With respect to Scenario 3, as a result of the establishment of a JARSC group, total CO 2 emissions are decreased by 7.8%, the total bought energy cost is decreased by 14.0%, and the total bought energy is decreased by 39.9%, due to a higher total PV energy of 26.4 MWh for this new design configuration.With respect to Scenario 4, as a result of the BESS installation, the total CO 2 emissions are decreased by 10.3 %, the total bought energy cost is decreased by 11.5%, and the total bought energy is decreased by 42.4%, due to a higher total PV energy of 26.4 MWh for this new design configuration.However, Figure 7b is also useful for analysing the sensitivity of the considered system in the neighbourhood of the identified optimal solution.Indeed, the self-consumed energy as a function of PV power exhibits a relatively sharp peak centred around 25 kWp of PV power.This suggests that varying the optimal sizing in its neighbourhood does not allow for any significant benefit, while, in previous scenarios, a slightly larger PV provided reduced CO 2 emissions with no penalty on PBT.

Simulation Scenario 5: PV-BESS System without Measurements Sharing (JARSC)
This scenario is intended to quantify the possible advantage due to the installation of a BESS, which can be achieved with respect to Scenario 4, and the possible advantage due to the establishment of a JARSC group, which can be achieved with respect to Scenario 3. In this scenario, individual user consumption measurements are not shared with the BESS control system, and therefore, the battery operation is determined only by PV generation, SoC, and common loads absorption, according to (11).
The surfaces representing the PBT as a function of PV plant size and BESS capacity are reported in Figure 7a, where the black line highlights the trade-off sizing values.Similarly to Scenario 3 (and according to the procedure proposed in Section 4), in order to identify the optimal sizing, the total annual self-consumed energy corresponding to the set of potential optimal points identified by the intersection of PBT and total CO2 emissions (Figure 7a) is reported in Figure 7b.Additionally, the corresponding BESS capacity values are also reported in Figure 7b.It is possible to appreciate that the maximum total self-consumed energy value is obtained with 60 PV modules, corresponding to a PV power equal to 24 kWp.The optimal point is highlighted with a red arrow both in Figure 7a and in Figure 7b.The corresponding optimal BESS capacity is equal to 25 kWh.The resulting absolute values of total CO2 emissions [kg/year], total bought energy cost [€/year], total bought energy [kWh/year], total PV energy [kWh/year], self-consumed energy [kWh/year], shared energy [kWh/year], and PBT [years] are reported in Table 7.These results immediately highlight how the establishment of a JARSC group provides strong benefits in both economic and environmental terms: with respect to an equivalent system with no JARSC group establishment (Scenario 3), the incentive granted to JARSC supports the installation of new, larger renewable PV plants (24 kWp vs. 15.6 kWp) and BESS (25 kWh vs. 17.5 kWh).In addition, comparing a JARSC group in the presence and in the absence of a BESS (Scenario 5 vs. Scenario 4), the economic incentive granted to JARSC allows the installation of quite a large PV-BESS system (24 kWp-25 kWh) with a modest PBT increment, with respect to a PV system alone (14.4 kWp).
Nevertheless, the best economic results in terms of PBT are obtained from Scenario 4, which consists of a JARSC group with no BESS.This is not completely unexpected, since one of the targets of the JARSC groups and REC is to relieve the stress on the distribution grid by supporting the local consumption of renewable energy.However, it is worth considering that, in the current scenario, the system only considers the measures of common consumption for BESS operation, according to (11), and therefore the storage system only releases its energy when it is required by common loads.It is hence worth investigating the impact of shared measures, which is discussed in Scenario 6. Anyway, the optimal sizing obtained in Scenario 5 results in significantly lower CO 2 emissions (−10.3 %) with respect to Scenario 4. Indeed, one of the main purposes of energy communities is to support the installation of renewable energy generators in industrial and residential buildings in order to provide economic, environmental, and social benefits, and consequently this result cannot be said not to be aligned with the legislator purposes.

Simulation Scenario 6: PV-BESS System with Measurement Sharing (JARSC)
This scenario is intended to quantify the possible advantage due to the sharing of each user's energy consumption measures within the JARSC group, with respect to Scenario 5. Consequently, user's consumption readings from each of the twelve energy meters (UM) are assumed to be available to the JARSC group energy management system, in addition to the common loads consumption measures, which are available in all scenarios.The BESS operation is hence determined according to (12).
The surfaces representing the PBT as a function of PV plant size and BESS capacity are reported in Figure 8a, where the black line highlights the trade-off sizing values.Similarly to Scenarios 3 and 5 (and according to the procedure proposed in Section 4), in order to identify the optimal sizing, an additional performance indicator is needed to identify the optimal point among the set of possible optimal points represented by the intersection of PBT and total CO 2 emissions (Figure 8a).However, since in this case, shared energy is included in the function defining BESS operation, considering self-consumed energy as in the previous scenarios is not very significant.On the contrary, in Scenario 6, the third performance indicator used to identify the optimal sizing among the set of possible optimal points represented by the intersection of PBT and total CO 2 emissions is the sum of self-consumed and shared energy.The values of this quantity, corresponding to the set of possible optimal points highlighted by the black line in Figure 8a, are reported in Figure 8b.Additionally, the corresponding BESS capacity values are reported in Figure 8b.It is possible to appreciate that the maximum of the sum of self-consumed and shared energy is obtained with 84 PV modules, corresponding to a PV power equal to 33.6 kWp.The optimal point is highlighted with a red arrow both in Figure 8a and in Figure 8b.The corresponding optimal BESS capacity is equal to 15 kWh.The resulting absolute values of total CO 2 emissions [kg/year], total bought energy cost [€/year], total bought energy [kWh/year], total PV energy [kWh/year], self-consumed energy [kWh/year], shared energy [kWh/year], and PBT [years] are reported in Table 7.
Comparing Scenario 6 (Figure 8a) with Scenario 5 (Figure 7a), it is possible to appreciate that measurement sharing within the JARSC groups is beneficial for the whole community.In fact, the PBT surface is lowered, with lower values especially in configurations with high PV power and storage capacity.This is a result of the BESS reacting not only to the demand of common loads, but also to individual user's consumptions in order to increase both shared and self-consumed energy.In addition, the optimal sizing is pushed towards higher PV powers, reducing CO 2 emissions consequently.With respect to Scenario 5, as a result of the modified BESS management allowed by measurement sharing within the JARSC community, the total CO 2 emissions is decreased by 9.2 %, the total bought energy cost is decreased by 10.6% and the total bought energy is decreased by 77.7% due to a much higher total PV energy of 37 MWh.Furthermore, the payback time is decreased by one year (10 vs. 11 years) despite the increase in the size of photovoltaics.Comparing Scenario 6 (Figure 8a) with Scenario 5 (Figure 7a), it is possible to appreciate that measurement sharing within the JARSC groups is beneficial for the whole community.In fact, the PBT surface is lowered, with lower values especially in configurations with high PV power and storage capacity.This is a result of the BESS reacting not only to the demand of common loads, but also to individual user's consumptions in order to increase both shared and self-consumed energy.In addition, the optimal sizing is pushed towards higher PV powers, reducing CO2 emissions consequently.With respect to Scenario 5, as a result of the modified BESS management allowed by measurement sharing within the JARSC community, the total CO2 emissions is decreased by 9.2 %, the total bought energy cost is decreased by 10.6% and the total bought energy is decreased by 77.7% due to a much higher total PV energy of 37 MWh.Furthermore, the payback time Figure 8b is also useful for analysing the sensitivity of the considered system in the neighbourhood of the identified optimal solution.Indeed, the sum of shared energy and self-consumed energy as a function of PV power is quite flat, from 20 kWp up to 36 kWp of PV power.This suggests that increasing the PV power with respect to the optimal sizing provides reduced CO 2 emission with no penalty on PBT, as the required BESS capacity decreases for increasing PV power (Figure 8b).
These results immediately highlight how the sharing of measurement data within the JARSC group provides strong benefits in both economic and environmental terms: with respect to an equivalent system with no measurement sharing (Scenario 5), the increased shared energy results in increased revenues due to the economic incentive granted to JARSC, which supports the installation of a larger renewable PV plant (33.6 kWp vs. 24 kWp) and smaller BESS (15 kWh vs. 25 kWh).In addition, comparing a JARSC group in the presence and in the absence of a BESS (Scenario 6 vs. Scenario 4), the economic incentive granted to JARSC allows the installation of quite a large PV-BESS system (33.6 kWp-15 kWh) with a modest PBT increment (10 vs. 9 years), with respect to a PV system alone (14.4 kWp).
The best economic results in terms of PBT are still obtained from Scenario 4, which consists of a JARSC group with no BESS.The same considerations drawn comparing Scenario 5 to Scenario 4 apply.Additionally, it is worth noting that the sharing of measurement data within the JARSC group allows the installation of a much larger PV power (roughly twice) and BESS with only a one-year increase in PBT.Furthermore, the optimal sizing obtained in Scenario 6 results in significantly lower CO 2 emissions (−9.2%) with respect to Scenario 5. Indeed, as one of the main purposes of energy communities is to support the installation of renewable energy generators in industrial and residential buildings in order to provide economic, environmental, and social benefits, this result cannot be said not to be aligned with the legislator purposes.

Conclusions
This paper proposed an investigation on optimal PV-BESS system sizing of a condominium acting as a JARSC community, possibly including a BESS with rule-based EMS.PV-BESS sizing results are investigated by combining economic and environmental perspectives, considering a case study located in Milan, Italy.The sizing combinations for different PV power and storage capacities are examined, and procedure to numerically determine the environ-economic optimal sizing is proposed, achieving a trade-off between PBT and CO 2 emissions due to power consumption from the grid.The proposed procedure is applied to five distinct simulation scenarios, the results of which are presented and discussed.
The effectiveness and advantages of the JARSC establishment are highlighted by showing that the economic remuneration on shared energy can be the key factor for the development of distributed generation at the residential level and for decarbonization strategies.In particular, the environ-economic optimal sizing obtained from the system with PV but no BESS is found to be significantly more economically favourable in the case where a JARSC group is established, even though it is marginally less environmentfriendly.On the contrary, the environ-economic optimal sizing obtained from the system with PV and BESS is found to be significantly more economically favourable and much more environment-friendly in the case where a JARSC group is established, particularly in the case in which measurement data are shared among within the JARSC community.In this last case, the results in terms of PBT come quite close to a much smaller PV system with no BESS, supporting both the effectiveness of the JARSC/REC tool in providing economic support to the transition towards a sustainable energy system and the need to include shared measurement data in JARSC and REC management.
Future developments of this work may include the assessment of costs and CO 2 emissions during the entire life cycle of components through a life cycle assessment (LCA) approach, covering the construction and disposal aspects along with the utilisation period.

Figure 1 .
Figure 1.Considered JARSC system electrical schematic composed by dweller's load, PV-BESS system, and common loads consisting of lighting system (LS), elevator (EL), and the electric vehicle charging station (CS).

Figure 2 .
Figure 2. Example of twelve apartment electrical load profiles over the period of one week.

Figure 2 .
Figure 2. Example of twelve apartment electrical load profiles over the period of one week.

Figure 3 .
Figure 3. Flowchart representing the procedure for selection of optimal PV-BESS sizing.

Figure 3 .
Figure 3. Flowchart representing the procedure for selection of optimal PV-BESS sizing.

Figure 5 .
Figure 5. (a) Normalised PBT vs. total CO2 emissions for Scenario 3. The black line represents the intersection of the two surfaces; (b) total self-consumed energy values and BESS capacity for the trade-off points considered for Scenario 3.

Figure 5 .
Figure 5. (a) Normalised PBT vs. total CO 2 emissions for Scenario 3. The black line represents the intersection of the two surfaces; (b) total self-consumed energy values and BESS capacity for the trade-off points considered for Scenario 3.

Energies 2023 ,
16, x FOR PEER REVIEW 19 o arrow both in Figure 5a and in Figure 5b.The corresponding optimal BESS capacity equal to 17.5 kWh.The resulting absolute values of total CO2 emissions [kg/year], to bought energy cost [€/year], total energy consumption [kWh/year], total PV ene [kWh/year], self-consumed energy [kWh/year], and PBT [years] are reported in Table
is equal to 11 years, 2 years longer than Scenario 4 (9 years) due to the increase in PV size and the BESS installation, but 3 years shorter than Scenario 3 (14 years).

Figure 7 .
Figure 7. (a) Normalized PBT vs. total CO2 emissions for Scenario 5.The black line represents the intersection of the two surfaces; (b) total self-consumed energy values and BESS capacity for the trade-off points considered for Scenario 5.

Figure 7 .
Figure 7. (a) Normalized PBT vs. CO 2 for Scenario 5.The line represents the intersection of the two surfaces; (b) total self-consumed energy values and BESS capacity for the trade-off points considered for Scenario 5.

Figure 8 .
Figure 8.(a) Normalized PBT vs. total CO2 emissions for Scenario 6.The black line represents the intersection of the two surfaces; (b) sum of total self-consumed energy and shared energy values and BESS capacity for the trade-off points considered for Scenario 6.

Figure 8 .
Figure 8.(a) Normalized PBT vs. total CO 2 emissions for 6.The black line represents the intersection of the two surfaces; (b) sum of total self-consumed energy and shared energy values and BESS capacity for the trade-off points considered for Scenario 6.

Table 2 .
Single battery unit specification.

Table 3 .
Dwellers details, contractual power, and yearly electricity consumption.

Table 4 .
JARSC group members fixed electricity costs.

Table 5 .
Parameters for JARSC group economic assessment.

•
Battery exchanged power P batt[1xN] : control variable which constitutes the output of the considered rule-based controllers, discussed in Sections 5.3 and 5.6 for the different simulation scenarios.• PV generated energy E PV[1xN] : PV generated energy over the N sample intervals included in one year.

Table 7 .
Simulation results of the optimal sizing plant of the considered scenarios.