Optimal Charging Scheduling of Electric Vehicles in Smart Grids by Heuristic Algorithms

Transportation electrification has become an important issue in recent decades and the large scale deployment of electric vehicles (EVs) has yet to be achieved. The smart coordination of EV demand addresses an improvement in the flexibility of power systems and reduces the costs of power system investment. The uncertainty in EV drivers’ behaviour is one of the main problems to solve to obtain an optimal integration of EVs into power systems. In this paper, an optimisation algorithm to coordinate the charging of EVs has been developed and implemented using a Genetic Algorithm (GA), where thermal line limits, the load on transformers, voltage limits and parking availability patterns are taken into account to establish an optimal load pattern for EV charging-based reliability. This methodology has been applied to an existing residential low-voltage system. The results indicate that a smart charging schedule for EVs leads to a flattening of the load profile, peak load shaving and the prevention of the aging of power system elements.


Introduction
Transportation electrification has become an important issue in recent decades mainly because of the potential for reducing energy consumption [1]. It should be noted that in Spain 41% of total energy OPEN ACCESS produced is consumed by the transportation sector [2]. Several targets related to greenhouse emission footprints, oil dependence and costs and integration of renewable energy must be reached by incorporating EVs [3]. Moreover, improvements in battery technology and significant reductions in EV costs have led to an increase in the number of EVs incorporated into systems [4,5].
EVs are treated as a new moving load (grid-to-vehicle, or G2V) with storage availabilities (vehicle-to-grid, or V2G) in power distribution networks [6]. These moving demands have significant influence on power networks even if large scale EV demand is not accommodated in a suitable way [7,8]. An EV can be considered a flexible load that can be charged throughout the day instead of following a rigid charging schedule [9,10]. The flexibility of the EV demand will improve the operation of power systems in terms of flattening the load curve on main substation transformers, providing, in addition, peak shaving services, reduced power system losses, reduced aging of transformers and lines, and increased renewable energy penetration [11] as well as providing financial support [9][10][11][12][13][14][15][16][17][18]. In an uncontrolled, or "dumb", scenario, EVs should be charged when the owner arrives at his home [16,19]; however, potential problems such as sudden peak demand or sudden overloading could be shaped or flattened by using a smart charging schedule for the EV's batteries [20]. Moreover, the optimal scheduling of EV battery charging could allow high EV penetration without requiring any upgrades to the existing electricity infrastructure [21] (cables and transformers), thereby reducing investment expenses. Optimal scheduling also offers the possibility of managing EVs as V2G [19,[22][23][24], providing ancillary services to network operators [25]. The optimisation of EV charging is a demand-response strategy that must be incorporated into Demand-Side Management (DSM) and implemented by a EV aggregator to improve the flexibility of the distribution network [9].
A number of studies were performed on the impact of EV integration into power systems [26][27][28][29]. A study shown in article [27] attempted to maximise the amount of energy that can be delivered to all the EVs in a fixed period of time taking into account network technical limits and using a linear programming methodology. However, the behaviour of electric vehicle users is not considered in the formulation of the problem. In reference [28], a direct load control management technique is developed to maximise the net energy supplied to the batteries and simultaneously minimise the total energy cost by incorporating charging patterns of a plug-in electric car; however, the technical network limits are not included in the problem formulation. In [29], the authors use the coordination of EV charging by considering EVs as distributed energy resources to smooth the load profile. Although they include a mobility pattern in their study, it should be noted that the mobility profile is not a realistic one and simply leads to theoretical results. Another research study [14] developed a smart load management framework for plug-in electric vehicles (PEVs) based on peak demand shaving, obtaining, concurrently, an improvement in the voltage profile and minimising power losses. The study was performed by taking into account the PEV owner's preferred fixed charging periods. The authors of reference [12] coordinated the charging of EVs to maximise the use of renewable energy in the transportation sector. Furthermore, they consider stochastic driving patterns and employ simple linear programming.
In [16], a GA drives the charging process to minimise the impact on peak load avoidance, parking availability and the charging control. Shaaban and Saadany [30] implemented the optimal charging of EVs using GAs and incorporated only light-duty fleet users' behaviours without considering peak load shaving in their formulation. In this paper, a different EV charging optimisation will be used to fill existing gaps such as the necessity to consider realistic driving patterns as well as the various charging characteristics and different vehicle penetration levels into low-voltage networks. The objective of this study is to utilise the EV demand to smooth the load profile and to reduce and prevent the aging of transformer substations and distribution lines. The main contributions of the paper are as follows: • The application of a novel optimisation method based on GAs for the demand side management of EVs in low-voltage distribution networks from a Spanish electricity distribution company (Unión Fenosa Distribución, Madrid, Spain).
• A model of a 24-hour electric vehicle charge pattern obtained from a Spanish survey of vehicle drivers' behaviour.
First, different EV penetration scenarios into low-voltage residential networks have been considered to address the impact of EVs on distribution networks. Second, electric vehicle user behaviour constraints that are based on real-world driving mobility in Spain are considered in the optimisation algorithm. Third, the potential to charge EVs during non-consecutive hours, throughout the period permitted for charging the EVs, by means of interrupted charging are included in the optimisation process to develop a more comprehensive approach. Finally, a GA, implemented in MATLAB ® (Natick, MA, USA), is used to develop the smart schedule for EV charging instead of using deterministic models that are widely used [18]. Many optimisation problems can be solved by linear programming and other deterministic algorithms. However, when the dimension of the problem becomes large, linear programming algorithms cannot address the problem in a reasonable amount of time, and in many cases such as the one discussed in this paper, it is not an appropriate approach [31].
The structure of the paper is as follows: mobility patterns are developed in Section 2 according to Spanish users' behaviour. Section 3 focuses on the EV charging model. The smart charging methodology and the GA implementation are developed in Section 4. Studies and results of the smart charging model for low-voltage topologies are presented in Section 5. Finally, the conclusions are given in Section 6.

