How can I simulate a car's acceleration using torque and RPM?

In summary, the user is seeking advice on how to create a simulation of a car moving in a straight line. They have been unsuccessful in finding information online, and would appreciate any help that is available. The user has set up some variables and entered the game loop, but they still need to figure out how to apply the wind resistance force to the car. They also need to figure out how to apply brakes.
  • #1
tarik666
2
0
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
 
Physics news on Phys.org
  • #2
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
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
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 don't 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 don't 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:

Related to How can I simulate a car's acceleration using torque and RPM?

1. What is car acceleration?

Car acceleration is the rate at which the velocity of a car changes over time. It is a measure of how quickly the car's speed increases.

2. How is car acceleration measured?

Car acceleration is typically measured in meters per second squared (m/s^2) or miles per hour per second (mph/s). It can be calculated by dividing the change in velocity by the change in time.

3. What factors affect car acceleration?

The main factors that affect car acceleration include the engine power, weight of the car, and the friction between the tires and the road. Other factors such as air resistance and road incline can also impact acceleration.

4. How does car acceleration affect fuel efficiency?

Accelerating quickly can decrease fuel efficiency as it requires more energy from the engine. However, maintaining a steady speed and avoiding excessive braking can improve fuel efficiency.

5. How does car acceleration differ from car deceleration?

Car acceleration refers to an increase in speed, while car deceleration refers to a decrease in speed. Acceleration occurs when the car's velocity and acceleration are in the same direction, while deceleration occurs when they are in opposite directions.

Similar threads

Replies
8
Views
2K
Replies
7
Views
1K
Replies
9
Views
285
  • Mechanics
Replies
10
Views
1K
Replies
4
Views
3K
Replies
2
Views
794
Replies
29
Views
5K
  • Mechanics
Replies
12
Views
2K
Replies
23
Views
6K
  • Mechanical Engineering
Replies
18
Views
4K
Back
Top