The number of electric vehicles is increasing at a worldwide level. For = instance, 12 000 electric cars were sold in the US country in January 2017,= accounting for approximately 1% of the total US auto sales. This results i= nto a Year over Year (YoY) increase of about 59% [1]. Similarly, the Chines= e market had more than 32 000 new electric cars along the streets in March = 2017, which corresponds to an 89% increase over the same month last year, w= ith the YoY increase now at 31% [2]. Numbers in Europe are contradictory, a= s the penetration level strongly depends on the specific country. For insta= nce, new registrations for battery powered cars increased in the first quar= ter of 2017 from 23703 to 32607 in the EU, Norway and Switzerland [3]. In p= articular, countries in Northern Europe are leading the way (e.g., UK, Neth= erlands, Scandinavian countries). For instance, Norway has the highest per = capita number of all-electric cars in the world: more than 100 000 in a cou= ntry of 5.2 million people [4].

The main reason behind such numbers is undoubtedly the growing concerns = over environmental issues. To address them, governments have exerted a regu= latory pressure to reduce urban pollution, in most cases through appropriat= e incentives to purchase electric vehicles, and to facilitate the creation = of a charging infrastructure. The pressure is also expected to further incr= ease the upcoming years, as some countries are taking even more strict meas= ures. For instance, Paris, Madrid, Athens and Mexico City are planning to b= an the most polluting cars and vans by 2025 to tackle air pollution, while = they promote electric vehicles and cleaner transport [5]. Such restrictive = measures are expected to further increase the penetration level of electric= vehicles, and some projections (e.g., Bloomberg [6]) predict that electric= vehicles might account for 35% of all new vehicle sales (worldwide) in 204= 0. Obviously, this implies that much larger penetration levels may be reach= ed in specific areas.

The previous numbers and predictions are obviously creating some concern= s regarding the ability of the power grid to accommodate such a new electri= c load. On the other hand, electric vehicles may be also regarded as an opp= ortunity, as at the same time they might not just take electricity from the= grid (G2V, as the power flows from the Grid to the Vehicles), but also occ= asionally inject power in the grid (V2G). In this sense, a fleet of electri= c vehicles plugged into the grid may be also regarded as a possible virtual= battery connected to the grid.

Accordingly, the next sections investigate the mathematical problems ari= sing in this context. In doing so, we shall mainly follow the recent refere= nce [7]. Also, we shall intend the notion of Electric Vehicles (EVs) in the= broadest sense, i.e., by EVs we shall both refer to Fully Electric Vehicle= s (FEVs) and to Plug-in Hybrid EVs (PHEVs).

**Charging of Electric Vehicles**

The charging problem can be modelled as (1):

where is the power drawn by the *i*=E2=80=99th vehicl=
e at time step *k*. If we assume that *n(k)* are plugged to t=
he power grid at the same time, then the power drawn by the population of t=
he fleet of vehicles cannot exceed a maximum value (i.e., ) that depends on=
the total power available for charging. Such maximum threshold depends its=
elf on many variables, as on the amount of other loads connected to the sam=
e bus, the topology and the constraints of the power grid, possibly the pow=
er locally generated from renewable sources. At the same time, the second e=
quation of (1) shows that the power drawn by the *i*=E2=80=99th vehi=
cle cannot take arbitrary values, but is set to lie on a predetermined set =
of feasible charging powers. At this regard, it is possible to distinguish =
three main categories:

, where the value of can either be= 0 (no charging) or equal to the maximum value (e.g., 4kW in the case of st= andard single phase outlets). Examples in this direction can be found in [8= -9].__On-off charging__-
, where the value of ca= n be chosen among of a set of possible values. For instance, the vehicle ma= y be charged in a fast mode at off-peak times, while it may be charged in a= slow mode at on-peak times. Other intermediate charging speeds may be poss= ible as well to further accomplish a larger variety of charging solutions.<= /li>__Multi-level charging__ , when the value of &nbs= p;can continuously adjust its power rate, within the feasible set (i.e., be= tween 0 =E2=80=93 no charging - and a maximum value given by the powe= r rate of the outlet).__Continuously adaptable charging__

Note that the optimisation problem (1) can be interpreted as a *resou=
rce allocation problem*, where the shared resource (i.e., maximum power=
) must be shared among a set of vehicles. Note that in principle many diffe=
rent ways may be devised to share the power among the vehicles. While an ob=
vious solution may be to give the same power to all vehicles, problem (1) b=
ecomes most interesting when one optimally shares the available power in or=
der to further minimise a cost function of interest, i.e. (2),

