## Challenge: maximum net energy from a blue belt of coal

Post all other topics which do not belong to any other category.
Koub
Global Moderator
Posts: 4688
Joined: Fri May 30, 2014 8:54 am
Contact:

### Re: Challenge: maximum net energy from a blue belt of coal

Wed Jun 12, 2019 2:41 pm
productivity does make the recipe cheaper and faster.
This is actually wrong. Proc 3 modules make machines :
- have +10% productivity (so for 10 craft cycles, you get 1 crafts per prod3 module, 4 bonus crafts with 4)
- have -15% speed (so each craft cycle lasts 15% more for each prod3 module, 60% slower with 4 prod3)

For a recipe needing n seconds to be crafted in a given AM, with 4 prod 3s, you'll craft 1.4 recipe every cycle, but every cycle will take you n*(1+60%), which is 1.6n
in other words, you craft 1.4x the quantity in 1.6x the time.

I'm still trying to figure out some parts of your code I don't get yet, but there is a small error : I think you can't have drain + working consumption at the same time : If I'm not mistaken, drain only occurs when idle.
Koub - Please consider English is not my native language.

Qon
Smart Inserter
Posts: 1234
Joined: Thu Mar 17, 2016 6:27 am
Contact:

### Re: Challenge: maximum net energy from a blue belt of coal

Koub wrote:
Wed Jun 12, 2019 6:11 pm
Wed Jun 12, 2019 2:41 pm
productivity does make the recipe cheaper and faster.
This is actually wrong. Proc 3 modules make machines :

For a recipe needing n seconds to be crafted in a given AM, with 4 prod 3s, you'll craft 1.4 recipe every cycle, but every cycle will take you n*(1+60%), which is 1.6n
in other words, you craft 1.4x the quantity in 1.6x the time.
This is actually wrong.

60% lower crafting speed means each cycle takes 250% time, not 160% time. 1/(1-0.6) = 2.5

But speed beacons basically eliminate the productivity speed reduction drawback. And it's fairly pointless to calculate how productivity modules alone affects crafting speed because you should pretty much always add speed beacons instead. And the results with speed beacons are so wildly different that the things you learn from your PM only calculations will just lead you astray if you try to apply it on the beaconed case.

Because speed beaconed assembler (12 beacons) with PM has a crafting speed of 8 and outputs at a speed of 11.2 (=8*1.4). An assembler without modules but with speed beacons has a speed of 8.75, so outputs significantly slower than PM moduled assemblers. Speed Moduled assembler + 12 beacons gets you to 11.25 speed though which is a teeny tiny bit faster than the PM assembler. But you have no productivity bonus so it's not really worth it.

So PM does make machines faster than no modules and practically outputs at the same speed as speed modules also, if you are using 12 beacons. And PM is faster than no assembler modules with 8 beacons too.

Smart Inserter
Posts: 3045
Joined: Tue Jul 12, 2016 9:03 am
Contact:

### Re: Challenge: maximum net energy from a blue belt of coal

Koub wrote:
Wed Jun 12, 2019 6:11 pm
Wed Jun 12, 2019 2:41 pm
productivity does make the recipe cheaper and faster.
This is actually wrong. Proc 3 modules make machines :
- have +10% productivity (so for 10 craft cycles, you get 1 crafts per prod3 module, 4 bonus crafts with 4)
- have -15% speed (so each craft cycle lasts 15% more for each prod3 module, 60% slower with 4 prod3)
You misunderstand. I am not talking about productivity modules. I am talking about productivity bonus as a concept. Because for the calculation it doesn't matter where the bonus comes from.

Image you have a hypothetical (bob probably has real ones...) module that gives +100% productivity. Nothing else, no drawback. Now imagine a crafting machine with 1 speed crafts a 1 second recipe that produces 1 item per recipe. If you put one of these modules into the machine it will produce 2(!) output items after one second, i.e. it takes on average 0.5 seconds to produce 1 item now, even though the machine has no speed bonus. Q.e.d. productivity is multiplied onto the final crafting speed.

Koub wrote:
Wed Jun 12, 2019 6:11 pm
I'm still trying to figure out some parts of your code I don't get yet, but there is a small error : I think you can't have drain + working consumption at the same time : If I'm not mistaken, drain only occurs when idle.
Nope. Wasn't 100% sure myself, but it's trivial to test with one unmodified assembler in a seperate network. Drain is always active. If there's anything particular you don't understand about the function don't hesitate to ask. I haven't been able to fine any theoretical problems with it myself yet, but haven't done any actual testing either.
Author of: Hand Crank Generator, Screenshot Hotkey 2.0
Mod support languages: 日本語, Deutsch, English
My code in the post above is dedicated to the public domain under CC0.

Koub
Global Moderator
Posts: 4688
Joined: Fri May 30, 2014 8:54 am
Contact:

### Re: Challenge: maximum net energy from a blue belt of coal

Wed Jun 12, 2019 7:36 pm
Image you have a hypothetical (bob probably has real ones...) module that gives +100% productivity. Nothing else, no drawback. Now imagine a crafting machine with 1 speed crafts a 1 second recipe that produces 1 item per recipe. If you put one of these modules into the machine it will produce 2(!) output items after one second, i.e. it takes on average 0.5 seconds to produce 1 item now, even though the machine has no speed bonus. Q.e.d. productivity is multiplied onto the final crafting speed.
Now I understand your point. Productivity bonus has a virtual speed bonus effect by allowing more finished products for each craft cycle.

However, with vanilla parts, one can turn things in any direction, even with infinitely many assembling machines so that the beacon:AM ratio gets close to 1, one still has :
- 4 prod modules per AM3
- Each AM3 in the range of 8 beacons with 2 speed modules each
- Numbers for each AM3 : total +40% productivity, total 5.5 crafting speed (8 times +50% speed from the beacons and 4 times -15% speed from the prod modules, total 340% speed bonus on a 1.25 base crafting speed), and 3.675 MW consumption

