Original software publication| Volume 13, 100369, August 01, 2022

# Electric vehicle range prediction estimator (EVPRE)

Open AccessPublished:July 14, 2022

## Highlights

• EVPRE software provides energy optimal routing and range prediction for EVs.
• User customizable for any EV.
• Algorithms consider location, elevation, weather, and real-time data.

## Abstract

The EVPRE software is a high resolution energy optimal routing and range prediction tool for electric Vehicles (EV). Users are able to quickly add characteristics of their EV systems to obtain reliable estimates of power consumption and see ideal range limits that maintain optimal battery health. These range and optimal routes are calculated using several models tested in hardware experiments. Interactive visualizations inform users on ideal energy-efficient routes and ranges based on specific locations, elevation changes, and real-time traffic

## Keywords

Tabled 1
Current code versionv1.0
Permanent link to code/repository used for this code versionhttps://github.com/SoftwareImpacts/SIMPAC-2022-118
Code versioning system usedgit
Software code languages, tools, and services usedJupyter Notebook and Python
Compilation requirements, operating environments & dependencieshttps://github.com/DIRECTLab/EVPRE/blob/main/requirements.txt and

Support email for questions[email protected]

## 1. Introduction

The Electric Vehicle Path and Range Estimator (EVPRE) software plans energy optimal routes for electric vehicles and generates range predictions from any arbitrary start location. EVPRE accounts for specific vehicle information, roadways, and environmental conditions to give user and location specific predictions. Range prediction is a key factor in measuring the performance of an electric vehicle (EV), and often inhibits adoption as new users are hesitant to invest when real operating range is unknown. This phenomenon (range anxiety) for EV users is mostly characterized by lack of understanding on how much distance can be covered at certain state of charge (SoC) [
• Ferreira J.
• Monteiro V.
• Afonso J.
Dynamic range prediction for an electric vehicle.
].
Predicting range is challenging as the presence of hills, wind, temperature, and time-of-day can impact performance and can drastically reduces the effective vehicle drive time. EVPRE is an open-source software which allows users to input their specific vehicle to generate range predictions, energy optimal driving routes, and gain an understanding of energy depletion for common driving in areas of interest. This software is designed to enable those interested in adopting, testing, or using EV’s in day-to-day life.
Accurate range prediction can also be useful in determining power needs, facilitating decisions on when to stop and recharge along long routes or at low SoC [
• Varga B.O.
• Sagoian A.
• Mariasiu F.
Prediction of electric vehicle range: A comprehensive review of current issues and challenges.
]. A proper understanding of range prediction and vehicle-specific energy optimal routing alleviates range anxiety and reduces the power demands for EV drivers.
Many common vehicle types come pre-loaded in our software and is extensible to account for new vehicles which are entering the market. Our software considers vehicle characteristics (speed, mass, air resistance, covered area etc.) to generate information specific to circumstances and locations at time of driving. While most new EVs have range prediction software, these operate with minimal driver awareness and real-time environmental information. These vehicle-integrated methods also are not well suited to test new and updated EV models which may be salient for those seeking to purchase such systems in the future (see Fig. 1).

## 2. Architecture

EVPRE software follows the Model-View-Controller (MVC) design. EVPRE requires several API keys for full functionality, we note that failure to query live data from these keys will result in using the bundled historical information. API keys provide access to real-time weather data, elevation information of the area of interest, and traffic data (used to calculate estimated route speed changes). All keys are ingested by the controller, which, redirects these to the models.
Road information is pulled from Open Street Map (OSM). This is converted into a graph representation with posted traffic speed, road grade, latitude, longitude, and length of road segments [

C. Bailey, B. Jones, M. Clark, R. Buck, M. Harper, Electric Vehicle Autonomy: Realtime Dynamic Route Planning and Range Estimation Software, in: International Conference on Intelligent Transportation Systems, ITSC, 2022.

]. The bellman ford algorithm is employed to calculate routes and the subsequent energy consumption of total routes based on energy prediction models. EVPRE returns the most energy efficient route between any two points after exploration.
The core function of this software resides in two types of prediction models, a physics-based analytic model and NREL’s FASTsim. A physics based model similar to [
• Fiori C.
• Ahn K.
• Rakha H.A.
Power-based electric vehicle energy consumption model: Model development and validation.
], was implemented in EVPRE using the following formula:
$Pwheels(T)=v(t)PmotorPdriveline(ma(t)+mgcos(θ)Cr1000(C1v(t)+C2)+0.5ρairAfCDVw(t)2+mgsin(θ))$

