Maximum throughput of a rail line

Post all other topics which do not belong to any other category.
mrvn
Smart Inserter
Smart Inserter
Posts: 5709
Joined: Mon Sep 05, 2016 9:10 am
Contact:

Maximum throughput of a rail line

Post by mrvn »

Does anyone have a formula for the maximum throughput of a rail line?

Parameters would be I believe:
1) acceleration
- locomotive power
- locomotive count + wagon counts
- fuel bonus
2) breaking speed
- locomotive breaking speed
- research
3) distance between signals
4) train length (not just the effect on acceleration)

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

Re: Maximum throughput of a rail line

Post by mmmPI »

Maximum throughput of [what] going through a rail line ?

You have the max throughput of trains when they are only composed of 1 locomotive and you place signal eveywhere but that's not what you are looking for i suppose :D

If you want the maximum throughput of material, it requires infinitly long trains i would say so that it's as much packed wagon as possible going to the maximum speed a train can go.

If you want the maximum throughput of material for a certain train lengh, then it's some tough math, because it would have to deal with all the parameters you have written but the train lengh need to fixed i would say.

Edit: "tough math" i used because the throughput/speed function is looking like this :
Highway-traffic-throughput-as-a-function-of-operating-speed-Illustration-of-effect-of.png
Highway-traffic-throughput-as-a-function-of-operating-speed-Illustration-of-effect-of.png (7.72 KiB) Viewed 3118 times
Meaning : When vehicule are super slow, the throughput is quite bad, when they start going faster the throughput increase, but also the distance between vehicule, this one increase faster, that the throughput which leads to a local maximum, and then vehicule going faster actually reduce the throughput until it gets very bad. This phenomenon is visible on highway, the best speed for throughput is usually something like 75% of the maximum allowed.

Another way to look at this is density * speed, considering "how many car/vehicule are located in a segment of x tile/meters ?" this is a quantity per distance, and it is divided by a distance per time (their speed) so it leaves a quantity per time, a throughput. So how many wagons in a segment, and how fast are they going ? The density of wagon diminishes with speed due to braking distance unless you make a super long train, since speed is capped you end up not accounting for the braking distance because there is only 1 train, infinitly long.

If you have a definite train lengh, like 2 loco and 4 wagon, THEN there is an optimal speed for throughput which can be mathed out based on fuel and braking distance /research, and which could be used to place signals but that would change quite often in a game

NineNine
Long Handed Inserter
Long Handed Inserter
Posts: 83
Joined: Mon Oct 24, 2022 11:20 pm
Contact:

Re: Maximum throughput of a rail line

Post by NineNine »

It's going to take some calculus to figure this out. That's a pretty big ask for most people.

[edit]

I didn't think that there'd be people around these parts who'd be able to/want to figure this out, but then I saw this post....

viewtopic.php?f=5&t=110066

mrvn
Smart Inserter
Smart Inserter
Posts: 5709
Joined: Mon Sep 05, 2016 9:10 am
Contact:

Re: Maximum throughput of a rail line

Post by mrvn »

Indeed. For a non mathematicion the formulas will probably look insane and then you have to derive them and solve for the maximum.

But it should be easy to take the formulas, take a set of parameters from the game and plot them getting a series of curves like mmmPI showed. Computers are good at those things I hear :). It would be easy to show the effect of varying 2 parameters at the time while keeping everything else fixed. The graphs would all have one axis the throughput, the second axis the first parameter e.g. signal distancing. The second parameter would then be shown as multiple curves, e.g. train length/composition where you pick some sensible train designs, never all of them.

Or do it as 3D plot, that's still easy to visualize. The throughput as height so you get a mountain surface. Adding transparent surfaces for a 4th parameter would become quickly unreadable I think. Maybe it works for 2 or 3 values of the 4th parameter. Or you only see the peaks where the value of the 4th parameter makes the throughput superior to all others.