In one craft cycle :
- Input is 10x12 MJ = 120 MJ
- Output is (in average) 1.4x100 MJ = 140 MJ
- Duration is 30/5.5 = 5.4545...s
- Energy used is 3.675 MW x 5.4545... = 20.04545... MJ

Conclusion, productivity gives 20 MJ every craft cycle, and increased consumption due to modules costs 20.04545... MJ for the same craft. Nets -45.45kJ, per craft, and per assembling machine.

One craft still burns over 45 kJ more than it produces . Expand as much as you want in any direction, as long as you make the regular sandwich, these numbers will just add up for each AM added.

As DaveMcW wrote, the only chance one could overcome this net loss would be by adding even more beacons per AM3 (thus abandoning the regular sandwich in favor of AM3s surrounded by beacons), but one will never be able to overcome the beacon's consumption (we didn't even need to account for until then).
Koub - Please consider English is not my native language.

patrick12222010
Inserter
Posts: 22
Joined: Thu May 16, 2019 4:31 am
Contact:

### Re: Challenge: maximum net energy from a blue belt of coal

Tue Jun 11, 2019 7:56 pm
Koub wrote:
Tue Jun 11, 2019 7:03 pm
If I trust the previous studies about how AM3 with 4 prod modules + speed moduled beacon sandwich is the optimal layout, then there's no way it can out net gain.
The problem is scale. Any sandwich of K rows of assemblers needs K+1 rows of beacons. The larger K is the less relevant is the "+1" fraction. Therefore if you build sufficiently large at some point you can make a tiny tiny surplus. If my math is right it works if you have on average less than 1.1 beacons per rocket fuel assembler.
I agree with eradicator. Larger scale will produce net profit. I already done it. See below screenshots.
Inefficient setup image
Unnecessary computations
Last edited by patrick12222010 on Tue Jun 18, 2019 12:19 am, edited 1 time in total.

Koub
Global Moderator
Posts: 4688
Joined: Fri May 30, 2014 8:54 am
Contact:

### Re: Challenge: maximum net energy from a blue belt of coal

patrick12222010 wrote:
Wed Jun 12, 2019 11:45 pm
Now, for the computations:
Coal In: 5.9k/min = 98.333/s = 393.333 MJ/s
Power In: 562MW = 562 MJ/s
Total In: 955.333 MJ/s

Rocket Fuel Out: 1.2k/min = 20/s = 2000 MJ/s

Overunity: 2.09
The discussion we have with eradicator is "is it worth to craft rocket fuel, or should we just use our solid fuel for power generation ?". If you read the first 2-3 posts of this topic, you'll see that the question "can we generate more than coal's worth of energy ?" has already beed answered.
DaveMcW did achieve 704 MW net output for 180 MW of coal input (1 blue belt), which is better than the 1438 MW output you get for 393.33 MW in (391% vs 365.6%)
Koub - Please consider English is not my native language.

DaveMcW
Smart Inserter
Posts: 2752
Joined: Tue May 13, 2014 11:06 am
Contact:

### Re: Challenge: maximum net energy from a blue belt of coal

I got up to 705.6 MW by optimizing beacon placement and inserter movement.

705MW.jpg (699.77 KiB) Viewed 245 times
Last edited by DaveMcW on Thu Jun 13, 2019 4:04 pm, edited 1 time in total.

Smart Inserter
Posts: 3045
Joined: Tue Jul 12, 2016 9:03 am
Contact:

### Re: Challenge: maximum net energy from a blue belt of coal

@Koub:
Ok. Let me do the math too. This time with all the values hardcoded.

Code: Select all

``````/c
crafting_speed = 5.5
productivity = 1.4
power_usage_per_second = 3612500
recipe_duration = 30
rocket_fuel_energy = 100000000
solid_fuel_energy = 12000000

input_fuel_cost = 10 * solid_fuel_energy / productivity
seconds_per_rocket_fuel = recipe_duration * (1/crafting_speed) * (1/productivity)
processing_power_cost = power_usage_per_second * seconds_per_rocket_fuel
net_gain = (rocket_fuel_energy - input_fuel_cost) - processing_power_cost

game.print(string.format('%.3fMJ',net_gain/1000^2))
``````
I still end up with 211kJ gained per rocket fuel before beacon costs. It produces one fuel every ~3.9 seconds, so we have ~54kW left to run beacons. Yea. That's not enough.

Btw, this is the same formula as i used in the function posted above. But before i misinterpreted the energy values of the fuel items.
Author of: Hand Crank Generator, Screenshot Hotkey 2.0
Mod support languages: 日本語, Deutsch, English
My code in the post above is dedicated to the public domain under CC0.

Smart Inserter
Posts: 3045
Joined: Tue Jul 12, 2016 9:03 am
Contact:

### Re: Challenge: maximum net energy from a blue belt of coal

Narf. Wrong energy usage (you too btw :p). Now i'm at -81kJ.

Code: Select all

``````/c
crafting_speed = 5.5
productivity = 1.4
power_usage_per_second = 3687500
recipe_duration = 30
rocket_fuel_energy = 100000000
solid_fuel_energy = 12000000

input_fuel_cost = 10 * solid_fuel_energy / productivity
seconds_per_rocket_fuel = recipe_duration * (1/crafting_speed) * (1/productivity)
processing_power_cost = power_usage_per_second * seconds_per_rocket_fuel
net_gain = (rocket_fuel_energy - input_fuel_cost) - processing_power_cost

game.print(string.format('%.3fMJ',net_gain/1000^2))
``````
For completeness i also iterated over all module combinations.
Code:

Code: Select all

``````
local mod_stats = {
speed = {speed =  0.5 , power =  0.7              } ,
prod  = {speed = -0.15, power =  0.8, prod  = 0.1 } ,
eff   = {               power = -0.5              } ,
}

local function get_bonusses(counts)
local bonusses = {}
for _,what_bonus in pairs{'speed','prod','power'} do
local b = 0
for mod_name,mod_count in pairs(counts) do
b = b + ((mod_stats[mod_name][what_bonus] or 0)*mod_count)
end
bonusses[what_bonus] = math.max(b,-0.8)
end
return bonusses
end

local function fuelcalc(mod_counts)
local bonus = get_bonusses(mod_counts)

local crafting_speed         = 1.25 * (1 + bonus.speed)
local productivity           = 1 + bonus.prod
local power_usage_per_second = (375000*(1 + bonus.power)) + 12500
local recipe_duration        = 30
local rocket_fuel_energy     = 100000000
local solid_fuel_energy      = 12000000
local beacon_power_per_second = 480000

local input_fuel_cost         = 10 * solid_fuel_energy / productivity
local seconds_per_rocket_fuel = recipe_duration * (1/crafting_speed) * (1/productivity)
local processing_power_cost   = power_usage_per_second * seconds_per_rocket_fuel
local net_gain = (rocket_fuel_energy - input_fuel_cost) - processing_power_cost
local beacon_power_usage = beacon_power_per_second * seconds_per_rocket_fuel

print(string.format(
'Net gain: %6.0fkJ, after one beacon: %6.0fkJ [Bonus: prod +%.2f%%, speed +%.2f%%, power +%.2f%%][P3 x%.1f, S3 x%.1f, E3 x%.1f]',
net_gain/1000,
(net_gain - beacon_power_usage) / 1000,
bonus.prod,bonus.speed,bonus.power,
mod_counts.prod,mod_counts.speed,mod_counts.eff
))

end

for i=0,24,1 do
if (i/2 <= 4) and ((i/2)%1 == 0) then
print('\nProd3 module count',i/2,':')
for j=0,24-i do
fuelcalc{prod = i/2, speed = j/2, eff = (24-i-j)/2}
end
end
end
``````
Result:

Code: Select all

``````
Prod3 module count	0.0	:
Net gain: -22100kJ, after one beacon: -33620kJ [Bonus: prod +0.00%, speed +0.00%, power +-0.80%][P3 x0.0, S3 x0.0, E3 x12.0]
Net gain: -21680kJ, after one beacon: -30896kJ [Bonus: prod +0.00%, speed +0.25%, power +-0.80%][P3 x0.0, S3 x0.5, E3 x11.5]
Net gain: -21400kJ, after one beacon: -29080kJ [Bonus: prod +0.00%, speed +0.50%, power +-0.80%][P3 x0.0, S3 x1.0, E3 x11.0]
Net gain: -21200kJ, after one beacon: -27783kJ [Bonus: prod +0.00%, speed +0.75%, power +-0.80%][P3 x0.0, S3 x1.5, E3 x10.5]
Net gain: -21050kJ, after one beacon: -26810kJ [Bonus: prod +0.00%, speed +1.00%, power +-0.80%][P3 x0.0, S3 x2.0, E3 x10.0]
Net gain: -20933kJ, after one beacon: -26053kJ [Bonus: prod +0.00%, speed +1.25%, power +-0.80%][P3 x0.0, S3 x2.5, E3 x9.5]
Net gain: -20840kJ, after one beacon: -25448kJ [Bonus: prod +0.00%, speed +1.50%, power +-0.80%][P3 x0.0, S3 x3.0, E3 x9.0]
Net gain: -20764kJ, after one beacon: -24953kJ [Bonus: prod +0.00%, speed +1.75%, power +-0.80%][P3 x0.0, S3 x3.5, E3 x8.5]
Net gain: -20700kJ, after one beacon: -24540kJ [Bonus: prod +0.00%, speed +2.00%, power +-0.80%][P3 x0.0, S3 x4.0, E3 x8.0]
Net gain: -21200kJ, after one beacon: -24745kJ [Bonus: prod +0.00%, speed +2.25%, power +-0.60%][P3 x0.0, S3 x4.5, E3 x7.5]
Net gain: -22657kJ, after one beacon: -25949kJ [Bonus: prod +0.00%, speed +2.50%, power +0.00%][P3 x0.0, S3 x5.0, E3 x7.0]
Net gain: -23920kJ, after one beacon: -26992kJ [Bonus: prod +0.00%, speed +2.75%, power +0.60%][P3 x0.0, S3 x5.5, E3 x6.5]
Net gain: -25025kJ, after one beacon: -27905kJ [Bonus: prod +0.00%, speed +3.00%, power +1.20%][P3 x0.0, S3 x6.0, E3 x6.0]
Net gain: -26000kJ, after one beacon: -28711kJ [Bonus: prod +0.00%, speed +3.25%, power +1.80%][P3 x0.0, S3 x6.5, E3 x5.5]
Net gain: -26867kJ, after one beacon: -29427kJ [Bonus: prod +0.00%, speed +3.50%, power +2.40%][P3 x0.0, S3 x7.0, E3 x5.0]
Net gain: -27642kJ, after one beacon: -30067kJ [Bonus: prod +0.00%, speed +3.75%, power +3.00%][P3 x0.0, S3 x7.5, E3 x4.5]
Net gain: -28340kJ, after one beacon: -30644kJ [Bonus: prod +0.00%, speed +4.00%, power +3.60%][P3 x0.0, S3 x8.0, E3 x4.0]
Net gain: -28971kJ, after one beacon: -31166kJ [Bonus: prod +0.00%, speed +4.25%, power +4.20%][P3 x0.0, S3 x8.5, E3 x3.5]
Net gain: -29545kJ, after one beacon: -31640kJ [Bonus: prod +0.00%, speed +4.50%, power +4.80%][P3 x0.0, S3 x9.0, E3 x3.0]
Net gain: -30070kJ, after one beacon: -32073kJ [Bonus: prod +0.00%, speed +4.75%, power +5.40%][P3 x0.0, S3 x9.5, E3 x2.5]
Net gain: -30550kJ, after one beacon: -32470kJ [Bonus: prod +0.00%, speed +5.00%, power +6.00%][P3 x0.0, S3 x10.0, E3 x2.0]
Net gain: -30992kJ, after one beacon: -32835kJ [Bonus: prod +0.00%, speed +5.25%, power +6.60%][P3 x0.0, S3 x10.5, E3 x1.5]
Net gain: -31400kJ, after one beacon: -33172kJ [Bonus: prod +0.00%, speed +5.50%, power +7.20%][P3 x0.0, S3 x11.0, E3 x1.0]
Net gain: -31778kJ, after one beacon: -33484kJ [Bonus: prod +0.00%, speed +5.75%, power +7.80%][P3 x0.0, S3 x11.5, E3 x0.5]
Net gain: -32129kJ, after one beacon: -33774kJ [Bonus: prod +0.00%, speed +6.00%, power +8.40%][P3 x0.0, S3 x12.0, E3 x0.0]

