# How to simulate car acceleration

I am a high school physics student and I've been trying to simulate the acceleration of a car as it fully accelerates from rest, but I'm finding it's much harder than I thought. Here was my first attempt (without including air resistance):

I used the horsepower to calculate the kinetic energy of the car since power = $\frac{\Delta E}{\Delta t}$ and in this case $E$ is the kinetic energy of the car. I substituted this into $KE = \frac{1}{2}mv^2$ and after manipulating the equation I ended up with:

$$v(t)=\sqrt\frac{2\dot{}hp\dot{}t}{m}$$

After taking air resistance into account, I substituted actual hp and mass of a Ferrari and took the limit as $t\rightarrow \infty$. My simulated top speed was very close to its actual top speed, but something wasn't right. The acceleration curve is decaying and at $t=0$ acceleration is infinite.

One source tested the acceleration of a few super cars from 0 to 60 and the acc vs time curve looks like this: After more research, I figured I must take into account torque, gear ratios, and RPM, but it only confused me more. Does anyone have any insight to make a realistic simulation, what equations to use, or which properties of the car are relevant? One car I would like to use for the simulation would be the Koenigsegg Regera because it has one fixed gear, which I thought could make calculations more simple. Thanks for any help or advice.

(Update)

Thanks to previous answers, I have found out that I can use a torque curve to relate the engine's RPM to torque, and thus solve for acceleration. The only problem that remains is how to find the rate of change of engine rpm. Consider a car at rest is running at 1000 rpm. If the driver then completely floors the throttle, how would I figure out how fast the rpm increases and approaches redline? To my current understanding, I need this information to find the torque at any given moment.

• You are correct that torque matters more than power when accelerating – Carl Witthoft Nov 27 '16 at 12:55

The crucial thing here is that for IC engines torque is some function of RPM and so you need to consult the torque curve for a given engine to do any sort of meaningful modelling.

This is also closely related to the way the gearbox works and indeed the primary function of the gearbox is to keep the RPM withing a particular range where the engine provides the most torque. Also engine torque characteristics can vary a lot for engine to engine and some engines may have quite a narrow rev band where they are providing peak torque which drops off sharply.

It is also worth nothing that power is proportional to torque x rpm and peak power and peak torque are not necessarily the same and while power is a good guide to maximum speed torque is much more relevant to acceleration.

This is further complicated by the fact that in accelerating form a standstill different limiting factors come into play at different phases of acceleration.

During the initial getaway traction dominates ie the ability to transfer torque through the tyres to the road without spinning the wheels. Most cars are capable of delivering enough torque to the wheels to spin them from a standstill in 1st gear so you can't just assume that the maximum torque the engine can provide is available at all times as an accelerating force. More powerful high performance cars may be able to spin the wheels on any gear-change. This initial traction phase is quite difficult to model without a lot of extra information.

Also air resistance is proportional to the square of speed so it is exponentially more significant as speed increases and is indeed the limiting factor of top speed (for a given top gear ratio) in most cases.

Edit in response to comment by OP

Assuming no slip (at either wheels or clutch) engine RPM is proportional to road speed, with the constant of proportionality being the overall gear ratio, including the current gear selected, the differential ratio and tyre diameter.

In some cases the best traction is achieved with a small slip angle, although you may want to ignore this for the sake of simplicity.

If the engine in question has a relatively flat torque curve it is probably OK to use the average torque between gear change points, otherwise you have to deal with the calculus relating instantaneous speed and torque.

• Thanks for the advice, the torque curves are definitely helpful, but the part I am now stuck at is figuring out what the rpms would be at any given point in time of the accelerating car. From there I would be able to model the torque vs time and then convert it to acceleration and velocity... but without knowing how the rpms change with time there is no way to do this. – Ryan Nov 28 '16 at 21:32

Real-world torque at standstill:

This is not your main area of concern but needs addressing so that you can then properly deal with the main issue.

at t=0 acceleration is infinite.

Indicates (as you are aware :-) ) a basic misunderstanding or misapplication of formulae.
Where one formula produces results that do not match known reality, it can help to do a "sanity check" using other formulae which should give the same answer but by using a different approach. If (when) they fail to do so, looking for the apparent contradictions can help you to identify incorrect assumptions and applications of formulae to reality.

