Simulation and optimisation study of the integration of distributed generation and electric vehicles in smart residential district

This paper presents an optimisation methodology for simulating the integration of distributed generation and electric vehicles (EVs) in a residential district. A model of a smart residential district is proposed. Different charging scenarios (CS) for private cars are considered for simulating different power demand distributions during the day. Four different case studies are investigated, namely the Base Case, in which no EVs are present in the district and three study cases with different CSs. A global optimisation method based on a genetic algorithm approach was applied on the model to find the total power from PV panels installed and co-generative micro gas turbines while minimising the annual energy cost in the district for the four different scenarios. In conclusion, the results showed that the use of EVs in the district introduces considerable savings with respect to the Base Case. Moreover, the impact of the chosen CS is nearly insignificant under a purely economic perspective even if it is relevant for grid management. Additionally, the optimum amounts of installed power vary in a limited range if the distance travelled by EVs, users’ departure and arrival time change broadly.


Introduction
An energy system is defined as the totality of energy sources, energy conversion plants and storage devices together with users and infrastructures, which guarantee energy transmission and distribution [1].
Energy sources can be either renewable, with rates of regeneration which counterbalance their consumption, or non-renewable, with regeneration occurring in a time scale that is not comparable with that of human activities. Nonrenewable energy sources include fossil fuels such as oil and coal, and nuclear resources; renewable energy derives from sunlight, wind, rain, tide, geothermal heat and biomass.
In pre-industrial society, and until the second half of the nineteenth century, energy needs were extremely low. Wood and traditional biomass were principally employed as fuels, while wind and hydropower were exploited to drive simple machines. With the Industrial Revolution, these sources have progressively been substituted with coal, which became the dominant energy source by the beginning of the twentieth century. Since the twentieth century, the importance of oil has steadily increased, becoming the leading contributor to the world's energy source by the 1970s. From the 1950s and especially in the last decades of the previous century, the use of natural gas, hydraulic and nuclear energy has increasingly become more popular [1].
Although not comparable to non-renewable energy, the exploitation of renewable energy sources (RES) became significant at the start of the twenty-first century. The disparate use of energy in the world's macro regions is remarkable. Asia uses a huge amount of coal; China is the largest producer and consumer of coal in the world. In Africa and North America, natural gas and oil have a primary role; coal and hydropower are also present in the energy mix, together with nuclear and renewables in a small portion (mainly in North America). The Middle East relies almost completely on oil and natural gas, being a region with substantial reserves. Europe and Eurasia prove to be the regions where renewable energy is most widely exploited, although its proportion in the energy mix is still not comparable to that of fossil fuels. Finally, South and Central America indicate a considerable consumption of hydroelectricity. According to EUROPE 2017 [2], "the 2020 package is a set of binding legislations to ensure that EU meets its climate and energy targets for the year 2020. The three key targets are: "20% cut in greenhouse gas emissions (from 1990 levels); 20% of EU energy from RES; 20% improvement in energy efficiency". These targets had previously been set by EU leaders in 2007 and later enacted as legislation in 2009.
An overview about energy system has been provided: the reasons behind its non-sustainability have been pointed out together with the actions planned and taken by governments to face the consequences of such a development model and to propose a transition to a new one.
A transition to sustainable energy use can be achieved in many ways and through varied methods. This study concentrates on what can be done in cities, in particular using a residential district in Milan an Italian city, as case study. The city can be considered as a "social-economic innovating ecosystem" which is, according to Michele Vianello, "a place where different people interact creating products, innovative activities, influencing each other towards virtuous initiatives. All these behaviours and actions influence the urban environment modifying its aspect with respect to the past" [3]. The urban environment has its own peculiarities: it is densely populated and it is a space where different human activities take place, it has its specific needs of energy, transports and services. These are the three main sectors to which it is worth paying attention to make a district become "Smart". As the study object is a part of Europe, it may be constituted by buildings, which have an historical, artistic and architectonic value, introducing constraints on interventions that could be done to make them smarter.
The need of a transition to a more sustainable energy system leads to a deep change in the energy, building and transports sector. Power installation from RES is becoming more and more relevant, new mobility schemes, namely car sharing, are growing more popular and particular attention is paid to energy efficiency in buildings. Moreover, each of these aspects is related to another important concept that is energy storage. The greatest change in the energy sector has occurred due to the development of distributed (or diffused) generation (DG). According to Ref. [1], DG consists of the totality of power plants having a nominal power lower than 10 MW and connected to the distribution network. DG plants exploit primary energy sources-in the majority of cases renewable-which are distributed on the territory [so the name distributed generation (DG)] and that could not otherwise be exploited in a traditional centralised plant; they supply local loads and they can be operated in a cogenerative mode. In an urban district, examples of DG are solar PV panels and/or solar thermal collectors mounted on top of buildings.
One of the drawbacks of DG is the high specific investment cost mainly due to the fact that, being medium or small plants, scale economy cannot be applied. Nevertheless, this can be faced as a result of a suitable incentive strategy: Refs. [2] and [3] are two examples in the Italian case. The real problem is the difficulty in predicting and controlling the power produced and put on the distribution network.
So the DG, together with other distributed energy resources such as electric vehicles (EVs) and energy storage, is the main driver for the shift to a new paradigm in the management of the grid: the passage to a smart grid.
In Ref. [4], a smart grid is defined as a modern electric power grid infrastructure that guarantees the reliability of the system and the security of supply, allowing to face problems related to the distributed power generation from RES and to control the load, promoting energy efficiency and involving the passive final users. To do so, integration of the electrical grid with Information and communications technology (ICT) is needed. Therefore, the aim of this paper is to analyse all the sides of this concept: the changes introduced in the characteristics of the electrical network, the involvement of the final user also through a smart metering system and the role of energy storage.
Several researchers have dealt with the integration of DG from RES and optimal operation of an energy management system for a grid-connected in smart buildings [4][5][6], EVs interacting with renewable energy in smart grid [7][8][9][10][11][12][13][14], simulation of future smart cities [15][16][17][18]. In recent times, a transition to a more sustainable energy and transport system has become necessary [19]. This paper addresses the subject at a district level by considering a residential neighbourhood of a big metropolitan area as case study, and ultimately proposing a model for a smart residential district that is efficiently run and optimises energy use [20,21]. Generally, when studying a district, three main factors have to be taken into account. These are: energy production, mobility and energy efficiency in buildings. However, this paper is concerned only with the optimal integration. For its energy requirements and energy generation, a smart district should include RES and combined heat and power (CHP) systems, leading to the presence of DG in the city block. These small plants inject amounts of power, which are difficult to predict and control on the low voltage network. Thus, a shift to an active grid model, i.e., a smart grid, is necessary. In this perspective, self-consumption assumes a fundamental role as it allows absorbing what has been produced locally, limiting possible congestions on the grid. Concerning transport sector, sustainable mobility is desirable. This can be done from a social point of view, for instance passing from a possess to a sharing logic, and from a technological point of view, due to low emissions fuels, hybrid and EVs. Among the technological solutions, EVs are regarded as the most promising alternative since they can interact in a synergetic way with the electrical network in a self-consumption perspective. In effect, the electrification of the demand allows a better management of intermittent power fluxes related to DG. Nevertheless to the knowledge of the authors, they did not find any published works on the simulation and optimisation of the integration of DG and EVs in smart residential district in Italy. To the best knowledge of the authors, the present investigation is original in proposing a model of a smart residential district accounting for the interaction and integration of DG and EVs with different realistic charging scenarios (CS) for an Italian residential district using an optimisation approach is the main innovation of this work.
The paper is organised as follows: In "Smart district model", the smart district model development is presented and described in detail. "Optimisation procedure" focuses on the optimisation methodology based on genetic algorithm approach. The simulation cases and results are provided in "Numerical simulations and results". Discussion of results is presented in "Discussion". The sensitivity analysis of the smart residential district is unveiled in "Sensitivity analysis". Finally, the conclusions are drawn in "Conclusions".

