Neural Network-Based Modeling of Electric Vehicle Energy Demand and All Electric Range

A deep neural network-based approach of energy demand modeling of electric vehicles (EV) is proposed in this paper. The model-based prediction of energy demand is based on driving cycle time series used as a model input, which is properly preprocessed and transformed into 1D or 2D static maps to serve as a static input to the neural network. Several deep feedforward neural network architectures are considered for this application along with different model input formats. Two energy demand models are derived, where the first one predicts the battery state-of-charge and fuel consumption at destination for an extended range electric vehicle, and the second one predicts the vehicle all-electric range. The models are validated based on a separate test dataset when compared to the one used in neural network training, and they are compared with the traditional response surface approach to illustrate effectiveness of the method proposed.


Introduction
In the last decade, there has been a trend of connecting the electric energy and transport systems through the appearance of electric vehicles (EV) and the need for their charging. Increased proliferation of EVs will require implementation of suitable load management procedures for electric grids in terms of applying optimal charging strategies to EV fleets, which would be facilitated by use of various Vehicle-to-Infrastructure (V2I) and Vehicle-to-Grid (V2G) communication methods [1]. In order to provide optimal EV fleet charging management within smart grids, there is a necessity for accurate models aimed at predicting the energy demand of each individual EV in the fleet, including prediction of battery state of charge (SoC) at destination (e.g., at the charging station). Such energy demand models can be used to optimize routes and charging schedules in order to ultimately minimize fueland electricity consumption-related costs [2,3].
The energy demand can be predicted based on a precise EV powertrain model, where each sub-component is modeled separately [4]. However, building of such models can be time consuming and thus impractical to use in the case of fleets where new vehicles are frequently added. Also, performing EV simulations within an optimization-based charging/routing management framework can be impractical from the standpoint of computational efficiency. Another possibility for modeling the EV energy demand relates to use of computationally efficient response surface-based method [5], where the model parameterization can be conducted off-line based on precise EV model simulations

Driving Cycle Data Preprocessing
This section first briefly describes the process of driving cycle data collection based on GPS/GPRS tracking technology applied on a set of ten mid-size delivery trucks [6]. A method for preprocessing of driving cycles is then elaborated, along with definition of several resulting formats of processed driving cycles aimed to be used as inputs to a feedforward NN.

Delivery Vehicle Fleet Description and Driving Data Collection
The delivery vehicle fleet considered in this paper consists of a set of ten mid-size MAN-TGM 15.240 trucks. The driving missions of these trucks relate to delivery of goods from a main

Driving Cycle Data Preprocessing
This section first briefly describes the process of driving cycle data collection based on GPS/GPRS tracking technology applied on a set of ten mid-size delivery trucks [6]. A method for preprocessing of driving cycles is then elaborated, along with definition of several resulting formats of processed driving cycles aimed to be used as inputs to a feedforward NN.

Delivery Vehicle Fleet Description and Driving Data Collection
The delivery vehicle fleet considered in this paper consists of a set of ten mid-size MAN-TGM 15.240 trucks. The driving missions of these trucks relate to delivery of goods from a main distribution center to sales centers. The truck loading capacity is 7460 kg and the empty vehicle mass is 7860 kg. The vehicle is propelled by a diesel engine with the maximum power of 176 kW. The vehicle maximum velocity equals 90 km/h.
Driving data have been collected by using the vehicle tracking equipment based on GPS and GPRS technology. The driving data were recorded continuously, i.e., 24 h a day, over a time period of three months (91 days). The data sampling time was set to 1 s. Apart from the GPS-related data, an additional set of data from the vehicle controller area network (CAN) bus were acquired (e.g., engine rotational speed and cumulative fuel consumption). The recorded GPS data include the following information: vehicle ID number, timestamps, vehicle velocity, vehicle position (longitude and latitude), and altitude. A total of 2286 driving cycles were extracted from the overall recorded dataset, where each driving cycle corresponds to a single driving mission determined by the time interval between vehicle departure from and its arrival back to the distribution center.

