News:

Simutrans Chat Room
Where cool people of Simutrans can meet up.

Measuring work and fuel consumption

Started by jamespetts, December 08, 2015, 12:31:28 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

jamespetts

It was and is certainly planned to have a system in which fuel costs changed with time using the inflation system (different types of costs inflating/deflating at different rates).

As to aircraft and ship physics - on reflection, I am not sure how important that these actually are in economic terms in the game. Unlike with trains, where there are locomotives that can pull an indeterminate number of carriages or wagons and it is important for the game engine to make sure that players cannot get an unrealistic effect by using weak vehicles to haul heavy loads), aircraft and ships are singular units. Because they tend to go long distances (and, in the case of ships, go very slowly), the rate of acceleration is of minimal importance. What is really important for aircraft and ships therefore is just the top speed, at which they will be travelling most of the time. In principle, it should be much easier to balance the physics for these than for rail vehicles (and, to a lesser extent, road vehicles).
Download Simutrans-Extended.

Want to help with development? See here for things to do for coding, and here for information on how to make graphics/objects.

Follow Simutrans-Extended on Facebook.

DrSuperGood

Quotethe rate of acceleration is of minimal importance. What is really important for aircraft and ships therefore is just the top speed, at which they will be travelling most of the time. In principle, it should be much easier to balance the physics for these than for rail vehicles (and, to a lesser extent, road vehicles).
With powered ships the current speed (not maximum speed) is extremely important when it comes to economics. In recent times container ships have been going slower on average as reducing speed a knot or two results in huge fuel savings for the same distance. For the same reason cruise ships often run well below their maximum speed as it results in huge fuel savings. This was especially important back in the days of steam ships as running at full power would burn coal very fast resulting in huge fuel costs as well as short maximum range. The player should only be paying for fuel that is used, not the full power of the ship.

With aircraft the weight of the plane, including fuel on board, is critical for their economics. A long distance flight with an aircraft will cost on average more per km than a short distance one as more energy is expended lugging fuel. In fact a long distance flight that has just taken off is unable to land until most of its fuel has been expended as planes are not designed to land reliably/safely at that weight. Like with boats, the current speed of an aircraft is also important for economics with slower often being more efficient. This is why passenger planes have been running slower over the decades, to reduce fuel costs.

I do not know how much weight effects the economics of a ship. Often ships require extensive ballast if their cargo holds are empty for ship stability, hence I imagine weight having little effect on ship economics.

This means that a speed cap feature is required between hops in line management. However even with such a feature one needs to calculate a fuel cost for ships and planes that is appropiate for the speed they run at. If a correct physics model is not used, one which energy used can be metered, then one would need to work out a mathematical model for each plane and boat to come up with reasonable fuel consumption estimates per km travelled.

jamespetts

I have been wondering about a speed cap feature: that should not in itself be excessively complicated to implement. However, one significant problem of a speed cap feature and also a weight dependent running costs feature is how to communicate the running costs to the player when the formula for calculating them is very complex. Have you any idea of a sensible and clear way of explaining these running costs in the user interface (and also of researching the relevant running costs for ships)?

For aircraft, fuel consumption is often available as an hourly rate based on that aircraft's standard cruising speed. I have not found any more in-depth data than that. One of the difficulties of making the formula for calculating fuel costs more complex is that one needs more detailed research data, which are not always available. Certainly, so far as I can tell, for aircraft they are not readily available. Would it not be better to have ships' and aircraft's maximum speed to be their normal cruising speed and calculate fuel consumption on the assumption that they are travelling at this rate? Aircraft circling at airports already have a feature to reduce their per km cost on account of their lower speed in this situation.

For steam engines, my calculations in the spreadsheet (the correct name of which is steam-physics-calc.ods - the previous file name was given from memory) give the kilograms of fuel consumed per hour per square foot of firegrate area, the calorific value of the fuel, the thermal efficiency of the locomotive and the resulting power. There are actually two ways in which the calculations are done: for the rows highlighted in yellow, these are calibrated engines, where the thermal efficiency is calculated backwards from the power, and the power is set by testing in-game performance against recorded real world performance (adjusting for gradients using a formula where necessary). The white rows are non-calibrated engines, whose efficiency is supplied manually based on a reasonable guess as to the efficiency of a locomotive of that sort in the relevant era and taking into account any reports about what is known about the locomotive and whose power is calculated from the efficiency and from the calorific value of the sort of coal known to be used by the railway company for which it worked. Neither of those calculations rely on making any assumptions about speed.

Assumptions about speed would be necessary for converting the data currently in this spreadsheet into a range or fuel consumption per kilometre, however. The original plan was to do this on the basis of an assumed average speed as a fraction of the multiple speed (perhaps 2/3rds). Do your calculations suggest that the actual average speed of trains varies so much that this would create real economic distortions in the game? If so, I should be interested to see these calculations.

Another thing to bear in mind if one has a non-fixed fuel consumption per kilometre is that not only will the running costs vary with this, but so will the range of those vehicles whose maximum range is determined by fuel capacity (e.g. aircraft and steam locomotives - but not, e.g. horses). This would require a whole other layer of complexity.

Given the intractable complexity of varying per km fuel consumption, do we perhaps need to do some modelling to calculate the real significance of this in an in-game setting to determine whether this is necessary, and, if it is, precisely how much depth is required for this?
Download Simutrans-Extended.

Want to help with development? See here for things to do for coding, and here for information on how to make graphics/objects.

Follow Simutrans-Extended on Facebook.

DrSuperGood

QuoteI have been wondering about a speed cap feature: that should not in itself be excessively complicated to implement. However, one significant problem of a speed cap feature and also a weight dependent running costs feature is how to communicate the running costs to the player when the formula for calculating them is very complex. Have you any idea of a sensible and clear way of explaining these running costs in the user interface (and also of researching the relevant running costs for ships)?
How are they done in real life? The idea would be to give a player a fuel expenditure estimate in the form of currency. This estimate need not be perfect, even in real life they never are, but close enough so that a player can see that running his trains 10km/h slower top speed might save him about X currency. For weight one can factor in fuel weight as well as average freight/passenger weight. This estimate could be shown at a line management level when the player is selecting the vehicles to use for that journey (part of the new recombination system), and also when selecting a vehicle for the current hop. Actual fuel costs could be charged when a train arrives at a stop (refuels) as that would probably simplify calculations no matter how the system is implemented.

Sure if the vehicle gets a passenger spike it might use more fuel than the estimate, but the owner really should not care as more passengers means more revenue. Like wise if there is bad traffic congestion resulting in much reduced economy (breaking is wasted energy for most vehicles) the player would understand that his fuel costs are higher than estimates and would likely try to optimize traffic flow.

In line management one could also show the actual fuel expenditure for a hop. This could be as simple as logging how much over or under the estimate was spent between a particular hop so as to factor in different vehicles servicing the same line. Again this can be calculated at stops, so is processor friendly. This could even be shown as a percentage over/under, which would be enough for a player to notice there might be a problem or maybe a line is running more efficiently than expected.

In real life fuel consumption is often not a direct concern when planing a route. For example trucking some freight between to depots it is unlikely that fuel consumpution was estimated beyond the km distance between the stops and the average km per liter of fuel. When it is calulated, it is usually rule of thumb estimates, often overly cautious. To save on fuel economcy companies generally use rule of thumbs that have been calculated by engineers and accountants. For example they might order their entire shipping fleet to run a few knots lower to save fuel. The amount acutally saved will approximatly be what is expected, but obviously will deviate from the estimates as nothing in the real world is perfect. Exception is aviation industry because fuel is a huge cost and running out of fuel has catostrphic results, there estimates will likely be more accurate and factor in even weather but they still have to run on the side of caution with reasonably excessive fuel.