Smart district model
The fore mentioned transition can be carried out in many ways and under several perspectives [22][23][24]. This paper concentrates on what can be done in cities, in particular considering a residential district of a big Italian city [25]. The urban environment has its own peculiarities: it is densely populated and it is a space where different human activities take place, it has its specific needs of energy, transports and services [26,27]. These are the three main sectors to which it is worth paying attention to make a district become "Smart" [28,29]. As the study object is an area of a European, in particular Italian, city, it may be constituted by buildings which have an historical, artistic and architectonic value, introducing constraints on interventions that could be done to make them smarter. The district is schematised as a system composed of: • 2000 inhabitants living in 700 apartments, considering 3 people per family on average (energy demand). • 500 private EVs (energy demand). • 50 shared EVs (energy demand). • Photovoltaic (PV) panels mounted on buildings' roofs (energy production). • Co-generative micro-turbines (with CHP) (energy production).
For each of these components, a curve describing the power released or required during the day is created. If there is a surplus in electricity generation with respect to the quarter needs, the exceeding quantity is sold to the grid; on the other hand, if the demand is larger than the production, the lacking energy amount is taken from the network.
The objective is to determine the amount of installed power from PV panels and co-generative micro-turbines that can minimize the annual energy cost in the district. In effect, on the one hand a large quantity of PV and CHP determines savings based on a high self-consumption rate, leading to a lower amount of energy bought from the grid [30,31]. On the other, this entails investment and operating costs [32,33]. Consequently, to solve this trade-off, an objective function is written as the minimisation of the sum of the costs related to power production in the district and to energy purchase from the grid [34].