Prod3 module count	1.0	:
Net gain: -11337kJ, after one beacon: -23658kJ [Bonus: prod +0.10%, speed +-0.15%, power +-0.80%][P3 x1.0, S3 x0.0, E3 x11.0]
Net gain: -10826kJ, after one beacon: -20347kJ [Bonus: prod +0.10%, speed +0.10%, power +-0.80%][P3 x1.0, S3 x0.5, E3 x10.5]
Net gain: -10505kJ, after one beacon: -18263kJ [Bonus: prod +0.10%, speed +0.35%, power +-0.80%][P3 x1.0, S3 x1.0, E3 x10.0]
Net gain: -10284kJ, after one beacon: -16830kJ [Bonus: prod +0.10%, speed +0.60%, power +-0.80%][P3 x1.0, S3 x1.5, E3 x9.5]
Net gain: -10123kJ, after one beacon: -15784kJ [Bonus: prod +0.10%, speed +0.85%, power +-0.80%][P3 x1.0, S3 x2.0, E3 x9.0]
Net gain: -10000kJ, after one beacon: -14987kJ [Bonus: prod +0.10%, speed +1.10%, power +-0.80%][P3 x1.0, S3 x2.5, E3 x8.5]
Net gain:  -9903kJ, after one beacon: -14360kJ [Bonus: prod +0.10%, speed +1.35%, power +-0.80%][P3 x1.0, S3 x3.0, E3 x8.0]
Net gain: -10769kJ, after one beacon: -14797kJ [Bonus: prod +0.10%, speed +1.60%, power +-0.50%][P3 x1.0, S3 x3.5, E3 x7.5]
Net gain: -12344kJ, after one beacon: -16019kJ [Bonus: prod +0.10%, speed +1.85%, power +0.10%][P3 x1.0, S3 x4.0, E3 x7.0]
Net gain: -13666kJ, after one beacon: -17044kJ [Bonus: prod +0.10%, speed +2.10%, power +0.70%][P3 x1.0, S3 x4.5, E3 x6.5]
Net gain: -14790kJ, after one beacon: -17916kJ [Bonus: prod +0.10%, speed +2.35%, power +1.30%][P3 x1.0, S3 x5.0, E3 x6.0]
Net gain: -15758kJ, after one beacon: -18667kJ [Bonus: prod +0.10%, speed +2.60%, power +1.90%][P3 x1.0, S3 x5.5, E3 x5.5]
Net gain: -16600kJ, after one beacon: -19320kJ [Bonus: prod +0.10%, speed +2.85%, power +2.50%][P3 x1.0, S3 x6.0, E3 x5.0]
Net gain: -17339kJ, after one beacon: -19894kJ [Bonus: prod +0.10%, speed +3.10%, power +3.10%][P3 x1.0, S3 x6.5, E3 x4.5]
Net gain: -17994kJ, after one beacon: -20401kJ [Bonus: prod +0.10%, speed +3.35%, power +3.70%][P3 x1.0, S3 x7.0, E3 x4.0]
Net gain: -18577kJ, after one beacon: -20854kJ [Bonus: prod +0.10%, speed +3.60%, power +4.30%][P3 x1.0, S3 x7.5, E3 x3.5]
Net gain: -19100kJ, after one beacon: -21260kJ [Bonus: prod +0.10%, speed +3.85%, power +4.90%][P3 x1.0, S3 x8.0, E3 x3.0]
Net gain: -19572kJ, after one beacon: -21626kJ [Bonus: prod +0.10%, speed +4.10%, power +5.50%][P3 x1.0, S3 x8.5, E3 x2.5]
Net gain: -20000kJ, after one beacon: -21958kJ [Bonus: prod +0.10%, speed +4.35%, power +6.10%][P3 x1.0, S3 x9.0, E3 x2.0]
Net gain: -20390kJ, after one beacon: -22260kJ [Bonus: prod +0.10%, speed +4.60%, power +6.70%][P3 x1.0, S3 x9.5, E3 x1.5]
Net gain: -20746kJ, after one beacon: -22536kJ [Bonus: prod +0.10%, speed +4.85%, power +7.30%][P3 x1.0, S3 x10.0, E3 x1.0]
Net gain: -21073kJ, after one beacon: -22790kJ [Bonus: prod +0.10%, speed +5.10%, power +7.90%][P3 x1.0, S3 x10.5, E3 x0.5]
Net gain: -21374kJ, after one beacon: -23024kJ [Bonus: prod +0.10%, speed +5.35%, power +8.50%][P3 x1.0, S3 x11.0, E3 x0.0]