QuoteFor aircraft, fuel consumption is often available as an hourly rate based on that aircraft's standard cruising speed. I have not found any more in-depth data than that. One of the difficulties of making the formula for calculating fuel costs more complex is that one needs more detailed research data, which are not always available. Certainly, so far as I can tell, for aircraft they are not readily available. Would it not be better to have ships' and aircraft's maximum speed to be their normal cruising speed and calculate fuel consumption on the assumption that they are travelling at this rate? Aircraft circling at airports already have a feature to reduce their per km cost on account of their lower speed in this situation.
Problem is cruise speed varies based on economics. If fuel is cheap and passengers want to pay a premium to get to their destination then cruise speed is higher. In real life passengers often want to pay as little as they can and fuel is expensive so cruise speeds are lower. The issue is due to air density and weight, since the more dense the air is the larger the drag losses are but the easier it is to keep a heavy plane flying as well as the more efficient the turbo fan jet engines are. Drag losses go up with speed. This is why planes need to fly very high above sea level to achieve such high speeds such as 920 km/h since otherwise the noses and engines of the plane would literally overheat if at sea level due to the drag. However turbo fan engines rely on combustion as well as air flow to provide thrust, and as such the higher the altitude they are operating at the lower their efficiency becomes. Cruise speed is thus determined by cruise altitude which is determined by economics. Many modern planes are capable of cruise speeds much faster than they are operated at.
Quotegive the kilograms of fuel consumed per hour per square foot of firegrate area
That makes a lot more sense now! I thought it was kg per hour in total...

However again this depended on how much work (steam) the locomotive was using. If they were pulling a light train slowly they would not need to burn the maximum fuel to produce the maximum steam. For example if a steam engine was in a station for an extended period it is unlikely much coal had to be shoved in it while parked there. Of course coal has delayed burning so the fireman/men would start shovelling coal in before it departs so the boiler is up to pressure, but that is just how they worked. Additionally some fuel is needed to keep the fire running, a sort of standing loss. In any case even with steam engines there would be economics for running a train slower. This can be as simple as running at a slow speed in crowded track sections where trains often had to stop, something one experiences daily in real life commuter trains.
QuoteAssumptions about speed would be necessary for converting the data currently in this spreadsheet into a range or fuel consumption per kilometre, however. The original plan was to do this on the basis of an assumed average speed as a fraction of the multiple speed (perhaps 2/3rds). Do your calculations suggest that the actual average speed of trains varies so much that this would create real economic distortions in the game? If so, I should be interested to see these calculations.
Trains that ran slower might have a longer range. A train that can go 300km at 100km/h might make 500km at a slower average running speed. This is especially the case with early steam ships as they had poor fuel efficiency and capacities. To be honest I am unsure with steam trains, since drag only becomes a problem at higher speeds so this might not effect early steam trains that much. With ships this happens at a much lower speed due to the density of water. Like wise with aircraft at cruise altitude this happens at a much higher speed due to reduced drag from low density air.
QuoteAnother thing to bear in mind if one has a non-fixed fuel consumption per kilometre is that not only will the running costs vary with this, but so will the range of those vehicles whose maximum range is determined by fuel capacity (e.g. aircraft and steam locomotives - but not, e.g. horses). This would require a whole other layer of complexity.
Unlike real life a game can be more forgiving as it is less complex and accurate. As such if loaded fuel estimates and ranges are wrong and result in a vehicle technically running out of fuel on a journey one might overlook it and not punish the player at all next to charging them the extra fuel spent with possibly some penalty percentage.

For some vehicles a speed against range graph could be shown, eg planes. For trains one might also show a weight against range graph for a certain speed (selectable).
QuoteGiven the intractable complexity of varying per km fuel consumption, do we perhaps need to do some modelling to calculate the real significance of this in an in-game setting to determine whether this is necessary, and, if it is, precisely how much depth is required for this?
Even if the model ends up not that complex or deep, in any case a better model than currently exists is required for realistic vehicle operation and running costs. To put in in perspective the reason aircraft cruise speed has become slower is it saves the airline companies millions every year, even if the aircraft could cruise much faster at a different altitude by design.

jamespetts

The UI suggestions relating to graphs and estimates seem to require a truly gargantuan amount of work for the UI alone - would you be interested in coding this? Any UI elements beyond the very simple are very hard indeed to code in Simutrans because of the nature of the codebase.

I note that you seem content to simplify away range depending on actual speed and work but not per kilometre costs. I am not clear why you are taking a different approach to these things in this instance.

For aircraft, there is very little variation in the speeds at which a given model of aircraft actually routinely cruises. There is a degree of discretion for an airline operator to select a lower cruising speed and save some fuel (as there is for ships), but would it really be a major issue of this choice was made at the pakset design level rather than the player level? I should note that already the aircraft speeds are based on their cruising speeds not their maximum speeds.

In relation to modelling, what I meant was actual calculations based on real life data done now to determine whether the work/speed variance in relation to fuel consumption is significant enough (compared to using an estimated average for each powered vehicle type) to be worth simulating in the game given the amount of additional work that would be involved and therefore the many additional months before this feature would be available. Have you done any calculations of this sort; do you have any data from which such calculations can be made?

Download Simutrans-Extended.

Want to help with development? See here for things to do for coding, and here for information on how to make graphics/objects.

Follow Simutrans-Extended on Facebook.

Vladki

This seems to be heading for too much complexity. I think before we start touching fuel consumption related stuff, we should first check and fix all other physics related stuff - acceleration, slopes, corners. Especially slopes seem to be a problem at the moment - with some vehicles being underpowered even to climb one level up.

In real life fuel consumption for a trip is estimated by using long time averages (or manufacturer specs). These average numbers should take into account usual cruising speed (for ships and planes), usual weight of cargo, some mix of going uphill and downhill, etc. In all specs I have seen the consumption is in liters / 100 km or liters / hour (or miles / gallon). I have never seen liters / Joule. Well you can find J/kg for different fuels, but that is the heat you get from burning them, not the mechanical work you get by using the fuel in engine. I don't think that the efficiency ratio for different vehicles would be easy to find. Maybe some approximate values for certain types of engines, but those would be very broad ranges. Efficiency also varies with RPM of engine.

Even if you would be able to find those values, it would be very confusing for players. Now we have two easy numbers: $/km, $/month. For full physics we would have:
$/kg (or liter) of fuel, J/kg of fuel, efficiency % of engine - well this can be put together to get $/J.
And how is a player supposed to calculate the $/km ?
Take into account weight of the train, energy needed to accelerate to full speed, friction (at varying speeds), distance.
You have to check how often it has to slow down and accelerate again due to corners, and how much it goes up or down hill.
Also how much fuel it uses while running idle (loading cargo).
All this can't be calculated before the engine is bought. One has to assemble the train, and set up schedule. Only then we can calculate price of each hop of the route.

If this complex model is ever implemented, I would suggest that each convoy, would have it's own counter for fuel consumption, so that player could make estimates based on really measured values.
And the depot window should show approximate value taken either from real world specs (for common cruising speeds/altitudes, usual length/weight of train, excluding special record setting events, etc), or values obtained by playing the game.

jamespetts

Vladki has a point that a fuel consumption based system is likely to be difficult for players to understand and engage with - this is why we need to undertake modelling to check whether it is strictly necessary if we are to have a workable balancing system using real life numbers or whether using (as discussed above) an average speed would be close enough to suffice.
Download Simutrans-Extended.

Want to help with development? See here for things to do for coding, and here for information on how to make graphics/objects.

Follow Simutrans-Extended on Facebook.

DrSuperGood

QuoteI have never seen liters / Joule.
This is covered by chemistry.
Quotebut that is the heat you get from burning them, not the mechanical work you get by using the fuel in engine
That is covered by engine efficiency.
QuoteEfficiency also varies with RPM of engine.
Which is why gearboxes are used, to try and keep the RPM of an engine within its optimum range.
QuoteAnd how is a player supposed to calculate the $/km ?
They are not. The game should give them an estimate which is reasonably accurate.

The problem with per km costs is it does not factor in the actual amount of work done. A fast powerful train pulling a lot of coaches might move very slowly but it is doing the same amount of work as if the train was pulling few coaches very fast. A more accurate measurement would be cost per hour since then a slow train or fast train using the same power will result in the same cost. However this is not accurate itself since if the train is not using all its power then it should not be billed as using all its power, as would be the case of a powerful locomotive pulling a few coaches slowly. Fuel can also be saved by running trains slower than their designed speed, eg making sure they do not exceed the minimum speed maximum of trains traveling the same congested line.

jamespetts

Dr. Supergood - do you have any data as to the variation in fuel consumption per kilometre for, say, railway locomotives for the purpose of modelling?
Download Simutrans-Extended.

Want to help with development? See here for things to do for coding, and here for information on how to make graphics/objects.

Follow Simutrans-Extended on Facebook.

DrSuperGood

