MODELING OF ELECTRIC VEHICLES FLEET’S CHARGING USING PARTIAL DIFFERENTIAL EQUATIONS

Resume With an increasing number of electric vehicles, their impact on electrical power systems is starting to be substantial. High deployment of these vehicles can even bring issues such as overloading the power transformers and power lines or loss of stability in the power system. Therefore, a suitable model, able to represent large groups or fleets of electric vehicles


ISSN 1335-4205 (print version) ISSN 2585-7878 (online version)
is the topic of electric vehicle charging. On the one hand, it is necessary to build more charging stations with the growing number of EVs and on the other hand, it is necessary to consider increased electricity consumption. From a global point of view, it is an uncontrolled load that is constantly changing and thus the necessary measures need to be taken to prevent overloading of the network or loss of a stability [3].
To define an appropriate measure to decrease the impact of EVs on the grid, it is necessary to predict the consumed power of the EVs charging. To be able to predict the consumed power of the EVs, the charging models and connection/disconnection times of the EVs need to be determined. Connection and disconnection times of EVs are related to behavior of the vehicle owners and this is not addressed in this paper. However, other works deal with this topic, e.g. in [4][5][6]. The model of EV charging is based on the battery parameters. There are many different types of battery charging models based on their application and required accuracy [7]. However, most of these models consist of one or more differential or nonlinear equations. It increases the computational complexity of these models, even more, if a group or a fleet of EVs is assumed.

Introduction
Nowadays, there is an accelerating trend of global air and ocean temperature growth. The cause of this acceleration is the constant growth of society's consumption, which is associated with greenhouse gas emissions to the atmosphere. Transportation accounts for 30 % of total carbon dioxide emissions in the European Union, thereof road transport accounts for up to 72 % of these emissions. That is not a negligible share. Therefore, it will be necessary to reduce these emissions within several years, not only in the European Union but at the global level, as well [1].
The solution is to reduce mobility or replace internal combustion engines with a more environmentally friendly alternative. This alternative is usually assumed to be the electric motor drive powered by the accumulator. However, electric vehicle (EV) production and operation also produce carbon oxide emissions, but on a lower scale. Electric vehicle emissions are linked mainly with its production, especially batteries and emissions produced by the power generation for battery charging supply [2].
With deployment of electric vehicles, many questions and technical challenges arise. Among these challenges physical-chemical relationships. The basis of the models is the use of measured battery data. Empirical models are significantly simpler compared to other models; computations of these models are simpler and faster. They are used to simulate the state of charge and state of battery degradation in real time. The disadvantage is the lower accuracy of the output values [7,10].
Empirical models include the universal model [10][11], the Nernst model [12], the Shepherd model [10] and the model of the equivalent circuit with polynomial equations [9].

Electrochemical models
Electrochemical models, based on the principle of internal phenomena in a battery, are very accurate. The electrochemical model of a battery is defined by several partial differential equations that describe the movements, concentrations of ions, and other chemical properties of a battery. The input data to these models are obtained by experimental measurement [12]. However, electrochemical models are difficult to compute, so simulations can take a long time. They are used when high accuracy of a battery model is required and to simulate battery behavior over a longer time horizon [7,9].

Physical, molecular models
Physical and molecular models are extensions of electrochemical models. They describe phenomena in the electrolyte, chemical changes of the electrodes and many other phenomena. They express the charging process as a more complex process, taking into account the movements of particles in all directions. So, these models can be two or even three-dimensional. Computations of these models are demanding because of the large number of time-and space-varying variables described by PDEs. However, their accuracy is high and so they are often used as reference models. Physical models include a P2D porous electrode model, a P3D thermal model, a P2D strain and stress model and a P2D population balance model. The abbreviations 1D, 2D and 3D after P in the model's name represent the dimensions of the model [13].