I just skimmed the documents from the other topic but they seem to be rather new (December 2023) and just starting out. Not much in real formulas and numbers or any substance in the later docs.

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

Re: Maximum throughput of a rail line

Post by mmmPI »

NineNine wrote:
Wed Dec 06, 2023 2:58 am
It's going to take some calculus to figure this out. That's a pretty big ask for most people.
mrvn wrote:
Wed Dec 06, 2023 6:13 am
Indeed. For a non mathematicion the formulas will probably look insane and then you have to derive them and solve for the maximum.
There are some AI tools like Wolfram alpha that can do powerful things when given accurate formulas and it's easily accessible nowadays ( free ) even to be used for videogames hobby :) you can give it a function and ask for the derivative or to solve for the maximum. The difficult part in which AI are not good is to transform a thought into an equation i would say, a mathematician could do, but maybe 2* 1/2 mathematician can do, or maybe 3 players that are 1/3 mathematician ? how much mathematical knowledge science pack is required ? is that how it works ? :lol:

mrvn wrote:
Wed Dec 06, 2023 6:13 am
But it should be easy to take the formulas, take a set of parameters from the game and plot them getting a series of curves like mmmPI showed. Computers are good at those things I hear :).
Yes exactly ! but as you say the result could potentially be hard to vizualise if there are 4 parameters (or more) because the representation of the "solution" could be a shape in 4 (or more ) dimension. Meaning that you could reach the same throughput using 4 or more different configuration of train lengh / fuel / train composition / signal spacing / braking research.

I'm no mathematician, but i learned from playing factorio that to solve complicated problems one could cut it in smaller chunk and get other people that may have a shared interest in a small chunk involved :)
mrvn wrote:
Wed Dec 06, 2023 6:13 am
I just skimmed the documents from the other topic but they seem to be rather new (December 2023) and just starting out. Not much in real formulas and numbers or any substance in the later docs.
That seem like the thread you created would fit the later part though, and just from basic math that are to my level, [1 mathematician] + [some help from videogame players] > 1 mathematician. That's sometimes debated with >= but never the other way around !

I think to follow those principles i would start by something easy, like the lengh of a wagon is 7 tile, the faster a train can go is a known formula from the wiki. This allow to math out the maximum throughput of material more as theorical limit that cannot be realistically achieved.

From this point it is necessary to add locomotives, so instead of imaginating a infinitly long train made only of full speed wagon to avoid accounting for the locomotives it would be necessary to say the ratio of wagon/locomotives but this number is quite arbitrary as the theorical limit is not the one that make sense in game. Meaning that train with very slow acceleration but still able to reach the maximum speed a train can go would be given a disproportionnate advantage. ( if you reach the same speed with LCLCLCLC or LCCCLCCCLCCC or LCCCCCCCCCLCCCCCCCCC it would mean the more dense in wagon is always the better at this point of the mathing/modeling).

Also it still an unrealistic theorical upper bond, but lower than the previous one as it imposes 1 condition that further cap the density of wagon per segment, given maximum speed. But to go a step further, the "braking distance" need to be added in the calculation for the density of wagon in a segment. Because in game trains would have a lower wagon density than an infite repeating pattern of LCLCLCLC or LCCCCCCCCCLCCCCCCCCCLCCCCCCCCCLCCCCCCCCC . Trains needs to be "arbitrarily" cut which would create "gaps" in between them. That seem to be still some thing i could vizuallize but that's the further all i can go for now :)

mrvn
Smart Inserter
Smart Inserter
Posts: 5709
Joined: Mon Sep 05, 2016 9:10 am
Contact:

Re: Maximum throughput of a rail line

Post by mrvn »

I'm not looking for the what train will give you the maximum throughput but I'm looking for the maximum throughput given a train configuration. I'm looking for the formula to computes the maximum throughput, not the solution of maximizing that formula for all parameters.

So talking about what train will give you the maximum throughput is the wrong thing to look at. The question is: Given a train configuration what is the maximum throughput you can have?

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