The physics based model takes the power cost at the wheels so the true power cost must be translated up to the motor which is done by the division of $Pmotor$ and $Pdriveline$. A definition and value for all variables in this formula is provided in Table 1. The wind speed variable is collected by a free API called Open Weather Maps; other data is collected per vehicle or dynamically collected during run time of the algorithm.
The more accurate but computationally complex FASTSim is a relatively efficient real-time simulation tool requiring vehicle parameters, and roadway information. This software comes bundled with a altered version of FASTSIM which considers additional effects to provide high resolution information about expected power consumption from real-time sources. FASTSim utilizes a greater amount of information (derived from API keys) and propagates this throughout a simulated traversal in 0.01 s increments. Conversely, the Simple Energy Model uses general parameters and computes energies based on entire road segments, resulting in some loss of accuracy as compared to real-world experiments. However, both models returns similar information in simple cases with long relatively straight roads. The user may choose to employ either or both algorithms to determine an optimal route and range prediction.
Table 1Definition and value of variables used in the physics model.
VariableDefinitionValue
mmass of vehiclevehicle specific
aacceleration of the vehicletrip specific
ggravitational acceleration9.81
$θ$road gradetrip specific
$Cr$rolling resistance surface type1.75
$C1$rolling resistance road condition0.0328
$C2$rolling resistance tire type4.575
$ρair$air mass density1.2256
$Af$frontal area of the vehiclevehicle specific
$CD$drag coefficientvehicle specific
$Vw$wind speedtrip specific
$v(t)$vehicle speedtrip specific
$Pmotor$electric motor efficiency0.91
$Pdriveline$driveline efficiency0.92
The FASTSim model utilizes a small simulation cycle at runtime, by creating emulations of vehicles operating along a edge’s length (i.e., road section length) and in a height differential (elevation) [

. Transportation & Mobility Research, FASTSim: Future Automotive Systems Technology Simulator, URL https://www.nrel.gov/transportation/fastsim.html.

]. In this model, elevation information (taken from GoogleMaps) are used to determine height differential. Vehicle parameters like velocity, mass, acceleration, resistance etc. are stored and ingested similar to the simple energy model.
Visual rendering of routes and anticipated ranges are built on Jupyter notebooks. These visuals in 2 show the energy efficient path and range estimation. Maps are interactive with users being able to change start and goal pins which generates an optimal route between two points. The size of map is determined by the user with a caution to avoid taxing the API limits from the OpenStreetMaps service.
Most internal instructions and user inputs are relayed to models via controller []. A configuration file contains vehicle information such as: model name, configuration details (user modifiable), requirements, including the range coverage, and starting coordinates. All required packages and FASTSim model installation needed to prepare the controller is provided and installed on initial setup.
An .env file is created to access the API keys. API keys are not provided in the .env file located in repositories and reproducibility capsules Code Ocean to mitigate the concerns about privacy. Details on installing the API keys are found in the provided README. Required information extracted from API’s from prior runs were stored and used as historical inputs for the reproducibility capsule.

## 3. Usage and examples

Two examples are given in main.ipynb using both analytic and FASTsim models. Necessary packages are listed in requirements.txt which can be installed by running using python version 3.7 or newer. Details on the required environments are given in the software documentation.
Additional installation is required to install the FASTSim Energy Model. This installation requires navigating to the directory that contains the FASTsim source code, and is installed by running . Note that the software can run without FASTsim if the user is not interested in high accuracy outputs.
Three API keys are used in the software; Google Maps Elevation API Key, Weather Key (Open Weather API) and Tomtom Traffic API Key. Elevation, temperature, humidity, wind speed, wind heading, visibility etc. information are extracted using these sources. A .env file must be created in the root level containing the API keys as described in accompanying documentation. config.py contains information for four vehicles and environment data which can be changed according to user requirements.
The Simple Energy Model uses the energy calculated based on [
• Fiori C.
• Ahn K.
• Rakha H.A.
Power-based electric vehicle energy consumption model: Model development and validation.
]. This simplified model is fast to compute allowing a user to find an energy efficient between two movable markers on an interactive map (shown in Fig. 2(a)). Conversely, the FASTSim Energy Model differs in computation time and fidelity of final routes. Fig. 2(b) shows the FASTSim generated path between the same markers (shown in Fig. 2(a)). In this comparison, the default starting point (blue marker) is set to Utah State University (located in Logan, Utah). This has been set to be the default start location when users do not defined their own.
EVPRE searches for an electric vehicle profile which needs to be declared in config.py. The 2012 Ford Focus EV model’s information has been used in generating example plots. We note that this is the default EV profile as validation tests for accuracy of EV models were conducted largely on a fleet of Ford Focus EV’s.
EVPRE visualizations and route outputs (generally energy efficient routes and isochrone images) are found in main.ipynb. The isochrone image in Fig. 3 gives an easy visualization to understand the range estimation of a particular vehicle at a specific start point. Each color in the gradient denotes another 10% power consumed of the considered vehicle’s battery. The green region is the most efficient and results in keeping batteries in the safest operating condition. The red regions denote the expected range of the vehicle where approximately more than 50% battery should be drained.
This range prediction is dependent on elevation and choosing start points at higher elevation will result in extended range. We caution users that the range of vehicle does change significantly when starting at tops or bottoms of hills and other drastic elevation changes.