Preprocessing of Driving Cycles to Serve as Neural Network Inputs
The longitudinal dynamics of vehicle is described by the following equations: where τ L and ω L are the total wheel torque and angular velocity, respectively, v v is the vehicle velocity, m v is the vehicle mass, r is the effective tire radius, g is the gravitational acceleration, α is the road slope, R o is the tire rolling coefficient, ρ air is the air density with the standard value of 1.225 kg/m 3 , C d is the vehicle aerodynamic drag coefficient, and A f is a vehicle frontal cross-section area. The demanded energy on wheels can be calculated as: where T f represents the driving cycle duration. By inspecting Equations (1)-(3), it can be concluded that the significant variables from the perspective of energy demand are: (i) vehicle velocity v v , (ii) vehicle acceleration a = dv v /dt, (iii) road slope α, and (iv) vehicle mass m v . In this paper only vehicle velocity v v and acceleration dv v /dt are taken into account when generating inputs to considered NNs. Since driving cycles can be variable both in time and travelled distance, and the feedforward NNs are supposed to be fed by static inputs of constant dimensions, driving cycle preprocessing is needed. Because different NN architectures require different input formats (see Figure 1 and Section 4), three input types (IT) of NNs labeled as IT1, IT2, and IT3 are proposed ( Table 1). The input IT1 refers to 1D vector of counted velocity states in range of 0 to 90 km/h, with resolution of 0.5 km/h. The input IT2 refers to 2D matrix of counted transitions between the different velocity states, where velocity range is equal as in the case of IT1 input, but with the resolution of 1 km/h. Here, the information of vehicle acceleration is included indirectly through counting of transitions between discrete values of vehicle velocities. The input IT3 refers to 2D matrix of counted accelerations for each velocity state defined in IT1, where the acceleration range and resolution are equal to ±1.5 m/s 2 and 0.1 m/s 2 , respectively. In this case, the information on vehicle acceleration is directly included. It should be mentioned that regardless of input type, by counting the discrete values of vehicle velocities for the given fixed sampling time, the information on travelled distance is accounted for implicitly (note that this information highly impacts the energy demand [4]).
Apart from the driving cycle-related velocity and acceleration information, the initial battery SoC value (SoC init ) needs to be included in the NN input to be able to predict the energy demand (e.g., SoC at destination). Various methods have been considered within this study, such as appending the input vector/matrix by SoC init , multiplying each element of input matrix by SoC init , etc. A simple addition of initial SoC to the overall input matrix has been found to be the best approach in terms of NN prediction accuracy. Exceptionally, in the IT1 case the initial SoC value is appended to the input vector. The addition of vehicle initial SoC value for the cases of matrix input formats (IT2 and IT3) can be visualized as a magnification of grey intensity in the graphical representation of the matrix, as illustrated in Figure 2 for the case of IT2 and initial SoC values ranging from 0.3 to 0.6. This figure shows that IT2 has very sparse structure (i.e., useful information just around diagonal positions), which affects the quality of recognition of sample features, while requiring long learning time of NN due to high dimension of input matrix. This difficulty is effectively overcome in the case of IT3, which is characterized by the reduced input dimensions (see Table 1), far less sparse structure (see Figure 3), and directly included acceleration information. The reduced input dimension makes the NN training process less time consuming due to a lower number of trainable parameters. For the sake of better visualization of addition of initial SoC to 2D inputs in the case of IT2 and IT3, the inputs are shown as contour plots in Figure 4. The procedure for generating inputs for NN-based energy demand models for the purpose of their training (i.e., parameterization) and testing is as follows: (i) splitting of overall driving cycle dataset into two distinctive groups, where 85% of data is used for training of NNs, while remaining 15% of data is employed for model testing, (ii) extracting of vehicle velocity and acceleration values from the driving cycle data; (iii) counting of the states including discrete values of vehicle velocity (and acceleration) and transitions between states and storing them into 1D or 2D static maps depending on the required NN input format (i.e., IT1, IT2 or IT3), and (iv) adding the initial SoC value SoC init into the given input format.  The procedure for generating inputs for NN-based energy demand models for the purpose of their training (i.e., parameterization) and testing is as follows: (i) splitting of overall driving cycle  dataset into two distinctive groups, where 85% of data is used for training of NNs, while remaining 15% of data is employed for model testing, (ii) extracting of vehicle velocity and acceleration values from the driving cycle data; (iii) counting of the states including discrete values of vehicle velocity (and acceleration) and transitions between states and storing them into 1D or 2D static maps depending on the required NN input format (i.e., IT1, IT2 or IT3), and (iv) adding the initial SoC value SoCinit into the given input format.

Generating Energy Demand Data
This section describes simulation data generated for the purpose of parameterization and validation of NN-based energy demand models. The first subsection deals with building up a simulation model of delivery EREV, which is executed over the recorded driving cycles (described in Section 2.1) for different initial SoC values. The obtained simulation results including fuel consumption, SoC at destination and AER are analyzed in the second subsection.

Modeling of Delivery EREV
A delivery EREV is modeled on the basis of particular conventional mid-size truck for which the driving cycle data have been recorded. First, a model of a fully electric vehicle with similar torque and power characteristics as the current conventional vehicle was built [31]. The electric vehicle powertrain model has then been extended with a range extender model consisting of an internal combustion engine (ICE) and a generator connected in a series hybrid powertrain configuration.
The backward-looking (i.e., quasi-static) modeling approach has been applied, where the only state variable corresponds to the battery SoC, while other powertrain components are modeled through 1D maps (e.g., ICE and electric machines' maximum torque curves, battery open circuit voltage dependence on SoC, etc.) and 2D maps (e.g., ICE fuel mass flow, electric machines' efficiency, etc.; see Figure 5a). The torque τm and angular velocity ωm of the electric motor, which depend on the total wheel demanded torque τL and the angular velocity ωL given by Equations (1) and (2), are calculated by using the following kinematic equations (represented by the block Mechanical transmission in Figure 5a): where io is the fixed final drive gear ratio, h is the transmission gear ratio, and ηt is the drivetrain efficiency. The ICE is coupled with the generator (τg, ωg) through a single ratio transmission, which is