Re: Maximum throughput of a rail line

Post by mmmPI »

mrvn wrote:
Wed Dec 06, 2023 1:34 pm
The question is: Given a train configuration what is the maximum throughput you can have?
I agree.

I think to answer that question one has to find the local maximum in a function that would represent the throughpout relative to speed which would mean having a function that can calculate the density of wagon given that train configuration which include the calculation of the braking distance and how it change relative to speed. (Abstracting signal placement for now as considering they are placed everywhere possible).

Such function can be approximated to a certain degree i hope for your purpose because the exact way of measuring the braking distance as it happens in the game involve mechanism that require reading the game code and understanding when is the exact tick a train starts braking or something like that coming from that thread :

viewtopic.php?p=595448#p595448

The formulas from farcast allow to math the braking distance to a certain degree of accuracy( from any train composition using any fuel going at any possible speed with any kind of braking research) and i think that the other linked .ods i made somewhere can be used to track how the speed of a train and thus its position changes every ingame tick but it's not very good and i haven't touched it since then.

I think if one adds the lengh of rolling stock ((loco + wagon) * 7 tile each +/-1?) and the braking distance( in tile) that ensued given their varying speed (tile per tick) it is possible to measure the theorical maxium density of wagon in a segment of an arbitrary choosen fixed lengh given a certain composition ( aka the material/useful throughput) and i would say that's one way to do it for real life roads using camera on highway.

( same calculations coming from trying to measure the throughput of passenger in a road when some of them are in the bus, or share a car, or not, this would include the difference of speed and braking distance of bus vs car and one would need to know the % of car vs bus is expected during a certain moment of the day. This in order to "recommend" a speed to those vehicule in real life, in order to achieve higher throughput by reducing the braking distance and thus increasing the density of the traffic flow more than its speed is slowed or just adjust the number of lane reserved for the different usage to optimize traffic)

Not sure how you want to look/use the end result ( static representation vs interactive model) , for static representation i think parameters like fuel and braking research shouldn't be part of the vizualisation proper, but more like you described be the thing that is used to generate a different graph (one 2D graph for a particular combo of fuel and level of braking research generated when needed) at least in a first train of thought because those are discrete parameters while the speed is not (or less). The train composition being fixed for one serie of 2D graph. While it would be nice to be able to overlap the representation of 1 of such 2D graph from the serie of all the fuel&braking research combo of a certain train composition with the equivalent with another train composition and another train composition and so on. This would result in several 2D curves or like a 2D surface more akin to a "surface of solution". given 1 fuel & braking research combo. This could be colored following a light/dark gradiant representing an increasingly long train used to generate the 2D curve part of that surface, and/or trending two hue/colors to represent the ratio of loco/wagon and made semi-transparent so that it would be possible to then change the braking research, and redraw the same, and again and again to make it a 3D colored shape if you offset all those graph by a fix amount. i had more time to think of it but i'm not sure it is very productive thought at this point because it would very hard to tell what one is looking at :D

I think rail signal placement is the last parameter because all of the previous reasonning can be made with signal everywhere, and only at the end it is possible to remove some maybe. I can't think of a situation where having too many would impact negatively the throughput. And also i can't think of a way to make it possible to vizualize more information in a functionnal way so meh, it's too complicated. I suppose it would interact with the way density of wagon is calculated by introducing some steps in the function that calculate the overal lengh of a train and its braking distance if signals are too spaced out, it would reduce such density by spreading more the trains than strictly necessary from the braking distance.

Getting a maxium throughput fixing many parameters at first seems easier, and later allowing changing those in a calculator, refining the formula with dynamic parameter one by one after the fix parameter version has yielded verified in-game result would be the way to go for me. And not care about being able to show all the different possibilities at once, that's nope.

mrvn
Smart Inserter
Smart Inserter
Posts: 5709
Joined: Mon Sep 05, 2016 9:10 am
Contact:

Re: Maximum throughput of a rail line

Post by mrvn »

Too many signals never harm the train, only waste your CPU. And yes, you would assume every possible position has a signal, compute the train behavior and then you actually would only build signals as needed.

quyxkh
Smart Inserter
Smart Inserter
Posts: 1028
Joined: Sun May 08, 2016 9:01 am
Contact:

Re: Maximum throughput of a rail line

Post by quyxkh »

If braking speed is a parameter then time to stop is top speed / braking speed and braking distance is ½topspeed*timetostop, that's the minimum tail-to-nose distance so minimum (and max-throughput) nose-to-nose distance is braking distance plus train length, wagons and locomotives are conveniently 7m each. Cargo density is (braking distance + train length) * cargo capacity, This is in my head so somebody correct this for units but I think the math is cargo density * top speed / nosetonose distance gives you cargo/s throughput for that train configuration. Acceleration doesn't affect max throughput because it eventually has to filter through a one-track bottleneck, right?

User avatar
MEOWMI
Filter Inserter
Filter Inserter
Posts: 310
Joined: Wed May 22, 2019 12:21 pm
Contact:

Re: Maximum throughput of a rail line

Post by MEOWMI »

Since it looks like we're assuming that trains can have a reason to brake even when not at a station, we then need to assess the reason for why they brake. Almost always, that's going to be because of an intersection. Thus, the throughput is bounded by the throughput of the intersection, which in turn is best discovered by empirical testing, with various mods.

A separate case is calculating the throughput of a rail line with only 1 train on it, in which case braking happens because it's at the station, but then no rail signals matter.

Also, a lot of the time, maximum material throughput is determined by how fast you can load and unload the train, or how fast you can produce or consume the materials. Indeed, that's where the bottleneck is, if trains are waiting before a station.

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

Re: Maximum throughput of a rail line

Post by mmmPI »

mmmPI wrote:
Wed Dec 06, 2023 6:43 pm
I can't think of a situation where having too many (signals) would impact negatively the throughput.
mrvn wrote:
Wed Dec 06, 2023 10:02 pm
Too many signals never harm the train, only waste your CPU. And yes, you would assume every possible position has a signal, compute the train behavior and then you actually would only build signals as needed.
The wording is a little different and i think yours is correct but mine i'm not so sure: when there are signals everywhere, trains are more likely to reach their "top speed", but this speed is not necessarily the best for throughput of material akin to car when they go "too fast" and the safety distance between them is so large that it could actually start impacting throughput. So it doesn't harm the trains (top speed), true, but thinking some more there could be situations where signals placement scarcity could force the train to go slower which could reduce their braking distance for higher throughput. I'm not sure it's possible that signals are scarce enough to force train to slow down but still plenty enough that they can actually drive closer to each other thanks to that reduced braking distance. I wouldn't know how to build those, i'm just unsure if it's not going to fast and missing things saying as i said earlier. In any case signals would only be built last as needed as you say thinking in game a network expand usually.
quyxkh wrote:
Thu Dec 07, 2023 1:47 am
If braking speed is a parameter then time to stop is top speed / braking speed and braking distance is ½topspeed*timetostop, that's the minimum tail-to-nose distance so minimum (and max-throughput) nose-to-nose distance is braking distance plus train length, wagons and locomotives are conveniently 7m each. Cargo density is (braking distance + train length) * cargo capacity, This is in my head so somebody correct this for units but I think the math is cargo density * top speed / nosetonose distance gives you cargo/s throughput for that train configuration. Acceleration doesn't affect max throughput because it eventually has to filter through a one-track bottleneck, right?
It's your comment who made me realize, i think you are correct in the reasonning to math throughput in general, except for the use of "top speed" rather than "optimal speed" or "current speed" because the speed is not affecting the throughput in a linear manner, the "top speed" is not always the best for "maximum" throughput. "current speed" can be used to math "current throughput", "top speed" yield 1 throughput, and maybe ( most likely i expect ) "optimal speed" is lower than "top speed" for a 2nd throughput that would be the "maximum throughput".