A very well known basic formula is f = m x a. - Force = mass x acceleration.
Rearranging - a = f/m
For acceleration to be infinite mass must be zero or force must be infinite.
In this case the relationship between power and torque and rotational velocity are liable to be misleading you.
In an ideal system torque is inversely proportional to power when both are plotted against rotational velocity.
ie Torque = Power/RPM x k (k adjusts to get units numerically correct).

This suggests that for a given supplied power Torque becomes infinite at zero RPM.
This is true only if there are no losses and if the energy source is able to be properly matched to the load. To transfer power from a rotating energy source ('motor') to a stationary object (wheel, axle, driveshaft, gear, ...) requires an infinite ratio gearbox, 'which we have not got'.

The closest example in 'everyday' automotive reality is electric motor driven vehicles where maximum torque occurs "at rest" as the electric motor can deliver torque without rotation. One limitation to how fast a modern electric sportscar 'comes off the line' is providing a drivetrain that will not shatter under starting torque but which is not excessively oversized and expensive for its task across the rest of its operating range.

In real-world applications the motor (especially a petrol or diesel engine) power decreases at low rpm and is zero at 0 RPM so torque is also zero at 0 engine RPM. This is compensated for by initially "slipping the clutch" in a manual gearbox system and effectively "slipping the torque converter" in an "automatic gearbox" system. At standstill the motor is allowed to operate at nonzero rpm, power and torque are produced and the torque is used to apply force to the drivetrain - either via a slipping clutch or via circulating transmission fluid exerting force but no power or motion at the instantaneous moment of application. Once there is some force available, f=ma can be applied and "we're off". In electric cars (with Tesla's easily coming to mind) it is positive with some types of electric motor to produce maximum torque at zero motor rpm and "we're off" faster per available engine power than with internal combustion engines that must produce start torque in a lossy manner, as above.

The real problem - air resistance:

If your basic equations for power and energy re correct then it is likely that your comment

... After taking air resistance into account ....

indicates a very significant misunderstanding of the effects and magnitude of energy consumed by air resistance.
For cars of typical size and dimension, air resistance is THE major source of power loss at velocities above about 10 m/s. As speed increases a proper modelling of drag and energy lost to air resistance is utterly essential to calulating acceleration profiles.

A simplistic formula for air drag which is nevertheless extremely useful and which gives results close to those seen in reality is

Force (drag) = 0.5 x d x Cd x A x V^2
&
Power = 0.5 x d x Cd x A x V^3 Where:

• d = air density = 1.2 kg/m^3 at sea level

• Cd = drag coefficient
Proportion of flat-plate-drag which you can achieve by aerodynamic streamlining.

• A = projected frontal area Area you would see viewing vehicle front on.

• V = velocity

In SI units where A = m^2, V = m/2, d = kg/m^2, F = N (or F ~= kg x 10)
Power is in Watts where 1 HP ~= 760 Watts.

At sealevel this reduces to ~=

Power = 0.6 x V^3 watts per square meter for a flat plate, reduced by whatever Cd you can achieve. eg a modern blockish shaped saloon or SUV may achieve Cd = 0.6-0.8 and the very bet sportscars MAY achieve Cds of 0.2-0.3. ie you can reduce power taken by drag by a factor of 3 or 4 compared to driving in a brick shaped vehicle.

As an illustration of how much power is involved.
Assume 2 m^2 frontal area, Cd = 0.5, V = 27 m/s (= 60 mph / 96 kph)

Power = 0.6 x Cd x A x V^3 = 0.6 x 0.5 x 2 x 27^3
= 11,810 Watts
~= 16 HP

At 100 mph that increases by the cube of the velocity so by a factor of (100/60)^3 = 4.6 times to about 74 HP. At 200 mph the power taken to oppose air resistance is 2^3 = 8 times larger again at 590 HP. For vehicles with hundreds of rear wheel HP available the jump from about 75 HP at 100 mph to about 600 HP at 200 mph means top speed will be "somewhere in this range".

A lot (lot lot) more could be said on this topic, but applying the above drag and power formula as a starting point should greatly improve the match of your results to reality.

_____________________________

Torque and power:

There is commonly a very major misunderstanding of the very simple relationship of torque and power.

Torque = Power per RPM.

That's it. Tht IS the formal meaning (or one of the several different but consistent ones. There will be a constant involved depending on the uits used but it's just a "scaling factor". Using foot-pounds and Horsepower
Torque = HP x 5252 / RPM or
HP = Torque x RPM / 5252 or
RPM = HP x 5252 / Torque

Can it be that simple?
Yep!

Torque is "twisting force" expressed in force x distance.
If you lean on a 1 foot bar with 100 lbf force you produce 100 foot pounds of force. Double the force or the bar length and you double the torque.
If the bar end does not move you are not delivering any power (despite what your muscles and brain may think). Only as you apply rotation do you deliver power - see formulae above.

A useful 'trick':

An "almost right" formula is Watts = kg.m.RPM.
This almost works because various constants almost cancel. It's about 2% out but very useful for in-the-head estimations.

________________________________________________

The point where I am stuck is figuring out what the rpms will be at any given point for a maximum accelerating car... from there I can find the force and then the acceleration.

If you have an automatic transmission you can ~~~ assume that the combination of the correct gear plus torque converter action*
THEN you can assume RPM is variable around engine optimum at all times.
Optimum is (probably/usually) such that mean torque is maximised in that gear.

*A fluid drive torque converter all by itself is effectively an automatically variable gearbox across a limited range, using fluid flow to 'match' driving and driven surfaces.

eg if the "pump" (engine) rotates faster than the driven surface then the system is designed so that fluid efficiently transfers energy to the slower moving driven "plate".

If you have a manual gearbox and a competent driver then you can assume a driver will enter a gear and exit a gear at such revs that Rmax ~= redline and Rmin is the Redline /gear_ratio between this gear and the next lower. For VERY narrow power bands, redline may be above optimum speed for engine so driver will exit at such revs that overall revs in that gear produce maximum torque. If the above does not make sense then draw diagrams with rpm on and power curves and gear ratios nd play until it becomes clear (assuming no typos above :-).

Very simplistic example: Assume a gearbox with 1.5:1 ratios between all gear changes (1 to 2, 2 to 3, 3 to 4, ...) - which is very high in most cases, and an engine that keeps on building power all the way to redline with power increasing fater than RPM and redline at 9,000 RPM.
The optimum way to use this engine is to change up AT redline and to try to start it from rest such that when the clutch fully engages the engine is doing 6000 rpm (assuming your clutch can stand that). I'll leave out the 1st gear startup as that is somewhat arguable. So:

Accelerate in 1st gear to 9000 RPM.
Change 1-2
2nd gear is now running at 9000/1.5 = 6000 RPM.

Accelerate in 2nd gear to 9000 RPM.
Change 2-3
3rd gear is now running at 9000/1.5 = 6000 RPM.

Accelerate in 3rd gear to 9000 RPM.
Change 3-4
4th gear is now running at 9000/1.5 = 6000 RPM. Accelerate ...

Comment only:
I had a TY250 trials bike (still have but now sleeping in my basement waiting engine repair from long ago death).
The ratio 1st:2nd is an immense 2:1
The ratio 2nd:3rd is an immense 1.5:1
4:3 and 5:4 are somewhat more sane. Most fun and (just) possibly optimum way to accelerate was to pull wheelies in 1st 2nd 3rd and 4th successively staring with a near loop in 1st and successively lower ones as the bike desired and changing up as the front wheel kissed the ground after each wheelie. Hitting 5th usually did not produce a wheelie and you then chugged way at about 50 kph :-).

