# Which force do I use for work done by an engine

I'm busy writing a train simulator. I need to calculate the fuel consumption of the locomotive. I know that Work = Force x distance. From that, I can easily use energy density and work out how many kg of fuel was used.

I have a total resistance force (Fres) for the train (gradient, aerodynamic resistance, rolling resistance).

I also have the force produced by the locomotive (Floc).

I can easily calculate the train's acceleration by knowing Facc, where Facc = Floc - Fres.

The question is this: in order to calculate the fuel used by the locomotive, do I use Facc or Floc?

I feel that the locomotive needs to use energy (its fuel) to overcome resistance. But Wikipedia (https://en.wikipedia.org/wiki/Work_(physics)) says that work is only done by the resultant force. This would mean that at terminal speed, the locomotive would consume no fuel, the forces are balanced, and there is no change in EK (Kinetic energy). Clearly, this sounds wrong.

The force applied by the locomotive and thus the energy output is given by $$F_\text{loc}$$. It doesn't really matter where the energy is going, as long as the force of the locomotive applied over some distance is known, that is how much energy is has put out.
$$F_{loc}$$. You were inattentive reading that paragraph from Wikipedia. It correctly states that work is done on the body by the resultant force on that body. In your case, if the locomotive is not accelerating, the force exerted by its engine does no work on the locomotive. This does not preclude it from doing work on air or on the rails, sleepers etc. part of which is eventually converted into heat.