Cargo density can have different units, it can be in slot per tile, ( or wagon per tile or wagon per km ....) considering a wagon is 40 slot and 7 tile, that is around 5.7 slot per tile to begin with, but then one has to add the locomotive, so 1 wagon + 1 loco would represent 40 slot still but then 14 or 13 tiles depending on how you count the gaps between wagons, so that would lead to 2.8 to 3 slot/tile density as a second value, but the final one would need to account for the braking distance ( or minimum tail-to-nose distance as you call it), so that would be 40 slot divided by ( 7 tiles +7 tiles + [number of tile between 2 trains]).

This giving density in slot/tile and i'm picking 2 as example to skip braking distance math by estimation. Then if the trains moves at a speed of say 0.3 tiles/tick ( 18m/s or 64.8 km/h), then the throughput is 0.6 slot/tick.( 2*0.3) Which would mean something like 0.6x50=30 iron ore is going through the rail line every tick since iron ore stacksize is 50, or 1800 per second.

Now for the "braking distance is ½topspeed*timetostop," it is expecting a linear deceleration, i'm not sure about this part, it depends on how precise you want to math things out because the "braking distance" is hard to compute : viewtopic.php?p=594182#p594182
There are a "few unexplained ticks" regarding the calculations of "timetostop", which i'm unsure how the game behave when it turns signals yellow and that is used to establish the density, and therefore can mess up with throughput calculations if trains are unexpectedly a little further away from each other in game than in theory.

Acceleration affect top speed as it would cap some trains, otherwise it would only impact calculation if signal placement is scarce to the point where a train has to slow down and re-accelerate due to block reservation. This is more a practical issue than a theorical one when trying to math the max throughput of line given certain train type. But braking distance is also a practical issue, because in theory you don't need signals you can just perfectly sync your trains in a signal less network, there would be higer cargo density, and thus throughput. It would make math much easier but the building part much harder, i think it fits more my mentality of playing the game :)
MEOWMI wrote:
Thu Dec 07, 2023 6:13 am
Since it looks like we're assuming that trains can have a reason to brake even when not at a station, we then need to assess the reason for why they brake. Almost always, that's going to be because of an intersection. Thus, the throughput is bounded by the throughput of the intersection, which in turn is best discovered by empirical testing, with various mods.
Not necessarily, one could try to math the thoughput of a rail line to know if it is possible to sustain an area with a single rail lane or if need to be doubled or tripled. This would require mathing out a theorical throughput for 1 rail line assuming trains would be running on it constantly. Then in game when this situation happens trains are spreading with a distance in between them that if one places signals at every single point is going to be the "braking distance" of that train. Just from an arbitrary point of view it is occuring in game that this is the distance in between 2 trains running even if they don't brake or have to brake. Similar to the 2 lines that car drives are supposed to leave in between them when they go full speed on the highway. If cars where only 50 cm apart the highways would have much more throughput, but it would be very unsafe to drive at the same speed. That would be the situation where the network is made without signals and trains are allowed to almost touch each other when running full speed. Otherwise the "braking distance" is useful to math the throughput even not considering train would have to actually brake.
MEOWMI wrote:
Thu Dec 07, 2023 6:13 am
Also, a lot of the time, maximum material throughput is determined by how fast you can load and unload the train, or how fast you can produce or consume the materials. Indeed, that's where the bottleneck is, if trains are waiting before a station.
I agree that this and the junctions causing braking are practical concerns that limit the benefit/usage of calculating the maximum material throughput. However in game it is possible to build a train network that avoid the consequences of those. Currently it's very unpractical to do (i did in editor once Edit : viewtopic.php?p=452123#p452123 ), but it is possible to only use 3 way merge junction in a network, place train stop far enough from the main line and have a station that can handle the full throughput of a rail lane without train slowing in the main lane. ( depending on train composition and train fuel and braking research it changes but i think with 2-4 trains and nuclear fuel, it was around 40 blue belts of iron ore that one could get through 1 rail lines in my testings).

