The model
These are the equations behind every number on the site, in the order the model uses them, with the constants. The code is a cell for cell port of our spreadsheet and the test suite checks that the two agree on every build. The source is GPL-3.0 and the data files are here. The last sections cover what the model leaves out and why, and how it is checked.
Notation and constants
| Symbol | Meaning | Value or unit |
|---|---|---|
| v | road speed | m/s (1 mph = 0.44704 m/s; v_kph = 3.6 v) |
| m | vehicle mass | kg, the EPA equivalent test weight unless typed |
| g | gravity | 9.807 m/s² |
| rho | air density | kg/m³; 1.16708 at 862 ft, 68 °F, dry air |
| rho_ref | EPA dynamometer reference density | 1.16712 kg/m³ |
| eff_dt | drivetrain efficiency, battery to wheels | 0.912285 = 0.99 inverter × 0.95 motor × 0.97 gearbox |
| eff_rt | battery round trip efficiency | 0.9409 = 0.97 in × 0.97 out |
| eff_wall | wall to battery, AC level 2, full charge | 0.864 |
| P_acc | accessory load | 650 W on the trip pages; 250 W on the drive cycle page (the EPA test figure) |
| E_u | usable battery energy | kWh |
| t_d | charger detour per stop | s; default 300 s (5 min) |
| SOC | state of charge as a fraction of usable energy | 0 to 1 |
| 1 mile | 1609.344 m; 1 kWh = 3.6 × 10⁶ J; 1 gallon of gasoline = 33.705 kWh (EPA) |
Road load
Road load F is the force in newtons needed to hold a steady speed on level ground. We use the EPA coast-down coefficients when a vehicle has them and the aerodynamic form when it does not.
Coast-down form (preferred)
EPA publishes target coefficients A, B and C for every certified vehicle, in lbf, lbf per mph and lbf per mph². We convert them to newtons and km/h and scale the C term to the day's air density:
A_N = A × 4.4482216152605 (lbf to N) B_N = B × 2.7639967684103 (lbf/mph to N per km/h) C_N = C × 1.71746796732724 (lbf/mph² to N per (km/h)²) F_cd(v) = A_N + B_N × v_kph + C_N × (rho / rho_ref) × v_kph_air × |v_kph_air| v_kph_air = 3.6 × (v + v_wind) wind acts on the aerodynamic term only
The signed square makes a tailwind faster than the car a push instead of a drag.
Aerodynamic form (fallback)
F_aero(v) = 0.5 × rho × (v + v_wind) × |v + v_wind| × Cd × Af + Crr × m × g
Cd is the drag coefficient, Af the frontal area in m², Crr the tire rolling resistance coefficient, from maker specifications or our own estimates. They are not fitted to any published range.
Energy per mile and range at a steady speed
e(v) = ( F(v) / eff_dt + P_acc / v ) × 1609.344 / 3.6e6 + e_elev kWh per mile R(v) = E_u / e(v) miles
F/eff_dt is the battery energy per metre needed to push the car, P_acc/v spreads the accessory load over the distance covered each second, and e_elev is the elevation term below, zero on level ground. e(v) is floored at 0.01 kWh per mile so a large descent cannot make range infinite. There is no battery temperature term and no speed dependent drivetrain efficiency; see what is left out.
The energy chart splits e(v) into the road load terms, the drivetrain loss F × (1/eff_dt − 1), the accessories and the elevation term. They add up to e(v).
Air density, wind and elevation
Moist air density
From altitude h in metres, air temperature T in kelvin and relative humidity RH as a fraction:
p_dry = 101325 × (1 − 0.0000225577 × h)^5.25588 Pa, standard atmosphere p_vap = 0.378 × RH × 610.78 × exp( 17.27 × (T − 273.15) / (T − 35.85) ) Pa, water vapour correction rho = ( p_dry − p_vap ) / ( 287.05 × T ) kg/m³
Humid air is slightly less dense, so humidity lowers drag a little. Altitude, temperature and humidity change rho only.
Wind
A steady headwind v_wind (negative for a tailwind) is added to the car's speed in the aerodynamic term only. Rolling resistance and the A and B terms do not see it.
Elevation
You enter the total climb h_up and total descent h_down, both positive, over a distance d in miles from a route planner. The energy budget over that distance is
E_climb = m × g × h_up / eff_dt J, paid through the drivetrain W_down = m × g × h_down J of height given back W_road = F(v) × d × 1609.344 J, the road load's own work over the distance W_direct = min( W_down, W_road ) gravity pushing the car directly E_descent = −W_direct / eff_dt − ( W_down − W_direct ) × eff_dt × eff_rt e_elev = ( E_climb + E_descent ) / 3.6e6 / d kWh per mile, added to e(v)
On a grade too shallow to need braking, gravity does part of the road load's work. The motor supplies that much less, so each joule of height saves 1/eff_dt joules from the battery and nothing passes through regeneration. That holds until gravity supplies the whole road load. Height energy beyond that has to be braked away and returns through the drivetrain and the battery round trip, eff_dt × eff_rt (0.858).
The page knows the total descent and the distance, not the shape of the road, so it takes the descent as spread evenly over the distance. That is the gentlest road that fits the entry and therefore the most favourable one: a route that packs the same descent into a few steep grades brakes more and saves less. At 70 mph a typical crossover's road load equals a grade of about 2.5 percent, so most highway descents are direct.
The leg you enter is taken as a sample of the route, so the terrain is assumed to continue for the whole trip. Planner totals often run high; gentle phantom ups and downs cancel, because a climb costs 1/eff_dt and the same descent returns 1/eff_dt. When the descent credit reaches half of flat ground consumption the page flags the result as a best case.
Charging time
Each vehicle's DC charging curve is a table of power P(SOC) in kW at every whole percent, from a logged session credited on the chart. Charging time is energy divided by power, summed per percent:
for each step i from SOC_i−1 to SOC_i (0.01 wide):
dt_i = ( E_u × (SOC_i − SOC_i−1) ) / ( P_avg_i × eff_rt ) × 3600 seconds
P_avg_i = ( P(SOC_i−1) + P(SOC_i) ) / 2
T(SOC_a → SOC_b) = sum of dt_i between a and b, with linear interpolation inside a step
The curve's kW is used as measured and is not rescaled when another car borrows it. Dividing by eff_rt (0.9409) charges the full battery round trip loss to the stop, so charging times run about 6 percent longer than the curve alone would give. This is the most conservative step in the model.
The plug in boost
Some vehicles charge on a higher curve for a fixed time after plugging in, whatever the state of charge on arrival. Such a vehicle carries a second table P_boost(SOC) and a duration t_boost. A stop that plugs in at SOC_a runs on the boost table until t_boost has passed, reaching SOC_e, then on the base table:
SOC_e : the level where T_boost(SOC_a → SOC_e) = t_boost
T(SOC_a → SOC_b) = T_boost(SOC_a → SOC_b) if SOC_b ≤ SOC_e
= t_boost + T_base(SOC_e → SOC_b) otherwise
The boost counts once per stop, from the arrival level, so it can save at most t_boost per stop.
The trip optimum: how fast to drive and when to unplug
A long trip is one cycle repeated: drive until the battery reaches the arrival level SOC_a, pull off to a charger, charge to SOC_b, drive on. With range R(v) at the chosen speed:
D = R(v) × ( SOC_b − SOC_a ) miles per cycle v_avg = D / ( D / v + T(SOC_a → SOC_b) / 3600 + t_d / 3600 ) mph
The best unplug level does not depend on driving speed. Write Δ = SOC_b − SOC_a and T_s(Δ) = T(SOC_a → SOC_a + Δ) + t_d for the whole stop. Then v_avg = Δ / ( Δ / v + T_s(Δ) / R(v) ), and its derivative in Δ is zero when
T_s(Δ) = Δ × dT_s/dΔ
Neither v nor R appears. Unplug when the next percent would cost as much time as the stop has averaged per percent so far, detour included. The optimum depends on the charging curve, the detour and the arrival level only, so one unplug level serves every speed.
The driving speed optimum is a brute force sweep: v from 10 to 180 mph, SOC_b from SOC_a to 100 percent, v_avg at every pair, highest wins. It usually lands far above any speed limit. It is shown as a physics result, not as a recommendation.
The sweet spot is every SOC_b that costs no more than 2 minutes over a 500 mile trip against the best. The curve is flat near its peak, so the band is wide. When the next charger is farther than that allows, the leg sets the minimum: SOC_needed = SOC_a + leg_miles / R(v), rounded up to the next percent.
One detour number. The detour is paid at every stop whether you charge a little or a lot, so one charger's detour does not change the unplug level. The trip average does, by setting how many stops you make. We checked this by brute force on random trips with detours from 3 to 15 minutes: charging to the average detour optimum at every stop matched the best possible plan.
EPA drive cycles and the window sticker
The drive cycle page runs the vehicle through the EPA city schedule (UDDS, 1369 s, 7.45 miles) and highway schedule (HWFET, 765 s, 10.26 miles) one second at a time, as the label test does on a dynamometer:
v_avg = ( v_i + v_i−1 ) / 2
a = ( v_i − v_i−1 ) / dt
F_in = m × delta × a inertial force; delta = 1.05 rotating mass factor
F_rl = road load at v_avg (coast-down or aerodynamic form, no wind)
P_w = v_avg × ( F_in + F_rl ) wheel power, W
P_b = P_w / eff_dt + P_acc when P_w ≥ 0 (driving)
= P_w × eff_dt × eff_rt + P_acc when P_w < 0 (braking, regenerated)
E = sum of P_b × dt over the schedule J; per mile in Wh/mi
range_raw = E_u / (kWh per mile)
range_adjusted = range_raw × adj adj = the vehicle's own label factor, else 0.7
combined = 0.55 × city + 0.45 × highway weighted average of the two ranges, both raw and adjusted
The adjustment factor is the EPA's 2-cycle to 5-cycle correction (40 CFR 600.210-12(d)(3)). Where the fuel economy guide gives a vehicle its own factor, we use it. The cycle page runs at EPA conditions: 68 °F, 862 ft, dry air, no wind, 250 W of accessories. The port matches our spreadsheet's cycle tabs to four decimal places and the build checks that.
Vehicles built from EPA data
Most vehicles on the site come from two public files: the EPA certification test results (road load coefficients and test weight for every tested setup) and the DOE and EPA fuel economy guide (label range, MPGe and the adjustment factor). From them:
m = equivalent test weight (lb) / 2.20462262184878 kg A, B, C = the test car's target coefficients, as published adj = combined label MPGe / combined unadjusted MPGe E_u = combined label range × 33.705 / combined label MPGe × 0.864 kWh
The last line turns the sticker into a usable battery estimate: label range over label efficiency is the energy from the wall, and 0.864 is the share of wall energy that reaches the battery in the EPA's AC charge. Where a published usable figure is typed in instead, the page says so next to the battery figure.
A label row is matched to the test cars of its certified test group, then by drive, then by name. A tested setup counts as possible only if the energy its road load needs at the wheels over the highway cycle is no more than the sticker says came from the wall, and at least 70 percent of it (typical is about 89 percent). When several setups remain and the name does not decide, each is listed as its own vehicle, least drag first. A car with no measured charging curve can use the curve of a car with the same battery pack (same maker group, same pack voltage and amp hours, usable energy within 3 percent); the page marks it as similar.
0 to 60 simulation
For vehicles with motor ratings, each motor (or axle) is an idealized envelope: full rated torque up to the base speed where torque × speed reaches rated power, constant power above it. With gear ratio G and tire radius r_t:
omega = ( v / r_t ) × G motor speed, rad/s
tau = tau_max if tau_max × omega ≤ P_max
= P_max / omega otherwise
F_motor = sum over motors of tau × G / r_t N at the road
a = ( F_motor − F_rl(v) ) / ( m × delta )
midpoint steps, dt = 0.1 s: v_next = v + a( v + a(v) × dt/2 ) × dt, x_next = x + ( v + v_next )/2 × dt
0 to 60 mph read by interpolation, with and without a 1 ft rollout;
0 to 100 km/h from standstill, no rollout
Traction is assumed perfect: no wheel slip and no launch control limit. A car with enough torque to break the tires loose simulates quicker than it can launch, so these are full grip best case times, and the page says so.
What is left out, and why
No cap on regenerative braking in the drive cycles
All braking energy on the EPA schedules is credited back through eff_dt × eff_rt, with no limit on regen power. The schedules are mild: the hardest deceleration on either cycle is 1.48 m/s² (3.3 mph per second) and the city cycle never passes 56.7 mph. That is about 39 kW of braking at the wheels on the city cycle and 55 kW on the highway cycle for a mid size crossover, and about 100 kW for the heaviest truck on the site. Any modern EV regenerates well above that, so a cap would never come into play and the friction brakes are not needed. A cap would matter for hard real world stops, which these cycles do not contain.
A fixed drivetrain efficiency with coast-down road load
We use one battery to wheels efficiency, 0.912, at every speed and load. A motor map would show efficiency falling off at low load, and the reason that does not matter here is where the coast-down coefficients come from. A coast-down is run on the complete car rolling on the road with the drivetrain in it. Most EVs have no true neutral, so the test is run with the motor commanded to zero torque: the inverter excites the windings just enough to cancel the magnets' cogging and drag, and the car freewheels through its gearbox and spinning motor. Bearing drag, seal drag, oil churning and gear mesh spin losses all end up in A, B and C, and those are the losses that make a motor map collapse at low load. What is left for eff_dt is the electrical conversion loss under load, and for a permanent magnet machine that is nearly flat over the power range the drive cycles and steady cruising use. It falls off at very low power, which the coast-down already paid for, and at very high power, which no cycle or cruise here reaches. This is also why the coast-down form is used whenever it exists.
The aerodynamic form has no drivetrain losses in it
Cd × Af and Crr describe air and tires only. Driveline spin losses are not in them, so for the vehicles that use this form (no EPA test car yet) the fixed eff_dt has to cover both the conversion loss and the mechanical losses, and the rolling resistance figure absorbs some of the rest. That is less exact than the coast-down route and is one reason those vehicles are marked as built from maker figures rather than EPA data.
Coast-down coefficients above the test speed
EPA coast-downs run from about 70 to 78 mph down to 15 km/h, and A, B and C are a quadratic fit over that range. The speed slider runs to 160 mph and a typed speed can go as high as the speed of sound; above the measured range the quadratic is an extrapolation. Aerodynamic drag does go as the square of speed, so the shape holds, but anything that changes with speed (ride height, active aero, tire growth) is not in it.
Added weight at a steady speed
With the coast-down form, passengers and cargo do not change the steady speed result. A, B and C were measured at the EPA test weight and the tire drag inside them is not scaled to a heavier car. Mass enters only the elevation term, the drive cycles and the 0 to 60 simulation. A loaded car on level ground uses somewhat more than shown. The aerodynamic form does scale rolling resistance with the mass you type.
Steady speed
Range and the trip optimum assume a constant speed on level ground. Traffic, stops and hills are not simulated beyond the elevation and wind inputs. Accelerating and braking are modelled on the drive cycle page.
No battery temperature model
Temperature enters only through air density. A cold battery charges slower and drives less efficiently, and a cold cabin costs heating energy. None of that is modelled, because there is no public data to model it from. Every maker manages pack temperature differently: resistive heater or heat pump, how cold the heat pump can run before the car falls back to resistance heating, how warm the pack is held while driving, whether and when it preconditions before a fast charge. None of it is published, it is the finest detail of a maker's battery management, and it changes with software updates. A temperature model built on guesses would be wrong in a different way for every car. The only real source is measured cold weather data for each vehicle, and when such sessions exist they belong on the charging curve, not in a formula. The model states its conditions, 68 °F and a warm pack, and leaves temperature to you. The accessory load is fixed at 650 W on the trip pages, a realistic everyday figure, and 250 W on the cycle page to match the EPA test.
One charging curve is one session on one car
Charger, battery temperature, software version and battery age all move a charging curve. A curve here is representative of the model, not a specification. A curve taken from another car with the same battery pack has the same shape but not necessarily the same minutes. The page says which kind each one is.
Charging efficiency on the stop
Dividing the charging integral by eff_rt (0.9409) assumes the kW on the curve is what the charger delivers at the car and that the usable energy goes into the cells through both halves of the round trip. It is conservative, and it is the same constant that credits regeneration, so the two uses are consistent.
Usable battery from the sticker
For vehicles from EPA data the usable energy comes from label range, label MPGe and the 0.864 wall to battery factor. Makers quote battery sizes gross or usable and rarely say which, so a sticker derived figure is often more consistent across brands than the brochure number, but it carries any error in the label. The page names the source of every battery figure.
The 0.7 label factor
A 2-cycle label is the raw dynamometer range times 0.7 unless the maker ran the 5-cycle test and earned a different factor. We use each vehicle's own factor from the guide where it exists and 0.7 otherwise, which is what the regulation prescribes.
No tuning
Every input is a sourced figure: EPA coefficients and weights, guide ranges, maker torque and power, a measured charging session. When the model disagrees with a published range or a road test, the gap is shown on the vehicles page. No input is adjusted to close it.
How the model is checked
- The code is a port of our spreadsheet; a test suite run on every build checks the two agree, including every second of both drive cycles to four decimal places.
- Every vehicle is run through the EPA cycles and compared with its window sticker on the drive cycles page; the whole roster is listed there.
- Model range at 70 mph is compared with independent 70 mph road tests on the vehicle summaries page, differences shown, outliers included.
- Model 0 to 60 and 10 to 80 percent charging times are checked against published figures in the same audit.
Short form
The same equations in one place. Units as above; v in m/s unless marked.
ROAD LOAD (N) coast-down: F = A×4.44822 + B×2.76400×v_kph + C×1.71747×(rho/rho_ref)×v_kph_air×|v_kph_air| aerodynamic: F = 0.5×rho×(v+v_wind)×|v+v_wind|×Cd×Af + Crr×m×g rho = (101325×(1−2.25577e−5×h)^5.25588 − 0.378×RH×610.78×exp(17.27×(T−273.15)/(T−35.85))) / (287.05×T) ENERGY AND RANGE e(v) = (F/eff_dt + P_acc/v)×1609.344/3.6e6 + e_elev kWh/mi e_elev = (m×g×h_up/eff_dt − W_direct/eff_dt − (m×g×h_down − W_direct)×eff_dt×eff_rt)/(3.6e6×d), W_direct = min(m×g×h_down, F×d×1609.344) R(v) = E_u / e(v) eff_dt = 0.912285 eff_rt = 0.9409 P_acc = 650 W (250 W on the cycle page) CHARGING T(a→b) = Σ_steps E_u×ΔSOC / (P_avg×eff_rt) × 3600 s, P from the measured curve at 1% steps plug in boost: run P_boost from the arrival level until t_boost has passed, then the base curve TRIP OPTIMUM D = R(v)×(SOC_b−SOC_a); v_avg = D / (D/v + T/3600 + t_d/3600) best SOC_b solves T_s(Δ) = Δ×dT_s/dΔ with T_s = T + t_d (independent of v) best v: sweep 10 to 180 mph × all SOC_b; sweet spot: within 2 min per 500 mi of the best EPA CYCLES per second: a=(v_i−v_i−1)/dt; P_w=v_avg×(m×1.05×a + F(v_avg)); P_b = P_w/eff_dt (+) or P_w×eff_dt×eff_rt (−); +P_acc range = E_u/(kWh/mi) × adj; combined = 0.55×city + 0.45×hwy EPA ROSTER m = ETW_lb/2.20462; adj = label MPGe/unadjusted MPGe; E_u = range×33.705/MPGe×0.864 0 TO 60 tau = min(tau_max, P_max/omega), omega = v×G/r_t; a = (Σ tau×G/r_t − F(v)) / (m×1.05); midpoint steps, dt = 0.1 s; perfect traction