In the optimisation problem (2), we further have that the cost functions=
indicate some cost associated with receiving a given instantaneous p=
ower . In most cases; this may refer to the price for charging, to the over=
all time required for charging; or the inconvenience for the users associat=
ed with a given power; or the inconvenience for the grid (i.e., in terms of=
its overall availability to serve the requested total demand for charging)=
; or may measure some CO_{2} emissions associated with a given char=
ging (e.g., depending on whether power generated from renewable sources is =
available or not for charging EVs). Obviously, problem (2) may be also form=
ulated as a maximisation problem, in the case one assumes that the function=
s represent some utility of interest (e.g., revenues).

A number of algorithms have been proposed in the literature to solve pro= blem (2). Different solutions may be categorised as:

In the case of c= entralised solutions, each EV communicates to some central infrastructure i= ts charging needs (i.e., how much they should charge, and by what time). Th= e central infrastructure gathers all this information and computes the opti= mal scheduling in order to minimise a cost function of interest. Examples i= n this direction can be found in [10-12]. While centralised solutions may m= ore efficiently solve the optimisation problem (as the central infrastructu= re has all the information required to solve the optimisation problem), the= y are known not to be as robust, and communication efficient as distributed= solutions. For this reason, it is usually advocated that a mixed framework= , where some central infrastructure is interfaced with some local controlle= rs may be the most convenient trade-off [13]. Other examples of distributed= solutions are [14-18].__Distributed vs. centralised solutions:__In the resource-= allocation formulation of the electric vehicle charging problem, EVs may ei= ther cooperate or compete to get a larger share of the shared resource (i.e= ., to complete their charging as soon as possible). While competing scenari= os may occur when EV owners pursue opportunistic strategies, cooperative so= lutions may arise when the EV owners are all employees of the same company,= or EV car-sharing service. Examples of both solutions may be found in the = already mentioned [15], while examples of competing solutions are [19-21]. = Note that in most of these papers where competing behaviours are considered= , game-theory based methodologies are employed to solve them.__Cooperative vs. competitive solutions:__

**Problem extensions**

The optimisation problem (2) can be further refined and made more realis= tic along a number of different lines. In particular, the following problem= s are of interest in the related literature:

, as briefly anticipated, EVs may provide a = number of ancillary services to the grid, especially considering that vehic= les are idle (i.e., parked) most of the time. Under the assumption that veh= icles may be plugged to the grid every time they are parked, then the grid = would have a giant virtual battery at its own disposal, that can be used to= improve the functioning of the grid (e.g., in terms of active and reactive= power exchange, for peak-shaving/valley filling purposes, and more in gene= ral to accomplish demand side management tasks, to mitigate problems associ= ated with voltage drops, power losses or overheating). Some works that have= addressed V2G issues are [22-23, 16].__V2G__, more recently, some part of the li= terature concerned about V2G ancillary services has specialised upon the pa= rticular case of power exchanged between electric vehicles and buildings - = Vehicle to Building (V2B) and Building to Vehicle (B2V). In fact, batteries= of EVs may be used as an alternative to conventional in-home batteries to = implement demand side management functionalities in buildings. In particula= r, power generated from photovoltaic (PV) panels (e.g., on the roof of a bu= ilding) can be used to charge EVs if at the same time domestic appliances a= re switched off. Similarly, power can be occasionally taken from EVs to dri= ve domestic appliances when power from renewable sources is not available. = Examples of papers along this line of research are [24-27].__V2B and B2V__, many of the aforementione= d works tend to neglect the actual topology of the grid. In this case, the = main assumption is that all EVs are connected to the same sub-station or to= the same bus. While such an assumption may hold in the case of a single mi= crogrid, still it might be unsatisfactory when a realistic large-scale scen= ario is actually considered. Among the works that explicitly take the topol= ogy of the grid into account we remind [28-29].__Topology of the grid__become important whe= n EV owners are not willing to reveal their needs (i.e., how much energy sh= ould be required and by what time) to some central infrastructure or to som= e kind of an aggregator. Whenever this kind of information is considered to= be sensitive, then algorithms that do not reveal this kind of information = become important. Additive Increase Multiplicative Decrease (AIMD) algorith= ms are known to be very convenient both in terms of reduced communication r= equirements, and also in terms of their privacy preserving properties. More= information at this regard can be found in [7, Chapter 18].__Privacy preserving aspects__come into play anyti= me one is not interested in instantaneously solving problem (2) (i.e., in a= greedy fashion), but rather in finding the optimal solution in a future ho= rizon of time. Then the problem becomes much more complicated as it require= s the ability to compute the optimal solution considering the highly uncert= ain scenario. The uncertainties entering the optimisation problem regard th= e need to predict the future driving/charging patterns of EV owners; and al= so the future power generation (e.g., from renewable sources) and future lo= ad consumption. Note that all such uncertain future profiles are themselves= related to other aspects (i.e., meteorological conditions affect power gen= eration, load consumption, and also energy consumption in EVs). Papers addr= essing this issue are [30], where Particle Swarm Optimization (PSO) method = is used, [31], where a Markov decision process is used, and [32], where a r= obustified version of a heuristic algorithm based on Model Predictive Contr= ol (MPC) is employed.__Receding horizon solutions__