This is going to be made much easier with bridges from the expansion ! because then it is possible to create train junctions that are similar to highway junctions, "merge" and not llike current mostly used 4 way junctions that require crossing.
MEOWMI wrote:
Thu Dec 07, 2023 6:13 am
A separate case is calculating the throughput of a rail line with only 1 train on it, in which case braking happens because it's at the station, but then no rail signals matter.
This is a different metric/approach, the density of material approach is akin to real life highway camera looking to math the instant throughput of passenger . What you are mentionning is also used in real life but that would be a different approach that consist into surveying people to know who is composing the flow that could have otherwise been observed from a highway camera. I haven't practiced this , only read that this is used to "forecast" traffic in an area. Knowing how much time or where a passenger would go ( in vacation for example ) allow to forecast the density of traffic which in practical life has implications. ( If passenger goes further it means 1 car will stays for x more hours ; survey many passenger every week and observe variation, know how many km of track is available and you can forecast the density of car with the forecast, and thus the speed at which traffic will flow because if density gets too high car have to brake/go slower for safety reason, and thus the throughput can be estimated ).

This in game would translate into the questionning of how many trains do you need to supply a constant flow of material, considering they would sometimes be in 'traffic jam' , or unloading/loading if i understood correctly what you are refering to.

mrvn
Smart Inserter
Smart Inserter
Posts: 5709
Joined: Mon Sep 05, 2016 9:10 am
Contact:

Re: Maximum throughput of a rail line

Post by mrvn »

quyxkh wrote:
Thu Dec 07, 2023 1:47 am
If you have the breaking speed then yes, the formula is easy. But breaking speed itself is not so easy to compute. For example as you research breaking it changes. And top speed is also not a constant as it depends on the fuel, the weight, the nose air resistance.

Overall there are a lot of parameters that go into it all. Lots of little equations.
MEOWMI wrote:
Thu Dec 07, 2023 6:13 am
Since it looks like we're assuming that trains can have a reason to brake even when not at a station, we then need to assess the reason for why they brake. Almost always, that's going to be because of an intersection. Thus, the throughput is bounded by the throughput of the intersection, which in turn is best discovered by empirical testing, with various mods.

A separate case is calculating the throughput of a rail line with only 1 train on it, in which case braking happens because it's at the station, but then no rail signals matter.

Also, a lot of the time, maximum material throughput is determined by how fast you can load and unload the train, or how fast you can produce or consume the materials. Indeed, that's where the bottleneck is, if trains are waiting before a station.
Intersections are what normally limits your throughput, or a lack of enough loading/unloading stations. But how do you know? What throughput should your intersection have to not be the limiting factor? How many stations do you need? At what point do you have to switch to 2 rail lines per directions instead of just one. That's where you need the theoretical achievable throughput figures.


How fast you can load and unload the the train gets rather unimportant as you progress the game. It solely depends on the inserter used and the inserter bonus, with a maximum at 12 for stack inserters. Each bonus also gives a diminishing return and loading/unloading is just fast. Getting the train in and out of the station becomes the bigger problem. And then you can have many stations all working in parallel or longer trains, both increase the throughput linear without limit. With more and more items getting introduced the number of stations all working in parallel rises.

To saturate a rail line you always need multiple stations because you need to accelerate multiple trains in parallel on separate lines before you merge them at speed to get the optimal packing. Even instant unloading wouldn't help, the trains just can't accelerate and clear a single station fast enough to saturate a line. The time for the train to move in/out of a station dominates the overall time.

