# Car acceleration physics

1. Sep 7, 2008

### tarik666

Hey guys I need a bit of help with car physics type thing. I am trying to create a simulation of a car moving in a straight line. I have been searching the internet for two days but have not been able to find much.

I want the user to input the cars torque and then on a little simulation the user presses up and it does exactly what a car would do if you pressed down on the accelerator.

I need some help thou. What I have figured out lately is things live
velocity
acceleration
mass
momentum
torque
rpm
horsepower
force
energy
air resistance
friction

but I want to completely simulate a car on a road with air resistance. I have tried and tried but my figures are not. I need some formulas like how to convert the energy into speed and how to convert horspe power into energy.
I have a formula for converting torque and rpm into horsepower but I have no idea how to convert torque into rpm. Any help would be appriciated. Thanks

2. Sep 7, 2008

### mordechai9

I think you would benefit from first creating an organizational strategy. In particular, you should first separate the types of data which you are working with. Some data will exist as input parameters; things like the car's horsepower, torque, red-line parameter, drag coefficient, etc. You can build up sets of input parameters corresponding to different cars, and so on.

Next, isolate the parameters which are known as "control" parameters. These are things like the gas-pedal, break-pedal, and so on, which the actual driver of the car controls; these are somewhat similar to the inputs mentioned above, but they are still a separate category.

Finally, you want to set up your other parameters as functions of the input and control parameters. Then, the simulation basically must accomplish the task of computing these other unknowns.

You will certainly be able to find expressions and information to construct a model. I'm sorry but it is asking quite a lot for someone to provide all of these expressions for you. If you made a more specific inquiry, I'm sure people would be able to furnish you with some help. However, your main resources for this endeavor should be books. Look up some books on car mechanics, or automobile engineering, and so on, and you should be in good shape.

3. Sep 7, 2008

### Staff: Mentor

This is asking a lot, and the equations should be easy to find (mostly it's newton's laws of motion), but a few things:

Torque doesn't get converted into RPM.
Horsepower doesn't get converted into energy (you can multiply by time to get energy, but I don't know why you'd need it anyway).
horsepower is rpm times torque
Torque times the diameter of the tires gives you the force. acceleration is force/mass
For a car, wind resistance (force) is drag coefficient times velocity squared

You'll need a bunch of assumptions and givens, like drag coefficient, friction loss in the car's transmission, mass, the car's torque curve (perhaps in table form), physical dimensions, etc.

4. Sep 8, 2008

### tarik666

I did some reading up and studying here is what I have so far.
Firstly I set some variables

brake=0;
global.speedy=0
global.force=0;
global.velocity=0;
acceleration=0;
mass=1000;
momentum=0;

Then in the game loop here is what I did

also one thing.
Once I have figured out wind resistance force how do I apply it to the car?
Cause the wind resistance force is larger than the cars force at the moment it I just say
speed-=resistance

acceleration=global.force/mass
global.velocity=global.velocity+mass*acceleration
momentum=global.velocity*mass

speed.y-=brake
speed.y+=acceleration
y-=speedy

global.speedy=acceleration/30*3600

and the above is to figure out the speed at which the car is moving. I dont quite know the forumula.

Anyways, a few questions what role does momentum play
what is torque and rpm, i know the formula to find horse power using them
(torque*rpm)/5,252 = horsepower.

so when the driver pushed full pedal down he applys what to the car, more torque, more energy I dont know?

At the moment in my code I just say if key_press up
{
apply more force
}

and finally brakes. How should I do brakes?
thanks for the help so far:D

Last edited: Sep 8, 2008