Simple friction formula for a car I am making a 2D driving video game, and I would like to know the "simple" formula for calculating the friction force between the car and the road. I have read lots of friction diagrams involving balls rolling down inclined planes, but I'm having trouble applying it to this problem.
Consider a car driving on a horizontal road, with some coefficient of friction, $\mu$. Its velocity is $v$, mass is $m$, and a constant driving force is accelerating the car at $a\ \mathrm{m/sec}^2$ in the forwards direction. What is the friction force, $F$, that acts on the car in the backwards direction?
I guess that the friction force is proportional to the car's speed, but I can't explain this guess. The reason I think that is because of a handful of case studies. Say that the driver's foot is on the pedal such that the car will get up to $16\ \mathrm{m/sec}$:


*

*If the car's velocity is $0\ \mathrm{m/sec}$, there is no force accelerating it backwards (it is stationary).

*If the car's velocity is $8\ \mathrm{m/sec}$, the friction force accelerating it backwards must be less (in magnitude) than the driving force, and hence the car keeps accelerating.

*If the car's velocity is $16\ \mathrm{m/sec}$, the friction force accelerating it backwards is equal (in magnitude) and opposite to the driving force, and hence the car maintains a constant velocity.

*When the driver releases the pedal, the same friction force accelerates the car backwards, but now there is no driving force, so the car drifts slowly to a halt.


It would therefore make sense that $F \propto -\mu v$, such that in the first case, $F = 0$; in the second case $F = -\frac{1}{2}ma$; in the third and fourth cases, $F = -ma$, where $a$ is whatever acceleration is required to maintain a constant velocity of $16\ \mathrm{m/sec}$. But I can't figure out the exact relationship between $F$ and $v$, or explain why they are proportional.
 A: I stumbled on a reference which summarizes what I think is the most correct answer to this question.  You have several options, but I think we should only use terms that we have a physical reason to write.  Here's the reference:
http://usna.edu/Users/physics/schneide/Buick.htm
They use a lot of unnecessary details like time between stopping that we're not interested in.  I agree with their graph but not their equation.  So here is my equation to explain their graph.  I also limited it to flat roads (no hills).
$$F = \frac{P_0}{v} + \mu mg + c \rho A  \frac{v^2}{2}  $$
From the reference, known values about their car are:


*

*The weight, $m=1800 kg$

*The front area $A = 3 m^2$


I report these because there is no direct measurement available.  I would then use their data to evaluate the three coefficients that determine the relative friction from each thing.

They put a constant term in the transmission factor (the 1/v term).  I don't like this, because I want clean mathematics, so I'm bunching that long tail of transmission with the friction coefficient.
$$ \mu (1800 kg) (9.8 m/s^2) = 200 N + 250 N = 450 N \rightarrow \mu = 0.026 $$
$$ \frac{P_0}{15 m/s} = 500 N - 250 N = 250 N \rightarrow P_0 = 3750 W$$
$$ c (3 m^2) (1.3 kg/m^3) \frac{(31 m/s)^2}{2} = 500 N \rightarrow c = 0.27 $$
These are all consistent with what the link claimed, aside from the cases where I willfully used a different kind of definition.  Another good thing that these all have physical interpretations, which those units are suggesting.  I will avoid getting into the exact interpretation because I feel like there's space for quibbling.
I plotted this on Wolfram alpha.  This is my altered version of that link.

This fits expectations fairly well.  Take note, however, of the 1/v term.  That represents fuel consumption due to constant loads (thus, units of power, of course).  That might not be relevant if you're looking for a force, but it can be kind of interpreted as a force.  It's a force the engine is exerting against itself (to some fraction of that number) due to idling.  It is also the constant electronic loads on the battery... and the charging of the battery itself.  It's not the friction of the wheels on the road of air on the car.  If you're only interested in those then you might do well to just take the last two terms.  If you do that, however, there is no concept of maximum gas mileage, nor should there be.  What you're going to do with these terms depends on the application.  I just believe this to be the best available option so I posted it.
A: This is the figure I mean above in the comments for question. The units in the figure are a bit weird, but If I do this correctly...
Wh/mile = J/hh/mile = Nmile/hh/mile = N
So, y-axis has force and x-axis has velocity (you may want to check the above). This shows that tires have nearly constant friction force respect to velocity. 
The figure is from www.teslamotors.com/blog/roadster-efficiency-and-range and the points go to Zassounotsukushi for revealing this web page (@Z you may want to make the correct answer, I am just posting this because of the figure).

A: Your case study is erronous if you are only considering friction between the tyre and the ground. For a body that is rolling with uniform velocity, there is no need for friction to act. In rolling, there is no relative displacement at the point of contact, so we use static friction. Static friction is NOT $\mu_smg$, that is only its maximum value. For a body rolling uniformly, friction is zero in the absence of other forces. 
When a car accelerates, the friction force is forwards. For a body to accelerate, there must be an external force. There are two external forces here, gravity (useless for forward acceleration), and friction. The car 'pushes' back on the ground, and the ground exerts an equal and opposite forward push. Thus push manifests itself as friction. A similar thing happens while walking; friction need not always oppose net motion(it opposes relative motion). In a car, the treads do not move with respect to the ground for the duration of their contact, so there is no relative motion to oppose. The friction is free to choose its direction based on the other forces.
So, in each of your cases, the frictional force will be (mass of car)x(acceleration) forwards.
If the car is skidding, then you need to apply kinetic friction, which will be constant and equal to $\mu_kmg$. It will oppose the spinning of the wheels.