This article covers many points relating to energy efficiency. It includes mentioning that drag on aircraft is directly proportional to weight (due to converting forward motion into vertical lift to keep the plane from falling) and hence weight is directly proportional to fuel consumption with aircraft. It also covers that one of the biggest energy expenditures on urban railway lines is breaking, being as much as over 40% of the total energy usage. It also mentions the energy of different fuel sources. Also mentions that train fuel economy can vary greatly between different stretches of the same route.
https://en.wikipedia.org/wiki/Energy_efficiency_in_transport

Here is a paper which covers efficiency related concepts specifically for trains. In the section of Dynamic train movement a simulated train was used to demonstrate how energy consumption for the same journey varied with both train weight and train speed. It is worth noting that due to the higher loadings in the simulation, the train velocity decreased which itself raises energy efficiency, hence why it looks like heavily loading the trains becomes increasingly more energy efficient. A second graph goes on to show the effect of maximum driving speed on energy consumption by keeping the weight of the simulated train constant. A section also discusses fuel cost implications. A table shows that in their simulation of 20km at a 2% gradient moving 100t cost 14€ of energy while 2,000t cost 120€ of energy. It also makes mention that energy is a huge cost, often greatly exceeding the cost of line rental for a distance on a real network.
https://hrcak.srce.hr/file/122021

How one could model this I am not sure. One could try pre computing efficiency metrics for each hop of a line using some kind of simulation model. One could also try using a physics system and metering the energy used. In any case in real life this stuff does make a big impact to economics.

As far as player usability goes it would likely be similar to real life energy efficiency, often after thought or something that occurs towards modern times. If a player is noticing huge expenditure on energy they might look to optimize energy efficiency such as lowering the maximum speed on low traffic lines or decoupling coaches that often sit mostly empty. As fuel costs rise towards modern times the player would have to increasingly look to save energy, including removal of inefficient rolling stock, flattening/straightening of lines, optimizing signals, lowering maximum speeds, etc.

jamespetts

What we really need to model is the extent to which fully dynamic fuel efficiency calculation in so far as it can be implemented produces different results in game to static, averaged fuel efficiency per vehicle. For aircraft, for example, one would have to calculate, not only passenger loading, but luggage loading and the fuel weight necessary for the flight, which then reduces during the flight - a fantastically complex thing to calculate in itself. What is really necessary to understand is not whether these things are significant in reality in general, but rather whether they are so significant that it would be impossible to have any workable balancing using (averaged) real life figures without using dynamic rather than static fuel efficiency computation.

There is a difference between the game being simplified and not fully simulating some real-world dynamics such as varying fuel consumption, but being accurately balanced within those simplified parameters, and the game being unbalancable (or only balancable in a way that means that, even within the simplified range of things simulated, the optimum thing to do is often significantly different in game than it would be in reality) because of not simulating those additional dynamics. It is necessary to discern which is the case before progressing with balancing features.

It is not immediately clear to me precisely how one would go about modelling for this comparison - any thoughts on appropriate formulae/algorithms would be welcome.
Download Simutrans-Extended.

Want to help with development? See here for things to do for coding, and here for information on how to make graphics/objects.

Follow Simutrans-Extended on Facebook.

DrSuperGood

QuoteWhat we really need to model is the extent to which fully dynamic fuel efficiency calculation in so far as it can be implemented produces different results in game to static, averaged fuel efficiency per vehicle. For aircraft, for example, one would have to calculate, not only passenger loading, but luggage loading and the fuel weight necessary for the flight, which then reduces during the flight - a fantastically complex thing to calculate in itself. What is really necessary to understand is not whether these things are significant in reality in general, but rather whether they are so significant that it would be impossible to have any workable balancing using (averaged) real life figures without using dynamic rather than static fuel efficiency computation.
With trains it is pretty obvious such a system is required. A train pulling fewer coaches or a lot of empty freight coaches should cost significantly less per km than the same train pulling a lot of coaches or full freight coaches. This is required to give a lot of economic sense behind having smaller trains with fewer coaches.

For example take a bulk train running coal from a mine to a dock along a flat stretch of rail. Currently moving the train costs the same in both directions. In real life it costs considerably more to move the train full of coal to the dock than it does to move the empty train from the dock back to the coal mine.

However coal mines are seldom on a plain, especially in the UK, and hence in real life the mine might be at a considerably higher altitude from the dock. Now in this example the same bulk train is running coal from a mine to a dock downhill. Due to gravity there is a huge energy saving on the previously energy intensive mine to dock route which now might require almost no input power (nearly free) depending on how steep the gradient is. On the other hand the dock to mine journey now requires considerably more energy to cover lugging the empty trucks up the gradient so is more expensive energy wise. However since the empty bulk trucks are only a fraction of the weight of the full bulk trucks the net result of this line configuration is that less energy is needed to move the coal and so considerable amounts of money are saved.

Currently in Simutrans and Extended this is impossible to simulate as the trains cost the same per km irrespective of how much of their power gets used. Trains will also always try to accelerate to the maximum speed they can, even if it does not make them arrive any faster as they are scheduled to run behind slower trains so end up waiting at signals. Now I am not saying that it needs to be simulated every tick with a phsyics model. However some system needs to be in place that allows the player to limit maximum speed and depending on maximum speed and how much weight a train is lugging the running cost of the train goes down.

jamespetts

It does not really assist much to state that it is "obvious" or that the difference is "huge". What we need are numbers. In particular, what we need to know is not just whether there is a difference in fuel consumption between running full and empty or running on the level or uphill, but rather whether it will make a significant difference to how the game plays out and what strategy is optimum for the player in all but edge cases if we actually simulate these things dynamically rather than taking an average of level and uphill, loaded and unloaded, etc.. It is this latter aspect that is critical - this is what tells us whether the extra complexity is worthwhile (and also, if it is, in precisely what way and to precisely what extent, so that we can work out what simplifications may be workable in simulating this).

Let us take some specific examples to work with for the purpose of modelling. I suggest that we model three specific examples: (1) a freight train; (2) a passenger train; and (3) a passenger jet airliner.

Starting with the freight train, let us use for these purposes the LNWR DX Goods of 1858 as the locomotive, and imagine that it is hauling 25 wagons of coal (each with an 8t load) with a 7.5t brake van at the end of the train. The tare weight of such a train is 149.5t, and the payload is 200t, making the loaded weight 349.5t. The rolling resistance empty is 0.284kN and full 0.664kN. The locomotive's power is 167kW. My estimate of its thermal efficiency is 3.8%; it burns 31.75kg of coal per hour per square foot of firegrate area to produce the 167kW output, the coal having a calorific value of 8.12 kW/kG. The firegreate area is 17.1 sq. ft., so the total coal consumption is 542.9kg/hour. The train's maximum speed is 56km/h, which, being a slow freight train, it is likely to achieve for perhaps about 80% of its journey. Taking 80% of 56km/h gives us 44.8km/h, which would then be the basis for the average speed for the purpose of fuel consumption calculation for the averaged method. At 44.8km/h and 31.76kg/hour, that gives us 542.9kg/44.8km, or ~12.1kg of coal per km.

Turning to a passenger train, we can start with some real world data reproduced here showing that the LNWR "Precedent" class had an average coal consumption of 33.2lb/mile. This would work out as 16.6kg/mile or 10.4kg/km. It is instructive to compare this with the extrapolated figures for this class of locomotive. This locomotive has a power of 204kw and I have estimated a thermal efficiency of 4.5%. It is estimated to have consumed 32.75kg of coal per square foot of firegrate area per hour, and has a firegrate area of 17.1 square feet, giving a total hourly consumption of 560kg/hour of coal. The locomotive's maximum speed is 130km/h, but it is unlikely to sustain this for long in practice, so I will estimate an average speed of 65km/h (half the maximum speed). At this speed, 560kg of coal would be consumed per 75 km, giving a per km consumption of 8.6kg/km. To get 10.4kg/km as from the historical data, the average speed would have to be estimated at about 54km/h. (This might be a good way of calibrating the average speed if we were to do it in this way).

As for a passenger aircraft, we will take the example of the Boeing 707. According to this source, this used approximately 1,200 gallons of fuel per hour, or 4,542l per hour. The Boeing 707-120 has a capacity of 137 passengers in ordinary configuration. Its tare weight is 84t and its loaded weight is 93.59t. It is given a power of 43,200kW and has a range of 5,037km. Its maximum speed in game (i.e., its deemed cruising speed) is 885km/h. At this speed, it will burn 4,524l of fuel per km, equivalent to 5.11l of fuel per km.