Electric Vehicle User Behaviour
One of the main problems related to EV integration into distribution power networks is predicting the mobility behaviour of the EV, which depends on each individual EV driver [30]. To meet the total EV charging demand in a way that enhances the load profile, it is necessary to develop a parking availability pattern that lets the smart grid aggregator determine the possible scheduling of EV charging.
In this study, a survey of vehicle user behaviour, MOVILIA (Encuesta de Movilidad de las Personas Residentes en España) [32] carried out by the Spanish Ministry of Industry (Madrid, Spain) is used to determine the parking patterns of vehicles for each topology of this study. MOVILIA provides information about the type of trip (trips to work, for shopping, leisure, etc.) and the duration of the trip. The MOVILIA results focus attention on periods related to work that correspond to the majority of the trips.
MOVILIA distributes the trips in a typical day into eight categories: trips from/to home, movements from/to work, leisure trips, shopping trips, accompany trips, trips to/from school or study centres, visiting friends/family and others. By extracting the trips suitable for the residential topology (trips from/to home), it becomes possible to estimate the periods of the day that the EV is plugged-in at home. Figure 1 shows the hourly statistical distribution for the first and last trip from/to home. According to Figure 1, it should be noted that Spanish vehicle users leave home between 8:00 and 10:00 in the morning (first trip of the day), which corresponds to the beginning of business activity, and return home between 19:00 and 24:00 (last trip of the day). In Figure 2, all the vehicle trips during a working day are shown. Taking into account the previous data, Figure 3 shows the number of hours that vehicles are parked at home during the day. As shown, 18% of EVs are parked at home and connected to the grid for 12 h, and only 2% of EVs are parked 24 h per day. Finally, the number of EVs parked at home and available to be charged hourly, or the parking pattern, is shown in Figure 4. These results show that that 98% of EVs are parked at home at 2:00, whereas only 2% of EVs are parked at home at 10:00. Comparing the first and last hour of the day, Figure 4 shows that at 24:00, only 96% of EVs have returned home, which means that the last trips of 2% for EVs take place between 24:00 and 1:00. The parking pattern of a residential low-voltage network can be obtained by taking into account the percentage of EVs that could be parked at home for each of the 24 h in a day, which is related to the total number of available EVs connected to the network. EVs are mainly parked at home between 19:00 and 7:00, and it should be noted that EVs finish arriving home at 1:00 instead of at 24:00.

