Units>Trains - Bad travel time formula

Anything related to the content on our wiki (https://wiki.factorio.com/)

Moderator: Bilka

Post Reply
tholda8
Manual Inserter
Manual Inserter
Posts: 1
Joined: Tue Jul 23, 2024 11:15 am
Contact:

Units>Trains - Bad travel time formula

Post by tholda8 »

Time travel formula should be: (2S / A) + (distance - S^2 / A) / S
Here's my explanation (I'm using your unit labels, only the distance for D is changed, and some values from the same article) :

S = 72 tiles*sec^(-1) - maximum speed
A = 9.26 tiles*sec^(-2) - acceleration
D = 1000 tiles - distance

Demonstrative insertion of these values into your and my formula:
Yours: 2S / A + (D-4*S^2/A)/S ≈ -1.66 sec
Mine: 2S / A + (D-S^2/A)/S ≈ 21.66 sec

Here's an example of speed graph in GeoGebra: https://www.geogebra.org/calculator/wjaprzjg

My long explanation:
So the total travel time should be the sum of the part where the train speed increases, the part where the train speed decreases and the part where the train speed is constant.
travel time = sIncT + sConT + sDecT
If we assume your quote "deceleration = acceleration", then the increase and decrease in speed take the same time.
travel time = 2*sIncT + sConT
To calculate the time for the increase in speed, we use T=S/A.
travel time = 2*S/A + sConT
Our speed constant time is the distance (where the train has the maximum speed) divided by the maximum speed.
travel time = 2*S/A + (DwithS)/S
The distance (where the train has the maximum speed) is just the total distance without the acceleration sections. To calculate the distance travelled by the train during acceleration, we can take the speed graph on it, the acceleration part can resemble this formula currentSpeed = time*A and we can integrate this formula with respect to time to get
DistanceWithSInc = A/2 * time^2 and we already have a formula for the time at which the speed of the train increases, so after substitution we get:
DistanceWithSInc = A/2 * (S/A)^2 = (S^2)/A * 0.5
Then our distance travelled at maximum speed is equal to the distance minus distance the distance travelled accelerating and decelerating (so times 2):
DwithS = D - 2*DistanceWithSInc = D - 2*S^2/A*0.5 = D-S^2/A
So, if we plug in, we get back:
travel time = 2*S/A + (D-S^2/A)/S

mmmPI
Smart Inserter
Smart Inserter
Posts: 3098
Joined: Mon Jun 20, 2016 6:10 pm
Contact:

Re: Units>Trains - Bad travel time formula

Post by mmmPI »

Where is referenced the time travel formula in the Wiki ?
tholda8 wrote:
Tue Jul 23, 2024 12:30 pm
If we assume your quote "deceleration = acceleration", then the increase and decrease in speed take the same time.
Who ?

this is wrong and barely make any sense, the slower train due to many wagons can never reach full speed and therefore have an acceleration time trending toward infinity, whereas their decelaration is quite fast.

Post Reply

Return to “Wiki Talk”