Prod3 module count	2.0	:
Net gain:  -2500kJ, after one beacon: -16214kJ [Bonus: prod +0.20%, speed +-0.30%, power +-0.80%][P3 x2.0, S3 x0.0, E3 x10.0]
Net gain:  -1842kJ, after one beacon: -11947kJ [Bonus: prod +0.20%, speed +-0.05%, power +-0.80%][P3 x2.0, S3 x0.5, E3 x9.5]
Net gain:  -1458kJ, after one beacon:  -9458kJ [Bonus: prod +0.20%, speed +0.20%, power +-0.80%][P3 x2.0, S3 x1.0, E3 x9.0]
Net gain:  -1207kJ, after one beacon:  -7828kJ [Bonus: prod +0.20%, speed +0.45%, power +-0.80%][P3 x2.0, S3 x1.5, E3 x8.5]
Net gain:  -1029kJ, after one beacon:  -6676kJ [Bonus: prod +0.20%, speed +0.70%, power +-0.80%][P3 x2.0, S3 x2.0, E3 x8.0]
Net gain:  -2436kJ, after one beacon:  -7359kJ [Bonus: prod +0.20%, speed +0.95%, power +-0.40%][P3 x2.0, S3 x2.5, E3 x7.5]
Net gain:  -4205kJ, after one beacon:  -8568kJ [Bonus: prod +0.20%, speed +1.20%, power +0.20%][P3 x2.0, S3 x3.0, E3 x7.0]
Net gain:  -5612kJ, after one beacon:  -9531kJ [Bonus: prod +0.20%, speed +1.45%, power +0.80%][P3 x2.0, S3 x3.5, E3 x6.5]
Net gain:  -6759kJ, after one beacon: -10315kJ [Bonus: prod +0.20%, speed +1.70%, power +1.40%][P3 x2.0, S3 x4.0, E3 x6.0]
Net gain:  -7712kJ, after one beacon: -10966kJ [Bonus: prod +0.20%, speed +1.95%, power +2.00%][P3 x2.0, S3 x4.5, E3 x5.5]
Net gain:  -8516kJ, after one beacon: -11516kJ [Bonus: prod +0.20%, speed +2.20%, power +2.60%][P3 x2.0, S3 x5.0, E3 x5.0]
Net gain:  -9203kJ, after one beacon: -11986kJ [Bonus: prod +0.20%, speed +2.45%, power +3.20%][P3 x2.0, S3 x5.5, E3 x4.5]
Net gain:  -9797kJ, after one beacon: -12392kJ [Bonus: prod +0.20%, speed +2.70%, power +3.80%][P3 x2.0, S3 x6.0, E3 x4.0]
Net gain: -10316kJ, after one beacon: -12747kJ [Bonus: prod +0.20%, speed +2.95%, power +4.40%][P3 x2.0, S3 x6.5, E3 x3.5]
Net gain: -10774kJ, after one beacon: -13060kJ [Bonus: prod +0.20%, speed +3.20%, power +5.00%][P3 x2.0, S3 x7.0, E3 x3.0]
Net gain: -11180kJ, after one beacon: -13337kJ [Bonus: prod +0.20%, speed +3.45%, power +5.60%][P3 x2.0, S3 x7.5, E3 x2.5]
Net gain: -11543kJ, after one beacon: -13585kJ [Bonus: prod +0.20%, speed +3.70%, power +6.20%][P3 x2.0, S3 x8.0, E3 x2.0]
Net gain: -11869kJ, after one beacon: -13808kJ [Bonus: prod +0.20%, speed +3.95%, power +6.80%][P3 x2.0, S3 x8.5, E3 x1.5]
Net gain: -12163kJ, after one beacon: -14010kJ [Bonus: prod +0.20%, speed +4.20%, power +7.40%][P3 x2.0, S3 x9.0, E3 x1.0]
Net gain: -12431kJ, after one beacon: -14193kJ [Bonus: prod +0.20%, speed +4.45%, power +8.00%][P3 x2.0, S3 x9.5, E3 x0.5]
Net gain: -12675kJ, after one beacon: -14360kJ [Bonus: prod +0.20%, speed +4.70%, power +8.60%][P3 x2.0, S3 x10.0, E3 x0.0]