Electric Vehicle Battery Charging
The electrification requirements of the transportation sector are not very significant at the moment. For this reason, we use 2020 as the target year because this is when the number of EVs on the road is expected to be higher [17].
EVs can be modelled as mobility loads whose main characteristics are charging time, power demand and the rate of charge [33,34]. In a dynamic analysis, such as EV control, dynamic models of the EV batteries must be considered [16] where EV batteries can be approximated by a voltage source V OC in series with an equivalent constant resistance of the battery cell R i in which the active power characteristic of the EV battery represents the charging process. However, for planning and scheduling purposes, we consider that the EV aggregator manages the EVs' distributed storage batteries to provide DSO the required flexibility of services. To accomplish this, the EV aggregator receives the information on the initial State-Of-Charge (SOC initial ) of the EV batteries for each of the 24 h in a day. It is assumed that the SOC of each battery must be between a maximum (SOC max ) and minimum level (SOC min ). In this paper, it is considered that EV aggregator performs the optimal scheduling using the following data from the EV charging station: time of connection; initial state of charge; actual state of charge (SOC); final state of charge; type of vehicle and customer charging mode as it is defined in the Standard ISO/IEC 15118 [35]. Additionally, a typical value of battery charger efficiency of 90% is considered in the EV energy demand from the grid.
For each of the charging periods, a PEV charges until its desired state of charge (SOC) is reached Equation (1): where SOC (h) is the state of charge at any instant of time and H is the last hourly time period in the battery charging process. Several EV charging infrastructures (currents and grid connection types) are described in the International Standard IEC 61851-1 [36] as shown in Table 1. Charging Mode 1 is the most preferred charging infrastructure followed in residential distribution networks mode, which corresponds to a slow charging rate of 3.7 kW, mainly because EV drivers have enough time for a slow charge (four to eight hours, depending on the charge level) [15], and it is the most suitable method for domestic environments [32]. Table 1. Standard charging power levels [36].

Smart Charging Scheme: Problem Formulation
The scheduling of EV load demand is an important issue for current power networks [37,38]. Several charging schemes have been developed during recent years that can be classified into four categories: dumb charging schemes (the EVs charging starts just when they are plugged-in at home), conventional controlled charging schemes (the charging process is time-delayed to avoid peak demand periods), smart charging schemes (a G2V charging scheme is determined by an intelligent algorithm to improve the operation of the power network) and V2G-G2V charging schemes (the charging and discharging of EV batteries are controlled to optimise power system operation).
This study focuses on an optimal EV charging strategy to flatten the load profile of the transformer substation of the distribution network; in addition, peak demand shaving and technical network limits are considered. To achieve this goal, it must be considered that all the EV load requirements must be supplied according to the parking patterns developed in Section 2 and must take into account technical network constraints, such as thermal limits of cables and voltage violations at buses.
A 24-hour load demand profile of a residential network and the low-voltage network topology are used as input data in the optimisation problem. The decision parameters are the EV charging demand that might be used for each of the 24 h. In this study, a slow charging connection is considered because it is the normal charging infrastructure installed in residential power networks. The result of the study is a 24-hour optimal EV batteries power charging schedule.

Objective Function
The goal of the optimisation problem is to obtain the daily optimal scheduling of EV demand to flatten the loading profile of the transformer substation. The loading profile at the transformer corresponds to the addition of a residential load demand for each house connected to the network and a total EV hourly demand. To level the load profile of the whole system and avoid the deviation of the load between consecutive hours, it is necessary to develop an optimal schedule of EV charging to fill the gaps of the residential load profile during periods of lower load demands and avoid charging EVs during peak load hours. To achieve this, the objective function is given as a measure of main transformer load profile deviation between consecutive hours Equation (2): where represents the main transformer loading at hour h.

Constraints
The constraints of the optimisation problem are organised into several categories.

Parking Patterns
The optimal scheduling of EV battery charging must utilise the availability of the EVs at the Customer Point Of Connection (CPOC) Equation (3). The parking patterns developed in Section 2 show the possible hours of connection for EVs to be charged. Every hour, the parking availability of the EV must be checked to assess the available EV demand:

EV Demand
The energy demand of EVs that must be accommodated in the study's framework depends on the number of EVs connected to the power system, the size of the battery, SOC max and the SOC of the battery when the user arrives at home from the last trip (SOC initial ) Equation (4). The SOC initial is transferred from the EV to the CPOC and is subsequently registered by the EV aggregator. It is considered that all the energy demand of the EV batteries must be covered throughout the 24 h charging process: where C is a constant that represents the number of EVs charging simultaneously; if C = 0, then no EVs are connected, and if C = 1, all the EVs are charging simultaneously.
Moreover, the SOC of the battery of each EV must be within the limits in every step of the simulation Equation (5): When the SOC max is reached, the EV charging is complete. SOC min is limited by the maximum Depth of Discharge (DOD). Under normal operating conditions optimum DOD should not be discharge above 80% of the rated battery size (typically SOC min ≈ 0.2).

Power-Flow Constraints
Basic equality constraints correspond to the power-flow equations for every bus Equations (6)- (9): where: ∆ , ∆ correspond to bus active and reactive power mismatch equations; , are the active and reactive power injections at bus ; , active and reactive power of generators at bus which corresponds to the available variable injection of EV working as V2G (EVgeneration ), , active and reactive power demand at bus . Power demand is considered as the sum of residential power demand and the variable EV charging demand as G2V (EVdemand ).

Charging Constraints
To improve the power system operation, the peak transformer substation load demand must not be exceeded after adding EV charging/discharging Equation (10) energy to the residential electricity demand. Dumb, conventional controllable charge and smart charging approaches are included as constant power loads in the power flow and correspond to EVdemand (ℎ) in Equation (10).

Network's Technical Limits
• The voltage levels in buses are not allowed to fall outside the maximum and minimum limits according to the grid voltage regulation Equation (11): • The thermal limits of network components corresponding to the ratio of the apparent power flowing though the lines and the main transformer substations must be taken into account during the optimisation process. These constraints are summarised in Equations (12) and (13):

