Steam Engine physics: TS and Real World

Steam Engine physics: TS and Real World

Postby TrabantDeLuxe » Sat Aug 06, 2016 10:17 pm

Continued from this topic, pp. 7, 8 & 9

Steam locomotives, how do they work? How do we come up with reasonable performance figures? What goes on under the bonnet of TS? So many questions, let's discuss.
TrabantDeLuxe
Passed Fireman
 
Posts: 247
Images: 7
Joined: Mon Mar 21, 2016 10:10 pm
Location: Delft, NL
Has thanked: 176 times
Been thanked: 263 times

Re: Steam Engine physics: TS and Real World

Postby AndiS » Sun Aug 07, 2016 9:48 pm

Another very telling Sunday. Instead of digging through the maths, I looked for reasons not to do it.

Part 1: Quick remarks triggered Eduard's excellent source

1) It cites Wood: Principles of Locomotive Operation, 1925. The 1915 edition of this can be downloaded here. I recommend it to all who feel locked out by all the discussion of Igel and other Germans. It's the US parallel and comparing it to Igel subtopic by subtopic would be a great project for anyone seeking a degree in history of technology or something like that.

2) Since the trigger to this quest here is a rather early design, I feel that it is important to take the historical context of each engine into consideration when trying to define its parameters of performance.

At the risk of looking ridiculous, let me fake an introduction to steam engine history so you know what I mean by shifting limitations.

