Energy, Environmental and Economic Performance of an Urban Community Hybrid Distributed Energy System

: Energy systems face great challenges from both the supply and demand sides. Strong e ﬀ orts have been devoted to investigate technological solutions aiming at overcoming the problems of fossil fuel depletion and the environmental issues due to the carbon emissions. Hybrid (activated by both renewables and fossil fuels) distributed energy systems can be considered a very e ﬀ ective and promising technology to replace traditional centralized energy systems. As a most peculiar characteristic, they reduce the use of fossil sources and transmission and distribution losses along the main power grid and contribute to electric peak shaving and partial-loads losses reduction. As a direct consequence, the transition from centralized towards hybrid decentralized energy systems leads to a new role for citizens, shifting from a passive energy consumer to active prosumers able to produce energy and distribute energy. Such a complex system needs to be carefully modelled to account for the energy interactions with prosumers, local microgrids and main grids. Thus, the aim of this paper is to investigate the performance of a hybrid distributed energy system serving an urban community and modelled within the framework of agent-based theory. The model is of general validity and estimates ( i ) the layout of the links along which electricity is distributed among agents in the local microgrid, ( ii ) electricity exchanged among agents and ( iii ) electricity exported to the main power grid or imported from it. A scenario analysis has been conducted at varying the distance of connection among prosumers, the installed capacity in the area and the usage of links. The distributed energy system has been compared to a centralized energy system in which the electricity requests of the urban community are satisﬁed by taking electricity from the main grid. The comparison analysis is carried out from an energy, environmental and economic point of view by evaluating the primary energy saving, avoided carbon dioxide emissions and the simple payback period indices.


Introduction
The rapid climate changes due to fossil fuel consumption and the rising awareness on the need to increase environmental protection have pushed the scientific community and governments to integrate sustainable solutions able to account for the massive global energy demand. In this sense, renewable-based energy production systems represent a valid alternative to the traditional fossil-fuelled energy production paradigm. Among the most important peculiarities of these systems, the decentralization of the energy distribution and the rising role of prosumers within a local microgrid constitutes the leitmotiv of this present research.
If on the one hand renewable systems have radically changed the way we have conceived energy production and distribution so far, on the other hand, their contribution is often not sufficient to strategies [17]. Similarly, but with more attention to the layout of the microgrid and without deepening power flow control, Fichera et al. proposed a complex network approach to model the configuration of a potential distribution network of prosumers [18]. Karmellos and Mavrotas formulated an optimization model to account for the design of multi-energy systems within microgrids [19].
So far, there is a fundamental feature of microgrids that needs to be further explored in depth, i.e., the impact of the active participation of prosumers in the distribution process in terms of electricity flows exchanged in local microgrids [20]. In fact, although the current literature is rich in models and approaches dealing with power control strategies, load shaping and optimal design, operation and management of energy systems, the investigation of electricity flows distributed within the local microgrid of prosumers still merits further research [21]. In this direction, a previous work of the authors proposed an agent-based model to account for the hybrid distributed energy system serving an urban community [22]. Each building is modelled as an agent able to both produce electricity for its own requests and to exchange electrical energy within the local microgrid. The electrical energy neither self-consumed nor distributed is fed into the main grid and, in the same way, electrical energy demands not met by the local microgrid are satisfied by the main grid. The model has been implemented in a programmable modelling environment and the analysis has been performed varying different parameters such as the installed photovoltaic capacity in the area, the imposed distance for the energy exchanges, and the utilization of the links of the local microgrid. The hybrid distributed energy system is composed by a certain number of grid-connected photovoltaic plants installed on residential and tertiary buildings of the urban area. Taking inspirations from the results of this previous research, the foremost goal of this paper is to provide insights on the performance of a local hybrid distributed energy system serving urban communities. To the scope, the local microgrid is compared to the traditional centralized configuration in which the electricity requests are entirely satisfied by the main grid. The comparison is grounded on energetic, environmental and economic issues evaluated taking primary energy savings, avoided carbon dioxide emissions and simple payback period indices into account.