As an example I managed to put one LC train every 73 ticks on a rail line. To pack them that closely I needed 16 stations that release their trains in a fixed pattern and then merges the 16 rails into 1. That gives you about 19 seconds to load/unload the train. 2 blue belts worth of items manage that up to a stacksize of 150 items. Larger stack size need more belts or longer trains and therefore longer interval. The most common items is probably ore, with a stacksize of 50 or 2 yellow belts worth of items.

Illiander42
Filter Inserter
Filter Inserter
Posts: 412
Joined: Mon Feb 05, 2018 10:01 am
Contact:

Re: Maximum throughput of a rail line

Post by Illiander42 »

Has anyone gone and found the old signalless clocked setups yet?

The ones where the order you placed the trains boosts throughput if you get it right.

mrvn
Smart Inserter
Smart Inserter
Posts: 5709
Joined: Mon Sep 05, 2016 9:10 am
Contact:

Re: Maximum throughput of a rail line

Post by mrvn »

Illiander42 wrote:
Thu Dec 07, 2023 9:42 am
Has anyone gone and found the old signalless clocked setups yet?

The ones where the order you placed the trains boosts throughput if you get it right.
I only remember the one with a # setup where trains drive through the gaps between wagons of other trains.

But theoretically if you remove all signals you should be able to clock trains to leave signals so they drive head to tail without that pescy breaking distance ruining your throughput.

farcast
Long Handed Inserter
Long Handed Inserter
Posts: 86
Joined: Fri Jul 06, 2018 8:25 am
Contact:

Re: Maximum throughput of a rail line

Post by farcast »

On a straight track with constant signal spacing,
with identical trains as close to each other as can be (train -> braking distance -> signal block length -> train),
and assuming trains move at a constant speed,
this graph on desmos should show how throughput varies with speed.
LOOK AT THIS GRAPH
1 tile = 1 meter
Braking force is in Newtons
Distance is in meters
Velocity is in meters/second
Mass is in kilograms

Interestingly, throughput is always highest when braking distance = train length + block length, whatever speed that ends up being.

EDIT: More accurate, much more complicated graph
Last edited by farcast on Sat Feb 10, 2024 7:55 am, edited 1 time in total.
Efficient inefficient design.

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

Re: Maximum throughput of a rail line

Post by mmmPI »

farcast wrote:
Thu Dec 07, 2023 7:17 pm
Interestingly, throughput is always highest when braking distance = train length + block length, whatever speed that ends up being.
Woa the graph are great !