Private electric vehicles
In this model, private EVs are charged at home thanks to a suitable wall box allowing a maximum power of 6 kW. The following specifications, typical of an average EV, are considered: • Battery capacity ( C b ): 60 kWh. • Battery consumption ( C e ): 0.16 kWh/km. • Charging and discharging efficiency (η): 80%.
Moreover, to determine the daily power requested by private EVs, it is necessary to know the arrival and departure times, the number of trips per day and the travelled distance. These are all stochastic variables, which are modelled in a different way depending on whether the user is a commuter, or not.
In case of EVs driven by commuters, one trip per day is used as the baseline. Departure and arrival times follow a Gaussian distribution showing expected values, respectively, of 8 a.m. and 6.30 p.m. and a standard deviation of an hour in both cases. As for the travelled distance, it is modelled according to a Weibull distribution with a scale parameter of 40 and a shape factor of 0.95. Three diverse CS are analysed.

Charging Scenario 1-CS 1
Vehicles are completely charged at maximum power as soon as they arrive home, concentrating the requested power between 6 p.m. and 9.30 p.m., as Fig. 1 clearly shows. The steps made to define the obtained charging curve are the following: • Calculation of the energy needed, expressed in kWh: where d is the travelled distance (km), C e is the battery consumption (kWh/km) and is the charging efficiency. • Evaluation of the necessary time interval, expressed in hours: where P max (kW) is the maximum power available, 6 kW in this case. • Computation of the power needed during the day assuming that the vehicle is charged at P max starting at the arrival time and for the time interval defined at point 2.
This CS is not favourable for the electrical network because the time interval in which the charging process mainly takes place coincides with the one of residential peak demand, so the load on the grid is increased dramatically. On the other hand, CS 1 is advantageous for the user because it allows charging the car in the shortest time possible, guaranteeing a sufficient state of charge (SOC) for driving the vehicle later in the evening, if needed.

Charging Scenario 2-CS 2
In this case, the charging process is distributed on the whole available time interval; therefore, most of it takes place during the night. The steps defining the charging curve are: • Calculation of the energy needed (as before). • Evaluation of the available time interval, expressed in hours: where t ar and t dep are, respectively, the arrival time of the vehicle at home and the departure time for the following trip. • Computation of the charging power: This amount of power is needed by each vehicle from the arrival to the departure time. The resulting power curve ( Fig. 2) is similar to the one obtainable following a valley filling approach. For this reason, peak load is not particularly affected by the power needed for the EVs, hence CS 2 is particularly beneficial for the electrical network. However, to implement this CS, a precise knowledge of arrival and departure time is necessary but unfortunately it is not often possible. Moreover, if the target is to fully charge the vehicle, the process should not be interrupted between arrival and departure time: this means that the car cannot be driven in the evening, which can be limiting for the users. Nevertheless, if it is not required to reach SOC equal to one for the following day trip, the car can be used in the evening if it has achieved a sufficient charging level.

