Mean Field Approximation of an Optimal Control Problem for the Continuity Equation Arising in Smart Charging

We consider the optimal control of a finite population of hybrid processes (namely agents state is composed of a discrete and a continuous variable), modeling the optimal charging of a large population of identical plug-in electric vehicles (PEVs). We prove the convergence of the solution and that of the value of a sequence of finite population problems respectively to a solution and the value of a mean field optimal control problem.


Introduction
This work is motivated by the optimal charging of a very large population of plug-in electric vehicles (PEVs) controlled by a central planner.Each PEV is characterised by two variables: a continuous one representing the state of charge (SoC) of the battery, and a discrete one denoting the mode of charging of the PEV (e.g.idling, charging, discharging, etc.).The central planner determines when and to which mode of charging each PEV switches.In addition to the charging cost, the objective function also contains a term penalizing the switches, in order to avoid both excessive jumps per PEV and synchronization effects, i.e., simultaneous switches of a large proportion of PEVs.An optimization problem is considered, where the distribution of the population is subject to a congestion constraint to avoid a large proportion of PEVs having the same regime.Such a control problem typically arises in parking lots powered by solar energy that can be found in malls, airports, stadiums, hospitals and other facilities with large parking areas [22].Since the number n of PEVs is very large, both combinatorial techniques and optimal control tools may fail to solve the problem, due to the curse of dimensionality [4].To overcome these difficulties, one can approximate the problem of n PEVs by considering a continuum of PEVs, leading to the techniques of optimal control of PDEs and those of convex optimization.The resulting limit mean field control problem was studied in [49] and numerically solved in [50].Note that several articles have already dealt with smart charging problems within a mean field limit framework [16,45,47].Our paper aims to justify the mean field approximation by proving the convergence of the finite population optimization problem to the mean field problem, when n tends to infinity.Although the studied model in the present paper is motivated by the optimal charging of PEVs, this class of optimal control problem modelling should be useful in other contexts, such as the optimal control of a large population of flexible devices (e.g.water heaters, refrigerators etc.) whose state is composed of a discrete variable (e.g.ON/OFF).This type of problem usually arises in the framework of power system stability management.
We point out three important features in our modelling of the PEV charging.First, only a finite number of charging rates are allowed, because charging is mostly done at discrete rates [46].This feature was also adopted for example in [17,28,51].However, these papers did not systematically take into account the switching cost and congestion constraints, which are the second and third features of our modelling.Indeed, penalizing switches is crucial because, on the one hand, multiple changes in charging regime causes more intensive battery aging and degradation [21,43] whereas, on the other hand, the synchronization of switches of PEVs can disrupt energy balance on the electrical network [53] and increase instability of distribution transformers [54].Finally, congestion constraints enable to avoid voltage drops and overloading of transformers [34] caused by uncoordinated large fleets of PEVs.
The main contribution of this work is the convergence, as n tends to infinity, of the value of the finite population problem to the value of the mean field control problem (Theorem 2.1).We also prove the convergence (up to a subsequence) of optimal solutions of the finite population problem to a solution of the mean field control problem (Corollary 2.1).
Let us make some remarks on the method of proof.The finite population problem is first defined in a Lagrangian point of view, namely that the evolution of the population is described by the trajectory of each process (PEV).Then, an Eulerian formulation of the problem, which characterizes the evolution of the population by its state distribution, velocity field and the distribution of the switches of its discrete state, is introduced and proved to be equivalent to the Lagrangian formulation (Corollary 3.1).This result is obtained thanks to an empirical superposition principle (Proposition 3.1), that is an adaptation of the one in [11].The superposition principle states that any curve of probability measure, solution of the continuity equation, can be represented as the transport of the initial distribution along an ODE flow.This result was first introduced in [1] in the Euclidean setting, extended to general metric spaces in [42].In [11], the authors explain how to adapt this principle to empirical measures.Proposition 3.1 extends the empirical superposition principle of [11] to time discontinuous curves of probability.
The convergence of the solution and that of the value of the finite population problem in the Eulerian formulation are achieved in two steps.First, we prove that the lower limit, as n tends to infinity, of the value of the finite population problem is larger than the value of the mean field control problem, due to the compactness and lower semicontinuity arguments (Proposition 4.1).Second, we show that the value of the finite population problem is bounded above by the value of the mean field control problem up to a term of order O(n −1/3 ) (Proposition 4.2).To obtain this bound, a mean field optimal control is implemented to a finite population of processes and an estimate of the Wasserstein distance between the empirical distribution of the finite population and the optimal mean field distribution is derived (Theorem 4.1).This estimate strongly relies on the regularity of the optimal control of the mean field control problems.The Lipschitz continuity w.r.t. the space variable, uniformly in time, of the optimal control has been established in a companion paper [49].Similar results of Lipschitz regularity of the optimal controls have been studied in the context of mean field control problems [5,19].
Mean field control problems are strongly connected with the mean field game (MFG) problems.This class of games, introduced by Lasry and Lions [39][40][41] and Huang, Malhamé and Caines [32,33], describes the interaction among a large population of identical and rational agents in competition.It was first proved that one can construct ε-Nash equilibrium in the n-player game from mean field models [9,10,13,32].The convergence of the Nash equilibrium system to the MFG system is closely related to the well-posedness of the so-called "master equation".Such a property was proved in general settings, with common noise, in the breakthrough of [8].The convergence was studied in [25,36] in the open-loop control framework and extended in [38] for closed-loop Nash equilibrium, expanding results obtained in [8].Finally, convergence results in the finite state settings were obtained in [3,13,29,35] The mean field limit of a system of n interacting agents is defined as the asymptotic behaviour of the system when n tends to infinity.The empirical distribution of the system of n agents can be approximated by a distribution that is a solution of a Vlasov type equation.In the stochastic setting, one often refers to this asymptotic behavior as a propagation of chaos result [52].In the context of optimal control with deterministic dynamics, the convergence of the solutions of the finite population problem to a solution of the mean field control problem was first proved in [27], in the particular case of feedback control functions that are locally Lipschitz continuous in space.The authors applied -convergence techniques [18], that are usually used to study the convergence of a sequence of minimization problems and of the corresponding minimizers.
The convergence of the value of the optimal control of a finite population of interacting McKean-Vlasov dynamics to the value of a mean field optimal control problem was proved in [37] in a fairly general setting (the results hold for degenerate diffusion).The convergence results in [27] were obtained without the restrictions on the control in [26].In [11], the Eulerian, Lagrangian and Kantorovich formulations of the finite population and the mean field problems were introduced, and the convergence of the value functions of the finite population of the Lagrangian and Eulerian problems were established.More convergence properties in various deterministic settings can be found in [6,31] and in the references therein.In a stochastic setting, the results of [37] were extended to the case with common noise in [24] and with interaction of the agents with joint distribution of the state and control in [23].More recently, in a setting with idiosyncratic and common noise in the dynamics of the agents, a convergence rate of the value function of the finite population problem to the value function of the mean field limit problem was derived in [7].In a finite state space setting, this rate was proved to be of order 1/ √ n in [12].Similar results on the value function were obtained in [2] in the case of mean field control problem with regime switching in the state dynamics.The -convergence of a control problem of hybrid processes was proved in [30] in the very specific framework of multi-line traffic.Several convergence properties of the finite population model to the mean field one are given in [44] for the discrete time setting with common noise.
The modelling contains new features compared to the existing literature on optimal control.While most of problems in the literature deal with either continuous or discrete state variables, this work addresses the analysis of the mean field limit of hybrid processes.These new features led us to develop new mathematical tools such as a new superposition principle and a new transfer procedure from continuous to discrete control.Further, due to the time discontinuity of the empirical distribution of the finite population of agents and of the form of the cost function penalizing the switches of the discrete variables, standard techniques of the literature do not apply and new argument must be found.Also, a congestion constraint is considered in the optimization problem, which is unusual among the existing literature studying mean field limit of control problems (see however [14] for a -convergence result of an n-agent system to a mean field control problem with L ∞ upper bound on the density of the population).Finally, a particularity of the model in this paper is that the nature of the dynamics in the finite population problem is different from that in the mean field problem and, with respect to the literature discussed so far, is an uncommon result.While the switches of the discrete variable are controlled and deterministic in the finite population setting, the jumps of the discrete variable of each process are stochastic and the control is on the transition rate in the mean field problem.
The paper is organized as follows.In Sect.2, we present our assumptions, the nagent optimal control problem, the mean field control problem and the main results.The equivalence between the finite population problem and its Eulerian formulation is established in Sect.3, as well as the superposition principle.Finally, the convergence of the solution and that of the value of the finite population problem to the solution and the value of the mean field problem are proved in Sect. 4.

