This page tries to summarize the algorithm used for realistic train acceleration. What follows is a description of the formulas listed at the bottom of this page.
acceleration = (force – friction) / 4m
- where m is the mass of the train
- force = 2.2 * power / velocity = 2.2 * time * power / distance
friction = 4 * (1.3m + 60n + μmv*10-3 + Adv2/10,000 + q)
- where n is the number of cars
- and v is the velocity.
- μ is the coefficient of friction, which is set to 35 for OpenTTD.
- A is the area of mumble, mumble 120.
d = 20+3n
- This is the drag coefficient, although it does not depend on velocity as one would expect.
q = Σ 60simi
- where si is the slope of car i
- and mi is the mass of car i.
This is incline of the train as a whole (or the sum of the inclines of each car), where 60simi is the incline of a single car i.
The slop of a car is one of the following:
- 1 if the car is ascending
- 0 if the car is level
- -1 if the car is descending
velocity [v] = mph
power [P] = W
mass [m] = t
F = 22P / 10v [N]
n — number of cars
μ = 35 (eq. 1e-3 ?) — coefficient of friction
A = 120 — area (units?)
d = 20+3n — drag coefficient
q = Σ 60simi — incline term, summed over cars
si — slope, -1 (going down), 0, or 1
mi — mass of the car
Fr = 4(13m / 10 + 60n + μmv / 1000 + Adv2/10000 + q) [N]
a = (F - Fr) / (m * 4) [m s-2]