Prod3 module count	3.0	:
Net gain:   4755kJ, after one beacon: -11357kJ [Bonus: prod +0.30%, speed +-0.45%, power +-0.80%][P3 x3.0, S3 x0.0, E3 x9.0]
Net gain:   5673kJ, after one beacon:  -5404kJ [Bonus: prod +0.30%, speed +-0.20%, power +-0.80%][P3 x3.0, S3 x0.5, E3 x8.5]
Net gain:   6154kJ, after one beacon:  -2286kJ [Bonus: prod +0.30%, speed +0.05%, power +-0.80%][P3 x3.0, S3 x1.0, E3 x8.0]
Net gain:   3787kJ, after one beacon:  -3030kJ [Bonus: prod +0.30%, speed +0.30%, power +-0.30%][P3 x3.0, S3 x1.5, E3 x7.5]
Net gain:   1737kJ, after one beacon:  -3980kJ [Bonus: prod +0.30%, speed +0.55%, power +0.30%][P3 x3.0, S3 x2.0, E3 x7.0]
Net gain:    256kJ, after one beacon:  -4667kJ [Bonus: prod +0.30%, speed +0.80%, power +0.90%][P3 x3.0, S3 x2.5, E3 x6.5]
Net gain:   -863kJ, after one beacon:  -5186kJ [Bonus: prod +0.30%, speed +1.05%, power +1.50%][P3 x3.0, S3 x3.0, E3 x6.0]
Net gain:  -1739kJ, after one beacon:  -5592kJ [Bonus: prod +0.30%, speed +1.30%, power +2.10%][P3 x3.0, S3 x3.5, E3 x5.5]
Net gain:  -2443kJ, after one beacon:  -5919kJ [Bonus: prod +0.30%, speed +1.55%, power +2.70%][P3 x3.0, S3 x4.0, E3 x5.0]
Net gain:  -3022kJ, after one beacon:  -6187kJ [Bonus: prod +0.30%, speed +1.80%, power +3.30%][P3 x3.0, S3 x4.5, E3 x4.5]
Net gain:  -3506kJ, after one beacon:  -6411kJ [Bonus: prod +0.30%, speed +2.05%, power +3.90%][P3 x3.0, S3 x5.0, E3 x4.0]
Net gain:  -3916kJ, after one beacon:  -6601kJ [Bonus: prod +0.30%, speed +2.30%, power +4.50%][P3 x3.0, S3 x5.5, E3 x3.5]
Net gain:  -4269kJ, after one beacon:  -6765kJ [Bonus: prod +0.30%, speed +2.55%, power +5.10%][P3 x3.0, S3 x6.0, E3 x3.0]
Net gain:  -4575kJ, after one beacon:  -6907kJ [Bonus: prod +0.30%, speed +2.80%, power +5.70%][P3 x3.0, S3 x6.5, E3 x2.5]
Net gain:  -4843kJ, after one beacon:  -7031kJ [Bonus: prod +0.30%, speed +3.05%, power +6.30%][P3 x3.0, S3 x7.0, E3 x2.0]
Net gain:  -5081kJ, after one beacon:  -7141kJ [Bonus: prod +0.30%, speed +3.30%, power +6.90%][P3 x3.0, S3 x7.5, E3 x1.5]
Net gain:  -5292kJ, after one beacon:  -7239kJ [Bonus: prod +0.30%, speed +3.55%, power +7.50%][P3 x3.0, S3 x8.0, E3 x1.0]
Net gain:  -5481kJ, after one beacon:  -7327kJ [Bonus: prod +0.30%, speed +3.80%, power +8.10%][P3 x3.0, S3 x8.5, E3 x0.5]
Net gain:  -5651kJ, after one beacon:  -7406kJ [Bonus: prod +0.30%, speed +4.05%, power +8.70%][P3 x3.0, S3 x9.0, E3 x0.0]

Prod3 module count	4.0	:
Net gain:  10536kJ, after one beacon: -10036kJ [Bonus: prod +0.40%, speed +-0.60%, power +-0.80%][P3 x4.0, S3 x0.0, E3 x8.0]
Net gain:   6044kJ, after one beacon:  -6615kJ [Bonus: prod +0.40%, speed +-0.35%, power +-0.20%][P3 x4.0, S3 x0.5, E3 x7.5]
Net gain:   4048kJ, after one beacon:  -5095kJ [Bonus: prod +0.40%, speed +-0.10%, power +0.40%][P3 x4.0, S3 x1.0, E3 x7.0]
Net gain:   2919kJ, after one beacon:  -4236kJ [Bonus: prod +0.40%, speed +0.15%, power +1.00%][P3 x4.0, S3 x1.5, E3 x6.5]
Net gain:   2194kJ, after one beacon:  -3684kJ [Bonus: prod +0.40%, speed +0.40%, power +1.60%][P3 x4.0, S3 x2.0, E3 x6.0]
Net gain:   1688kJ, after one beacon:  -3299kJ [Bonus: prod +0.40%, speed +0.65%, power +2.20%][P3 x4.0, S3 x2.5, E3 x5.5]
Net gain:   1316kJ, after one beacon:  -3015kJ [Bonus: prod +0.40%, speed +0.90%, power +2.80%][P3 x4.0, S3 x3.0, E3 x5.0]
Net gain:   1030kJ, after one beacon:  -2797kJ [Bonus: prod +0.40%, speed +1.15%, power +3.40%][P3 x4.0, S3 x3.5, E3 x4.5]
Net gain:    804kJ, after one beacon:  -2625kJ [Bonus: prod +0.40%, speed +1.40%, power +4.00%][P3 x4.0, S3 x4.0, E3 x4.0]
Net gain:    620kJ, after one beacon:  -2485kJ [Bonus: prod +0.40%, speed +1.65%, power +4.60%][P3 x4.0, S3 x4.5, E3 x3.5]
Net gain:    468kJ, after one beacon:  -2369kJ [Bonus: prod +0.40%, speed +1.90%, power +5.20%][P3 x4.0, S3 x5.0, E3 x3.0]
Net gain:    340kJ, after one beacon:  -2272kJ [Bonus: prod +0.40%, speed +2.15%, power +5.80%][P3 x4.0, S3 x5.5, E3 x2.5]
Net gain:    231kJ, after one beacon:  -2189kJ [Bonus: prod +0.40%, speed +2.40%, power +6.40%][P3 x4.0, S3 x6.0, E3 x2.0]
Net gain:    137kJ, after one beacon:  -2117kJ [Bonus: prod +0.40%, speed +2.65%, power +7.00%][P3 x4.0, S3 x6.5, E3 x1.5]
Net gain:     55kJ, after one beacon:  -2055kJ [Bonus: prod +0.40%, speed +2.90%, power +7.60%][P3 x4.0, S3 x7.0, E3 x1.0]
Net gain:    -17kJ, after one beacon:  -2000kJ [Bonus: prod +0.40%, speed +3.15%, power +8.20%][P3 x4.0, S3 x7.5, E3 x0.5]
Net gain:    -81kJ, after one beacon:  -1951kJ [Bonus: prod +0.40%, speed +3.40%, power +8.80%][P3 x4.0, S3 x8.0, E3 x0.0]
``````
Conclusion: There is no combination of modules that results in energy gain if you have to pay for at least one beacon per assembler.
Author of: Hand Crank Generator, Screenshot Hotkey 2.0
Mod support languages: 日本語, Deutsch, English
My code in the post above is dedicated to the public domain under CC0.