## 4. Impact

This software returns the most energy efficient route for EV operation. Energy efficient paths improves the range of electric vehicles, allows drivers to keep batteries in healthy operating regions, and helps reduce the range anxiety.
Tesla has begun to respond to the greater needs of accurate modeling and has recently implemented an improved algorithm based on weather and temperature data to perform higher accuracy range prediction. Tesla’s updated routing system measures energy usage by distance, changes in elevation, and native vehicle information. This improved capability is useful for operator of their vehicle, but is not extensible to those seeking to understand energy constraints, range, and optimal routes for their specific vehicle.
While many route planning software exists (Google Maps, Waze, Apple Maps, Tesla route, etc.), these often take aggregate roadway information rather than specific vehicle considerations. This algorithm considers additional factors helpful to long distance travel and dense roadway commutes where regenerative braking and acceleration play a significant role by modeling the power profiles of both actions on battery and range. The use of weather information (wind conditions, humidity, and ambient temperature) also has significant impact in predicting the range proficiently as demonstrated [

C. Bailey, B. Jones, M. Clark, R. Buck, M. Harper, Electric Vehicle Autonomy: Realtime Dynamic Route Planning and Range Estimation Software, in: International Conference on Intelligent Transportation Systems, ITSC, 2022.

]. As this software is open source, any user or organization may make use of the findings and component parts for their applications.
EVPRE gives range models helpful to policy makers, individual actors, and corporations seeking to understand vehicle range. This tool is far superior to other offerings in this regard as no other tool currently gives general vehicle range estimations for electric transportation systems. As EVPRE is capable of simulating ranges for multiple types and classes of vehicles, it is better suited to make personal decisions or inform policy makers on real requirements for charging, charger placements, and EV adoption. This tool is provided in the hopes that public and private users may benefit from additional insights as they make decisions on adoption of EV technology, navigation and routing, and assessing their power needs.

## 5. Ongoing development

Currently, some multi-objective optimization algorithms are being integrated with this software to enable route optimization which fulfills multiple objectives such as time, energy and traffic. Pareto Optimal frontiers are planned to be used to obtain optimized paths where algorithms like RRT* (Optimal Rapidly exploring Random Tree), Monte-Carlo, Brownian Bridge etc. will be tested. Graph generation algorithms like A*, RRT*, SBMPO (Sampling Based Model Predictive Optimization) etc. are being explored to better streamline search to return solutions quicker to users.

## Declaration of Competing 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.

## Acknowledgments

We would like to thank the NSF ASPIRE ERC ( 1941524 ) for supporting this research.

## References

• Ferreira J.
• Monteiro V.
• Afonso J.
Dynamic range prediction for an electric vehicle.
in: 2013 World Electric Vehicle Symposium and Exhibition, EVS 2014. 2013
• Varga B.O.
• Sagoian A.
• Mariasiu F.
Prediction of electric vehicle range: A comprehensive review of current issues and challenges.
Energies. 2019; 12 (URL https://www.mdpi.com/1996-1073/12/5/946)
1. C. Bailey, B. Jones, M. Clark, R. Buck, M. Harper, Electric Vehicle Autonomy: Realtime Dynamic Route Planning and Range Estimation Software, in: International Conference on Intelligent Transportation Systems, ITSC, 2022.

• Fiori C.
• Ahn K.
• Rakha H.A.
Power-based electric vehicle energy consumption model: Model development and validation.
Appl. Energy. 2016; 168 (URL https://www.sciencedirect.com/science/article/pii/S030626191630085X): 257-268
2. . Transportation & Mobility Research, FASTSim: Future Automotive Systems Technology Simulator, URL https://www.nrel.gov/transportation/fastsim.html.

3. . Model View Controller, MVC, URL https://developer.mozilla.org/en-US/docs/Glossary/MVC.