The constant background is that for 150 years, people wanted more and more performance from engines. First engines had to justify their price against horses that could almost do the same unless traffic was really heavy. Last designs tried to show that they can do what Diesel engines do.

  • First, internal friction plus balancing the rotating parts was an issue, so they preferred uncoupled designs.
  • When they got that settled, they moved to 2, latter three coupled axles, even for fast running engines.
  • Without clever arrangements for sideways shift of coupled axles and an understanding how to build that so the engine does not derail at higher speed, they could not go much farther that 3 coupled axles.
  • Before the introduction of vacuum or air brakes, no one needed fast running engines that could carry a heavy train.
  • High boiler pressure has always been a great thing but steel was not durable enough for quite a while.
  • Superheated steam was known to be more efficient, but supply of suitable grease was a serious limiting factor.
  • Compound engines were a great success for static engines and ships, but whether they paid off financially (counting in maintenance effort) in railway engines was debated quite to the end of their history.
  • Maximum axle load was limited by the company's will to invest in better trackwork.
  • Almost all engines were designed as improvements of an existing one. Changing as few parts as necessary meant substantial savings in maintenance but it sometimes reduced the degree of harmony among all the parts of an engine, thereby reducing the benefit from an improvement in some parts.
  • Countless economical, political, geographical and social constraints hindered (and only sometimes promoted) progress.
  • When they got all that settled, they found that gas dynamics and some other complex stuff matters in the most advanced engines. They only focussed on those, since there was the money.
  • In the majority of cases, the reduction of maintenance cost was the one thing the operators cared the most. So staff were told not to take the engine to its limits in many ways (maximum pressure, pressure changes, steam production, sanding. And staff were not always motivated to take it to its limits in some other ways or to listen to the authorities (taking care of the firebed, building up steam for a prompt departure even if it is not sure whether signals will clear, sanding).
Looking at older engines, we are left at our own devices. They were defined by some of the limits on the above list and finding out which is the cornerstone of defining their performance.

This does not mean that dealing with the scientific findings at the end of the steam era is irrelevant. But without knowing the limiting factors, details of steam flow may not bear as much as those factors.

Some fun facts from good old Austria, to illustrate the above:

Military authorities demanded that all engines had an axle load of no more than 14 tons so in case of war, they could freely use them throughout the empire. Though this never had much bearing, even during WW I, saving every kg you could save was a distinct feature of Austrian engines almost into WW II.

This greatly increased maintenance cost as all this saving lead to various parts that wore quicker than desired.

They even left out some springs that would center the leading running axle, accepting the associated drop in maximum space, or else the load on that axle would have been to high.

During WW I, there was a shortage of high-temperature grease from the US, so they added a contraption that sprayed water into the superheated steam to cool it down again so the mediocre grease would not ruin the valves and cylinder. It was more feasible than taking out the superheater, I read.

One of the factories in Vienna had rather short traversers between their halls. They opted against taking down a significant part of them and produced engines that were not as long as they ought have been instead.

Austrian engines generally fired local lignite but those in the farthest south (that is now Italy and Slovenia) fired English coal that was shipped to Triest.

One of the railway lines was bought by French who brought in some French engine designs.

One company, facing rocky terrain, took a page from the Americans while the other copied the English. That was about the one thing they did right, if they changed idols, results would not have been as good.

The reports from trips to America in the 1840ies count with the earliest detailed descriptions of American railways that still exist.
https://archive.org/details/diebaltimoreohi00gheggoog
https://archive.org/details/dieinnerncommun00kleigoog
Oops, off topic now. But fun to read, if you love old-fashioned German and old stuff in general.


Part 2: How to take this to RW/TS2016?

For me, it all starts with the train that the engine pulls. What you observe in the end is whether the engine succeeds in what you expect it to do. So all the performance is relative to the train and if the train is not set up properly, then setting up the engine properly alone does not lead to success.

There are lots of reports describing which engine pulled which train on which gradient at which speed. Of course, there are just as many remarks on how realistic these official "duty tables" were, some engineers outperformed them while others failed due to bad weather and other reasons without their influence.

I admit to being a bit grumpy about RW physics and I lost interest when half a decade ago I found that I could not find out whether loading a wagon during a scenario effectively changed the train mass due to the broken wheelslip.

Under the influence of the good people here I went back and unriddled a few things that I put aside until now. This was greatly helped by stock that I knew was set up with care (i.e., the one that came with the 50ies Riviera route).

The aim of the undertaking is to see how precisely you can depict the waggons & coaches. This degree of precision forms the baseline for any work on engines, for me.

To see the relative importance of each factor contributing to the TE needed, let's go back to my old-time, Continental perspective, just to compare the size of factors.

Rolling friction ... 3 (or about 2.4 in later years)
Gradient ... 10 for a 1 in 100 grade, 5 for 1 in 200, 25 on a mountain route at 1 in 40
Air drag ... v²/2500 as an example, which gives 0.64 for 40 km/h = 25 mph, but 4 for 100 km/h = 62 mph
Curve resistance ... 650 / (radius in m - 30) for tight curves giving 3.8 for a 200 m curve.

The sum of this is multiplied by the train weight. A loaded freight train weighs about three times as much as an empty one.

So on a level track, resistance is composed of 3 + 1 to 4 for air drag + 1 for a wide curve.
On a 1 in 100 grade, 10 is added to that, and air drag will become less of a factor as speed will go down.
On a mountain climb, you get 3 + 25 + 1 + 4 (25 permille, tight curves).

This means that the relative importance of each of these factors depends on the route you are looking at. Only mass matters all the time.

So how much off can we be in the simulation, for each of these influence factors?


Rolling friction

The documentation on RollingFrictionCoefficient says it is multiplied with gravity and mass. So this is the old factor as in my old books - funny given that kg/metric ton is not exactly British.

I peeked into the files of a few new items of rolling stock to repent for talking about the 2007 default stock for too long.
[EK] BR Centenary 3rd Class 0.0015
[EK] Collett "Sunshine" Third - BR Blood & Custard 0.00087
same vor all Mk1 for all I see
[EK] 3Plank 0.001
same with canvas and for other plank count; same for van and bloater.

old Mk2: 0.00082 as in the documentation.

The numbers in the documentation where they quote Railway Magazine give 3.4 lbs/ton on my scrible pad, which would be 1.52 kg per metric ton, or 0.00152 kg per kg of mass. This ties in exactly with the 0.0015 found.

It does not tie in with the 0.0024 I would consider the lower end, by 60%. Now these Mk2/3 coaches must have roller bearings, so I cut out complaints here, but for the 4-wheeled wagons that certainly had none.


Gradient

The good news is that most people use DEM data so the total climb in a real mountain will be as precise as you would care for. The bad news is that the DEM data is less precise as people may think and thus trick route builders in some local deviations that might cause wrong gradients. But by and large, I observe that the gradient profiles people find in books are no more precise that what people produce if they use a small portion of care. This is subjective, of course, but I need to plug in an unanimously positive note here.


Air drag

Documentation on DragCoefficient mentions halving that and multiplying it with air densitiy, which is 1 for all I care. Wikipedia says it is 1.225 at sea level and it depends on a ton of factors that RW certainly does not model, though it could: altitude, temperature, humidity.

However, it does not mention mass (nor gravity), so it must be a constant only multiplied by the squared speed.

Looking at the quote from Railway Magazine, I guess air drag at 0.00166 lbs/ton, which would be a factor of 0.00074 if you convert it to kg (force) per metric ton.

Multiplying that with some 32 tons would give 0.024. But that would be for velocity in mph. If velocity is in m/s, then my factor must be 5,06 as high. And I ought to multiply 9.81 to go from kg to N. But the docu does not mention that. Anyway, I end up at 1.19 then.

How does that tie in with the same files? Not at all.

[EK] BR Centenary 3rd Class 7.2
[EK] Collett "Sunshine" Third - BR Blood & Custard 1.5
same vor all Mk1 for all I see

[EK] GW Standard Van 2.04
[EK] Fish Van - Bloater 1.5

[EK] 3Plank 1.75
same with Canvas
[EK] 5Plank 1.2
[EK] 7Plank 1.5

Some stuff from the time when the docu was written:
Mk2 Second BR Blue 2.76 - true to the documentation !
5 and 7-plank had the same figures back then as now.

Going back to Igel, I find factors for the squared speed. I converted them to N for speed in m/s.
Frank: 0.038 to 0.056 depending on train length (longer trains are more favourable, of course).
Hütte: 0.032.

For a balance, I checked Wood mentioned above. He gives 0.001 lbf per ton for velocity in mph for the first coach, 0.0001 for an intermediate one and 0.00026 for the last. That would be 0.148 for the first and 0.0148 for intermediate ones. A 10 coach train should then see an average factor of 0.027 for each coach.

So if we multiply 0.03 by 30 (which is the lower end of the mass range for coaches), we get 0.9.
If we multiply 0.05 (which is near the upper end of Frank) with 33 (which is given for Mk1 and Collet in the .bin files), then we get 1.65.

So the 1.5 seen in the majority of the newer stock is close to the forumlas I picked. 7.2 will be a typo and 2,76 will go unexplained for the rest of the product lifetime, though we could theorise that multiplying it by 0.5 and air density as suggested in the documentation, one gets 1.69 which is a valid figure. Did the game do that back when it was new?

There are many formulas in literature that contain a linear factor on speed. You need to compromise when you map those and the linear factor is not exactly scientifically justified but rather pragmatic, which is why I did not mention them.


For vans, Frank quotes 0.052. The bloater's mass is given at 12 which results in 0.6. This is a fraction of the 1.5 set in the file, but using the same figure as for a coach is not implausible.

The standard van's 2.04 is even higher. Frank would say 0,37 if you would ask him but that is based on the mass of just 6.48 in the .bin file which is far out even for an empty one. Minimum tare of a GWR wagon I know is 7.1, and the German vans Frank tried were certainly more 10 tons empty, and most likely they were not empty.

Knowing that the models converned never ran too fast, I would not obsess over them as much as over the coaches.


For open goods wagons, there is a marked distinction between empty and loaded. Loaded ones have an air drag that is slightly higher than coaches and vans. Empties have horrible aerodynamics.

For empty open goods wagons, Frank's factor is 0.24.
For loaded ones, it he quotes 0.041.
Hütte gives 0.18 for empties and 0.029 for loaded ones.

Mass and (loading) capacity are:
3Plank: 4.8 and 8
5Plank: 5 and 10
7Plank: 5.2 and 12

So for the empty ones, Frank would suggest, if he knew RW, 1.152, 1.2, 1.248.
Loaded: 0.52, 0.62, 0.71.
Hütte would suggest 2/3 and 3/4 of that.

(In case someone cares, Hütte must be the journal "Die Hütte"; I skipped copying the page with the references back then when photocopies cost money.)

So, refocussing on the original of idea of finding out how much precision we get, we can say the following:

Not considering the mass, in contrast to historic literature, is a good move in RW. For all sorts of covered vehicles, you can enter a factor that gives N if multiplied with the squared speed in m/s. The current stock suits the assumption that this is right.

For open stock, you would need distinct models for loaded and unloaded versions if you care about air drag. I have no clue whether the game physics consider the loading state. If the total train mass does not add capacity to mass, then you necessarily need two different models or your train mass is 1/3 of what it ought to be. So air drag is a small issue then.

Also consider that these things fell appart before you reach any speed where air drag becomes noticeable. There are a few modern hoppers that run fast and are not covered, but who has precise air drag figures for those anyway?


Curve resistance

0/10 is all you can say. You can go and excuse this by stating that modern stock goes through curves easily but no one will ever claim that curves have no cost. You could say that there is a hidden formula, but I want to see it before I cheer. More likely they simply dropped it.

There are a few positive thought on this that could be made up:

Clever designers of the original route sometimes reduced the gradient in curves to keep the TE required constant. If the person modelling the route does not know this, they will lay a constant gradient that will approach the TE required in the original.

Where the track is curved most of the time, without any straights, it often is inclined, too. In such a case, the gradient requires much TE and the curve resistance is just 10 or 20% of that. Routes that not as steep often have wider curves, too.

If there is a sharp bend between straights, it only affects part of the train.

In addition to the formular by Röckl which is the most commonly used one, there is one by Frank that takes the wheelbase into account.

wheelbase / radius * (180 - 1000 * wheelbase / radius)

For 200 m radius and bogeys of 2 m wheelbase, that only gives 1,7. This sounds much nicer, but applies only to coaches with bogeys.

For freight trains, the 1000 are replaced by 2000, most likely to cater for the reduced speed (and thus reduced issues in curves). Entering UK wagons of but 9 ft wheelbase, you get 2.1. But the wagons Frank sampled will have had an average wheelbase of around 4 m or so. For 3.5, 4.0 and 4.5 m, you get resistance factors of 2.5, 2.8 and 3.0, respectively.

This is still below the 3.8 that Röckl estimates. To arrive at that using Frank's formula, you need a wheelbase of 5 m for a 4-wheeled coach or 7 m for a 4-wheeled van. These are not unrealistic, around 8 m were en vogue for some time. Though these had axles that moved freely and adjusted themselves to curves.


Mass

I have a few drawings. It is clear that there were many things going by the same names, so the figures I found need not be the figures the modeller was looking at.

Goods wagons, found in .bin vs. found in GWR drawings:

3Plank: 4.8 and 8 ... nothing found
5Plank: 5 and 10 ... 5.7 - 6 and 10
7Plank: 5.2 and 12 ... 6.2 for a 5-plank, 12 ton china clay wagon

Van: 6.48 and 12 ... 7.3 and 12
Bloater: 12 and 10 ...8.6 and 6 (smaller, for meat); 8 and 10 (bananas);
No fish found on this harddisk. With all the ice, 12 tons are not unbelievable for me.

In general, I would increase the tare by some 10-20% in the stock I sampled.

No info on coaches that I could grab fast.


Summary

So how much precision do we get on the train side of things?

Rolling friction should be 0.0024 or more, found values range from 0.001 and less to 0.0015. I.e., I would almost double these figures if I were to fix all these files.

Gradients look very good to me, by which I mean that deviations between sources are as big as deviations between the model and the source used. But this clearly is a sweeping statement that cannot be true for all routes out there. And it can only refer to routes that are laid out with care by someone who knows of the importance of gradients.

Drag coefficient can be set correctly if your gold standard does not use a linear term in the formula. The coaches I checked looked mostly fine. For open wagons, you need two models if you care about the difference in air drag. For vans and wagons, I would suggest values that differ by under 50%. This would have small effect at realistic speed.

Curve resistance is simply missing. This causes an error of 50% when shunting, but only for those few wagons that are on curved track), and around 10% for an up gradient with tight curves, largely depending on the route.