** **

**References**

[1] https://cleant= echnica.com/2017/02/04/us-electric-car-sales-59-january-2017/, last acc= essed: May 2017.

[2] https://evobsess= ion.com/china-electric-car-sales-keep-soaring-march-2017/, last accesse= d: May 2017.

[3] https://www.bloomberg.com/news/articles/2017-05-04/electric-c= ar-sales-are-suddenly-taking-off-in-europe, last accessed: May 2017.

[4] http://e360.yale.edu/features/with-norway-in-the-lead-europe-set-f= or-breakout-on-electric-vehicles, last accessed: May 2017.

[6] https://www.bloomberg.com/features/= 2016-ev-oil-crisis/, last accessed: May 2017.

[7] E. Crisostomi, R. Shorten, F. Wirth and S. St=C3=BCdli, =E2=80=9CEle= ctric and Plug-in Hybrid Vehicle Networks: Optimization and Control=E2=80= =9D, CRC Press =E2=80=93 Taylor & Francis, Series: Automation and Contr= ol Engineering, 2017.

[8] S. St=C3=BCdli, R.H. Middleton, and J.H. Braslavsky, =E2=80=9CA fixe= d-structure automaton for load management of electric vehicles=E2=80=9D. In= Proc. IEEE European Control Conference (ECC), pages 3566-3571, Zurich, Swi= tzerland,

July 2013.

[9] L. Yao, W. H. Lim, and T. S. Tsai, =E2=80=9CA Real-Time Charging Sch= eme for Demand Response in Electric Vehicle Parking Station=E2=80=9D, IEEE = Transactions on Smart Grid, vol. 8, no. 1, pp. 52-62, 2017.

[10] S. Deilami, A.S. Masoum, P.S. Moses, and M.A.S. Masoum, =E2=80=9CRe= al-time coordination of plug-in electric vehicle charging in smart grids to= minimize power losses and improve voltage profile=E2=80=9D, IEEE Transacti= ons on

Smart Grid, vol. 2, no. 3, pp. 456-467, 2011.

[11] K. Clement-Nyns, E. Haesen, and J. Driesen, =E2=80=9CThe impact of = charging plug-in hybrid electric vehicles on a residential distribution gri= d=E2=80=9D, IEEE Transactions on Power Systems, vol. 25, no. 1, pp. 371-380= , 2010.

[12] W. Su and M.-Y. Chow, =E2=80=9CPerformance evaluation of an EDA-bas= ed largescale plug-in hybrid electric vehicle charging algorithm=E2=80=9D, = IEEE Transactions on Smart Grid, vol. 3, no. 1, pp. 308-315, 2012.

[13] J.A. Pe=C3=A7as Lopes, F.J. Soares, and P.M. Rocha Almeida, =E2=80= =9CIntegration of electric vehicles in the electric power system=E2=80=9D, = Proceedings of the IEEE, vol. 99, no. 1, pp. 168-183, 2011.

[14] D. Wu, D.C. Aliprantis, and L. Ying, =E2=80=9CLoad scheduling and d= ispatch for aggregators of plug-in electric vehicles=E2=80=9D, IEEE Transac= tions on Smart Grid, vol. 3, no. 1, pp. 368-376, March 2012.

[15] S. St=C3=BCdli, E. Crisostomi, R. Middleton, and R. Shorten, =E2=80= =9CA flexible distributed framework for realising electric and plug-in hybr= id vehicle charging policies=E2=80=9D, International Journal of Control, vo= l. 85, no. 8, pp. 1130-1145, 2012.

[16] E.L. Karfopoulos, K.A. Panourgias, and N.D. Hatziargyriou, =E2=80= =9CDistributed coordination of electric vehicles providing V2G regulation s= ervices=E2=80=9D, IEEE Transactions on Power Systems, vol. 31, no. 4, pp. 2= 834-2846, 2016.

[17] L. Gan, U. Topcu, and S.H. Low, =E2=80=9COptimal decentralized prot= ocol for electric vehicle charging=E2=80=9D, IEEE Transactions on power sys= tems, vol. 28, no. 2, pp. 940-951, 2013.