Main Results
Notations The space of non-negative real numbers is denoted by R + and the space of strictly positive real numbers by R * + .Given two real valued sequences {a n } n∈N and {b n } n∈N , the notation a n = O(b n ) indicates that there exists a constant M > 0 such that, for any n ∈ N, one has |a n | ≤ Mb n .The space of Borel, positive and bounded measures on a space A is denoted by M + (A) and the space of Borel probability measures on a space A is denoted by P(A).For any measure μ ∈ M + ([0, T ]) and 0 ≤ t 1 < t 2 ≤ T , we set ).Given a set S and a finite space I , for any function f defined on S × I and any measure μ ∈ M + (S × I ), we use the notations f i (x) := f (x, i) for any (x, i) ∈ S × I and μ i (S) := μ(S × {i}) for any (S, i) ∈ B(S) × I , where B(S) denotes the Borel algebra.Similarly, for any function g defined on S × I 2 and any measure ν ∈ M + (S × S × I 2 ), where S is a set, we use the notations g i, j (x) := g(x, i, j) for any (x, i, j) ∈ S × I 2 and ν i, j (S, S ) := ν(S × S × {i} × { j}) for any (S, S , i, j) ∈ B(S) × B(S ) × I 2 .For any metric spaces (X , d X ) and (Y , d Y ), we denote by D(X , Y ) the set of cadlag functions and by AC(X , Y ) the set of absolutely continuous functions from X to Y .Let C 0 (X , Y ) and Lip(X , Y ) denote respectively the set of continuous functions and the set of bounded and Lipschitz continuous functions from X to Y .For any Let be a domain of R d , we denote by BV ( ) the set of real valued functions that are of bounded variation on , by C 0 ( ) the set of real valued functions that are continuous on and by C 1 ( ) the set of real valued functions that are continuously differentiable on .The space Lip([0, T ] × [0, 1] × I ) + BV ((0, T ) × I ) denotes the set of real valued functions that are the sum of a function in Lip([0, T ] × [0, 1] × I ) and a function in BV ((0, T ) × I ).We denote by W the Wasserstein distance on P([0, 1] × I ), defined by for any i, j ∈ I .For any x ∈ R, x denotes the integer truncation of x.For any n ∈ N, we introduce P n [0, 1] × I , the set of empirical probability measures on the space [0, 1] × I defined by and similarly we introduce M n ([0, 1]) defined by:

The n PEVs Control Problem
We consider a population of n PEVs (n For any ∈ {1, . . ., n} and t ∈ [0, T ], the vehicle is described by its state variable x t := (i t , s t ) ∈ I × [0, 1], with a given initial datum x 0 = (i 0 , s 0 ).The discrete variable i , denoting the mode of charging, can switch deterministically and only at fixed times in {t 1 , • • • , t N n T −1 }, while the continuous variable s , representing the SoC, is governed by an ODE depending on the mode of charging.Between two jumps of the variable i , i.e. within each interval [t k , t k+1 ), the dynamics of x is deterministic and is given by: ( We denote by (i,s) a generic element of X n ( m).The population of n processes is subject to the following congestion constraints: where D : [0, T ] → R * + is given.This constraint indicates that at time t, the proportion of PEVs charging in mode i must be not larger than D i (t).The admissible set T n ( m, D) is defined by:

4) .
(2.5) Let J n be the objective function, defined by: Our purpose is to study the mean field limit of the following finite population optimal control problem: J n (i,s). (2.7) We recall that this work is initially motivated by the optimal charging of a population of plug-in electrical vehicles (PEVs) controlled by a central planner.The given velocity field b(i, s) denotes the power of charge or discharge of a PEV in mode i and with battery level s.The congestion constraint (2.4) aims at avoiding high demand of energy at each moment over the period.The value c(t, i, s) in (2.6) (i,s) normalizes the transition cost and avoids its explosion when n tends to infinity.The switching costs in (2.7) showed good numerical results in [50].
Remark 2.1 For any PEV , the discrete variable i is considered as a state variable in Problem (2.7).In the finite population problem, this variable can be seen as a control variable to determine the charging rate of the PEV during each time interval.In this case, Problem (2.7) can be reformulated where the discrete variables {i } ∈{1,...,n} are control variables.However, in the mean field limit problem, this discrete state variable can no longer be seen as a control variable (see Sect. 2.2).

Remark 2.2
Since the number of admissible trajectories is finite and by Assumption 3 (given in Sect.2.3) non-empty, the infimum is always attained in (2.7).Actually, Assumption 3 ensures that the n processes with no switches for the discrete variable is admissible.We deduce that, for any n ∈ N, (2.8)

The Mean Field Control Problem
This section defines the limit model when n tends to infinity.Let ( m, D) ∈ P([0, 1] × I ) × C 0 ([0, T ] × I , R * + ) satisfy supp( mi ) ⊂ (0, 1), for any i ∈ I , and where the constant ε 0 > 0 is defined further in Assumption 3. In the mean field limit model, the system is described by a pair (m, , defined on the domain (0, T ) × (0, 1) × I : (2.9) In the PDE above, the distribution m evolves through the effects, on the one hand, of an advection term, taking into account the displacement induced by the charging rate b, and on the other hand, of a reaction term, induced by the measure E of the jumps of the discrete variable.We introduce the density constraint: and the admissible set and satisfies (2.10) . (2.11) The definition of weak solution of (2.9) is given by Definition 3.1 in Sect.3. The objective function J is defined for any (m, E) ∈ S( m, D) by: (2.12) The mean field control problem is: This problem has been studied in [49], where optimality conditions and regularity results on the solutions are established.The main result of the paper, giving the convergence of Problem (2.7) to Problem (2.13), is described in the next section.

Remark 2.3
The dynamics of each agent in the mean field control problem (2.13) is a Piecewise Deterministic Markov Process (PDMP for short) [20], with jump intensity α, where for any i, j ∈ I , α i, j := dE i, j dm i .The state of each PEV at time t is denoted by (i t , s t ), where (i t ) t∈[0,T ] is a jump process with values in I switching spontaneously, at jump times {t k } k∈N given by a Poisson process with intensity α, while (s t ) t∈[0,T ] follows a deterministic dynamics between two consecutive jumps and is a solution of an ODE driven by the function b.We highlight that while the dynamics (2.2) of the PEVs in the finite population problem (2.7) is deterministic, the dynamics in the mean field control problem (2.13) is stochastic, which is an unnatural feature.

Convergence Result
Throughout the paper, we assume the following: General assumptions For any n ∈ N and i ∈ I , we assume that mn ∈ P n [0, 1] × I and supp( mn i ) ⊂ (0, 1). 3. There exists ε 0 > 0 such that, for any n ∈ N, ε 0 ≤ inf ) is an increasing strongly convex function, bounded from above by a quadratic function, i.e. there exist C > 0 such that for any x ∈ R + : where the first inequality is due to the strong convexity of l.By convention: 4 The main role of Assumptions 1 and 2 is to ensure that the solution of the ODE in (2.2) takes values in [0, 1].In addition, the superposition principle formulated in Sect. 3 relies on the regularity of b stated in Assumption 1. Assumption 3 ensures that the n trajectories with no switch of discrete variable i are admissible trajectories.Correspondingly, the feasible set T n ( m, D) of Problem (2.7) is not empty.This assumption also enables to build in Section 4.2 admissible trajectories based on a solution of the mean field control problem.It is possible to replace Assumption 3 by less restrictive conditions.However, for the sake of clarity, we restrict the analysis to the case with Assumption 3. Regularity results of the solution of the mean field control problem (2.13) are derived from the properties of c, g and L given in Assumptions 4 and 5. Assumption 5 enables to obtain the compactness of the solutions of the finite population problem and to apply -convergence techniques in Sect.4.1.

Remark 2.5
The definition of J n in (2.6) does not take into account the jumps of PEVs with SoC equal to 1.However, by Assumptions 1 and 2 it is not possible for a PEV to have a SoC equal to 1, which justifies our choice.
In the following theorem, we state the convergence of the value of Problem (2.7) to the value of Problem (2.13) as n tends to infinity.
hold for any n ∈ N * , then,

16)
2. There exists C > 0 such that for any n ∈ N: where C depends on the data, including C1 and C2 .
The proof of Theorem 2.1 is given in Sect.4.3.To obtain this result, an Eulerian formulation of Problem 2.7 is introduced and proved to be equivalent to Problem 2.7 (Corollary 3.1) thanks to a superposition principle (Proposition 3.1).Then, the first part of Theorem 2.1 is obtained in Sect. 4 by applying compactness arguments on the sequences of solutions of the Eulerian problem, while the second part directly derives from Proposition 4.2.Inequality (2.17) relies on regularity results of the solution of Problem (2.13), that are used to build an admissible control for the Eulerian version of Problem 2.7.