The above are all calculations based on the averaging method that I was planning to use (the final step, omitted here, being to convert the per km fuel consumption figures into per km costs using historical pricing data for the relevant fuel types).

Can you set out some specific worked examples (with figures as above), being not edge cases, for these three vehicle sets in which a dynamic system would make a real difference to the actual average per km cost paid by players in different situations, each realistically likely to occur in game, such that these differences would not simply be irrelevant by virtue of being averaged out over time and that players would have a real incentive to make substantially different choices in a dynamic than an averaged static system?
Download Simutrans-Extended.

Want to help with development? See here for things to do for coding, and here for information on how to make graphics/objects.

Follow Simutrans-Extended on Facebook.

DrSuperGood

#48
I am having trouble coming up with the needed examples. With aircraft it seems that there can be around 10-15% variances in fuel cost with range and like wise with weight however I cannot easilly find a mathematical model for this that would fit with your example aircraft (the one shown was for a different model of aircraft).

QuoteMy estimate of its thermal efficiency is 3.8%; it burns 31.75kg of coal per hour per square foot of firegrate area to produce the 167kW output, the coal having a calorific value of 8.12 kW/kG. The firegreate area is 17.1 sq. ft., so the total coal consumption is 542.9kg/hour.
I am a bit unsure of how you came up with "31.75kg of coal per hour per square foot of firegrate area". I would imagine the amount of coal one needed to burn was based on how much work the train had to do. I recall hearing that firemen would have to shovel in extra coal in the run up to a hill to make sure there was enough steam to climb it. Sure that would define the maximum power of the steam engine, but not how much fuel it is burning unless you assume all power is being used.

Now be aware I did not do advanced physics so what I am about to say might not be correct...

For simplicity sake let us say this train runs at 44.8km/h along a 44.8km stretch and ignore acceleration/deceleration losses (more important with commuter services, probably trivial for a freight train). This means that time is 1 hour (3600 seconds).

Rolling resistances...
Loaded -> 664N
Unloaded -> 284N

The total work done...
Loaded -> 664N  * 44,800m = 29,747,200J
Unloaded -> 284N  * 44,800m = 12,723,200J

This means that the power used to move the train during that time is...
Loaded -> 29,747,200J / 3,600s = 8,263W = 8.3kW
Unloaded -> 12,723,200J / 3,600s = 3,534W = 3.5kW

Something looks very wrong with these values, they are so small that a tiny 20kW train train could manage it. You did say rolling resistance so I am guessing this does not factor in aerodynamic drag, another huge loss for trains. As this train is slow it should not be that much, but who knows...

The density of air at sea level is 1.2kg/m3 according to wikipedia. UK being an island with trains often running near sea level means this is reasonable. The velocity is 44.8km/h, as mentioned above, which is ~12.4m/s. I cannot find a decent drag coefficient for an old steam powered freight train however some site state that a "passenger train" is 1.8 and a "Rectangual box" is  2.1 so 2.5 seems a good estimate to factor in the complex shape of a steam engine and rough surface of open coal trucks. Apparently for frontal surface area a value of 10m2 is commonly used for trains, so lets go with that.

Drag Force -> (1/2) * 1.2kg/m3 * 12.4 ^ 2 * 2.5 * 10m2 = 2,306N

This is considerably larger than the rolling resistance, not something we can ignore.

The total work done...
Loaded -> (2,306N + 664N)  * 44,800m = 133,056,000J
Unloaded -> (2,306N + 284N)  * 44,800m = 115,942,400J

This means that the power used to move the train during that time is...
Loaded -> 133,056,000J / 3,600s = 36,960W = 37kW
Unloaded -> 115,942,400J / 3,600s = 32,206W= 32kW

Now this value makes more sense. The empty train will be using 32kW of coal while the full train 37kW of coal.

Since you calculated the 542.9kg/hour to produce 167kW that means the train will consume...
Loaded -> 542.9kg/hour * 37kW / 167kW = 120kg/hour
Unloaded -> 542.9kg/hour * 32kW / 167kW = 104kg/hour

In per km fuel costs...
Loaded -> 120kg/h / 44.8km/h = 2.68kg/km
Unloaded -> 104kg/h / 44.8km/h = 2.32kg/km

Or in savings when moving the empty coal train over the full coal train...
Savings = 1 - 2.32kg/km / 2.68kg/km = 0.134 = 13.4%

Firstly this calculation shows that the train in the given conditions would be using well under half its potential coal consumption since only a small amount of its power is needed to keep the coal trains moving. Secondly it shows that running the empty train is 13.4% cheaper per km than when pulling the full train. It also shows that most of the power is being used to combat airodynamic drag, possibly due to how bad I am at calculating this sort of thing (maybe the number was smaller in real life? or larger?). It is also possible the rolling resistance numbers are wrong, I do not know for sure.

This does sort of make sense. The train only needs most of its power when accelerating or when climbing a hill. There are practical limits to the load it can hall based on these conditions.

Now this does not factor in accelerating the train to 44.8km/h. This uses the trains extra power but is technically an energy cost hence would have a cost in kg of coal associated with it.
Loaded -> 1/2 * 349,500kg * 12.4m/s ^ 2 = 26,869,560J
Unloaded -> 1/2 * 149,500kg * 12.4m/s ^ 2 = 11,493,560J