Mass. You need different models for loaded closed vehicles (tankers, vans).

It needs to be found out under which circumstances the game handles the train load correctly (loading during the scenario, coupling during the scenario). If loading fails, duplicate models with different mass could provide a partial solution.

I would modify the tare by up to 20% if I were to edit all these files.

So of five factors, I see deviations between 10 and 50 % in three of them and they mostly add up: half the rolling friction, no curve resistance, sometimes reduced mass.

Much of that can be fixed, but the idea here is to point out under which circumstances your carefully tuned engine will be used. Of course, you can supply a set of equaly well tuned wagons with it, but you need to take that into consideration.

All that said, I must certify that the situation of the default stock I looked at is worlds from what was pretty normal in MSTS days.

(Edit: fixed Frank's figures on curve friction.)
AndiS
Top Link Driver!
 
Posts: 736
Joined: Wed Apr 09, 2014 5:48 pm
Has thanked: 268 times
Been thanked: 308 times

Re: Steam Engine physics: TS and Real World

Postby AndiS » Mon Aug 08, 2016 6:34 pm

Post scripts on air drag

First of all, it is not the absolute speed of the train that is the big contributing factor, but speed relative to the surrounding air. That means that you have to add or subtract wind speed. Not sure the game does that. Influence can be significant but greatly depends on the route.


It does make sense to look at the latest findings in air drag even for old-time stock. In particular, one would prefer figures that map directly to the how vehicle and do not depend on mass, as mass really has no bearing here. It is just there for compatibility with old resistance formulas.

So I dug about a bit more and found the following.

In 1935, our beloved organ for railway progress reported experiments that lead to the following factors (cited in Taschenbuch für Bauingenieure).

1.1 normal engine
0.54 fully streamlined engine
0.9 streamlined engine with uncovered drivers
0.51 for new motor cars without trailer
0.7 same with trailer
0.45 for two-part multiple unit
0.6 and 0.71 for the same with three and four parts

These values are multiplied by the area of the front view, by 0.5 and squared speed, given in 1/10 km/m ! Result is in kg as per usual.

Translating that to m/s and N, the factor of 0.5 is replaced by 0.64.
Area is given as 10 to 10.3 for motor cars and 11 m² for engines, which means you could derive the following figure ready for plugging into RW:

7.69 normal engine (half of that if fully streamlined)
3.24 motor car
4.45 same with trailer
2.86 two-part multiple unit
0.95 added for the third part
0.70 added for the forth and any further car, if we dare to extrapolate

Note that these figures are for the whole consist. Since you must supply a number for each vehicle in RW, you generally add the extra resistance for the whole train to the engine and use values for further vehicles for coaches, e.g., 0.7.


Another German book, titled "The mechanics of train forwarding and their scientific-experimental foundations" and printed in 1952, shows a graph comparing classic formulas with actual measurements. The display ends at 120 km/h and most plotted lines end at 100 km/h. So much for high speed in Germany. In this diagram, theoretic values lie 10 % below and 10-20% above the measured ones.
Source (graph on next page)

This source assumes 6 kg * square of speed in 1/10 km/h, which translates to 7.65 in RW terms, which is a close match to above, quite unsurprisingly.


Johannes Strommer on his present-day website gives the following values, to be multiplied by air density (1.2-1.4 according to him), area and speed (in m/s!) and divided by 2. It refers to modern stock.

0.3 engine
0.23 first car
0.14 middle car
0.3 last car

In RW terms, it means.
1.95 engine
1.5 first car
0.91 middle car
1.95 last car

For a present-day four-car set, this would be 6.31 while the 1935 values would suggest 4.51 for the whole consist. Comparing the two, we see higher values for intermediate cars in 2006 and extremely high values for the standard steam engine, which is not a surprise.


Google was kind enough to remind me that all of the above is utter nonsense today. As reported by Alwin Meschede, keeper of the Zusi 3 vehicle base, you can rent Autodesk Flow Design for mere €40 per month. It simulates a wind tunnel on your PC and boasts 6% accuracy which is far beyond all the historic here-say. All you need is a 3D model with an accuracy that suits the 15 cm voxel size, i.e., any current model will qualify.
(Original article, in German)

I had even posted about this, but reading old books is so much better than dealing with software that it totally vanished from my memory.

And of course, even with your private wind tunnel, you need to find compromise figures to enter in the blueprint of intermediate cars.


Post script on rolling resistance

A presentation of Peter Spiess for DB Systemtechnik in 2006 gives 1.5 kg/t as an overall estimate. In detail, he computes it as

friction coefficient * mass * radius of bearing (journal) / radius of wheel

with friction coefficient being 0.6 for friction bearings and 0.2 for roller bearings; result in kg/t. With an axle diameter of 10 cm and a wheel diameter of 1 m, I get 1.2 for a total mass of 20 t. So this is even less than the average 1.5.

1.5 is exactly what DTG use today, so it looks like present-day guys conspire against my books full of old glory.


Post script on curve resistance

The DB source cites the formula by Protopapadakis below, that I converted to my old-time perspective, to make it comparable with the other stuff.

friction / radius * (0.47 * wheelbase + 0.72 * gauge)

Gauge really is the distance of the contact points of the wheels on an axle and the rails, i.e, 1.5 m.

With a friction around 0.2 and radius in the lower range, the results are very close to Frank's formulas. For radii of 400 m an greater, Protopapadakis' results are more than 10% smaller than Frank's.

So the problem is still there, even according to the present-day guys.


Internal inertia

The above source mentions the inertia of moving parts inside the vehicle. I don't think there is a mapping for that in RW. He gives the following factors.

1.1 passenger train
1.04 ICE 3 (so it must have very light-weight moving parts)
1.15 empty freight train (wheels weigh a lot relative to the tare weight)
1.06 loaded freight train (ties in with a ratio of 2.5 of loaded to empty wagon)
1.2 to 1.3 both Diesel and electric engines

This only bears in acceleration and deceleration.

There is nothing you can do to correct it as both mass and TE play an important roll at constant speed, so doctoring either of them to compensate for the 10% deviation would have serious collateral damage.
AndiS
Top Link Driver!
 
Posts: 736
Joined: Wed Apr 09, 2014 5:48 pm
Has thanked: 268 times
Been thanked: 308 times

Re: Steam Engine physics: TS and Real World

Postby DominusEdwardius » Tue Aug 09, 2016 12:09 am

My turn, my input on rolling resistance:

the rolling resistance in game is defined by the following equation:

Rolling Resistance force (N) = (Rolling Friction Coefficient*Gravity*Vehicle Weight in kg ) + (0.5*Drag Coefficent*Air Density*(TangentialSpeedMs^2))

where

gravity = 9.81 ( hay they got it right)
air density = 1.204 ( also right although amusingly it wasn't always so, it varied every iteration of TS from 0.5 to 3! but it is now a constant correct value as of TS2016 :P )

*Yay for SI units for a change!

typically speaking a a polynomial shaped curve is produced by rolling friction against speed usually in the format A+BV+CV^2 where A,B and C are constants and V is velocity. British Rail ran a series of tests measuring various rolling resistances of wagons, coaches, black fives and a Class 76 also measuring the drag due to head win and found values for these constants. This report can be found form here however you will need to pay for it if you don't have access to openAthens or can find it another way.
http://jil.sagepub.com/content/44/237/91.2.extract

Alternatively a much older source (which is free) but probably a lot more valid, a series of rolling resistance tests were run in France (1909) for various types of locos of 4, 6 and 8 coupled varieties and the results of which in a polynomial equation can be found here giving the rolling resistance in lb per 1000lb (yes that is very confusing if you didn't notice that bit as it is usually specified as lb per ton!) against speed in mph (alternative a similar arrangement in metric units). the equations can be found on page 310.
http://www.gracesguide.co.uk/images/6/6 ... 90326a.pdf

Anyway the previous table gives a general application of all the rolling resistances including air resistances so it forms a very good basis for getting the values ingame. To get the values in game I suggest using Excel and its solver to find the equivalent value for the coefficients. As you are missing a B*V term you will never perfectly be able to match it but you can get it close over a range you want (usually at higher speeds). You can use this spreadsheet then use the solver to minimise the sum of the error value
https://www.dropbox.com/s/c2f606j0o1j1x ... .xlsx?dl=0

(note the coefficient values currently in it are for a 8 coupled goods engine ).

regards
Edward
Regards Edward

Meshtools - Scripter and Sound Artist
http://www.meshtools.co.uk
https://www.facebook.com/Meshtools
User avatar
DominusEdwardius
Passed Fireman
 
Posts: 114
Joined: Mon Mar 31, 2014 11:25 am
Location: Loughborough, UK
Has thanked: 10 times
Been thanked: 40 times

Re: Steam Engine physics: TS and Real World

Postby AndiS » Tue Aug 09, 2016 4:40 pm

DominusEdwardius wrote:the rolling resistance in game is defined by the following equation:

Rolling Resistance force (N) = (Rolling Friction Coefficient*Gravity*Vehicle Weight in kg ) + (0.5*Drag Coefficent*Air Density*(TangentialSpeedMs^2))

where

gravity = 9.81 ( hay they got it right)
air density = 1.204 ( also right although amusingly it wasn't always so, it varied every iteration of TS from 0.5 to 3! but it is now a constant correct value as of TS2016 :P )

Eduard, how exactly did you measure that?

During the past days, I was thinking of creating an engine script for logging actual TE, acceleration, train mass and such to find out what really goes on. But together with doctoring engine and wagon to cut out all the disturbing influence factors, it would mean days of hacking.

And once going, I would have to feed countless CSV curves to the game to see what it does. Since I explored MSTS physics in 2005, when everyone was in Rail Simulator hysteria, I am very wary of doing this for RW now. They say that only fools make the same mistake twice and I am on the verge of looking foolish. 8-)

The only thing that can stop me would be seeing all the information in the public, after all these years of hunting for it.

The article from The Engineer is a great relief to me as it shows about the stuff Igel shows, too, but already translated to English and even converted to points. So I can take that from my to-do list.
AndiS
Top Link Driver!
 
Posts: 736
Joined: Wed Apr 09, 2014 5:48 pm
Has thanked: 268 times
Been thanked: 308 times

Re: Steam Engine physics: TS and Real World

Postby TrabantDeLuxe » Tue Aug 09, 2016 5:42 pm

Yes, I'm really interested how you measured the resistance in-game, and got all the constants.

Andy, outputting live data (in the other topic I called this 'telemetry', must be a hangover from playing KSP) into a .csv, is that something that is doable? Some live telemetry into a .csv and matlab would make my life a lot easier.
TrabantDeLuxe
Passed Fireman
 
Posts: 247
Images: 7
Joined: Mon Mar 21, 2016 10:10 pm
Location: Delft, NL
Has thanked: 176 times
Been thanked: 263 times

Re: Steam Engine physics: TS and Real World

Postby DominusEdwardius » Tue Aug 09, 2016 7:57 pm

The equation was given to me by Simon Hall (username was Kariban on ukts), I believe he had someone at DTG get it for him so I do believe it is accurate. (it was from that he released the air density kept changing randomly!)

the equation itself is very very simplistic, basically the first term is sliding friction equation (basically the constant ist he coefficient of friction), while the second term is drag equation where the coefficeint stands in for area and drag coefficeint.

You can actually get the script to print to a csv format I do believe.

I can't remember if this script works or not I just found it in one of my folders, I think Matt P gave it too me but it probably shouldn't be too hard to get it working if it doesn't
Code: Select all
function OpenPerformanceFile()
   gPerformanceFile = io.open("performance.csv", "w")
   gPerformanceFile:write("Time(s),Regulator(CTRL),Cut Off(CTRL),Speed(MPH),Acceleration(M/S^2),Gradient(%),Tractive Effort(%),Firebox Mass(%),Current Speed Limit(MPH),Virtual Throttle(CTRL),Boiler Pressure(PSI),Loco Weight(metric tonnes),Train Weight(metric tonnes),Length(M)\n")
   gPerformanceFile:flush()
end

function ClosePerformanceFile()
   gPerformanceFile:close()
end

function UpdatePerformanceFile( time )
   if (gPerformanceLogEnabled == 1 ) then
      local accelSample = round(Call("GetAcceleration"), 4)
      gAccelAccum = gAccelAccum + accelSample * interval
      gAccelTime = gAccelTime + interval
      
      if ( gCurrentTime > gNextPerformanceTime ) then
         gNextPerformanceTime = gCurrentTime + gPerformanceTimeDelta

         local regulator = Call("*:GetControlValue", "Regulator", 0)
         local speed = round(Call("GetSpeed"), 4) * 2.23693629
         local gradient = round(Call("GetGradient"), 4)
         local tractiveEffort = round(Call("GetTractiveEffort"), 4)
         local fireboxMass = round(Call("GetFireboxMass"), 4)
         local cutoff = round(Call("*:GetControlValue", "Reverser", 0), 4)
         local currentLimit = round(Call("GetCurrentSpeedLimit"), 4) * 2.23693629
         local virtualThrottle = round(Call("*:GetControlValue", "VirtualThrottle", 0), 4)
         local boilerPressure = round(Call("*:GetControlValue", "BoilerPressureGaugePSI", 0), 4)
         
         local totalMass = round(Call("GetTotalMass"), 4)
         local consistTotalMass = round(Call("GetConsistTotalMass"), 4)
         local length = round(Call("GetConsistLength"), 4)

         
         local acceleration = gAccelAccum / gAccelTime
         
         gPerformanceFile:write(gCurrentTime .. "," .. regulator .. "," .. cutoff .. "," .. speed .. "," .. acceleration .. "," .. gradient .. "," .. tractiveEffort .. "," .. fireboxMass .. "," .. currentLimit .. "," .. virtualThrottle .. "," .. boilerPressure .. "," .. totalMass .. "," .. consistTotalMass .. "," .. length .. "\n")
         gPerformanceFile:flush()
      end
   end
end


Logger = Call( "*:GetControlValue", "PerformanceLogging", 0 )
 
 
if Logger > 0 then
   OpenPerformanceFile()
   gPerformanceLogEnabled = 1
else
   gPerformanceLogEnabled = FALSE
   ClosePerformanceFile()
end


The csv is generated in the railworks folder.

Edward
Regards Edward

Meshtools - Scripter and Sound Artist
http://www.meshtools.co.uk
https://www.facebook.com/Meshtools
User avatar
DominusEdwardius
Passed Fireman
 
Posts: 114
Joined: Mon Mar 31, 2014 11:25 am
Location: Loughborough, UK
Has thanked: 10 times
Been thanked: 40 times

Re: Steam Engine physics: TS and Real World

Postby AndiS » Tue Aug 09, 2016 8:24 pm

Oops, Edward was quicker. Yet our scripting ideas do not fully overlap. So all we need is someone with really much time now.

Regarding the formula, if this is word that originated from DTG then it makes experimentation even hotter. The tangential speed sounds like they did consider wind.

TrabantDeLuxe wrote:Andy, outputting live data (in the other topic I called this 'telemetry', must be a hangover from playing KSP) into a .csv, is that something that is doable? Some live telemetry into a .csv and matlab would make my life a lot easier.

Totally easy, in theory. Which translates to a week or so fiddling with stupid stuff that plays up and a month of finding out the stuff you want to know now that the first round of answers is there.

So this is my plan for when I get time to play:

In Initialise:
elapsedTime = 0
interval = 0.1 -- the interval at which to log, in seconds
logfile = io.open("...", "w") -- filename of your choice, see other post on that
logfile:write("TE\t...\n")

In Update:

function Update(time)
elapsedTime = elapsedTime + time
if elapsedTime > interval
elapsedTime = elapsedTime - interval
... and do the following

logfile:write(string.format("%.1f\t",
logfile:write(string.format("%.1f\t", Call("GetTractiveEffort")))
... further columns
logfile:write("\n")
logfile:flush()

Notes:

.1 is the number of places after the comma - change to taste. I just hate the mass of useless digits in the output. However, it might be faster to print them than to call format. But then again, it will not matter at all.

I prefer \t over , as a separator as it is foolproof but , is the default or else it would be TSV and not CSV.

If you print a suiting header line first, Excel will use that to label the graphs.

You could put a time stamp in the first column to get more precise plots, but I am not sure about the importance of that. And plotting is easier if Excel just assumes that points are spaced equally on the X axis.

Further columns would be

GetSpeed
GetAcceleration (or compute it in Lua or Excel)
GetConsistTotalMass
GetGradient - to see when the climb starts
GetConsistLength - to document coupling/uncoupling actions
GetCurvature - if you want to check whether there is some secret curve friction built in
later we need GetControlValue for all sorts of controls that might be relevant (compare Matt's script for a shopping list)

Experiments

1) Acceleration = (TE - train resistance) / total train mass
This means that from acceleration, TE and train mass, we can observe actual train resistance for different speed, grade and curvature. (And wind from different directions!)

But we get TE in % of maximum TE (says the docu), and I am not sure what that would be. MaxForce will be the first candidate, clearly. And I bet the % are in fact a number between 0 and 1.

If need be, first start with a light engine with doctored engine data so there are very few guesses of what TE could be, then couple wagons to it.

2) Couple and observe total train mass
3) Start scenario with loaded wagons (tick mark in scenario editor) and observe total train mass
4) Take empty wagons to some loading point and observe total train mass
5) Take up fuel and observe total train mass

Now for the traction of choice (steam, what else), set all influence factors to neutral, like a graph spanning from 0/1 to max/1 in the CSV, rolling friction and air drag 0, and all that. Then, read out TE.

Then modify each according to various theories, only one at a time.
Then see how the CSVs interact, i.e., how they are combined.

This requires restarting the game often, which take lots of time. Deploying a whole series of engines with different settings in the blueprint could be an answer. But you get easily confused with that.

If you try that, use GetRVNumber to get the number into the filename of the logfile and keep a table of which number corresponds to which line of experiments.

I am not sure I would use many engine variants side by side, but a few could help, maybe.
AndiS
Top Link Driver!
 
Posts: 736
Joined: Wed Apr 09, 2014 5:48 pm
Has thanked: 268 times
Been thanked: 308 times


Return to Rolling Stock General

Who is online

Users browsing this forum: No registered users and 1 guest

cron