[18] S. Grammatico, =E2=80=9CExponentially convergent decent= ralized charging control for large populations of plug-in electric vehicles= =E2=80=9D, in Proc. IEEE Conference on Decision and Control (CDC),= pp. 5775-5780, Las Vegas, Nevada, December 2016.

[19] M. Gonzales Vaya, S. Grammatico, G. Andersson, and J. Lygeros, =E2= =80=9COn th= e price of being selfish in large populations of plug-in electric vehicles<= /a>=E2=80=9D, 54th IEEE Conference on Decision and Control (CDC), pp. 6542-= 6547, Osaka, Japan, December 2015.

[20] S. Grammatico, F. Parise, M. Colombino, and J. Lygeros, =E2=80=9CDe= centralized convergence to Nash equilibria in constrained deterministic mea= n field control,=E2=80=9D IEEE Transactions on Automatic Control, vol. 61, = no. 11, pp. 3315-3329, 2016.

[21] S. Zou, Z. Ma, X. Liu, and I. Hiskens, =E2=80=9CAn Efficient Game f= or Coordinating Electric Vehicle Charging=E2=80=9D, IEEE Transactions on Au= tomatic Control, vol. 62, no. 5, pp. 2374-2389, 2017.

[22] S. St=C3=BCdli, E. Crisostomi, R. Middleton, and R. Shorten. =E2=80= =9COptimal real-time distributed V2G and G2V management of electric vehicle= s=E2=80=9D, International Journal of Control, vol. 87, no. 6, pp. 1153-1162= , 2014.

[23] Y. Ota, H. Taniguchi, J. Baba, and A. Yokoyama, =E2=80=9CImplementa= tion of autonomous distributed V2G to electric vehicle and DC charging syst= em=E2=80=9D, Electric Power Systems Research, vol. 120, pp. 177-183, March 2015.

[24] E. Ancillotti, R. Bruno, E. Crisostomi and M. Tucci, =E2=80=9CUsing= Electric Vehicles to Improve Building Energy Sustainability=E2=80=9D, in P= roc. of IEEE International Electric Vehicle Conference (IEVC), Florenc= e, Italy, 2014.

[25] D. Wu, H. Zeng, C. Lu, and B. Boule, =E2=80=9CTwo-Stage Energy Mana= gement for Office Buildings With Workplace EV Charging and Renewable Energy= =E2=80=9D, IEEE Transactions on Transportation Electrification, vol. 3, no.= 1, pp. 225-237, 2017.

[26] C. Pang, P. Dutta, and M. Kezunovic, =E2=80=9CBEVs/PHEVs as Dispers= ed Energy Storage for V2B Uses in the Smart Grid=E2=80=9D, IEEE Transaction= s on Smart Grid, vol. 3, no. 1, pp. 473-482, 2012.

[27] H.K. Nguyen, and J.B. Song, =E2=80=9COptimal Charging and Dischargi= ng for Multiple PHEVs with Demand Side Management in Vehicle-to-Building=E2= =80=9D, IEEE Journal of Communications and Networks, vol. 14, no. 6, pp. 66= 2-671, 2012.

[28] J. de Hoog, T. Alpcan, M. Brazil, D.A. Thomas, and I. Mareels, =E2= =80=9COptimal charging of electric vehicles taking distribution network con= straints into account=E2=80=9D, IEEE Transactions on Power Systems, vol. 30= , no. 1, pp. 365-375, 2015.

[29] G. Deconinck, K. De Craemer, and B. Claessens, =E2=80=9CCombining M= arket-Based Control with Distribution Grid Constraints when Coordinating El= ectric Vehicle Charging=E2=80=9D, Engineering, vol. 1, no. 4, pp. 453-465, = 2015.

[30] A. Y. Saber and G. K. Venayagamoorthy, =E2=80=9CResource scheduling= under uncertainty in a smart grid with renewables and plug-in vehicles=E2= =80=9D, IEEE Systems Journal, vol. 6, no. 1, pp. 103-109, March 2012.

[31] E. B. Iversen, J.M. Morales, and H. Madsen, =E2=80=9COptimal chargi= ng of an electric vehicle using a Markov decision process=E2=80=9D, Applied= Energy, vol. 123, pp. 1-12, 2014.

[32] S. Zao, X. Lin, and M. Chen, =E2=80=9CRobust Online Algorithms for = Peak-Minimizing EV Charging under Multi-Stage Uncertainty=E2=80=9D, IEEE Tr= ansactions on Automatic Control, accepted for publication, 2017.

**Contributor:**

Dr Emanuele Crisostomi, University of Pisa