Generating Energy Demand Data
This section describes simulation data generated for the purpose of parameterization and validation of NN-based energy demand models. The first subsection deals with building up a simulation model of delivery EREV, which is executed over the recorded driving cycles (described in Section 2.1) for different initial SoC values. The obtained simulation results including fuel consumption, SoC at destination and AER are analyzed in the second subsection.

Modeling of Delivery EREV
A delivery EREV is modeled on the basis of particular conventional mid-size truck for which the driving cycle data have been recorded. First, a model of a fully electric vehicle with similar torque and power characteristics as the current conventional vehicle was built [31]. The electric vehicle powertrain model has then been extended with a range extender model consisting of an internal combustion engine (ICE) and a generator connected in a series hybrid powertrain configuration.
The backward-looking (i.e., quasi-static) modeling approach has been applied, where the only state variable corresponds to the battery SoC, while other powertrain components are modeled through 1D maps (e.g., ICE and electric machines' maximum torque curves, battery open circuit voltage dependence on SoC, etc.) and 2D maps (e.g., ICE fuel mass flow, electric machines' efficiency, etc.; see Figure 5a). The torque τ m and angular velocity ω m of the electric motor, which depend on the total wheel demanded torque τ L and the angular velocity ω L given by Equations (1) and (2), are calculated by using the following kinematic equations (represented by the block Mechanical transmission in Figure 5a): where i o is the fixed final drive gear ratio, h is the transmission gear ratio, and η t is the drivetrain efficiency. The ICE is coupled with the generator (τ g , ω g ) through a single ratio transmission, which is characterized by the gear ratio h G . The battery dynamics, represented by the open-circuit voltage source U oc (SoC) and the internal resistance R(SoC, i) (Figure 5b), is described by the following nonlinear state Equation (4): where P batt is the battery power and Q max is the total battery charge capacity (with the SoC defined as SoC = Q/Q max ). The battery power P batt is calculated by subtracting the generator electrical power P g from the motor electrical power P m (see Figure 5a). The battery pack consists of 1300 individual Li-Ion battery cells, where a capacity Q max and mass of each battery cell is assumed to be equal to 15.9 Ah and 0.63 kg, respectively [31]. Therefore, the final total battery pack capacity is approximately 73 kWh, while the battery pack mass equals to 819 kg.
where Pbatt is the battery power and Qmax is the total battery charge capacity (with the SoC defined as = / ). The battery power Pbatt is calculated by subtracting the generator electrical power Pg from the motor electrical power Pm (see Figure 5a). The battery pack consists of 1300 individual Li-Ion battery cells, where a capacity Qmax and mass of each battery cell is assumed to be equal to 15.9 Ah and 0.63 kg, respectively [31]. Therefore, the final total battery pack capacity is approximately 73 kWh, while the battery pack mass equals to 819 kg. The EREV powertrain can operate in two characteristic regimes: (i) charge depleting (CD) where only electric driving is active, and (ii) charge sustaining (CS) where hybrid driving is performed by activating the ICE and generator in combination with the motor, in order to sustain battery SoC at some predefined level (here set to 0.3). The distance travelled in the CD regime prior to switching to CS regime is referred to as all-electric range (AER). The operating points of powertrain components are calculated by a control strategy, which combines a rule-based (RB) control, including a battery SoC controller and an engine switching logic, with an instantaneous optimization of equivalent fuel consumption known as equivalent consumption minimization strategy (ECMS). A detailed explanation of the RB + ECMS control strategy is given in [32].

Simulation Results of Delivery EREV
The delivery EREV model from Figure 5a has been simulated over the full set of 2286 recorded driving cycles for nine discrete levels of initial SoC ( ∈ 0.2, 0.3, … , 1.0 ), in order to obtain the fuel consumption, SoC at destination and AER data aimed to be used for NN training and validation. This resulted in total of 20,574 simulations. The vehicle mass mv, which includes both the empty vehicle mass and the cargo mass, is set to 10,066 kg (i.e., empty vehicle mass + average mass for the recorded driving cycles) and is kept constant for all driving cycles. The impact of the road slope α in Equation (1) is neglected (α is set to 0) due to a relatively flat area over which the considered delivery vehicle fleet were operating. Figure 6 shows the relation of both the simulated fuel consumption Vf and the SoC at destination (i.e., at the end of a driving cycle, SoCend) with respect to travelled distance d for the case of SoCinit equal to 1.0 (Figure 6a), and for the case of SoCinit equal to 0.6 ( Figure 6b). It can be observed from these results that the initial SoC and travelled distance d highly influence the fuel consumption Vf and SoC at destination (i.e., at the given d). The EREV powertrain can operate in two characteristic regimes: (i) charge depleting (CD) where only electric driving is active, and (ii) charge sustaining (CS) where hybrid driving is performed by activating the ICE and generator in combination with the motor, in order to sustain battery SoC at some predefined level (here set to 0.3). The distance travelled in the CD regime prior to switching to CS regime is referred to as all-electric range (AER). The operating points of powertrain components are calculated by a control strategy, which combines a rule-based (RB) control, including a battery SoC controller and an engine switching logic, with an instantaneous optimization of equivalent fuel consumption known as equivalent consumption minimization strategy (ECMS). A detailed explanation of the RB + ECMS control strategy is given in [32].