Bauer
Fast Inserter
Posts: 247
Joined: Fri May 05, 2017 12:48 pm
Contact:

### Re: Challenge: maximum net energy from a blue belt of coal

DaveMcW wrote:
Thu Jun 13, 2019 7:08 am
I got up to 705.8 MW by optimizing beacon placement and inserter movement.

705MW.jpg
nice!

I know, it's not part of the challenge. However, have you calculated the payback time of this monster in terms of energy building cost?

Koub
Global Moderator
Posts: 4688
Joined: Fri May 30, 2014 8:54 am
Contact:

### Re: Challenge: maximum net energy from a blue belt of coal

Thu Jun 13, 2019 9:18 am
Narf. Wrong energy usage (you too btw :p). Now i'm at -81kJ.

Code: Select all

``````/c
crafting_speed = 5.5
productivity = 1.4
power_usage_per_second = 3687500
recipe_duration = 30
rocket_fuel_energy = 100000000
solid_fuel_energy = 12000000

input_fuel_cost = 10 * solid_fuel_energy / productivity
seconds_per_rocket_fuel = recipe_duration * (1/crafting_speed) * (1/productivity)
processing_power_cost = power_usage_per_second * seconds_per_rocket_fuel
net_gain = (rocket_fuel_energy - input_fuel_cost) - processing_power_cost

game.print(string.format('%.3fMJ',net_gain/1000^2))
``````
Let me replace the code by your numbers :

input_fuel_cost (J)= 10*120,000,000/1.4 = 85,714,286
seconds_per_rocket_fuel (s)= 30/5.5/1.4 = 3.896
processing_power_cost (J)= 3,687,500*3.896 = 14,366,500
net_gain (J)= 100,000,000-85,714,286-14,366,500 = -80768

Even with beacons consuming 0, you still lose energy rocket fuel conversion is suboptimal for energy production means (provided you're playing vanilla of course).

I'm almost certain that drain is not consumed on top of the assembling machine's consumption when it is processing, I guess that's the source of the difference in our numbers : I see a 32 kJ loss while you get a 80 kJ loss, the difference perfectly matches the 12.5 kW during a 3.896s craft.
Koub - Please consider English is not my native language.

DaveMcW
Smart Inserter
Posts: 2752
Joined: Tue May 13, 2014 11:06 am
Contact:

### Re: Challenge: maximum net energy from a blue belt of coal

Here is the code I used to get more precise network stats:

Code: Select all

``````/c
precision = defines.flow_precision_index.one_hour
network = game.player.selected.electric_network_statistics
for name, _ in pairs(network.input_counts) do
energy = network.get_flow_count{name = name, input = true, precision_index = precision}
game.print("Input - " .. name .. ": " .. energy * 59.8 .. " W")
end
for name, _ in pairs(network.output_counts) do
energy = network.get_flow_count{name = name, input = false, precision_index = precision}
game.print("Output - " .. name .. ": " .. energy * 59.8 .. " W")
end``````
Last edited by DaveMcW on Thu Jun 13, 2019 5:15 pm, edited 1 time in total.

Smart Inserter
Posts: 3045
Joined: Tue Jul 12, 2016 9:03 am
Contact:

### Re: Challenge: maximum net energy from a blue belt of coal

@DaveMcW:
Where did you get the "59.8" i can't find it in the documentation? The values look correct though O_O.

______________
Koub wrote:
Thu Jun 13, 2019 3:11 pm
I'm almost certain that drain is not consumed on top of the assembling machine's consumption when it is processing
If you don't believe me when i tell you drain is *always* active please take the time to confirm it yourself. I don't know who or where this rumor of adaptive drain started. 375kW+12.5kW=387.5kW. It's also the value that @DaveMcW's function produces if you set it to one_second - as you seem to trust him more than me.
Have a blueprint:

drain.png (63.28 KiB) Viewed 158 times
Koub wrote:
Thu Jun 13, 2019 3:11 pm
I see a 32 kJ loss while you get a 80 kJ loss, the difference perfectly matches the 12.5 kW during a 3.896s craft.
Nope, it doesn't. The precise loss-per-rocket-fuel i get is 81168.8311...J (your 80768 is close enough to be caused by additional rounding you do). What you were trying to calculate is the loss-per-recipe-cycle , so yours should be 81169J*1.4 ≊ 113636J, which is precisely what i get if i replace your 3.675MW (no drain) with 3687.5MW (including drain).
Koub wrote:
Thu Jun 13, 2019 3:11 pm
Even with beacons consuming 0, you still lose energy :)
Fun fact: If there were actual 0-cost becons there are some configurations that work, because then you get free efficency modules (see table above) :D.
Author of: Hand Crank Generator, Screenshot Hotkey 2.0
Mod support languages: 日本語, Deutsch, English
My code in the post above is dedicated to the public domain under CC0.

Koub
Global Moderator
Posts: 4688
Joined: Fri May 30, 2014 8:54 am
Contact:

### Re: Challenge: maximum net energy from a blue belt of coal

Thu Jun 13, 2019 4:53 pm
If you don't believe me when i tell you drain is *always* active please take the time to confirm it yourself. I don't know who or where this rumor of adaptive drain started. 375kW+12.5kW=387.5kW. It's also the value that @DaveMcW's function produces if you set it to one_second - as you seem to trust him more than me.
Now I did take the time to test it, and you were absolutely right, I apologize, I never noticed drain was active 100% of the time .