Electric models
These models describe the electrical quantities of the battery, i.e. its volt-ampere characteristics. The models are based on the data provided by the battery manufacturer -nominal capacity, internal resistance, voltage, charging current, polarization voltage, the amplitude of the exponential zone and inverse time Therefore, this work defines a charging model of a fleet of EVs as one unit using partial differential equations (PDE). A similar model, defined using PDEs, was already presented in [8], however, it assumes controlled charging or discharging of EVs. The presented model is more general and can be used to predict the consumed power of the charging EVs even if the charging is uncontrolled. Moreover, the comparison of the presented model with the commonly used electrical model for battery charging was carried out in this paper.
So, this paper is focused on definition of a charging model of a fleet of EVs, able to predict the consumed power of charging EVs and demonstrate its properties. Moreover, the defined model can be scaled from small EV fleets to fleets consisting of thousands or more of EVs without increasing the computation times. So, this definition of a charging fleet model allows to easily study the impact of EV charging on the power network, e. g. define hosting capacity for electric vehicles in a specific power network or increase in total consumption in a specific electric power system.
The contributions of this manuscript are twofold: • a definition of a charging model representing the consumed power of a fleet of EVs with uncontrolled or controlled charging; • a definition of a charging model that is able to scale from small EV fleets to large ones without increasing the computation times. The rest of the paper is organized as follows. Section 2 presents the commonly used charging models and specifically the electric model that is later used for comparison with model defined in this paper. Section 3 defines the model of the EV fleet described with PDEs. The simulation of the created model and the comparison with the electric model are carried out in section 4. Section 5 concludes the paper and suggests future work.

EV charging models
The basis of the EV charging model is the battery charging model. There are many battery models and each has its advantages and disadvantages, so it is necessary to choose a suitable model to represent EV charging [7]. According to [9], medium-term battery models can be divided, according to different modeling perspectives and techniques, as follows [9]: • empirical models. • electrochemical models, • physical, molecular models and • electric models -equivalent circuits models.

Empirical models
The principle of operation of these models is to describe the battery charging function without using The voltage drop is positive during charging and negative during discharging. Since we are examining the battery as a whole, it is necessary to convert cell voltages U t , U OC and resistance R v to battery U pack , U OCekv and R ekv as shown in Figure 2 [14].
The EV battery charging takes place in two phases. First, it is charged with a constant current, the voltage is slowly increased until the limit value is reached. The power consumed from the network P AC and the power supplied to the battery P DC are determined as [14]: where U C is the network voltage (V) and i C is a current consumed from the network (A). Since U pack is dependent on the SOC of the battery, then P AC is dependent on the SOC, as well. The power consumed from the network can be expressed [14]: while the relationship between the power consumed from the network and the charging power delivered to the battery is [14]: constant of the exponential zone. Such a model is described in detail as it is used for comparison with the charging model of a fleet of EVs defined in this paper. The basis of the battery model is a battery cell model and its equivalent circuit, as shown in Figure 1. This circuit consists of a controlled voltage source U OC in series with the internal resistance of the battery cell R v . The battery voltage is denoted by U t [14].
The state variable of this model is the state of charge (SOC) of a battery, which is given by [14]: where Q nom is a nominal capacity of a battery (Ah) and Q is a current capacity of a battery (Ah). Neglecting losses in the battery during charging, one can express the time change of the state of charge as [14]: where i is a charging/discharging current (A). The open-circuit voltage U OC is expressed as [14]: where U K is a constant battery voltage (V), K is a polarization voltage (V), A is the amplitude of the exponential zone (V) and B is an inverse time constant of the exponential zone (Ah -1 ). Then, the battery cell voltage U t can be easily derived by adding the voltage drop due to the internal impedance R v [14]: is expressed in per unit (pu) and is represented by the variable x. The number of EVs that are in the charging state, with SOC equal to x at time t, is represented as u(x,t). The number of EVs that are in the idle state with SOC equal to x at time t is denoted as v(x,t) [16][17].
The EV transition between individual discrete states is determined by the variable σ. In the upper part of Figure 5, the EV transits from the idle state to the charging one is given by the variable σ i →c . At the bottom of Figure 4, σ i →po determines the EV movement between the idle state and the state when the EV is disconnected from the charging station (EV arrival to/departure from the charging station) [16][17].
After connecting the EV to the charging station, the model assigns the EV automatically into the idle state. If its SOC is lower than 1, the EV is transited to the charging state. If SOC becomes 1, which means the EV is charged, the EV goes into the idle state unless it is disconnected from the charging station. By disconnecting from the charging station, an EV goes into an undefined driving state when the EV is being discharged. This condition is not modeled in the simulation, it is considered that EVs can be randomly connected and disconnected from the charging station [16][17].