Assuming 30MJ per kg of coal (https://en.wikipedia.org/wiki/Energy_density) with 3.8% efficiency...
Loaded -> 26,869,560J / 30MJ/kg / 0.038 = 24kg
Unloaded -> 11,493,560J / 30MJ/kg / 0.038 = 10kg

Is this cost significant? it is between 1/10 and 1/5 of an hour of running, more so when loaded than unloaded.

I will look into the second rail example later.

ACarlotti

One brief thing to note is that I believe the physics engine currently uses only the air resistance of the leading vehicle, ignoring any resistance along the side of the train or caused by the gaps between vehicles. While the resistance to the leading vehicle is more significant than that to any other individual vehicle, this does not necessarily mean that subsequent vehicles can be ignored. Indeed, I think over a long container trains the overall effect of subsequent vehicles is rather significant. (I do not have any figures for this right now, but the RAIB report about a wheelchair striking a freight train due to air movement overcoming the brakes comes to mind.)

jamespetts

Dr. Supergood - thank you very much for the calculations. I have not had time to review them in detail as yet, as I have been very busy this week, but some initial thoughts pending your second rail example.

Firstly, I suspect that there is an error somewhere apropos air resistance: between rolling resistance and air resistance, rolling resistance is by far the most significant. Air resistance is trivial at low speeds, and minor at moderate speeds. It is more significant at higher speeds, and significant enough that streamlining makes a difference at >90mph (but below that speed, streamlining has no significant effect in real life). I am not sure where the error is in the calculations (one or more off by orders of magnitude error(s)?) as I did not write the physics code.

Secondly, for the purposes of discerning the economic (rather than purely physical) significance of different fuel consumption rates, we have to compare not just loaded and unloaded fuel consumption, but dynamic calculation of fuel consumption (as you suggest) against static averaging of fuel consumption (as originally planned) to see whether this differs significantly in significant enough ways in enough cases to justify the additional complexity that this would entail. For example, taking your figures of 37kW vs. 32kW (I pause to wonder whether we should really be measuring energy, i.e. kWh, rather than power (kW)) for loaded vs. unloaded, what we need to do is to compare, not 37kW with 32kW, but rather the average of the two, 34.5kW being applied at all times as against the figure being calculated dynamically and varying between 37kW and 32kW.

Of course, on a flat journey, this would make no difference at all: the loaded trip in one direction would consume 37kW and the unloaded trip 32kW, and the two would average out to 34.5kW, which would be exactly the same result as if the average 34.5kW had been applied to both trips individually. One case that you mentioned where this might make a difference is with a heavy freight load that is higher in altitude than its destination. This is indeed the case, but I am doubtful as to the actual significance of this in gameplay terms, both in terms of the magnitude of the numerical significance and the frequency with which it is likely to be encountered in game. The pakset will have to be balanced so that flat journeys make a profit in any event, so it it really important that players would not be able to make extra profit from a downhill run?

Another perhaps more significant consequence might be that players have more disincentive than they would have in reality to use more powerful vehicles where less powerful vehicles would do; but I am still not sure of the real practical significance of this in magnitude terms, nor whether a simple dynamic power calculation would get this right: after all, players should not have an incentive (as they do in Standard often) to use the most powerful vehicles for everything.

A. Carlotti - as to side drag: this is an interesting thought. I did not write the physics code, and given its complexity and my lack of knowledge of the details of physics, I should be reluctant to change it; I also do not know any figures for calculating side drag so as to be able to modify the code even if i were inclined to do so.
Download Simutrans-Extended.

Want to help with development? See here for things to do for coding, and here for information on how to make graphics/objects.

Follow Simutrans-Extended on Facebook.

ACarlotti

I think it is currently impossible to produce accurate (or close to accurate) running costs for all four combinations of:
1. A diesel locomotive with high energy costs
2. An electric locomotive with low energy costs
and:
a. A short train of (say) 2 coal wagons
b. A long train of (say) 20 coal waggons

Clearly replacing 1b with 2b should lead to a greater reduction in running costs than replacing 1a with 2a, but at present these two replacements cannot produce different reductions in costs.

So this suggests that some account of actual energy consumption is needed in the long run.

Quote from: jamespetts on July 07, 2018, 12:15:22 AMA. Carlotti - as to side drag: this is an interesting thought. I did not write the physics code, and given its complexity and my lack of knowledge of the details of physics, I should be reluctant to change it; I also do not know any figures for calculating side drag so as to be able to modify the code even if i were inclined to do so.
I think I would feel comfortable working on this at some point in the future, but I would anticipate this being multiple years away given my other priorities.

DrSuperGood

QuoteFirstly, I suspect that there is an error somewhere apropos air resistance: between rolling resistance and air resistance, rolling resistance is by far the most significant. Air resistance is trivial at low speeds, and minor at moderate speeds. It is more significant at higher speeds, and significant enough that streamlining makes a difference at >90mph (but below that speed, streamlining has no significant effect in real life). I am not sure where the error is in the calculations (one or more off by orders of magnitude error(s)?) as I did not write the physics code.
I suspect the value you provided for rolling resistance is incorrect. Possibly it excluded the rolling resistance of the steam engine which would be higher per ton than the coaches due to pistons and levers being attached to the wheels.

Even at 44.8km/h air drag starts to become significant if you are moving a box at those speeds, which might actually be more aerodynamic than a steam engine due to all the discontinuities on the surface as well as strange protruding shapes. Sure the calculations might not be completely accurate, I have a feeling 10m2 might be too large for the front cross section of a steam engine. At 89.6km/h drag is 4 times as much as at 44.8km/h and the power needed to overcome drag is 8 times as much. Hence the values do seem kind of reasonable.

I think all the "but below that speed, streamlining has no significant effect in real life" talk refers to everything now days being streamlined in the first place and hence below those speeds the drag is minimal that improving streamlining further has limited effect. Some modern cars have a drag coefficient of ~0.25 with tiny front cross section, where as something like a steam train would be ~2 (this might be wrong) with a much larger front cross section. This means that for a car the drag forces at 44.8km/h are insignificant where as for the steam train they are considerably more significant.
QuoteI am not sure where the error is in the calculations (one or more off by orders of magnitude error(s)?) as I did not write the physics code.
This has nothing to do with the physics code. I literally went to Wikipedia and read up all the formula. The formula states that for a doubling in speed the force exerted by drag increases by 4 times and the power required to overcome drag by 8 times.

https://en.wikipedia.org/wiki/Drag_equation

QuoteSecondly, for the purposes of discerning the economic (rather than purely physical) significance of different fuel consumption rates, we have to compare not just loaded and unloaded fuel consumption, but dynamic calculation of fuel consumption (as you suggest) against static averaging of fuel consumption (as originally planned) to see whether this differs significantly in significant enough ways in enough cases to justify the additional complexity that this would entail. For example, taking your figures of 37kW vs. 32kW (I pause to wonder whether we should really be measuring energy, i.e. kWh, rather than power (kW)) for loaded vs. unloaded, what we need to do is to compare, not 37kW with 32kW, but rather the average of the two, 34.5kW being applied at all times as against the figure being calculated dynamically and varying between 37kW and 32kW.
Problem is that the average could vary in so many ways... Raising the speed of the train would raise the average due to additional drag. Adding more coaches would raise the average due to additional rolling resistance. Using a vehicle with a better drag coefficient, eg, a smaller steam engine, might lower the average due to less drag losses.

jamespetts

Quote from: DrSuperGood on July 07, 2018, 07:08:03 AM
I think all the "but below that speed, streamlining has no significant effect in real life" talk refers to everything now days being streamlined in the first place and hence below those speeds the drag is minimal that improving streamlining further has limited effect.

No, I recall reading this in relation specifically to steam engines: this is why so few steam engines were ever streamlined: it made virtually no difference to the speeds at which all but the fastest steam engines would ever run.

QuoteProblem is that the average could vary in so many ways... Raising the speed of the train would raise the average due to additional drag. Adding more coaches would raise the average due to additional rolling resistance. Using a vehicle with a better drag coefficient, eg, a smaller steam engine, might lower the average due to less drag losses.

And this is precisely what needs accurate calculation: we need to know, empirically and numerically, whether the difference in the average for fuel consumption differs sufficiently to make a real difference to what players have an incentive to do in enough different situations that are realistically likely to arise to make the enormous extra complexity of dynamic calculation of fuel consumption and consequent delay of many months or even years in the code being balance ready worthwhile.
Download Simutrans-Extended.

Want to help with development? See here for things to do for coding, and here for information on how to make graphics/objects.

Follow Simutrans-Extended on Facebook.

Vladki

I'd like to confirm, that the current code in simutrans for air friction uses only the first vehicles values.

And I must confess personally, that standing at a platform 1-2 m from the edge while a fast (160 km/h) train is passing by is not a good idea. However I spoke to a guy who works near the tracks, and said that there is huge difference in the blow between non-streamlined engines (boxy shape), and streamlined (pendolino and similar). But the biggest blow was from the engine, the rest of the train made much less turbulence.

DrSuperGood

QuoteAnd I must confess personally, that standing at a platform 1-2 m from the edge while a fast (160 km/h) train is passing by is not a good idea. However I spoke to a guy who works near the tracks, and said that there is huge difference in the blow between non-streamlined engines (boxy shape), and streamlined (pendolino and similar). But the biggest blow was from the engine, the rest of the train made much less turbulence.
This is because the front shape causes most of the air displacement and hence most of the drag. The rest of the train is directly behind the front of the train so rides in the displacement it made so produces little drag.

That said train length does increase drag in the form of turbulance between coaches and surface friction of the sides of the coaches rubbing the air. This is most noticable with long mixed freight trains where the height of the freight coaches might vary such that the displacement fades away between them. Yes there are real life energy savings to be had by correctly ordering your freight so that similar height coaches are next to each other and ordering them from tallest in the front to shortest in the back.

Drag forces occur at every speed. Even at low speeds one can still have savings by reducing the drag coefficient. Just at very low speeds the power required is so low it can be considered trivial compared to other losses. For example a human has a drag coefficient of around 2, making us not much more aerodynamic than a box. However at common walking speeds of 5 km/h with the small front cross section of a human the result is minimal drag loss, so small one will not even notice it. However start to ski or cycle around and these drag losses are huge, so large that professional athletes have to adopt special poses and wear special clothing to reduce their drag coefficient. Let us not even talk about swimming and how bad the human body is at doing it due to this...

44.8km/h is not slow. The same shape moving at 89.6km/h would have 4 times the drag force and at 179.2km/h 16 times the drag force. I know that at 179.2km/h drag is a huge problem for steam engines, hence one can expect it to be 1/16 less of a problem at 44.8km/h.

jamespetts

It would be ideal if we could simulate non-frontal drag; but this is taking us rather a long way from the real issue of this topic, viz. precisely what features are actually necessary for balancing. As to drag generally, I know that Bernd Gabriel did use realistic values for drag (he had initially used too high a value to get realistic acceleration, which caused problems with light, low powered vehicles; we then realised that he had not accounted for transmission losses, so we used the "gear" values to account for these in all but steam engines where power is measured at the drawbar in any event, and then reverted to the realistic drag coefficient values, which we use now); but also that, at lower speeds, drag is relatively trivial. A cyclist will experience significant air drag at 32km/h, but a tram (for example) will have, proportionate to its power and other resistive forces, only relatively minor air drag at the same speed. When the drag coefficient was initially set too high in order to compensate for failing to take account of transmission losses, it was the low powered, light vehicles where this caused problems by making them too slow. A small proportion (the side drag) of a relatively minor part of the overall physics (the air drag) is not likley to make a major difference to the overall balance, certainly not enough to warrant delaying balancing until this can be done or changing what other balancing features are added just to take account of this.

Dr. Supergood - have you completed the aircraft analysis to which you referred above? It will be very interesting to see this, and, in particular, not just the loaded vs. unloaded calculations, but rather the static averaged vs. dynamic fuel consumption calculations. I will in the meantime see if I can find any historical sources on practical variance in fuel consumption, although what I have seen so far has strongly tended to be averaged fuel consumption for rail vehicles in particular (see the "snippet of relative pricing information" thread for the details of this that I have digested from various sources).
Download Simutrans-Extended.

Want to help with development? See here for things to do for coding, and here for information on how to make graphics/objects.

Follow Simutrans-Extended on Facebook.

jamespetts

Some more thoughts of a miscellaneous nature. Firstly, average speeds: in this post, I set out average fuel consumption for some 19th century steam locomotives and calculated that, for the LNWR Precedent class, the average speed would have to be in the region of 54km/h to match the calculated/extrapolated fuel consumption/power/thermal efficiency figures.
Looking at actual average speeds for trains in game: in a saved game from 1860 (from the Bridgewater-Brunel server), average speeds for passenger trains ranged from 35-58km/h, with most in the 40-50km/h range. Only Dr. Supergood's express trains with the LNWR "extra large bloomer" locomotives exceeded an average of ~52km/h.

By 1904 (the current date for the server game), train average speeds have increased, but not by a great deal: now, they are mostly between 50-60km/h, with extremes at 25km/h for urban rail and 67km/h for express trains (e.g. Bay Transport's Northern Frontier Express).





Looking at the "Snippet of relative pricing information" thread, the following posts deal with historical sources showing fuel consumption using either average speeds or giving a simple per kilometre/mile figure without indicating the speed:

https://forum.simutrans.com/index.php/topic,6521.msg85675.html#msg85675
https://forum.simutrans.com/index.php/topic,6521.msg98733.html#msg98733
https://forum.simutrans.com/index.php/topic,6521.msg129252.html#msg129252
https://forum.simutrans.com/index.php/topic,6521.msg147771.html#msg147771
https://forum.simutrans.com/index.php/topic,6521.msg157715.html#msg157715
https://forum.simutrans.com/index.php/topic,6521.msg157721.html#msg157721
https://forum.simutrans.com/index.php/topic,6521.msg140571.html#msg140571
https://forum.simutrans.com/index.php/topic,6521.msg160790.html#msg160790
https://forum.simutrans.com/index.php/topic,6521.msg166768.html#msg166768
https://forum.simutrans.com/index.php/topic,6521.msg169046.html#msg169046

The following posts give some indication of the fuel consumption per unit of power (but this might simply be extrapolated from coal usage at an average speed)
https://forum.simutrans.com/index.php/topic,6521.msg85675.html#msg85675
https://forum.simutrans.com/index.php/topic,6521.msg113258.html#msg113258
The following posts give some indication of dynamic fuel consumption
https://forum.simutrans.com/index.php/topic,6521.msg151288.html#msg151288 (aircraft)

(Incidentally, this post gives at least one source for the amount of coal burnt per square foot of firegrate per hour on a steam locomotive).

Thus, there is far more information available regarding averaged fuel consumption than dynamic fuel consumption. Using a dynamic fuel consumption model therefore requires a known accurate means of extrapolating from the static, averaged figures that we have which is also sufficiently simple to implement to be workable.



In relation to implementation of a dynamic system, if this should prove necessary, one possible way of doing this is to assume that a vehicle is using its full power and thus maximum fuel consumption whenever it is accelerating or travelling at a speed limited by its power, and calculate a percentage of currently used power (and therefore fuel) when it is travelling at a speed limited by something other than its power (the convoy's or the way's speed limit, signals, etc.). This percentage could be displayed simply to the player and the player could therefore easily understand how much power is being used.
However, there are some serious issues that need to be considered before even this scheme can be implemented (if indeed it can). Firstly, there is the question of how to calculate this. I have no idea what the formula should be, save that increasing power increases with the square of increasing speed. The physics engine is quite computationally intensive because it uses a fixed point system implemented using integral values (because floating point precision cannot be kept in snyc over a network with clients compiled for different platforms). Any per-step calculation involving square roots for all vehicles might significantly harm performance.
Secondly, there is the question of how to get the data for the maximum fuel consumption. As above, almost all the data are for average fuel consumption. There are some data for aircraft's maximum fuel consumption, but road, rail and water vehicles have no equivalent data.

Thirdly, there is the vexed question about what to do about deceleration and idling. If we are modelling actual, dynamic fuel consumption, we have to assume a minimum fuel consumption for when the vehicle is decelerating; but this also requires one to assume that this minimum fuel consumption is maintained when the vehicle is, e.g., stuck behind a signal or in a traffic jam. This is not consistent with the existing per km cost system and so would require further complexity, possibly removing fuel from the per km cost system entirely and making fuel consumption time based - but this would then be far, far more complex to implement (and also harder to explain to the player). This would also make it even harder to get good fuel consumption figures against which to calibrate it, especially for internal combustion engine vehicles whose economy is typically measured in miles per gallon or litres per kilometre.



In any event, I shall look forward in due course to Dr. Suergood's aircraft calculations and any calculations showing whether there is a serious balance difference between static and dynamic calculation of fuel consumption.
Download Simutrans-Extended.

Want to help with development? See here for things to do for coding, and here for information on how to make graphics/objects.

Follow Simutrans-Extended on Facebook.

ACarlotti

It seems to me that the example I gave in this post (with the added proviso that all four trains travel at the same speed for most of their journey) is sufficient to demonstrate a need to charge for fuel consumption (or some equivalent measure).

This could perhaps be as simple as adding a running cost to powered vehicles which is charged proportional to the motive power they apply, although I think it would be more sensible to introduce some of the following sets of variables (many existing variable included for completeness):
Fixed:

  • Monthly Running cost
  • Distance Running cost
  • Weight
And per fuel type (could also be specified once for all types for compatibility):
  • Maximum power
  • Maximum force
  • Minimum power (could be negative for regenerative braking back to grid, or positive to represent an idling engine while decelerating)
  • Fuel cost (per unit of energy)
A separate proposal I think I made elsewhere:

  • Energy buffer capacity (e.g. for battery-fuel hybrids, or to simulate steam locomotives building up energy before a hill, or horses being capable of working harder to climb a short hill
  • Buffer max charge rate
[li]Buffer max power output
[/li][/list]

Fuel weight: Modelling this precisely would probably require a refuelling system to be implemented, but I don't think this is necessary. Even for aircraft, where almost half the gross weight can be fuel on long-haul flights, the extra weight doesn't seem to affect fuel consumption much, based upon this graph for a 777.  Furthermore, I think a realistic refuelling system is incompatible with Simutrans, since most transit vehicles refuel only overnight, or sometimes off-peak, whereas Simutrans has no concept or day/night or peak/off-peak. That's not to say that fuel capacity is unimportant, but it can be mostly simulated using the existing range feature (or perhaps planned maintenance features for something like horses requiring an overnight rest). This does ignore some subtleties such as aircraft having a greater range with a smaller payload, but I don't see any reason to implement that as a feature. This is related to the lack of stabling sidings/depots in Simutrans.

All of the above features, along with an increase in the number of electrification types, are sufficiently interlinked that they should probably all be at least accommodated, if not implemented, in a future modification/reworking of the physics system. They all seem computationally feasible to me (with the probable exception of fuel weight and refuelling); the main issue (as with all things) is having time to develop them.

DrSuperGood

QuoteI have no idea what the formula should be, save that increasing power increases with the square of increasing speed.
Power increases by the cube of increasing speed as covered by the drag formula. This is because the drag force increases by the square of speed but work is force times distance and power is work over time and speed is distance over time. Hence power to overcome drag increases by the cube of speed.

This is why reducing speed even a small amount for both ships and trains can have significant energy savings. This applies to ships especially due to the higher density of water than air so their hulls in the water produce a lot of drag at anything but the lowest speed (why ships are so slow in general and why hovercrafts are so fast).
QuoteEven for aircraft, where almost half the gross weight can be fuel on long-haul flights, the extra weight doesn't seem to affect fuel consumption much, based upon this graph for a 777.
In retrospect I agree. Averaged statistics are probably fine for aircraft. At most a landing/takeoff charge could be added to make short distance flights more or less economical with some types of aircraft to achieve a similar graph shape with averaged values.

jamespetts

Thank you for your thoughts. I can only reply briefly now as I am in a train, but one very significant thing that must be considered is that fuel economy is not constant for any given engine but rather varies with speed and load. A high power engine running at a low load will be less efficient than a high power engine running at a high load or a low power engine running at a low load.

See here for discussion: https://physics.stackexchange.com/questions/195479/engine-fuel-consumption-vs-power

This makes it much harder to produce a satisfactory formula for this,as one cannot simply calculate a single jule per watt figure for each vehicle.
Download Simutrans-Extended.

Want to help with development? See here for things to do for coding, and here for information on how to make graphics/objects.

Follow Simutrans-Extended on Facebook.

jamespetts

To add to the previous post in a little more detail: given that fuel economy per unit of power output is not consistent at different levels of power output, the only way in which a dynamic system for calculating the contribution of fuel consumption to running costs is likely to be more realistic than a static averaged system (the latter of which would use data from sources that would already have taken into account by averaging the vehicle's differing fuel efficiency at differing levels of power output) is: (1) to have data about the relationship between fuel efficiency, current power output and maximum power output for different sorts of vehicles; (2) develop an algorithm to simulate this relationship which is accurate enough to make the overall fuel consumption significantly more accurate than for a static averaged calculation but fast enough not significantly adversely to affect game performance; and (3) find a clear, simple and precise way of communicating this relationship to the player using the UI.

At present, I do not have any idea as to where even to begin on any of these three things. For (1), which is where one would have to start, one would need to have, at the very least, multiple data points for each of the following types of engine: (1) reciprocating steam engines; (2) reciprocating internal combustion engines; (3) jet engines; and (4) electric motors. Each of those data points would, in turn, comprise a multi-point graph showing the relationship between power output and fuel efficiency at any given level of power output. I am afraid that I have no idea where one can find such data. Does anyone else have any ideas for where such data might be obtained?

The non-constant relationship between fuel efficiency and power output is potentially significant in other ways, too. Given that it appears that the way in which this relationship is non-constant is that (as one might expect) engines with a high maximum power output are considerably less efficient when being used at a low level of power output than engines with a low maximum power output (at least for internal combustion engines and probably also steam engines - it is not clear whether and if so to what extent his applies to electric motors), a static, averaged system is likely to be less wrong than it would be if this relationship were constant. Importantly, an algorithm that assumes a constant relationship would not give players any incentive to use lower powered vehicles where the higher degree of power is not necessary, whereas both the dynamic system with the dynamic efficiency to power ratio and the static averaged system would give players such an incentive. This is of particular importance, since, without such an incentive, vehicle choice becomes far less meaningful, and whole swathes of lower powered vehicles become more or less useless, which is the exact opposite of the purpose of Simutrans-Extended. Thus, for practical purposes, a dynamic system that assumes a static relationship between power output relative to the maximum and fuel efficiency is likely to be more wrong than a static averaged system. Only a double dynamic system (one that both changes both fuel consumption and fuel efficiency with power output) is likely to be better than a static averaged system.

The bottom line seems to be this: unless there are people able and willing to assist with both data and algorithm, I do not think that a dynamic model is feasible, as an overly simplistic dynamic model is likely to be worse than a static model, and one that is not overly simplistic is likely to be very, very complex indeed and require extensive research data which are very hard to obtain. Is anyone in a position to assist with this?
Download Simutrans-Extended.

Want to help with development? See here for things to do for coding, and here for information on how to make graphics/objects.

Follow Simutrans-Extended on Facebook.

DrSuperGood

There are different tiers simulation to consider. At present I would say using averaged efficiency with dynamic power. This would still mean that moving an empty freight train or a train with few coaches saves over a full freight train or one with many coaches. Like wise lower speeds would give savings due to less drag than higher speeds. It would also remain simple enough to calculate in real time I hope because the maths involved for energy efficiency with speed often become quite complex and use non trivial functions. There may be cases where running very slowly is too economical as a result, however one must remember that a competitor just has to run slightly faster and the line loses all business so in practice I do not see it being abused that much out of desperate or miser people. Running fast will never be too economical due to drag, even if in real life the engine is more efficient than it should be at those speeds.

jamespetts

Quote from: DrSuperGood on July 15, 2018, 07:24:25 PM
There are different tiers simulation to consider. At present I would say using averaged efficiency with dynamic power. This would still mean that moving an empty freight train or a train with few coaches saves over a full freight train or one with many coaches. Like wise lower speeds would give savings due to less drag than higher speeds. It would also remain simple enough to calculate in real time I hope because the maths involved for energy efficiency with speed often become quite complex and use non trivial functions. There may be cases where running very slowly is too economical as a result, however one must remember that a competitor just has to run slightly faster and the line loses all business so in practice I do not see it being abused that much out of desperate or miser people. Running fast will never be too economical due to drag, even if in real life the engine is more efficient than it should be at those speeds.

As explained in the previous post, single dynamic fuel consumption is likely to produce a worse (or, at best, equally bad) degree of realism than static averaged fuel consumption in terms of what players actually have an incentive to do. For the reasons already given, only double dynamic fuel consumption is likely to give any improvement in realism (so far as player incentives are concerned, which is the important thing to consider) over static averaged fuel consumption.
Download Simutrans-Extended.

Want to help with development? See here for things to do for coding, and here for information on how to make graphics/objects.

Follow Simutrans-Extended on Facebook.

ACarlotti

Have you taken into account that higher monthly or distance-based maintenance (/staffing) costs, higher weight and higher rolling resistance will also tend to penalise using an overpowered vehicle?

jamespetts

I doubt that a higher powered vehicle would need more staff than a lower powered vehicle: a steam engine of any size still needs just one driver and one fireman; a huge articulated lorry needs the same number of drivers as a van; a large double decker 'bus needs the same number of drivers as a small single decker 'bus (there were some differences with very small minibuses which could be driven by people with van licences at one point, but that does not scale with power). Higher weight may be significant in some cases, but may well not be particularly significant in others (and weight will certainly not scale in a linear fashion with power in any event), and of course, a higher powered vehicle would almost always have a better power to weight ratio than a lower powered vehicle or else it would be of no use at all compared to the lower powered vehicle. Aside from higher weight, it is not clear why more powerful vehicles are likely to have higher rolling resistance.

The only real co-acting incentives against using higher powered vehicles where lower powered vehicles would suffice are weight and capital cost (and the latter more importantly than the former); but I am doubtful that these will produce the same incentive patterns in practice as a system involving more accurate fuel efficiency.

It really does not seem likely that a singly dynamic fuel consumption system will be any more accurate than a static averaged system (although of course we have not tested this empirically; but I am not sure that we have the data with which to do so at this stage; does anyone have any data with which this can be tested? The trouble is, of course, that the very data necessary for this testing are the same data as we would need to implement the doubly dynamic system in the first place).
Download Simutrans-Extended.

Want to help with development? See here for things to do for coding, and here for information on how to make graphics/objects.

Follow Simutrans-Extended on Facebook.

DrSuperGood

Quotea steam engine of any size still needs just one driver and one fireman
The late stage steam engines I thought required at least 2 firemen at any given time, with express services like the Mallard requiring replacement firemen on standby (4-6 firemen in teams of 2 swapped out using a corrodor tender). This is because a fireman can only shovel so much coal per hour for so long. Now if the standby firemen should be getting paid when not shovelling coal is another question.

Replacement firemen were also parked at stops along the way for some stopping express services. As such even if only 1-2 firemen were on the locomotive at any given time, one might still need many more employed to man the engine with them being swapped out at stops.

Obviously staff management and swapping is an extremely complex system. As such having averages might be better. For sure more powerful steam locomotives would average more staff to run.
Quotea higher powered vehicle would almost always have a better power to weight ratio than a lower powered vehicle or else it would be of no use at all compared to the lower powered vehicle
Not true at all. Power to weight ratio has to do with performance, a metric only cared about when speed is critical such as motor racing or express services. What drives the use of large vehicles is efficiency, the cost per ton per km hauled.
QuoteAside from higher weight, it is not clear why more powerful vehicles are likely to have higher rolling resistance.
Depends on type of vehicle. In the case of road vehicles the rolling resistance is not linear with weight as more weight causes the tires to deform more and hence generate more rolling resistance when moving along the road than stiff wheels like rails will.

Mostly larger vehicles are more efficient from a drag loss point of view. This is why it is a lot more economical to move long coal trains rather than short coal trains even though rolling resistance loses are less with short coal trains. Exception is with aircraft where on top of normal drag losses they are also subject to parasitic drag to generate lift force, in which case weight efficiency is a major design consideration.

jamespetts

#67
Quote from: DrSuperGood on July 16, 2018, 05:51:06 AM
The late stage steam engines I thought required at least 2 firemen at any given time, with express services like the Mallard requiring replacement firemen on standby (4-6 firemen in teams of 2 swapped out using a corrodor tender). This is because a fireman can only shovel so much coal per hour for so long. Now if the standby firemen should be getting paid when not shovelling coal is another question.

Only two classes of locomotives, both on the same railway (the LNER) were ever fitted with corridor tenders: the A3 and A4 class. Those locomotives hauled very long distance expresses between London and Edinburgh, some of them with few or no stops. The journey would take in excess of a working day, and therefore both driver and fireman would be changed using the corridor tender. No other railway in the UK ever used corridor tenders.

QuoteReplacement firemen were also parked at stops along the way for some stopping express services. As such even if only 1-2 firemen were on the locomotive at any given time, one might still need many more employed to man the engine with them being swapped out at stops. Obviously staff management and swapping is an extremely complex system. As such having averages might be better. For sure more powerful steam locomotives would average more staff to run.

I am not aware of any situation in which, in the UK, the fireman was changed when the driver was not changed. Do you have any sources for this? (Changing both crew was fairly common on longer runs, of course).

QuoteNot true at all. Power to weight ratio has to do with performance, a metric only cared about when speed is critical such as motor racing or express services. What drives the use of large vehicles is efficiency, the cost per ton per km hauled.

Do you have any significant examples of where the power to weight ratio declined with increasing power for land vehicles?

QuoteDepends on type of vehicle. In the case of road vehicles the rolling resistance is not linear with weight as more weight causes the tires to deform more and hence generate more rolling resistance when moving along the road than stiff wheels like rails will.

Surely heavier road vehicles would just have higher pressure tyres?




The idea of dynamic fuel consumption requires very great complexity and additional time. In order to make the degree of sacrifices necessary to implement this, I need to have a high degree of confidence that this will be significantly better than a static averaged system in terms of how the game plays in practice (i.e., player incentives in non-edge cases). It is not at all clear at present (and, indeed, it seems from what I have found so far unlikely) that this will be the case unless the fuel efficiency be dynamic as well as the fuel consumption.

This source gives some indication of the relationship between load and power consumption for internal combustion engined road vehicles; I have great doubt that we will find anything for steam engines, although I suspect that the graph is most similar to the diesel engines given, as the fire would have to be "forced" to produce maximum power output, resulting in much unburnt material being ejected through the chimney. I do not know the position for electric motors. Information on the relationship for electric motors can be found here. If anyone can come up with a workable algorithm to use the information in this graph in a way that interacts with the variables that we already have in the Simutrans engine, that would be most useful.

As I think that I have indicated above, the only way that I can think of making dynamic fuel consumption workable is by making fuel consumption time based rather than distance based, as we then have to take into account idle loads. We would then have to take account of the fact that some engines can be switched off in some cases of sufficiently long stops (giving a zero idle load), and that others cannot. We would also have to take into account the fact that for some vehicles (such as horses), their food consumption would not vary much with load (perhaps that could be simulated with a very high idle load - an animal's resting metabolic activity is far greater than the difference between resting and exercising metabolic activity). We would then have to come up with a way of converting miles per gallon and equivalent distance based fuel consumption data into time based data. We can probably do this for aircraft without much difficulty as we have hourly fuel flow figures for many aircraft, and we can do this for steam engines as we have hourly coal burn statistics already, but I do not know how we could do this for road vehicles.

If anyone can think of a means of overcoming all of these challenges, I should be very grateful to know.

Edit: I think that I have mentioned this briefly above, it it is worth making clear here: if we do not get the dynamic relationship between power output and efficiency right, then the average fuel consumption actually experienced by players in the game is likely to be significantly wrong. A static, averaged system will already have taken the dynamic relationship between power output and energy efficiency into account in giving the averages. Thus, this is another reason that the only real options are either double dynamic energy costs or static, averaged energy costs.
Download Simutrans-Extended.

Want to help with development? See here for things to do for coding, and here for information on how to make graphics/objects.

Follow Simutrans-Extended on Facebook.

jamespetts

The time to resume work on the vehicle maintenance features is now approaching, but it is necessary to reach a final resolution on this issue before it does.

So far as I can discern from the discussion so far, the position is that, whilst fully dynamic fuel consumption would be ideal, if not done properly so that the fuel efficiency as well as fuel consumption varies with power output, this could easily be no better than, or even worse than, a static averaged system for fuel cost as was originally planned.

Given the very great amount of additional work likely to be involved in dynamic fuel cost calculation, it is necessary to have a high degree of confidence that such a system would (1) be workable; and (2) be preferable in the form implemented to a static averaged system. This would mean (1) devising a workable algorithm to vary not just fuel cost but also fuel efficiency with power output; and (2) finding enough data for relevant types of vehicles to enable the actual in-game figures to be based on real life data, or extrapolations or interpolations there-from.

At present, I do not believe that it is possible to implement a workable dynamic system within current known constraints, as I do not know anywhere where I could find what a suitable formula could be or find enough data.

If anyone would like to propose a workable scheme, I should be grateful if this could be done, at least in outline, soon (preferably within the next week or so), or else I will have to continue as originally planned with a static averaged system.

Thank you all for your input on this idea so far - it is appreciated.
Download Simutrans-Extended.

Want to help with development? See here for things to do for coding, and here for information on how to make graphics/objects.

Follow Simutrans-Extended on Facebook.

DrSuperGood

To a large extent vehicle maintenance should not heavily couple with fuel economy. For now simply implementing vehicle maintenance would solve some of the above mentioned problems with accurate vehicle life costs.

Accurate fuel and running costs can be visited at a later time. Unfortunately it is the sort of feature that may require some experimentation and testing before results are satisfactory.

Although the mathematics involved are quite simple, and could potentially be estimated and still good enough, the problem is getting actual realistic data. Drag was a huge problem with steam engines but no one has shoved one in a wind tunnel because the importance of drag is a very modern concept, post dating the fall of wide spread steam usage. Aircraft do have fuel efficiency variances based on distance and loaded weight but these seem to be quite small so might be worth averaging away. Ships do have variances in fuel efficiency based on their speed they travel at, however how much of a variance is probably unknown for early steam ships, especially since they were hybrid sailing ships and in real life arriving on time often out does the difference in fuel economy.

There are different tiers of system that could be implemented, possibly individually. It may be found that some are sufficient that others could be ignored. In any case at some stage they will have to be looked at since averaging just will not work due to allowing players to exploit extreme cases that abuse the averaging or exposing them other extremes that unfairly punish them.

Ultimately at least the following needs to be looked into and modelled in some form or another.

  • Aero/hydrodynamics and the ability to limit maximum speed. Slower means lower drag which means some savings. This would mostly apply to ships and early trains, with others possibly able to use averages instead. Most of the energy cost of ships is due to this.
  • Acceleration and deceleration costs. Accelerating heavy vehicles uses a lot of energy which ultimately is wasted when breaking. This would mostly apply to trains and road vehicles as they are considerable masses that may be subject to regular acceleration and deceleration, especially within inefficient networks. Most of the energy cost on some underground networks with short distance stops is likely due to this. This can be ignored with ships because ships have very low top speeds and generally travel long distances without stopping and often take advantage of coasting so averages would suffice.

The following features probably do not need to be investigated and instead could be modelled by averaging or other easy to implement mechanics.

  • Dynamic maximum range of vehicles. Technically maximum range varies with speed, weight and the amount of breaking performed. However simulating fuel would likely annoy players and becomes hugely complicated.
  • Fuel efficiency of aircraft. Although the data will be available somewhere due to how much money is involved with aircraft and air transport being a recent invention, the gains from it are likely minimal over using averaging. For ranges that an aircraft would have extremely poor economy in real life (huge aircraft short distance) one could apply a minimum permitted flight distance or a constant takeoff/landing charge.