Charging Scenario 3: CS 3
According to this scenario, each vehicle is recharged at maximum power but, differently from CS 1, the charging process does not begin as soon as the car arrives home but it starts when the energy demand has decreased, as Fig. 3 illustrates.
In this case, the steps followed to define the charging curve are the same as those presented in CS 1 but the process The EVs load is shifted away from peak moments so the pressure on the grid is reduced with respect to CS 1. Another advantage of CS 3 is that, as vehicles are charged at maximum power, it is not necessary to know precisely the arrival and departure time since it does not take the whole period in which the car is parked at home to reach complete charging. On the other hand, if charging starts in the late evening, it may happen that the vehicle SOC is not sufficient to use the car to go out before that time. For this is a strongly negative point for the user, to make this strategy more popular and socially accepted, an incentive system could be implemented to encourage people to choose it.
The risk of a large-scale implementation of this scenario is that of a demand restrike, i.e., the creation of a second demand peak when the EVs charging process starts. For the moment, this fact does not constitute a real threat because the EVs diffusion is still too low.

Characteristics of the charging scenarios
In the first scenario, charging Scenario 1, CS 1, EVs are charged at maximum power as soon as they arrive at home. Even if this solution is convenient for the user, it is not beneficial for the distribution network because EVs demand a high volume of power during peak times, thereby increasing the stress on the grid.
In CS 2 the charging process is distributed overall available time interval, therefore, most of it takes place during the night. The resulting power curve is similar to the one obtainable following a valley filling approach. In CS 3, each vehicle is recharged at maximum power but, as opposed to CS 1, the charging process starts when the energy demand has decreased. Consequently, CS 2 and CS 3 are more favourable from a grid management perspective.
For non-commuters, more than one trip per day is used as the baseline: the number of daily travels is modelled as a stochastic variable showing a Gaussian distribution with an expected value of 2.68 and a standard deviation of 0.6. The definition of arrival and departure time is slightly more complicated than in the commuter case because, in this case, users exhibit extremely diverse habits. So, the departure time is conceived as a uniform distribution between 8 a.m. and 10 p.m. with the addition of two peaks related to two normal distributions with expected values corresponding to 8 a.m. and 4 p.m. and standard deviations, respectively, of 0.25 and 0.5. These two peaks coincide with the start time t and the finishing time at schools or offices. The arrival time is modelled in a similar way through a uniform distribution from 9 a.m. to 12 p.m. plus a peak due to a Gaussian distribution with expected value of 5.30 p.m. and a standard deviation of 0.75. This peak is again related to the finishing time at school or in other activities. The distance travelled is described with a Weibull distribution with a scale coefficient of 9 and a shape coefficient of 1.1.
In the modelled district, a mix of 50% non-commuters and 50% commuters charging their vehicles according to CS 1 is employed.

Shared electric vehicles
Shared EVs are charged according to a fast process at the charging station located in the residential district under study with a maximum power of 50 kW. Each car presents these specifications, which are typical of an average shared EV: • Battery capacity ( C b ): 24 kWh. • Battery consumption ( C e ): 0.14 kWh/km. • Charging and discharging efficiency (η): 80%.
To build the shared EVs demand curve, information about the amount of power required at the district charging station and the time intervals in which each car is parked is required. In this case, the problem is more complex than the case of private EVs because the charging required is not only related to the habits of the users: a person can set out with a vehicle, which is not necessarily the same as the one with which he/ she later returns. Therefore, as the utilisation profile of each shared vehicle cannot be established, the SOC is taken into account. First, the SOC of the vehicle leaving a generic station located anywhere in the city is modelled as a stochastic variable belonging to a uniform distribution between 0.4 and 1. Then, taking into account the travelled distance to reach the district, which follows the same Weibull distribution of private non-commuter case, the SOC of the car arriving in the studied station (SOC ar ) can be determined. Finally, the SOC of the vehicle leaving the block is again a stochastic variable from a uniform distribution between SOC ar and 1 if SOC ar is higher than 0.4, otherwise the lower bound is 0.4 instead of SOC ar . The number of times a generic shared vehicle arrives at the analysed charging station during the day is considered as a random value belonging to a uniform distribution between 1 and 5, while the arrival time can be defined in the same way for private non-commuter vehicles.
The charging daily curves found for both private and shared EVs are the same during the year, except for the summer months of July and August when the number of circulating cars is assumed to be reduced.

