Calculating Vehicle Speed and Acceleration Curve for Game Programmers

AI Thread Summary
To calculate vehicle speed and acceleration in a game without external forces, use a constant engine force (Fe) opposed by a drag force (Cd * velocity²). At top speed (155 MPH), the forces balance, allowing the calculation of drag force as Cd = Fe/(155²). The time to reach 60 MPH in 4.5 seconds can be modeled using the integral of the net force equation, leading to the relationship Fe * (1 - (velocity/155)²) over 4.5 seconds equaling 60. This method allows for replicating calculations for different car types in the project. Understanding these dynamics is crucial for accurate speed modeling in game programming.
pacificapilot
Messages
3
Reaction score
0
I am programming a game in which there are no outside forces acting on the car aside from the engine. I will not be having gears, so that is not a factor. I just want to know if there is an equation I can use to calculate the car's speed at any given time. The car will start off accelerating quickly, but then as it approaches top speed, it will accelerate slower and slower until it reaches top speed. Also, finding the car's 0-60 time is easy, just a google search, but because of this curve, that does not give me the original speed. Is there a way to figure that out?

The car's stats are:
0-60 in 4.5 seconds
Top Speed: 155 MPH

Please show your steps so that I can replicate it for the other car types in my project.
 
Physics news on Phys.org
pacificapilot said:
The car will start off accelerating quickly, but then as it approaches top speed, it will accelerate slower and slower until it reaches top speed.
That may depend on how it accelerates or decelerates. So, if you want to accurately get the speed of any time, the change of acceleration should also be given.
 
pacificapilot said:
Also, finding the car's 0-60 time is easy, just a google search, but because of this curve, that does not give me the original speed. Is there a way to figure that out?

The car's stats are:
0-60 in 4.5 seconds
Top Speed: 155 MPH

Please show your steps so that I can replicate it for the other car types in my project.

What do you mean by the original speed?
 
Use a constant engine force Fe opposed by a drag force Cd * velocity2. Since the top speed is 155, you know that the engine force and drag force are in balance at 155 mph. So Fe-Cd*1552 = 0. and Cd = Fe/(1552). You also know the time to 60 is 4.5. So the second integral of (Fe - Cd*velocity2) = Fe * (1-(velocity/155)2 over 4.5 seconds is 60. You can calculate Fe and then Cd from that.

PS. The zero to 60 mph times from Google searches are certainly for a standing start.
 
  • Like
Likes pacificapilot
SteamKing said:
What do you mean by the original speed?
Original as in the starting speed, which, in this case, is 0 mph
 
FactChecker said:
Use a constant engine force Fe opposed by a drag force Cd * velocity2. Since the top speed is 155, you know that the engine force and drag force are in balance at 155 mph. So Fe-Cd*1552 = 0. and Cd = Fe/(1552). You also know the time to 60 is 4.5. So the second integral of (Fe - Cd*velocity2) = Fe * (1-(velocity/155)2 over 4.5 seconds is 60. You can calculate Fe and then Cd from that.

PS. The zero to 60 mph times from Google searches are certainly for a standing start.
Thanks!
 
Hello everyone, Consider the problem in which a car is told to travel at 30 km/h for L kilometers and then at 60 km/h for another L kilometers. Next, you are asked to determine the average speed. My question is: although we know that the average speed in this case is the harmonic mean of the two speeds, is it also possible to state that the average speed over this 2L-kilometer stretch can be obtained as a weighted average of the two speeds? Best regards, DaTario
The rope is tied into the person (the load of 200 pounds) and the rope goes up from the person to a fixed pulley and back down to his hands. He hauls the rope to suspend himself in the air. What is the mechanical advantage of the system? The person will indeed only have to lift half of his body weight (roughly 100 pounds) because he now lessened the load by that same amount. This APPEARS to be a 2:1 because he can hold himself with half the force, but my question is: is that mechanical...
Thread 'Beam on an inclined plane'
Hello! I have a question regarding a beam on an inclined plane. I was considering a beam resting on two supports attached to an inclined plane. I was almost sure that the lower support must be more loaded. My imagination about this problem is shown in the picture below. Here is how I wrote the condition of equilibrium forces: $$ \begin{cases} F_{g\parallel}=F_{t1}+F_{t2}, \\ F_{g\perp}=F_{r1}+F_{r2} \end{cases}. $$ On the other hand...
Back
Top