Physics of car racing. I Need help.

I have played with the idea of creating my own Fantasy Racing Simulator for the past couple of months and have now decided to get more serious about it and I need a bit of help.

The program will accept variables (ie. wing adjustment), hash through an algorithm, and spit out how fast a car went around a track. However, to make this work I need some physics instruction. I will give a couple of examples:

Car ‘A’ travels down a long straight accelerating to maximum speed. What variables would I have have in order to know what max velocity is and how would I calculate it? Horsepower, drag, gear ratio, mass, wing downforce, tire friction is what I can think of. Am I missing something? What would the formula be?

Car ‘A’ approaches a corner and must slow down. Gravity(?), brakes, wings, tire friction, and engine rpms slow the car down while the inertia(?) keeps the car going forward. How do I calculate deceleration?

Car ‘A’ races into the corner. First off, how do I calculate the arc of the corner? What speed does the car have to get down to in order to make it around and not slide off the track? Mass, wing downforce, tire friction all work to keep tho car on the track. The velocity of car ‘A’ works to keep it in a straight line. Did I miss anything? What formula would be used to calculate whether the car makes the corner or not?
Once I get the formulae, the development is the easy part.
Thanks in advance for the help.

I want to qualify this by saying that while I’m a local area race car driver and car owner and I know a fair amount about how a race car works, I don’t keep mathematical equations describing a race car in my head. With that in mind, I’ll give you a few suggestions.

You don’t really say what kind of a car your are talking about. There are big differences between the types of race cars. If you are talking stock cars (ie. similar to NASCAR) I recommend that you look for books by Steve Smith.

You would want horsepower at the wheels, or else you will have to account for the drag in the drive line. This is actually somewhat variable as well depending on the pinion gear angle (rear wheel drive car) and the temperature of the oil in the transmission and rear end. Also remember that traction is not just dependent on tires, but also the track surface. This changes with temperature as well.

You would also be looking at things like compression ratio of the engine, throttle position (we don’t really let off the gas all at once), and the suspension geometry (how the suspension is dealing with these forces).

Here is where you would have to get very seriously into the suspension geometry. There is really too much to try to explain (and I don’t know the equations). There are $200+ software packages that just simulate the front suspension geometry. You could really bury yourself in calculations. I guess what I’m trying to say is that you should check out the writings of the author I mentioned and decide how far you want to get into it. Personally, I would go more for feel than exact physics.

For cornering, decelleration, and acceration, the limiting factor is always the amount of traction available to the tires. Wings help, (a lot) but bottom line is if you try do something that exceeds the available grip you are in trouble.
For example let’s say your race car can pull 1G through corner A. If you enter corner A at and try an pull 1.05G you will hit the wall. Also available traction changes throughout the race, as tires wear, fuel gets burned, and the track changes. A race car with a full tank that handles great, might be a pig with an empty tank. A car that pushes early in the race, might be loose by the end.

All you wanted to know and more about the physics of auto racing.

I’ve never read it, but:

Physics for Game Developers

Thanks for the help. I’ll start compiling the formula and see what I can do.

I do not think I explained this very well. Essentially the game is a function that returns race results based on the parameters fed into it. The managers submit their car specs to be processed through the algrrithm. This same concept is done for hockey. Here is an example of it.

The people play the part of management rather than driver. You hire drivers and pit crews to help you along but there is no graphical display. Your team makes money from good results and sponsers which can then help you afford better drivers and such.
What I am looking for is if car ‘A’ weighs ‘m’, has fins providing a downforce of ‘d’, tire adhesiveness of ‘ta’, and a velocity of ‘v’ with a corner degree of ‘cd’, how do I calculate how fast the car can go and still stay on the track. Exact formula(e) would be most appreciated.

Just read bughunter’s link. Very informative.

There are people who have spent their entire lives studying this. There are virtually innumerable factors that can affect a car’s performance, some of which may be less than obvious to a layperson.

The question is how realistic do you want this? You could probably make something simple using just the factors you mentioned. There are no “exact formula(e),” just approximations of varying reasonableness. A websearch may turn up something to suit your needs, but most likely you will have to derive your own using only the variables you want to consider.

You are most likely right Max_Castle.

Basically the factors I listed, I feel, will give enough variation that the people participating could tinker and tweak with their cars and get reasonable results.

I am just feeling a little lost as my physics days are far behnd me.

My advice in the first post was similar to what Max_Castle said (even if I didn’t word it very well). Now that you have cleared things up a little in regards to what you are coding, I can give you a bit of a different twist. Since you are writing from a team team point of view, I would also consider other things.

If you still want to get involved with the physics of cornering, you are really going to have to look at corner weights and spring rates at a minimum. Many race cars run without wings or spoilers, but most have suspension (springs). Even karts which have no springs rely on the flex of the chassis for adjustment. I would probably switch the “spoiler” setting to a “downforce” setting that implies the downforce of the entire car. Let them dial in more downforce, but increase their drag. Their handling may improve, but straight away speeds will decrease. Using this along with different track and horsepower combinations will give the players different strategy options.

As far as engines, allow them to tune for fuel mileage or horsepower. With better fuel mileage, they may be able to skip a pit stop or something, but they will be down on horsepower. Allow them drivers that are conservative or that drive right on the ragged edge. Also remember that money buys speed. There should be a way for them to kick in more money to go faster. You wouldn’t need exact chassis setup, just allow them to decide if they are going aggressive or conservative on the setup. An aggressive setup may miss completely and get a poor finish, but it may also earn an underfunded team a win.

An interesting twist would be to allow competing as we call it. In other words, let them decide if they want to bend the rules. This could give them added performance at the cost of fines and possible point deductions as well as loss of face with the sponsors. All racers compete in this way. Trying to exploit the grey areas in the rules is a big part of the game. It’s just a matter of how blatent you decide to be and how many risks you want to take.

You should check netKar first. It is maybe the best racing simulator out there. And it is free! (you ll need a steering wheel to play it though). Their website is http://www.nkzone.com/

There is also an english forum there. The guys who made the game will give you lots of information.