Remark 2.6
Improving the qualitative inequality (2.16) into a quantitative one, as in (2.17), seems a difficult task.The main difficulties come from the constraint (2.4) and the lack of regularity of the objective function J n w.r.t. to the set of trajectories (s, i).
For any n ∈ N, let (i n , s n ) ∈ T n ( mn , D) be a solution of Problem (2.7).We define the empirical distribution of the processes m n and the empirical measure of the switches E n by: and

Equivalence Between Eulerian and Lagrangian Finite Population Control Problems
In this section, an Eulerian formulation of Problem (2.7) is introduced.The equivalence between the Lagrangian and the Eulerian formulation relies on a superposition principle, adapted to the problem and stated in Proposition 3.1. and The two constraints above are used to characterize the empirical distribution m of the set of processes {(i , s )} 1≤ ≤n and to characterize the distribution of the jumps E associated to {i } 1≤ ≤n .Constraint (3.1) implies that the support of E is concentrated on the nodes of the time mesh.Thus, the jumps only occur at times in the set {t 1 , . . ., t N n T −1 }.Constraint (3.2) ensures that the number of switches does not exceed the number of vehicles at each time and position.
Finally, for any n ∈ N and m ∈ P n [0, 1] × I , we define the set Q n ( m) by: such that (m, E) is a weak solution of (2.9) with initial distribution m, (m, E) satisfies (3.1) and (3.2), and where M n ([0, 1]) is defined in (2.1).The proposition below is the main result of this section.It highlights the equivalence between the Lagrangian and the Eulerian points of view, when describing the evolution of the system of n PEVs.It is a reminiscent of the empirical superposition principle [11], where it is stated for time continuous curve of probabilities.The following proposition extends this result for time discontinuous curve of probabilities.We stress that the processes (i,s) in 2 is not necessary unique.The proof of the theorem is given in Sect.3.2.

Eulerian Problem Formulation
In this subsection, we describe the Eulerian formulation of the optimal control problem and show that it is equivalent to the Lagrangian Problem (2.7).We define, for any m ∈ P n [0, 1] × I and D ∈ C 0 ([0, T ] × I , R * + ), the set S n ( m, D) by: m i for any i, j ∈ I and we show below that m is continuous in time.On the other hand, if (m, E) belongs to S n ( m, D) and E = 0, then by (3.1) E i, j is supported by a set of discrete times (and therefore E i, j m i cannot hold); moreover m is discontinuous w.r.t. the time variable.
For any n ∈ N, we define the cost function J n , for any (m, E) ∈ S n ( m, D) by: For any n ∈ N, we consider the optimization problem: The following corollary is a direct consequence of Proposition 3.1.
Using Proposition 3.1.2and similar computations as in the first part of this proof, one can obtain the reverse inequality: and the conclusion follows.
and the conclusion follows.

Construction of n PEVs Trajectories from a Couple of Measure (m, E)
In this subsection, we prove the converse result of Sect.
3), we show that there exists (i,s) ∈ X n ( m) such that m, the empirical distribution of (i,s), satisfies (2.18) and E, the empirical distribution of the jumps, satisfies (2.19).Due to the measure E in the right hand side of the continuity equation (2.9), one can not directly apply the empirical superposition principle [11,Theorem C.1] to obtain the existence of n processes whose empirical distribution is m.However, because of the condition on the support of E in (3.1), there is no jumps during each interval (t k , t k+1 ).Thus, the empirical superposition principle can be used on any of these intervals, stating the existence of n processes {(s k, , i k, )} ∈{1,...,n} such that m is equal to the empirical measure of this population of processes over the interval (t k , t k+1 ).This result is given in the following lemma.
Proof By Lemmas 3.3 and 3.2, summing (3.8) over I one deduces that, for any t ∈ (t k , t k+1 ), where z is defined in Lemma 3.3.Since z is continuous at t k+1 and, s k, and s k+1, are respectively cadlag on [t k , t k+1 ] and [t k+1 , t k+2 ], the previous equality holds for t = t k+1 and gives the result.