What you actually want is the drag forces due to viscosity and the internal friction forces(at the axle).
The internal friction force will probably be a constant for the car, you could approximate its torque to $\tau=r_{axle}\times\mu_{axle}mg$. Now, due to this torque, there will be a frictional force $$\frac{\tau}{r_{wheel}+\frac{I_{wheel}}{m_{car}r_{wheel}}}$$ (I is moment of inertia). I calculated this with similar concepts as "balls rolling down inclines", so I doubt you want the derivation here. Now, this force will be backwards, and it will retard the car. Since you're programming for a game and need a formula with values plugged in, I'll give you typical values of any constant you need(ask in the comments=).
Due to drag, there will be a drag force $\approx Bv$, where B is some constant.
Really, the easiest thing to do would be to set the retarding force as $$A+Bv+Cv^2+Dv^3....$$. You may set higher order terms to zero if you wish. What I've given above lets you calculate $A$ (since the frictional force described above is constant), and tells you where $B$ comes from, but such a formula would be better for programming purposes (The $v2$ etc terms come from the fact that cars are not simple bodies). You can fiddle around with values till you get something that feels realistic in your simulation (then use a variety of nearby values for different cars). I suggest you keep A to be the calculated value, though. Right now, it would be good to create a method getFriction(Car c, Velocity v), and have some dummy code in it till you have finished with the rest of the program. Then you can plug in the formulae and fiddle with them to see how the end result looks.
A: Just to clarify, you mean the friction between air and the car (this is called drag, see e.g. stokes law http://en.wikipedia.org/wiki/Stokes%27_law). There is some friction in the bearings of the car but this is negligible to the resistance of the air.
The rest of the answer assumes that you mean drag.
You are right: the first degree approximation to drag force is that it is proportional to the velocity. You can also use higher order approximations (e.g. F = kv^3), but it makes the calculations quickly very difficult (depending of course how do you want to solve them).
How I would write this is (' means derivative respect to time, x is place, m and k are constants, a is acceleration)
f = ma + kv = mx'' + kx' => ax'' + bx' + c = 0
This is now a general differential equation (a,b,c are constants). This helps later if you have lots of forces in your system.
A: The confusing part in calculating the friction of a car tire on the road is that where the tire contacts the pavement it’s not moving relative to the pavement. For some reason it’s difficult for people to understand. If a car is going 60 m/h where the rubber contacts the pavement the speed is 0 and the top of the tire is going 120 m/h. So the coefficient of friction for the tire pavement contact is static. The coefficient of friction of a dry tire on dray pavement is approximately 1. Conditions: 1) Say you’re going 60 m/h and you slam on the brakes the static contact is broken and you start slipping so the mass of the car comes in to play and you apply kinetic friction formulas.  2) How hard do you step on the brakes before static friction gives in and that is momentum over kinetic friction. 3) If the car is turning on a curve the mass of the car and the radios of the curve will establish the angular momentum and this will give you the speed at which static friction gives and the car starts skidding. 
Now your coefficient of static friction is almost arbitrary as far as the game goes. Consider the extremes a 5” wide car tire cold and smooth pavement Vs a formula One 18” wide sticky rubber and hot on a rough track. That gives you a pretty wide rage to play whit.
A: You want a friction acceleration of the following form:
$$ A_f = - A - Bv - Cv^2$$
where you fit $A$, $B$, $C$ to three flat-road tests of how long a car will coast to a given reference speed (say 5mph) from 10mph, 45mph, and 65mph (1m/s \approx 2 mph).
$A$ is the slow-speed reduction in speed per second, whose origin is solid friction in interior components, $B$ is the exponential decay rate of moderate speeds, while $C$ gives the air drag for ultra-fast speeds. I estimate
$$A \approx {1\over 2} mph/s$$
$$B \approx {1\over 20 s}$$
$$C \approx {1\over 800} {1\over \mathrm{mph}s}$$
These estimates are based on the observations that it takes about 10 seconds to go from 10mph to 5mph, that if you are driving 40, it takes about 15 second to coast to driving 40/e, and the crossover for solid friction to air-friction is around 55mph, and correcting for mutual dependency. If you want better values, you need a car and a stopwatch.
A: You will have to track the motion of the wheels. If the wheels roll, then a small constant coefficient of friction applies. When the wheels slip, a larger coefficient of friction applies. Both do not really vary with speed.
Assuming you have hills (up/down) then you have to track how much weight % is on the front or the back to get your total friction/traction available. The rotational motion of the wheels get affected by the engine torque and the friction available.
A: The simplest formula I know of is $F_f=(\mu)F_n$. This simply states that the force of friction equals $\mu$ times the normal force. Easy.