The Agent-Based Model
The smart grid paradigm implies the decentralization of the electricity distribution from a national centralized to a local decentralized configuration. This shift entails the direct involvement of final users in the electricity distribution process: thanks to the installation of renewable-based production systems, prosumers satisfy their own electricity demand and share the exceeding production within a limited neighborhood. The distribution among prosumers constitutes a local microgrid characterized by bidirectional electricity exchanges which modelling requires the development of ad hoc defined tools. Dealing with such a complex system, in which prosumers actively participate in the distribution process and pursuit the twofold objective of satisfying their demand and distributing the exceeding production is a non-trivial task. In fact, if on one side each prosumer acts as a unique decision maker, on the other side they are a part of a whole system that they directly influence through their autonomous behaviors. Precisely, by virtue of these characteristics, the electricity distribution among prosumers can be approached with the aim of agent-based models, able to highlight both interactions and mutual influence between the organisms and its parts. The agent-based model reported in this paper has been developed in a previous research of the authors [22] and investigated the topological configuration of the local microgrid. Here, the model is reported with the aim of enhancing the energetic, environmental and economic issues related to the electricity self-consumed and distributed within the local microgrid and to the electricity exported or imported from the main grid.
The steps of the agent-based model have been briefly summarized in the flowchart of Figure 1. The electricity distribution within the local microgrid follows three main steps: a pre-processing stage characterized by the import of all input parameters into NetLogo, a simulation stage in which Energies 2020, 13, 2545 4 of 19 distribution takes place according to a set of predefined rules and, finally, a post-simulation stage collecting data on the exchanged electricity flows (in terms of both local microgrid and main grid).
Going into the detail, the main scope of the pre-processing stage consists in the constitution of the local microgrid in terms of both energetic and architectural viewpoints. For each building, the input parameters transferred to the platform substantially refer to the spatial position (through longitudinal and latitudinal coordinates) and to the energetic demands. Properly, a daily electricity consumption profile is associated to each agent and the potential electricity production from photovoltaic (PV) panels is calculated by taking the available rooftop areas of the buildings into account and, particularly, including correction factors based on the typology of roof (span or flat), orientation, exposure and relative shading from surrounding elements. Once the potential size of the PV to be installed in each building has been estimated, the daily electricity production profiles for any agent of the local microgrid are calculated.  Going into the detail, the main scope of the pre-processing stage consists in the constitution of the local microgrid in terms of both energetic and architectural viewpoints. For each building, the input parameters transferred to the platform substantially refer to the spatial position (through longitudinal and latitudinal coordinates) and to the energetic demands. Properly, a daily electricity consumption profile is associated to each agent and the potential electricity production from photovoltaic (PV) panels is calculated by taking the available rooftop areas of the buildings into account and, particularly, including correction factors based on the typology of roof (span or flat), orientation, exposure and relative shading from surrounding elements. Once the potential size of the PV to be installed in each building has been estimated, the daily electricity production profiles for any agent of the local microgrid are calculated.
At this point, agents should be connected to ensure the distribution. It is not reasonable to choose a fully connected mode; therefore, a threshold distance d l establishes the maximum admitted length of the transmission line between each agent's pair. According to this, two randomly selected agents are connected through a link if they are located within the predetermined distance. With respect to the connections with the main grid, each agent maintains its traditional electrical transmission line. Having determined the topological and energetic features of the local microgrid, the last step of this pre-processing stage consists in the calculation of the distribution potential of any agent. This potential is calculated as the difference between the electrical production and the electrical demand for each agent. In this sense, each agent is allowed to distribute electrical energy if its potential is positive, i.e., if the production exceeds the demand. On the contrary, a negative value of the distribution potential states that the demand exceeds the production, i.e., the agent needs to receive electrical energy from the local microgrid or from the main grid. It is worth noting that the decisional process of agents refers to the energetic flow control and does not involve power flow control, i.e., it does not include voltage problems, power losses on the power transmission lines or peak load-shaving issues. This assumption is common in the literature on the field of the energy distribution modelling [23][24][25]. In the simulation stage, distribution among agents takes place and the amount of electricity distributed by agents within the local microgrid is E PV El , that is the electrical energy produced by PV and shared among agents. The distribution occurs within the neighbourhood of agents respecting the maximum admitted distance of connection d l as said, but also in accordance with a priority list accounting for who should be served first. In this model, distribution priority is granted to closest agents that have the lowest electricity demand yet to be fulfilled. After the distribution, two main configurations may occur: there are still agents whose demands need to be covered but no any agents with positive distribution potential can be identified within the neighbourhood comprised in the admitted distance d l : in this case, the agent needs to purchase electricity from the main grid E PG_PS El . In the second case, agents with positive distribution potential can be in the condition for which they still have electricity to be distributed but are not able to identify other requiring agents: this excess is therefore exported to the main grid E PG El_exp . Finally, during the post-processing analysis, the total amount of electricity exchanged within the local microgrid and the total electricity imported or exported to the power grid are calculated.

The Energetic, Environmental and Cost Performance Evaluation
The local microgrid constituted by PV plants installed in an urban community (UC) is here considered as a proposed system (PS). The energy, environmental and economic performances of PS are compared with those of a conventional system (CS) in which the electricity needs of urban area are satisfied by taking off electricity from a main power grid (PG). Both PS and CS are schematically represented in Figure 2.