Lemma 3.5
The measure E satisfies for any i ∈ I and any k ∈ {1, . . ., N n T − 1}: For any i ∈ I , even though (t, s, j) it can be considered as a test function for the Eq.(2.9) because On the one hand, using the dominated convergence theorem one has: On the other hand, one gets: Since m is cadlag, one obtains by considering the limit ε → 0 in the previous equality: Therefore, by considering the limit ε → 0 in the left hand side of equality (3.14), one has: Since ϕ is arbitrary, equality (3.13) is satisfied.

Remark 3.3
For some s ∈ [0, 1] and i, j ∈ I , the sets T k,+ i, j (s) or T k,− i, j (s) can be empty.We maintain the terminology of "partition" in this case for the sake of simplicity.
The set R k,− i (s) represents the set of indices of processes defined in Lemma 3.2 that have a state equal to (i, s) at time t − k , just before a possible jump, while R k,+ i (s) represents the set of indices of processes with a state equal to (i, s) at time t k .By the definition of R k,− i (s) and R k,+ i (s), and by Lemma 3.4, we have, for any k ∈ {1, . . ., ) (3.17) Hence, {R k,− i (s)} i∈I ,s∈[0,1] and {R k,+ i (s)} i∈I ,s∈[0,1] are partitions of {1, . . ., n}.The rest of the proof consists in constructing the sets T k,− i, j (s) j∈I and T k,+ i, j (s) j∈I that are respectively a partition of R k,− i (s) and R k,+ i (s).We define, for any s ∈ [0, 1], i, j ∈ I with j = i, c k i, j (s) := n E i, j (t k , {s}). (3.18) We define, for any i ∈ I , c k i,i (s) := nm i (t k , {s}) − j∈I , j =i c k j,i (s).By Lemma 3.5, one has: where the inequality is obtained by Sorting the elements of R k,− i (s) and R k,+ i (s) in ascending order, we can now define the collections of subsets T k,+ i, j (s) i, j∈I , s∈[0,1] and T k,− i, j (s) i, j∈I , s∈[0,1] .For any i ∈ I and s ∈ [0, 1], T k,− i, j (s) and T k,+ i, j (s) are defined iteratively for j = 1, . . ., |I |: T k,− i,q (s) and T k,+ i, j (s) is equal to the set of the c k i, j (s) with smallest we used the convention 1≤q<1 T k,− i,q (s) = 1≤q<1 T k,+ i,q (s) = ∅.By (3.20) and their construction, the sets T k,+ i, j (s) j∈I and T k,− i, j (s) j∈I are well defined and are respectively a partition of R k,− i (s) and R k,+ i (s).Since {R k,− i (s)} i∈I ,s∈[0,1] and {R k,+ i (s)} s∈[0,1] are both partitions of {1, . . ., n}, the conclusion follows.
Proof Let σ k ∈ S(n) be such that, for any s ∈ [0, 1] and i, j ∈ I , if c k i, j (s) > 0, the restriction of σ k to T k,− i, j (s) is a bijective map from T k,− i, j (s) to T k,+ i, j (s), where T k,− i, j (s) and T k,+ i, j (s) are defined in Lemma 3.6.The existence of such a permutation is guaranteed by the properties of T k,+ i, j (s) i, j∈I , s∈[0,1] and T k,− i, j (s) i, j∈I , s∈[0,1] established in Lemma 3.6.By the construction of σ k , one deduces that, for any non empty set T k,− i, j (s), where R k,+ j (s) and R k,+ j (s) are defined in the proof of Lemma 3.6.Finally, one has, for any s ∈ [0, 1] and i, j ∈ I , The next lemma shows the existence of n processes, such that m is the empirical measure of these processes and E is the empirical measure of the jumps of the processes.
We are now able to prove Proposition 3.1.

Proof of Proposition 3.1
This is a direct consequence of Lemmas 3.1 and 3.8.

The Convergence Result
This section is devoted to the proofs of Theorem 2.1.1,reformulated in Proposition 4.1 and proved in Sect.4.1, Theorem 2.1.2reformulated in Proposition 4.2 and proved in Sect.4.2, and Corollary 2.1 proved in Sect.4.3.We assume in this section that the time and space parameters t and s are such that (2.14) and (2.15) are satisfied.