Residential load, PV panels and co-generative micro-turbines
Residential load profiles vary depending on the season, while daily PV power production curves consist of a monthly average and vary depending on the month. An installed power of 600 kW from PV is considered as a first hypothesis for the optimisation procedure. Considering the CHP plant, it is initially dimensioned based on the thermal energy needs of the district: 9 micro-turbines with a nominal power of 65 kW provide a total electrical power of 585 kW. Capstone microturbines C65 are taken as a reference. Micro-turbines are switched on from October to March; they work in nominal conditions for 18 h a day and at partial load (25% of nominal power) for the balance of 6 h during the night.

Optimisation procedure
The optimisation procedure is carried out based on a genetic algorithm. It is a non-deterministic method, so it enables a wider exploration of the solutions space with respect to other optimisation techniques, avoiding possible convergence on local optima. Moreover, it is relatively simple and it permits the derivation of a solution that is sufficiently close to the global optimum of the problem. For this study's purpose, there is no point in using a more sophisticated technique, which might require an extremely detailed representation of the problem, and more elaborate computations to provide results that are more precise. Being non-deterministic, this algorithm provides slightly different results each time it is run. Figure 4 puts together the main outcomes of the district model presented in "Smart district model". It shows the trends of the average daily electrical power requested and produced in the analysed quarter during the month of January. As it has been explained in the previous chapter, the demand includes households, private and shared EVs while the power generation is related to PV panels and micro-turbines operating in a co-generative mode.
This private EVs demand curve is obtained assuming that half of the neighbourhood inhabitants are non-commuters and that the remaining half is constituted by commuters charging the vehicle according to CS 1. Regarding the electrical power production curves, the PV one refers to a nominal installed power of 600 kW while the CHP one is related to the installation of nine C65 micro-turbines providing a nominal power of 585 kW which corresponds to the electrical power allowing to satisfy the district thermal load through cogeneration.
Based on these assumptions, the curves are derived from each month taking into account that: • PV power production profile varies monthly, (it is a monthly average of daily curves). • CHP electrical power generation curve is present only from October to March and it keeps the same during this period. • Residential demand changes according to the season. • Private and shared EVs demand is the same for every month except for July and August when, due to vacations, the number of circulating vehicles is halved and a few adjustments are made about departure and arrival times of users.
These conditions provide the starting point for the optimisation problem, which aims at evaluating the amount of power installed from PV panels and micro-turbines that minimises the annual energy cost in the block. Basically, a large quantity of power installed in the district leads to important savings on the energy bought from the distributor (high self-consumption level), but on the other hand, it determines considerable investment and operating costs. Therefore, to find a satisfying compromise, an optimisation procedure based on a genetic algorithm is carried out. The The first step of this algorithm is the creation of an initial population of potential solutions: it is composed of individuals, or chromosomes, containing values that the optimization variables (genes) can assume. In the studied case, the optimization variables are two, PV and CHP installed power ( P PV and P CHP ), so each individual contains two genes.
Secondly, individuals are evaluated based on a fitness function or objective function, which in this case corresponds to the minimization of the annual energy costs in the district. Applying the principle of "the survival of the fittest", the best performing individuals are selected for mating and creation of a new generation.
To avoid a premature convergence on local optima, two operators borrowed from genetics are applied according to a given probability: crossover and mutation. Once a new generation is obtained, its components are again evaluated, mated and recombined following the procedure described earlier.
There are several possible stopping criteria such as a maximum number of generations, a time limit or a given tolerance on the fitness value. As previously stated, the fitness function of the problem studied corresponds to the minimisation of the annual energy costs in the district. It is expressed as Eq. (5): where the first and the second term represent the fixed costs related, respectively, to PV panels and co-generative microturbines. C m_ave can be written as Eq. (6): It takes into account, respectively: the costs related to the activity of the CHP plant, the cost of natural gas bought from the distributor in case the installed CHP power is not sufficient to meet the thermal needs of the district, the cost/ revenues related to the amount of electricity bought/sold from/to the grid during the day.