GA Implementation
In recent decades, intelligent algorithms have been applied to address complex, real-world power system optimisation, which involves a large number of possible solutions [39,40]. The application of evolutionary algorithms, such as GAs, has received considerable attention because of the difficulty of extending conventional optimisation techniques to those types of problems [32] and assessing the problem in near real time. For this reason, GAs appear to be an acceptable algorithm for smart charging scheduling of PEV [37,41].
Genetic algorithms (GA) are a family of computational optimisation models developed by Holland [42] and first implemented by Hopgood and Goldberg [43] to solve both constrained and unconstrained optimisation problems. GAs are based on natural evolution processes, which can be deduced from the employed operators that are clearly inspired by natural sequences and from the main driver of the GA, which would be defined as a biological selection. One of the main advantages of GAs is that they work with a set of possible solutions, called the population, that will be modified at each stage (generation) of the algorithm based on a genetic operator. The algorithm evolves to a new generation of individuals by executing reproduction, mutation and crossover operations among the individuals of this population. The main advantages offered by GAs over conventional optimisation algorithms are as follows [44]: • GAs do not require initial information about the system to begin the searching process because they work only with coding (chromosomes), which will be optimised according to the objective functions and the proper constraints.
• The algorithms can explore various regions in the search space simultaneously by using multiple points of the population and iterative characteristics. This represents one of the most important distinctions from traditional optimisation algorithms, where only one direction in the search space can be followed.
• The best individuals are selected among parents and offspring generations, making the process more likely to converge to a global optimum.
The choice of the optimization algorithm depends on different aspects, such as: the required quality of solutions, the computing time, the selection of the objective functions or the problem's constraints. Some deterministic algorithms can be very fast but in many cases they can only be applied for small size problems where only a single objective function is required and the number of constraints is reduced. In this paper, GA has been selected because they offer great flexibility to consider multi-objective functions and they are able to work, simultaneously, with several constraints. Moreover, GAs have proved to be robust optimization techniques [39] dealing with non-linear and non-convex problems as the one shown in this paper.
The objective of the present study is to minimise the load profile deviation by means of EV optimal charging. Variables used in the optimisation problem are the hourly demands. Using this approach, the GA chromosome is composed of 24 genes (Load demand 1 , Load demand 2 , Load demand 3 , … , Load demand 24 ). Genes are encoded by real numbers that correspond to hourly total demands according to Equation (14). The hourly load demand involves the hourly home electricity demand, hourly electricity demand using a G2V scheme and the hourly EV power production using a V2G scheme as is shown in Equation (14): The engine of the GA is the Fitness Function (FF) (2), which assigns a goodness value to each individual of the population and is employed to drive the evolution process. In this study, the FF must fulfil the charging requirements of all the EVs connected at each hour and minimise the deviation of the load profile of the main transformer (residential electricity demand or pre-load profile + EV load profile + power losses). The GA determines the optimal EV load demand during each hour. A scheme of the algorithm is given as follows (see Figure 5): • The GA implementation begins with the encoding. The 24-hour parking pattern developed in Section 2, 24-hour day-ahead EV demand and the 24-hour load demand are used as boundaries to determinate the feasible solution space of the population. A large population size (100 individuals) is selected as the initial population to increase the convergence rate to the global solution. The selection of the population size is a critical factor in the GA implementation because large values increase the convergence rate to the global solution, but this also increases the computation time.
• When the initial population is created, information about the low-voltage grid topology is considered in the evaluation process. The feasibility of each individual in terms of the FF (2), considering network constraints (3)-(13), is evaluated using a power flow.
• After the evaluation and scaling of each individual, the population evolves through genetic operators to a new population. The roulette method approach is used for the selection operator, and a rate of 50% is assigned to the crossover operators.
• To improve the evolution of the GA process, a mutation rate of 50% is selected. Two elitism children are maintained at each generation to ensure the best solution throughout the process.
• The process continues until the stopping criteria have been reached. In this study, a convergence tolerance of 10 −6 and 100 maximum generations are used as the stopping criteria.
• Finally, the result of the GA shows the optimal management of EV charging. The optimal solution corresponds to the pre-operational load plus the EV contribution and power losses calculated in the power flow.

Grid Topology
The optimised EV charging schedule shown in this paper has been applied to low-voltage distribution networks from a Spanish electricity distribution company (Unión Fenosa), which is shown in Figure 6. The residential distribution network corresponds to an existing low-voltage network with a main substation transformer that provides electricity for N = 100 individual customers connected to several feeders. Grid data are detailed in the Appendix. Figure 7 shows one of the parking charge points available at the network. Figure 8 shows the EV parking infrastructure of a multiple charge point location of a distribution system equivalent to the system under study. The daily baseline load profile measured at the main substation transformer is shown in Figure 9. It is assumed that each individual house can have one or two EVs; consequently, the EV population connected to the network can be considered to be 1.5 N.
In this study, it is assumed that the charging process corresponds to a slow charge and that the EV batteries are fully charged throughout the day: continuously during the fixed time duration (for example, 3 h) or discontinuously throughout the day. The charging rate at the CPOC is 16 A, which corresponds to an AC voltage of 250 V based on Mode 1 of the IEC 61581-1 standard. It is considered that the state of charge (SOC) at the end of the last trip of the day is 20%. It is also assumed that the CPOC is equipped with technology to control the charge of the battery of the EV by using signals from the smart grid aggregator.

Studies
The optimal scheduling strategy described in previous sections has been implemented in the residential network. Three EV penetration scenarios have been considered: a low penetration level (5%), medium penetration level (20%) and a high penetration level (50%). Four different types of EV charging processes (dumb, conventional, smart G2V and smart G2V + V2G) have been applied to the residential network.

