8
$\begingroup$

I have been trying to understand how Microsoft Train Simulator works and people seem to use some Davis equation to calculate friction. So my questions are: What is it? Why do they use it? Are there alternatives to calculate train friction/are there other ways to calculate train friction?

$\endgroup$
13
$\begingroup$

Basically, the Davis Equation is a resistance formula mainly used in basic go-stop situations like trains. The basic formula: $$R'=1.3+\frac{29}{w}+.045v+\frac{.0005av^2}{wn}$$ R being resistance, w is axle load in short tons, n is the number of axles, and a is the frontal area of the train in sq. feet. According to Szanto in Rolling Resistance Revisited you can modify the equation to fit standard freight cars, but the concepts are the same, factoring in air resistance as well. When you or the simulator substitutes the values above to yield certain necessary values for the simulation, you can find relatively accurate coefficients of drag. When you get resistance/drag the simulator will then compute whatever other factors are necessary and then create the appropriate image. This (according to Microsoft Train Simulator) happens hundreds of times a second at the highest settings to give high quality data for the discerning user. Now as to your third question, yes, there are other ways of calculating friction, but the Davis Equation was designed specifically for this purpose and requires no extraneous values and in a sense is the most 'streamlined' equation for this purpose. Some come close though, most prominent being the Canadian National modification for double deck EMU's: $$R=14*\sqrt{10(M)(n)}$$ This square root function will yield more accurate resistance coefficients for taller wagons. If anybody has found more accurate and EFFICIENT methods of finding resistance for trains than the Davis please edit or answer thusly, but as to my point of view the Train Simulator, as with all computer programs, uses this equation to balance both accuracy and speed of calculation.

$\endgroup$
  • $\begingroup$ Games are unlikely to use the second because square roots are a relatively expensive operation, and a power of two is relatively cheap. $\endgroup$ – evandentremont Feb 20 '18 at 21:39
  • $\begingroup$ @evandentremont: Check out instlatx64.atw.hu where they measured all instructions of many CPUs. A random contemporary Intel CPU does indeed multiply a lot faster (roughly 2.5-7 times, depending on which specific variant of the FSQRT command is used). But if you involve dividing, then FSQRT can, in specific cases, even be slightly faster; at the least it's not slower by an order of magnitude, more like 4/5 or so. Summing up the many operations needed for the first formula in this answer would very like turn out to it being slower overall than the second (depending on CPU). $\endgroup$ – AnoE Feb 20 '18 at 21:59
  • $\begingroup$ If anybody would like I could read further into the computational processes behind square root v. standard processes. Maybe it would shed some light on the decisions of the programmers. $\endgroup$ – Jihyun Feb 20 '18 at 22:33
  • 3
    $\begingroup$ @evandentremont There's also "tricks" with things like the 0x5F3759DF method which take advantage of things like particular bit representations used by modern CPUs and the fact that "close enough" often works for games even when it might not for scientific simulations. So depending on what a programmer is doing, a strict operation counting of the official formula may or may not indicate the computational complexity. $\endgroup$ – R.M. Feb 20 '18 at 22:34
  • $\begingroup$ Thanks for your reply! @Jihyun ! But I have a question, if this calculates resistance, may I ask of what exactly? Just air resistance? Or wheel resistance too? $\endgroup$ – appmaker1358 Feb 21 '18 at 7:45

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.