Numerical simulations and results
Simulations to find the optimum values of installed power are performed for four cases: the Base Case, in which residential load, PV panels and CHP plant are included in the district; and Scenario 1, Scenario 2 and Scenario 3, in which EVs are also present. They are charged according to the three CS presented earlier. For each case, the Genetic Algorithm is run 30 times using the same input data, and the most frequent result is selected.
The optimisation procedure to determine the values of installed power from PV panels and CHP plant minimising the annual energy costs in the district is explained as follows. The starting point proposed is a condition in which commuter people charge the EVs according to CS 1, i.e., uncontrolled charging. Here, besides performing the simulation of that case, three other situations are studied: the Base Case, corresponding to the absence of EVs in the neighbourhood, and the cases in which commuters charge their cars as in CS 2 and CS 3. By doing so, it is possible to investigate the impact of EVs and of their charging strategy on the district energy demand and expenditure.
Then, focusing on a specific case, a sensitivity analysis is performed to understand which is the variation range of results consequent to a change in EVs input parameters.

Base Case
In this case, the model of the district is the same as the one presented in Sect. 2 except for the EVs, which are not present here. As explained in the paper, the genetic algorithm is non-deterministic algorithm that, even for the same input, can exhibit different behaviours on different runs, as opposed to a deterministic algorithm. For this reason, slightly different results can be obtained running the solver many times with the same inputs. Therefore, the simulation is performed 30 times (keeping equal input arguments) and the optimum values attained by the fitness function at each retrial are reported in a histogram (Fig. 5).
The most frequent value is taken as the actual result, i.e., the annual energy cost in the district which, in this case, corresponds to 528,242 €/year. Considering a number of 2000 inhabitants in the quarter, this amount is equivalent to a 22.01 €/month per person. Then, the optimum PV and CHP power installed have to be evaluated choosing again the  Fig. 6a, b show that, for the Base Case, they are 433 kW and 414 kW, respectively, for PV and micro-turbines. Notice that CHP installed power should comply with the size of the machines available on the market. Therefore, in this case, six C65 turbines and a C30 are installed, providing a total power of 420 kW.
Mildly different values of installed power can lead to the same total cost because they determine diverse investment and operating costs as well as different amounts of energy produced and these effects counterbalance one another. For example, the lower the amount of power placed, the lower the investment and operating costs, but also the lower the revenues as less energy can be self-consumed or sold to the grid; on the other hand, the higher the amount of power, the larger the costs but the higher the possibility to earn or save more money, respectively, selling energy to the distributor or reducing energy purchase from the network. Based on the simulation results, it will be interesting to have an estimate of the actual daily power demand and production curves of the district. These are derived as monthly average values. Figure 7 summarises satisfactorily the electrical power generated and requested for the months of January, May, August, and November, based on the different conditions occurring during the year. These later are the effects of diverse seasons, sun irradiance level, state of the CHP plant (which is not working from April to September), and the number of circulating EVs (reduced in July and August). Even if the Base Case is not affected by the last aspect concerning the vehicles, this will be relevant for the following ones.

Scenario 1
In particular, in this case, private EVs driven by commuter people are charged according to CS 1 (Scenario 1), that consists of full power charging as soon as the user arrives home.
Cars used by commuters are supposed to account for 50% of total private vehicles present in the district; the remaining 50% is employed by non-commuter people. This assumption keeps the same for all the cases analysed. The simulation is run 30 times and the obtained values of minimum annual energy cost are reported in Fig. 8 according to which the total cost can be set to 781,350 €/year. This amount corresponds to 32.56 €/month per person, still assuming the presence of 2000 inhabitants in the district.
Then, the optimum power installed from PV and CHP is again derived picking the most frequent values among the ones corresponding to the selected total cost. Finally, basing on these results, it is possible to plot the daily power generation and demand curves (Fig. 9).

Scenario 2
In this case, EVs driven by commuters are charged according to CS 2 (Scenario 2), which consists of a strategy analogous to peak shaving: the charging process is distributed overall available time interval, generally taking place during the night.
Results are derived repeating the procedure formerly exposed. Figure 10 illustrates the minimum annual energy cost attained that is 773,230 €/year, corresponding to 32.22 €/month per person.
Then, the electrical power curves for the district are reported, referring once more to the months of January, May, August and November as shown in Fig. 11.