Speed *3.6 for km/h is what is shown in the game, so i understand your graph cover all realistic speed in vanilla it puzzled me a little at first. Also it took me a little time to realize why there is no modeling for fuel change( it's only going to impact speed in your graphs, which are all represented anyway ).

I'm still unsure how it is possible to math the block lengh interaction without accounting for the acceleration, that part seem mysterious and that would be another interaction for the fuel, from the graph i assume the train are themselves assumed to be smart enough to exit a block as soon as they can, but in real life for cars i think this is not always the case as there could be emergent behavior, namely "traffic jams" when a car takes longer to re-accelerate than to slow down though this assume variation of speed which are not to be accounted for in the modeling from the graph.

Edit : I know what puzzle me, if i try to make a train with 1 loco and 50 wagon , i can still see the theoric throughput for 100meter/second train, but really such train would not be able to reach such speed so the graph shoudln't be drawn to the right past the max speed such train composition allow, which would depend on fuel ! haha ! :ugeek:

From playing with the graph it look likes the more breaking research is done, the more forgiving it is to have your signals spaced out which i like to see for obvious gameplay benefit.logic but i have hard time to picture how it behave in game.

what you are saying is when D = l the throughput is maxed no matter the speed, but interestingly no matter the signal placement too which sounds good for gameplay too.

I suppose what's left to do is pick some value and build setups in game to count trains to make sure there is no descrepancy between the theory and the practice and if so why and to which magnitude :D

According to your graph, many 2-4 trains containing iron on a single rail lane should have a max throughput of 46 trains per minutes with a braking research of 2 and signals at a 0 spacing. This means ((4*40(slots)*50(iron per slot)*46(train per minute))/60(minutes)/45(item per second) =136 blue belt worth of iron. ( or 6133 per second). But for that the trains need to move at 180 km/h which is not their max speed.

Comparing to the previously link setup that claims 40 blue belt worth or iron, or 1800 per second. That correspond to 14 train per minutes so. Which when train are not going only 180 km/h but their max speed instead is achieved when signal are placed 50 tiles apart and there is no braking research (1), or when signals are placed 100 tiles apart and braking research is 1.2.

So worse fuel is better for throughput ?

quyxkh
Smart Inserter
Smart Inserter
Posts: 1028
Joined: Sun May 08, 2016 9:01 am
Contact:

Re: Maximum throughput of a rail line

Post by quyxkh »

farcast wrote:
Thu Dec 07, 2023 7:17 pm
On a straight track with constant signal spacing,
with identical trains as close to each other as can be (train -> braking distance -> signal block length -> train),
and assuming trains move at a constant speed,
this graph on desmos should show how throughput varies with speed.
LOOK AT THIS GRAPH
1 tile = 1 meter
Braking force is in Newtons
Distance is in meters
Velocity is in meters/second
Mass is in kilograms

Interestingly, throughput is always highest when braking distance = train length + block length, whatever speed that ends up being.

Really think that ought to be graphing cargo wagons or cargo slots per minute, with X axis wagon count not speed.

mrvn
Smart Inserter
Smart Inserter
Posts: 5709
Joined: Mon Sep 05, 2016 9:10 am
Contact:

Re: Maximum throughput of a rail line

Post by mrvn »

I played a bit with the graphs and it feels wrong. For example with 1 locomotive and 30 wagons the max throughput is at 107 m/s. But when I build that train and drive it around a circle for a good while I only get 57.6 km/h, or 16m/s (in space exploration). The game also says max speed is 259 + 32 = 291 km/h = 80.833 m/s.

One or both of the resistance factors must be missing I think.

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

Re: Maximum throughput of a rail line

Post by mmmPI »

quyxkh wrote:
Thu Dec 07, 2023 9:19 pm
Really think that ought to be graphing cargo wagons or cargo slots per minute, with X axis wagon count not speed.
If that would be the case , one would lose the ability to represent throughput of single locos ( with no wagon ) as the effective throughput of material would be 0 but it's still fun to see how single locos behave imo, otherwise i agree that it would help readability, because currently if you use 8 locos and 1 wagon or 8 locos and 8 wagon the curves are quite similar, as the number of train per minute is quite close, but the throughput of material is very different.

mrvn wrote:
Thu Dec 07, 2023 10:08 pm
I played a bit with the graphs and it feels wrong. For example with 1 locomotive and 30 wagons the max throughput is at 107 m/s. But when I build that train and drive it around a circle for a good while I only get 57.6 km/h, or 16m/s (in space exploration). The game also says max speed is 259 + 32 = 291 km/h = 80.833 m/s.

One or both of the resistance factors must be missing I think.
The speed you got depend on the fuel you used with such trains.

The resistance factors would just mean the curves are not drawn entirely to the right part as it would interpreted in a cap in the train speed. The formulas from the other thread allow to math the train max speed but if you were to use modded fuel then it would still give accurate result using the faster than 80m/s train.

You can still read the result for your 1 loco 30 wagons train, at 57.6km/h or less it will be accurate, above it is not "wrong" it's just that it's not going to happen in game with the fuel you used.

mrvn
Smart Inserter
Smart Inserter
Posts: 5709
Joined: Mon Sep 05, 2016 9:10 am
Contact:

Re: Maximum throughput of a rail line

Post by mrvn »

You are right, the page actually doesn't mention or consider achievable speed of the train at all. That makes the results quite meaningless since most of the max throughput values it calculates will be beyond the speed cap.

Post Reply

Return to “General discussion”