An EV motor draws power from the battery under throttle and reverses the flow — pushing power back into the battery — under braking via the inverter, recovering kinetic energy that a friction brake would waste as heat:
P(t) = throttle · P_max // throttle > 0: discharging
P(t) = brake · regen · P_max // throttle < 0: regenerating (sign flips)
dSOC/dt = −P / (capacity_kWh · 3600) · 100
v' = v + (P / mass) · dt (clamped 0..v_max)
- Throttle / brake — positive values draw power from the battery to accelerate; negative values apply regenerative braking that feeds power back in.
- Battery capacity — total energy storage; larger packs drain slower per km and give more range.
- Regen braking strength — fraction of braking energy recovered into the battery instead of lost as heat.
- Recharge to 100% — instantly tops the battery back up, useful for exploring range at a fixed charge.
This bidirectional power-flow visualization is exactly how EV dashboards (Tesla, BYD, etc.) display "power" gauges swinging between acceleration and regen, and is the core reason EVs recover far more energy in stop-and-go driving than combustion cars.