Scenario 3
In case 3, cars belonging to commuters are charged following CS 3 (Scenario 3): the charging process does not start as soon as the user arrives home, but it is delayed to 11 p.m., when the residential load has decreased with respect to demand peak. Results are obtained following the same method as in the other presented cases. The best fitness value attained, shown in Fig. 12 corresponds to an annual energy cost for the district of 824,350 €/year, which is equivalent to 34.35 €/ month per person. Then, the optimum values of installed power are obtained and pointed out, respectively, to 604 kW for PV and 579 kW for CHP. Anyway, to get 579 kW, nine C65 micro-turbines have to be installed leading again to an actual nominal power of 585 kW.
Finally, the daily power curves for the district are evaluated according to the achieved results. Here are again reported only those referring to different months as shown in Fig. 13.

Discussion of results
The results obtained for the analysed cases are summarised in Table 1, which also includes the costs of the As is condition in which no EVs, PV panels and co-generative microturbines are present in the district.
First, it is interesting to compare the Base Case to the As is case; it turns out that it is convenient to install the indicated amount of power from PV panels and co-generative  micro-turbines. In this way the district does not rely completely on the distributor as for the thermal energy and electricity is bought from the grid only in some time intervals when the CHP plant works at partial load or when it is turned off and PV power is not enough to meet the demand.
Secondly, a comparison between the Base Case and the ones involving the EVs is carried out. From Table 1, it can be seen that the presence of the EVs, whatever is the CS adopted, introduces a cost increase relative to the Base Case. This is not a correct evaluation since it is made between conditions offering different services: unlike the Base Case, Scenario 1, 2 and 3 include the use of cars. Therefore, to make a fair assessment, the cost related to the use of traditionally fuelled vehicles has to be added in the Base Case.
It is evident that the cases involving the EVs are more convenient than the base one: the savings introduced range from a minimum of 158.9 €/year/person in Scenario 3 to a maximum of 184.46 €/year/person in Scenario 2. Moreover, it is easily feasible to reach these advantageous conditions starting from the base scenario: it is sufficient to increase the installed PV power of less than 50% and to place three more C65 micro-turbines, removing the C30 one. Based on the above considerations, Scenario 1, Scenario 2 and Scenario 3 are analysed and compared. The best power quantities installed in the district are the same for these three scenarios: PV power is 604 kW while CHP value is 585 kW. It is noteworthy to remark that the optimum power deriving from co-generative micro-turbines coincides with the maximum allowable or gets really close to it as in Scenario 3. This is justified by two motivations. The first is that, in this way, the district does not rely on thermal energy supplied by the distributor; the second is that micro-turbines produce a stable and reliable amount of energy throughout the day that satisfies the residential load and a good portion of EVs non-peak demand.
As for monthly specific energy cost, it does not vary much depending on the charging strategy adopted. The similarity of results is related to the fact that in all the three scenarios the power installed is the same and, even if the EVs demand is distributed in a different way according to the CS, in every case a considerable quantity of electricity for the charging process is still purchased from the grid. The reasons for this differ according to the scenario considered, are as follows: • In Scenario 1, private EVs evening peak demand almost coincides with residential peak load; thus, the demand significantly exceeds the generation.
• In Scenario 2, private EVs charging occur mainly during night-time and, the power requested by cars goes beyond the portion produced by micro-turbines when they work at partial load. • In Scenario 3, strong EVs peak demand concentrates in the late evening and in the night, widely surpassing partial load CHP plant electricity production. As in  Scenario 2, there is a decoupling between EVs peak demand and large local energy generation.
These differences justify the slight variation among the obtained costs. For instance, in Scenario 3 the specific cost is higher because, more than in any other situation, EVs peak demand is significantly concentrated in moments when local energy resources are scarcely available.
In conclusion, the charging strategy adopted has a small influence on the annual costs, but it is particularly relevant from the point of view of the management of the electrical grid. In this perspective, Scenario 2 and Scenario 3 are preferable to Scenario 1.