Simulation Results of Delivery EREV
The delivery EREV model from Figure 5a has been simulated over the full set of 2286 recorded driving cycles for nine discrete levels of initial SoC (SoC init ∈ [0.2, 0.3, . . . , 1.0]), in order to obtain the fuel consumption, SoC at destination and AER data aimed to be used for NN training and validation. This resulted in total of 20,574 simulations.
The vehicle mass m v , which includes both the empty vehicle mass and the cargo mass, is set to 10,066 kg (i.e., empty vehicle mass + average mass for the recorded driving cycles) and is kept constant for all driving cycles. The impact of the road slope α in Equation (1) is neglected (α is set to 0) due to a relatively flat area over which the considered delivery vehicle fleet were operating. Figure 6 shows the relation of both the simulated fuel consumption V f and the SoC at destination (i.e., at the end of a driving cycle, SoC end ) with respect to travelled distance d for the case of SoC init equal to 1.0 (Figure 6a), and for the case of SoC init equal to 0.6 ( Figure 6b). It can be observed from these results that the initial SoC and travelled distance d highly influence the fuel consumption V f and SoC at destination (i.e., at the given d). This is the reason why these variables were used as inputs for predicting energy demand when using the response surface modeling approach (see [4] and Section 4 for more details). However, it should be noted that there is notable scattering of both fuel consumption (Vf) and SoC at destination data (SoCend) for the given distance travelled d, which is caused by variability in driving cycles features (reflecting different driving routes, driving styles and traffic congestion aspects). This means that the fuel consumption, the SoC at destination and also the AER (see Figure 7) cannot be accurately captured solely by using travelled distance and initial SoC inputs. This is the reason why these variables were used as inputs for predicting energy demand when using the response surface modeling approach (see [4] and Section 4 for more details). However, it should be noted that there is notable scattering of both fuel consumption (V f ) and SoC at destination data (SoC end ) for the given distance travelled d, which is caused by variability in driving cycles features (reflecting different driving routes, driving styles and traffic congestion aspects). This means that the fuel consumption, the SoC at destination and also the AER (see Figure 7) cannot be accurately captured solely by using travelled distance and initial SoC inputs.

Modeling of Energy Demand
This section first describes the traditional map-based approach (i.e., response surface method) of energy demand modeling, which is based on simulation of the delivery EREV model over synthetic driving cycles (more details are given in [4]). The emphasis is then on NN modeling approach, where the MLP and CNN network architectures are considered.

Response Surface Modeling Approach
Because both vehicle fuel consumption Vf and SoC-at-destination SoCend predominantly depend on the initial SoC (SoCinit) and the travelled distance d (see Section 3 and Figure 6), the energy demand model is based on the following functional dependences [4,5]: = ( , ).
The response surface approach is appropriate for this modeling application, because the resulting model is typically computationally very efficient and easy to be parameterized. The modeling procedure includes the following steps [4]: (i) clustering of recorded driving cycles by travelled distance into several groups, (ii) generating and validating single representative synthetic driving cycle for each cluster, (iii) defining levels of initial SoC, (iv) performing simulations of EREV model over each generated synthetic driving cycle for each defined level of initial SoC, (v) forming response surfaces based on the simulation results. Figure 8 shows the obtained response surface model in the form of two-dimensional approximation polynomials (labeled as Model) defined by Equations (7) and (8), along with the simulation results based on recorded driving cycles [4].

Modeling of Energy Demand
This section first describes the traditional map-based approach (i.e., response surface method) of energy demand modeling, which is based on simulation of the delivery EREV model over synthetic driving cycles (more details are given in [4]). The emphasis is then on NN modeling approach, where the MLP and CNN network architectures are considered.