Well that doesn't change much to the original topic (because we all agree that with vanilla, rocket fuel can't be better at producing power than solid fuel), but I'm glad I've learnt something today .

btw : It's not that I trust DaveMcW more, it's just I see no point running some code I don't understand to get a result I can't double check (because of me not understanding the code).
I didn't run DaveMcW's code either, cause can't understand it (at all, while I partially understood yours, because it doesn't imply I need to know the data structures of Factorio).

Now there's no use for me to try and do better than 705.8 MW, I admit my defeat .
Koub - Please consider English is not my native language.

vanatteveldt
Filter Inserter
Posts: 914
Joined: Wed Nov 25, 2015 11:44 am
Contact:

### Re: Challenge: maximum net energy from a blue belt of coal

Deleting the rocket fuel production indeed had a net positive effect, getting me to 703:

I was hoping using one fewer refinery (with an extra beacon) might give me better results, but I would obviously have to optimize my other beacons (a lot)
Attachments
iQ1II3Y - Imgur.png (2.8 MiB) Viewed 137 times
r0IhyDO - Imgur.png (643.9 KiB) Viewed 137 times
Last edited by vanatteveldt on Thu Jun 13, 2019 6:22 pm, edited 2 times in total.

Smart Inserter
Posts: 3045
Joined: Tue Jul 12, 2016 9:03 am
Contact:

### Re: Challenge: maximum net energy from a blue belt of coal

Koub wrote:
Thu Jun 13, 2019 6:07 pm
it's just I see no point running some code I don't understand
True. I just don't get very positive feelings if i tell someone that facts are different and how to check it. And they then go on to tell me that they prefer believing their own "facts" (you're by far not the only one). Now that you "know the truth about drain" you can join the effort to kill the rumors :p.
Koub wrote:
Thu Jun 13, 2019 6:07 pm
Now there's no use for me to try and do better than 705.8 MW, I admit my defeat :).
I still liked your original "solution" best. Using free steam in a challenge to produce more steam :p.

But yea, we agree. (I wanted to believe...). When i wrote the thing to test all possible module configurations i got a small kick when i noticed just how much surplus the Eff3 configurations had... until i added the cost of a single beacon - the Eff3 configurations were taking so much longer to craft things that they turned into the highest loss scenario.
Author of: Hand Crank Generator, Screenshot Hotkey 2.0
Mod support languages: 日本語, Deutsch, English
My code in the post above is dedicated to the public domain under CC0.

Koub
Global Moderator
Posts: 4688
Joined: Fri May 30, 2014 8:54 am
Contact:

### Re: Challenge: maximum net energy from a blue belt of coal

Bauer wrote:
Thu Jun 13, 2019 1:22 pm
I know, it's not part of the challenge. However, have you calculated the payback time of this monster in terms of energy building cost?
I used this : https://kirkmcdonald.github.io/calc.htm ... Y0HBv8Pw== to estimate it.
if one needs 7.66 GW to produce everything in a minute, during that minute, 60x7.66 = 460-ish GJ were used (assuming everything that can be crafted with prod modules is prod moduled and beacon sandwiched).
With a 705 525 MJ net gain (vs coal), one would need slightly less than 652 875s to get full payback, just over 14 minutes and a half.

If everything is produced raw in AM2s without beacons and modules, it's almost exactly the same thing :

https://kirkmcdonald.github.io/calc.htm ... 89k/wuZPwE

Unless I'm very wrong of course.
Koub - Please consider English is not my native language.

Smart Inserter
Posts: 3045
Joined: Tue Jul 12, 2016 9:03 am
Contact:

### Re: Challenge: maximum net energy from a blue belt of coal

Koub wrote:
Thu Jun 13, 2019 6:46 pm
With a 705 MJ net gain
Eh. But the net gain is only 705 - 180 = 525MW compared to directly burning the coal :p.
Also the material cost for building all the modules surely is much more significant than a bit of energy.
Author of: Hand Crank Generator, Screenshot Hotkey 2.0
Mod support languages: 日本語, Deutsch, English
My code in the post above is dedicated to the public domain under CC0.

Koub
Global Moderator
Posts: 4688
Joined: Fri May 30, 2014 8:54 am
Contact:

### Re: Challenge: maximum net energy from a blue belt of coal

Thu Jun 13, 2019 6:54 pm
Koub wrote:
Thu Jun 13, 2019 6:46 pm
With a 705 MJ net gain
Eh. But the net gain is only 705 - 180 = 525MW compared to directly burning the coal :p.
Also the material cost for building all the modules surely is much more significant than a bit of energy.
Thx, corrected my post. The cost for extracting the resources and crafting the modules is included in the calculation.
Koub - Please consider English is not my native language.

Smart Inserter
Posts: 3045
Joined: Tue Jul 12, 2016 9:03 am
Contact:

### Re: Challenge: maximum net energy from a blue belt of coal

Koub wrote:
Thu Jun 13, 2019 7:10 pm
Thx, corrected my post. The cost for extracting the resources and crafting the modules is included in the calculation.
To me it just doesn't make much sense to express the construciton of a sub-factory in Joules. What you really lose is the time that your existing factory spends on crafting all the parts, the time you lose because your ore fields deplete slightly faster, etc. And as that depends - amongst others - on the current size of your factory it's not meaningful to me to calculate it.
Author of: Hand Crank Generator, Screenshot Hotkey 2.0
Mod support languages: 日本語, Deutsch, English
My code in the post above is dedicated to the public domain under CC0.

### Who is online

Users browsing this forum: No registered users