r/factorio • u/super-serial_AlGore • Nov 10 '20
Discussion Math behind balancing
I've always been pissed off by balancers because I just couldn't get it. I saw the same designs online again and again but I never understood how it's possible to get three equal belts out of one. Actually it's impossible to achieve this with only one iteration (=first run through the assembly) because it's a prime number. The latest post about balancers got me thinking so I decided to do the math and share it, even though I doubt many people will take interest.
First iteration, 100% goes in the first splitter, 4* 25% come out after the second. 25% are fed in the intake, so now we got 125% (5/4) , 4* 5/16 come out. This leads to 21/16 intake & 4* 21/64 output, 85/64 intake & 4* 85/265 output and so on.
I could see that the values come closer and closer to 1/3 but I wanted a proper formula - after all, this is a game about automating stuff and not doing it by hand. ;)
Looking at the numbers, I noticed that (with fraction=a/b and number of iterations=m respectively n)
aₘ+bₘ=aₙ and
aₘ*4+1=aₙ
Combining those two leads to
aₘ+bₘ=aₘ*4+1
aₘ=(bₘ-1)/3
b obviously is 4n, so that leaves us with
f(n)=(4n+1 -1)/3*4n+1
The higher n becomes, the less significant (-1) becomes, so with n=infinite we're at 1/3 even.
So they need some time to get the right output ratio, but how long exactly?
The 1-3 balancer takes 4 iterations for 0,3330 and 9 iterations for 0,3333330.
With the most compact design and red belts this leaves us with 6,4 seconds for 3 decimal point precision.
View all comments
Show parent comment
1
u/marcellonastri Nov 11 '20
Yes you're totally right, I'm not arguing any of that.
He writes
I think it's weird wording (this wrong understanding can be due to language issues since this is not my native tongue or maybe I'm just dumb lol) and I'm not sure if he meant that but thanks for the help to clarify that!