• Thanks for the answer. This points me in the right direction a little bit. I know I have the air resistance part correct already, and my confirmation is that my simulated top speed reflects the actual top speed of the tested car like I mentioned in my question. The point where I am stuck is figuring out what the rpms will be at any given point for a maximum accelerating car... from there I can find the force and then the acceleration... – Ryan Nov 28 '16 at 21:28
• @Ryan Read and apply all (correct :-) ) answers and comments and it should come out OK. How did you manage to get the air resistance part right? Formula? Assumptions (area, Cd, ...)? || If you have an automatic transmission you can ~~~ assume that the combination of the correct gear plus torque converter action (a fluid drive torque converter all by itself is effectively an automatically variable gearbox across a limited range, using fluid flow to 'match' driving and driven surfaces ) THEN you can assume RM is variable around engine optimum at all times. If you have a manual gearbox and ... – Russell McMahon Nov 29 '16 at 1:11
• @Ryan ... a competent driver then you can assume a driver will enter a gear and exit a gear at such revs that Rmax ~= redline and Rmin is the Redline /ger ratio between this gear and the next lower. For VERY narrow power bands, redline may be above optimum speed for engine so driver will exit at such revs that overall revs in that gear produce maximum torque. If the above does not make sense then draw diagrams with rpm on and power cuves and gear ratios nd play until it becomes clear (assuming no typos above :-). – Russell McMahon Nov 29 '16 at 1:20