Response Surface Modeling Approach
Because both vehicle fuel consumption V f and SoC-at-destination SoC end predominantly depend on the initial SoC (SoC init ) and the travelled distance d (see Section 3 and Figure 6), the energy demand model is based on the following functional dependences [4,5]: SoC end = f 2 (SoC init , d).
The response surface approach is appropriate for this modeling application, because the resulting model is typically computationally very efficient and easy to be parameterized. The modeling procedure includes the following steps [4]: (i) clustering of recorded driving cycles by travelled distance into several groups, (ii) generating and validating single representative synthetic driving cycle for each cluster, (iii) defining levels of initial SoC, (iv) performing simulations of EREV model over each generated synthetic driving cycle for each defined level of initial SoC, (v) forming response surfaces based on the simulation results. Figure 8 shows the obtained response surface model in the form of two-dimensional approximation polynomials (labeled as Model) defined by Equations (7) and (8), along with the simulation results based on recorded driving cycles [4].

Energy Demand Modeling
Using of NNs for energy demand modeling is motivated by the universal approximation theorem for NNs, which states that a feedforward NN with a linear output layer and at least one hidden layer containing a finite number of neurons, can approximate any continuous function of finite dimensional space to any certain target amount of error [33]. Two NN architectures have been considered for the purpose of EV energy demand modeling. The first architecture corresponds to MLP, and consists of a single input layer, four fully connected (i.e., hidden) layers with 2056, 1024, 512, and 256 neurons, respectively, and the single output layer (see Figure 9a). The second NN architecture corresponds to CNN, and consists of a single input layer, two convolutional layers with six convolutional filters of size 2 × 2, one max-pooling layer of size 2 × 2, one flattened layer, two fully connected layers with 512 and 256 neurons, and the single output layer (see Figure 9b). The former one is chosen because it represents standard NN architecture, while the latter one is selected because it has been proven to be very successful in image classification tasks (due to its effectiveness in automatic feature extraction) and the processed driving cycles can be considered as images (i.e., 2D matrices in the case of IT2 and IT3; see  Both MLP and CNN models take the driving cycle data with incorporated initial SoC value (SoCinit) as inputs (see description of IT1, IT2, and IT3 in Section 2), and they output the predicted fuel consumption (Vf) and SoC at destination (SoCend) values. The corresponding NN architectures are implemented in Python programming language (version 3.5.0), by using the Keras module [34] with Tensorflow [35] as backend. The stride property (i.e., the number of pixels by which the filter matrix slides over the input matrix) of the considered two-dimensional convolutional and max-pooling

Energy Demand Modeling
Using of NNs for energy demand modeling is motivated by the universal approximation theorem for NNs, which states that a feedforward NN with a linear output layer and at least one hidden layer containing a finite number of neurons, can approximate any continuous function of finite dimensional space to any certain target amount of error [33]. Two NN architectures have been considered for the purpose of EV energy demand modeling. The first architecture corresponds to MLP, and consists of a single input layer, four fully connected (i.e., hidden) layers with 2056, 1024, 512, and 256 neurons, respectively, and the single output layer (see Figure 9a). The second NN architecture corresponds to CNN, and consists of a single input layer, two convolutional layers with six convolutional filters of size 2 × 2, one max-pooling layer of size 2 × 2, one flattened layer, two fully connected layers with 512 and 256 neurons, and the single output layer (see Figure 9b). The former one is chosen because it represents standard NN architecture, while the latter one is selected because it has been proven to be very successful in image classification tasks (due to its effectiveness in automatic feature extraction) and the processed driving cycles can be considered as images (i.e., 2D matrices in the case of IT2 and IT3; see .

Energy Demand Modeling
Using of NNs for energy demand modeling is motivated by the universal approximation theorem for NNs, which states that a feedforward NN with a linear output layer and at least one hidden layer containing a finite number of neurons, can approximate any continuous function of finite dimensional space to any certain target amount of error [33]. Two NN architectures have been considered for the purpose of EV energy demand modeling. The first architecture corresponds to MLP, and consists of a single input layer, four fully connected (i.e., hidden) layers with 2056, 1024, 512, and 256 neurons, respectively, and the single output layer (see Figure 9a). The second NN architecture corresponds to CNN, and consists of a single input layer, two convolutional layers with six convolutional filters of size 2 × 2, one max-pooling layer of size 2 × 2, one flattened layer, two fully connected layers with 512 and 256 neurons, and the single output layer (see Figure 9b). The former one is chosen because it represents standard NN architecture, while the latter one is selected because it has been proven to be very successful in image classification tasks (due to its effectiveness in automatic feature extraction) and the processed driving cycles can be considered as images (i.e., 2D matrices in the case of IT2 and IT3; see  Both MLP and CNN models take the driving cycle data with incorporated initial SoC value (SoCinit) as inputs (see description of IT1, IT2, and IT3 in Section 2), and they output the predicted fuel consumption (Vf) and SoC at destination (SoCend) values. The corresponding NN architectures are implemented in Python programming language (version 3.5.0), by using the Keras module [34] with Tensorflow [35] as backend. The stride property (i.e., the number of pixels by which the filter matrix slides over the input matrix) of the considered two-dimensional convolutional and max-pooling Both MLP and CNN models take the driving cycle data with incorporated initial SoC value (SoC init ) as inputs (see description of IT1, IT2, and IT3 in Section 2), and they output the predicted fuel consumption (V f ) and SoC at destination (SoC end ) values. The corresponding NN architectures are implemented in Python programming language (version 3.5.0), by using the Keras module [34] with Tensorflow [35] as backend. The stride property (i.e., the number of pixels by which the filter matrix slides over the input matrix) of the considered two-dimensional convolutional and max-pooling layers, represented as Conv2D and MaxPooling2D in Figure 9, is set to 1. The abbreviation ReLU stands for rectifier linear unit, i.e., the non-linear activation function used in developed NN models, which avoids negative values by mapping them to zero, thus allowing the more effective training of the networks. For the purpose of training the developed NNs, Adam (i.e., adaptive moment estimation) optimization algorithm for stochastic gradient descent is used, with its parameters set to default values [36]. The batch size and the number of epochs are set to 32 and 300, respectively. The loss function E to be minimized by training is defined as mean squared error (MSE) between the given NN output y net and the desired output y train : where X represents the input vector or matrix, y net = [V f SoC end ] T is the vector of energy demand data obtained by EREV simulation over recorded driving cycles, W are the network weights, and n is the length of the overall training dataset (in this case it equals to 17,488, i.e., 85% of the obtained simulation dataset; see Section 3 for detailed information).

All-Electric Range Modeling
The EREV fleet AER is described by the same CNN model as for predictions of vehicle fuel consumption and SoC at destination (see Figure 9b), but with its output dimension changed to 1 (i.e., model outputs a single value of AER). The AER model uses input of type IT3 to whom the following minor modification were made: (i) each of the matrix rows are normalized with respect to the sum of belonging elements, and (ii) all of the matrix fields are incremented by the corresponding initial SoC values (SoC init = (0.2, 0.3, . . . , 1.0)). This modification of IT3 were introduced because AER is more dependent on driving style than on the total distance travelled (see Figure 7). More specifically, the normalization of matrix rows effectively converts the information about counted velocity and acceleration states into the transition probabilities between the related states, thus giving more focus on a driving style, while suppressing the information about total distance travelled and resulting in better AER predictions. The opposite applies to the case of V f and SoC end modeling, where the distance travelled is the dominant influencing parameter, so that the matrix rows remain in the absolute (non-normalized) form, thus reflecting the distance travelled.

Analysis of Modeling Results
This section presents a detailed comparative analysis of the energy demand and AER prediction results obtained by the response surface-and NN-based models. The computations are performed on a HP Z440 Workstation, equipped with 16 GB RAM and an Intel ® Xeon ® Processor E5-1620 v3 @ 3.50 GHz.

Energy Demand Prediction
First, the recorded driving cycles have been processed and the inputs of predefined formats obtained (IT1, IT2, and IT3; see Section 2). Next, the response surface-and NN-based models have been derived based on generated EREV simulation-based energy demand data (see Section 4), finally, the derived models have been evaluated over those inputs giving several key performance indicators. The performance indicators related to the response surface-based model reflect basic statistics of the obtained prediction results and related residuals (i.e., difference between model-predicted and reference values), while the NN-based models include some additional indicators such as: (i) training time in hours, (ii) evaluation time in milliseconds, (iii) training score which corresponds to the value of loss function E for the case of training dataset, (iv) testing score which corresponds to the value of loss function E for the case of testing dataset, and (v) the total number of trainable parameters. The basic statistics information considers the minimum (min), maximum (max), mean, median, standard deviation (std), and 95% confidence interval (CFI 95%) of the prediction errors (i.e., residuals; see Equations (10) and (12) given below). The confidence intervals are calculated as CFI 95% = mean ± 2·std (under the assumption of normal distribution of residuals).
The results related to NN-based models are given for five different cases, concerning two NN architectures and three input formats (MLP for IT1, MLP for IT3, MLP for IT2, CNN for IT2, and CNN for IT3; see Table 2), and they are compared with the results obtained by using the response surface-based models. Tables 3 and 4 present detailed statistical information of the prediction results (i.e., residual errors) considering the vehicle fuel consumption (V f ) and SoC at destination (SoC end ) for both response surface-and NN-based models. These results point out that CNN2 (CNN in combination with IT3 input, i.e., 2D matrix including velocity and acceleration information) yields best results both in training score and testing score, as well as in evaluation time (the best scores are marked in green color). On the other hand, MLP1 has a significantly shorter training time, which is due to the lower number of trainable parameters resulting from the smaller input dimension. The CNN2 yields overall best results regarding the predictions of fuel consumption V f and SoC end , as well, while the MLP1 results follow them very closely. Therefore, graphical plots presented below are given only for these two cases.  Furthermore, in order to gain better insight into precision of the developed NN-based energy demand models when compared to the traditional response surface-based models, the distributions of both fuel consumption and SoC-at-destination prediction errors ∆V f and ∆SoC end are analyzed, where two types of prediction errors (i.e., relative: rel, and absolute: abs) are considered: ∆SoC end,abs = SoC end,predict − SoC end,real [−], (12) ∆SoC end, rel = SoC end,predict − SoC end,real SoC end,real [%], (13)  The fuel-and SoC-related absolute prediction errors ∆V f,abs and ∆SoC end,abs are shown in Figure 10, while the distributions of absolute and relative errors calculated according to Equations (10)- (13), along with the corresponding mean values (Mean) and standard deviations (Std), are shown in Figures 11 and 12, respectively. The results shown in Figure 12 indicate that most of the relative prediction errors for both ∆V f,rel and ∆SoC end,rel and both MLP1 and CNN2 models are located within the ±2% interval, which are significantly better results when compared to the response surfaces model whose distributions of errors are far wider (i.e., ±20%). Furthermore, in order to gain better insight into precision of the developed NN-based energy demand models when compared to the traditional response surface-based models, the distributions of both fuel consumption and SoC-at-destination prediction errors ∆Vf and ∆SoCend are analyzed, where two types of prediction errors (i.e., relative: rel, and absolute: abs) are considered: The fuel-and SoC-related absolute prediction errors ∆Vf,abs and ∆SoCend,abs are shown in Figure  10, while the distributions of absolute and relative errors calculated according to Equations (10)- (13), along with the corresponding mean values (Mean) and standard deviations (Std), are shown in Figures 11 and 12, respectively. The results shown in Figure 12 indicate that most of the relative prediction errors for both ∆Vf,rel and ∆SoCend,rel and both MLP1 and CNN2 models are located within the ±2% interval, which are significantly better results when compared to the response surfaces model whose distributions of errors are far wider (i.e., ±20%).

All-Electric Range (AER) Prediction
The corresponding CNN-based prediction results including the basic statistics of the absolute AER errors calculated as ∆ = − are given in Table 5. Figure 13a shows the plot of predicted AER (AERpredict) vs. real AER (AERreal), while the absolute AER errors ∆AERabs for a given testing dataset are shown in Figure 13b. The distributions of the AER-related residuals (i.e., ∆ and ∆ = − / ) are shown in Figure 13c,d. These results

All-Electric Range (AER) Prediction
The corresponding CNN-based prediction results including the basic statistics of the absolute AER errors calculated as ∆ = − are given in Table 5. Figure 13a shows the plot of predicted AER (AERpredict) vs. real AER (AERreal), while the absolute AER errors ∆AERabs for a given testing dataset are shown in Figure 13b. The distributions of the AER-related residuals (i.e., ∆ and ∆ = − / ) are shown in Figure 13c,d. These results

All-Electric Range (AER) Prediction
The corresponding CNN-based prediction results including the basic statistics of the absolute AER errors calculated as ∆AER abs = AER predict − AER real are given in Table 5. Figure 13a shows the plot of predicted AER (AER predict ) vs. real AER (AER real ), while the absolute AER errors ∆AER abs for a given testing dataset are shown in Figure 13b. The distributions of the AER-related residuals (i.e., ∆AER abs and ∆AER rel = AER predict − AER real /AER real ) are shown in Figure 13c,d. These results show that the developed CNN-based model predicts the vehicle AER with an absolute error ∆AER abs that is approximately 1 km (i.e., most of the points are located within the ±1 km interval; see Figure 13c). Regarding the relative AER error ∆AER rel , the majority of points lays within the ±5% interval (see Figure 13d), which can be considered quite accurate for this kind of prediction tasks. It is worth noting that the same methodology can be used to predict the driving distance of fully electric vehicle, as well. show that the developed CNN-based model predicts the vehicle AER with an absolute error ∆ that is approximately 1 km (i.e., most of the points are located within the ±1 km interval; see Figure 13c). Regarding the relative AER error ∆ , the majority of points lays within the ±5% interval (see Figure 13d), which can be considered quite accurate for this kind of prediction tasks. It is worth noting that the same methodology can be used to predict the driving distance of fully electric vehicle, as well.  Figure 13. Predicted vs. real values (a), absolute AER residuals ∆AERabs for given testing input dataset (b), and distributions of absolute (c) and relative (d) predicted AER residuals.

Discussion
Energy demand modeling of an extended range electric vehicle (EREV) has been presented based on applying deep neural networks (NN). The models are aimed at predicting the EREV fuel consumption Vf, SoC-at-destination SoCend, and all electric range (AER). Special emphasis was placed on proposing proper methods for preprocessing of driving cycles, in order to prepare them to serve as static 1D or 2D inputs to NNs, while conserving driving cycle features relevant to energy demand modeling. Three driving cycle input type formats have been proposed and analyzed: (i) IT1-1D vector which contains counted discrete vehicle velocity values, (ii) IT2-2D matrix which contains counted transitions between discrete vehicle velocity values/states (acceleration included indirectly), and (iii) IT3-2D matrix which contains counted states where each state represents one combination of discrete vehicle velocity and acceleration (acceleration included directly). Reliable options for including the initial SoC (i.e., the one at the beginning of driving cycle) into the NN input have been suggested (e.g., through adding the initial SoC to each element of 2D matrix in the case of IT2 and IT3). Also, two NN architectures have been considered and analyzed in different combinations with input types: (i) standard multi-layer perceptron (MLP); and (ii) convolutional neural network (CNN). The use of CNN architecture has been motivated by its effectiveness in image classification tasks (i.e., automatic feature extraction characteristics), where images are typically represented with Figure 13. Predicted AER predict vs. real AER real values (a), absolute AER residuals ∆AER abs for given testing input dataset (b), and distributions of absolute (c) and relative (d) predicted AER residuals.

Discussion
Energy demand modeling of an extended range electric vehicle (EREV) has been presented based on applying deep neural networks (NN). The models are aimed at predicting the EREV fuel consumption V f , SoC-at-destination SoC end , and all electric range (AER). Special emphasis was placed on proposing proper methods for preprocessing of driving cycles, in order to prepare them to serve as static 1D or 2D inputs to NNs, while conserving driving cycle features relevant to energy demand modeling. Three driving cycle input type formats have been proposed and analyzed: (i) IT1-1D vector which contains counted discrete vehicle velocity values, (ii) IT2-2D matrix which contains counted transitions between discrete vehicle velocity values/states (acceleration included indirectly), and (iii) IT3-2D matrix which contains counted states where each state represents one combination of discrete vehicle velocity and acceleration (acceleration included directly). Reliable options for including the initial SoC (i.e., the one at the beginning of driving cycle) into the NN input have been suggested (e.g., through adding the initial SoC to each element of 2D matrix in the case of IT2 and IT3). Also, two NN architectures have been considered and analyzed in different combinations with input types: (i) standard multi-layer perceptron (MLP); and (ii) convolutional neural network (CNN). The use of CNN architecture has been motivated by its effectiveness in image classification tasks (i.e., automatic feature extraction characteristics), where images are typically represented with 2D matrices, similarly as it is the case with driving cycles-related NN input herein (i.e., IT2 and IT3). The proposed NNs have been trained and examined based on different portions of large energy demand dataset obtained by simulating a delivery EREV model over a wide set of recorded driving cycles. The traditional response surface energy demand modeling approach has also been considered to quantify improvements which can be achieved by applying newly proposed NN methods.
The comparative analysis of the energy-related prediction results has shown that the CNN in combination with IT3 input (i.e., 2D matrix including velocity and acceleration information; CNN2), provides the best results in terms of the training and testing score (mean squared errors), as well as evaluation time (≈3.4 ms), while the MLP1 resulted in a significantly shorter training time (≈2.6 h vs. ≈7.6 h) due to the significantly lower input dimensions of IT1 when compared to IT3 (vector of dimension 182 vs. matrix of dimension 91 × 31). Furthermore, it is shown that most of the prediction errors (residuals) for both the fuel consumption ∆V f,rel and the SoC-at-destination ∆SoC end,rel in cases of MLP1 and CNN2 are located within the ±2% interval, which is significantly better when compared to the response surface model whose distributions of errors are far wider (i.e., most errors lays within the ±20% interval). The CNN-based model has been retrained for the purpose of prediction of vehicle AER. It is shown that the AER predictions are slightly less precise while compared to the energy-related prediction models (i.e., the majority of relative prediction errors ∆AER ,rel lays within the ±5%; or ±1 km in terms of absolute errors ∆AER ,abs ), but this can still be considered quite accurate for this kind of prediction task.

Conclusions
It can be concluded that NN-based energy demand models are significantly more accurate than response surface models, because response surfaces only include the driving distance d as input, along with the initial SoC; while NNs, apart from the driving distance (contained implicitly within inputs), also include other significant driving cycle features contained within NN inputs through automatic feature extraction. When considering model prediction accuracy, it has been found that the CNN-based energy demand model in combination with IT3 input form is the most successful in this automatic feature extraction. Apart from the high prediction accuracy, NN-based models are shown to be very computationally efficient (e.g., 3.4 ms of evaluation time in the case of CNN and IT3), and can therefore be used in various applications which require real-time performance such as vehicle routing and charging management. In the latter case, the accurate prediction of SoC at destination represents a key input to advanced, predictive charging management strategies, which need to satisfy the required driving missions and minimize the charging energy cost. Future work can consider other vehicle and environment parameters (e.g., vehicle mass and road slope) as inputs to NN for more accurate predictions in general case. Funding: This research was funded by the EU European Regional Development Fund through Interreg CE project SOLEZ ("Smart Solutions supporting Low Emission Zones and other low-carbon mobility policies in EU cities"; https://www.interreg-central.eu/Content.Node/SOLEZ.html).