Dumb Charging Strategy
For the dumb charging strategy, electric vehicles are charged as soon as the EV is plugged-in at home. In this case, the charging process is performed using a slow charge. Based on the vehicle user behaviour study MOVILIA [32], it is considered that the EVs are connected to the network, and consequently charged, during the following periods: • 85% of the EVs arrive at home between 18:00 and 20:59, and they are supposed to be plugged into the electricity network immediately. This period of time occurs during the peak load demand on the substation transformer, which is called the peak period.
• 5% of the EVs are connected to the network between 24:00 and 2:59, which coincides with the valley load demand.
• 10% of the EVs are plugged-in and charged between 21:00 and 23:59. Figure 10 shows the percentage of the load of the main transformer of the residential networks, for a dumb EV charging schedule, where the three EV penetration levels and time frames are analysed. It should be observed that with dumb charging, the main transformer substation is overloaded at the peak periods for a high penetration level, which corresponds to an overloading of 140% occurring at 20:00. Figures 11-13 show the voltage profile of the main branches for feeders 1, 2 and 3, respectively, under different EV penetration levels, considering the maximum loading hour (20:00). It should be noted that the bus voltages remain under the allowable limits for the most overloaded hour, and the bus voltages vary between 0.97 p.u and 1.03 p.u.    To determine the capacity of the residential network to assess the EV demand, an analysis of the power system capacity was performed. The maximum number of EVs that could be charged within network limits is shown with a blue line in Figure 14. Moreover, Figure 14 shows an hourly comparison between the number of EVs that are parked at home and therefore are available to be charged using the parking pattern described in Section 2, for each penetration level (represented by low, medium and high parking areas), and for the EV charging pattern provided by the GA (low, medium and high penetration columns). It should be noted that during peak hours, the amount of EV charging exceeds the maximum load capacity of the main substation transformer; therefore, this dumb charging strategy produces an overload of the main transformer from 19:00 to 21:59 for high EV penetration.

Conventional Controlled Charging
In this situation, the EV is plugged into the electricity network as soon as the driver arrives home. However, the charging process is controlled by the smart grid aggregator based on the time frame. The charging periods considered by the aggregator are the following: • 85% of EVs are charged during the valley load period, and the charging process is initiated at 1:00, considering slow charging and continuous charge duration (for example, 3 h).
• 10% of EVs are charged during the remaining hours of the day. Figure 15 represents the final loading (%) at the substation transformer. It should be noted that the final loading only exceeds network capacity during the first hour of the day and for high penetration levels. Because the controlled charging scheme only considers the time delay and initiates the EV charging at the same moment in time, the peak demand is displaced from 21:00 (without EVs) to 24:00 (with EVs). Voltage profiles for the three main feeders are shown in Figures 16-18 for different EV penetration levels and for the hour h = 0:00.     -Blue solid line represents the maximum number of EV that could be charged considering network limits. -Stacked bar graph represents the number of EVs charging hourly for low, medium and high penetration levels. -Colored area represents the number of EVs parked at home and available to be charged based on the parking patterns for low, medium and high penetration levels. Figure 19. Conventional controlled EV charging schedule.

Smart Management G2V
In this section, the smart G2V load management technique is applied to the residential low-voltage network. Smart management is based on the GA developed in Section 4.3. In this case, two periods of time are considered for fully charging EVs throughout the day: during the daylight period (7:00-18:59) 10% of parked EVs are charged, and 90% of EVs are charged during the night timeframe (19:00-6:59). As shown in Figure 20, the smart G2V EV load management technique improves the post-operation load profile of the main transformer. In this case, the peak load of the main transformer is not exceeded during any hour. It can be observed that the electricity demand for the high EV penetration level is spread throughout the night so that no overload takes place. Figure 21 shows an EV pattern connection for the different penetration levels and compares it with the availability parking pattern and the maximum number of EVs for the overload. The GA charging pattern does not exceed the maximum number of EVs for overload or the parking pattern in any case.

