2D Car Simulation with Throttle Linear Physics
- by James
I'm trying to make a simulation game for an automatic cruise control system. The system simulates a car on varying inclinations and throttle speeds.
I've coded up to the car physics but these do note make sense.
The dynamics of the simulation are specified as follows:
a = V' - V
T = (k1)V + ?(k2) + ma
V' = (1 - (k1 / m) V) + T - ( k2 / m) * ?
Where
T = throttle position
k1 = viscous friction
V = speed
V' = next speed
? = angle of incline
k2 = m g sin ?
a = acceleration
m = mass
Notice that the angle of incline in the equation is not chopped up by sin or cos.
Even the equation for acceleration isn't right.
Can anyone correct them or am I misinterpreting the physics?