I don't know if you're still interested in this topic, but it sort of relates to a question I had about modeling acceleration. I might be able to clear up some confusion, though, because I had the same question when I was learning how to build a similar model.

It turns out that you don't need to know "how fast the engine revs up" while the car is accelerating at maximum capacity -- at least, you don't need to know it directly; it sort of "falls out" of the simulation. The key is that as long as the engine and wheels are physically connected, all you need is an initial condition: either the initial speed of the car or the initial RPM of the engine in a particular gear. The two are "linked" via the gear ratios of the car, so you can always use one to calculate the other, then check to see what the acceleration is at that speed, then update one, then figure out the other, etc. until you decide to shift.

A basic procedure for a simple computer simulation goes like this:

(1) Start in first gear at some vehicle speed, $v_{car}$.

(2) Figure out what the engine speed is for these conditions using: $RPM_{eng}=\frac{v_{car}*\gamma_{FD}*\gamma_{trans}*(5280ft/mi)}{2*(60min/hr)*\pi * r_{wheel}}$ where I am using $\gamma_{FD}$ and $\gamma_{trans}$ to represent the final drive and transmission gearing ratios, and I'm assuming the vehicle speed is in MPH and the radius of the tire is in feet.

(3) Now you need to look at the engine's torque curve. Figure out, based on the curve, what the engine torque, $\tau_{eng}$ is at the current $RPM_{eng}$.

(4) Use the engine torque and the current gear to calculate the force at the wheels and, thus, the acceleration: $a_{car}=\frac{\tau_{eng}*\gamma_{trans}*\gamma_{FD}}{r_{wheel}*m_{car}}$ where I've left out the conversion factors this time because I don't know how you want to express the acceleration (if torque is in lb*ft then this formula would give you acceleration in terms of pounds per whatever units you used for mass).

(5) Now just use a small timestep $dt$ and Euler's method of numerical integration to calculate the new vehicle speed: $v_{car}=v_{car}+a_{car}*dt$. It doesn't matter what $dt$ is exactly; smaller values will provide a slightly more accurate theoretical simulation but the code will also run slower. I think I used 0.005 seconds. Just make sure all the units agree -- that's the easiest way to mess up!

No go back to step (2) and repeat until you decide to shift (or the engine hits the redline). For maximum acceleration you want to shift exactly when the wheel torque (or, equivalently, engine power) provided at the same vehicle speed in the next gear up exactly equals that in the current gear. Hope this helps!

A quick shortcut for a vehicle of mass $m$ is the following procedure:

1. At each vehicle speed $v$ calculate the engine rpm $n$.
2. For that rpm calculate the engine power $P(n)$ using the torque/power curves.
3. Assume a transmission loss of $\lambda=0.15$ for 15%
4. Assume a drag coefficient $\beta$ (more on this later)
5. The acceleration at this instant is $$a(v) = \frac{ (1-\lambda) P}{m v} - \beta v^2$$
6. If the coefficient of friction is $\mu$ and the % of weight on the driving wheels $\gamma$ then the traction limit is $$a_{limit} = \mu \gamma g$$
7. Apply which ever is lowest between $a(v)$ and $a_{limit}$

NOTE: You can estimate the drag coefficient $\beta$ if you know the peak power $P_{max}$ and peak speed $v_{max}$ of the vehicle. $$\beta = \frac{(1-\lambda) P_{max}}{m v_{max}^3}$$

Now you need to simulate this using a numerical integration scheme. For quick and dirty use Euler's method where at each time frame, you apply a time step $h$ by

\begin{aligned} t & \leftarrow t + h \\ x & \leftarrow x + h\, v \\ v & \leftarrow v + h\, a(v) \end{aligned}