0-Lower Limit Result
We reformulate the first result of the paper, Theorem 2.1.1 in Proposition 4.1.Proposition 4.1 For any sequence { mn } n weakly converging to a measure m ∈ P([0, 1] × I ) and satisfying Assumptions 2 and 3, we have: The rest of this subsection is dedicated to the proof of Proposition 4.1.The proof is based on Lemmas 4.1 and 4.2, for which we need the following preliminary results.By Corollary 3.1 and Remark 3.2 we know that there exists a sequence The proof of Proposition 4.1 relies on the existence of a limit point (m * , E * ) of the sequence {(m n , E n )} n that belongs to the set S( m, D).By inequality (2.8), we have i, j∈I the constant C 0 > 0 only depends on T , c ∞ and g ∞ .Inequality (4.2) implies that {E n i, j ([0, T ] × [0, 1])} n is uniformly bounded.Indeed, let t, t ∈ [0, T ], with t ≤ t.If there is no t q ∈ {0, . . ., k t, . . ., T } satisfying t ≤ t q ≤ t, then by (3.1) (4.3)where the two last inequalities are obtained by Assumption 5 and inequality (4.2).Taking t = 0 and t = T , one obtains: C > 0 is a constant that depends on Assumption 5 and on C 0 .By (4.4), there exists a limit  In addition, (m * , E * ) is a weak solution of (2.9) with initial data m, and it satisfies (2.10).
Proof Let φ ∈ C 1 ([0, 1] × I ) be 1-Lipschitz continuous.Since (m n , E n ) satisfies the continuity equation (2.9), one has, for any t, t ∈ [0, T ] and n ∈ N, Since φ is 1-Lipschitz continuous, by Cauchy-Schwarz inequality and (4.3), one has for a constant C > 0, independent of n, t and t.Further, using that, for any τ ∈ [0, T ], m n (τ ) is in P([0, 1] × I ), one observes that, Thus, by the two previous inequalities, one has, for any t, t ∈ [0, T ] and n ∈ N, By adapting the Arzelà-Ascoli Theorem, one can deduce the existence of m * : Proof We define for any n ∈ N and i, j ∈ I , the curve of measure mn : [0, T ] → P([0, 1] × I ) by: By the uniform weak convergence of {m n } n to m * in Lemma 4.1 and the definition of mn , one can show that for any t ∈ [0, T ], { mn (t)} n weakly converges to m * (t) in P([0, 1] × I ).For any n ∈ N and i, j ∈ I , we introduce α n i, j : [0, T ) × [0, 1] → R + : where t ∈ [t k , t k+1 ) and s ∈ [y p , y p+1 ),

123
and we define the measure Ẽn i, j on [0, T ]×[0, 1] by: Ẽn i, j (dt, ds) := α n i, j mn i (t, ds)dt.One can observe that: Using the previous equality and (4.4), { Ẽn i, j } n is tight.Thus, there exists a measure Ẽi, j such that a subsequence of { Ẽn i, j } n weakly converges to Ẽi, j .We define the function m i and α i, j := dEi,j dmi with α i, j ≥ 0, +∞ otherwise.
The function is convex and l.s.c.w.r.t. the weak topology in We have: where the constant C 0 > 0 is defined in (4.2).Using that (m n i , Ẽn i, j ) weakly converges to (m * i , Ẽi, j ) and by the previous inequality, one deduces that (m * , Ẽ) ≤ C 0 and thus, for any i, j ∈ I : Ẽi, j m * i .We now prove that Ẽi, j = E * i, j by showing that Ẽn i, j − E n i, j weakly converges to 0 in . By the definition of Ẽn and (4.4) one has Ẽn Using (4.4) and the property on the support of E n in (3.1), we have: Since ϕ is continuous, for any k ∈ {0, . . ., N n T − 1} and p ∈ {0, . . ., N n s − 1}, there exists By previous inequality and by (4.4), equality (4.8) becomes and therefore W( Ẽn i, j , E n i, j ) → 0. We deduce that E * i, j = Ẽi, j and we can define the Radon-Nikodym derivative α * i, j := We can now prove Proposition 4.1.

Proof of Proposition
and the conclusion follows.

Upper Bound of the Value of the Finite Population Problem
We reformulate the second main result of this paper, Theorem 2.1.
Proposition 4.2 provides an upper bound on the value of (2.7).Note that the constants in this theorem depend on ε 0 (defined in Assumption 3) and not on the choice of the sequence { mn } n .To prove this theorem, we first show in Sect.4.2.1 how to implement an optimal control of the mean field control problem to a finite population of PEVs, such that the constraint (2.4) is satisfied (Corollary 4.1).Then, in Sect.4.2.2 we give an estimate of the Wasserstein distance between the resulting empirical distribution of the finite population of processes and the mean field distribution.Finally, we finish the proof of Proposition 4.2 in Sect.4.2.3.