The Energy Analysis
Before starting the comparison between the energy performances of both PS and CS, the performances of only PS are evaluated by means of the specific power grid impact index (z) introduced in [26]. z index is defined as reported in Equation (1): z index is the ratio between the sum of electricity exported to the main power grid (E PG El_ exp ) and taken off PG (E PG_PS El ) and the total urban community electricity needs (E UC El ). E PG El_ exp is the electricity produced by PV panels installed on UC buildings that is not exchanged among users in UC.
PS and CS are compared from an energy point of view by means of the Fossil Primary Energy Saving (FPES) index (Equation (2)). It expresses the primary energy saving due to fossil fuels achieved by PS with respect to CS (PE CS − PE PS ) and primary energy of CS (PE CS ). where: Primary energy due to CS (Equation (3)) is the ratio between the annual urban community electricity requirement and the average Italian power plants mix efficiency in 2017 (η PP El ), calculated considering the hourly electricity generated from fossil fuel-based thermo-electric power plants, renewable plants and including also the grid losses in 2017 [27]. η PP El is equal to 0.476. Primary energy of PS (Equation (4)) is proportional to the electric energy taken from grid (E PG_PS El ) that is the amount of energy required by UC and not satisfied by electricity generated from PV panels (E PV El ). Moreover, the electric energy produced by PV panels and exported to main power grid (E PG El_ exp ) because it is not used to satisfy urban community requests, is accounted as a "credit" in energy analysis.

The Environmental Analysis
The avoided carbon dioxide (CO 2 ) emissions index (∆CO 2 ) is used to compare the environmental performance of PS and CS. ∆CO 2 index (Equation (5)) represents the amount of CO 2 emissions reduction achieved using PS with respect to CS on the basis of a simplified approach: where: CO 2 emissions of both CS (Equation (6)) and PS (Equation (7)) are defined by means of Italian average CO 2 emission factor for electricity (α) in 2017. α factor is equal to 356 gCO 2 /kWh El and it is evaluated considering Italian hourly electricity produced both by thermoelectric power plants and renewable-based plants including grid losses [27]. CO PS 2 emissions depend on electricity exported to Energies 2020, 13, 2545 7 of 19 main power grid (E PG El_ exp ) that is considered as a "credit" in CO PS 2 (as it has already done for energy analysis) according to methodology proposed in [28].

The Economic Analysis
Economic analysis is performed by assessing the investment cost (IC) of PS with respect to CS (Equation (8)). Hereinafter, it is considered that all the infrastructures referred to CS predate PS installation and thus, no Investment Cost (IC) can be imputable to CS: where: • IC is the investment cost of hybrid distributed energy system (PV panels and local microgrid connecting the agents of UC); • IC PV is the investment cost of photovoltaic plants equal to 1000 €/kW [29]. It includes all PV plants infrastructures (inverter, modules, wiring, etc.), transportation and installation costs and 10% VAT. • IC LM is the investment cost of the local microgrid (LM) which connects the agents in urban community. This cost is equal to 9.59 €/m [30] and it considers the electric wirings cost and their undergrounding as well as the dumping of waste materials.
Furthermore, the difference between operating cost of CS and PS (∆OC) is calculated according to (Equation (9)): where the Operating Cost (OC) of PS and CS is defined with reference to Equation (10) and Equation (11), respectively: where: • OC PG_PS (Equation (12)) and OC PG El_ exp (Equation (13)) are the operating costs due to the electricity imported from and exported to power grid respectively. and they are expressed as following: El_ exp (13) c u,El is the unitary cost of electricity taken from the grid equal to about 187 €/MWh [31], that depends upon the amount of electricity imported from main power grid both for PS and CS. • c PG u.El_Exp is the unitary cost paid for the electricity exported to main power grid. It amounts to about 55 €/MWh [31]; • OC O&M are the operating and maintenance costs that are equal to 3% of the whole initial investment cost [31].