Smart Management G2V + V2G
The Smart G2V + V2G load management technique is applied to the low-voltage power system under study. In this case, the EVs are assumed to be equipped with technology capable of providing energy stored in the battery to the grid (V2G) when they are parked at home; therefore, EVs can act as loads and generators. This new capability enables EVs to offer ancillary services, such as spinning reserves and regulation, to the system operators by working as flexible energy storage resources [13]. Smart scheduling with a combination of G2V and V2G offers the possibility of managing EVs as V2G to the smart grid aggregator, offering peak savings. In addition, they can be used as G2V providers, offering the service of valley filling. Moreover, EVs capable of acting as flexible storage units could be managed in terms of energy demand requirements for movements of daily trips and energy storage required as a producer based on the DSM. The storage capacity could lead to greater integrations of distributed energy resources by assessing their energy fluctuations. EVs with V2G technology could be charged, discharged or disconnected during each hour of the day. For this reason, the scheduling management of V2G must optimise the charging and discharging of the batteries to improve the operations of power systems, reducing the necessity of installing additional new reactive power resources or generation sources. In smart V2G management, it is assumed that a percentage of the energy stored in EV batteries could be delivered to the grid during several hours in a day. It is considered that the V2G exchange is possible only when EVs are plugged-in at home; therefore, two timeframes are considered: daylight (7:00-18:59), when 10% of the V2G stored energy can be injected into the network, and during the night, when 90% of the EVs are plugged-in at home and are capable of delivering part of their stored energy to the grid. According to the 2020 forecast of EV penetration levels [16], a smart G2V + V2G analysis has been developed for a medium penetration level of EVs in the network. As shown in Figure 22, the smart G2V + V2G load management technique (green columns) improves the post-operation load profile of the smart G2V main transformer. A brief reduction of the load demand on the power network throughout the day is possible because of the V2G capability of the EV; therefore, the load profile is reduced by 20% between 24:00 and 6:00 compared to the total load demand at the main transformer for the G2V scheme. As in the previous case, it should be noted that the smart G2V+V2G technique avoids main transformer overload and respects parking patterns. Figure 23 shows the power profile in feeder number 3 where EVs are connected for different charging strategies: Dumb charging; conventional charging; Smart management G2V; Smart G2V + V2G management technique. It can be noted that power flowing across feeder's lines is fairly constant throughout the day by using smart charging. Smart G2V + V2G management technique prevents the aging of distribution feeder elements.

Conclusions
This paper develops a smart scheme for EV battery-charging management. The realistic behaviour of drivers has been used to obtain the mobility patterns and parking availability aspect of EVs to improve the charging and discharging process. EV integration into power systems has been carried out based on peak shavings and valley filling services. In addition, the reduction of substation transformer aging has been proved. A comparison between dumb, conventional, smart G2V and smart G2V + V2G battery management techniques in an existing residential network has also been performed.
The problem is solved using GAs and focuses on an authentic residential low-voltage topology. The formulation of the problem takes into account network constraints, which are related to voltage limits, lines and transformer thermal limits, as well as battery models. Moreover, the availability connection patterns have been incorporated as inequality constraints. The result of the GA is the optimal schedule for charging EV batteries throughout the day, taking into account drivers' behaviour.
Four different management techniques have been tested in the power system. The first corresponds to uncontrollable, or dumb, management in which EVs charge their batteries as soon as they arrive home. It should be noted that under this scheme, the peak load increases and exceeds the thermal limits of the substation transformer accelerating the aging of the transformers. The second schedule corresponds to conventional management in which EVs are charged in a new time frame that corresponds to valley hours. In this case, the load profile has a new peak demand during the night hours, and in high EV penetration level, the substation transformer is overloaded. The third and fourth schemes correspond to smart management techniques. The G2V management technique improves the load profile of the daily demand, and the substation transformer is not overloaded in any case. A combination of smart G2V and V2G EV charging techniques improves the load profile as well, and it should be noted that in this smart charging scenario, the total load demand of the main transformer during valley frame hours is smaller than in the G2V scenario. This is caused by the capacity of the EVs to discharge their batteries and provide this energy to the power system, thus reducing the stress on the transformer. Focusing on the last management scheme, EVs could be treated as loads or generators depending on the necessities of the DSO. This flexibility in the behaviour of EVs offers a number of advantages to DSOs in terms of assessing the load demand of power systems and flattening the load profile as has been demonstrated in this paper and reducing transformer aging. Furthermore, V2G technology can be used to address distributed energy resource generation oscillations and allows EVs to be treated as new generators in the electricity generation portfolio.

Acknowledgments
This work has been partially funded by the Spanish Ministry of Industry, Energy and Tourism under contract DOMOCELL TSI-020100-2009-849.