Calculating Vehicle Speed and Acceleration Curve for Game Programmers

Click For Summary

Discussion Overview

The discussion revolves around calculating vehicle speed and acceleration curves for a game programming context, specifically focusing on a car that accelerates quickly at first and then slows its acceleration as it approaches top speed. Participants explore equations and methods to determine the car's speed at any given time, considering parameters like 0-60 time and top speed.

Discussion Character

  • Technical explanation
  • Mathematical reasoning
  • Debate/contested

Main Points Raised

  • One participant seeks an equation to calculate the car's speed over time, noting that the car accelerates quickly initially and then more slowly as it nears its top speed.
  • Another participant suggests that the change in acceleration must be considered to accurately determine speed at any moment.
  • A clarification is requested regarding what is meant by "original speed," which is identified as the starting speed of 0 mph.
  • One participant proposes using a constant engine force opposed by a drag force to model the car's acceleration, providing a mathematical framework to calculate the forces involved at top speed and during acceleration.
  • There is an acknowledgment that typical 0-60 mph times found online are based on a standing start, which may not apply directly to the participant's scenario.

Areas of Agreement / Disagreement

Participants express differing views on how to model the acceleration curve and the implications of the 0-60 time. There is no consensus on a single method or equation to use, and the discussion remains unresolved regarding the best approach.

Contextual Notes

Participants mention the need for specific assumptions about forces acting on the vehicle, such as the balance between engine force and drag force, which may affect the calculations. The discussion also highlights the importance of understanding the acceleration curve's shape and its impact on speed calculations.

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   Reactions: 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!
 

Similar threads

  • · Replies 95 ·
4
Replies
95
Views
7K
  • · Replies 26 ·
Replies
26
Views
7K
  • · Replies 3 ·
Replies
3
Views
2K
  • · Replies 4 ·
Replies
4
Views
3K
  • · Replies 4 ·
Replies
4
Views
4K
  • · Replies 13 ·
Replies
13
Views
3K
  • · Replies 3 ·
Replies
3
Views
7K
  • · Replies 7 ·
Replies
7
Views
5K
  • · Replies 27 ·
Replies
27
Views
22K
  • · Replies 1 ·
Replies
1
Views
1K