Proposed System Energy Analysis Results
This paper describes the results of the application of the described agent-based model to an urban community (UC) located in Southern Italy. The area counts 370 buildings, the majority of them belonging to social houses (i.e., building stocks owned by the local government and rent to people with low incomes), but also including independent houses owned and occupied by a single-family unit, supermarkets, retail shops and a church. The electricity demands of the area have been collected merging data derived from both audits and public databases of the National Statistical Institute [32] and by Terna S.p.A. [33] for residential buildings. For non-residential buildings, data have been averaged from Confcommercio [34] and the Italian National Agency for New Technologies, Energy and Sustainable Economic Development (ENEA) [35]. Geometrical features of the rooftops derive from a data collection campaign: available data refer to the typology of roof (span or flat), to the orientation and shading from surrounding buildings. Two panoramic views of the area are reported in Figure 3. The two scenarios are described as follows: • Scenario#1 (Sc#1): the agents of proposed system are able to exchange electric energy if their mutual spatial distance is lower than 50 m. • Scenario#2: (Sc#2): the geographical allowed distance threshold between two agents that want to exchange electricity is extended to 200 m.
The choice of the two scenarios mainly derives from the simulations conducted in the previous research [22]. In fact, it has been demonstrated that the distribution among agents is enhanced in correspondence with allowed distances 50 m and, generally, for distances limited to 200 m. So, to highlight differences, it has been chosen to conduct the current analysis for the minimum and maximum values resulting from the simulations. Figure 4 shows the outputs from the simulation including the electricity distributed within the local microgrid, the electricity exported to the main power grid and the electricity imported from it. As regards to the proposed systems the analysis is conducted considering nine different installed PV capacities in urban community, ranging from 2000 kW to 18,000 kW. In particular, PV panels have been first placed on the buildings that display the highest rooftop areas and have been then progressively increased taking into account all required constraints (inclinations, exposition and shading factors, cabling area and maintenance spaces). On average, the electrical energy production for the simulated area can be estimated to be around 1500 kWh/y per 10 m 2 of south-oriented surface [22].
The two scenarios are described as follows: • Scenario#1 (Sc#1): the agents of proposed system are able to exchange electric energy if their mutual spatial distance d l is lower than 50 m. • Scenario#2: (Sc#2): the geographical allowed distance threshold between two agents that want to exchange electricity is extended to 200 m.
The choice of the two scenarios mainly derives from the simulations conducted in the previous research [22]. In fact, it has been demonstrated that the distribution among agents is enhanced in correspondence with allowed distances 50 m and, generally, for distances limited to 200 m. So, to highlight differences, it has been chosen to conduct the current analysis for the minimum and maximum values resulting from the simulations. Figure 4 shows the outputs from the simulation including the electricity distributed within the local microgrid, the electricity exported to the main power grid and the electricity imported from it.   The electricity distributed within the local microgrid by agents with positive distribution potential is reported in Figure 4a at varying the installed PV capacity and for the two simulated scenarios. In both scenarios, the increase of the installed capacity yields an increase of the amount of electricity exchanged among agents.
The trends of both curves show an almost linear increase until the installed capacity is 12,000 kW, becoming smoother beyond this value. This is due to the fact that the higher installed capacity means higher diffusion within the territory and, therefore, a higher distribution potential. Moreover, the difference between the two scenarios is evident as far as an increase of the admitted distance of connection gives rise to a higher amount of electricity exchanged within the local microgrid. Figure  4b reports the electricity exported to the power grid; actually, after the satisfaction of their own demands and the distribution to other requiring neighbours, agents can still have a residual electricity production that is exported, in this case, to the main grid.
Coherently with the results plotted in Figure 4a here the electricity exported to the power grid decreases for any installed PV capacity at increasing the distance of connections between each agent's pair: in this case, in fact, agents gain the chance to distribute their production to a higher number of neighbours.
As expected, the increase of the installed capacity in both scenarios produces an increase of the electricity exported to the traditional power grid. Finally, Figure 4c plots the electricity imported from the main grid despite the distribution within the local microgrid. As can be seen, the request to traditional fossil-fuelled grid decreases significantly at increasing the installed capacity in the territory. To this beneficial result, the observation that part of the electricity produced by agents, i.e. deriving from renewable sources, is exported to the grid play a noteworthy part in reducing the role of fossil consumption. Figure 5 shows the z index trends as a function of PV installed capacity in urban community for both analysed scenarios (Sc#1 and Sc#2). The electricity distributed within the local microgrid by agents with positive distribution potential is reported in Figure 4a at varying the installed PV capacity and for the two simulated scenarios. In both scenarios, the increase of the installed capacity yields an increase of the amount of electricity exchanged among agents.
The trends of both curves show an almost linear increase until the installed capacity is 12,000 kW, becoming smoother beyond this value. This is due to the fact that the higher installed capacity means higher diffusion within the territory and, therefore, a higher distribution potential. Moreover, the difference between the two scenarios is evident as far as an increase of the admitted distance of connection gives rise to a higher amount of electricity exchanged within the local microgrid. Figure 4b reports the electricity exported to the power grid; actually, after the satisfaction of their own demands and the distribution to other requiring neighbours, agents can still have a residual electricity production that is exported, in this case, to the main grid.
Coherently with the results plotted in Figure 4a here the electricity exported to the power grid decreases for any installed PV capacity at increasing the distance of connections between each agent's pair: in this case, in fact, agents gain the chance to distribute their production to a higher number of neighbours.
As expected, the increase of the installed capacity in both scenarios produces an increase of the electricity exported to the traditional power grid. Finally, Figure 4c plots the electricity imported from the main grid despite the distribution within the local microgrid. As can be seen, the request to traditional fossil-fuelled grid decreases significantly at increasing the installed capacity in the territory. To this beneficial result, the observation that part of the electricity produced by agents, i.e., deriving from renewable sources, is exported to the grid play a noteworthy part in reducing the role of fossil consumption. Figure 5 shows the z index trends as a function of PV installed capacity in urban community for both analysed scenarios (Sc#1 and Sc#2).
The z index accounts for the specific power grid impact and, as expected, it is lower in Sc#2 with respect to Sc#1 for each installed PV capacity option. Indeed, in Sc#2 the electricity exported to and imported from main grid is minor than Sc#1 since the spatial distance allowed for electricity exchange among agents is extended to 200 m, so the z index varies from 99% to about 133% in Sc#1, while in Sc#2 it ranges from 89% to 130%. The z index accounts for the specific power grid impact and, as expected, it is lower in Sc#2 with respect to Sc#1 for each installed PV capacity option. Indeed, in Sc#2 the electricity exported to and imported from main grid is minor than Sc#1 since the spatial distance allowed for electricity exchange among agents is extended to 200 m, so the z index varies from 99% to about 133% in Sc#1, while in Sc#2 it ranges from 89% to 130%.
The highest value of the z index is obtained for 18,000 kW PV power in both scenarios, whereas the minimum value is achieved for 4000 kW and 6000 kW PV installed capacity in Sc#1 and Sc#2, respectively. These lowest values represent the best compromise, in terms of PV size, between the self-consumption of photovoltaic electricity and the reduction of the electricity taken from the main grid. The z index higher than 100% means that the sum of electric energy imported from and exported to main grid is greater than urban community electricity requests. This condition occurs with an increase of PV capacity beyond 12,000 kW in Sc#2 instead it is verified for the majority of PV power considered excepted for 2000 kW and 4000 kW in Sc#1.
In order to reduce the electricity exported to the main power grid maximising the on-site PV electricity consumption, the possibility to install an electric storage or a mobile electric storage, such as the mobile electric vehicles used within urban community could be considered.

Energy, Environmental and Economic Comparison Analysis Results and Discussion
The energy, environmental and economic comparison analysis introduced in Section 2 has been applied to PS and CS and the major results are reported in the following. In Figure 6 FPES index (Equation (2)) and primary energy of CS (Equation (3)) and PS (Equation (4)) in both scenarios and for each PV installed power are reported. Primary energy of conventional system (PE CS )does not vary changing PV power and scenario since it depends only upon the electricity requested by urban community ( UC El E ) that remains constant. PE CS (16,776 MWh) is always higher than primary energy of proposed system (PE PS ) in both Sc#1 and Sc#2. Precisely, PE PS in Sc#2 is lower than PE PS in Sc#1 since the higher allowed mutual spatial distance among agents for the electricity exchange in Sc#2 lead to a reduction of numerator in Equation (4). Indeed, the distributed electricity in the urban community increases and contemporary the electricity exported to the main power grid, considered as a credit, decreases for each PV installed capacity. As regards to Fuel Primary Energy Saving (FPES) index, it is always positive demonstrating that PS ensures a primary energy saving with respect to The highest value of the z index is obtained for 18,000 kW PV power in both scenarios, whereas the minimum value is achieved for 4000 kW and 6000 kW PV installed capacity in Sc#1 and Sc#2, respectively. These lowest values represent the best compromise, in terms of PV size, between the self-consumption of photovoltaic electricity and the reduction of the electricity taken from the main grid. The z index higher than 100% means that the sum of electric energy imported from and exported to main grid is greater than urban community electricity requests. This condition occurs with an increase of PV capacity beyond 12,000 kW in Sc#2 instead it is verified for the majority of PV power considered excepted for 2000 kW and 4000 kW in Sc#1.
In order to reduce the electricity exported to the main power grid maximising the on-site PV electricity consumption, the possibility to install an electric storage or a mobile electric storage, such as the mobile electric vehicles used within urban community could be considered.

Energy, Environmental and Economic Comparison Analysis Results and Discussion
The energy, environmental and economic comparison analysis introduced in Section 2 has been applied to PS and CS and the major results are reported in the following. In Figure 6 FPES index (Equation (2)) and primary energy of CS (Equation (3)) and PS (Equation (4)) in both scenarios and for each PV installed power are reported. Primary energy of conventional system (PE CS ) does not vary changing PV power and scenario since it depends only upon the electricity requested by urban community (E UC El ) that remains constant. PE CS (16,776 MWh) is always higher than primary energy of proposed system (PE PS ) in both Sc#1 and Sc#2. Precisely, PE PS in Sc#2 is lower than PE PS in Sc#1 since the higher allowed mutual spatial distance among agents for the electricity exchange in Sc#2 lead to a reduction of numerator in Equation (4). Indeed, the distributed electricity in the urban community increases and contemporary the electricity exported to the main power grid, considered as a credit, decreases for each PV installed capacity. As regards to Fuel Primary Energy Saving (FPES) index, it is always positive demonstrating that PS ensures a primary energy saving with respect to CS in all considered cases and scenarios. In addition, FPES rises with PV installed power thanks to the renewable-based electricity production increase. It moves from 10% to about 99% in Sc#1 and from 12% to 99% in Sc#2. CS in all considered cases and scenarios. In addition, FPES rises with PV installed power thanks to the renewable-based electricity production increase. It moves from 10% to about 99% in Sc#1 and from 12% to 99% in Sc#2. The values of FPES index near 100% is reached for the maximum PV capacity power in both scenarios since in this condition the amount of electricity imported from and exported to power grid in PS are very similar. This condition occurs for two reasons: • even if the amount of electricity produced by PV plants is lower than that requested by the urban community, the photovoltaic electricity is often available when the urban community electricity demand is low and thus it is exported to the main power grid; • the electricity demand of some agents cannot be satisfied by photovoltaic electricity because their mutual spatial distance is higher than that one allowed in each scenario.
The first issue can be overcome coupling PV plants with electric storage in order to store the energy produced by a photovoltaic system and to make it available for use when it is requested. The second issue can be solved changing the allowed mutual spatial distance or selecting the connections among buildings following energy criteria (such as the amount of electricity requested and the PV power installed).
Environmental analysis has been carried out by evaluating the avoided carbon dioxide emissions index (∆CO2) introduced in Equation (5). It has a behaviour similar to FPES as it can be seen from Table 1. The introduction of PV-based systems guarantees a considerable reduction of CO2 emissions due to fossil fuels especially in Sc#2 where higher values of ∆CO2 index are achieved compared to those of Sc#1. In particular, as it has been observed for FPES index, the avoided CO2 emissions rises with the installed PV power and the allowed spatial mutual distance for electricity exchange among agents.  The values of FPES index near 100% is reached for the maximum PV capacity power in both scenarios since in this condition the amount of electricity imported from and exported to power grid in PS are very similar. This condition occurs for two reasons: • even if the amount of electricity produced by PV plants is lower than that requested by the urban community, the photovoltaic electricity is often available when the urban community electricity demand is low and thus it is exported to the main power grid; • the electricity demand of some agents cannot be satisfied by photovoltaic electricity because their mutual spatial distance is higher than that one allowed in each scenario.
The first issue can be overcome coupling PV plants with electric storage in order to store the energy produced by a photovoltaic system and to make it available for use when it is requested. The second issue can be solved changing the allowed mutual spatial distance or selecting the connections among buildings following energy criteria (such as the amount of electricity requested and the PV power installed).
Environmental analysis has been carried out by evaluating the avoided carbon dioxide emissions index (∆CO 2 ) introduced in Equation (5). It has a behaviour similar to FPES as it can be seen from Table 1. The introduction of PV-based systems guarantees a considerable reduction of CO 2 emissions due to fossil fuels especially in Sc#2 where higher values of ∆CO 2 index are achieved compared to those of Sc#1. In particular, as it has been observed for FPES index, the avoided CO 2 emissions rises with the installed PV power and the allowed spatial mutual distance for electricity exchange among agents. Economic analysis has been performed by calculating the investment cost (IC)for PS according to Equation (8) and the difference between operating cost of CS and PS (∆OC) as introduced in Equation (9) for both scenarios. Figure 7 reports ∆OC and IC trends as a function of PV power. Obviously, IC increases with PV installed capacity. Whereas, the difference between the IC in Sc#1 and Sc#2 is not appreciable since it mainly depends upon the cost of local microgrid connecting the agents. The Investment cost of local microgrid (IC LM ) varies between two scenarios because of different length of IG nevertheless, this variation is not substantial compared to the investment cost of photovoltaic system (equal in both scenarios for a fixed PV power) which covers about 98-99% of total investment cost. ∆OC is higher in Sc#2 than Sc#1 and it reaches its maximum value (383 k€/year) at 12,000 kW PV installed power. ∆OC in Sc#1 is significantly lower since the amount of electricity imported/exported to/to grid varies between two scenarios and then its economic valorisation too. Economic analysis has been performed by calculating the investment cost (IC)for PS according to Equation (8) and the difference between operating cost of CS and PS (∆OC) as introduced in Equation (9) for both scenarios. Figure 7 reports ∆OC and IC trends as a function of PV power. Obviously, IC increases with PV installed capacity. Whereas, the difference between the IC in Sc#1 and Sc#2 is not appreciable since it mainly depends upon the cost of local microgrid connecting the agents. The Investment cost of local microgrid (IC LM ) varies between two scenarios because of different length of IG nevertheless, this variation is not substantial compared to the investment cost of photovoltaic system (equal in both scenarios for a fixed PV power) which covers about 98-99% of total investment cost. ∆OC is higher in Sc#2 than Sc#1 and it reaches its maximum value (383 k€/year) at 12,000 kW PV installed power. ∆OC in Sc#1 is significantly lower since the amount of electricity imported/exported to/to grid varies between two scenarios and then its economic valorisation too. In order to better analyse the operating costs of PS, each term expressed in Equation (11) is displayed in Figure 8 for Sc#1 and Sc#2 and for all PV powers, while operating costs of conventional system (OC CS ) are constant and they are equal to 1494 k€/year. The most of operating costs of proposed system (OC PS ) is constituted by operating costs due to the electricity imported from main power grid (OC PG_PS ) for all PV installed powers, but its contribution decreases with PV power increase. On contrary, the operating cost due to electricity exported to main power grid ( PG El OC exp _ ) and the operating and maintenance costs (OC O&M ) show an opposite trend rising with PV installed capacity. More in detail, OC PS in Sc#1 is higher than Sc#2 because two contemporary events occur: #1 the decrease of electricity imported from main power grid; #2 the decrease of electric energy exported to power grid.
While the first event contributes to a reduction of OC PS the second one should contribute to enhance the total operating cost according to Equation (11). This condition is not verified because the economic valorisation of electricity exported to power grid ( ) is substantially lower than that In order to better analyse the operating costs of PS, each term expressed in Equation (11) is displayed in Figure 8 for Sc#1 and Sc#2 and for all PV powers, while operating costs of conventional system (OC CS ) are constant and they are equal to 1494 k€/year. The most of operating costs of proposed system (OC PS ) is constituted by operating costs due to the electricity imported from main power grid (OC PG_PS ) for all PV installed powers, but its contribution decreases with PV power increase. On contrary, the operating cost due to electricity exported to main power grid (OC PG El_ exp ) and the operating and maintenance costs (OC O&M ) show an opposite trend rising with PV installed capacity. More in detail, OC PS in Sc#1 is higher than Sc#2 because two contemporary events occur: #1 the decrease of electricity imported from main power grid; #2 the decrease of electric energy exported to power grid.
While the first event contributes to a reduction of OC PS the second one should contribute to enhance the total operating cost according to Equation (11). This condition is not verified because the economic valorisation of electricity exported to power grid (c PG u.El_ exp ) is substantially lower than that one of electricity imported from grid (c u.El ). Thereby, considering 12,000 kW PV power installed (at which the greatest ∆OC occurs) OC PS are equal to 1242 k€/year and 1110 k€/year in Sc#1 and Sc#2, respectively. In this case the electricity exported to the power grid is 2643 MWh/y in Sc#1 and 2057 MWh/y in Sc#2 while the electricity taken from the PG amounts to 5389 MWh/y and 4507 MWh/y in Sc#1 and Sc#2, respectively. By using the investment cost and the operating costs of both proposed and conventional systems it has been possible to evaluate the simple payback period. This index returns the numbers of years needed to recover the investment cost. The calculation provides not favourable results thus, payback period in Sc#2 ranges from 16 to 42 years increasing with the installed PV capacity growth. These outcomes underline the unavoidable urgency to define specific economic incentives at national and European level to support initiatives of users' aggregation form an energy point of view such as energy community, smart cities, urban districts, energy municipalities. Sc#1 and Sc#2, respectively. By using the investment cost and the operating costs of both proposed and conventional systems it has been possible to evaluate the simple payback period. This index returns the numbers of years needed to recover the investment cost. The calculation provides not favourable results thus, payback period in Sc#2 ranges from 16 to 42 years increasing with the installed PV capacity growth. These outcomes underline the unavoidable urgency to define specific economic incentives at national and European level to support initiatives of users' aggregation form an energy point of view such as energy community, smart cities, urban districts, energy municipalities.

Sensitivity Analysis
The environmental analysis presented in the previous section is based on the average value of emission factor for electricity production in Italy (α ). This parameter has been evaluated as the mean value of hourly electricity emission factor in 2017 calculated by the authors on the basis of the Italian hourly electricity production in that year [27]. Indeed, the electricity production mix is variable hour by hour and as a consequence also the emission factor shows the same variability. The variation of emission factor is due to the different environmental impact of the energy sources employed in the electricity generation as well as to the high penetration of renewables (especially in some seasons and hours) with a strong intermittent behavior (such as PV and wind). Thereby, the Italian electricity emission factor ranges from a minimum ( Min α ) of 152 gCO2/kWEl to a maximum ( Max α ) of 556 gCO2/kWEl (Table 2). Furthermore, it has been evidenced in [32] that in those countries in which congestion and physical constraints for electricity transmission over power lines occur, often, it is necessary to activate electricity production units near the geographical areas in which the electricity demand takes place. This fact implies that the electricity demand in a zone is frequently met by power

Sensitivity Analysis
The environmental analysis presented in the previous section is based on the average value of emission factor for electricity production in Italy (α). This parameter has been evaluated as the mean value of hourly electricity emission factor in 2017 calculated by the authors on the basis of the Italian hourly electricity production in that year [27]. Indeed, the electricity production mix is variable hour by hour and as a consequence also the emission factor shows the same variability. The variation of emission factor is due to the different environmental impact of the energy sources employed in the electricity generation as well as to the high penetration of renewables (especially in some seasons and hours) with a strong intermittent behavior (such as PV and wind). Thereby, the Italian electricity emission factor ranges from a minimum (α Min ) of 152 gCO 2 /kW El to a maximum (α Max ) of 556 gCO 2 /kW El (Table 2). Furthermore, it has been evidenced in [32] that in those countries in which congestion and physical constraints for electricity transmission over power lines occur, often, it is necessary to activate electricity production units near the geographical areas in which the electricity demand takes place. This fact implies that the electricity demand in a zone is frequently met by power units situated in the same territorial area and, since each zone is characterized by an own electricity production mix, the emission factor for electricity shows a spatial variability too. So that, as it has already done for Italy, the environmental indicator on hourly basis referred to Italian electricity market zones (North, South, Centre-North, Centre-South, Sicily and Sardinia) have been evaluated on hourly basis in [36]. Thus, in Table 2 the minimum (α Sic Min ), maximum (α Sic Max ) and average (α Sic ) electricity emission factor for Sicily zone (where the analysed urban community is located) in 2017 are listed too. It can be noticed that all values referred to Sicily zone are higher than those evaluated for Italy since the electricity production mix of Sicily zone is characterized in a large percentage by energy sources with a high environmental impact (such as fossil oil or other liquid and solid fossil fuels).
On the basis of these considerations, a sensitivity environmental analysis has been carried out with reference to Sc#2, considering the minimum, maximum and average emissions factor referred to Italy and Sicily zone. The outcomes of this analysis are showed in Figure 9a for Italy and in Figure 9b for Sicily zone, as a function of PV installed power. CO   These results confirm that time and spatial variability of emission factor for electricity can strongly affect environmental analysis results. A similar sensitivity analysis could be carried out for the energy results too. Indeed, an hourly power grid efficiency can be defined both for Italy and all electricity market zones as already discussed by the authors in [27,36]. These results confirm that time and spatial variability of emission factor for electricity can strongly affect environmental analysis results. A similar sensitivity analysis could be carried out for the energy results too. Indeed, an hourly power grid efficiency can be defined both for Italy and all electricity market zones as already discussed by the authors in [27,36].

Conclusions
This paper compares the energy, environmental and economic performance of a proposed system based on distributed energy conversion systems and a conventional system. The proposed system is based on photovoltaic plants installed on the rooftops of about 370 buildings (located in the South of Italy) connected by a local electric microgrid. The electricity requests of each building constituting the urban community is satisfied by the electric energy produced by the photovoltaic system or by the near photovoltaic system connected to the grid. When there is a surplus of electricity it is exported to the power grid and, on contrary, when an electric deficit occurs each building is able to draw off electric energy from the grid. The conventional system represents the condition in which each building of urban community taken electricity from the main grid. The proposed system has been previous simulated by means of an agent-based model implemented in NetLogo software using as input, real data concerning building spatial position and electric load, structural dimensions and roof's characteristics for the PV installation (exposure, shading, orientation and typology of roof).
On the basis of the simulation results, an energy, environmental and economic comparison analysis has been performed between the proposed and conventional systems considering nine different installed photovoltaic capacities ranging from 2000 kW to 18,000 kW and two scenarios. In the first one, agents of proposed system are able to exchange electrical energy if their mutual spatial distance is lower than 50 m, while in the second one this distance is set to 200 m. The main findings can be summarised as follows: • the proposed system allows achieving energy, environmental and economic benefits with respect to a conventional one. In particular, the best outcomes are achieved considering the second scenario; • the fossil primary energy saving index is always positive moving from 12% to 99% in second scenario; • the environmental analysis results follow the energy analysis outcomes highlighting that the avoided carbon dioxide emissions increase with the installed photovoltaic power and the allowed spatial mutual distance for electricity exchange among agents of the local microgrid; • the avoided operating cost awards proposed system reaching its maximum value (383 k€/year) at 12,000 kW photovoltaic installed power in second scenario.
In order to improve the performance of proposed system reducing the electricity exported to the main power grid and maximising the on-site PV electricity consumption, future works will consider the possibility of installing an electric storage system or using mobile electric storage such as electric vehicles used within urban community. In this way, it will be possible to temporally uncouple the photovoltaic electricity availability (linked to the solar energy availability) and the electricity needs. The outcomes of this work could be particularly useful for decision makers that operate the energy planning with the scope to maximising the renewables exploitation to reach national and international energy and environmental targets to reach a sustainable development.
Further improvements of this study could involve "dynamic" energy and environmental analyses based on time-dependent and spatial-dependent energy and environmental indicators (power grid efficiency and emission factors) in order to compare the results to those one achieved in this work. Funding: This research has been funded by the European Union and the Italian Ministry of Education, University and Research, under the project "AIM-Attrazione e Mobilità Internazionale" in attuazione dell'Azione I.2 "Mobilità dei Ricercatori" dell'Asse I del PON R&I 2014-2020-Linea di intervento 1.

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