Transfer Procedure for a Finite Number of PEVs Using a Mean Field Control
The goal of this subsection is to present how a bounded mean field control α can be implemented for a finite population of PEVs.We provide a convergence rate of the empirical distribution to the mean field distribution.Let us fix a sequence { mn } n of initial distribution in (2.9) satisfying Assumptions 2 and 3. We highlight that, all the constants in this section depend on ε 0 and not on the choice of the sequence { mn } n .
Let N ∈ N be such that, where C * > 0 is introduced later in (4.17 By the previous inequality and [49, Theorem 2.1], we have ) and, for any (i, j, t, s) where where by [49,Remark 4.5], upper bounds on ϕ n ∞ and ∂ s ϕ n ∞ depend on the data of the problem and on λ n ([0, T ] × I ).Since (4.11) is satisfied for any n > N , there exists C > 0 that depends on ε 0 , such that, for any Transfer procedure We consider n > N PEVs with an initial state distribution mn .At each time step t k ∈ { t, . . ., t(N n T − 1)} and for any p ∈ {0, . . ., N n s − 1}, we apply the following steps: , the set of indices of PEVs in the mode of charging i ∈ I with a SoC in the range [y p , y p+1 ) at time t k , and set N k, p i ).
• The number of PEVs in V k, p i transferred from the mode of charging i ∈ I to the mode j ∈ I at time t k is denoted by a n i, j (k, p) and is defined by: . The transferred vehicles are the ones with the lowest indices.We denote by T k, p i, j the set of indices of the transferred vehicles.We have: 1 By inequalities (2.15) and (4.13), one has, for any n > N , t ≤ i .Thus, the maximal amount of PEVs with a state in {i} × [y p , y p+1 ) that can be transferred is bounded by the total number of PEVs with a state in i × [y p , y p+1 ).Remark 4. 2 One can observe that PEVs with a SoC equal to 1 are not taken into account in the transfer procedure given above.This is without consequence because, following Remark 2.5 and Assumption 2, there is never a PEV with a SoC equal to 1.
Recall that mn ∈ P n [0, 1]× I is the initial distribution of the states of the population of PEVs.The procedure defined above enables us to construct a unique set of n processes {(i , s )} ∈{1,...,n} ∈ X n ( mn ).For any ∈ {1, . . ., n} and t ∈ [0, T ], i t and s t denote respectively the mode of charging and the SoC of the th PEV at time t.By Proposition 3.1, the pair (m n , E n ) defined by (2.18) and (2.19) belongs to Q n ( mn ).
There exists a pair (m n , E n ) ∈ Q n ( mn ) that is the empirical distribution of the states of the population of PEVs and of the jumps and that satisfies (2.18) and (2.19).In addition, the following equalities hold, for any k ∈ {0, . . ., N n T −1}, p ∈ {0, . . ., N n s − 1} and i, j ∈ I , The theorem below gives an estimate of the Wasserstein distance between m * ,n and m n .We postpone the proof to Sect.4.2.2.As we show below, the rate n − 1 3 in right hand-side of (4.16) comes from inequality (2.14).
The next result shows that the previous theorem enables us to find strategies, based on a mean field optimal control, satisfying the constraint (2.4).We now set: where C > 0 is the constant defined in Theorem 4.1.
Corollary 4.1 One has, for any n ≥ N , Proof Let i ∈ I and ψ, the 1-Lipschitz continuous function defined, for any (s, j) ∈ [0, 1] × I , by Then, we find that by the definition of the Wasserstein distance W, Rearranging the terms and adding D i (t) in both side of the previous inequality, one observes that By Theorem 4.1 and since (m , one deduces, for any The conclusion follows from the previous inequality and (4.17).

Proof of Theorem 4.1
We start by stating some preliminary results.
Proof This lemma is a direct consequence of the proof of Lemma 3.1.
We introduce mn ∈ L where we used that     We recall that there is no transfer at time t 0 = 0 in the transfer procedure described in Sect.4.2.1.Thus, to find an upper bound of (4.26), two cases are considered below: k = 0 and k ∈ {1, . . ., N n T − 1}.
• If k = 0, we have, for any i, j ∈ I and p ∈ {0, . . ., where the constant C > 0 is defined in (4.13). (4.28) By the Lipschitz continuity of ϕ, the definition of a n i, j (k, p) and inequality (4.13), one gets: Using the previous display, inequality ( where the constant C depends on C, T and |I |.

.32)
Proof Lemmas 4.4 and 4.5 can be easily extended to any t ∈ (0, T ], giving: Inequality (4.32) is a direct consequence of the two previous inequalities.

Remark 4.3
The term T n s t on the r.h.s. of the inequality in Lemma 4.6, implies to choose carefully the time and space steps, depending on the number of agents n.To this end, inequality (2.14) crucial.
Remark 4. 4 The condition (2.14) on the time and space steps t and s in Theorem 2.1 can be replaced by a less restrictive one.Indeed, if there exist γ > 0 and θ > 0 such that γ + θ < 1 and then, the convergence rate in the right hand side of inequality (4.24) in Lemma 4.5 would satisfy: Optimizing with respect to γ and θ in the right hand side of the above equality gives condition (2.14).
We can now prove Theorem 4.1.

Proof of Theorem
By applying the method of characteristics, the solution ϕ of (4.33) satisfies, for any where S t,s i is the unique solution of the ODE below One can show that, for any τ, t ∈ [0, T ] and s ∈ [0, 1], |∂ s S τ,s i (t)| ≤ e T b ∞ .Then, one has ϕ ∞ = ψ ∞ , and denoting by γ ψ the Lipschitz constant of ψ, for any t ∈ [0, T ] ϕ i (t, •) is Lipschitz continuous with Lipschitz constant γ ψ e T b ∞ .Since (m * ,n , E * ,n ) is a weak solution of the continuity equation (2.9) with initial distribution mn , and ϕ a classical solution of (4.33), using that α n i, j = dE * ,n i, j dm * ,n i , we have: From Lemma 4.6, we have, for any t ∈ (0, T ]: From the previous equality and inequality, one deduces: . From the previous inequality and Theorem 4.1, using that g ∈ C 1 ([0, 1] × I ), c ∈ C 1 ([0, T ] × [0, 1] × I ) and the definition of J n and J , one has: .
We now turn to the proof of Proposition 4.2. .

Proof of
By the previous inequality and Lemma 4.8: One can consider a constant C > 0 large enough such that previous inequality holds for any n ∈ N * .

Proof of Corollary 2.1
In this section we provide a proof of Corollary 2.1, based on the results obtained above in Sect. 4.

Proof of Corollary 2.1
The convergence of a subsequence of {(m n , E n )} to (m * , E * ) is given by Lemma 4.1.One that (m * , E * ) is optimal for Problem (2.13) by Theorem 2.1 and the proof of Proposition 4.1 .

1 3.
).For any n ∈ N, we consider (m * ,n , E * ,n ), a minimizer of J over the set S mn , D − C * /n We define α n by α n i, j := dm * ,n i dE * ,n i, j , for any i, j ∈ I .By Assumption 3 and the definition of N in (4.10), one has for any n ≥ N , and (i, t) ∈ I × [0, T ],

1 3 . ( 4 . 45 ) 3 ≤
(m,E)∈S( mn ,D) J (m, E) + C + C L C * n By Corollary 4.1, one has for any i ∈ I , t ∈ [0, T ] and n ≥ N , that:0 ≤ D i (t) − m n i (t, [0, 1]), yielding that (m n , E n ) ∈ S n (mn , D).It follows from Corollary 3.1 and inequality (4.45) that there exist N , C > 0 such that, for any sequence { mn } n in P n [0, 1] × I satisfying Assumptions 2 and 3, one has, for any n > N , inf (i,s)∈T n ( mn ,D) J n (i,s) − C n 1 inf (m,E)∈S( mn ,D) J (m, E). (4.46) , y p+1 ) × {i} that switch their discrete state i to j at time t k , and Q where m is the distribution of the hybrid state of the infinite population of PEVs, and E is the measure of the switches of the discrete state variable among the population over the time.More precisely, for any i, j ∈ I , interval I ⊂ [0, T ] and subset A ∈ B([0, 1]), the quantity E i, j (I, A) counts the number of jumps of the discrete state variable from i to j of PEVs having a continuous state variable s in A, during the time interval I.We consider the continuity equation on the pair For any n ∈ N, m ∈ P n [0, 1] × I , and (m, E) ∈ Q n ( m), there exists (i,s) ∈ X n ( m), such that m satisfies(2.18)andEsatisfies(2.19).