Derivation of the model
The basis of the aggregated model is the EV battery charging model that was described in section 2.4. In this model, for simplicity, the SOC is denoted by x i , where i expresses the i th EV [16][17].
The required energy for the EV fleet charging at the time t is given by [16][17]: where h is a charger efficiency (-).
In the case of constant voltage charging, it is not possible to control the P AC or i C . The only controlled quantity is the voltage U pack , which is kept at a constant value until the SOC level of 100 % is reached.
The comparison of the accuracy and computation time complexity of the presented types of models is shown in Figure 3.

Charging model of a fleet of EVs
The charging of one EV can be described by different models, as shown in section 2. However, modeling a fleet of several thousand EVs separately using these equations would represent a large computational burden. However, the relations describing the EV fleet can be simplified by an aggregation method [15]. A model using the aggregation method expresses a group of EVs as a whole and describes it by one or more PDEs. The EVs in such models are expressed as functions of their current SoC and time [16][17].
The simulation of the EV fleet is expressed using the two interconnected continuous PDEs. However, the EV fleet can acquire two discrete states [16][17]: • charging, when the EV is charging and so represents a load for the grid, • idle, when the EV battery is already fully charged but is still connected to the grid. Individual discrete states are expressed using hyperbolic PDEs. These PDEs are interconnected using transition variables describing the transition of the EVs between individual discrete states, from the state of charging to the idle state and vice versa. The dynamic of these states is shown in Figure 4. The SOC of an EV charged in an infinitesimal segment between x and x+dx is considered. The flow of charged EVs at time t with SOC x is expressed through the function F(x,t) as [16][17]: , where Equation (12) describes the incoming flow of EVs with SOC corresponding to x at time t and Equation (13) defines the outgoing flow of EVs whose SOC is already larger and corresponds to x+dx at a certain time t. An additional increase in the number of EVs in this segment (dx) can also be given by the transition of EVs with SOC equal to x at time t, which come from the idle to the charging state, denoted by σ i →c (x,t). Figure 5 shows the approximate amount of total number of EVs The aggregation method can be used to express the PDE since dx/dt is linearly proportional to the charging power. In the model, the parameters of the battery and the efficiency of the charger η are assumed as homogeneous in the EV fleet.
The amount of EVs that are charged is denoted by u(x,t) and their SOC is x(t). The charging rate at x is noted as q c (x,t). Charging rate q c (x,t) is given by the change of the SOC over time, which is expressed by the battery charging model as in section 2.4. Simply, it can be expressed as [15,17]: , To derive the model, the dynamics of the EVs Figure 4 The dynamic of the two defined discrete states used to solve this model. The Lax-Wendroff method is a numerical method, so it finds an approximate solution that solves the hyperbolic PDEs. It shows good accuracy and in the case of the second-order equations, it has an error rate of less than 3 %. The resulting equation of this method has the form of a Taylor series.
Using this method, the resulting equation expressing the number of EVs in the charging state is given as [16][17]: In Equation (17), u j k expresses how many EVs have a certain SOC corresponding to step j and time step k in the charging state [8,16]: Variable a in Equation (17) denotes the constant charging rate. The charging rate is the same throughout the whole charging cycle. ∆t determines the time of the discretization step of the function and ∆x expresses the discretization step of SOC. Equation (17) thus defines the change in the number of EVs with SOC j at time k+1, based on the values at time k, the amount of EVs with j times ∆x SOC and the amount of EVs with the surrounding values of SOC at j+1 and j-1 steps [8,17].
The differential equation expressing the number of EVs in the idle state is derived only with respect to time and can therefore be solved numerically without modifications. The equation defines the number of EVs in the idle state in the next time step, which is determined by the number of vehicles in the idle state in the current time step and the transport variables is the number of EVs moving from the idle state to the charging state in the current time step k and i c j k v " represents the number of EVs moving from the idle state to the driving state (disconnection from the charging station) in the current time step. The mathematical notation of Equation (16) in discretized version is [8]: Using Equations (17) and (19) and conditions set in section 3.1, the simulation model was created in Matlab R2020b. The simulation of EV fleet charging represents charging with constant power. From the model, it is possible to determine the time for EVs to charge, the number of charging vehicles at a certain time t and the number of EVs in the idle state at a given time. An important function of the model from the electrical grid point of view is the prediction of the consumed power from the grid for the fleet charging. The input variables to this model are the number and type of EVs in the fleet whose SOC at time t is between x and x+dx [16][17].
In an infinitesimally small time interval dt, the number of charged EVs can be expressed according to the conservation law as [8,[16][17]: .
If dt → 0 and dx → 0 are considered, then the PDE representing the time change of the number of EVs in the charging state is given by [8]: Equation (15) can be used to determine how many EVs have a certain level of SOC or how many EVs consume energy from the network, i.e. they are being charged.
Similarly, one can express the PDE determining the number of EVs in the idle state according to the following equation [16][17]: The number of EVs with SOC equal to x at time t in the idle state depends on how many EVs are currently connected or disconnected to the charger , x t i po v "^h h and from the number of EVs that was transited from charging state to idle state , x t i c v "^h h and vice versa.
For the correct function of the model, it is necessary to determine the PDE boundary conditions representing the EV charging dynamics, i.e. for x = 0 at time t [16][17]: • u(0,t) = 0, meaning SOC of EV cannot be lower than 0. It is also important to determine the condition for the limit value of charging rate q c (x,t) when the EV is already charged [16][17]: • q c (1,t) = 0, after reaching x = 1, the battery is not charged any further. The other conditions are defined within the model. If x is less than 1, then EVs are connected to the charger and they are in the charging state, until x does not take on the value of 1. EVs with x = 1 are not charged any further but are transited into the idle state [16][17].

Simulation model
The mathematical model of EV fleet charging dynamics defined in the previous section consists of hyperbolic PDEs. The computation of these hyperbolic PDEs can be very complex. However, if a charging rate q c (x,t) is assumed to be constant over time, the quite simple Lax-Wendroff numerical method can be The results from the simulation show the charging process of individual groups of EVs in Figure 6. The SOC of all groups increases over time and the duration of the charging process depends on the initial SOC.
After reaching x = 1, the vehicles are automatically transited into the idle state, as shown in Figure 7. The gradual increase of vehicles in the idle state, as soon as individual EV groups reach full SOC can be seen in Figure 6. Figure 6 also shows that EVs with the lowest initial SOC (25 %) are fully charged after 699 minutes. That corresponds to the time when the last group of Evs is added to the idle state ( Figure 7).
The total consumed power is a function of the number of charging vehicles and the charging rate. So, the total consumed power at the time t is the sum of power consumed by all the Evs in the charging state. However, the number of vehicles in the charging state is constantly changing depending on their actual SOC. The power curve, therefore, evolves over time as shown in Figure 8. The curve corresponds to the initial condition of connecting all the vehicles to the charger and so their location in the charging state of the model. Therefore, the power takes on a value of 3700 kW, i.e. the power of the charger 3.7 kW multiplied by the number of vehicles 1000. As the Evs are charged and so transited from the charging to the idle state, the power gradually decreases. In addition, the trends in Figure  8 can be compared to Figures 6 and 7, where the EV group with an initial charge of 25 % reaches x = 1 after 699 minutes from the simulation start. The total power consumed at this time will drop to zero because all the vehicles are already fully charged and are in the idle state.
with their initial SOC and defined constant charging rate.

Testing of the simulation model
To test the created simulation model, the following input values were used. We chose the maximum number of EVs in the fleet equal to 1000, with a nominal battery capacity of 50 kWh. Charger efficiency is assumed 87 %. The simulation time is set to 800 minutes. The length of time is chosen so that all the EVs have time to charge with charging power equal to 3.7 kW. The charging rate per time unit dt is then determined as: . .
While x changes in the range 0 to 1 with a step dx, time takes on values from 0 to the selected simulation time with a dt step set to 1 minute.
In addition, it is important to determine the limits for Equations (17) and (19). If the SOC is lower than 1, the EV is automatically transited to the charging state from the idle state after being connected. If SOC is equal to 1, EV is transited into the idle state.
The initial conditions for these discrete equations need to be determined as well. In the idle state, there are no EVs in the initial state. All the EVs connected to the charging station are already in the charging state at the beginning of the simulation and they are divided into groups as follows: • 300 vehicles with initial x corresponding to 25 % SOC; • 200 vehicles with initial x corresponding to 35 % SOC; • 100 vehicles with initial x corresponding to 50 % SOC;       Table 2. The battery charging model from section 2.4 calculates the battery charging time, current and voltage curves. The battery consists of battery cells, which are charged evenly in the battery and are assumed to be homogeneous. The parameters of the simulated battery cobalt blended lithium-ion cell are shown in Table 3.
times of the presented charging model and the one from section 2.4 are compared, with the charging time from the online calculator presented in Table 1.
The full charging is represented by the charging window between 20 % and 100 % of the nominal battery capacity. The calculator has a preset charger efficiency value of 90 %, so the simulation models assume the same one. The charging process in a group of 5 Evs with  Figure 9 The charging characteristics determined by the electrical battery charging model and so utilization of this model, to represent charging of larger EV fleets, is not efficient. On the other hand, the computation time of the model defined in this paper is almost the same in both cases since the computation of PDEs defining the EV fleet model does not depend on the number of EVs. Therefore, this model can be computation time efficient for modeling large fleets of EVs, while keeping the accuracy of the model commonly used for battery charging representation.

Conclusions
Charging many electric vehicles represent an increased load on the power grid that changes unpredictably over time. Such uncontrolled charging of vehicles can cause problems with the stability of the grid or overloading of some of its parts. To study these impacts and implement measures to prevent them, modeling large EV groups charging is important.
Therefore, this paper defines a model suitable to represent the charging of the fleet of EVs that can vary in size without affecting the computation time. Simulation results show that the defined model meets the accuracy of the commonly used model representing battery charging while decreasing the computation time in comparison with these commonly used models.
The defined model can be used in future work in an analysis of the EVs' charging impact on the power system as a whole or its parts. Moreover, the model can be also utilized for the charging control system definition, where the EVs will be transferred between the charging and the idle states to meet the consumed power threshold or other requirements.

Grants and funding
The authors received no financial support for the research, authorship, and/or publication of this article.

Conflicts of interest
The authors declare that they have no known competing financial interests or personal relationships that could have appeared to influence the work reported in this paper.
The Tesla S85 vehicle battery is constructed from 16 modules connected in series. One module consists of 74 parallel-connected branches of 6 serial battery cells of type 18650. In one module, 444 such cells are connected. Based on this, the battery cell model was proportionally converted to the battery model. The resulting charging characteristics, determined using the electric battery charging model, are presented in Figure 9.
For the presented model of the fleet of EVs, it is also necessary to determine the discretization step dx the EV's data as: . .
The simulation time was estimated from the expected charging time of the vehicle with the lowest initial charge according to the time given by the online calculator, namely 250 minutes. We kept the calculation step dt for 1 minute. The resulting charging characteristics are presented in Figure 10.
As can be seen in Figures 9 and 10, the character of the charging in both models is quite similar since the electrical battery charging model was used as the basis for definition of the EV fleet model. However, the charging window between 20 % and 100 % is 192 minutes, or 3 hours and 12 minutes in the simulation of the electrical model of battery charging, as shown in Figure 9. The reference charging time for this charging window (Table  1) is 3 hours and 29 minutes. In the EV fleet charging model, a full charge from the initial 20 % was achieved after 206 minutes, or 3 hours and 26 minutes, as shown in Figure 10. So, this second simulation case is closer with its charging time estimation to the reference one defined by [18] with a difference of only 3 minutes. However, the time difference in both models can be assumed small enough.
The main difference between the two models is their computation time. The average computation times for both simulation and for the case of an increase of EVs to ten within the fleet are presented in Table 4. As can be seen in Table 4, the computation time of the electrical battery charging model for 5 EVs in a fleet is much higher than the computation time of the EV fleet model presented in the paper. With the increase of EVs to ten within the fleet, the computation time of the electrical battery charging model increases even more. As can be seen in Table 4, the increase of the computation time is proportional to the increase of the EVs in the fleet