Battery Discharge Model#
POLARIS estimates per-link energy consumption for electric vehicles using one of two discharge models, selected per scenario:
A linear regression model parameterized by EPA vehicle class (default).
A TensorFlow Lite (TFLite) neural network model that consumes a richer feature set, including the vehicle’s powertrain characteristics and the speed/length context of neighbouring links.
A third option — a fixed Wh-per-mile rate — is also available as a degenerate “model” for sensitivity studies and short-circuits inference when enabled.
The two models are mutually exclusive at the scenario level. The selection is driven by the following scenario JSON keys:
Scenario JSON key |
Type |
Effect |
|---|---|---|
|
bool |
If |
|
path |
Path to the |
|
path |
Path to the JSON file with per-vehicle-class linear coefficients. Used when the ML model is disabled. |
|
bool |
If |
|
float |
Rate used when |
When use_ML_model_for_battery_discharge is true, POLARIS must be built with TensorFlow Lite linked in; otherwise scenario setup throws. The ML path also emits a runtime warning that it is currently discouraged because it tends to overestimate charging demand — the linear model is the recommended production path.
Linear Regression Model#
For a vehicle of class $c$ traversing a link, the energy consumed (in watt-hours) is:
where:
Symbol |
Description |
Unit |
|---|---|---|
$t_{travel}$ |
Travel time on the link |
seconds |
$t_{stop}$ |
Stopped/idle time on the link |
seconds |
$\ell$ |
Link length from the supply database |
meters |
$v$ |
Actual average speed on the link |
m/s |
The interaction term $t_{travel} \cdot v^2 / 100$ captures the relationship between aerodynamic drag (proportional to $v^2$) and exposure time, which dominates energy consumption at highway speeds.
Coefficients are specified per vehicle class in a JSON configuration file referenced by ev_discharge_models:
{
"ev_discharge_model": {
"Compact": {
"Intercept": 1.5,
"travel_time": 0.02,
"stop_time": 0.005,
"length_from_db": 0.03,
"travel_time:actual_speed2": 0.0001
},
"SUV": {
"Intercept": 2.0,
"travel_time": 0.03,
"stop_time": 0.007,
"length_from_db": 0.04,
"travel_time:actual_speed2": 0.00015
}
}
}
At link traversal, the vehicle looks up the coefficient set for its EPA vehicle class and evaluates the closed-form expression.
TensorFlow Lite ML Model#
The TFLite model is a single-output neural network trained offline to predict Wh consumed per link traversal. POLARIS loads the model at scenario initialization and runs inference at the end of each link traversal.
Input features#
Each inference call passes a fixed 46-element float vector in a hard-coded order. The features fall into three groups:
Vehicle characteristics (20 features) — drawn from the vehicle’s powertrain record:
Index |
Feature |
Meaning |
|---|---|---|
0 |
EV ML class |
EPA-aligned class index used during training |
1 |
Powertrain |
Powertrain code |
2 |
Fuel type |
Fuel type code |
3 |
Automation level |
SAE automation level |
4 |
Vehicle mass |
Curb mass (kg) |
5 |
Rolling resistance |
Tire rolling resistance coefficient |
6 |
Frontal area |
Vehicle frontal area (m²) |
7 |
Drag coefficient |
Aerodynamic drag coefficient |
8 |
Accessory power |
Accessory electrical load (W) |
9 |
Final drive ratio |
Final drive gear ratio |
10–11 |
Engine peak power / efficiency |
Zero for battery-electric vehicles |
12–13 |
Motor peak power / efficiency |
Primary traction motor |
14–15 |
Secondary motor peak power / efficiency |
Zero for single-motor vehicles |
16–17 |
Battery peak power / capacity |
Energy storage system (W, Wh) |
18–19 |
Gearbox gears / peak efficiency |
Transmission characteristics |
Current-link state (10 features) — derived from the movement plan and link being exited:
Index |
Feature |
Meaning |
|---|---|---|
20 |
Link index |
Position of this link within the trajectory |
21 |
Entering time |
Time of entry to the link (s) |
22 |
Length |
Link length (m) |
23 |
Stopped time |
Time spent stopped on the link (s) |
24 |
Travel time |
Free-flow travel time (s) |
25 |
Actual speed |
length / travel_time, capped at free-flow (m/s) |
26 |
Free-flow speed |
Posted free-flow speed (m/s) |
27 |
Adjusted actual speed |
length / (travel_time + stopped_time) (m/s) |
28 |
Congestion |
$1 - v_{actual}/v_{ff}$ |
29 |
Adjusted congestion |
$1 - v_{actual,adj}/v_{ff}$ |
Trajectory context (16 features) — boundary flags and lagged/lead values from the previous and next links in the trajectory:
Index |
Feature |
Meaning |
|---|---|---|
30–31 |
First-link / last-link flags |
Boundary indicators within the trajectory |
32–33 |
Previous / next link actual speed |
Speeds on the adjacent links |
34–35 |
Speed deltas (previous, next) |
Differences vs. current-link speed |
36–37 |
Previous / next adjusted actual speed |
Stop-time-adjusted adjacent-link speeds |
38–39 |
Adjusted speed deltas (previous, next) |
Differences vs. current-link adjusted speed |
40–41 |
Previous / next link length |
Lengths of the adjacent links (m) |
42–43 |
Length deltas (previous, next) |
Differences vs. current-link length |
44–45 |
Stop flags (current, previous) |
Whether the vehicle was stopped on each |
If the previous or next link is missing or is not a drive link, the corresponding features default to zero (so deltas degenerate to the current-link values).
Output#
A single value in watt-hours, applied as the link’s discharge. No post-normalization is performed in POLARIS; any scaling is baked into the trained model weights.
Integration with Simulation#
At the end of each link traversal, the EV powertrain selects the active discharge model — the linear regression evaluator if per-class coefficients were loaded, or the TFLite inference path otherwise (which itself short-circuits to the fixed Wh/mile rate when that option is enabled).
The returned value is then multiplied by the scenario’s seasonality consumption multiplier and by a per-vehicle temperature modifier (a function of the current link’s weather impact) before being subtracted from the battery level. If the resulting state-of-charge falls below a threshold, the vehicle’s behavior may change — for example, a TNC vehicle may be dispatched to a charging station, or a personal vehicle’s driver may reroute.
References#
Detailed calibration methodologies and data sources for EV energy consumption models are an active area of research. The POLARIS linear discharge model is calibrated using EPA vehicle class data and real-world driving cycle measurements; the TFLite model is trained offline against Autonomie powertrain simulations and supplied as a
.tfliteartifact.