For fun, I'm trying to play with really simple simulation of a Tesla Model 3. Modeling its acceleration and such. But I've hit a roadblock early on despite validating my math several times.
What I want to do is find the car's velocity at a time $t$ given the motor's (current) torque, wheel radius, mass, and a timestep $dt$, figure out how much the speed of the car should changemass.
When I look up values for this car, here's what I get:
- Peak torque: $\tau = 639\ \text{N}\cdot\text{m}$
- Mass: $m = 1800\ \text{kg}$
- Wheel radius: $R = 0.2413\ \text{m}$
Here's how I'm calculating acceleration:
$$ F = \frac{\tau}{R} \\ a = F/m \\ a = \frac{\tau}{Rm} $$
So in code, here's howConsidering that I'm updating the car's speed. dt
equals the time, in secondsmodeling torque as constant, since the last frame renderedacceleration will also be constant, so it's usually around 0.016 (60 fps)which means:
const force = torque / car.wheelRadius
speed += (force / car.weight) * dt
$$ v(t) = at = \frac{\tau}{Rm}t $$
However, after a fewwhen I plug in $t = 3.2$ (the Model 3 accelerates from 0-60mph in 3.2 seconds), the speed of my simulated carvelocity is only $\text{2-3 m/s}$$\text{4.7 m/s}$. For the actual car, it wouldIt should be closer to $\text{30 m/s}$. I thought that was odd, so I plugged some real-world approximations of how the car works into WolframAlpha to figure out how much torque it "should" have, only to see that it said $\text{3800 N} \cdot \text{m}$! That's way more thanWhere is this discrepancy coming from? Are the car's specs say.
What amofficial numbers I doingfound simply wrong here? Why is my simulated car so slow, and why does the math tell me the Model 3 should have 5x more torque than it claims to have?