Sensitivity analysis
A sensitivity analysis is conducted with respect to the variation of input data concerning EVs, namely departure and arrival times and travelled distance. The aim is to study the influence of these changes on the total annual cost and on the optimum amount of power installed in the district. Fifteen (15) different EVs utilisation profiles are considered and the analysis is conducted only on Scenario 1.
This investigation is performed only for Scenario 1: 15 different input conditions are considered and for each of them the genetic algorithm is run 30 times to establish the most frequent results. Table 2 shows the outcomes of this procedure.
First of all, the mentioned distance refers to the kilometres travelled per day by all the vehicles present in the district, i.e., 550 cars. As for the annual cost, it changes according to different EVs input conditions. It strongly depends on the distance: the larger the number of travelled kilometres, the larger the battery consumption, the higher the amount of needed charging electricity. However, also arrival and departure time play a significant role in defining the total cost because they determine the periods available for charging. For example, if the charging process occurs simultaneously to energy production by local resources (PV panels and CHP), self-consumption rate increases leading to savings.
Concerning the installed power, CHP quantity keeps constant and PV varies in a limited range. The boxplot in Fig. 14 summarises the characteristics of PV power distribution reported in Table 2. This confined variability of PV amount shows an advantage: if the exact optimum power cannot be placed owing to space or architectural constraints, a slightly different value does not lead to huge cost augmentations. Finally, the fact that the optimum amounts of power do not vary significantly with respect to a change in EVs input conditions has a remarkable positive consequence: solutions found are resilient with respect to variations of users' choices and daily habits, which are actually common in real-life situations.

Conclusions
This paper presented an optimisation methodology for simulating the integration of distributed energy generation and EVs in a residential district. A model of a smart residential district is proposed which include households, private and shared EVs, photovoltaic (PV) panels and natural gas fuelled co-generative micro-turbines. Three potential CS for private cars were considered for simulating different power demand distributions during the day. A global optimisation method based on a genetic algorithm approach was applied on the model to find the total power from PV panels installed and co-generative micro-turbines, while minimising the annual energy cost in the district for four different scenarios namely the base scenario, in which no EVs are present in the district, and for the cases corresponding to three different CSs.
To investigate the possibility of a beneficial interaction between EVs, distributed generators (DGs), residential load and the grid in a self-consumption perspective, the amounts of power from PVs and micro-turbines minimising the district annual energy cost are determined.
Five cases are taken into account to evaluate the impact of EVs and of their charging strategy on the district energy demand and expenditure. These are: the Base Case, in which EVs are not included, Scenario-Scenario 3, corresponding to the three different CS, and the As is case, in which only the residential load is present.
First of all, the As is case is weighted up against the Base Case. It comes out that the Base Case is significantly advantageous if an optimum power of 433 kW from PV and 420 kW from CHP is placed in the analysed quarter. This amount of CHP power can be obtained with six C65 and a C30 micro-turbines.
The first important outcome of this investigation is that the cases involving the EVs are more convenient than the Base Case for the same services offered. Moreover, it is very feasible to achieve the conditions in Scenarios 1, 2 and 3. Essentially, it is sufficient to increase the installed PV power of less than 50%, to install three more C65 micro-turbines, and to remove the C30.
Secondly, comparing Scenario 1, Scenario 2 and Scenario 3, it is interesting to note that monthly specific energy cost does not vary much depending on the charging strategy adopted. The similarity of results is related to the fact that in all the three cases, the power installed is the same and, even if the EVs demand is distributed in a different manner, according to the CS, in every case a considerable quantity of electricity for the charging process is still purchased from the grid. However, the choice of the CS has a relevant impact from the grid management point of view; Scenario 2 and Scenario 3 are preferable to Scenario 1.
Finally, a sensitivity analysis is performed with respect to the variation of input arguments concerning the EVs. The annual cost varies mainly according to a change in the travelled distance even if it is influenced also by departure and arrival time because they determine a different distribution of charging periods during the day. As for the installed power, the quantity from co-generative micro-turbines keeps constant while PV amount varies in a limited range of 20 kW. The stability of the found solutions is extremely positive because it means that they are resilient to changes in user's habits and choices, which are common in real-life situations.
This contribution has highlighted a global optimum condition for the district. This may be regarded as an interesting starting point for an Energy Service Company (ESCo) to enlarge its horizon to the whole district instead of the single building. Moreover, the results obtained encourage the integration of EVs in a potential ESCo project, considering that locally produced energy could give a considerable support to the mobility service.
Open Access This article is distributed under the terms of the Creative Commons Attribution 4.0 International License (http://creat iveco mmons .org/licen ses/by/4.0/), which permits unrestricted use, distribution, and reproduction in any medium, provided you give appropriate credit to the original author(s) and the source, provide a link to the Creative Commons license, and indicate if changes were made.