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

Click For Summary

Discussion Overview

The discussion revolves around simulating a car's acceleration using torque and RPM, focusing on the physics involved in creating a realistic model for a car moving in a straight line. Participants explore various parameters such as torque, horsepower, force, and resistance, and seek formulas to accurately represent these relationships in a simulation context.

Discussion Character

  • Exploratory
  • Technical explanation
  • Homework-related

Main Points Raised

  • One participant expresses the need for help in simulating car physics, mentioning key variables like velocity, acceleration, mass, torque, and air resistance.
  • Another participant suggests organizing data into input and control parameters, emphasizing the importance of isolating these for the simulation.
  • A different participant clarifies that torque does not convert into RPM and explains the relationship between horsepower, torque, and RPM, stating that horsepower is the product of RPM and torque.
  • One participant shares their initial coding efforts and questions how to apply wind resistance force to the car, noting that it currently exceeds the car's force.
  • There is a query about the role of momentum in the simulation and how to implement braking mechanics effectively.

Areas of Agreement / Disagreement

Participants do not reach a consensus on the best approach to simulate the car's acceleration, and multiple competing views on how to handle various aspects of the simulation remain present throughout the discussion.

Contextual Notes

Participants mention the need for assumptions regarding parameters like drag coefficient and friction loss, indicating that the discussion is contingent on these definitions and values.

Who May Find This Useful

Individuals interested in physics simulations, game development, automotive engineering, or those seeking to understand the dynamics of vehicle motion may find this discussion relevant.

tarik666
Messages
2
Reaction score
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
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.
 
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.
 
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:

Similar threads

  • · Replies 17 ·
Replies
17
Views
1K
  • · Replies 95 ·
4
Replies
95
Views
7K
  • · Replies 15 ·
Replies
15
Views
5K
  • · Replies 8 ·
Replies
8
Views
3K
  • · Replies 4 ·
Replies
4
Views
4K
  • · Replies 7 ·
Replies
7
Views
3K
  • · Replies 60 ·
3
Replies
60
Views
7K
  • · Replies 9 ·
Replies
9
Views
2K
  • · Replies 10 ·
Replies
10
Views
2K
  • · Replies 13 ·
Replies
13
Views
2K