2 Proof of the Superposition Principle 3.2.1 Construction of the Empirical Distribution and of the Jump Measure from n PEVs Trajectories
19oof Using the definition of E n in (2.19) and m n in (2.18), (3.1) and (3.2) hold.We now show that (m n , E n ) is a weak solution of (2.9).Since, for any ∈ {1, . . ., n}, the function t → (i , s ) is cadlag, one has 19mark 3.2 By Remark 2.2, there exists a solution to Problem (2.7).Thus, by Proposition 3.1 and Corollary 3.1, there exists a solution to Problem (3.6).3.In this section, we fix n ∈ N * , m ∈ P n [0, 1] × I and (i,s) ∈ X n ( m), where X n ( m) is defined in (2.3).Lemma 3.1The pair (m n , E n ) defined in(2.18) and (2.19) from (i,s) is a weak solution of (2.9) and satisfies (3.1) and (3.2).
Since the dynamics (2.2) implies that the processes {s } ∈{1,...,n} are time continuous, we first need, for any k ∈ {0, . . ., N n T − 1}, to understand the connection between {s k, } ∈{1,...,n} and {s k+1, } ∈{1,...,n} at time t k+1 .To this end, we define m : [0, T ] → P([0, 1]) by: m(t) := i m i (t), that can be understood as the marginal distribution of the continuous variable s of the distribution m.The next lemma states an empirical superposition principle for m.There exists {z } 1≤ ≤n such that, for any ∈ {1, . . ., n}, z ∈ AC([0, T ], [0, 1]) is solution of: t ) for a.e.t ∈ [0, T ], By (3.1)and Cauchy-Schwartz inequality, one has: Hölder continuous in time w.r.t. the distance W and, such that, up to a subsequence, {m n } n uniformly converges in time to m * w.r.t. to W. Finally, since (2.9) and (2.10) are linear w.r.t. the couple (m, E) and that, for any n ∈ N, (m n , E n ) is a weak solution of (2.9) and satisfies (2.10), one can deduce, by the respective weak convergence of (m n , E n ) and { mn } n to (m * , E * ) and m, that (m * , E * ) is also a weak solution of (2.9) with initial distribution m, and satisfies (2.10).We want to show that the limit point defined in the previous lemma (m * , E * ) of the sequence {(m n , E n )} n belongs to the set S( m, D).To this end, we need to prove that E * is absolutely continuous w.r.t. the measure m * .This property is stated in the next lemma.Lemma4.2For any i, j ∈ I , E * i, j is absolutely continuous w.r.t. the measure m * i .Denoting by α * i, j the Radon-Nikodym derivative of E * i, j w.r.t. the measure m * i , we have α There exist C > 0 such that, for any sequence { mn } n in P n [0, 1]× I satisfying Assumptions 2 and 3, one has, for any n ∈ N * , inf (i,s)∈T n ( mn ,D) [49,H is the Fenchel conjugate of L (that is defined in Assumption 5) and H the derivative of H .By Assumption 5, H is Lipschitz continuous on R and thus, α n is Lipschitz continuous in space uniformly in time.By[49, Lemma 5.3], the upper bound of λ n ([0, T ]× I ) only depends on ε 0 in(4.11)and on the data of the problem.In addition, by [49, Theorem 2.1], for any n ∈ N * , there exists defined, for any i, j ∈ I , t ∈ [t k , t k+1 ) and s ∈ [y p , y p+1 ), by: for any t ∈ [t k , t k+1 ) and s ∈ [y p , y p+1 ).Lemma 4.4 There exists C > 0 such that for any n ≥ N and any function ϕ ∈ C 0 ([0, T ] × [0, 1] × I ) and i ∈ I , we have: i (t, s)ds dt ≤ C ϕ ∞ ( s + t).
inequality is deduced by the fact that, if s t k ∈ [y p , y p+1 ), then |s t − y p | ≤ ( s + t b ∞ ) for any t ∈ [t k , t k+1 ).Summing the previous inequality