<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://wiki.factorio.com/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Untitled7</id>
	<title>Official Factorio Wiki - User contributions [en]</title>
	<link rel="self" type="application/atom+xml" href="https://wiki.factorio.com/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Untitled7"/>
	<link rel="alternate" type="text/html" href="https://wiki.factorio.com/Special:Contributions/Untitled7"/>
	<updated>2026-10-02T03:42:55Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.43.9</generator>
	<entry>
		<id>https://wiki.factorio.com/index.php?title=Tutorial:Circuit_network_cookbook&amp;diff=219969</id>
		<title>Tutorial:Circuit network cookbook</title>
		<link rel="alternate" type="text/html" href="https://wiki.factorio.com/index.php?title=Tutorial:Circuit_network_cookbook&amp;diff=219969"/>
		<updated>2026-09-11T19:16:01Z</updated>

		<summary type="html">&lt;p&gt;Untitled7: /* Lights */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{cleanup|Combinator GUI and circuit network changed in 2.0}}&lt;br /&gt;
&#039;&#039;This is a &#039;&#039;&#039;beginners&#039;&#039;&#039; tutorial. See also the [[Circuit network]] page for an overview over the circuit network and the [[Tutorial:Combinator tutorial]] for an advanced tutorial.&#039;&#039;&lt;br /&gt;
{{Languages}}&lt;br /&gt;
&lt;br /&gt;
== Foreword == &lt;br /&gt;
This page provides examples of simple circuit network designs and some not so simple designs that others can use, combine and modify. They are designed to be as easy to understand as possible.  To see the settings of combinators without opening them, the option &amp;quot;Show combinator settings in &amp;quot;Alt-mode&amp;quot;&amp;quot; in the Interface/Alt-mode settings has to be checked and &amp;quot;Alt-mode&amp;quot; has to be turned on.&lt;br /&gt;
&lt;br /&gt;
== Lights ==&lt;br /&gt;
[[File:LightWiredToChest.png|border|left|430px]]&lt;br /&gt;
&lt;br /&gt;
=== Single lamp on condition ===&lt;br /&gt;
&lt;br /&gt;
This is one of the simplest possible use of circuit-network. A single [[lamp]] is turned on or off, depending on the number of goods (in this example empty barrels) in a chest.&lt;br /&gt;
&lt;br /&gt;
==== Setting up circuit connection ====&lt;br /&gt;
&amp;lt;div style=&amp;quot;margin-left:440px;&amp;quot;&amp;gt;&lt;br /&gt;
* The lamp is connected to the chest.&lt;br /&gt;
* The lamp is set to light if the chest contains less than 10 empty barrels.&lt;br /&gt;
&lt;br /&gt;
==== To set the light condition ====&lt;br /&gt;
* Open the lamp (left click on it).&lt;br /&gt;
* Set the input to barrels.&lt;br /&gt;
* Set the operator to &amp;lt; (less than).&lt;br /&gt;
* Set the constant number:&lt;br /&gt;
** Left click on the constant number&lt;br /&gt;
** Move the slider until 10 is shown, or edit the value box directly.&lt;br /&gt;
** Press set.&lt;br /&gt;
&lt;br /&gt;
Depending on the condition you set, the lamp may light if the chest is empty, or if it contains the required quantity of items.&lt;br /&gt;
&lt;br /&gt;
The drawback with this scenario is that the lamp has a white light , and is therefore difficult to differentiate from an ordinary lamp at night.&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
{{clear}}&lt;br /&gt;
&lt;br /&gt;
[[File:Circuit network cookbook lamp as counter.png|border|left|430px]]&lt;br /&gt;
&lt;br /&gt;
=== Multiple lamps as counts ===&lt;br /&gt;
&amp;lt;div style=&amp;quot;margin-left:440px;&amp;quot;&amp;gt;&lt;br /&gt;
This is an extension of using a single lamp on a condition, where multiple lamps operate on the same signal with increasingly higher thresholds&lt;br /&gt;
&lt;br /&gt;
* In this circuit a series of [[lamp]]s show the train limit of a [[train stop]] set by some external signal &amp;lt;code&amp;gt;L&amp;lt;/code&amp;gt;.&lt;br /&gt;
* By setting different conditions on each lamp we can build an indicator strip. &lt;br /&gt;
* The Enabled condition of the first lamp is &amp;lt;code&amp;gt;L&amp;lt;/code&amp;gt;&#039;&#039;&#039; ≥ 1&#039;&#039;&#039;.&lt;br /&gt;
* The others light up when gas is greater than or equal to 2, 3, and 4 respectively.&lt;br /&gt;
&lt;br /&gt;
This also works to display things that don&#039;t come in integer intervals. For example, a storage tank&#039;s contents could be read in 5k intervals at 5k, 10k, 15k, 20k and full 25k.&lt;br /&gt;
&lt;br /&gt;
In this setup you can connect the train stop to the lamps directly, even if the stop is not what is creating the signal, see the [[#Railway network||section on railway networks]] further down for more.&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
{{clear}}&lt;br /&gt;
&lt;br /&gt;
[[File:ColoredLights.png|border|left|430px]]&lt;br /&gt;
&lt;br /&gt;
=== Colored Lights ===&lt;br /&gt;
&amp;lt;div style=&amp;quot;margin-left:440px;&amp;quot;&amp;gt;&lt;br /&gt;
While after 2.0, a [[lamp]]&#039;s color can be changed in its GUI, it can also be connected to a circuit network for various purposes. To allow the circuit network to modify its color, you need an intermediate device like an [[arithmetic combinator]] that can send a color signal.  &lt;br /&gt;
Instead of directly connecting the [[lamp]] and the [[Storage tank]] you need:&lt;br /&gt;
# Add the arithmetic combinator.&lt;br /&gt;
# Connect the [[storage tank]] with the input of the  arithmetic combinator.&lt;br /&gt;
# Connect the  output of the [[arithmetic combinator]] with the lamp.&lt;br /&gt;
# Set up the arithmetic combinator:&lt;br /&gt;
## Setting the input to petroleum Gas + 0 (the constant 0 not the signal 0)&lt;br /&gt;
## Set the output to the pink signal (on the bottom row of the last tab of signals.)&lt;br /&gt;
# Set up the [[lamp]]:&lt;br /&gt;
##  Select the &amp;quot;Use colors&amp;quot; check box on the lamp.&lt;br /&gt;
## Set the condition to the pink signal, and what value you want (i.e. &amp;gt; 100)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
{{clear}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Circuit network cookbook lamp percentage as color ramp.png|border|left|430px]]&lt;br /&gt;
&lt;br /&gt;
=== Mapping a percentage onto a color ramp ===&lt;br /&gt;
&amp;lt;div style=&amp;quot;margin-left:440px;&amp;quot;&amp;gt;&lt;br /&gt;
While after 2.0, a [[lamp]]&#039;s color can be changed in its GUI, it can also be connected to a circuit network for various purposes. To allow the circuit network to modify its color, you need an intermediate device like an [[arithmetic combinator]] that can send a color signal.&lt;br /&gt;
&lt;br /&gt;
This example maps a percentage &amp;lt;code&amp;gt;P&amp;lt;/code&amp;gt; onto a color. Lamps read the received signals like hexadecimal colors, each of the RGB signals (by default red-square, green-square, and blue-square respectively) going from 0 to 255. Importantly here is that any values below 0 are treated as 0, and any values above 255 are equally treated as 255. If we want a ramp where at 0% the color should be red (R:255,G:0,B:0), at 50% yellow (R:255,G:255,B:0), and at 100% green (R:0,G:255,B:0). The green-square signal must rise between 0% and 50% from 0 to 255, then stay at or above 255 for percentages above 50%. Meanwhile the red-square signal must be 255 or above for percentages below 50%, then go down from 255 to 0 at 100%. If we accept a little bit of slack, we only need two arithmetic combinators. One multiplies the percentage by 5 and outputs the green-square signal, while the red-square signal starts at 510 and subtracts the green-square signal.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Percentage &amp;lt;code&amp;gt;P&amp;lt;/code&amp;gt; !! Green signal !! Red signal !! effective RGB !! apparent color&lt;br /&gt;
|-&lt;br /&gt;
| 0 || 0 || 510 || R:255; G:0; B:0 || red&lt;br /&gt;
|-&lt;br /&gt;
| 10 || 50 || 460 || R:255; G:50; B:0 || &lt;br /&gt;
|-&lt;br /&gt;
| 20 || 100 || 410 || R:255; G:100; B:0 || &lt;br /&gt;
|-&lt;br /&gt;
| 30 || 150 || 360 || R:255; G:150; B:0 || orange&lt;br /&gt;
|-&lt;br /&gt;
| 40 || 200 || 310 || R:255; G:200; B:0 ||&lt;br /&gt;
|-&lt;br /&gt;
| 50 || 250 || 260 || R:255; G:250; B:0 || yellow&lt;br /&gt;
|-&lt;br /&gt;
| 60 || 300 || 210 || R:210; G:255; B:0 ||&lt;br /&gt;
|-&lt;br /&gt;
| 70 || 350 || 160 || R:160; G:255; B:0 || lime&lt;br /&gt;
|-&lt;br /&gt;
| 80 || 400 || 110 || R:110; G:255; B:0 ||&lt;br /&gt;
|-&lt;br /&gt;
| 90 || 450 || 60 || R:60; G:255; B:0 || &lt;br /&gt;
|-&lt;br /&gt;
| 100 || 500 || 10 || R:10; G:255; B:0 || green&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
* connect the input signal to the input of the first arithmetic combinator&lt;br /&gt;
* set it to multiply the signal by 5, and output it as a green-square&lt;br /&gt;
* connect its output to the lamp and a second arithmetic combinator&lt;br /&gt;
* set the second arithmetic combinator to subtract the green-square from 510, and output it as a red-square&lt;br /&gt;
* connect its output to the lamp&lt;br /&gt;
* set the lamp to &amp;quot;Use colors&amp;quot; and &amp;quot;Color components&amp;quot;&lt;br /&gt;
* leave the default color components as the red-square signal for red, etc.&lt;br /&gt;
&lt;br /&gt;
{{clear}}&lt;br /&gt;
&lt;br /&gt;
== Oil Setups ==&lt;br /&gt;
Balancing the production of petroleum gas, light oil and heavy oil is one of the most important use cases of the circuit network.&lt;br /&gt;
&lt;br /&gt;
[[File:LgtOilCracking.png|border|left|430px]]&lt;br /&gt;
&lt;br /&gt;
=== Light Oil Cracking ===&lt;br /&gt;
&amp;lt;div style=&amp;quot;margin-left:440px;&amp;quot;&amp;gt;&lt;br /&gt;
* This circuit provides balanced light oil and petroleum gas production by cracking excess light oil into gas. &lt;br /&gt;
* The [[pump]] is connected to the [[storage tank]] by a [[red wire]]. &lt;br /&gt;
* The pump has an enabled condition set to &#039;&#039;&#039;Light Oil &amp;gt; 20000&#039;&#039;&#039;.&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
{{clear}}&lt;br /&gt;
&lt;br /&gt;
[[File:HvyOilCracking.png|border|left|430px]]&lt;br /&gt;
&lt;br /&gt;
=== Heavy Oil Cracking ===&lt;br /&gt;
&amp;lt;div style=&amp;quot;margin-left:440px;&amp;quot;&amp;gt;&lt;br /&gt;
* This circuit extends on the previous circuit by adding optional heavy oil cracking to provide lubricant etc.&lt;br /&gt;
* The pump has an enabled condition set to &#039;&#039;&#039;Heavy oil &amp;gt; 20000&#039;&#039;&#039;.&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
{{clear}}&lt;br /&gt;
&lt;br /&gt;
=== Alternative Setup for Cracking and Lubricant Production ===&lt;br /&gt;
This setup compares different fluid levels to each other instead of checking fixed values. It offers some guarantees such as petroleum gas being produced when you have light oil to spare, and light oil not being cracked when you have plenty of petroleum gas, and similar rules for heavy oil cracking and lubricant production. &lt;br /&gt;
&lt;br /&gt;
[[File:oil-single-cct.png|border|left|430px]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;margin-left:440px;&amp;quot;&amp;gt;&lt;br /&gt;
It takes 4 steps:&lt;br /&gt;
&lt;br /&gt;
# Have a fluid tank for heavy oil, light oil, petroleum gas, and lubricant. For each fluid, make sure to connect the tank via pipes to every location where the fluid is being produced or consumed.&lt;br /&gt;
# For each chemical plant (or each row of them, if you use rows) add a pump to the non-water fluid input pipe to make it possible to block the flow. Note: Alternatively, the blocking pumps could be added to the chemical plant output pipes, but there is no need to add pumps to both inputs and outputs.&lt;br /&gt;
# Connect every pump and every fluid tank to a single circuit network of red (or green) wire. The resulting circuit network will know about the fluid level in every storage tank and pass this information to every pump.&lt;br /&gt;
# For each connected pump set the circuit “enable condition” to &amp;quot;[input fluid] &amp;gt; [output fluid]&amp;quot; , for its respective chemical plant recipe. E.g. set &amp;quot;heavy oil &amp;gt; light oil&amp;quot; for the heavy oil cracking input pump, set &amp;quot;heavy oil &amp;gt; lubricant&amp;quot; for the lubricant production input pump, and set &amp;quot;light oil &amp;gt; petroleum gas&amp;quot; for the light oil cracking input pump.&lt;br /&gt;
&lt;br /&gt;
Done! Now all the pumps will move to equalize the fluid levels to each other. This will prevent fluid system deadlocks where you have plenty of one fluid but you are unable to make any of the other.&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
{{clear}}&lt;br /&gt;
&lt;br /&gt;
== Misc ==&lt;br /&gt;
[[file:MulitipleChestsAndPoles.png|border|left|430px]]&lt;br /&gt;
&lt;br /&gt;
=== Multiple Storages ===&lt;br /&gt;
&amp;lt;div style=&amp;quot;margin-left:440px;&amp;quot;&amp;gt;&lt;br /&gt;
* If you connect multiple chests to a pole, the pole displays the sum of items in all the chests.&lt;br /&gt;
* This also works with [[storage tank]]s and [[roboport]]s.&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
{{clear}}&lt;br /&gt;
&lt;br /&gt;
[[File:ConstantComb.png|border|left|430px]]&lt;br /&gt;
&lt;br /&gt;
=== Constant Combinator ===&lt;br /&gt;
&amp;lt;div style=&amp;quot;margin-left:440px;&amp;quot;&amp;gt;&lt;br /&gt;
* With a [[constant combinator]] you can generate any signals you may need. &lt;br /&gt;
* In this example we have generated a signal of 50 Laser turrets and 200 Piercing round magazine. &lt;br /&gt;
* Constant combinators are not of much use on their own but we shall use them later.&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
{{clear}}&lt;br /&gt;
&lt;br /&gt;
[[File:constant_combinator_signs2.png|border|left|430px]]&lt;br /&gt;
&lt;br /&gt;
=== Constant Combinator Signs (Managing Belts) ===&lt;br /&gt;
&amp;lt;div style=&amp;quot;margin-left:440px;&amp;quot;&amp;gt;&lt;br /&gt;
* Somewhat similar to the previous example, constant combinator signals can be used with belts to help indicate what items should be on which belts. This is extremely useful when sharing blueprints, as it&#039;s possible for blueprints to be shared albeit with no indication on which items are meant for which belts.&lt;br /&gt;
* Note again that [[Display_panel|Display panels]] are more useful here as of the 2.0 update.&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
{{clear}}&lt;br /&gt;
&lt;br /&gt;
[[File:MemoryCell.png|border|left|430px]]&lt;br /&gt;
&lt;br /&gt;
=== Memory Cell / Counter ===&lt;br /&gt;
&amp;lt;div style=&amp;quot;margin-left:440px;&amp;quot;&amp;gt;&lt;br /&gt;
* Basic memory cell that counts all the items moved by the inserter&lt;br /&gt;
* The [[fast inserter]] is connected to &#039;&#039;&#039;BOTH&#039;&#039;&#039; ends of the arithmetic combinator.&lt;br /&gt;
* If the fast inserter hasn&#039;t picked anything up this tick the input to the Arithmetic combinator is the same as and output and hence the values are persisted. &lt;br /&gt;
* When the fast inserter does pick something up its value is added to the output from the previous tick thus incrementing that item.&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
{{clear}}&lt;br /&gt;
&lt;br /&gt;
== Inserters ==&lt;br /&gt;
[[File:LimitItemsPlacedIntoAChest.png|border|left|430px]]&lt;br /&gt;
&lt;br /&gt;
=== Limit items placed into a chest ===&lt;br /&gt;
&amp;lt;div style=&amp;quot;margin-left:440px;&amp;quot;&amp;gt;&lt;br /&gt;
*  The [[inserter]] is connected to the [[wooden chest]] using a [[red wire]]. &lt;br /&gt;
*  The inserter&#039;s enabled condition is &#039;&#039;&#039;Advanced Circuit &amp;lt; 10&#039;&#039;&#039;. &lt;br /&gt;
*  In reality this means the inserter may place more than 10 Advanced circuits in the chest because it could pick up to 3 at once due to stack size bonuses.&lt;br /&gt;
*  This effect can be even greater with Stack inserters because of their large carrying capacity. &lt;br /&gt;
*  This technique still gives far greater control than limiting the inventory on the chest.&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
{{clear}}&lt;br /&gt;
&lt;br /&gt;
[[File:BalancedChestInsert.png|border|left|430px]]&lt;br /&gt;
&lt;br /&gt;
=== Balanced chest insert ===&lt;br /&gt;
&amp;lt;div style=&amp;quot;margin-left:440px;&amp;quot;&amp;gt;&lt;br /&gt;
Goal: Load n chests with approximately the same number of items. This can be used for train stations: [https://www.reddit.com/r/factorio/comments/4e03g2/madzuris_smart_loading_train_station_guide/ MadZuri&#039;s smart loading train station]&lt;br /&gt;
*  Place n chests and n inserters. &lt;br /&gt;
*  Place 1 [[arithmetic combinator]]&lt;br /&gt;
*  Set the combinator to take Each (yellow star) and divide by the negative number of chests. ie &amp;amp;minus;n.&lt;br /&gt;
*  Connect all chests to each other and to the input of the combinator using red wire.&lt;br /&gt;
*  Connect all inserters to each other and to the output of the combinator using red wire.&lt;br /&gt;
*  Connect each inserter to the box it inserts into with green wire.&lt;br /&gt;
*  Set the enable condition on each inserter to be Everything (red star) &amp;lt; 0.&lt;br /&gt;
&lt;br /&gt;
The combinator calculates the average number of items in the chests, and makes it negative. Each inserter gets the amount in the chest it is inserting to and adds the negative average, i.e. it calculates how many more than the average it has in its chest. Thus if that number is negative, it has less than the average in the chest and it enables. &lt;br /&gt;
&lt;br /&gt;
Due to inserter stack bonus the count is not exact. If a precise count is needed, set the inserter stack size to 1.&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
{{clear}}&lt;br /&gt;
&lt;br /&gt;
[[File:SmartOutpostUnloader.png|border|left|430px]]&lt;br /&gt;
&lt;br /&gt;
=== Keeping outpost stocked with specified items ===&lt;br /&gt;
&amp;lt;div style=&amp;quot;margin-left:440px;&amp;quot;&amp;gt;&lt;br /&gt;
*  This circuit keeps a [[storage chest]] at an outpost stocked with customized levels of different items. &lt;br /&gt;
*  For example you could keep an outpost stocked with 50 laser turrets and 200 piercing magazine rounds but not have to worry about it being over filled. &lt;br /&gt;
*  The [[storage chest]] is attached to the input of the [[arithmetic combinator]] (left side in the picture) with a [[red wire]]. &lt;br /&gt;
*  Another couple of [[red wire]]s join the output of the [[arithmetic combinator]] (right side) to the [[constant combinator]] and to the [[stack filter inserter]]. &lt;br /&gt;
*  The [[arithmetic combinator]] &#039;&#039;&#039;multiplies&#039;&#039;&#039; each input value (from the storage chest) by &#039;&#039;&#039;-1&#039;&#039;&#039;. &lt;br /&gt;
*  Finally the filter stack inserter&#039;s mode of operation is set to &#039;&#039;&#039;Set filters&#039;&#039;&#039;.&lt;br /&gt;
*  So the input to the [[stack filter inserter]] is &#039;&#039;&#039;&amp;lt;constant combinator&amp;gt; - &amp;lt;storage chest contents&amp;gt;&#039;&#039;&#039; and the filter is set to filter for the first item by inventory order.&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
{{clear}}&lt;br /&gt;
&lt;br /&gt;
[[File:SolarAccumalatorBalancer.png|border|left|430px]]&lt;br /&gt;
&lt;br /&gt;
=== Balanced Solar panel / Accumulator Production ===&lt;br /&gt;
&amp;lt;div style=&amp;quot;margin-left:440px;&amp;quot;&amp;gt;&lt;br /&gt;
* This circuit balances production of [[solar panel]]s and [[accumulator]]s to a desired ratio in my case 24:20.&lt;br /&gt;
* The first [[arithmetic combinator]] takes the number of accumulators in the chest and &#039;&#039;&#039;multiplies&#039;&#039;&#039; it by &#039;&#039;&#039;24&#039;&#039;&#039;. &lt;br /&gt;
* The second [[arithmetic combinator]] takes the output of the first combinator and &#039;&#039;&#039;divides&#039;&#039;&#039; it by &#039;&#039;&#039;20&#039;&#039;&#039;. &lt;br /&gt;
* This gives us the number of accumulators that we can directly compare to the number of Solar panels in both inserters. &lt;br /&gt;
* If the number of accumulators is greater we enable the Solar panels inserter, if the number of Solar panels is greater we enable the accumulators inserter. &lt;br /&gt;
* However, if they are equal, neither machine does anything. So we add a single accumulator to one of the inserters using a constant combinator and a wire of the other color, therefore breaking the deadlock.&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
{{clear}}&lt;br /&gt;
&lt;br /&gt;
== Sushi Belts ==&lt;br /&gt;
[[File:SushiScience1.png|border|left|430px]]&lt;br /&gt;
&lt;br /&gt;
=== Reading Belt Design ===&lt;br /&gt;
&amp;lt;div style=&amp;quot;margin-left:440px;&amp;quot;&amp;gt;&lt;br /&gt;
* Six belts in a row are connected with Red wire and set to &#039;&#039;&#039;Read belts contents&#039;&#039;&#039; and &#039;&#039;&#039;Hold&#039;&#039;&#039; &lt;br /&gt;
* Note: Instead of using six belts all set to &#039;&#039;&#039;hold&#039;&#039;&#039;, only one can be used, and set to &#039;&#039;&#039;Hold (all belts)&#039;&#039;&#039; for simplicity&lt;br /&gt;
* This [[red wire]] is then connected to the inserters that insert onto the belt. &lt;br /&gt;
* Read hand contents is unselected for all inserters.&lt;br /&gt;
* Mode of operation is set to &#039;&#039;&#039;Enable/Disable&#039;&#039;&#039; on all inserters. &lt;br /&gt;
* The first inserter is enabled when &#039;&#039;&#039;Automation science pack = 0&#039;&#039;&#039;&lt;br /&gt;
* The other inserters are set similarly for the other science packs.&lt;br /&gt;
* When using &#039;&#039;&#039;Hold (all belts)&#039;&#039;&#039;, the amount required for enabling the inserters varies, but 30 is a good number.&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
{{clear}}&lt;br /&gt;
&lt;br /&gt;
[[File:SushiScience2.png|border|left|430px]]&lt;br /&gt;
&lt;br /&gt;
=== Memory Cell Design ===&lt;br /&gt;
&amp;lt;div style=&amp;quot;margin-left:440px;&amp;quot;&amp;gt;&lt;br /&gt;
* This recipe produces a rolling sum of the number of items of each type, as they added or removed from a looping conveyor belt. Inserters placing items onto the belt can use this sum to turn on or off as needed. &lt;br /&gt;
* It achieves this through two networks, one red (subtraction) and one green (addition), connected to their own inserters, and two arithmetic combinators: one basic [[arithmetic combinator]] to do the subtraction, and one memory cell, to update and persist the values.&lt;br /&gt;
&amp;amp;nbsp;&lt;br /&gt;
* Each inserter that takes items &#039;&#039;&#039;from&#039;&#039;&#039; the belt is connected with Red wire. Each of these inserters is set to &#039;&#039;&#039;Mode of operation: None&#039;&#039;&#039;, &#039;&#039;&#039;Read hand contents is checked&#039;&#039;&#039;, and Hand read mode is set to &#039;&#039;&#039;Pulse&#039;&#039;&#039; (sends 1 each time an item is picked up). &lt;br /&gt;
* These red wire inserters are connected to the input of the subtraction arithmetic combinator, in this example, it is the one on the left.&lt;br /&gt;
* The left [[arithmetic combinator]] multiples &#039;&#039;&#039;each&#039;&#039;&#039; input by &#039;&#039;&#039;-1&#039;&#039;&#039; and outputs it to &#039;&#039;&#039;each&#039;&#039;&#039;. This subtracts 1 each time an inserter removes an item from the belt, for the specific type of item taken.&lt;br /&gt;
* The right [[arithmetic combinator]] is the &#039;&#039;&#039;memory cell&#039;&#039;&#039;.&lt;br /&gt;
* The memory cell&#039;s input is connected to: 1. A green wire network of inserters placing items onto the belt (the addition), 2. The output of the left [[arithmetic combinator]] (the subtraction).&lt;br /&gt;
* The memory cell&#039;s output should be connected to its input, so that each time an update is sent from either the addition network (green wire) or subtraction network (red wire), the updated value is persisted.&lt;br /&gt;
* When a Green wire inserter adds an item to the belt, that item&#039;s count in the memory cell is increased by 1.&lt;br /&gt;
* The inserters that place items onto the belt (green wire) should be set to: &#039;&#039;&#039;Enable/disable&#039;&#039;&#039;, &#039;&#039;&#039;Read hand contents is checked&#039;&#039;&#039; and &#039;&#039;&#039;Hand read mode is set to Pulse&#039;&#039;&#039;.&lt;br /&gt;
* The &#039;&#039;&#039;Enable/disable&#039;&#039;&#039; condition is set based on the number of items you&#039;d like picked up by the red wire inserters, e.g. Automation science pack &amp;lt;= 16 (one pack for each lab in the example shown here).&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
{{clear}}&lt;br /&gt;
&lt;br /&gt;
== Power ==&lt;br /&gt;
[[File:SteamBackup.png|border|left|430px]]&lt;br /&gt;
&lt;br /&gt;
=== Backup steam power ===&lt;br /&gt;
&amp;lt;div style=&amp;quot;margin-left:440px;&amp;quot;&amp;gt;&lt;br /&gt;
* The [[steam engine]]s are not directly connected to the power network. They are connected to the power network through a [[power switch]]. &lt;br /&gt;
* The [[power switch]] is connected to one of the [[accumulator]]s in the main network. &lt;br /&gt;
* The [[power switch]] turns on when A &amp;lt; 10. That is when the [[accumulator]]s are less than 10% full.&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
{{clear}}&lt;br /&gt;
&lt;br /&gt;
=== Optimal usage of fuel for nuclear power ===&lt;br /&gt;
Unlike the normal steam power that adjusts fuel usage based on power usage, the [[Power_production#Nuclear_power|nuclear reactors]] spend fuel in fixed units of time. To be exact, the consumption of 1 fuel cell takes exactly 200 seconds.&lt;br /&gt;
&lt;br /&gt;
Combined with the fact that creating the nuclear fuel cells are time consuming and expensive to create, it is therefore beneficial to optimize their use to match the actual consumed power.&lt;br /&gt;
&lt;br /&gt;
[[File:NuclearCircuits.png|border|left|430px]]&lt;br /&gt;
&amp;lt;div style=&amp;quot;margin-left:440px;&amp;quot;&amp;gt;&lt;br /&gt;
This picture shows a setup with 4 reactors, that spend only 1 fuel cell each whenever steam runs low.&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;Note: The GUI in the image above has been altered to make sure all important info fits within the image size.&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
There are a few elements in this setup:&lt;br /&gt;
* Storage tank that provides the [[steam]] signal.  You should only read from one storage tank, and it should have pipe connections to all your other steam storage tanks.&lt;br /&gt;
* Chests containing [[uranium fuel cell]]s for the reactor.&lt;br /&gt;
* Output inserter that takes [[Used_up_uranium_fuel_cell|empty fuel cells]] from the reactor. This is connected to the storage tank to listen for the steam signal, and to the chests to listen for the uranium fuel cell signal. If the steam level is low and there are uranium fuel cells available, it removes the empty fuel cells from the reactor and sends an empty fuel cell signal (since &amp;quot;Read hand contents&amp;quot; is checked).&lt;br /&gt;
* Input inserter that put uranium fuel cells into the reactor. This is connected to the output inserter and listens for the empty fuel cell signal. The &amp;quot;Override stack size&amp;quot; is set to 1, so that it only inserts 1 fuel cell at a time.&lt;br /&gt;
* If you are using multiple reactors you should only wire one output inserter to one steam tank, and then connect all input inserters to the single output inserter. This will synchronize fuel insertion to maximize the reactor neighbour heat bonus. The other reactors can have &amp;quot;dumb&amp;quot; output inserters that remove [[Used_up_uranium_fuel_cell|empty fuel cells]] immediately.&lt;br /&gt;
&lt;br /&gt;
Since this design uses empty fuel cells as a signal to fill the reactor, you need to manually insert 1 uranium fuel cell into the reactor to get it started.&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
{{clear}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Prioritize usage of uranium towards nuclear fuel production ===&lt;br /&gt;
Because a continuous supply of [[uranium fuel cell]]s is critical to maintaining a [[nuclear reactor]], the circuit network can be used to set up a system where [[uranium-235]] and [[uranium-238]] are conserved for the production of nuclear fuel before other uses.&lt;br /&gt;
&lt;br /&gt;
[[File:Nuclear Fuel Circuit Network.png|border|left|430px]]&lt;br /&gt;
&amp;lt;div style=&amp;quot;margin-left:440px;&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Using a [[splitter]], divert the two types of uranium onto two parallel conveyors, with an [[inserter]] positioned to gather uranium from each conveyor (a [[long-handed inserter]] will be needed for the far belt). Each of these inserters deposits their load into a container, from which two more inserters deliver the contents to an [[assembling machine]] making nuclear fuel. An inserter delivers the produced fuel to a third container, from which inserter(s) delivers the fuel to your nuclear reactor. Wire the two inserters gathering from the conveyors to the container each of them is delivering to, and to the tile of conveyor immediately after the tile the inserter is gathering from. Set each inserter&#039;s enable condition to &amp;quot;less than or equal to X amount of uranium&amp;quot;, using the appropriate type of uranium the inserter is gathering and X being the number of reserve uranium desired (optimally, one uranium-235 and nineteen uranium-238, the amount needed to produce nuclear fuel; the amount may be increased if a greater stockpile is desired). Set each conveyor&#039;s enable condition to &amp;quot;greater than or equal to X amount of uranium&amp;quot; in the same manner. Finally, connect the inserters delivering uranium to the assembly machine up to the container the assembly machine is delivering nuclear fuel to, and set each of their enable conditions to &amp;quot;nuclear fuel = 0 (the enable condition can be set to &amp;quot;less than or equal to X amount of nuclear fuel&amp;quot; if a larger stockpile is desired).&lt;br /&gt;
&lt;br /&gt;
This set-up accomplishes the following:&lt;br /&gt;
&lt;br /&gt;
* When there is sufficient nuclear fuel and uranium stockpiled, the inserters will deactivate and the conveyors activate, allowing the uranium to continue down the conveyors to other facilities.&lt;br /&gt;
* When the nuclear fuel stockpile hits zero (or decreases below the desired amount), the inserters delivering to the assembly machine will activate and deliver uranium to resume production of nuclear fuel until quota is reached again.&lt;br /&gt;
* When there is not enough uranium stockpiled to produce a batch of nuclear fuel, the inserters gathering uranium will activate and and resume gathering uranium until they reach their quota. The conveyors carrying uranium will stop past the inserters, cutting off other facilities from that type of uranium until its respective inserter reaches quota.&lt;br /&gt;
* The assembly machine will only be provided with uranium when the stockpile of nuclear fuel hits zero (or decreases below the desired amount), preventing over-production of nuclear fuel and thus over-consumption of uranium.&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
{{clear}}&lt;br /&gt;
&lt;br /&gt;
== Railway network ==&lt;br /&gt;
=== Set train routing ===&lt;br /&gt;
The circuit network can be used to allow deeper micromanagement of [[train]]s. Circuits can be used to adjust train limits for [[Train stop|stops]], effectively disabling a stop when a resource is not available for loading, or if an unloading station already has more than enough of a resource. Note that adjusting train limits runs into fewer problems than fully enabling/disabling stops; see [https://factorio.com/blog/post/fff-361 Friday Facts #361 - Train stop limit, Tips and tricks] and the [[Train stop]] page for additional information about using train limits.&lt;br /&gt;
&lt;br /&gt;
=== Player safety ===&lt;br /&gt;
The circuit network can be used to ensure the player&#039;s safety when crossing train tracks so they do not get hit. Place [[gate]]s at designated crossing areas and connect an adjacent [[wall]] to [[rail signal]]s near the gate. Set the gate to &amp;quot;read sensor&amp;quot; and the signal to &amp;quot;close signal&amp;quot; with the condition being the signal the gate sends out being &amp;quot;1&amp;quot;. This means that when the gate is closed, the signal will be green and trains can pass freely, but when the player approaches the gate and it opens for them, the train signal will be turned red and trains will be stopped until the player clears the area.&lt;br /&gt;
&lt;br /&gt;
Alternatively, this system can be reversed - by setting the gate to &amp;quot;open gate&amp;quot; and the train signal set to &amp;quot;read signal&amp;quot;, the gate will remain open normally and will close when a train is approaching, preventing the player from crossing until it is safe.&lt;br /&gt;
&lt;br /&gt;
In lieu of gates, the player can connect a [[programmable speaker]] to the train signals to broadcast a warning siren when a train is approaching the area.&lt;br /&gt;
&lt;br /&gt;
== Latches ==&lt;br /&gt;
=== RS latch - single decider version ===&lt;br /&gt;
[https://forums.factorio.com/viewtopic.php?f=193&amp;amp;t=14556 This discussion] on the Factorio forums starts with the common 2 decider RS latch version, but later a [https://forums.factorio.com/viewtopic.php?p=111192#p111192 single decider version was proposed]. The thread [https://forums.factorio.com/viewtopic.php?p=160896#p160896 goes on to explain] why this is better. In the thread, the latch is described as an SR latch. However, when both inputs are true, the latch will reset, so it is an RS latch.&lt;br /&gt;
&lt;br /&gt;
=== SR latch ===&lt;br /&gt;
In 2.0, an SR latch can be accomplished in a single decider combinator with many combinations of set and reset conditions. This latch, for example will set if the steam levels or the accumulator levels fall too low, and will reset when both levels recover. This is an SR latch; if both inputs are true, the latch will set.&lt;br /&gt;
[[File:SR-Multi-condition.png|border|left|430px]]&lt;br /&gt;
{{clear}}&lt;br /&gt;
&lt;br /&gt;
=== Backup steam example ===&lt;br /&gt;
This example will turn on the steam generator when the Accumulator charge drops to 20%, but will &amp;quot;latch&amp;quot; (remember) the On state until the accumulator is charged to 90%.&lt;br /&gt;
&lt;br /&gt;
Latching is used to introduce [[Wikipedia:hysteresis|hysteresis]] and avoid the power switch rapidly cycling on and off (as the accumulator falls to 19%, charges to 20%, falls to 19% and so on). &lt;br /&gt;
[[File:SR-01-Layout.png|border|left|430px]]&lt;br /&gt;
{{clear}}&lt;br /&gt;
{{BlueprintString|bp-string=0eNqllMmO2zAMht+FZ2UQx0trHwr0GXoMAkO2mRkBWgwtyQSB330oJXGKxmg604tNUdQnkr+kM3Qy4GiF9tCcQfRGO2i2Z3DiVXMZfZorhAacR65WqF+FRpgYCD3gOzTZtGOA2gsv8LIyDU6tDqpDSwHsRlA4iEAIib23ol+NRiIwGI2jxUbHvQhY5C8lgxMZ9Us5TewBuPkksMyeAPMZ6BSX8inv+xNeMfN43wcVJPfGLhRaJ0qZUTOp7d4a2Xb4xg+CoinEBD8G396F8KcxQg/C+kCee9YpYvUTpqVsyjluwF4MaFe9UZ3Qy0mV+TUpKo3BICy1Is0Wy0lemS3NDYnjovf3EZ2IvbDuc4WkzZzn8VRu1rGq/2PUX2H8ujDUyG1qVgM/4ObA9rqY6wHiFbio9efd+bcdxhP1L2jf7q1RrdAEgmbPpcNpt6hpNYNGcyRF3VH4/m1BzervR6wXtg/Ct6h5J3GAxtuAbHbPMsbYrzXvJsD6oZNUF1zybinG463ix2q/scU36KHaan29mAunN0p0pHEUaJuxkm1YuWNb+rIqWXmyKrIKFuczslIUK5JV0OxmRxThUVEq92eTwQGtS9uU1aYu6pp+eZ1X+TR9AMRRzM0=}}&lt;br /&gt;
{{clear}}&lt;br /&gt;
[[File:SR-02-Accumulator.png|border|left|430px]]&lt;br /&gt;
Accumulator outputs the current charge level as % on signal [[File:Signal-A.png|21px]]&lt;br /&gt;
{{clear}}&lt;br /&gt;
[[File:SR-04-SRLatch.png|border|left|430px]]&lt;br /&gt;
The decider sets and latches the Set signal [[File:Signal-S.png|21px]] when the accumulator falls below 20%, and unlatches when the accumulator reaches 90%.&amp;lt;br /&amp;gt;&lt;br /&gt;
{{clear}}&lt;br /&gt;
[[File:SR-05-PowerSwitch.png|border|left|430px]]&lt;br /&gt;
The Power switch isolates the generator from the rest of the factory until [[File:Signal-S.png|21px]] = 1&lt;br /&gt;
{{clear}}&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
[[File:BeltLatch.png|border|left|430px]]&lt;br /&gt;
&lt;br /&gt;
=== Belt only latch ===&lt;br /&gt;
&amp;lt;div style=&amp;quot;margin-left:440px;&amp;quot;&amp;gt;&lt;br /&gt;
* To make it work, &#039;&#039;&#039;3&#039;&#039;&#039; pieces of raw wood must be placed on the inside lane of the belt.&lt;br /&gt;
* It will have higher latency than the combinator version, but in most situations you will not notice the difference.&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
{{clear}}&lt;br /&gt;
&lt;br /&gt;
=== Toggle Latch ===&lt;br /&gt;
&lt;br /&gt;
[[File:ToggleLatch2.0.png|thumb|left|430px|The wiring setup for the toggle latch.]]&lt;br /&gt;
[[File:ToggleLatch2.0_Settings.png|thumb|left|430px|The decider combinator settings.]]&lt;br /&gt;
[[File:ToggleLatch2.0_InputSettings.png|thumb|left|430px|The required inputs.]]&lt;br /&gt;
&lt;br /&gt;
A variant of a SR latch that toggles between two states on receiving the leading edge of the given input signals.&lt;br /&gt;
&lt;br /&gt;
Both input signals are required to cause the latch to toggle.&lt;br /&gt;
{{clear}}&lt;br /&gt;
&lt;br /&gt;
== Displays ==&lt;br /&gt;
[[File:5digitDisplay.png|border|left|430px]]&lt;br /&gt;
&lt;br /&gt;
=== Numerical Display ===&lt;br /&gt;
&amp;lt;div style=&amp;quot;margin-left:440px;&amp;quot;&amp;gt;&lt;br /&gt;
* Each digit is driven by its own [[green wire]], that wire holds 15 signals, one for each lamp used in the digit.&lt;br /&gt;
* [[constant combinator]]s are used to define which lamp should light up for each value.&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
{{clear}}&lt;br /&gt;
&lt;br /&gt;
[[File:BWDisplay.png|border|left|430px]]&lt;br /&gt;
&lt;br /&gt;
=== Black and White Grid Display ===&lt;br /&gt;
&amp;lt;div style=&amp;quot;margin-left:440px;&amp;quot;&amp;gt;&lt;br /&gt;
* Each row has its own [[red wire]] connection and within that row each light has a numbered signal 0-9.&lt;br /&gt;
* We turn each light on by just setting or clearing the relevant signal.&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
{{clear}}&lt;br /&gt;
&lt;br /&gt;
[[File:MultiColoredDisplay.png|border|left|430px]]&lt;br /&gt;
&lt;br /&gt;
=== Multicolor Display by DaveMcW ===&lt;br /&gt;
&amp;lt;div style=&amp;quot;margin-left:440px;&amp;quot;&amp;gt;&lt;br /&gt;
* To understand how this works, you first need to understand how color lights choose which color to light up when there are multiple colored signals. &lt;br /&gt;
* The [[lamp]] will light up with the colored signal that is greater than zero and earliest in this list: red, green, blue, yellow, pink, cyan, white.  &lt;br /&gt;
* We have a [[red wire]] per column, that wire has each of the colored signals on it at different values and a numbered signal for each row. &lt;br /&gt;
* There is a [[arithmetic combinator]] for each cell that subtracts the &amp;quot;row&amp;quot; value from each of the colored signals. &lt;br /&gt;
* And this enables us to choose the color for each cell. &lt;br /&gt;
* Simple!&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
{{clear}}&lt;br /&gt;
&lt;br /&gt;
== Setting Recipes ==&lt;br /&gt;
[[File:MultipleItemAssembler.png|border|left|430px]]&lt;br /&gt;
&lt;br /&gt;
=== Multiple Item Assembling Machine ===&lt;br /&gt;
&amp;lt;div style=&amp;quot;margin-left:440px;&amp;quot;&amp;gt;&lt;br /&gt;
* This circuit design allows a user to have a single [[assembling machine]] produce several different items that all use mostly the same ingredients. This is a convenient way to avoid routing the same set of inputs to multiple assembly machines for items that need automated, but not constant production. For example, [[medium electric pole]]s and [[big electric pole]]s share the same ingredients, or the [[pumpjack]], [[oil refinery]], and [[chemical plant]] take mostly the same inputs.&lt;br /&gt;
* To use this, the player opens the [[constant combinator]] and selects which items and what quantities to make.&lt;br /&gt;
* This signal goes into the green wire input of the [[decider combinator]], where it is compared to the quantity of items in the logistics chest connected to the combinator input on the red wire.&lt;br /&gt;
* The decider combinator uses the &amp;quot;each&amp;quot; signal, so each signal on the green wire is compared to each signal on the red wire, and if there are fewer of any item in the chest than are set by the constant combinator, the decider combinator will output a signal on that item&#039;s channel.&lt;br /&gt;
* The assembling machine then is configured to set the recipe based on incoming signals and so will produce whatever items are needed to fulfill the settings on the constant combinator.&lt;br /&gt;
* The assembly machine outputs items to the steel chest, which then loads them into the requester chest, which feeds back into the assembly machine. This is because when a new recipe is loaded, any extra input items of the previous recipe must be unloaded from the machine, and this loop will supply those unloaded items back into the assembly machine, otherwise input materials will fill up the output storage, preventing new items from being produced.&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
{{clear}}&lt;br /&gt;
&lt;br /&gt;
== Signal Switch ==&lt;br /&gt;
&lt;br /&gt;
=== Simple Signal Switch ===&lt;br /&gt;
[[File:Factorio signal switch edit.png|430px|border|left|alt=combinator settings for a simple signal switch]]&lt;br /&gt;
* With the advent of complex conditionals, it is possible to have a single [[constant combinator]] + [[decider combinator]] output any arbitrary signal from any conditional block&lt;br /&gt;
* This relies the behavior of the &#039;&#039;&#039;each&#039;&#039;&#039; signal.  If the &#039;&#039;&#039;each&#039;&#039;&#039; signal is used in an input condition, then it can be used as the output signal as well.&lt;br /&gt;
* To start, we&#039;ll define all of the signals we may want to output in the constant combinator, and give them each a unique value.  If circumstances dictate that you cannot dedicate one of the decider&#039;s input wires to just the constant combinator, you may want to make the values negative and/or very large to ensure they stay unique.&lt;br /&gt;
* We can exploit the behavior of &#039;&#039;&#039;each&#039;&#039;&#039; to propagate any of our constant combinator signals when any arbitrary condition is true.&lt;br /&gt;
* The format is simple: Define the condition in which you want your signal sent, and then add `AND` &#039;&#039;&#039;each&#039;&#039;&#039; = `the signal in the constant combinator you want to send when that condition is true`.&lt;br /&gt;
* The condition can be simple, using only a single condition, or can have as many AND statements as you need.&lt;br /&gt;
* Because the &#039;&#039;&#039;each&#039;&#039;&#039; statement is only true - due to our constant combinator signals all having unique values - when &#039;&#039;&#039;each&#039;&#039;&#039; compares a signal to itself, and because we are using &#039;&#039;&#039;each&#039;&#039;&#039; as our output value, whenever the other conditions in each block are all true, the signal that is compared to &#039;&#039;&#039;each&#039;&#039;&#039; is sent as the output signal, as it is the only signal that passes that particular condition.&lt;br /&gt;
* In the example shown, the decider will output the &amp;quot;pipe&amp;quot; signal when there are fewer than 100 pipes in the chest. It will output the &amp;quot;underground pipe&amp;quot; signal when there are 100 or more pipes AND less than 100 underground pipes in the chest.&lt;br /&gt;
* It is important to set the &#039;&#039;&#039;each&#039;&#039;&#039; comparisons to use only the wire connected to the constant combinator, otherwise any other signals that share the same values might get passed through.&lt;br /&gt;
&lt;br /&gt;
=== Latching Signal Switch ===&lt;br /&gt;
[[File:Factorio latching signal switch edit.png|430px|border|left|alt=Combinator settings for a latching signal switch that manages metallic asteroid processing]]&lt;br /&gt;
* This type of circuit expands on the simple signal switch by making the decider act as an SR (set/reset) latch as well as a signal switch.&lt;br /&gt;
* Adding latching helps prevent machines from flickering on and off, and recipes from switching wildly due to changing conditions.&lt;br /&gt;
* For this, the decider&#039;s output is connected to its input via the wire NOT connected to the constant combinator. This allows us to use the decider&#039;s current output as part of our logic.&lt;br /&gt;
* Each separate recipe needs two blocks: the &amp;quot;set&amp;quot; conditions, or &amp;quot;when do we turn the latch on,&amp;quot; and the &amp;quot;reset&amp;quot; conditions, or &amp;quot;when do we turn the latch off.&amp;quot;&lt;br /&gt;
* For the example shown here, the latch for advanced metallic asteroid processing is &#039;&#039;set&#039;&#039; when there is less than 80 copper ore on the output belts ({{Icon|Copper ore}} &amp;lt; 80).&lt;br /&gt;
* The second group of conditionals keeps the latch on until the reset condition - {{Icon|copper ore}} ≥ 300 - is reached. Because the &#039;&#039;set&#039;&#039; condition makes the decider start outputting the {{Icon|Advanced metallic asteroid crushing}} signal, then that makes the second block of conditionals true until {{Icon|copper ore}} reaches 300.  Once there are 300 copper ore on the belt, neither of the {{Icon|Advanced metallic asteroid crushing}} conditions will be true, and the latch will &#039;&#039;reset&#039;&#039;.&lt;br /&gt;
* The next two blocks are a latch for basic metallic asteroid processing. In this case, the &#039;&#039;set&#039;&#039; condition is {{Icon|Iron ore}} &amp;lt; 120 AND {{Icon|Advanced metallic asteroid crushing}} = 0. The check for {{Icon|Advanced metallic asteroid crushing}} ensures that we do not have both latches on at once. It&#039;s up to you to define the priority of possible output signals by adding similar checks. So for basic processing, the latch can be &#039;&#039;reset&#039;&#039; by two things: either {{Icon|Iron ore}} reaching 500+, or by the {{Icon|Advanced metallic asteroid crushing}} latch turning on.&lt;br /&gt;
* Pay close attention to which wires you&#039;re using for each condition. Always be as restrictive as possible.&lt;br /&gt;
&lt;br /&gt;
== See Also ==&lt;br /&gt;
* [[Arithmetic combinator]]&lt;br /&gt;
* [[Constant combinator]]&lt;br /&gt;
* [[Decider combinator]]&lt;br /&gt;
* [[Circuit network]]&lt;/div&gt;</summary>
		<author><name>Untitled7</name></author>
	</entry>
	<entry>
		<id>https://wiki.factorio.com/index.php?title=File:Circuit_network_cookbook_lamp_percentage_as_color_ramp.png&amp;diff=219968</id>
		<title>File:Circuit network cookbook lamp percentage as color ramp.png</title>
		<link rel="alternate" type="text/html" href="https://wiki.factorio.com/index.php?title=File:Circuit_network_cookbook_lamp_percentage_as_color_ramp.png&amp;diff=219968"/>
		<updated>2026-09-11T17:22:02Z</updated>

		<summary type="html">&lt;p&gt;Untitled7: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Untitled7</name></author>
	</entry>
	<entry>
		<id>https://wiki.factorio.com/index.php?title=File:Circuit_network_cookbook_lamp_as_counter.png&amp;diff=219967</id>
		<title>File:Circuit network cookbook lamp as counter.png</title>
		<link rel="alternate" type="text/html" href="https://wiki.factorio.com/index.php?title=File:Circuit_network_cookbook_lamp_as_counter.png&amp;diff=219967"/>
		<updated>2026-09-11T17:19:59Z</updated>

		<summary type="html">&lt;p&gt;Untitled7: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Untitled7</name></author>
	</entry>
	<entry>
		<id>https://wiki.factorio.com/index.php?title=Tutorial:Quality_upcycling_math&amp;diff=207011</id>
		<title>Tutorial:Quality upcycling math</title>
		<link rel="alternate" type="text/html" href="https://wiki.factorio.com/index.php?title=Tutorial:Quality_upcycling_math&amp;diff=207011"/>
		<updated>2024-11-24T11:54:48Z</updated>

		<summary type="html">&lt;p&gt;Untitled7: /* Number of crafting machines */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;How do we get the most amount of [[Quality|legendary]] items out of an upcycling plant?&lt;br /&gt;
&lt;br /&gt;
The answer is not quite as straight forward as we&#039;d like it to be, because it depends on a number of factors, luckily there is a finite number of possibilities of what the modules can be, and for the sake of simplicity this tutorial will ignore the productivity gain from [[Technologies#Space_Age|infinite technologies]]. But first, a presentation of the results.&lt;br /&gt;
&lt;br /&gt;
== Best ratios ==&lt;br /&gt;
The table below shows the best ratio for [[Quality module 3|quality]] to [[Productivity module 3|productivity modules]] in the crafting machines, while the [[Recycler|recyclers]] always take only quality modules. The values are not given in whole numbers because often it is not just a single crafting machine per tier that will be used, then the ratios can change between different crafting machines in the same tier. e.g. &amp;quot;3.67 quality / 1.33 productivity&amp;quot; could have 4 machines where 3 have a ratio 4 to 1, and one a ratio 3 to 2.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tabber&amp;gt;&lt;br /&gt;
common modules = &lt;br /&gt;
The columns &amp;quot;Modules for X items&amp;quot; denote which modules need to go into the machines that are set to produce items of X quality.&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Crafting machine || Modules for common items || Modules for uncommon items || Modules for rare items  || Modules for epic || Modules for legendary || Percentage yield || Items recycled*&lt;br /&gt;
|-&lt;br /&gt;
| Chemical plant || 3 quality &amp;lt;br /&amp;gt;0 productivity || 3 quality &amp;lt;br /&amp;gt;0 productivity || 3 quality &amp;lt;br /&amp;gt;0 productivity || 3 quality &amp;lt;br /&amp;gt;0 productivity  || 0 quality &amp;lt;br /&amp;gt;3 productivity || 0.034014% || 2940&lt;br /&gt;
|-&lt;br /&gt;
| Assembling machine 3 || 4 quality &amp;lt;br /&amp;gt;0 productivity || 4 quality &amp;lt;br /&amp;gt;0 productivity || 4 quality &amp;lt;br /&amp;gt;0 productivity || 4 quality &amp;lt;br /&amp;gt;0 productivity  || 0 quality &amp;lt;br /&amp;gt;4 productivity || 0.046275% || 2161&lt;br /&gt;
|-&lt;br /&gt;
| Foundry || 4 quality &amp;lt;br /&amp;gt;0 productivity || 4 quality &amp;lt;br /&amp;gt;0 productivity || 4 quality &amp;lt;br /&amp;gt;0 productivity || 4 quality &amp;lt;br /&amp;gt;0 productivity  || 0 quality &amp;lt;br /&amp;gt;4 productivity || 0.133814% || 747&lt;br /&gt;
|-&lt;br /&gt;
| Electromagnetic plant || 5 quality &amp;lt;br /&amp;gt;0 productivity || 5 quality &amp;lt;br /&amp;gt;0 productivity || 5 quality &amp;lt;br /&amp;gt;0 productivity || 5 quality &amp;lt;br /&amp;gt;0 productivity  || 0 quality &amp;lt;br /&amp;gt;5 productivity || 0.176712% || 566&lt;br /&gt;
|-&lt;br /&gt;
| Cryogenic plant || 6 quality &amp;lt;br /&amp;gt;2 productivity || 6 quality &amp;lt;br /&amp;gt;2 productivity || 6 quality &amp;lt;br /&amp;gt;2 productivity || 6.5 quality &amp;lt;br /&amp;gt;1.5 productivity  || 0 quality &amp;lt;br /&amp;gt;8 productivity || 0.119134%|| 840&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;nowiki&amp;gt;*&amp;lt;/nowiki&amp;gt; &amp;quot;items recycled&amp;quot; quantifies how many items need to be crafted and put into the entire upcycler to yield a single legendary item, it doesn&#039;t account for those which get recycled multiple times.&lt;br /&gt;
\-\&lt;br /&gt;
uncommon modules = &lt;br /&gt;
The columns &amp;quot;Modules for X items&amp;quot; denote which modules need to go into the machines that are set to produce items of X quality.&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Crafting machine || Modules for common items || Modules for uncommon items || Modules for rare items  || Modules for epic || Modules for legendary || Percentage yield || Items recycled*&lt;br /&gt;
|-&lt;br /&gt;
| Chemical plant || 3 quality &amp;lt;br /&amp;gt;0 productivity || 3 quality &amp;lt;br /&amp;gt;0 productivity || 3 quality &amp;lt;br /&amp;gt;0 productivity || 3 quality &amp;lt;br /&amp;gt;0 productivity  || 0 quality &amp;lt;br /&amp;gt;3 productivity || 0.059498% || 1681&lt;br /&gt;
|-&lt;br /&gt;
| Assembling machine 3 || 3.75 quality &amp;lt;br /&amp;gt;0.25 productivity || 3.75 quality &amp;lt;br /&amp;gt;0.25 productivity || 3.8 quality &amp;lt;br /&amp;gt;0.2 productivity || 3.9 quality &amp;lt;br /&amp;gt;0.1 productivity  || 0 quality &amp;lt;br /&amp;gt;4 productivity || 0.082296% || 1216&lt;br /&gt;
|-&lt;br /&gt;
| Foundry || 4 quality &amp;lt;br /&amp;gt;0 productivity || 4 quality &amp;lt;br /&amp;gt;0 productivity || 4 quality &amp;lt;br /&amp;gt;0 productivity || 4 quality &amp;lt;br /&amp;gt;0 productivity  || 0 quality &amp;lt;br /&amp;gt;4 productivity || 0.243699% || 410&lt;br /&gt;
|-&lt;br /&gt;
| Electromagnetic plant || 4.7 quality &amp;lt;br /&amp;gt;0.3 productivity || 4.67 quality &amp;lt;br /&amp;gt;0.33 productivity || 4.75 quality &amp;lt;br /&amp;gt;0.25 productivity || 4.9 quality &amp;lt;br /&amp;gt;0.1 productivity  || 0 quality &amp;lt;br /&amp;gt;5 productivity || 0.324189% || 309&lt;br /&gt;
|-&lt;br /&gt;
| Cryogenic plant || 4.6 quality &amp;lt;br /&amp;gt;3.4 productivity || 4.6 quality &amp;lt;br /&amp;gt;3.4 productivity || 4.67 quality &amp;lt;br /&amp;gt;3.33 productivity  || 5 quality &amp;lt;br /&amp;gt;3 productivity  || 0 quality &amp;lt;br /&amp;gt;8 productivity || 0.257621% || 389&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;nowiki&amp;gt;*&amp;lt;/nowiki&amp;gt; &amp;quot;items recycled&amp;quot; quantifies how many items need to be crafted and put into the entire upcycler to yield a single legendary item, it doesn&#039;t account for those which get recycled multiple times.&lt;br /&gt;
\-\&lt;br /&gt;
rare modules = &lt;br /&gt;
The columns &amp;quot;Modules for X items&amp;quot; denote which modules need to go into the machines that are set to produce items of X quality.&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Crafting machine || Modules for common items || Modules for uncommon items || Modules for rare items  || Modules for epic || Modules for legendary || Percentage yield || Items recycled*&lt;br /&gt;
|-&lt;br /&gt;
| Chemical plant || 2.8 quality &amp;lt;br /&amp;gt;0.2 productivity || 2.8 quality &amp;lt;br /&amp;gt;0.2 productivity || 2.9 quality &amp;lt;br /&amp;gt;0.1 productivity || 2.9 quality &amp;lt;br /&amp;gt;0.1 productivity  || 0 quality &amp;lt;br /&amp;gt;3 productivity || 0.100660% || 994&lt;br /&gt;
|-&lt;br /&gt;
| Assembling machine 3 || 3 quality &amp;lt;br /&amp;gt;1 productivity || 3.1 quality &amp;lt;br /&amp;gt;0.9 productivity || 3.2 quality &amp;lt;br /&amp;gt;0.8 productivity || 3.33 quality &amp;lt;br /&amp;gt;0.67 productivity  || 0 quality &amp;lt;br /&amp;gt;4 productivity || 0.145220% || 689&lt;br /&gt;
|-&lt;br /&gt;
| Foundry || 3.5 quality &amp;lt;br /&amp;gt;0.5 productivity || 3.5 quality &amp;lt;br /&amp;gt;0.5 productivity || 3.6 quality &amp;lt;br /&amp;gt;0.4 productivity || 3.9 quality &amp;lt;br /&amp;gt;0.1 productivity  || 0 quality &amp;lt;br /&amp;gt;4 productivity || 0.424039% || 236&lt;br /&gt;
|-&lt;br /&gt;
| Electromagnetic plant || 3.6 quality &amp;lt;br /&amp;gt;1.4 productivity || 3.6 quality &amp;lt;br /&amp;gt;1.4 productivity || 3.6 quality &amp;lt;br /&amp;gt;1.4 productivity || 3.9 quality &amp;lt;br /&amp;gt;1.1 productivity  || 0 quality &amp;lt;br /&amp;gt;5 productivity || 0.588510% || 170&lt;br /&gt;
|-&lt;br /&gt;
| Cryogenic plant || 3.6 quality &amp;lt;br /&amp;gt;4.4 productivity || 3.6 quality &amp;lt;br /&amp;gt;4.4 productivity || 3.6 quality &amp;lt;br /&amp;gt;4.4 productivity  || 3.9 quality &amp;lt;br /&amp;gt;4.1 productivity  || 0 quality &amp;lt;br /&amp;gt;8 productivity || 0.565030% || 177&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;nowiki&amp;gt;*&amp;lt;/nowiki&amp;gt; &amp;quot;items recycled&amp;quot; quantifies how many items need to be crafted and put into the entire upcycler to yield a single legendary item, it doesn&#039;t account for those which get recycled multiple times.&lt;br /&gt;
\-\&lt;br /&gt;
epic modules = &lt;br /&gt;
The columns &amp;quot;Modules for X items&amp;quot; denote which modules need to go into the machines that are set to produce items of X quality.&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Crafting machine || Modules for common items || Modules for uncommon items || Modules for rare items  || Modules for epic || Modules for legendary || Percentage yield || Items recycled*&lt;br /&gt;
|-&lt;br /&gt;
| Chemical plant || 2.33 quality &amp;lt;br /&amp;gt;0.67 productivity || 2.4 quality &amp;lt;br /&amp;gt;0.6 productivity || 2.4 quality &amp;lt;br /&amp;gt;0.6 productivity || 2.4 quality &amp;lt;br /&amp;gt;0.6 productivity  || 0 quality &amp;lt;br /&amp;gt;3 productivity || 0.152486% || 656&lt;br /&gt;
|-&lt;br /&gt;
| Assembling machine 3 || 2.5 quality &amp;lt;br /&amp;gt;1.5 productivity || 2.5 quality &amp;lt;br /&amp;gt;1.5 productivity || 2.6 quality &amp;lt;br /&amp;gt;1.4 productivity || 2.8 quality &amp;lt;br /&amp;gt;1.2 productivity  || 0 quality &amp;lt;br /&amp;gt;4 productivity || 0.232966% || 430&lt;br /&gt;
|-&lt;br /&gt;
| Foundry || 2.7 quality &amp;lt;br /&amp;gt;1.3 productivity || 2.7 quality &amp;lt;br /&amp;gt;1.3 productivity || 2.75 quality &amp;lt;br /&amp;gt;1.25 productivity || 3 quality &amp;lt;br /&amp;gt;1 productivity  || 0 quality &amp;lt;br /&amp;gt;4 productivity || 0.664130% || 151&lt;br /&gt;
|-&lt;br /&gt;
| Electromagnetic plant || 2.6 quality &amp;lt;br /&amp;gt;2.4 productivity || 2.6 quality &amp;lt;br /&amp;gt;2.4 productivity || 2.67 quality &amp;lt;br /&amp;gt;2.33 productivity || 2.9 quality &amp;lt;br /&amp;gt;2.1 productivity  || 0 quality &amp;lt;br /&amp;gt;5 productivity || 0.974700% || 103&lt;br /&gt;
|-&lt;br /&gt;
| Cryogenic plant || 2.6 quality &amp;lt;br /&amp;gt;5.4 productivity || 2.6 quality &amp;lt;br /&amp;gt;5.4 productivity || 2.6 quality &amp;lt;br /&amp;gt;4.4 productivity  || 2.8 quality &amp;lt;br /&amp;gt;4.2 productivity  || 0 quality &amp;lt;br /&amp;gt;8 productivity || 1.122444% || 90&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;nowiki&amp;gt;*&amp;lt;/nowiki&amp;gt; &amp;quot;items recycled&amp;quot; quantifies how many items need to be crafted and put into the entire upcycler to yield a single legendary item, it doesn&#039;t account for those which get recycled multiple times.&lt;br /&gt;
\-\&lt;br /&gt;
legendary modules=&lt;br /&gt;
The columns &amp;quot;Modules for X items&amp;quot; denote which modules need to go into the machines that are set to produce items of X quality.&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Crafting machine || Modules for common items || Modules for uncommon items || Modules for rare items  || Modules for epic || Modules for legendary || Percentage yield || Items recycled*&lt;br /&gt;
|-&lt;br /&gt;
| Chemical plant || 1.67 quality &amp;lt;br /&amp;gt;1.33 productivity || 1.67 quality &amp;lt;br /&amp;gt;1.33 productivity || 1.67 quality &amp;lt;br /&amp;gt;1.333 productivity || 1.8 quality &amp;lt;br /&amp;gt;1.2 productivity  || 0 quality &amp;lt;br /&amp;gt;3 productivity || 0.344061% || 291&lt;br /&gt;
|-&lt;br /&gt;
| Assembling machine 3 || 1.67 quality &amp;lt;br /&amp;gt;2.33 productivity || 1.67 quality &amp;lt;br /&amp;gt;2.33 productivity || 1.67 quality &amp;lt;br /&amp;gt;2.33 productivity || 1.8 quality &amp;lt;br /&amp;gt;2.2 productivity  || 0 quality &amp;lt;br /&amp;gt;4 productivity || 0.586191% || 171&lt;br /&gt;
|-&lt;br /&gt;
| Foundry || 1.4 quality &amp;lt;br /&amp;gt;2.6 productivity || 1.4 quality &amp;lt;br /&amp;gt;2.6 productivity || 1.4 quality &amp;lt;br /&amp;gt;2.6 productivity || 1.5 quality &amp;lt;br /&amp;gt;2.5 productivity  || 0 quality &amp;lt;br /&amp;gt;4 productivity || 1.624266% || 62&lt;br /&gt;
|-&lt;br /&gt;
| Electromagnetic plant || 1 quality &amp;lt;br /&amp;gt;4 productivity || 1 quality &amp;lt;br /&amp;gt;4 productivity || 1 quality &amp;lt;br /&amp;gt;4 productivity || 1 quality &amp;lt;br /&amp;gt;4 productivity  || 0 quality &amp;lt;br /&amp;gt;5 productivity || 2.722332% || 37&lt;br /&gt;
|-&lt;br /&gt;
| Cryogenic plant || 0 quality &amp;lt;br /&amp;gt;8 productivity || 0 quality &amp;lt;br /&amp;gt;8 productivity || 0 quality &amp;lt;br /&amp;gt;8 productivity || 0 quality &amp;lt;br /&amp;gt;8 productivity  || 0 quality &amp;lt;br /&amp;gt;8 productivity || 4.835199% || 21&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;nowiki&amp;gt;*&amp;lt;/nowiki&amp;gt; &amp;quot;items recycled&amp;quot; quantifies how many items need to be crafted and put into the entire upcycler to yield a single legendary item, it doesn&#039;t account for those which get recycled multiple times.&lt;br /&gt;
&amp;lt;/tabber&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Number of crafting machines ===&lt;br /&gt;
If we assume a constant input stream of uncommon items, which will always fill back up, we can additionally figure out what ratio of items will be inside the system at once, and with that we can figure out how many crafting machines we need per tier of quality. This is done by setting &amp;lt;math&amp;gt;m_{1,k+1} = 100 \, \% - m_{2,k+1} - m_{3,k+1} - m_{4,k+1}&amp;lt;/math&amp;gt; after each iteration and further adjusting for the crafting machines change in speed dependant on the modules (assuming the machines which only house productivity modules are not additionally boosted by [[Speed module 3|speed moduled]] [[beacon]]s). See the calculations further below for a full explanation of the calculations.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tabber&amp;gt;&lt;br /&gt;
per recycler=&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Crafting machine || Recyclers || Machines producing common items || Machines producing uncommon items || Machines producing rare items || Machines producing epic items || Machines producing legendary items&lt;br /&gt;
|-&lt;br /&gt;
| Chemical plant || 1 || 4.418130519 || 0.037216657 || 1.294369664 || 0.009779 || 0.431955&lt;br /&gt;
|- &lt;br /&gt;
| Assembling machine 3 || 1 || 4.733868899 || 0.052316655 || 1.527502978 || 0.015336 || 0.52576&lt;br /&gt;
|- &lt;br /&gt;
| Foundry || 1 || 4.314446 || 0.082198 || 1.683088 || 0.03016 || 0.58448&lt;br /&gt;
|- &lt;br /&gt;
| Electromagnetic plant || 1 || 4.494435 || 0.116985 || 1.93479 || 0.049665 || 0.60795&lt;br /&gt;
|- &lt;br /&gt;
| Cryogenic plant || 1 || 5.23556 || 0.21384 || 2.53374 || 0.1034 || 0.594&lt;br /&gt;
|}&lt;br /&gt;
\-\&lt;br /&gt;
per legendary crafter (exact) =&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Crafting machine || Recyclers || Machines producing common items || Machines producing uncommon items || Machines producing rare items || Machines producing epic items || Machines producing legendary items&lt;br /&gt;
|-&lt;br /&gt;
| Chemical plant || 90.1223 || 331.8198 || 38.5325 || 11.2893 || 2.9653 || 1&lt;br /&gt;
|- &lt;br /&gt;
| Assembling machine 3 || 52.8432 || 208.4632 || 30.3992 || 9.8094 || 2.8783 || 1&lt;br /&gt;
|- &lt;br /&gt;
| Foundry || 24.7668 || 89.0483 || 19.9206 || 7.7712 || 2.8592 || 1&lt;br /&gt;
|- &lt;br /&gt;
| Electromagnetic plant || 16.5379 || 61.9418 || 17.4010 || 7.4908 || 3.1822 || 1&lt;br /&gt;
|- &lt;br /&gt;
| Cryogenic plant || 10.8718 || 47.4350 || 18.2124 || 8.8138 || 4.2654 || 1&lt;br /&gt;
|}&lt;br /&gt;
\-\&lt;br /&gt;
per legendary crafter (conservative)=&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Crafting machine || Recyclers || Machines producing common items || Machines producing uncommon items || Machines producing rare items || Machines producing epic items || Machines producing legendary items&lt;br /&gt;
|-&lt;br /&gt;
| Chemical plant || 53 || 198 || 23 || 7 || 2 || 1&lt;br /&gt;
|-&lt;br /&gt;
| Assembling machine 3 || 31 || 123 || 18 || 6 || 2 || 1&lt;br /&gt;
|-&lt;br /&gt;
| Foundry || 14 || 53 || 12 || 5 || 2 || 1&lt;br /&gt;
|-&lt;br /&gt;
| Electromagnetic plant || 14 || 56 || 16 || 7 || 3 || 1&lt;br /&gt;
|-&lt;br /&gt;
| Cryogenic plant || 9 || 41 || 16 || 8 || 4 || 1&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;/tabber&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== The crafting machines ==&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Crafting machine || Module slots &amp;lt;math&amp;gt;N&amp;lt;/math&amp;gt; || Base productivity bonus &amp;lt;math&amp;gt;p_0&amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| [[Chemical plant]] || 3 || +0%&lt;br /&gt;
|-&lt;br /&gt;
| [[Assembling machine 3]] || 4 || +0%&lt;br /&gt;
|-&lt;br /&gt;
| [[Foundry]] || 4 || +50%&lt;br /&gt;
|-&lt;br /&gt;
| [[Electromagnetic plant]] || 5 || +50%&lt;br /&gt;
|-&lt;br /&gt;
| [[Cryogenic plant]] || 8 || +0%&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Quality probability ==&lt;br /&gt;
When an item gets produced and the initial roll decides that the quality of the item will increase, there is a 90% chance it will rise one tier, a 9% chance it will rise two, a 0.9% chance it will rise three, and a 0.1% chance it will rise four. This is of course capped if the item already started out at a higher tier.&lt;br /&gt;
&lt;br /&gt;
== Mathematical model ==&lt;br /&gt;
The mathematical model is time discrete. As opposed to dealing with derivatives in respect to time, the next state is a direct function of the previous state.&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;math&amp;gt;m_{i,k}&amp;lt;/math&amp;gt; ... Number of materials of tier &amp;lt;math&amp;gt;i&amp;lt;/math&amp;gt; (whereas 1 is common, 2 is uncommon, 3 is rare, 4 is epic, and 5 is legendary) after the &amp;lt;math&amp;gt;k&amp;lt;/math&amp;gt;-th iteration before being crafted. (this doesn&#039;t mean that an item only needs one type of ingredient, but that &amp;quot;1 materials&amp;quot; can be crafted into 1 item from them)&lt;br /&gt;
* &amp;lt;math&amp;gt;n_{i,k}&amp;lt;/math&amp;gt; ... Number of items of tier &amp;lt;math&amp;gt;i&amp;lt;/math&amp;gt; after the &amp;lt;math&amp;gt;k&amp;lt;/math&amp;gt;-th iteration, after being crafted together.&lt;br /&gt;
* &amp;lt;math&amp;gt;p_0&amp;lt;/math&amp;gt; ... the crafting machines inherent productivity bonus&lt;br /&gt;
* &amp;lt;math&amp;gt;N&amp;lt;/math&amp;gt; ... number of modules the crafting machine can hold&lt;br /&gt;
* &amp;lt;math&amp;gt;q_r = 4 \cdot 6.2 \, \% = 0.248&amp;lt;/math&amp;gt; ... quality probability of the recyclers with 4 [[quality module 3]]&#039;s (6.2% is the chance of a legendary tier quality module 3)&lt;br /&gt;
* &amp;lt;math&amp;gt;p_i = p_0 + x_i \cdot 25 \, \%&amp;lt;/math&amp;gt; ... productivity due to &amp;lt;math&amp;gt;x_i&amp;lt;/math&amp;gt; legendary [[productivity module 3]]&#039;s in the crafting machine which takes &amp;lt;math&amp;gt;i&amp;lt;/math&amp;gt;-tier materials (25% is the productivity boost of a legendary tier productivity module 3)&lt;br /&gt;
* &amp;lt;math&amp;gt;q_i = (N-x_i) \cdot 6.2 \, \%&amp;lt;/math&amp;gt; ... quality probability due to &amp;lt;math&amp;gt;(N - x_i)&amp;lt;/math&amp;gt; legendary quality module 3&#039;s in the crafting machine which takes &amp;lt;math&amp;gt;i&amp;lt;/math&amp;gt;-tier materials&lt;br /&gt;
&lt;br /&gt;
=== Recycled materials ===&lt;br /&gt;
When a quarter of all items being recycled and the quality probability rules, we can write the equations for the amount of materials received after recycling. This calculation is rather simple, as uncommon items can only come forth from uncommon material failing to raise in quality. The second tier are 90% of tier 1 items that did increase, and all those tier 2 items that didn&#039;t. This continues for all tiers as follows, but legendary items &amp;lt;math&amp;gt;n_{5,k}&amp;lt;/math&amp;gt; will not be recycled&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\begin{align}&lt;br /&gt;
\text{common material:}\quad m_{1,k+1} &amp;amp;= \frac{n_{1,k}}{4} \cdot (1 - q_r)\\&lt;br /&gt;
\text{uncommon material:}\quad m_{2,k+1} &amp;amp;= \frac{n_{1,k}}{4} \cdot q_r \cdot 0.9 &amp;amp;+&amp;amp; \frac{n_{2,k}}{4} \cdot (1 - q_r)\\&lt;br /&gt;
\text{rare material:}\quad m_{3,k+1} &amp;amp;= \frac{n_{1,k}}{4} \cdot q_r \cdot 0.09 &amp;amp;+&amp;amp; \frac{n_{2,k}}{4} \cdot q_r \cdot 0.9 &amp;amp;+&amp;amp; \frac{n_{3,k}}{4} \cdot (1 - q_r)\\&lt;br /&gt;
\text{epic material:}\quad m_{4,k+1} &amp;amp;= \frac{n_{1,k}}{4} \cdot q_r \cdot 0.009 &amp;amp;+&amp;amp; \frac{n_{2,k}}{4} \cdot q_r \cdot 0.09 &amp;amp;+&amp;amp; \frac{n_{3,k}}{4} \cdot q_r \cdot 0.9 &amp;amp;+&amp;amp; \frac{n_{4,k}}{4} \cdot (1 - q_r)\\&lt;br /&gt;
\text{legendary material:}\quad m_{5,k+1} &amp;amp;= \frac{n_{1,k}}{4} \cdot q_r \cdot 0.001 &amp;amp;+&amp;amp; \frac{n_{2,k}}{4} \cdot q_r \cdot 0.01 &amp;amp;+&amp;amp; \frac{n_{3,k}}{4} \cdot q_r \cdot 0.1 &amp;amp;+&amp;amp; \frac{n_{4,k}}{4} \cdot q_r\\&lt;br /&gt;
\end{align}&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
which can also be written as a vector-matrix-multiplication &amp;lt;math&amp;gt;\textbf{m}_{k+1} = \textbf{A} \,\textbf{n}_k&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\underbrace{\begin{bmatrix} m_{1,k+1}\\ m_{2,k+1}\\ m_{3,k+1}\\ m_{4,k+1}\\ m_{5,k+1}\\ \end{bmatrix}}_{\textbf{m}_{k+1}}&lt;br /&gt;
=&lt;br /&gt;
\underbrace{\begin{bmatrix}&lt;br /&gt;
\frac{1 - q_r}{4} &amp;amp; 0 &amp;amp; 0 &amp;amp; 0 &amp;amp; 0\\&lt;br /&gt;
\frac{0.9 \, q_r}{4}   &amp;amp; \frac{1 - q_r}{4} &amp;amp; 0 &amp;amp; 0 &amp;amp; 0\\&lt;br /&gt;
\frac{0.09 \, q_r}{4}  &amp;amp; \frac{0.9 \, q_r}{4}  &amp;amp; \frac{1 - q_r}{4} &amp;amp; 0 &amp;amp; 0 \\&lt;br /&gt;
\frac{0.009 \, q_r}{4} &amp;amp; \frac{0.09 \, q_r}{4} &amp;amp; \frac{0.9 \, q_r}{4} &amp;amp; \frac{1 - q_r}{4} &amp;amp; 0\\&lt;br /&gt;
\frac{0.001 \, q_r}{4} &amp;amp; \frac{0.01 \, q_r}{4} &amp;amp; \frac{0.1 \, q_r}{4} &amp;amp; \frac{q_r}{4} &amp;amp; 0\\&lt;br /&gt;
\end{bmatrix}}_{\textbf{A}}&lt;br /&gt;
\underbrace{\begin{bmatrix} n_{1,k}\\ n_{2,k}\\ n_{3,k}\\ n_{4,k}\\ n_{5,k}\\ \end{bmatrix}}_{\textbf{n}_k}&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As we assume there is nothing to be done about recyclers to make them more effective but fill them with all quality modules, the value of &amp;lt;math&amp;gt;q_r = 0.248&amp;lt;/math&amp;gt; is a constant, and therefore the matrix &amp;lt;math&amp;gt;\textbf{A}&amp;lt;/math&amp;gt; is also a constant. For legendary quality module 3&#039;s, it looks like:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \textbf{A} = &lt;br /&gt;
\begin{bmatrix}&lt;br /&gt;
0.188 &amp;amp; 0 &amp;amp; 0 &amp;amp; 0 &amp;amp; 0 \\&lt;br /&gt;
0.055\,8 &amp;amp; 0.188 &amp;amp; 0 &amp;amp; 0 &amp;amp; 0 \\&lt;br /&gt;
0.005\,58 &amp;amp; 0.055\,8 &amp;amp; 0.188 &amp;amp; 0 &amp;amp; 0 \\&lt;br /&gt;
0.000\,558 &amp;amp; 0.005\,58 &amp;amp; 0.055\,8 &amp;amp; 0.188 &amp;amp; 0 \\&lt;br /&gt;
0.000\,062 &amp;amp; 0.000\,62 &amp;amp; 0.006\,2 &amp;amp; 0.062 &amp;amp; 0 \\&lt;br /&gt;
\end{bmatrix}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Recrafted items ===&lt;br /&gt;
Once more we first check how many items are produced, which is, again, the sum of all possible ways to get to a tier, this time adding productivity &amp;lt;math&amp;gt;p_i&amp;lt;/math&amp;gt;, and bringing along all those items which are already legendary &amp;lt;math&amp;gt;n_{5,k}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\begin{align}&lt;br /&gt;
\text{common item:}\quad n_{1,k+1} &amp;amp;= m_{1,k+1} \cdot ( 1 + p_1 ) \cdot (1 - q_1)\\&lt;br /&gt;
\text{uncommon items:}\quad n_{2,k+1} &amp;amp;= m_{1,k+1} \cdot ( 1 + p_1 ) \cdot q_1 \cdot 0.9 &amp;amp;+&amp;amp;  m_{2,k+1} \cdot ( 1 + p_2 ) \cdot (1 - q_2)\\&lt;br /&gt;
\text{rare items:}\quad n_{3,k+1} &amp;amp;= m_{1,k+1} \cdot ( 1 + p_1 ) \cdot q_1 \cdot 0.09 &amp;amp;+&amp;amp;  m_{2,k+1} \cdot ( 1 + p_2 ) \cdot q_2 \cdot 0.9 &amp;amp;+&amp;amp; m_{3,k+1} \cdot ( 1 + p_3 ) \cdot (1 - q_3) \\&lt;br /&gt;
\text{epic items:}\quad n_{4,k+1} &amp;amp;= m_{1,k+1} \cdot ( 1 + p_1 ) \cdot q_1 \cdot 0.009 &amp;amp;+&amp;amp;  m_{2,k+1} \cdot ( 1 + p_2 ) \cdot q_2 \cdot 0.09 &amp;amp;+&amp;amp; m_{3,k+1} \cdot ( 1 + p_3 ) \cdot q_3 \cdot 0.9  &amp;amp;+&amp;amp; m_{4,k+1} \cdot ( 1 + p_4) \cdot (1 - q_4) \\&lt;br /&gt;
\text{legendary items:}\quad n_{5,k+1} &amp;amp;= m_{1,k+1} \cdot ( 1 + p_1 ) \cdot q_1 \cdot 0.001 &amp;amp;+&amp;amp;  m_{2,k+1} \cdot ( 1 + p_2 ) \cdot q_2 \cdot 0.01 &amp;amp;+&amp;amp; m_{3,k+1} \cdot ( 1 + p_3 ) \cdot q_3 \cdot 0.1  &amp;amp;+&amp;amp; m_{4,k+1} \cdot ( 1 + p_4) \cdot q_4 &amp;amp;+&amp;amp; m_{5,k+1} \cdot ( 1 + p_5) + n_{5,k}\\&lt;br /&gt;
\end{align}&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This can once more be written as a vector-matrix-multiplication &amp;lt;math&amp;gt;\textbf{n}_{k+1} = \textbf{B} \,\textbf{m}_{k+1} + \textbf{C} \,\textbf{n}_{k}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\underbrace{\begin{bmatrix} n_{1,k+1}\\ n_{2,k+1}\\ n_{3,k+1}\\ n_{4,k+1}\\ n_{5,k+1}\\ \end{bmatrix}}_{\textbf{n}_{k+1}} = &lt;br /&gt;
\underbrace{\begin{bmatrix}&lt;br /&gt;
( 1 + p_1 ) \cdot (1 - q_1) &amp;amp; 0 &amp;amp; 0 &amp;amp; 0 &amp;amp; 0 \\&lt;br /&gt;
( 1 + p_1 ) \cdot q_1 \cdot 0.9 &amp;amp;  ( 1 + p_2 ) \cdot (1 - q_2) &amp;amp; 0 &amp;amp; 0 &amp;amp; 0 \\&lt;br /&gt;
( 1 + p_1 ) \cdot q_1 \cdot 0.09 &amp;amp; ( 1 + p_2 ) \cdot q_2 \cdot 0.9 &amp;amp; ( 1 + p_3 ) \cdot (1 - q_3) &amp;amp; 0 &amp;amp; 0 \\&lt;br /&gt;
( 1 + p_1 ) \cdot q_1 \cdot 0.009 &amp;amp; ( 1 + p_2 ) \cdot q_2 \cdot 0.09 &amp;amp; ( 1 + p_3 ) \cdot q_3 \cdot 0.9  &amp;amp; ( 1 + p_4) \cdot (1 - q_4) &amp;amp; 0 \\&lt;br /&gt;
( 1 + p_1 ) \cdot q_1 \cdot 0.001 &amp;amp; ( 1 + p_2 ) \cdot q_2 \cdot 0.01 &amp;amp; ( 1 + p_3 ) \cdot q_3 \cdot 0.1  &amp;amp; ( 1 + p_4) \cdot q_4 &amp;amp; ( 1 + p_5)\\&lt;br /&gt;
\end{bmatrix}}_{B}&lt;br /&gt;
\underbrace{\begin{bmatrix} m_{1,k+1}\\ m_{2,k+1}\\ m_{3,k+1}\\ m_{4,k+1}\\ m_{5,k+1}\\ \end{bmatrix}}_{\textbf{m}_{k+1}}&lt;br /&gt;
+&lt;br /&gt;
\underbrace{\begin{bmatrix}&lt;br /&gt;
0&amp;amp;0&amp;amp;0&amp;amp;0\\&lt;br /&gt;
0&amp;amp;0&amp;amp;0&amp;amp;0\\&lt;br /&gt;
0&amp;amp;0&amp;amp;0&amp;amp;0\\&lt;br /&gt;
0&amp;amp;0&amp;amp;0&amp;amp;0\\&lt;br /&gt;
0&amp;amp;0&amp;amp;0&amp;amp;1\\&lt;br /&gt;
\end{bmatrix}}_{\textbf{C}}&lt;br /&gt;
\underbrace{\begin{bmatrix} n_{1,k}\\ n_{2,k}\\ n_{3,k}\\ n_{4,k}\\ n_{5,k}\\ \end{bmatrix}}_{\textbf{n}_k}&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Combined model ===&lt;br /&gt;
&lt;br /&gt;
As such we gain an equation for the amount of items for every tier after any amount of iterations&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\begin{align}&lt;br /&gt;
\textbf{n}_{k+1} &lt;br /&gt;
    &amp;amp;= \textbf{B} \, \textbf{m}_{k+1} + \textbf{C} \, \textbf{n}_{k}\\&lt;br /&gt;
    &amp;amp;= \textbf{B} \, \textbf{A} \,\textbf{n}_{k} + \textbf{C} \, \textbf{n}_{k}\\&lt;br /&gt;
    &amp;amp;= (\textbf{B} \, \textbf{A} +\textbf{C} ) \, \textbf{n}_{k}\\&lt;br /&gt;
    &amp;amp;= \textbf{M} \, \textbf{n}_{k}\\&lt;br /&gt;
\textbf{n}_{k+2} &amp;amp;= \textbf{Q} \, \textbf{n}_{k+1} = \textbf{Q} \,  \textbf{Q} \, \textbf{n}_{k} = \textbf{Q}^2 \, \textbf{n}_{k}\\&lt;br /&gt;
&amp;amp;\vdots\\&lt;br /&gt;
\textbf{n}_k &amp;amp;= \textbf{Q}^k \, \textbf{n}_0\\&lt;br /&gt;
\end{align}&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
A realistic starting point for &amp;lt;math&amp;gt;\textbf{n}_0&amp;lt;/math&amp;gt; is only items in tier 1, and if we do not care for any other tiers, we simply choose sufficiently large &amp;lt;math&amp;gt;k = 100&amp;lt;/math&amp;gt;, and, through numeric means, try to maximize a single value. &amp;lt;math&amp;gt;q_{100,\text{crit}}&amp;lt;/math&amp;gt;, which falls in the fifth row, first column, of the Matrix &amp;lt;math&amp;gt;\textbf{Q}&amp;lt;/math&amp;gt; raised to the 100th power.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\begin{align}&lt;br /&gt;
\textbf{n}_k &amp;amp;= Q^k \, \textbf{n}_0\\&lt;br /&gt;
\begin{bmatrix}*\\ *\\ *\\ *\\ n_{5,100} \end{bmatrix} &amp;amp;= &lt;br /&gt;
\begin{bmatrix}&lt;br /&gt;
 * &amp;amp; * &amp;amp; * &amp;amp; * \\&lt;br /&gt;
 * &amp;amp; * &amp;amp; * &amp;amp; * \\&lt;br /&gt;
 * &amp;amp; * &amp;amp; * &amp;amp; * \\&lt;br /&gt;
 * &amp;amp; * &amp;amp; * &amp;amp; * \\&lt;br /&gt;
q_{100,\text{crit}} &amp;amp; * &amp;amp; * &amp;amp; * \\&lt;br /&gt;
\end{bmatrix} \begin{bmatrix}n_{1,0}\\ *\\ *\\ *\\ * \end{bmatrix}\\&lt;br /&gt;
\end{align}&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The choice of optimization method (simplex, branch and bound, etc.) itself is irrelevant, although most software will want the problem to be stated in a way so it can find a minimum, and may require the proper guard rails as to not pick values below 0 or higher than the maximum number of allowed modules.&lt;/div&gt;</summary>
		<author><name>Untitled7</name></author>
	</entry>
	<entry>
		<id>https://wiki.factorio.com/index.php?title=Tutorial:Quality_upcycling_math&amp;diff=207002</id>
		<title>Tutorial:Quality upcycling math</title>
		<link rel="alternate" type="text/html" href="https://wiki.factorio.com/index.php?title=Tutorial:Quality_upcycling_math&amp;diff=207002"/>
		<updated>2024-11-23T22:06:08Z</updated>

		<summary type="html">&lt;p&gt;Untitled7: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;How do we get the most amount of [[Quality|legendary]] items out of an upcycling plant?&lt;br /&gt;
&lt;br /&gt;
The answer is not quite as straight forward as we&#039;d like it to be, because it depends on a number of factors, luckily there is a finite number of possibilities of what the modules can be, and for the sake of simplicity this tutorial will ignore the productivity gain from [[Technologies#Space_Age|infinite technologies]]. But first, a presentation of the results.&lt;br /&gt;
&lt;br /&gt;
== Best ratios ==&lt;br /&gt;
The table below shows the best ratio for [[Quality module 3|quality]] to [[Productivity module 3|productivity modules]] in the crafting machines, while the [[Recycler|recyclers]] always take only quality modules. The values are not given in whole numbers because often it is not just a single crafting machine per tier that will be used, then the ratios can change between different crafting machines in the same tier. e.g. &amp;quot;3.67 quality / 1.33 productivity&amp;quot; could have 4 machines where 3 have a ratio 4 to 1, and one a ratio 3 to 2.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tabber&amp;gt;&lt;br /&gt;
common modules = &lt;br /&gt;
The columns &amp;quot;Modules for X items&amp;quot; denote which modules need to go into the machines that are set to produce items of X quality.&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Crafting machine || Modules for common items || Modules for uncommon items || Modules for rare items  || Modules for epic || Modules for legendary || Percentage yield || Items recycled*&lt;br /&gt;
|-&lt;br /&gt;
| Chemical plant || 3 quality &amp;lt;br /&amp;gt;0 productivity || 3 quality &amp;lt;br /&amp;gt;0 productivity || 3 quality &amp;lt;br /&amp;gt;0 productivity || 3 quality &amp;lt;br /&amp;gt;0 productivity  || 0 quality &amp;lt;br /&amp;gt;3 productivity || 0.034014% || 2940&lt;br /&gt;
|-&lt;br /&gt;
| Assembling machine 3 || 4 quality &amp;lt;br /&amp;gt;0 productivity || 4 quality &amp;lt;br /&amp;gt;0 productivity || 4 quality &amp;lt;br /&amp;gt;0 productivity || 4 quality &amp;lt;br /&amp;gt;0 productivity  || 0 quality &amp;lt;br /&amp;gt;4 productivity || 0.046275% || 2161&lt;br /&gt;
|-&lt;br /&gt;
| Foundry || 4 quality &amp;lt;br /&amp;gt;0 productivity || 4 quality &amp;lt;br /&amp;gt;0 productivity || 4 quality &amp;lt;br /&amp;gt;0 productivity || 4 quality &amp;lt;br /&amp;gt;0 productivity  || 0 quality &amp;lt;br /&amp;gt;4 productivity || 0.133814% || 747&lt;br /&gt;
|-&lt;br /&gt;
| Electromagnetic plant || 5 quality &amp;lt;br /&amp;gt;0 productivity || 5 quality &amp;lt;br /&amp;gt;0 productivity || 5 quality &amp;lt;br /&amp;gt;0 productivity || 5 quality &amp;lt;br /&amp;gt;0 productivity  || 0 quality &amp;lt;br /&amp;gt;5 productivity || 0.176712% || 566&lt;br /&gt;
|-&lt;br /&gt;
| Cryogenic plant || 6 quality &amp;lt;br /&amp;gt;2 productivity || 6 quality &amp;lt;br /&amp;gt;2 productivity || 6 quality &amp;lt;br /&amp;gt;2 productivity || 6.5 quality &amp;lt;br /&amp;gt;1.5 productivity  || 0 quality &amp;lt;br /&amp;gt;8 productivity || 0.119134%|| 840&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;nowiki&amp;gt;*&amp;lt;/nowiki&amp;gt; &amp;quot;items recycled&amp;quot; quantifies how many items need to be crafted and put into the entire upcycler to yield a single legendary item, it doesn&#039;t account for those which get recycled multiple times.&lt;br /&gt;
\-\&lt;br /&gt;
uncommon modules = &lt;br /&gt;
The columns &amp;quot;Modules for X items&amp;quot; denote which modules need to go into the machines that are set to produce items of X quality.&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Crafting machine || Modules for common items || Modules for uncommon items || Modules for rare items  || Modules for epic || Modules for legendary || Percentage yield || Items recycled*&lt;br /&gt;
|-&lt;br /&gt;
| Chemical plant || 3 quality &amp;lt;br /&amp;gt;0 productivity || 3 quality &amp;lt;br /&amp;gt;0 productivity || 3 quality &amp;lt;br /&amp;gt;0 productivity || 3 quality &amp;lt;br /&amp;gt;0 productivity  || 0 quality &amp;lt;br /&amp;gt;3 productivity || 0.059498% || 1681&lt;br /&gt;
|-&lt;br /&gt;
| Assembling machine 3 || 3.75 quality &amp;lt;br /&amp;gt;0.25 productivity || 3.75 quality &amp;lt;br /&amp;gt;0.25 productivity || 3.8 quality &amp;lt;br /&amp;gt;0.2 productivity || 3.9 quality &amp;lt;br /&amp;gt;0.1 productivity  || 0 quality &amp;lt;br /&amp;gt;4 productivity || 0.082296% || 1216&lt;br /&gt;
|-&lt;br /&gt;
| Foundry || 4 quality &amp;lt;br /&amp;gt;0 productivity || 4 quality &amp;lt;br /&amp;gt;0 productivity || 4 quality &amp;lt;br /&amp;gt;0 productivity || 4 quality &amp;lt;br /&amp;gt;0 productivity  || 0 quality &amp;lt;br /&amp;gt;4 productivity || 0.243699% || 410&lt;br /&gt;
|-&lt;br /&gt;
| Electromagnetic plant || 4.7 quality &amp;lt;br /&amp;gt;0.3 productivity || 4.67 quality &amp;lt;br /&amp;gt;0.33 productivity || 4.75 quality &amp;lt;br /&amp;gt;0.25 productivity || 4.9 quality &amp;lt;br /&amp;gt;0.1 productivity  || 0 quality &amp;lt;br /&amp;gt;5 productivity || 0.324189% || 309&lt;br /&gt;
|-&lt;br /&gt;
| Cryogenic plant || 4.6 quality &amp;lt;br /&amp;gt;3.4 productivity || 4.6 quality &amp;lt;br /&amp;gt;3.4 productivity || 4.67 quality &amp;lt;br /&amp;gt;3.33 productivity  || 5 quality &amp;lt;br /&amp;gt;3 productivity  || 0 quality &amp;lt;br /&amp;gt;8 productivity || 0.257621% || 389&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;nowiki&amp;gt;*&amp;lt;/nowiki&amp;gt; &amp;quot;items recycled&amp;quot; quantifies how many items need to be crafted and put into the entire upcycler to yield a single legendary item, it doesn&#039;t account for those which get recycled multiple times.&lt;br /&gt;
\-\&lt;br /&gt;
rare modules = &lt;br /&gt;
The columns &amp;quot;Modules for X items&amp;quot; denote which modules need to go into the machines that are set to produce items of X quality.&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Crafting machine || Modules for common items || Modules for uncommon items || Modules for rare items  || Modules for epic || Modules for legendary || Percentage yield || Items recycled*&lt;br /&gt;
|-&lt;br /&gt;
| Chemical plant || 2.8 quality &amp;lt;br /&amp;gt;0.2 productivity || 2.8 quality &amp;lt;br /&amp;gt;0.2 productivity || 2.9 quality &amp;lt;br /&amp;gt;0.1 productivity || 2.9 quality &amp;lt;br /&amp;gt;0.1 productivity  || 0 quality &amp;lt;br /&amp;gt;3 productivity || 0.100660% || 994&lt;br /&gt;
|-&lt;br /&gt;
| Assembling machine 3 || 3 quality &amp;lt;br /&amp;gt;1 productivity || 3.1 quality &amp;lt;br /&amp;gt;0.9 productivity || 3.2 quality &amp;lt;br /&amp;gt;0.8 productivity || 3.33 quality &amp;lt;br /&amp;gt;0.67 productivity  || 0 quality &amp;lt;br /&amp;gt;4 productivity || 0.145220% || 689&lt;br /&gt;
|-&lt;br /&gt;
| Foundry || 3.5 quality &amp;lt;br /&amp;gt;0.5 productivity || 3.5 quality &amp;lt;br /&amp;gt;0.5 productivity || 3.6 quality &amp;lt;br /&amp;gt;0.4 productivity || 3.9 quality &amp;lt;br /&amp;gt;0.1 productivity  || 0 quality &amp;lt;br /&amp;gt;4 productivity || 0.424039% || 236&lt;br /&gt;
|-&lt;br /&gt;
| Electromagnetic plant || 3.6 quality &amp;lt;br /&amp;gt;1.4 productivity || 3.6 quality &amp;lt;br /&amp;gt;1.4 productivity || 3.6 quality &amp;lt;br /&amp;gt;1.4 productivity || 3.9 quality &amp;lt;br /&amp;gt;1.1 productivity  || 0 quality &amp;lt;br /&amp;gt;5 productivity || 0.588510% || 170&lt;br /&gt;
|-&lt;br /&gt;
| Cryogenic plant || 3.6 quality &amp;lt;br /&amp;gt;4.4 productivity || 3.6 quality &amp;lt;br /&amp;gt;4.4 productivity || 3.6 quality &amp;lt;br /&amp;gt;4.4 productivity  || 3.9 quality &amp;lt;br /&amp;gt;4.1 productivity  || 0 quality &amp;lt;br /&amp;gt;8 productivity || 0.565030% || 177&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;nowiki&amp;gt;*&amp;lt;/nowiki&amp;gt; &amp;quot;items recycled&amp;quot; quantifies how many items need to be crafted and put into the entire upcycler to yield a single legendary item, it doesn&#039;t account for those which get recycled multiple times.&lt;br /&gt;
\-\&lt;br /&gt;
epic modules = &lt;br /&gt;
The columns &amp;quot;Modules for X items&amp;quot; denote which modules need to go into the machines that are set to produce items of X quality.&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Crafting machine || Modules for common items || Modules for uncommon items || Modules for rare items  || Modules for epic || Modules for legendary || Percentage yield || Items recycled*&lt;br /&gt;
|-&lt;br /&gt;
| Chemical plant || 2.33 quality &amp;lt;br /&amp;gt;0.67 productivity || 2.4 quality &amp;lt;br /&amp;gt;0.6 productivity || 2.4 quality &amp;lt;br /&amp;gt;0.6 productivity || 2.4 quality &amp;lt;br /&amp;gt;0.6 productivity  || 0 quality &amp;lt;br /&amp;gt;3 productivity || 0.152486% || 656&lt;br /&gt;
|-&lt;br /&gt;
| Assembling machine 3 || 2.5 quality &amp;lt;br /&amp;gt;1.5 productivity || 2.5 quality &amp;lt;br /&amp;gt;1.5 productivity || 2.6 quality &amp;lt;br /&amp;gt;1.4 productivity || 2.8 quality &amp;lt;br /&amp;gt;1.2 productivity  || 0 quality &amp;lt;br /&amp;gt;4 productivity || 0.232966% || 430&lt;br /&gt;
|-&lt;br /&gt;
| Foundry || 2.7 quality &amp;lt;br /&amp;gt;1.3 productivity || 2.7 quality &amp;lt;br /&amp;gt;1.3 productivity || 2.75 quality &amp;lt;br /&amp;gt;1.25 productivity || 3 quality &amp;lt;br /&amp;gt;1 productivity  || 0 quality &amp;lt;br /&amp;gt;4 productivity || 0.664130% || 151&lt;br /&gt;
|-&lt;br /&gt;
| Electromagnetic plant || 2.6 quality &amp;lt;br /&amp;gt;2.4 productivity || 2.6 quality &amp;lt;br /&amp;gt;2.4 productivity || 2.67 quality &amp;lt;br /&amp;gt;2.33 productivity || 2.9 quality &amp;lt;br /&amp;gt;2.1 productivity  || 0 quality &amp;lt;br /&amp;gt;5 productivity || 0.974700% || 103&lt;br /&gt;
|-&lt;br /&gt;
| Cryogenic plant || 2.6 quality &amp;lt;br /&amp;gt;5.4 productivity || 2.6 quality &amp;lt;br /&amp;gt;5.4 productivity || 2.6 quality &amp;lt;br /&amp;gt;4.4 productivity  || 2.8 quality &amp;lt;br /&amp;gt;4.2 productivity  || 0 quality &amp;lt;br /&amp;gt;8 productivity || 1.122444% || 90&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;nowiki&amp;gt;*&amp;lt;/nowiki&amp;gt; &amp;quot;items recycled&amp;quot; quantifies how many items need to be crafted and put into the entire upcycler to yield a single legendary item, it doesn&#039;t account for those which get recycled multiple times.&lt;br /&gt;
\-\&lt;br /&gt;
legendary modules=&lt;br /&gt;
The columns &amp;quot;Modules for X items&amp;quot; denote which modules need to go into the machines that are set to produce items of X quality.&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Crafting machine || Modules for common items || Modules for uncommon items || Modules for rare items  || Modules for epic || Modules for legendary || Percentage yield || Items recycled*&lt;br /&gt;
|-&lt;br /&gt;
| Chemical plant || 1.67 quality &amp;lt;br /&amp;gt;1.33 productivity || 1.67 quality &amp;lt;br /&amp;gt;1.33 productivity || 1.67 quality &amp;lt;br /&amp;gt;1.333 productivity || 1.8 quality &amp;lt;br /&amp;gt;1.2 productivity  || 0 quality &amp;lt;br /&amp;gt;3 productivity || 0.344061% || 291&lt;br /&gt;
|-&lt;br /&gt;
| Assembling machine 3 || 1.67 quality &amp;lt;br /&amp;gt;2.33 productivity || 1.67 quality &amp;lt;br /&amp;gt;2.33 productivity || 1.67 quality &amp;lt;br /&amp;gt;2.33 productivity || 1.8 quality &amp;lt;br /&amp;gt;2.2 productivity  || 0 quality &amp;lt;br /&amp;gt;4 productivity || 0.586191% || 171&lt;br /&gt;
|-&lt;br /&gt;
| Foundry || 1.4 quality &amp;lt;br /&amp;gt;2.6 productivity || 1.4 quality &amp;lt;br /&amp;gt;2.6 productivity || 1.4 quality &amp;lt;br /&amp;gt;2.6 productivity || 1.5 quality &amp;lt;br /&amp;gt;2.5 productivity  || 0 quality &amp;lt;br /&amp;gt;4 productivity || 1.624266% || 62&lt;br /&gt;
|-&lt;br /&gt;
| Electromagnetic plant || 1 quality &amp;lt;br /&amp;gt;4 productivity || 1 quality &amp;lt;br /&amp;gt;4 productivity || 1 quality &amp;lt;br /&amp;gt;4 productivity || 1 quality &amp;lt;br /&amp;gt;4 productivity  || 0 quality &amp;lt;br /&amp;gt;5 productivity || 2.722332% || 37&lt;br /&gt;
|-&lt;br /&gt;
| Cryogenic plant || 0 quality &amp;lt;br /&amp;gt;8 productivity || 0 quality &amp;lt;br /&amp;gt;8 productivity || 0 quality &amp;lt;br /&amp;gt;8 productivity || 0 quality &amp;lt;br /&amp;gt;8 productivity  || 0 quality &amp;lt;br /&amp;gt;8 productivity || 4.835199% || 21&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;nowiki&amp;gt;*&amp;lt;/nowiki&amp;gt; &amp;quot;items recycled&amp;quot; quantifies how many items need to be crafted and put into the entire upcycler to yield a single legendary item, it doesn&#039;t account for those which get recycled multiple times.&lt;br /&gt;
&amp;lt;/tabber&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Number of crafting machines ===&lt;br /&gt;
If we assume a constant input stream of uncommon items which will always fill back up, we can additionally figure out what ratio of items will be inside the system at once, and with that we can figure out how many crafting machines we need per tier. This is done by setting &amp;lt;math&amp;gt;m_{1,k+1} = 100 \, \% - m_{2,k+1} - m_{3,k+1} - m_{4,k+1}&amp;lt;/math&amp;gt; after each iteration. See the calculations further below for a full explanation of the calculations.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tabber&amp;gt;&lt;br /&gt;
per recycler=&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Crafting machine || Recyclers || Machines producing common items || Machines producing uncommon items || Machines producing rare items || Machines producing epic items || Machines producing legendary items&lt;br /&gt;
|-&lt;br /&gt;
| Chemical plant || 1 || 3.4427 || 0.0290 || 1.0086 || 0.0077 || 0.2979&lt;br /&gt;
|-&lt;br /&gt;
| Assembling machine 3 || 1 || 3.3027 || 0.0365 || 1.0657 || 0.0108 || 0.3286&lt;br /&gt;
|-&lt;br /&gt;
| Foundry || 1 || 2.9551 || 0.0563 || 1.1528 || 0.0208 || 0.3653&lt;br /&gt;
|-&lt;br /&gt;
| Electromagnetic plant || 1 || 2.7239 || 0.0709 || 1.1726 || 0.0301 || 0.3474&lt;br /&gt;
|-&lt;br /&gt;
| Cryogenic plant || 1 || 2.3798 || 0.0972 || 1.1517 || 0.0470 || 0.2700&lt;br /&gt;
&lt;br /&gt;
|}&lt;br /&gt;
\-\&lt;br /&gt;
per legendary crafter (exact) =&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Crafting machine || Recyclers || Machines producing common items || Machines producing uncommon items || Machines producing rare items || Machines producing epic items || Machines producing legendary items&lt;br /&gt;
|-&lt;br /&gt;
| Chemical plant || 108.8978 || 374.9134 || 43.5367 || 12.7555 || 3.3856 || 1&lt;br /&gt;
|-&lt;br /&gt;
| Assembling machine 3 || 70.4576 || 232.7032 || 33.9340 || 10.9500 || 3.2432 || 1&lt;br /&gt;
|-&lt;br /&gt;
| Foundry || 33.0224 || 97.5872 || 21.8308 || 8.5164 || 3.1550 || 1&lt;br /&gt;
|-&lt;br /&gt;
| Electromagnetic plant || 24.1178 || 65.6959 || 18.4556 || 7.9448 || 3.3747 || 1&lt;br /&gt;
|-&lt;br /&gt;
| Cryogenic plant || 19.9316 || 47.4350 || 18.2124 || 8.8138 || 4.2654 || 1&lt;br /&gt;
|}&lt;br /&gt;
\-\&lt;br /&gt;
per legendary crafter (conservative)=&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Crafting machine || Recyclers || Machines producing common items || Machines producing uncommon items || Machines producing rare items || Machines producing epic items || Machines producing legendary items&lt;br /&gt;
|-&lt;br /&gt;
| Chemical plant || 92 || 318 || 37 || 11 || 3 || 1&lt;br /&gt;
|-&lt;br /&gt;
| Assembling machine 3 || 62 || 205 || 30 || 10 || 3 || 1&lt;br /&gt;
|-&lt;br /&gt;
| Foundry || 30 || 89 || 20 || 8 || 3 || 1&lt;br /&gt;
|-&lt;br /&gt;
| Electromagnetic plant || 20 || 56 || 16 || 7 || 3 || 1&lt;br /&gt;
|-&lt;br /&gt;
| Cryogenic plant || 17 || 41 || 16 || 8 || 4 || 1&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;/tabber&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== The crafting machines ==&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Crafting machine || Module slots &amp;lt;math&amp;gt;N&amp;lt;/math&amp;gt; || Base productivity bonus &amp;lt;math&amp;gt;p_0&amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| [[Chemical plant]] || 3 || +0%&lt;br /&gt;
|-&lt;br /&gt;
| [[Assembling machine 3]] || 4 || +0%&lt;br /&gt;
|-&lt;br /&gt;
| [[Foundry]] || 4 || +50%&lt;br /&gt;
|-&lt;br /&gt;
| [[Electromagnetic plant]] || 5 || +50%&lt;br /&gt;
|-&lt;br /&gt;
| [[Cryogenic plant]] || 8 || +0%&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Quality probability ==&lt;br /&gt;
When an item gets produced and the initial roll decides that the quality of the item will increase, there is a 90% chance it will rise one tier, a 9% chance it will rise two, a 0.9% chance it will rise three, and a 0.1% chance it will rise four. This is of course capped if the item already started out at a higher tier.&lt;br /&gt;
&lt;br /&gt;
== Mathematical model ==&lt;br /&gt;
The mathematical model is time discrete. As opposed to dealing with derivatives in respect to time, the next state is a direct function of the previous state.&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;math&amp;gt;m_{i,k}&amp;lt;/math&amp;gt; ... Number of materials of tier &amp;lt;math&amp;gt;i&amp;lt;/math&amp;gt; (whereas 1 is common, 2 is uncommon, 3 is rare, 4 is epic, and 5 is legendary) after the &amp;lt;math&amp;gt;k&amp;lt;/math&amp;gt;-th iteration before being crafted. (this doesn&#039;t mean that an item only needs one type of ingredient, but that &amp;quot;1 materials&amp;quot; can be crafted into 1 item from them)&lt;br /&gt;
* &amp;lt;math&amp;gt;n_{i,k}&amp;lt;/math&amp;gt; ... Number of items of tier &amp;lt;math&amp;gt;i&amp;lt;/math&amp;gt; after the &amp;lt;math&amp;gt;k&amp;lt;/math&amp;gt;-th iteration, after being crafted together.&lt;br /&gt;
* &amp;lt;math&amp;gt;p_0&amp;lt;/math&amp;gt; ... the crafting machines inherent productivity bonus&lt;br /&gt;
* &amp;lt;math&amp;gt;N&amp;lt;/math&amp;gt; ... number of modules the crafting machine can hold&lt;br /&gt;
* &amp;lt;math&amp;gt;q_r = 4 \cdot 6.2 \, \% = 0.248&amp;lt;/math&amp;gt; ... quality probability of the recyclers with 4 [[quality module 3]]&#039;s (6.2% is the chance of a legendary tier quality module 3)&lt;br /&gt;
* &amp;lt;math&amp;gt;p_i = p_0 + x_i \cdot 25 \, \%&amp;lt;/math&amp;gt; ... productivity due to &amp;lt;math&amp;gt;x_i&amp;lt;/math&amp;gt; legendary [[productivity module 3]]&#039;s in the crafting machine which takes &amp;lt;math&amp;gt;i&amp;lt;/math&amp;gt;-tier materials (25% is the productivity boost of a legendary tier productivity module 3)&lt;br /&gt;
* &amp;lt;math&amp;gt;q_i = (N-x_i) \cdot 6.2 \, \%&amp;lt;/math&amp;gt; ... quality probability due to &amp;lt;math&amp;gt;(N - x_i)&amp;lt;/math&amp;gt; legendary quality module 3&#039;s in the crafting machine which takes &amp;lt;math&amp;gt;i&amp;lt;/math&amp;gt;-tier materials&lt;br /&gt;
&lt;br /&gt;
=== Recycled materials ===&lt;br /&gt;
When a quarter of all items being recycled and the quality probability rules, we can write the equations for the amount of materials received after recycling. This calculation is rather simple, as uncommon items can only come forth from uncommon material failing to raise in quality. The second tier are 90% of tier 1 items that did increase, and all those tier 2 items that didn&#039;t. This continues for all tiers as follows, but legendary items &amp;lt;math&amp;gt;n_{5,k}&amp;lt;/math&amp;gt; will not be recycled&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\begin{align}&lt;br /&gt;
\text{common material:}\quad m_{1,k+1} &amp;amp;= \frac{n_{1,k}}{4} \cdot (1 - q_r)\\&lt;br /&gt;
\text{uncommon material:}\quad m_{2,k+1} &amp;amp;= \frac{n_{1,k}}{4} \cdot q_r \cdot 0.9 &amp;amp;+&amp;amp; \frac{n_{2,k}}{4} \cdot (1 - q_r)\\&lt;br /&gt;
\text{rare material:}\quad m_{3,k+1} &amp;amp;= \frac{n_{1,k}}{4} \cdot q_r \cdot 0.09 &amp;amp;+&amp;amp; \frac{n_{2,k}}{4} \cdot q_r \cdot 0.9 &amp;amp;+&amp;amp; \frac{n_{3,k}}{4} \cdot (1 - q_r)\\&lt;br /&gt;
\text{epic material:}\quad m_{4,k+1} &amp;amp;= \frac{n_{1,k}}{4} \cdot q_r \cdot 0.009 &amp;amp;+&amp;amp; \frac{n_{2,k}}{4} \cdot q_r \cdot 0.09 &amp;amp;+&amp;amp; \frac{n_{3,k}}{4} \cdot q_r \cdot 0.9 &amp;amp;+&amp;amp; \frac{n_{4,k}}{4} \cdot (1 - q_r)\\&lt;br /&gt;
\text{legendary material:}\quad m_{5,k+1} &amp;amp;= \frac{n_{1,k}}{4} \cdot q_r \cdot 0.001 &amp;amp;+&amp;amp; \frac{n_{2,k}}{4} \cdot q_r \cdot 0.01 &amp;amp;+&amp;amp; \frac{n_{3,k}}{4} \cdot q_r \cdot 0.1 &amp;amp;+&amp;amp; \frac{n_{4,k}}{4} \cdot q_r\\&lt;br /&gt;
\end{align}&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
which can also be written as a vector-matrix-multiplication &amp;lt;math&amp;gt;\textbf{m}_{k+1} = \textbf{A} \,\textbf{n}_k&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\underbrace{\begin{bmatrix} m_{1,k+1}\\ m_{2,k+1}\\ m_{3,k+1}\\ m_{4,k+1}\\ m_{5,k+1}\\ \end{bmatrix}}_{\textbf{m}_{k+1}}&lt;br /&gt;
=&lt;br /&gt;
\underbrace{\begin{bmatrix}&lt;br /&gt;
\frac{1 - q_r}{4} &amp;amp; 0 &amp;amp; 0 &amp;amp; 0 &amp;amp; 0\\&lt;br /&gt;
\frac{0.9 \, q_r}{4}   &amp;amp; \frac{1 - q_r}{4} &amp;amp; 0 &amp;amp; 0 &amp;amp; 0\\&lt;br /&gt;
\frac{0.09 \, q_r}{4}  &amp;amp; \frac{0.9 \, q_r}{4}  &amp;amp; \frac{1 - q_r}{4} &amp;amp; 0 &amp;amp; 0 \\&lt;br /&gt;
\frac{0.009 \, q_r}{4} &amp;amp; \frac{0.09 \, q_r}{4} &amp;amp; \frac{0.9 \, q_r}{4} &amp;amp; \frac{1 - q_r}{4} &amp;amp; 0\\&lt;br /&gt;
\frac{0.001 \, q_r}{4} &amp;amp; \frac{0.01 \, q_r}{4} &amp;amp; \frac{0.1 \, q_r}{4} &amp;amp; \frac{q_r}{4} &amp;amp; 0\\&lt;br /&gt;
\end{bmatrix}}_{\textbf{A}}&lt;br /&gt;
\underbrace{\begin{bmatrix} n_{1,k}\\ n_{2,k}\\ n_{3,k}\\ n_{4,k}\\ n_{5,k}\\ \end{bmatrix}}_{\textbf{n}_k}&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As we assume there is nothing to be done about recyclers to make them more effective but fill them with all quality modules, the value of &amp;lt;math&amp;gt;q_r = 0.248&amp;lt;/math&amp;gt; is a constant, and therefore the matrix &amp;lt;math&amp;gt;\textbf{A}&amp;lt;/math&amp;gt; is also a constant. For legendary quality module 3&#039;s, it looks like:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \textbf{A} = &lt;br /&gt;
\begin{bmatrix}&lt;br /&gt;
0.188 &amp;amp; 0 &amp;amp; 0 &amp;amp; 0 &amp;amp; 0 \\&lt;br /&gt;
0.055\,8 &amp;amp; 0.188 &amp;amp; 0 &amp;amp; 0 &amp;amp; 0 \\&lt;br /&gt;
0.005\,58 &amp;amp; 0.055\,8 &amp;amp; 0.188 &amp;amp; 0 &amp;amp; 0 \\&lt;br /&gt;
0.000\,558 &amp;amp; 0.005\,58 &amp;amp; 0.055\,8 &amp;amp; 0.188 &amp;amp; 0 \\&lt;br /&gt;
0.000\,062 &amp;amp; 0.000\,62 &amp;amp; 0.006\,2 &amp;amp; 0.062 &amp;amp; 0 \\&lt;br /&gt;
\end{bmatrix}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Recrafted items ===&lt;br /&gt;
Once more we first check how many items are produced, which is, again, the sum of all possible ways to get to a tier, this time adding productivity &amp;lt;math&amp;gt;p_i&amp;lt;/math&amp;gt;, and bringing along all those items which are already legendary &amp;lt;math&amp;gt;n_{5,k}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\begin{align}&lt;br /&gt;
\text{common item:}\quad n_{1,k+1} &amp;amp;= m_{1,k+1} \cdot ( 1 + p_1 ) \cdot (1 - q_1)\\&lt;br /&gt;
\text{uncommon items:}\quad n_{2,k+1} &amp;amp;= m_{1,k+1} \cdot ( 1 + p_1 ) \cdot q_1 \cdot 0.9 &amp;amp;+&amp;amp;  m_{2,k+1} \cdot ( 1 + p_2 ) \cdot (1 - q_2)\\&lt;br /&gt;
\text{rare items:}\quad n_{3,k+1} &amp;amp;= m_{1,k+1} \cdot ( 1 + p_1 ) \cdot q_1 \cdot 0.09 &amp;amp;+&amp;amp;  m_{2,k+1} \cdot ( 1 + p_2 ) \cdot q_2 \cdot 0.9 &amp;amp;+&amp;amp; m_{3,k+1} \cdot ( 1 + p_3 ) \cdot (1 - q_3) \\&lt;br /&gt;
\text{epic items:}\quad n_{4,k+1} &amp;amp;= m_{1,k+1} \cdot ( 1 + p_1 ) \cdot q_1 \cdot 0.009 &amp;amp;+&amp;amp;  m_{2,k+1} \cdot ( 1 + p_2 ) \cdot q_2 \cdot 0.09 &amp;amp;+&amp;amp; m_{3,k+1} \cdot ( 1 + p_3 ) \cdot q_3 \cdot 0.9  &amp;amp;+&amp;amp; m_{4,k+1} \cdot ( 1 + p_4) \cdot (1 - q_4) \\&lt;br /&gt;
\text{legendary items:}\quad n_{5,k+1} &amp;amp;= m_{1,k+1} \cdot ( 1 + p_1 ) \cdot q_1 \cdot 0.001 &amp;amp;+&amp;amp;  m_{2,k+1} \cdot ( 1 + p_2 ) \cdot q_2 \cdot 0.01 &amp;amp;+&amp;amp; m_{3,k+1} \cdot ( 1 + p_3 ) \cdot q_3 \cdot 0.1  &amp;amp;+&amp;amp; m_{4,k+1} \cdot ( 1 + p_4) \cdot q_4 &amp;amp;+&amp;amp; m_{5,k+1} \cdot ( 1 + p_5) + n_{5,k}\\&lt;br /&gt;
\end{align}&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This can once more be written as a vector-matrix-multiplication &amp;lt;math&amp;gt;\textbf{n}_{k+1} = \textbf{B} \,\textbf{m}_{k+1} + \textbf{C} \,\textbf{n}_{k}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\underbrace{\begin{bmatrix} n_{1,k+1}\\ n_{2,k+1}\\ n_{3,k+1}\\ n_{4,k+1}\\ n_{5,k+1}\\ \end{bmatrix}}_{\textbf{n}_{k+1}} = &lt;br /&gt;
\underbrace{\begin{bmatrix}&lt;br /&gt;
( 1 + p_1 ) \cdot (1 - q_1) &amp;amp; 0 &amp;amp; 0 &amp;amp; 0 &amp;amp; 0 \\&lt;br /&gt;
( 1 + p_1 ) \cdot q_1 \cdot 0.9 &amp;amp;  ( 1 + p_2 ) \cdot (1 - q_2) &amp;amp; 0 &amp;amp; 0 &amp;amp; 0 \\&lt;br /&gt;
( 1 + p_1 ) \cdot q_1 \cdot 0.09 &amp;amp; ( 1 + p_2 ) \cdot q_2 \cdot 0.9 &amp;amp; ( 1 + p_3 ) \cdot (1 - q_3) &amp;amp; 0 &amp;amp; 0 \\&lt;br /&gt;
( 1 + p_1 ) \cdot q_1 \cdot 0.009 &amp;amp; ( 1 + p_2 ) \cdot q_2 \cdot 0.09 &amp;amp; ( 1 + p_3 ) \cdot q_3 \cdot 0.9  &amp;amp; ( 1 + p_4) \cdot (1 - q_4) &amp;amp; 0 \\&lt;br /&gt;
( 1 + p_1 ) \cdot q_1 \cdot 0.001 &amp;amp; ( 1 + p_2 ) \cdot q_2 \cdot 0.01 &amp;amp; ( 1 + p_3 ) \cdot q_3 \cdot 0.1  &amp;amp; ( 1 + p_4) \cdot q_4 &amp;amp; ( 1 + p_5)\\&lt;br /&gt;
\end{bmatrix}}_{B}&lt;br /&gt;
\underbrace{\begin{bmatrix} m_{1,k+1}\\ m_{2,k+1}\\ m_{3,k+1}\\ m_{4,k+1}\\ m_{5,k+1}\\ \end{bmatrix}}_{\textbf{m}_{k+1}}&lt;br /&gt;
+&lt;br /&gt;
\underbrace{\begin{bmatrix}&lt;br /&gt;
0&amp;amp;0&amp;amp;0&amp;amp;0\\&lt;br /&gt;
0&amp;amp;0&amp;amp;0&amp;amp;0\\&lt;br /&gt;
0&amp;amp;0&amp;amp;0&amp;amp;0\\&lt;br /&gt;
0&amp;amp;0&amp;amp;0&amp;amp;0\\&lt;br /&gt;
0&amp;amp;0&amp;amp;0&amp;amp;1\\&lt;br /&gt;
\end{bmatrix}}_{\textbf{C}}&lt;br /&gt;
\underbrace{\begin{bmatrix} n_{1,k}\\ n_{2,k}\\ n_{3,k}\\ n_{4,k}\\ n_{5,k}\\ \end{bmatrix}}_{\textbf{n}_k}&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Combined model ===&lt;br /&gt;
&lt;br /&gt;
As such we gain an equation for the amount of items for every tier after any amount of iterations&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\begin{align}&lt;br /&gt;
\textbf{n}_{k+1} &lt;br /&gt;
    &amp;amp;= \textbf{B} \, \textbf{m}_{k+1} + \textbf{C} \, \textbf{n}_{k}\\&lt;br /&gt;
    &amp;amp;= \textbf{B} \, \textbf{A} \,\textbf{n}_{k} + \textbf{C} \, \textbf{n}_{k}\\&lt;br /&gt;
    &amp;amp;= (\textbf{B} \, \textbf{A} +\textbf{C} ) \, \textbf{n}_{k}\\&lt;br /&gt;
    &amp;amp;= \textbf{M} \, \textbf{n}_{k}\\&lt;br /&gt;
\textbf{n}_{k+2} &amp;amp;= \textbf{Q} \, \textbf{n}_{k+1} = \textbf{Q} \,  \textbf{Q} \, \textbf{n}_{k} = \textbf{Q}^2 \, \textbf{n}_{k}\\&lt;br /&gt;
&amp;amp;\vdots\\&lt;br /&gt;
\textbf{n}_k &amp;amp;= \textbf{Q}^k \, \textbf{n}_0\\&lt;br /&gt;
\end{align}&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
A realistic starting point for &amp;lt;math&amp;gt;\textbf{n}_0&amp;lt;/math&amp;gt; is only items in tier 1, and if we do not care for any other tiers, we simply choose sufficiently large &amp;lt;math&amp;gt;k = 100&amp;lt;/math&amp;gt;, and, through numeric means, try to maximize a single value. &amp;lt;math&amp;gt;q_{100,\text{crit}}&amp;lt;/math&amp;gt;, which falls in the fifth row, first column, of the Matrix &amp;lt;math&amp;gt;\textbf{Q}&amp;lt;/math&amp;gt; raised to the 100th power.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\begin{align}&lt;br /&gt;
\textbf{n}_k &amp;amp;= Q^k \, \textbf{n}_0\\&lt;br /&gt;
\begin{bmatrix}*\\ *\\ *\\ *\\ n_{5,100} \end{bmatrix} &amp;amp;= &lt;br /&gt;
\begin{bmatrix}&lt;br /&gt;
 * &amp;amp; * &amp;amp; * &amp;amp; * \\&lt;br /&gt;
 * &amp;amp; * &amp;amp; * &amp;amp; * \\&lt;br /&gt;
 * &amp;amp; * &amp;amp; * &amp;amp; * \\&lt;br /&gt;
 * &amp;amp; * &amp;amp; * &amp;amp; * \\&lt;br /&gt;
q_{100,\text{crit}} &amp;amp; * &amp;amp; * &amp;amp; * \\&lt;br /&gt;
\end{bmatrix} \begin{bmatrix}n_{1,0}\\ *\\ *\\ *\\ * \end{bmatrix}\\&lt;br /&gt;
\end{align}&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The choice of optimization method (simplex, branch and bound, etc.) itself is irrelevant, although most software will want the problem to be stated in a way so it can find a minimum, and may require the proper guard rails as to not pick values below 0 or higher than the maximum number of allowed modules.&lt;/div&gt;</summary>
		<author><name>Untitled7</name></author>
	</entry>
	<entry>
		<id>https://wiki.factorio.com/index.php?title=Tutorial:Quality_upcycling_math&amp;diff=207001</id>
		<title>Tutorial:Quality upcycling math</title>
		<link rel="alternate" type="text/html" href="https://wiki.factorio.com/index.php?title=Tutorial:Quality_upcycling_math&amp;diff=207001"/>
		<updated>2024-11-23T21:37:47Z</updated>

		<summary type="html">&lt;p&gt;Untitled7: /* Recrafted items */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;How do we get the most amount of [[Quality|legendary]] items out of an upcycling plant?&lt;br /&gt;
&lt;br /&gt;
The answer is not quite as straight forward as we&#039;d like it to be, because it depends on a number of factors, luckily there is a finite number of possibilities of what the modules can be, and for the sake of simplicity this tutorial will ignore the productivity gain from [[Technologies#Space_Age|infinite technologies]].&lt;br /&gt;
&lt;br /&gt;
== The crafting machines ==&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Crafting machine || Module slots &amp;lt;math&amp;gt;N&amp;lt;/math&amp;gt; || Base productivity bonus &amp;lt;math&amp;gt;p_0&amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| [[Chemical plant]] || 3 || +0%&lt;br /&gt;
|-&lt;br /&gt;
| [[Assembling machine 3]] || 4 || +0%&lt;br /&gt;
|-&lt;br /&gt;
| [[Foundry]] || 4 || +50%&lt;br /&gt;
|-&lt;br /&gt;
| [[Electromagnetic plant]] || 5 || +50%&lt;br /&gt;
|-&lt;br /&gt;
| [[Cryogenic plant]] || 8 || +0%&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Quality probability ==&lt;br /&gt;
When an item gets produced and the initial roll decides that the quality of the item will increase, there is a 90% chance it will rise one tier, a 9% chance it will rise two, a 0.9% chance it will rise three, and a 0.1% chance it will rise four. This is of course capped if the item already started out at a higher tier.&lt;br /&gt;
&lt;br /&gt;
== Mathematical model ==&lt;br /&gt;
The mathematical model is time discrete. As opposed to dealing with derivatives in respect to time, the next state is a direct function of the previous state.&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;math&amp;gt;m_{i,k}&amp;lt;/math&amp;gt; ... Number of materials of tier &amp;lt;math&amp;gt;i&amp;lt;/math&amp;gt; after the &amp;lt;math&amp;gt;k&amp;lt;/math&amp;gt;-th iteration before being crafted. (this doesn&#039;t mean that an item only needs one type of ingredient, but that &amp;quot;1 materials&amp;quot; can be crafted into 1 item from them)&lt;br /&gt;
* &amp;lt;math&amp;gt;n_{i,k}&amp;lt;/math&amp;gt; ... Number of items of tier &amp;lt;math&amp;gt;i&amp;lt;/math&amp;gt; after the &amp;lt;math&amp;gt;k&amp;lt;/math&amp;gt;-th iteration, after being crafted together.&lt;br /&gt;
* &amp;lt;math&amp;gt;p_0&amp;lt;/math&amp;gt; ... the crafting machines inherent productivity bonus&lt;br /&gt;
* &amp;lt;math&amp;gt;N&amp;lt;/math&amp;gt; ... number of modules the crafting machine can hold&lt;br /&gt;
* &amp;lt;math&amp;gt;q_r = 4 \cdot 6.2 \, \% = 0.248&amp;lt;/math&amp;gt; ... quality probability of the recyclers with 4 [[quality module 3]]&#039;s (6.2% is the chance of a legendary tier quality module 3)&lt;br /&gt;
* &amp;lt;math&amp;gt;p_i = p_0 + x_i \cdot 25 \, \%&amp;lt;/math&amp;gt; ... productivity due to &amp;lt;math&amp;gt;x_i&amp;lt;/math&amp;gt; legendary [[productivity module 3]]&#039;s in the crafting machine which takes &amp;lt;math&amp;gt;i&amp;lt;/math&amp;gt;-tier materials (25% is the productivity boost of a legendary tier productivity module 3)&lt;br /&gt;
* &amp;lt;math&amp;gt;q_i = (N-x_i) \cdot 6.2 \, \%&amp;lt;/math&amp;gt; ... quality probability due to &amp;lt;math&amp;gt;(N - x_i)&amp;lt;/math&amp;gt; legendary quality module 3&#039;s in the crafting machine which takes &amp;lt;math&amp;gt;i&amp;lt;/math&amp;gt;-tier materials&lt;br /&gt;
&lt;br /&gt;
=== Recycled materials ===&lt;br /&gt;
When a quarter of all items being recycled and the quality probability rules we can write the equations for the amount of materials received after recycling. This calculation is rather simple, as we the lowest tier can only come forth from it&#039;s own tier failing to raise in quality. The second tier are 90% of tier 1 items that did increase, and all those tier 2 items that didn&#039;t. This continues for all tiers as follows, but legendary items &amp;lt;math&amp;gt;n_{5,k}&amp;lt;/math&amp;gt; will not be recycled&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\begin{align}&lt;br /&gt;
m_{1,k+1} &amp;amp;= \frac{n_{1,k}}{4} \cdot (1 - q_r)\\&lt;br /&gt;
m_{2,k+1} &amp;amp;= \frac{n_{1,k}}{4} \cdot q_r \cdot 0.9 &amp;amp;+&amp;amp; \frac{n_{2,k}}{4} \cdot (1 - q_r)\\&lt;br /&gt;
m_{3,k+1} &amp;amp;= \frac{n_{1,k}}{4} \cdot q_r \cdot 0.09 &amp;amp;+&amp;amp; \frac{n_{2,k}}{4} \cdot q_r \cdot 0.9 &amp;amp;+&amp;amp; \frac{n_{3,k}}{4} \cdot (1 - q_r)\\&lt;br /&gt;
m_{4,k+1} &amp;amp;= \frac{n_{1,k}}{4} \cdot q_r \cdot 0.009 &amp;amp;+&amp;amp; \frac{n_{2,k}}{4} \cdot q_r \cdot 0.09 &amp;amp;+&amp;amp; \frac{n_{3,k}}{4} \cdot q_r \cdot 0.9 &amp;amp;+&amp;amp; \frac{n_{4,k}}{4} \cdot (1 - q_r)\\&lt;br /&gt;
m_{5,k+1} &amp;amp;= \frac{n_{1,k}}{4} \cdot q_r \cdot 0.001 &amp;amp;+&amp;amp; \frac{n_{2,k}}{4} \cdot q_r \cdot 0.01 &amp;amp;+&amp;amp; \frac{n_{3,k}}{4} \cdot q_r \cdot 0.1 &amp;amp;+&amp;amp; \frac{n_{4,k}}{4} \cdot q_r\\&lt;br /&gt;
\end{align}&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
which can also be written as a vector-matrix-multiplication &amp;lt;math&amp;gt;\textbf{m}_{k+1} = \textbf{A} \,\textbf{n}_k&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\underbrace{\begin{bmatrix} m_{1,k+1}\\ m_{2,k+1}\\ m_{3,k+1}\\ m_{4,k+1}\\ m_{5,k+1}\\ \end{bmatrix}}_{\textbf{m}_{k+1}}&lt;br /&gt;
=&lt;br /&gt;
\underbrace{\begin{bmatrix}&lt;br /&gt;
\frac{1 - q_r}{4} &amp;amp; 0 &amp;amp; 0 &amp;amp; 0 &amp;amp; 0\\&lt;br /&gt;
\frac{0.9 \, q_r}{4}   &amp;amp; \frac{1 - q_r}{4} &amp;amp; 0 &amp;amp; 0 &amp;amp; 0\\&lt;br /&gt;
\frac{0.09 \, q_r}{4}  &amp;amp; \frac{0.9 \, q_r}{4}  &amp;amp; \frac{1 - q_r}{4} &amp;amp; 0 &amp;amp; 0 \\&lt;br /&gt;
\frac{0.009 \, q_r}{4} &amp;amp; \frac{0.09 \, q_r}{4} &amp;amp; \frac{0.9 \, q_r}{4} &amp;amp; \frac{1 - q_r}{4} &amp;amp; 0\\&lt;br /&gt;
\frac{0.001 \, q_r}{4} &amp;amp; \frac{0.01 \, q_r}{4} &amp;amp; \frac{0.1 \, q_r}{4} &amp;amp; \frac{q_r}{4} &amp;amp; 0\\&lt;br /&gt;
\end{bmatrix}}_{\textbf{A}}&lt;br /&gt;
\underbrace{\begin{bmatrix} n_{1,k}\\ n_{2,k}\\ n_{3,k}\\ n_{4,k}\\ n_{5,k}\\ \end{bmatrix}}_{\textbf{n}_k}&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As we assume there is nothing to be done about recyclers to make them more effective but fill them with all quality modules, the value of &amp;lt;math&amp;gt;q_r = 0.248&amp;lt;/math&amp;gt; is a constant, and therefore the matrix &amp;lt;math&amp;gt;\textbf{A}&amp;lt;/math&amp;gt; is also a constant. For legendary quality module 3&#039;s, it looks like:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \textbf{A} = &lt;br /&gt;
\begin{bmatrix}&lt;br /&gt;
0.188 &amp;amp; 0 &amp;amp; 0 &amp;amp; 0 &amp;amp; 0 \\&lt;br /&gt;
0.055\,8 &amp;amp; 0.188 &amp;amp; 0 &amp;amp; 0 &amp;amp; 0 \\&lt;br /&gt;
0.005\,58 &amp;amp; 0.055\,8 &amp;amp; 0.188 &amp;amp; 0 &amp;amp; 0 \\&lt;br /&gt;
0.000\,558 &amp;amp; 0.005\,58 &amp;amp; 0.055\,8 &amp;amp; 0.188 &amp;amp; 0 \\&lt;br /&gt;
0.000\,062 &amp;amp; 0.000\,62 &amp;amp; 0.006\,2 &amp;amp; 0.062 &amp;amp; 0 \\&lt;br /&gt;
\end{bmatrix}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Recrafted items ===&lt;br /&gt;
Once more we first check how many items are produced, which is, again, the sum of all possible ways to get to a tier, this time adding productivity &amp;lt;math&amp;gt;p_i&amp;lt;/math&amp;gt;, and bringing along all those items which are already legendary &amp;lt;math&amp;gt;n_{5,k}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\begin{align}&lt;br /&gt;
n_{1,k+1} &amp;amp;= m_{1,k+1} \cdot ( 1 + p_1 ) \cdot (1 - q_1)\\&lt;br /&gt;
n_{2,k+1} &amp;amp;= m_{1,k+1} \cdot ( 1 + p_1 ) \cdot q_1 \cdot 0.9 &amp;amp;+&amp;amp;  m_{2,k+1} \cdot ( 1 + p_2 ) \cdot (1 - q_2)\\&lt;br /&gt;
n_{3,k+1} &amp;amp;= m_{1,k+1} \cdot ( 1 + p_1 ) \cdot q_1 \cdot 0.09 &amp;amp;+&amp;amp;  m_{2,k+1} \cdot ( 1 + p_2 ) \cdot q_2 \cdot 0.9 &amp;amp;+&amp;amp; m_{3,k+1} \cdot ( 1 + p_3 ) \cdot (1 - q_3) \\&lt;br /&gt;
n_{4,k+1} &amp;amp;= m_{1,k+1} \cdot ( 1 + p_1 ) \cdot q_1 \cdot 0.009 &amp;amp;+&amp;amp;  m_{2,k+1} \cdot ( 1 + p_2 ) \cdot q_2 \cdot 0.09 &amp;amp;+&amp;amp; m_{3,k+1} \cdot ( 1 + p_3 ) \cdot q_3 \cdot 0.9  &amp;amp;+&amp;amp; m_{4,k+1} \cdot ( 1 + p_4) \cdot (1 - q_4) \\&lt;br /&gt;
n_{5,k+1} &amp;amp;= m_{1,k+1} \cdot ( 1 + p_1 ) \cdot q_1 \cdot 0.001 &amp;amp;+&amp;amp;  m_{2,k+1} \cdot ( 1 + p_2 ) \cdot q_2 \cdot 0.01 &amp;amp;+&amp;amp; m_{3,k+1} \cdot ( 1 + p_3 ) \cdot q_3 \cdot 0.1  &amp;amp;+&amp;amp; m_{4,k+1} \cdot ( 1 + p_4) \cdot q_4 &amp;amp;+&amp;amp; m_{5,k+1} \cdot ( 1 + p_5) + n_{5,k}\\&lt;br /&gt;
\end{align}&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This can once more be written as a vector-matrix-multiplication &amp;lt;math&amp;gt;\textbf{n}_{k+1} = \textbf{B} \,\textbf{m}_{k+1} + \textbf{C} \,\textbf{n}_{k}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\underbrace{\begin{bmatrix} n_{1,k+1}\\ n_{2,k+1}\\ n_{3,k+1}\\ n_{4,k+1}\\ n_{5,k+1}\\ \end{bmatrix}}_{\textbf{n}_{k+1}} = &lt;br /&gt;
\underbrace{\begin{bmatrix}&lt;br /&gt;
( 1 + p_1 ) \cdot (1 - q_1) &amp;amp; 0 &amp;amp; 0 &amp;amp; 0 &amp;amp; 0 \\&lt;br /&gt;
( 1 + p_1 ) \cdot q_1 \cdot 0.9 &amp;amp;  ( 1 + p_2 ) \cdot (1 - q_2) &amp;amp; 0 &amp;amp; 0 &amp;amp; 0 \\&lt;br /&gt;
( 1 + p_1 ) \cdot q_1 \cdot 0.09 &amp;amp; ( 1 + p_2 ) \cdot q_2 \cdot 0.9 &amp;amp; ( 1 + p_3 ) \cdot (1 - q_3) &amp;amp; 0 &amp;amp; 0 \\&lt;br /&gt;
( 1 + p_1 ) \cdot q_1 \cdot 0.009 &amp;amp; ( 1 + p_2 ) \cdot q_2 \cdot 0.09 &amp;amp; ( 1 + p_3 ) \cdot q_3 \cdot 0.9  &amp;amp; ( 1 + p_4) \cdot (1 - q_4) &amp;amp; 0 \\&lt;br /&gt;
( 1 + p_1 ) \cdot q_1 \cdot 0.001 &amp;amp; ( 1 + p_2 ) \cdot q_2 \cdot 0.01 &amp;amp; ( 1 + p_3 ) \cdot q_3 \cdot 0.1  &amp;amp; ( 1 + p_4) \cdot q_4 &amp;amp; ( 1 + p_5)\\&lt;br /&gt;
\end{bmatrix}}_{B}&lt;br /&gt;
\underbrace{\begin{bmatrix} m_{1,k+1}\\ m_{2,k+1}\\ m_{3,k+1}\\ m_{4,k+1}\\ m_{5,k+1}\\ \end{bmatrix}}_{\textbf{m}_{k+1}}&lt;br /&gt;
+&lt;br /&gt;
\underbrace{\begin{bmatrix}&lt;br /&gt;
0&amp;amp;0&amp;amp;0&amp;amp;0\\&lt;br /&gt;
0&amp;amp;0&amp;amp;0&amp;amp;0\\&lt;br /&gt;
0&amp;amp;0&amp;amp;0&amp;amp;0\\&lt;br /&gt;
0&amp;amp;0&amp;amp;0&amp;amp;0\\&lt;br /&gt;
0&amp;amp;0&amp;amp;0&amp;amp;1\\&lt;br /&gt;
\end{bmatrix}}_{\textbf{C}}&lt;br /&gt;
\underbrace{\begin{bmatrix} n_{1,k}\\ n_{2,k}\\ n_{3,k}\\ n_{4,k}\\ n_{5,k}\\ \end{bmatrix}}_{\textbf{n}_k}&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Combined model ===&lt;br /&gt;
&lt;br /&gt;
As such we gain an equation for the amount of items for every tier after any amount of iterations&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\begin{align}&lt;br /&gt;
\textbf{n}_{k+1} &lt;br /&gt;
    &amp;amp;= \textbf{B} \, \textbf{m}_{k+1} + \textbf{C} \, \textbf{n}_{k}\\&lt;br /&gt;
    &amp;amp;= \textbf{B} \, \textbf{A} \,\textbf{n}_{k} + \textbf{C} \, \textbf{n}_{k}\\&lt;br /&gt;
    &amp;amp;= (\textbf{B} \, \textbf{A} +\textbf{C} ) \, \textbf{n}_{k}\\&lt;br /&gt;
    &amp;amp;= \textbf{M} \, \textbf{n}_{k}\\&lt;br /&gt;
\textbf{n}_{k+2} &amp;amp;= \textbf{Q} \, \textbf{n}_{k+1} = \textbf{Q} \,  \textbf{Q} \, \textbf{n}_{k} = \textbf{Q}^2 \, \textbf{n}_{k}\\&lt;br /&gt;
&amp;amp;\vdots\\&lt;br /&gt;
\textbf{n}_k &amp;amp;= \textbf{Q}^k \, \textbf{n}_0\\&lt;br /&gt;
\end{align}&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
A realistic starting point for &amp;lt;math&amp;gt;\textbf{n}_0&amp;lt;/math&amp;gt; is only items in tier 1, and if we do not care for any other tiers, we simply choose sufficiently large &amp;lt;math&amp;gt;k = 100&amp;lt;/math&amp;gt;, and, through numeric means, try to maximize a single value. &amp;lt;math&amp;gt;q_{100,\text{crit}}&amp;lt;/math&amp;gt;, which falls in the fifth row, first column, of the Matrix &amp;lt;math&amp;gt;\textbf{Q}&amp;lt;/math&amp;gt; raised to the 100th power.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\begin{align}&lt;br /&gt;
\textbf{n}_k &amp;amp;= Q^k \, \textbf{n}_0\\&lt;br /&gt;
\begin{bmatrix}*\\ *\\ *\\ *\\ n_{5,100} \end{bmatrix} &amp;amp;= &lt;br /&gt;
\begin{bmatrix}&lt;br /&gt;
 * &amp;amp; * &amp;amp; * &amp;amp; * \\&lt;br /&gt;
 * &amp;amp; * &amp;amp; * &amp;amp; * \\&lt;br /&gt;
 * &amp;amp; * &amp;amp; * &amp;amp; * \\&lt;br /&gt;
 * &amp;amp; * &amp;amp; * &amp;amp; * \\&lt;br /&gt;
q_{100,\text{crit}} &amp;amp; * &amp;amp; * &amp;amp; * \\&lt;br /&gt;
\end{bmatrix} \begin{bmatrix}n_{1,0}\\ *\\ *\\ *\\ * \end{bmatrix}\\&lt;br /&gt;
\end{align}&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The choice of optimization method (simplex, branch and bound, etc.) itself is irrelevant, although most software will want the problem to be stated in a way so it can find a minimum, and may require the proper guard rails as to not pick values below 0 or higher than the maximum number of allowed modules.&lt;br /&gt;
&lt;br /&gt;
== Best ratios ==&lt;br /&gt;
This table shows the best ratio for quality to productivity modules in the crafting machines, while the recyclers always take only quality modules. The values are not given in whole numbers because often it is not just a single crafting machine per tier that will be used, then the ratios can change between different crafting machines in the same tier. e.g. &amp;quot;3.67 quality / 1.33 productivity&amp;quot; could have 4 machines where 3 have a ratio 4 to 1, and one a ratio 3 to 2.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tabber&amp;gt;&lt;br /&gt;
common modules = &lt;br /&gt;
&amp;quot;Modules in Tier X&amp;quot; means which Modules need to go into the machines that are set to produce the item at tier X.&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Crafting machine || Modules in Tier 1 || Modules in Tier 2 || Modules in Tier 3 || Modules in Tier 4 || Modules in Tier 5 || percentage yield || items recycled*&lt;br /&gt;
|-&lt;br /&gt;
| Chemical plant || 3 quality &amp;lt;br /&amp;gt;0 productivity || 3 quality &amp;lt;br /&amp;gt;0 productivity || 3 quality &amp;lt;br /&amp;gt;0 productivity || 3 quality &amp;lt;br /&amp;gt;0 productivity  || 0 quality &amp;lt;br /&amp;gt;3 productivity || 0.034014% || 2940&lt;br /&gt;
|-&lt;br /&gt;
| Assembling machine 3 || 4 quality &amp;lt;br /&amp;gt;0 productivity || 4 quality &amp;lt;br /&amp;gt;0 productivity || 4 quality &amp;lt;br /&amp;gt;0 productivity || 4 quality &amp;lt;br /&amp;gt;0 productivity  || 0 quality &amp;lt;br /&amp;gt;4 productivity || 0.046275% || 2161&lt;br /&gt;
|-&lt;br /&gt;
| Foundry || 4 quality &amp;lt;br /&amp;gt;0 productivity || 4 quality &amp;lt;br /&amp;gt;0 productivity || 4 quality &amp;lt;br /&amp;gt;0 productivity || 4 quality &amp;lt;br /&amp;gt;0 productivity  || 0 quality &amp;lt;br /&amp;gt;4 productivity || 0.133814% || 747&lt;br /&gt;
|-&lt;br /&gt;
| Electromagnetic plant || 5 quality &amp;lt;br /&amp;gt;0 productivity || 5 quality &amp;lt;br /&amp;gt;0 productivity || 5 quality &amp;lt;br /&amp;gt;0 productivity || 5 quality &amp;lt;br /&amp;gt;0 productivity  || 0 quality &amp;lt;br /&amp;gt;5 productivity || 0.176712% || 566&lt;br /&gt;
|-&lt;br /&gt;
| Cryogenic plant || 6 quality &amp;lt;br /&amp;gt;2 productivity || 6 quality &amp;lt;br /&amp;gt;2 productivity || 6 quality &amp;lt;br /&amp;gt;2 productivity || 6.5 quality &amp;lt;br /&amp;gt;1.5 productivity  || 0 quality &amp;lt;br /&amp;gt;8 productivity || 0.119134%|| 840&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;nowiki&amp;gt;*&amp;lt;/nowiki&amp;gt; &amp;quot;items recycled&amp;quot; quantifies how many items need to be crafted and put into the entire upcycler to yield a single legendary item, it doesn&#039;t account for those which get recycled multiple times.&lt;br /&gt;
\-\&lt;br /&gt;
uncommon modules = &lt;br /&gt;
&amp;quot;Modules in Tier X&amp;quot; means which Modules need to go into the machines that are set to produce the item at tier X.&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Crafting machine || Modules in Tier 1 || Modules in Tier 2 || Modules in Tier 3 || Modules in Tier 4 || Modules in Tier 5 || percentage yield || items recycled*&lt;br /&gt;
|-&lt;br /&gt;
| Chemical plant || 3 quality &amp;lt;br /&amp;gt;0 productivity || 3 quality &amp;lt;br /&amp;gt;0 productivity || 3 quality &amp;lt;br /&amp;gt;0 productivity || 3 quality &amp;lt;br /&amp;gt;0 productivity  || 0 quality &amp;lt;br /&amp;gt;3 productivity || 0.059498% || 1681&lt;br /&gt;
|-&lt;br /&gt;
| Assembling machine 3 || 3.75 quality &amp;lt;br /&amp;gt;0.25 productivity || 3.75 quality &amp;lt;br /&amp;gt;0.25 productivity || 3.8 quality &amp;lt;br /&amp;gt;0.2 productivity || 3.9 quality &amp;lt;br /&amp;gt;0.1 productivity  || 0 quality &amp;lt;br /&amp;gt;4 productivity || 0.082296% || 1216&lt;br /&gt;
|-&lt;br /&gt;
| Foundry || 4 quality &amp;lt;br /&amp;gt;0 productivity || 4 quality &amp;lt;br /&amp;gt;0 productivity || 4 quality &amp;lt;br /&amp;gt;0 productivity || 4 quality &amp;lt;br /&amp;gt;0 productivity  || 0 quality &amp;lt;br /&amp;gt;4 productivity || 0.243699% || 410&lt;br /&gt;
|-&lt;br /&gt;
| Electromagnetic plant || 4.7 quality &amp;lt;br /&amp;gt;0.3 productivity || 4.67 quality &amp;lt;br /&amp;gt;0.33 productivity || 4.75 quality &amp;lt;br /&amp;gt;0.25 productivity || 4.9 quality &amp;lt;br /&amp;gt;0.1 productivity  || 0 quality &amp;lt;br /&amp;gt;5 productivity || 0.324189% || 309&lt;br /&gt;
|-&lt;br /&gt;
| Cryogenic plant || 4.6 quality &amp;lt;br /&amp;gt;3.4 productivity || 4.6 quality &amp;lt;br /&amp;gt;3.4 productivity || 4.67 quality &amp;lt;br /&amp;gt;3.33 productivity  || 5 quality &amp;lt;br /&amp;gt;3 productivity  || 0 quality &amp;lt;br /&amp;gt;8 productivity || 0.257621% || 389&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;nowiki&amp;gt;*&amp;lt;/nowiki&amp;gt; &amp;quot;items recycled&amp;quot; quantifies how many items need to be crafted and put into the entire upcycler to yield a single legendary item, it doesn&#039;t account for those which get recycled multiple times.&lt;br /&gt;
\-\&lt;br /&gt;
rare modules = &lt;br /&gt;
&amp;quot;Modules in Tier X&amp;quot; means which Modules need to go into the machines that are set to produce the item at tier X.&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Crafting machine || Modules in Tier 1 || Modules in Tier 2 || Modules in Tier 3 || Modules in Tier 4 || Modules in Tier 5 || percentage yield || items recycled*&lt;br /&gt;
|-&lt;br /&gt;
| Chemical plant || 2.8 quality &amp;lt;br /&amp;gt;0.2 productivity || 2.8 quality &amp;lt;br /&amp;gt;0.2 productivity || 2.9 quality &amp;lt;br /&amp;gt;0.1 productivity || 2.9 quality &amp;lt;br /&amp;gt;0.1 productivity  || 0 quality &amp;lt;br /&amp;gt;3 productivity || 0.100660% || 994&lt;br /&gt;
|-&lt;br /&gt;
| Assembling machine 3 || 3 quality &amp;lt;br /&amp;gt;1 productivity || 3.1 quality &amp;lt;br /&amp;gt;0.9 productivity || 3.2 quality &amp;lt;br /&amp;gt;0.8 productivity || 3.33 quality &amp;lt;br /&amp;gt;0.67 productivity  || 0 quality &amp;lt;br /&amp;gt;4 productivity || 0.145220% || 689&lt;br /&gt;
|-&lt;br /&gt;
| Foundry || 3.5 quality &amp;lt;br /&amp;gt;0.5 productivity || 3.5 quality &amp;lt;br /&amp;gt;0.5 productivity || 3.6 quality &amp;lt;br /&amp;gt;0.4 productivity || 3.9 quality &amp;lt;br /&amp;gt;0.1 productivity  || 0 quality &amp;lt;br /&amp;gt;4 productivity || 0.424039% || 236&lt;br /&gt;
|-&lt;br /&gt;
| Electromagnetic plant || 3.6 quality &amp;lt;br /&amp;gt;1.4 productivity || 3.6 quality &amp;lt;br /&amp;gt;1.4 productivity || 3.6 quality &amp;lt;br /&amp;gt;1.4 productivity || 3.9 quality &amp;lt;br /&amp;gt;1.1 productivity  || 0 quality &amp;lt;br /&amp;gt;5 productivity || 0.588510% || 170&lt;br /&gt;
|-&lt;br /&gt;
| Cryogenic plant || 3.6 quality &amp;lt;br /&amp;gt;4.4 productivity || 3.6 quality &amp;lt;br /&amp;gt;4.4 productivity || 3.6 quality &amp;lt;br /&amp;gt;4.4 productivity  || 3.9 quality &amp;lt;br /&amp;gt;4.1 productivity  || 0 quality &amp;lt;br /&amp;gt;8 productivity || 0.565030% || 177&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;nowiki&amp;gt;*&amp;lt;/nowiki&amp;gt; &amp;quot;items recycled&amp;quot; quantifies how many items need to be crafted and put into the entire upcycler to yield a single legendary item, it doesn&#039;t account for those which get recycled multiple times.&lt;br /&gt;
\-\&lt;br /&gt;
epic modules = &lt;br /&gt;
&amp;quot;Modules in Tier X&amp;quot; means which Modules need to go into the machines that are set to produce the item at tier X.&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Crafting machine || Modules in Tier 1 || Modules in Tier 2 || Modules in Tier 3 || Modules in Tier 4 || Modules in Tier 5 || percentage yield || items recycled*&lt;br /&gt;
|-&lt;br /&gt;
| Chemical plant || 2.33 quality &amp;lt;br /&amp;gt;0.67 productivity || 2.4 quality &amp;lt;br /&amp;gt;0.6 productivity || 2.4 quality &amp;lt;br /&amp;gt;0.6 productivity || 2.4 quality &amp;lt;br /&amp;gt;0.6 productivity  || 0 quality &amp;lt;br /&amp;gt;3 productivity || 0.152486% || 656&lt;br /&gt;
|-&lt;br /&gt;
| Assembling machine 3 || 2.5 quality &amp;lt;br /&amp;gt;1.5 productivity || 2.5 quality &amp;lt;br /&amp;gt;1.5 productivity || 2.6 quality &amp;lt;br /&amp;gt;1.4 productivity || 2.8 quality &amp;lt;br /&amp;gt;1.2 productivity  || 0 quality &amp;lt;br /&amp;gt;4 productivity || 0.232966% || 430&lt;br /&gt;
|-&lt;br /&gt;
| Foundry || 2.7 quality &amp;lt;br /&amp;gt;1.3 productivity || 2.7 quality &amp;lt;br /&amp;gt;1.3 productivity || 2.75 quality &amp;lt;br /&amp;gt;1.25 productivity || 3 quality &amp;lt;br /&amp;gt;1 productivity  || 0 quality &amp;lt;br /&amp;gt;4 productivity || 0.664130% || 151&lt;br /&gt;
|-&lt;br /&gt;
| Electromagnetic plant || 2.6 quality &amp;lt;br /&amp;gt;2.4 productivity || 2.6 quality &amp;lt;br /&amp;gt;2.4 productivity || 2.67 quality &amp;lt;br /&amp;gt;2.33 productivity || 2.9 quality &amp;lt;br /&amp;gt;2.1 productivity  || 0 quality &amp;lt;br /&amp;gt;5 productivity || 0.974700% || 103&lt;br /&gt;
|-&lt;br /&gt;
| Cryogenic plant || 2.6 quality &amp;lt;br /&amp;gt;5.4 productivity || 2.6 quality &amp;lt;br /&amp;gt;5.4 productivity || 2.6 quality &amp;lt;br /&amp;gt;4.4 productivity  || 2.8 quality &amp;lt;br /&amp;gt;4.2 productivity  || 0 quality &amp;lt;br /&amp;gt;8 productivity || 1.122444% || 90&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;nowiki&amp;gt;*&amp;lt;/nowiki&amp;gt; &amp;quot;items recycled&amp;quot; quantifies how many items need to be crafted and put into the entire upcycler to yield a single legendary item, it doesn&#039;t account for those which get recycled multiple times.&lt;br /&gt;
\-\&lt;br /&gt;
legendary modules=&lt;br /&gt;
&amp;quot;Modules in Tier X&amp;quot; means which Modules need to go into the machines that are set to produce the item at tier X.&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Crafting machine || Modules in Tier 1 || Modules in Tier 2 || Modules in Tier 3 || Modules in Tier 4 || Modules in Tier 5 || percentage yield || items recycled*&lt;br /&gt;
|-&lt;br /&gt;
| Chemical plant || 1.67 quality &amp;lt;br /&amp;gt;1.33 productivity || 1.67 quality &amp;lt;br /&amp;gt;1.33 productivity || 1.67 quality &amp;lt;br /&amp;gt;1.333 productivity || 1.8 quality &amp;lt;br /&amp;gt;1.2 productivity  || 0 quality &amp;lt;br /&amp;gt;3 productivity || 0.344061% || 291&lt;br /&gt;
|-&lt;br /&gt;
| Assembling machine 3 || 1.67 quality &amp;lt;br /&amp;gt;2.33 productivity || 1.67 quality &amp;lt;br /&amp;gt;2.33 productivity || 1.67 quality &amp;lt;br /&amp;gt;2.33 productivity || 1.8 quality &amp;lt;br /&amp;gt;2.2 productivity  || 0 quality &amp;lt;br /&amp;gt;4 productivity || 0.586191% || 171&lt;br /&gt;
|-&lt;br /&gt;
| Foundry || 1.4 quality &amp;lt;br /&amp;gt;2.6 productivity || 1.4 quality &amp;lt;br /&amp;gt;2.6 productivity || 1.4 quality &amp;lt;br /&amp;gt;2.6 productivity || 1.5 quality &amp;lt;br /&amp;gt;2.5 productivity  || 0 quality &amp;lt;br /&amp;gt;4 productivity || 1.624266% || 62&lt;br /&gt;
|-&lt;br /&gt;
| Electromagnetic plant || 1 quality &amp;lt;br /&amp;gt;4 productivity || 1 quality &amp;lt;br /&amp;gt;4 productivity || 1 quality &amp;lt;br /&amp;gt;4 productivity || 1 quality &amp;lt;br /&amp;gt;4 productivity  || 0 quality &amp;lt;br /&amp;gt;5 productivity || 2.722332% || 37&lt;br /&gt;
|-&lt;br /&gt;
| Cryogenic plant || 0 quality &amp;lt;br /&amp;gt;8 productivity || 0 quality &amp;lt;br /&amp;gt;8 productivity || 0 quality &amp;lt;br /&amp;gt;8 productivity || 0 quality &amp;lt;br /&amp;gt;8 productivity  || 0 quality &amp;lt;br /&amp;gt;8 productivity || 4.835199% || 21&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;nowiki&amp;gt;*&amp;lt;/nowiki&amp;gt; &amp;quot;items recycled&amp;quot; quantifies how many items need to be crafted and put into the entire upcycler to yield a single legendary item, it doesn&#039;t account for those which get recycled multiple times.&lt;br /&gt;
&amp;lt;/tabber&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Number of crafting machines ===&lt;br /&gt;
If we assume a constant input stream of tier 1 items which will always fill back up, we can additionally figure out what ratio of items will be inside the system at once, and with that we can figure out how many crafting machines we need per tier. This is done by setting &amp;lt;math&amp;gt;m_{1,k+1} = 100 \, \% - m_{2,k+1} - m_{3,k+1} - m_{4,k+1}&amp;lt;/math&amp;gt; after each iteration.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tabber&amp;gt;&lt;br /&gt;
per recycler=&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Crafting machine || Recyclers || Machines producing Tier 1 items || Machines producing Tier 2 items || Machines producing Tier 3 items || Machines producing Tier 4 items || Machines producing Tier 5 items&lt;br /&gt;
|-&lt;br /&gt;
| Chemical plant || 1 || 3.4427 || 0.0290 || 1.0086 || 0.0077 || 0.2979&lt;br /&gt;
|-&lt;br /&gt;
| Assembling machine 3 || 1 || 3.3027 || 0.0365 || 1.0657 || 0.0108 || 0.3286&lt;br /&gt;
|-&lt;br /&gt;
| Foundry || 1 || 2.9551 || 0.0563 || 1.1528 || 0.0208 || 0.3653&lt;br /&gt;
|-&lt;br /&gt;
| Electromagnetic plant || 1 || 2.7239 || 0.0709 || 1.1726 || 0.0301 || 0.3474&lt;br /&gt;
|-&lt;br /&gt;
| Cryogenic plant || 1 || 2.3798 || 0.0972 || 1.1517 || 0.0470 || 0.2700&lt;br /&gt;
&lt;br /&gt;
|}&lt;br /&gt;
\-\&lt;br /&gt;
per tier 5 crafter (exact) =&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Crafting machine || Recyclers || Machines producing Tier 1 items || Machines producing Tier 2 items || Machines producing Tier 3 items || Machines producing Tier 4 items || Machines producing Tier 5 items&lt;br /&gt;
|-&lt;br /&gt;
| Chemical plant || 108.8978 || 374.9134 || 43.5367 || 12.7555 || 3.3856 || 1&lt;br /&gt;
|-&lt;br /&gt;
| Assembling machine 3 || 70.4576 || 232.7032 || 33.9340 || 10.9500 || 3.2432 || 1&lt;br /&gt;
|-&lt;br /&gt;
| Foundry || 33.0224 || 97.5872 || 21.8308 || 8.5164 || 3.1550 || 1&lt;br /&gt;
|-&lt;br /&gt;
| Electromagnetic plant || 24.1178 || 65.6959 || 18.4556 || 7.9448 || 3.3747 || 1&lt;br /&gt;
|-&lt;br /&gt;
| Cryogenic plant || 19.9316 || 47.4350 || 18.2124 || 8.8138 || 4.2654 || 1&lt;br /&gt;
|}&lt;br /&gt;
\-\&lt;br /&gt;
per tier 5 crafter (conservative)=&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Crafting machine || Recyclers || Machines producing Tier 1 items || Machines producing Tier 2 items || Machines producing Tier 3 items || Machines producing Tier 4 items || Machines producing Tier 5 items&lt;br /&gt;
|-&lt;br /&gt;
| Chemical plant || 92 || 318 || 37 || 11 || 3 || 1&lt;br /&gt;
|-&lt;br /&gt;
| Assembling machine 3 || 62 || 205 || 30 || 10 || 3 || 1&lt;br /&gt;
|-&lt;br /&gt;
| Foundry || 30 || 89 || 20 || 8 || 3 || 1&lt;br /&gt;
|-&lt;br /&gt;
| Electromagnetic plant || 20 || 56 || 16 || 7 || 3 || 1&lt;br /&gt;
|-&lt;br /&gt;
| Cryogenic plant || 17 || 41 || 16 || 8 || 4 || 1&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;/tabber&amp;gt;&lt;/div&gt;</summary>
		<author><name>Untitled7</name></author>
	</entry>
	<entry>
		<id>https://wiki.factorio.com/index.php?title=Tutorial:Quality_upcycling_math&amp;diff=207000</id>
		<title>Tutorial:Quality upcycling math</title>
		<link rel="alternate" type="text/html" href="https://wiki.factorio.com/index.php?title=Tutorial:Quality_upcycling_math&amp;diff=207000"/>
		<updated>2024-11-23T21:36:24Z</updated>

		<summary type="html">&lt;p&gt;Untitled7: /* Mathematical model */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;How do we get the most amount of [[Quality|legendary]] items out of an upcycling plant?&lt;br /&gt;
&lt;br /&gt;
The answer is not quite as straight forward as we&#039;d like it to be, because it depends on a number of factors, luckily there is a finite number of possibilities of what the modules can be, and for the sake of simplicity this tutorial will ignore the productivity gain from [[Technologies#Space_Age|infinite technologies]].&lt;br /&gt;
&lt;br /&gt;
== The crafting machines ==&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Crafting machine || Module slots &amp;lt;math&amp;gt;N&amp;lt;/math&amp;gt; || Base productivity bonus &amp;lt;math&amp;gt;p_0&amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| [[Chemical plant]] || 3 || +0%&lt;br /&gt;
|-&lt;br /&gt;
| [[Assembling machine 3]] || 4 || +0%&lt;br /&gt;
|-&lt;br /&gt;
| [[Foundry]] || 4 || +50%&lt;br /&gt;
|-&lt;br /&gt;
| [[Electromagnetic plant]] || 5 || +50%&lt;br /&gt;
|-&lt;br /&gt;
| [[Cryogenic plant]] || 8 || +0%&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Quality probability ==&lt;br /&gt;
When an item gets produced and the initial roll decides that the quality of the item will increase, there is a 90% chance it will rise one tier, a 9% chance it will rise two, a 0.9% chance it will rise three, and a 0.1% chance it will rise four. This is of course capped if the item already started out at a higher tier.&lt;br /&gt;
&lt;br /&gt;
== Mathematical model ==&lt;br /&gt;
The mathematical model is time discrete. As opposed to dealing with derivatives in respect to time, the next state is a direct function of the previous state.&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;math&amp;gt;m_{i,k}&amp;lt;/math&amp;gt; ... Number of materials of tier &amp;lt;math&amp;gt;i&amp;lt;/math&amp;gt; after the &amp;lt;math&amp;gt;k&amp;lt;/math&amp;gt;-th iteration before being crafted. (this doesn&#039;t mean that an item only needs one type of ingredient, but that &amp;quot;1 materials&amp;quot; can be crafted into 1 item from them)&lt;br /&gt;
* &amp;lt;math&amp;gt;n_{i,k}&amp;lt;/math&amp;gt; ... Number of items of tier &amp;lt;math&amp;gt;i&amp;lt;/math&amp;gt; after the &amp;lt;math&amp;gt;k&amp;lt;/math&amp;gt;-th iteration, after being crafted together.&lt;br /&gt;
* &amp;lt;math&amp;gt;p_0&amp;lt;/math&amp;gt; ... the crafting machines inherent productivity bonus&lt;br /&gt;
* &amp;lt;math&amp;gt;N&amp;lt;/math&amp;gt; ... number of modules the crafting machine can hold&lt;br /&gt;
* &amp;lt;math&amp;gt;q_r = 4 \cdot 6.2 \, \% = 0.248&amp;lt;/math&amp;gt; ... quality probability of the recyclers with 4 [[quality module 3]]&#039;s (6.2% is the chance of a legendary tier quality module 3)&lt;br /&gt;
* &amp;lt;math&amp;gt;p_i = p_0 + x_i \cdot 25 \, \%&amp;lt;/math&amp;gt; ... productivity due to &amp;lt;math&amp;gt;x_i&amp;lt;/math&amp;gt; legendary [[productivity module 3]]&#039;s in the crafting machine which takes &amp;lt;math&amp;gt;i&amp;lt;/math&amp;gt;-tier materials (25% is the productivity boost of a legendary tier productivity module 3)&lt;br /&gt;
* &amp;lt;math&amp;gt;q_i = (N-x_i) \cdot 6.2 \, \%&amp;lt;/math&amp;gt; ... quality probability due to &amp;lt;math&amp;gt;(N - x_i)&amp;lt;/math&amp;gt; legendary quality module 3&#039;s in the crafting machine which takes &amp;lt;math&amp;gt;i&amp;lt;/math&amp;gt;-tier materials&lt;br /&gt;
&lt;br /&gt;
=== Recycled materials ===&lt;br /&gt;
When a quarter of all items being recycled and the quality probability rules we can write the equations for the amount of materials received after recycling. This calculation is rather simple, as we the lowest tier can only come forth from it&#039;s own tier failing to raise in quality. The second tier are 90% of tier 1 items that did increase, and all those tier 2 items that didn&#039;t. This continues for all tiers as follows, but legendary items &amp;lt;math&amp;gt;n_{5,k}&amp;lt;/math&amp;gt; will not be recycled&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\begin{align}&lt;br /&gt;
m_{1,k+1} &amp;amp;= \frac{n_{1,k}}{4} \cdot (1 - q_r)\\&lt;br /&gt;
m_{2,k+1} &amp;amp;= \frac{n_{1,k}}{4} \cdot q_r \cdot 0.9 &amp;amp;+&amp;amp; \frac{n_{2,k}}{4} \cdot (1 - q_r)\\&lt;br /&gt;
m_{3,k+1} &amp;amp;= \frac{n_{1,k}}{4} \cdot q_r \cdot 0.09 &amp;amp;+&amp;amp; \frac{n_{2,k}}{4} \cdot q_r \cdot 0.9 &amp;amp;+&amp;amp; \frac{n_{3,k}}{4} \cdot (1 - q_r)\\&lt;br /&gt;
m_{4,k+1} &amp;amp;= \frac{n_{1,k}}{4} \cdot q_r \cdot 0.009 &amp;amp;+&amp;amp; \frac{n_{2,k}}{4} \cdot q_r \cdot 0.09 &amp;amp;+&amp;amp; \frac{n_{3,k}}{4} \cdot q_r \cdot 0.9 &amp;amp;+&amp;amp; \frac{n_{4,k}}{4} \cdot (1 - q_r)\\&lt;br /&gt;
m_{5,k+1} &amp;amp;= \frac{n_{1,k}}{4} \cdot q_r \cdot 0.001 &amp;amp;+&amp;amp; \frac{n_{2,k}}{4} \cdot q_r \cdot 0.01 &amp;amp;+&amp;amp; \frac{n_{3,k}}{4} \cdot q_r \cdot 0.1 &amp;amp;+&amp;amp; \frac{n_{4,k}}{4} \cdot q_r\\&lt;br /&gt;
\end{align}&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
which can also be written as a vector-matrix-multiplication &amp;lt;math&amp;gt;\textbf{m}_{k+1} = \textbf{A} \,\textbf{n}_k&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\underbrace{\begin{bmatrix} m_{1,k+1}\\ m_{2,k+1}\\ m_{3,k+1}\\ m_{4,k+1}\\ m_{5,k+1}\\ \end{bmatrix}}_{\textbf{m}_{k+1}}&lt;br /&gt;
=&lt;br /&gt;
\underbrace{\begin{bmatrix}&lt;br /&gt;
\frac{1 - q_r}{4} &amp;amp; 0 &amp;amp; 0 &amp;amp; 0 &amp;amp; 0\\&lt;br /&gt;
\frac{0.9 \, q_r}{4}   &amp;amp; \frac{1 - q_r}{4} &amp;amp; 0 &amp;amp; 0 &amp;amp; 0\\&lt;br /&gt;
\frac{0.09 \, q_r}{4}  &amp;amp; \frac{0.9 \, q_r}{4}  &amp;amp; \frac{1 - q_r}{4} &amp;amp; 0 &amp;amp; 0 \\&lt;br /&gt;
\frac{0.009 \, q_r}{4} &amp;amp; \frac{0.09 \, q_r}{4} &amp;amp; \frac{0.9 \, q_r}{4} &amp;amp; \frac{1 - q_r}{4} &amp;amp; 0\\&lt;br /&gt;
\frac{0.001 \, q_r}{4} &amp;amp; \frac{0.01 \, q_r}{4} &amp;amp; \frac{0.1 \, q_r}{4} &amp;amp; \frac{q_r}{4} &amp;amp; 0\\&lt;br /&gt;
\end{bmatrix}}_{\textbf{A}}&lt;br /&gt;
\underbrace{\begin{bmatrix} n_{1,k}\\ n_{2,k}\\ n_{3,k}\\ n_{4,k}\\ n_{5,k}\\ \end{bmatrix}}_{\textbf{n}_k}&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As we assume there is nothing to be done about recyclers to make them more effective but fill them with all quality modules, the value of &amp;lt;math&amp;gt;q_r = 0.248&amp;lt;/math&amp;gt; is a constant, and therefore the matrix &amp;lt;math&amp;gt;\textbf{A}&amp;lt;/math&amp;gt; is also a constant. For legendary quality module 3&#039;s, it looks like:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \textbf{A} = &lt;br /&gt;
\begin{bmatrix}&lt;br /&gt;
0.188 &amp;amp; 0 &amp;amp; 0 &amp;amp; 0 &amp;amp; 0 \\&lt;br /&gt;
0.055\,8 &amp;amp; 0.188 &amp;amp; 0 &amp;amp; 0 &amp;amp; 0 \\&lt;br /&gt;
0.005\,58 &amp;amp; 0.055\,8 &amp;amp; 0.188 &amp;amp; 0 &amp;amp; 0 \\&lt;br /&gt;
0.000\,558 &amp;amp; 0.005\,58 &amp;amp; 0.055\,8 &amp;amp; 0.188 &amp;amp; 0 \\&lt;br /&gt;
0.000\,062 &amp;amp; 0.000\,62 &amp;amp; 0.006\,2 &amp;amp; 0.062 &amp;amp; 0 \\&lt;br /&gt;
\end{bmatrix}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Recrafted items ===&lt;br /&gt;
Once more we first check how many items are produced, which is, again, the sum of all possible ways to get to a tier, this time adding productivity &amp;lt;math&amp;gt;p_i&amp;lt;/math&amp;gt;, and bringing along all those items which are already legendary &amp;lt;math&amp;gt;n_{5,k}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\begin{align}&lt;br /&gt;
n_{1,k+1} &amp;amp;= m_{1,k+1} \cdot ( 1 + p_1 ) \cdot (1 - q_1)\\&lt;br /&gt;
n_{2,k+1} &amp;amp;= m_{1,k+1} \cdot ( 1 + p_1 ) \cdot q_1 \cdot 0.9 &amp;amp;+&amp;amp;  m_{2,k+1} \cdot ( 1 + p_2 ) \cdot (1 - q_2)\\&lt;br /&gt;
n_{3,k+1} &amp;amp;= m_{1,k+1} \cdot ( 1 + p_1 ) \cdot q_1 \cdot 0.09 &amp;amp;+&amp;amp;  m_{2,k+1} \cdot ( 1 + p_2 ) \cdot q_2 \cdot 0.9 &amp;amp;+&amp;amp; m_{3,k+1} \cdot ( 1 + p_3 ) \cdot (1 - q_3) \\&lt;br /&gt;
n_{4,k+1} &amp;amp;= m_{1,k+1} \cdot ( 1 + p_1 ) \cdot q_1 \cdot 0.009 &amp;amp;+&amp;amp;  m_{2,k+1} \cdot ( 1 + p_2 ) \cdot q_2 \cdot 0.09 &amp;amp;+&amp;amp; m_{3,k+1} \cdot ( 1 + p_3 ) \cdot q_3 \cdot 0.9  &amp;amp;+&amp;amp; m_{4,k+1} \cdot ( 1 + p_4) \cdot (1 - q_4) \\&lt;br /&gt;
n_{5,k+1} &amp;amp;= m_{1,k+1} \cdot ( 1 + p_1 ) \cdot q_1 \cdot 0.001 &amp;amp;+&amp;amp;  m_{2,k+1} \cdot ( 1 + p_2 ) \cdot q_2 \cdot 0.01 &amp;amp;+&amp;amp; m_{3,k+1} \cdot ( 1 + p_3 ) \cdot q_3 \cdot 0.1  &amp;amp;+&amp;amp; m_{4,k+1} \cdot ( 1 + p_4) \cdot q_4 &amp;amp;+&amp;amp; m_{5,k+1} \cdot ( 1 + p_5) + n_{5,k}\\&lt;br /&gt;
\end{align}&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This can once more be written as a vector-matrix-multiplication &amp;lt;math&amp;gt;\textbf{n}_{k+1} = \textbf{B} \,\textbf{m}_{k+1} + \textbf{C} \,\textbf{n}_{k}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\underbrace{\begin{bmatrix} n_{1,k+1}\\ n_{2,k+1}\\ n_{3,k+1}\\ n_{4,k+1}\\ n_{5,k+1}\\ \end{bmatrix}}_{\textbf{n}_{k+1}} = &lt;br /&gt;
\underbrace{\begin{bmatrix}&lt;br /&gt;
( 1 + p_1 ) \cdot (1 - q_1) &amp;amp; 0 &amp;amp; 0 &amp;amp; 0 &amp;amp; 0 \\&lt;br /&gt;
( 1 + p_1 ) \cdot q_1 \cdot 0.9 &amp;amp;  ( 1 + p_2 ) \cdot (1 - q_2) &amp;amp; 0 &amp;amp; 0 &amp;amp; 0 \\&lt;br /&gt;
( 1 + p_1 ) \cdot q_1 \cdot 0.09 &amp;amp; ( 1 + p_2 ) \cdot q_2 \cdot 0.9 &amp;amp; ( 1 + p_3 ) \cdot (1 - q_3) &amp;amp; 0 &amp;amp; 0 \\&lt;br /&gt;
( 1 + p_1 ) \cdot q_1 \cdot 0.009 &amp;amp; ( 1 + p_2 ) \cdot q_2 \cdot 0.09 &amp;amp; ( 1 + p_3 ) \cdot q_3 \cdot 0.9  &amp;amp; ( 1 + p_4) \cdot (1 - q_4) &amp;amp; 0 \\&lt;br /&gt;
( 1 + p_1 ) \cdot q_1 \cdot 0.001 &amp;amp; ( 1 + p_2 ) \cdot q_2 \cdot 0.01 &amp;amp; ( 1 + p_3 ) \cdot q_3 \cdot 0.1  &amp;amp; ( 1 + p_4) \cdot q_4 &amp;amp; ( 1 + p_5)\\&lt;br /&gt;
\end{bmatrix}}_{B}&lt;br /&gt;
\underbrace{\begin{bmatrix} m_{1,k+1}\\ m_{2,k+1}\\ m_{3,k+1}\\ m_{4,k+1}\\ m_{5,k+1}\\ \end{bmatrix}}_{\textbf{m}_{k+1}}&lt;br /&gt;
+&lt;br /&gt;
\begin{bmatrix}&lt;br /&gt;
0&amp;amp;0&amp;amp;0&amp;amp;0\\&lt;br /&gt;
0&amp;amp;0&amp;amp;0&amp;amp;0\\&lt;br /&gt;
0&amp;amp;0&amp;amp;0&amp;amp;0\\&lt;br /&gt;
0&amp;amp;0&amp;amp;0&amp;amp;0\\&lt;br /&gt;
0&amp;amp;0&amp;amp;0&amp;amp;1\\&lt;br /&gt;
\end{bmatrix}&lt;br /&gt;
\underbrace{\begin{bmatrix} n_{1,k}\\ n_{2,k}\\ n_{3,k}\\ n_{4,k}\\ n_{5,k}\\ \end{bmatrix}}_{\textbf{n}_k}&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Combined model ===&lt;br /&gt;
&lt;br /&gt;
As such we gain an equation for the amount of items for every tier after any amount of iterations&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\begin{align}&lt;br /&gt;
\textbf{n}_{k+1} &lt;br /&gt;
    &amp;amp;= \textbf{B} \, \textbf{m}_{k+1} + \textbf{C} \, \textbf{n}_{k}\\&lt;br /&gt;
    &amp;amp;= \textbf{B} \, \textbf{A} \,\textbf{n}_{k} + \textbf{C} \, \textbf{n}_{k}\\&lt;br /&gt;
    &amp;amp;= (\textbf{B} \, \textbf{A} +\textbf{C} ) \, \textbf{n}_{k}\\&lt;br /&gt;
    &amp;amp;= \textbf{M} \, \textbf{n}_{k}\\&lt;br /&gt;
\textbf{n}_{k+2} &amp;amp;= \textbf{Q} \, \textbf{n}_{k+1} = \textbf{Q} \,  \textbf{Q} \, \textbf{n}_{k} = \textbf{Q}^2 \, \textbf{n}_{k}\\&lt;br /&gt;
&amp;amp;\vdots\\&lt;br /&gt;
\textbf{n}_k &amp;amp;= \textbf{Q}^k \, \textbf{n}_0\\&lt;br /&gt;
\end{align}&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
A realistic starting point for &amp;lt;math&amp;gt;\textbf{n}_0&amp;lt;/math&amp;gt; is only items in tier 1, and if we do not care for any other tiers, we simply choose sufficiently large &amp;lt;math&amp;gt;k = 100&amp;lt;/math&amp;gt;, and, through numeric means, try to maximize a single value. &amp;lt;math&amp;gt;q_{100,\text{crit}}&amp;lt;/math&amp;gt;, which falls in the fifth row, first column, of the Matrix &amp;lt;math&amp;gt;\textbf{Q}&amp;lt;/math&amp;gt; raised to the 100th power.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\begin{align}&lt;br /&gt;
\textbf{n}_k &amp;amp;= Q^k \, \textbf{n}_0\\&lt;br /&gt;
\begin{bmatrix}*\\ *\\ *\\ *\\ n_{5,100} \end{bmatrix} &amp;amp;= &lt;br /&gt;
\begin{bmatrix}&lt;br /&gt;
 * &amp;amp; * &amp;amp; * &amp;amp; * \\&lt;br /&gt;
 * &amp;amp; * &amp;amp; * &amp;amp; * \\&lt;br /&gt;
 * &amp;amp; * &amp;amp; * &amp;amp; * \\&lt;br /&gt;
 * &amp;amp; * &amp;amp; * &amp;amp; * \\&lt;br /&gt;
q_{100,\text{crit}} &amp;amp; * &amp;amp; * &amp;amp; * \\&lt;br /&gt;
\end{bmatrix} \begin{bmatrix}n_{1,0}\\ *\\ *\\ *\\ * \end{bmatrix}\\&lt;br /&gt;
\end{align}&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The choice of optimization method (simplex, branch and bound, etc.) itself is irrelevant, although most software will want the problem to be stated in a way so it can find a minimum, and may require the proper guard rails as to not pick values below 0 or higher than the maximum number of allowed modules.&lt;br /&gt;
&lt;br /&gt;
== Best ratios ==&lt;br /&gt;
This table shows the best ratio for quality to productivity modules in the crafting machines, while the recyclers always take only quality modules. The values are not given in whole numbers because often it is not just a single crafting machine per tier that will be used, then the ratios can change between different crafting machines in the same tier. e.g. &amp;quot;3.67 quality / 1.33 productivity&amp;quot; could have 4 machines where 3 have a ratio 4 to 1, and one a ratio 3 to 2.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tabber&amp;gt;&lt;br /&gt;
common modules = &lt;br /&gt;
&amp;quot;Modules in Tier X&amp;quot; means which Modules need to go into the machines that are set to produce the item at tier X.&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Crafting machine || Modules in Tier 1 || Modules in Tier 2 || Modules in Tier 3 || Modules in Tier 4 || Modules in Tier 5 || percentage yield || items recycled*&lt;br /&gt;
|-&lt;br /&gt;
| Chemical plant || 3 quality &amp;lt;br /&amp;gt;0 productivity || 3 quality &amp;lt;br /&amp;gt;0 productivity || 3 quality &amp;lt;br /&amp;gt;0 productivity || 3 quality &amp;lt;br /&amp;gt;0 productivity  || 0 quality &amp;lt;br /&amp;gt;3 productivity || 0.034014% || 2940&lt;br /&gt;
|-&lt;br /&gt;
| Assembling machine 3 || 4 quality &amp;lt;br /&amp;gt;0 productivity || 4 quality &amp;lt;br /&amp;gt;0 productivity || 4 quality &amp;lt;br /&amp;gt;0 productivity || 4 quality &amp;lt;br /&amp;gt;0 productivity  || 0 quality &amp;lt;br /&amp;gt;4 productivity || 0.046275% || 2161&lt;br /&gt;
|-&lt;br /&gt;
| Foundry || 4 quality &amp;lt;br /&amp;gt;0 productivity || 4 quality &amp;lt;br /&amp;gt;0 productivity || 4 quality &amp;lt;br /&amp;gt;0 productivity || 4 quality &amp;lt;br /&amp;gt;0 productivity  || 0 quality &amp;lt;br /&amp;gt;4 productivity || 0.133814% || 747&lt;br /&gt;
|-&lt;br /&gt;
| Electromagnetic plant || 5 quality &amp;lt;br /&amp;gt;0 productivity || 5 quality &amp;lt;br /&amp;gt;0 productivity || 5 quality &amp;lt;br /&amp;gt;0 productivity || 5 quality &amp;lt;br /&amp;gt;0 productivity  || 0 quality &amp;lt;br /&amp;gt;5 productivity || 0.176712% || 566&lt;br /&gt;
|-&lt;br /&gt;
| Cryogenic plant || 6 quality &amp;lt;br /&amp;gt;2 productivity || 6 quality &amp;lt;br /&amp;gt;2 productivity || 6 quality &amp;lt;br /&amp;gt;2 productivity || 6.5 quality &amp;lt;br /&amp;gt;1.5 productivity  || 0 quality &amp;lt;br /&amp;gt;8 productivity || 0.119134%|| 840&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;nowiki&amp;gt;*&amp;lt;/nowiki&amp;gt; &amp;quot;items recycled&amp;quot; quantifies how many items need to be crafted and put into the entire upcycler to yield a single legendary item, it doesn&#039;t account for those which get recycled multiple times.&lt;br /&gt;
\-\&lt;br /&gt;
uncommon modules = &lt;br /&gt;
&amp;quot;Modules in Tier X&amp;quot; means which Modules need to go into the machines that are set to produce the item at tier X.&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Crafting machine || Modules in Tier 1 || Modules in Tier 2 || Modules in Tier 3 || Modules in Tier 4 || Modules in Tier 5 || percentage yield || items recycled*&lt;br /&gt;
|-&lt;br /&gt;
| Chemical plant || 3 quality &amp;lt;br /&amp;gt;0 productivity || 3 quality &amp;lt;br /&amp;gt;0 productivity || 3 quality &amp;lt;br /&amp;gt;0 productivity || 3 quality &amp;lt;br /&amp;gt;0 productivity  || 0 quality &amp;lt;br /&amp;gt;3 productivity || 0.059498% || 1681&lt;br /&gt;
|-&lt;br /&gt;
| Assembling machine 3 || 3.75 quality &amp;lt;br /&amp;gt;0.25 productivity || 3.75 quality &amp;lt;br /&amp;gt;0.25 productivity || 3.8 quality &amp;lt;br /&amp;gt;0.2 productivity || 3.9 quality &amp;lt;br /&amp;gt;0.1 productivity  || 0 quality &amp;lt;br /&amp;gt;4 productivity || 0.082296% || 1216&lt;br /&gt;
|-&lt;br /&gt;
| Foundry || 4 quality &amp;lt;br /&amp;gt;0 productivity || 4 quality &amp;lt;br /&amp;gt;0 productivity || 4 quality &amp;lt;br /&amp;gt;0 productivity || 4 quality &amp;lt;br /&amp;gt;0 productivity  || 0 quality &amp;lt;br /&amp;gt;4 productivity || 0.243699% || 410&lt;br /&gt;
|-&lt;br /&gt;
| Electromagnetic plant || 4.7 quality &amp;lt;br /&amp;gt;0.3 productivity || 4.67 quality &amp;lt;br /&amp;gt;0.33 productivity || 4.75 quality &amp;lt;br /&amp;gt;0.25 productivity || 4.9 quality &amp;lt;br /&amp;gt;0.1 productivity  || 0 quality &amp;lt;br /&amp;gt;5 productivity || 0.324189% || 309&lt;br /&gt;
|-&lt;br /&gt;
| Cryogenic plant || 4.6 quality &amp;lt;br /&amp;gt;3.4 productivity || 4.6 quality &amp;lt;br /&amp;gt;3.4 productivity || 4.67 quality &amp;lt;br /&amp;gt;3.33 productivity  || 5 quality &amp;lt;br /&amp;gt;3 productivity  || 0 quality &amp;lt;br /&amp;gt;8 productivity || 0.257621% || 389&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;nowiki&amp;gt;*&amp;lt;/nowiki&amp;gt; &amp;quot;items recycled&amp;quot; quantifies how many items need to be crafted and put into the entire upcycler to yield a single legendary item, it doesn&#039;t account for those which get recycled multiple times.&lt;br /&gt;
\-\&lt;br /&gt;
rare modules = &lt;br /&gt;
&amp;quot;Modules in Tier X&amp;quot; means which Modules need to go into the machines that are set to produce the item at tier X.&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Crafting machine || Modules in Tier 1 || Modules in Tier 2 || Modules in Tier 3 || Modules in Tier 4 || Modules in Tier 5 || percentage yield || items recycled*&lt;br /&gt;
|-&lt;br /&gt;
| Chemical plant || 2.8 quality &amp;lt;br /&amp;gt;0.2 productivity || 2.8 quality &amp;lt;br /&amp;gt;0.2 productivity || 2.9 quality &amp;lt;br /&amp;gt;0.1 productivity || 2.9 quality &amp;lt;br /&amp;gt;0.1 productivity  || 0 quality &amp;lt;br /&amp;gt;3 productivity || 0.100660% || 994&lt;br /&gt;
|-&lt;br /&gt;
| Assembling machine 3 || 3 quality &amp;lt;br /&amp;gt;1 productivity || 3.1 quality &amp;lt;br /&amp;gt;0.9 productivity || 3.2 quality &amp;lt;br /&amp;gt;0.8 productivity || 3.33 quality &amp;lt;br /&amp;gt;0.67 productivity  || 0 quality &amp;lt;br /&amp;gt;4 productivity || 0.145220% || 689&lt;br /&gt;
|-&lt;br /&gt;
| Foundry || 3.5 quality &amp;lt;br /&amp;gt;0.5 productivity || 3.5 quality &amp;lt;br /&amp;gt;0.5 productivity || 3.6 quality &amp;lt;br /&amp;gt;0.4 productivity || 3.9 quality &amp;lt;br /&amp;gt;0.1 productivity  || 0 quality &amp;lt;br /&amp;gt;4 productivity || 0.424039% || 236&lt;br /&gt;
|-&lt;br /&gt;
| Electromagnetic plant || 3.6 quality &amp;lt;br /&amp;gt;1.4 productivity || 3.6 quality &amp;lt;br /&amp;gt;1.4 productivity || 3.6 quality &amp;lt;br /&amp;gt;1.4 productivity || 3.9 quality &amp;lt;br /&amp;gt;1.1 productivity  || 0 quality &amp;lt;br /&amp;gt;5 productivity || 0.588510% || 170&lt;br /&gt;
|-&lt;br /&gt;
| Cryogenic plant || 3.6 quality &amp;lt;br /&amp;gt;4.4 productivity || 3.6 quality &amp;lt;br /&amp;gt;4.4 productivity || 3.6 quality &amp;lt;br /&amp;gt;4.4 productivity  || 3.9 quality &amp;lt;br /&amp;gt;4.1 productivity  || 0 quality &amp;lt;br /&amp;gt;8 productivity || 0.565030% || 177&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;nowiki&amp;gt;*&amp;lt;/nowiki&amp;gt; &amp;quot;items recycled&amp;quot; quantifies how many items need to be crafted and put into the entire upcycler to yield a single legendary item, it doesn&#039;t account for those which get recycled multiple times.&lt;br /&gt;
\-\&lt;br /&gt;
epic modules = &lt;br /&gt;
&amp;quot;Modules in Tier X&amp;quot; means which Modules need to go into the machines that are set to produce the item at tier X.&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Crafting machine || Modules in Tier 1 || Modules in Tier 2 || Modules in Tier 3 || Modules in Tier 4 || Modules in Tier 5 || percentage yield || items recycled*&lt;br /&gt;
|-&lt;br /&gt;
| Chemical plant || 2.33 quality &amp;lt;br /&amp;gt;0.67 productivity || 2.4 quality &amp;lt;br /&amp;gt;0.6 productivity || 2.4 quality &amp;lt;br /&amp;gt;0.6 productivity || 2.4 quality &amp;lt;br /&amp;gt;0.6 productivity  || 0 quality &amp;lt;br /&amp;gt;3 productivity || 0.152486% || 656&lt;br /&gt;
|-&lt;br /&gt;
| Assembling machine 3 || 2.5 quality &amp;lt;br /&amp;gt;1.5 productivity || 2.5 quality &amp;lt;br /&amp;gt;1.5 productivity || 2.6 quality &amp;lt;br /&amp;gt;1.4 productivity || 2.8 quality &amp;lt;br /&amp;gt;1.2 productivity  || 0 quality &amp;lt;br /&amp;gt;4 productivity || 0.232966% || 430&lt;br /&gt;
|-&lt;br /&gt;
| Foundry || 2.7 quality &amp;lt;br /&amp;gt;1.3 productivity || 2.7 quality &amp;lt;br /&amp;gt;1.3 productivity || 2.75 quality &amp;lt;br /&amp;gt;1.25 productivity || 3 quality &amp;lt;br /&amp;gt;1 productivity  || 0 quality &amp;lt;br /&amp;gt;4 productivity || 0.664130% || 151&lt;br /&gt;
|-&lt;br /&gt;
| Electromagnetic plant || 2.6 quality &amp;lt;br /&amp;gt;2.4 productivity || 2.6 quality &amp;lt;br /&amp;gt;2.4 productivity || 2.67 quality &amp;lt;br /&amp;gt;2.33 productivity || 2.9 quality &amp;lt;br /&amp;gt;2.1 productivity  || 0 quality &amp;lt;br /&amp;gt;5 productivity || 0.974700% || 103&lt;br /&gt;
|-&lt;br /&gt;
| Cryogenic plant || 2.6 quality &amp;lt;br /&amp;gt;5.4 productivity || 2.6 quality &amp;lt;br /&amp;gt;5.4 productivity || 2.6 quality &amp;lt;br /&amp;gt;4.4 productivity  || 2.8 quality &amp;lt;br /&amp;gt;4.2 productivity  || 0 quality &amp;lt;br /&amp;gt;8 productivity || 1.122444% || 90&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;nowiki&amp;gt;*&amp;lt;/nowiki&amp;gt; &amp;quot;items recycled&amp;quot; quantifies how many items need to be crafted and put into the entire upcycler to yield a single legendary item, it doesn&#039;t account for those which get recycled multiple times.&lt;br /&gt;
\-\&lt;br /&gt;
legendary modules=&lt;br /&gt;
&amp;quot;Modules in Tier X&amp;quot; means which Modules need to go into the machines that are set to produce the item at tier X.&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Crafting machine || Modules in Tier 1 || Modules in Tier 2 || Modules in Tier 3 || Modules in Tier 4 || Modules in Tier 5 || percentage yield || items recycled*&lt;br /&gt;
|-&lt;br /&gt;
| Chemical plant || 1.67 quality &amp;lt;br /&amp;gt;1.33 productivity || 1.67 quality &amp;lt;br /&amp;gt;1.33 productivity || 1.67 quality &amp;lt;br /&amp;gt;1.333 productivity || 1.8 quality &amp;lt;br /&amp;gt;1.2 productivity  || 0 quality &amp;lt;br /&amp;gt;3 productivity || 0.344061% || 291&lt;br /&gt;
|-&lt;br /&gt;
| Assembling machine 3 || 1.67 quality &amp;lt;br /&amp;gt;2.33 productivity || 1.67 quality &amp;lt;br /&amp;gt;2.33 productivity || 1.67 quality &amp;lt;br /&amp;gt;2.33 productivity || 1.8 quality &amp;lt;br /&amp;gt;2.2 productivity  || 0 quality &amp;lt;br /&amp;gt;4 productivity || 0.586191% || 171&lt;br /&gt;
|-&lt;br /&gt;
| Foundry || 1.4 quality &amp;lt;br /&amp;gt;2.6 productivity || 1.4 quality &amp;lt;br /&amp;gt;2.6 productivity || 1.4 quality &amp;lt;br /&amp;gt;2.6 productivity || 1.5 quality &amp;lt;br /&amp;gt;2.5 productivity  || 0 quality &amp;lt;br /&amp;gt;4 productivity || 1.624266% || 62&lt;br /&gt;
|-&lt;br /&gt;
| Electromagnetic plant || 1 quality &amp;lt;br /&amp;gt;4 productivity || 1 quality &amp;lt;br /&amp;gt;4 productivity || 1 quality &amp;lt;br /&amp;gt;4 productivity || 1 quality &amp;lt;br /&amp;gt;4 productivity  || 0 quality &amp;lt;br /&amp;gt;5 productivity || 2.722332% || 37&lt;br /&gt;
|-&lt;br /&gt;
| Cryogenic plant || 0 quality &amp;lt;br /&amp;gt;8 productivity || 0 quality &amp;lt;br /&amp;gt;8 productivity || 0 quality &amp;lt;br /&amp;gt;8 productivity || 0 quality &amp;lt;br /&amp;gt;8 productivity  || 0 quality &amp;lt;br /&amp;gt;8 productivity || 4.835199% || 21&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;nowiki&amp;gt;*&amp;lt;/nowiki&amp;gt; &amp;quot;items recycled&amp;quot; quantifies how many items need to be crafted and put into the entire upcycler to yield a single legendary item, it doesn&#039;t account for those which get recycled multiple times.&lt;br /&gt;
&amp;lt;/tabber&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Number of crafting machines ===&lt;br /&gt;
If we assume a constant input stream of tier 1 items which will always fill back up, we can additionally figure out what ratio of items will be inside the system at once, and with that we can figure out how many crafting machines we need per tier. This is done by setting &amp;lt;math&amp;gt;m_{1,k+1} = 100 \, \% - m_{2,k+1} - m_{3,k+1} - m_{4,k+1}&amp;lt;/math&amp;gt; after each iteration.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tabber&amp;gt;&lt;br /&gt;
per recycler=&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Crafting machine || Recyclers || Machines producing Tier 1 items || Machines producing Tier 2 items || Machines producing Tier 3 items || Machines producing Tier 4 items || Machines producing Tier 5 items&lt;br /&gt;
|-&lt;br /&gt;
| Chemical plant || 1 || 3.4427 || 0.0290 || 1.0086 || 0.0077 || 0.2979&lt;br /&gt;
|-&lt;br /&gt;
| Assembling machine 3 || 1 || 3.3027 || 0.0365 || 1.0657 || 0.0108 || 0.3286&lt;br /&gt;
|-&lt;br /&gt;
| Foundry || 1 || 2.9551 || 0.0563 || 1.1528 || 0.0208 || 0.3653&lt;br /&gt;
|-&lt;br /&gt;
| Electromagnetic plant || 1 || 2.7239 || 0.0709 || 1.1726 || 0.0301 || 0.3474&lt;br /&gt;
|-&lt;br /&gt;
| Cryogenic plant || 1 || 2.3798 || 0.0972 || 1.1517 || 0.0470 || 0.2700&lt;br /&gt;
&lt;br /&gt;
|}&lt;br /&gt;
\-\&lt;br /&gt;
per tier 5 crafter (exact) =&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Crafting machine || Recyclers || Machines producing Tier 1 items || Machines producing Tier 2 items || Machines producing Tier 3 items || Machines producing Tier 4 items || Machines producing Tier 5 items&lt;br /&gt;
|-&lt;br /&gt;
| Chemical plant || 108.8978 || 374.9134 || 43.5367 || 12.7555 || 3.3856 || 1&lt;br /&gt;
|-&lt;br /&gt;
| Assembling machine 3 || 70.4576 || 232.7032 || 33.9340 || 10.9500 || 3.2432 || 1&lt;br /&gt;
|-&lt;br /&gt;
| Foundry || 33.0224 || 97.5872 || 21.8308 || 8.5164 || 3.1550 || 1&lt;br /&gt;
|-&lt;br /&gt;
| Electromagnetic plant || 24.1178 || 65.6959 || 18.4556 || 7.9448 || 3.3747 || 1&lt;br /&gt;
|-&lt;br /&gt;
| Cryogenic plant || 19.9316 || 47.4350 || 18.2124 || 8.8138 || 4.2654 || 1&lt;br /&gt;
|}&lt;br /&gt;
\-\&lt;br /&gt;
per tier 5 crafter (conservative)=&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Crafting machine || Recyclers || Machines producing Tier 1 items || Machines producing Tier 2 items || Machines producing Tier 3 items || Machines producing Tier 4 items || Machines producing Tier 5 items&lt;br /&gt;
|-&lt;br /&gt;
| Chemical plant || 92 || 318 || 37 || 11 || 3 || 1&lt;br /&gt;
|-&lt;br /&gt;
| Assembling machine 3 || 62 || 205 || 30 || 10 || 3 || 1&lt;br /&gt;
|-&lt;br /&gt;
| Foundry || 30 || 89 || 20 || 8 || 3 || 1&lt;br /&gt;
|-&lt;br /&gt;
| Electromagnetic plant || 20 || 56 || 16 || 7 || 3 || 1&lt;br /&gt;
|-&lt;br /&gt;
| Cryogenic plant || 17 || 41 || 16 || 8 || 4 || 1&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;/tabber&amp;gt;&lt;/div&gt;</summary>
		<author><name>Untitled7</name></author>
	</entry>
	<entry>
		<id>https://wiki.factorio.com/index.php?title=Tutorial:Quality_upcycling_math&amp;diff=206999</id>
		<title>Tutorial:Quality upcycling math</title>
		<link rel="alternate" type="text/html" href="https://wiki.factorio.com/index.php?title=Tutorial:Quality_upcycling_math&amp;diff=206999"/>
		<updated>2024-11-23T21:32:12Z</updated>

		<summary type="html">&lt;p&gt;Untitled7: /* Best ratios */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;How do we get the most amount of [[Quality|legendary]] items out of an upcycling plant?&lt;br /&gt;
&lt;br /&gt;
The answer is not quite as straight forward as we&#039;d like it to be, because it depends on a number of factors, luckily there is a finite number of possibilities of what the modules can be, and for the sake of simplicity this tutorial will ignore the productivity gain from [[Technologies#Space_Age|infinite technologies]].&lt;br /&gt;
&lt;br /&gt;
== The crafting machines ==&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Crafting machine || Module slots &amp;lt;math&amp;gt;N&amp;lt;/math&amp;gt; || Base productivity bonus &amp;lt;math&amp;gt;p_0&amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| [[Chemical plant]] || 3 || +0%&lt;br /&gt;
|-&lt;br /&gt;
| [[Assembling machine 3]] || 4 || +0%&lt;br /&gt;
|-&lt;br /&gt;
| [[Foundry]] || 4 || +50%&lt;br /&gt;
|-&lt;br /&gt;
| [[Electromagnetic plant]] || 5 || +50%&lt;br /&gt;
|-&lt;br /&gt;
| [[Cryogenic plant]] || 8 || +0%&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Quality probability ==&lt;br /&gt;
When an item gets produced and the initial roll decides that the quality of the item will increase, there is a 90% chance it will rise one tier, a 9% chance it will rise two, a 0.9% chance it will rise three, and a 0.1% chance it will rise four. This is of course capped if the item already started out at a higher tier.&lt;br /&gt;
&lt;br /&gt;
== Mathematical model ==&lt;br /&gt;
The mathematical model is time discrete. As opposed to dealing with derivatives in respect to time, the next state is a direct function of the previous state.&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;math&amp;gt;m_{i,k}&amp;lt;/math&amp;gt; ... Number of materials of tier &amp;lt;math&amp;gt;i&amp;lt;/math&amp;gt; after the &amp;lt;math&amp;gt;k&amp;lt;/math&amp;gt;-th iteration before being crafted. (this doesn&#039;t mean that an item only needs one type of ingredient, but that &amp;quot;1 materials&amp;quot; can be crafted into 1 item from them)&lt;br /&gt;
* &amp;lt;math&amp;gt;n_{i,k}&amp;lt;/math&amp;gt; ... Number of items of tier &amp;lt;math&amp;gt;i&amp;lt;/math&amp;gt; after the &amp;lt;math&amp;gt;k&amp;lt;/math&amp;gt;-th iteration, after being crafted together.&lt;br /&gt;
* &amp;lt;math&amp;gt;p_0&amp;lt;/math&amp;gt; ... the crafting machines inherent productivity bonus&lt;br /&gt;
* &amp;lt;math&amp;gt;N&amp;lt;/math&amp;gt; ... number of modules the crafting machine can hold&lt;br /&gt;
* &amp;lt;math&amp;gt;q_r = 4 \cdot 6.2 \, \% = 0.248&amp;lt;/math&amp;gt; ... quality probability of the recyclers with 4 [[quality module 3]]&#039;s&lt;br /&gt;
* &amp;lt;math&amp;gt;p_i = p_0 + x_i \cdot 25 \, \%&amp;lt;/math&amp;gt; ... productivity due to &amp;lt;math&amp;gt;x_i&amp;lt;/math&amp;gt; legendary [[productivity module 3]]&#039;s in the crafting machine which takes &amp;lt;math&amp;gt;i&amp;lt;/math&amp;gt;-tier materials&lt;br /&gt;
* &amp;lt;math&amp;gt;q_i = (N-x_i) \cdot 6.2 \, \%&amp;lt;/math&amp;gt; ... quality probability due to &amp;lt;math&amp;gt;(N - x_i)&amp;lt;/math&amp;gt; legendary quality module 3&#039;s in the crafting machine which takes &amp;lt;math&amp;gt;i&amp;lt;/math&amp;gt;-tier materials&lt;br /&gt;
&lt;br /&gt;
=== Recycled materials ===&lt;br /&gt;
When a quarter of all items being recycled and the quality probability rules we can write the equations for the amount of materials received after recycling. This calculation is rather simple, as we the lowest tier can only come forth from it&#039;s own tier failing to raise in quality. The second tier are 90% of tier 1 items that did increase, and all those tier 2 items that didn&#039;t. This continues for all tiers as follows, but legendary items &amp;lt;math&amp;gt;n_{5,k}&amp;lt;/math&amp;gt; will not be recycled&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\begin{align}&lt;br /&gt;
m_{1,k+1} &amp;amp;= \frac{n_{1,k}}{4} \cdot (1 - q_r)\\&lt;br /&gt;
m_{2,k+1} &amp;amp;= \frac{n_{1,k}}{4} \cdot q_r \cdot 0.9 &amp;amp;+&amp;amp; \frac{n_{2,k}}{4} \cdot (1 - q_r)\\&lt;br /&gt;
m_{3,k+1} &amp;amp;= \frac{n_{1,k}}{4} \cdot q_r \cdot 0.09 &amp;amp;+&amp;amp; \frac{n_{2,k}}{4} \cdot q_r \cdot 0.9 &amp;amp;+&amp;amp; \frac{n_{3,k}}{4} \cdot (1 - q_r)\\&lt;br /&gt;
m_{4,k+1} &amp;amp;= \frac{n_{1,k}}{4} \cdot q_r \cdot 0.009 &amp;amp;+&amp;amp; \frac{n_{2,k}}{4} \cdot q_r \cdot 0.09 &amp;amp;+&amp;amp; \frac{n_{3,k}}{4} \cdot q_r \cdot 0.9 &amp;amp;+&amp;amp; \frac{n_{4,k}}{4} \cdot (1 - q_r)\\&lt;br /&gt;
m_{5,k+1} &amp;amp;= \frac{n_{1,k}}{4} \cdot q_r \cdot 0.001 &amp;amp;+&amp;amp; \frac{n_{2,k}}{4} \cdot q_r \cdot 0.01 &amp;amp;+&amp;amp; \frac{n_{3,k}}{4} \cdot q_r \cdot 0.1 &amp;amp;+&amp;amp; \frac{n_{4,k}}{4} \cdot q_r\\&lt;br /&gt;
\end{align}&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
which can also be written as a vector-matrix-multiplication &amp;lt;math&amp;gt;\textbf{m}_{k+1} = \textbf{A} \,\textbf{n}_k&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\underbrace{\begin{bmatrix} m_{1,k+1}\\ m_{2,k+1}\\ m_{3,k+1}\\ m_{4,k+1}\\ m_{5,k+1}\\ \end{bmatrix}}_{\textbf{m}_{k+1}}&lt;br /&gt;
=&lt;br /&gt;
\underbrace{\begin{bmatrix}&lt;br /&gt;
\frac{1 - q_r}{4} &amp;amp; 0 &amp;amp; 0 &amp;amp; 0 &amp;amp; 0\\&lt;br /&gt;
\frac{0.9 \, q_r}{4}   &amp;amp; \frac{1 - q_r}{4} &amp;amp; 0 &amp;amp; 0 &amp;amp; 0\\&lt;br /&gt;
\frac{0.09 \, q_r}{4}  &amp;amp; \frac{0.9 \, q_r}{4}  &amp;amp; \frac{1 - q_r}{4} &amp;amp; 0 &amp;amp; 0 \\&lt;br /&gt;
\frac{0.009 \, q_r}{4} &amp;amp; \frac{0.09 \, q_r}{4} &amp;amp; \frac{0.9 \, q_r}{4} &amp;amp; \frac{1 - q_r}{4} &amp;amp; 0\\&lt;br /&gt;
\frac{0.001 \, q_r}{4} &amp;amp; \frac{0.01 \, q_r}{4} &amp;amp; \frac{0.1 \, q_r}{4} &amp;amp; \frac{q_r}{4} &amp;amp; 0\\&lt;br /&gt;
\end{bmatrix}}_{\textbf{A}}&lt;br /&gt;
\underbrace{\begin{bmatrix} n_{1,k}\\ n_{2,k}\\ n_{3,k}\\ n_{4,k}\\ n_{5,k}\\ \end{bmatrix}}_{\textbf{n}_k}&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As we assume there is nothing to be done about recyclers to make them more effective but fill them with all quality modules, the value of &amp;lt;math&amp;gt;q_r = 0.248&amp;lt;/math&amp;gt; is a constant, and therefore the matrix &amp;lt;math&amp;gt;\textbf{A}&amp;lt;/math&amp;gt; is also a constant. For legendary quality module 3&#039;s, it looks like:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \textbf{A} = &lt;br /&gt;
\begin{bmatrix}&lt;br /&gt;
0.188 &amp;amp; 0 &amp;amp; 0 &amp;amp; 0 &amp;amp; 0 \\&lt;br /&gt;
0.055\,8 &amp;amp; 0.188 &amp;amp; 0 &amp;amp; 0 &amp;amp; 0 \\&lt;br /&gt;
0.005\,58 &amp;amp; 0.055\,8 &amp;amp; 0.188 &amp;amp; 0 &amp;amp; 0 \\&lt;br /&gt;
0.000\,558 &amp;amp; 0.005\,58 &amp;amp; 0.055\,8 &amp;amp; 0.188 &amp;amp; 0 \\&lt;br /&gt;
0.000\,062 &amp;amp; 0.000\,62 &amp;amp; 0.006\,2 &amp;amp; 0.062 &amp;amp; 0 \\&lt;br /&gt;
\end{bmatrix}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Recrafted items ===&lt;br /&gt;
Once more we first check how many items are produced, which is, again, the sum of all possible ways to get to a tier, this time adding productivity &amp;lt;math&amp;gt;p_i&amp;lt;/math&amp;gt;, and bringing along all those items which are already legendary &amp;lt;math&amp;gt;n_{5,k}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\begin{align}&lt;br /&gt;
n_{1,k+1} &amp;amp;= m_{1,k+1} \cdot ( 1 + p_1 ) \cdot (1 - q_1)\\&lt;br /&gt;
n_{2,k+1} &amp;amp;= m_{1,k+1} \cdot ( 1 + p_1 ) \cdot q_1 \cdot 0.9 &amp;amp;+&amp;amp;  m_{2,k+1} \cdot ( 1 + p_2 ) \cdot (1 - q_2)\\&lt;br /&gt;
n_{3,k+1} &amp;amp;= m_{1,k+1} \cdot ( 1 + p_1 ) \cdot q_1 \cdot 0.09 &amp;amp;+&amp;amp;  m_{2,k+1} \cdot ( 1 + p_2 ) \cdot q_2 \cdot 0.9 &amp;amp;+&amp;amp; m_{3,k+1} \cdot ( 1 + p_3 ) \cdot (1 - q_3) \\&lt;br /&gt;
n_{4,k+1} &amp;amp;= m_{1,k+1} \cdot ( 1 + p_1 ) \cdot q_1 \cdot 0.009 &amp;amp;+&amp;amp;  m_{2,k+1} \cdot ( 1 + p_2 ) \cdot q_2 \cdot 0.09 &amp;amp;+&amp;amp; m_{3,k+1} \cdot ( 1 + p_3 ) \cdot q_3 \cdot 0.9  &amp;amp;+&amp;amp; m_{4,k+1} \cdot ( 1 + p_4) \cdot (1 - q_4) \\&lt;br /&gt;
n_{5,k+1} &amp;amp;= m_{1,k+1} \cdot ( 1 + p_1 ) \cdot q_1 \cdot 0.001 &amp;amp;+&amp;amp;  m_{2,k+1} \cdot ( 1 + p_2 ) \cdot q_2 \cdot 0.01 &amp;amp;+&amp;amp; m_{3,k+1} \cdot ( 1 + p_3 ) \cdot q_3 \cdot 0.1  &amp;amp;+&amp;amp; m_{4,k+1} \cdot ( 1 + p_4) \cdot q_4 &amp;amp;+&amp;amp; m_{5,k+1} \cdot ( 1 + p_5) + n_{5,k}\\&lt;br /&gt;
\end{align}&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This can once more be written as a vector-matrix-multiplication &amp;lt;math&amp;gt;\textbf{n}_{k+1} = \textbf{B} \,\textbf{m}_{k+1} + \textbf{C} \,\textbf{n}_{k}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\underbrace{\begin{bmatrix} n_{1,k+1}\\ n_{2,k+1}\\ n_{3,k+1}\\ n_{4,k+1}\\ n_{5,k+1}\\ \end{bmatrix}}_{\textbf{n}_{k+1}} = &lt;br /&gt;
\underbrace{\begin{bmatrix}&lt;br /&gt;
( 1 + p_1 ) \cdot (1 - q_1) &amp;amp; 0 &amp;amp; 0 &amp;amp; 0 &amp;amp; 0 \\&lt;br /&gt;
( 1 + p_1 ) \cdot q_1 \cdot 0.9 &amp;amp;  ( 1 + p_2 ) \cdot (1 - q_2) &amp;amp; 0 &amp;amp; 0 &amp;amp; 0 \\&lt;br /&gt;
( 1 + p_1 ) \cdot q_1 \cdot 0.09 &amp;amp; ( 1 + p_2 ) \cdot q_2 \cdot 0.9 &amp;amp; ( 1 + p_3 ) \cdot (1 - q_3) &amp;amp; 0 &amp;amp; 0 \\&lt;br /&gt;
( 1 + p_1 ) \cdot q_1 \cdot 0.009 &amp;amp; ( 1 + p_2 ) \cdot q_2 \cdot 0.09 &amp;amp; ( 1 + p_3 ) \cdot q_3 \cdot 0.9  &amp;amp; ( 1 + p_4) \cdot (1 - q_4) &amp;amp; 0 \\&lt;br /&gt;
( 1 + p_1 ) \cdot q_1 \cdot 0.001 &amp;amp; ( 1 + p_2 ) \cdot q_2 \cdot 0.01 &amp;amp; ( 1 + p_3 ) \cdot q_3 \cdot 0.1  &amp;amp; ( 1 + p_4) \cdot q_4 &amp;amp; ( 1 + p_5)\\&lt;br /&gt;
\end{bmatrix}}_{B}&lt;br /&gt;
\underbrace{\begin{bmatrix} m_{1,k+1}\\ m_{2,k+1}\\ m_{3,k+1}\\ m_{4,k+1}\\ m_{5,k+1}\\ \end{bmatrix}}_{\textbf{m}_{k+1}}&lt;br /&gt;
+&lt;br /&gt;
\begin{bmatrix}&lt;br /&gt;
0&amp;amp;0&amp;amp;0&amp;amp;0\\&lt;br /&gt;
0&amp;amp;0&amp;amp;0&amp;amp;0\\&lt;br /&gt;
0&amp;amp;0&amp;amp;0&amp;amp;0\\&lt;br /&gt;
0&amp;amp;0&amp;amp;0&amp;amp;0\\&lt;br /&gt;
0&amp;amp;0&amp;amp;0&amp;amp;1\\&lt;br /&gt;
\end{bmatrix}&lt;br /&gt;
\underbrace{\begin{bmatrix} n_{1,k}\\ n_{2,k}\\ n_{3,k}\\ n_{4,k}\\ n_{5,k}\\ \end{bmatrix}}_{\textbf{n}_k}&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Combined model ===&lt;br /&gt;
&lt;br /&gt;
As such we gain an equation for the amount of items for every tier after any amount of iterations&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\begin{align}&lt;br /&gt;
\textbf{n}_{k+1} &lt;br /&gt;
    &amp;amp;= \textbf{B} \, \textbf{m}_{k+1} + \textbf{C} \, \textbf{n}_{k}\\&lt;br /&gt;
    &amp;amp;= \textbf{B} \, \textbf{A} \,\textbf{n}_{k} + \textbf{C} \, \textbf{n}_{k}\\&lt;br /&gt;
    &amp;amp;= (\textbf{B} \, \textbf{A} +\textbf{C} ) \, \textbf{n}_{k}\\&lt;br /&gt;
    &amp;amp;= \textbf{M} \, \textbf{n}_{k}\\&lt;br /&gt;
\textbf{n}_{k+2} &amp;amp;= \textbf{Q} \, \textbf{n}_{k+1} = \textbf{Q} \,  \textbf{Q} \, \textbf{n}_{k} = \textbf{Q}^2 \, \textbf{n}_{k}\\&lt;br /&gt;
&amp;amp;\vdots\\&lt;br /&gt;
\textbf{n}_k &amp;amp;= \textbf{Q}^k \, \textbf{n}_0\\&lt;br /&gt;
\end{align}&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
A realistic starting point for &amp;lt;math&amp;gt;\textbf{n}_0&amp;lt;/math&amp;gt; is only items in tier 1, and if we do not care for any other tiers, we simply choose sufficiently large &amp;lt;math&amp;gt;k = 100&amp;lt;/math&amp;gt;, and, through numeric means, try to maximize a single value. &amp;lt;math&amp;gt;q_{100,\text{crit}}&amp;lt;/math&amp;gt;, which falls in the fifth row, first column, of the Matrix &amp;lt;math&amp;gt;\textbf{Q}&amp;lt;/math&amp;gt; raised to the 100th power.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\begin{align}&lt;br /&gt;
\textbf{n}_k &amp;amp;= Q^k \, \textbf{n}_0\\&lt;br /&gt;
\begin{bmatrix}*\\ *\\ *\\ *\\ n_{5,100} \end{bmatrix} &amp;amp;= &lt;br /&gt;
\begin{bmatrix}&lt;br /&gt;
 * &amp;amp; * &amp;amp; * &amp;amp; * \\&lt;br /&gt;
 * &amp;amp; * &amp;amp; * &amp;amp; * \\&lt;br /&gt;
 * &amp;amp; * &amp;amp; * &amp;amp; * \\&lt;br /&gt;
 * &amp;amp; * &amp;amp; * &amp;amp; * \\&lt;br /&gt;
q_{100,\text{crit}} &amp;amp; * &amp;amp; * &amp;amp; * \\&lt;br /&gt;
\end{bmatrix} \begin{bmatrix}n_{1,0}\\ *\\ *\\ *\\ * \end{bmatrix}\\&lt;br /&gt;
\end{align}&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The choice of optimization method (simplex, branch and bound, etc.) itself is irrelevant, although most software will want the problem to be stated in a way so it can find a minimum, and may require the proper guard rails as to not pick values below 0 or higher than the maximum number of allowed modules.&lt;br /&gt;
&lt;br /&gt;
== Best ratios ==&lt;br /&gt;
This table shows the best ratio for quality to productivity modules in the crafting machines, while the recyclers always take only quality modules. The values are not given in whole numbers because often it is not just a single crafting machine per tier that will be used, then the ratios can change between different crafting machines in the same tier. e.g. &amp;quot;3.67 quality / 1.33 productivity&amp;quot; could have 4 machines where 3 have a ratio 4 to 1, and one a ratio 3 to 2.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tabber&amp;gt;&lt;br /&gt;
common modules = &lt;br /&gt;
&amp;quot;Modules in Tier X&amp;quot; means which Modules need to go into the machines that are set to produce the item at tier X.&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Crafting machine || Modules in Tier 1 || Modules in Tier 2 || Modules in Tier 3 || Modules in Tier 4 || Modules in Tier 5 || percentage yield || items recycled*&lt;br /&gt;
|-&lt;br /&gt;
| Chemical plant || 3 quality &amp;lt;br /&amp;gt;0 productivity || 3 quality &amp;lt;br /&amp;gt;0 productivity || 3 quality &amp;lt;br /&amp;gt;0 productivity || 3 quality &amp;lt;br /&amp;gt;0 productivity  || 0 quality &amp;lt;br /&amp;gt;3 productivity || 0.034014% || 2940&lt;br /&gt;
|-&lt;br /&gt;
| Assembling machine 3 || 4 quality &amp;lt;br /&amp;gt;0 productivity || 4 quality &amp;lt;br /&amp;gt;0 productivity || 4 quality &amp;lt;br /&amp;gt;0 productivity || 4 quality &amp;lt;br /&amp;gt;0 productivity  || 0 quality &amp;lt;br /&amp;gt;4 productivity || 0.046275% || 2161&lt;br /&gt;
|-&lt;br /&gt;
| Foundry || 4 quality &amp;lt;br /&amp;gt;0 productivity || 4 quality &amp;lt;br /&amp;gt;0 productivity || 4 quality &amp;lt;br /&amp;gt;0 productivity || 4 quality &amp;lt;br /&amp;gt;0 productivity  || 0 quality &amp;lt;br /&amp;gt;4 productivity || 0.133814% || 747&lt;br /&gt;
|-&lt;br /&gt;
| Electromagnetic plant || 5 quality &amp;lt;br /&amp;gt;0 productivity || 5 quality &amp;lt;br /&amp;gt;0 productivity || 5 quality &amp;lt;br /&amp;gt;0 productivity || 5 quality &amp;lt;br /&amp;gt;0 productivity  || 0 quality &amp;lt;br /&amp;gt;5 productivity || 0.176712% || 566&lt;br /&gt;
|-&lt;br /&gt;
| Cryogenic plant || 6 quality &amp;lt;br /&amp;gt;2 productivity || 6 quality &amp;lt;br /&amp;gt;2 productivity || 6 quality &amp;lt;br /&amp;gt;2 productivity || 6.5 quality &amp;lt;br /&amp;gt;1.5 productivity  || 0 quality &amp;lt;br /&amp;gt;8 productivity || 0.119134%|| 840&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;nowiki&amp;gt;*&amp;lt;/nowiki&amp;gt; &amp;quot;items recycled&amp;quot; quantifies how many items need to be crafted and put into the entire upcycler to yield a single legendary item, it doesn&#039;t account for those which get recycled multiple times.&lt;br /&gt;
\-\&lt;br /&gt;
uncommon modules = &lt;br /&gt;
&amp;quot;Modules in Tier X&amp;quot; means which Modules need to go into the machines that are set to produce the item at tier X.&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Crafting machine || Modules in Tier 1 || Modules in Tier 2 || Modules in Tier 3 || Modules in Tier 4 || Modules in Tier 5 || percentage yield || items recycled*&lt;br /&gt;
|-&lt;br /&gt;
| Chemical plant || 3 quality &amp;lt;br /&amp;gt;0 productivity || 3 quality &amp;lt;br /&amp;gt;0 productivity || 3 quality &amp;lt;br /&amp;gt;0 productivity || 3 quality &amp;lt;br /&amp;gt;0 productivity  || 0 quality &amp;lt;br /&amp;gt;3 productivity || 0.059498% || 1681&lt;br /&gt;
|-&lt;br /&gt;
| Assembling machine 3 || 3.75 quality &amp;lt;br /&amp;gt;0.25 productivity || 3.75 quality &amp;lt;br /&amp;gt;0.25 productivity || 3.8 quality &amp;lt;br /&amp;gt;0.2 productivity || 3.9 quality &amp;lt;br /&amp;gt;0.1 productivity  || 0 quality &amp;lt;br /&amp;gt;4 productivity || 0.082296% || 1216&lt;br /&gt;
|-&lt;br /&gt;
| Foundry || 4 quality &amp;lt;br /&amp;gt;0 productivity || 4 quality &amp;lt;br /&amp;gt;0 productivity || 4 quality &amp;lt;br /&amp;gt;0 productivity || 4 quality &amp;lt;br /&amp;gt;0 productivity  || 0 quality &amp;lt;br /&amp;gt;4 productivity || 0.243699% || 410&lt;br /&gt;
|-&lt;br /&gt;
| Electromagnetic plant || 4.7 quality &amp;lt;br /&amp;gt;0.3 productivity || 4.67 quality &amp;lt;br /&amp;gt;0.33 productivity || 4.75 quality &amp;lt;br /&amp;gt;0.25 productivity || 4.9 quality &amp;lt;br /&amp;gt;0.1 productivity  || 0 quality &amp;lt;br /&amp;gt;5 productivity || 0.324189% || 309&lt;br /&gt;
|-&lt;br /&gt;
| Cryogenic plant || 4.6 quality &amp;lt;br /&amp;gt;3.4 productivity || 4.6 quality &amp;lt;br /&amp;gt;3.4 productivity || 4.67 quality &amp;lt;br /&amp;gt;3.33 productivity  || 5 quality &amp;lt;br /&amp;gt;3 productivity  || 0 quality &amp;lt;br /&amp;gt;8 productivity || 0.257621% || 389&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;nowiki&amp;gt;*&amp;lt;/nowiki&amp;gt; &amp;quot;items recycled&amp;quot; quantifies how many items need to be crafted and put into the entire upcycler to yield a single legendary item, it doesn&#039;t account for those which get recycled multiple times.&lt;br /&gt;
\-\&lt;br /&gt;
rare modules = &lt;br /&gt;
&amp;quot;Modules in Tier X&amp;quot; means which Modules need to go into the machines that are set to produce the item at tier X.&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Crafting machine || Modules in Tier 1 || Modules in Tier 2 || Modules in Tier 3 || Modules in Tier 4 || Modules in Tier 5 || percentage yield || items recycled*&lt;br /&gt;
|-&lt;br /&gt;
| Chemical plant || 2.8 quality &amp;lt;br /&amp;gt;0.2 productivity || 2.8 quality &amp;lt;br /&amp;gt;0.2 productivity || 2.9 quality &amp;lt;br /&amp;gt;0.1 productivity || 2.9 quality &amp;lt;br /&amp;gt;0.1 productivity  || 0 quality &amp;lt;br /&amp;gt;3 productivity || 0.100660% || 994&lt;br /&gt;
|-&lt;br /&gt;
| Assembling machine 3 || 3 quality &amp;lt;br /&amp;gt;1 productivity || 3.1 quality &amp;lt;br /&amp;gt;0.9 productivity || 3.2 quality &amp;lt;br /&amp;gt;0.8 productivity || 3.33 quality &amp;lt;br /&amp;gt;0.67 productivity  || 0 quality &amp;lt;br /&amp;gt;4 productivity || 0.145220% || 689&lt;br /&gt;
|-&lt;br /&gt;
| Foundry || 3.5 quality &amp;lt;br /&amp;gt;0.5 productivity || 3.5 quality &amp;lt;br /&amp;gt;0.5 productivity || 3.6 quality &amp;lt;br /&amp;gt;0.4 productivity || 3.9 quality &amp;lt;br /&amp;gt;0.1 productivity  || 0 quality &amp;lt;br /&amp;gt;4 productivity || 0.424039% || 236&lt;br /&gt;
|-&lt;br /&gt;
| Electromagnetic plant || 3.6 quality &amp;lt;br /&amp;gt;1.4 productivity || 3.6 quality &amp;lt;br /&amp;gt;1.4 productivity || 3.6 quality &amp;lt;br /&amp;gt;1.4 productivity || 3.9 quality &amp;lt;br /&amp;gt;1.1 productivity  || 0 quality &amp;lt;br /&amp;gt;5 productivity || 0.588510% || 170&lt;br /&gt;
|-&lt;br /&gt;
| Cryogenic plant || 3.6 quality &amp;lt;br /&amp;gt;4.4 productivity || 3.6 quality &amp;lt;br /&amp;gt;4.4 productivity || 3.6 quality &amp;lt;br /&amp;gt;4.4 productivity  || 3.9 quality &amp;lt;br /&amp;gt;4.1 productivity  || 0 quality &amp;lt;br /&amp;gt;8 productivity || 0.565030% || 177&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;nowiki&amp;gt;*&amp;lt;/nowiki&amp;gt; &amp;quot;items recycled&amp;quot; quantifies how many items need to be crafted and put into the entire upcycler to yield a single legendary item, it doesn&#039;t account for those which get recycled multiple times.&lt;br /&gt;
\-\&lt;br /&gt;
epic modules = &lt;br /&gt;
&amp;quot;Modules in Tier X&amp;quot; means which Modules need to go into the machines that are set to produce the item at tier X.&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Crafting machine || Modules in Tier 1 || Modules in Tier 2 || Modules in Tier 3 || Modules in Tier 4 || Modules in Tier 5 || percentage yield || items recycled*&lt;br /&gt;
|-&lt;br /&gt;
| Chemical plant || 2.33 quality &amp;lt;br /&amp;gt;0.67 productivity || 2.4 quality &amp;lt;br /&amp;gt;0.6 productivity || 2.4 quality &amp;lt;br /&amp;gt;0.6 productivity || 2.4 quality &amp;lt;br /&amp;gt;0.6 productivity  || 0 quality &amp;lt;br /&amp;gt;3 productivity || 0.152486% || 656&lt;br /&gt;
|-&lt;br /&gt;
| Assembling machine 3 || 2.5 quality &amp;lt;br /&amp;gt;1.5 productivity || 2.5 quality &amp;lt;br /&amp;gt;1.5 productivity || 2.6 quality &amp;lt;br /&amp;gt;1.4 productivity || 2.8 quality &amp;lt;br /&amp;gt;1.2 productivity  || 0 quality &amp;lt;br /&amp;gt;4 productivity || 0.232966% || 430&lt;br /&gt;
|-&lt;br /&gt;
| Foundry || 2.7 quality &amp;lt;br /&amp;gt;1.3 productivity || 2.7 quality &amp;lt;br /&amp;gt;1.3 productivity || 2.75 quality &amp;lt;br /&amp;gt;1.25 productivity || 3 quality &amp;lt;br /&amp;gt;1 productivity  || 0 quality &amp;lt;br /&amp;gt;4 productivity || 0.664130% || 151&lt;br /&gt;
|-&lt;br /&gt;
| Electromagnetic plant || 2.6 quality &amp;lt;br /&amp;gt;2.4 productivity || 2.6 quality &amp;lt;br /&amp;gt;2.4 productivity || 2.67 quality &amp;lt;br /&amp;gt;2.33 productivity || 2.9 quality &amp;lt;br /&amp;gt;2.1 productivity  || 0 quality &amp;lt;br /&amp;gt;5 productivity || 0.974700% || 103&lt;br /&gt;
|-&lt;br /&gt;
| Cryogenic plant || 2.6 quality &amp;lt;br /&amp;gt;5.4 productivity || 2.6 quality &amp;lt;br /&amp;gt;5.4 productivity || 2.6 quality &amp;lt;br /&amp;gt;4.4 productivity  || 2.8 quality &amp;lt;br /&amp;gt;4.2 productivity  || 0 quality &amp;lt;br /&amp;gt;8 productivity || 1.122444% || 90&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;nowiki&amp;gt;*&amp;lt;/nowiki&amp;gt; &amp;quot;items recycled&amp;quot; quantifies how many items need to be crafted and put into the entire upcycler to yield a single legendary item, it doesn&#039;t account for those which get recycled multiple times.&lt;br /&gt;
\-\&lt;br /&gt;
legendary modules=&lt;br /&gt;
&amp;quot;Modules in Tier X&amp;quot; means which Modules need to go into the machines that are set to produce the item at tier X.&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Crafting machine || Modules in Tier 1 || Modules in Tier 2 || Modules in Tier 3 || Modules in Tier 4 || Modules in Tier 5 || percentage yield || items recycled*&lt;br /&gt;
|-&lt;br /&gt;
| Chemical plant || 1.67 quality &amp;lt;br /&amp;gt;1.33 productivity || 1.67 quality &amp;lt;br /&amp;gt;1.33 productivity || 1.67 quality &amp;lt;br /&amp;gt;1.333 productivity || 1.8 quality &amp;lt;br /&amp;gt;1.2 productivity  || 0 quality &amp;lt;br /&amp;gt;3 productivity || 0.344061% || 291&lt;br /&gt;
|-&lt;br /&gt;
| Assembling machine 3 || 1.67 quality &amp;lt;br /&amp;gt;2.33 productivity || 1.67 quality &amp;lt;br /&amp;gt;2.33 productivity || 1.67 quality &amp;lt;br /&amp;gt;2.33 productivity || 1.8 quality &amp;lt;br /&amp;gt;2.2 productivity  || 0 quality &amp;lt;br /&amp;gt;4 productivity || 0.586191% || 171&lt;br /&gt;
|-&lt;br /&gt;
| Foundry || 1.4 quality &amp;lt;br /&amp;gt;2.6 productivity || 1.4 quality &amp;lt;br /&amp;gt;2.6 productivity || 1.4 quality &amp;lt;br /&amp;gt;2.6 productivity || 1.5 quality &amp;lt;br /&amp;gt;2.5 productivity  || 0 quality &amp;lt;br /&amp;gt;4 productivity || 1.624266% || 62&lt;br /&gt;
|-&lt;br /&gt;
| Electromagnetic plant || 1 quality &amp;lt;br /&amp;gt;4 productivity || 1 quality &amp;lt;br /&amp;gt;4 productivity || 1 quality &amp;lt;br /&amp;gt;4 productivity || 1 quality &amp;lt;br /&amp;gt;4 productivity  || 0 quality &amp;lt;br /&amp;gt;5 productivity || 2.722332% || 37&lt;br /&gt;
|-&lt;br /&gt;
| Cryogenic plant || 0 quality &amp;lt;br /&amp;gt;8 productivity || 0 quality &amp;lt;br /&amp;gt;8 productivity || 0 quality &amp;lt;br /&amp;gt;8 productivity || 0 quality &amp;lt;br /&amp;gt;8 productivity  || 0 quality &amp;lt;br /&amp;gt;8 productivity || 4.835199% || 21&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;nowiki&amp;gt;*&amp;lt;/nowiki&amp;gt; &amp;quot;items recycled&amp;quot; quantifies how many items need to be crafted and put into the entire upcycler to yield a single legendary item, it doesn&#039;t account for those which get recycled multiple times.&lt;br /&gt;
&amp;lt;/tabber&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Number of crafting machines ===&lt;br /&gt;
If we assume a constant input stream of tier 1 items which will always fill back up, we can additionally figure out what ratio of items will be inside the system at once, and with that we can figure out how many crafting machines we need per tier. This is done by setting &amp;lt;math&amp;gt;m_{1,k+1} = 100 \, \% - m_{2,k+1} - m_{3,k+1} - m_{4,k+1}&amp;lt;/math&amp;gt; after each iteration.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tabber&amp;gt;&lt;br /&gt;
per recycler=&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Crafting machine || Recyclers || Machines producing Tier 1 items || Machines producing Tier 2 items || Machines producing Tier 3 items || Machines producing Tier 4 items || Machines producing Tier 5 items&lt;br /&gt;
|-&lt;br /&gt;
| Chemical plant || 1 || 3.4427 || 0.0290 || 1.0086 || 0.0077 || 0.2979&lt;br /&gt;
|-&lt;br /&gt;
| Assembling machine 3 || 1 || 3.3027 || 0.0365 || 1.0657 || 0.0108 || 0.3286&lt;br /&gt;
|-&lt;br /&gt;
| Foundry || 1 || 2.9551 || 0.0563 || 1.1528 || 0.0208 || 0.3653&lt;br /&gt;
|-&lt;br /&gt;
| Electromagnetic plant || 1 || 2.7239 || 0.0709 || 1.1726 || 0.0301 || 0.3474&lt;br /&gt;
|-&lt;br /&gt;
| Cryogenic plant || 1 || 2.3798 || 0.0972 || 1.1517 || 0.0470 || 0.2700&lt;br /&gt;
&lt;br /&gt;
|}&lt;br /&gt;
\-\&lt;br /&gt;
per tier 5 crafter (exact) =&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Crafting machine || Recyclers || Machines producing Tier 1 items || Machines producing Tier 2 items || Machines producing Tier 3 items || Machines producing Tier 4 items || Machines producing Tier 5 items&lt;br /&gt;
|-&lt;br /&gt;
| Chemical plant || 108.8978 || 374.9134 || 43.5367 || 12.7555 || 3.3856 || 1&lt;br /&gt;
|-&lt;br /&gt;
| Assembling machine 3 || 70.4576 || 232.7032 || 33.9340 || 10.9500 || 3.2432 || 1&lt;br /&gt;
|-&lt;br /&gt;
| Foundry || 33.0224 || 97.5872 || 21.8308 || 8.5164 || 3.1550 || 1&lt;br /&gt;
|-&lt;br /&gt;
| Electromagnetic plant || 24.1178 || 65.6959 || 18.4556 || 7.9448 || 3.3747 || 1&lt;br /&gt;
|-&lt;br /&gt;
| Cryogenic plant || 19.9316 || 47.4350 || 18.2124 || 8.8138 || 4.2654 || 1&lt;br /&gt;
|}&lt;br /&gt;
\-\&lt;br /&gt;
per tier 5 crafter (conservative)=&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Crafting machine || Recyclers || Machines producing Tier 1 items || Machines producing Tier 2 items || Machines producing Tier 3 items || Machines producing Tier 4 items || Machines producing Tier 5 items&lt;br /&gt;
|-&lt;br /&gt;
| Chemical plant || 92 || 318 || 37 || 11 || 3 || 1&lt;br /&gt;
|-&lt;br /&gt;
| Assembling machine 3 || 62 || 205 || 30 || 10 || 3 || 1&lt;br /&gt;
|-&lt;br /&gt;
| Foundry || 30 || 89 || 20 || 8 || 3 || 1&lt;br /&gt;
|-&lt;br /&gt;
| Electromagnetic plant || 20 || 56 || 16 || 7 || 3 || 1&lt;br /&gt;
|-&lt;br /&gt;
| Cryogenic plant || 17 || 41 || 16 || 8 || 4 || 1&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;/tabber&amp;gt;&lt;/div&gt;</summary>
		<author><name>Untitled7</name></author>
	</entry>
	<entry>
		<id>https://wiki.factorio.com/index.php?title=Tutorial:Quality_upcycling_math&amp;diff=206998</id>
		<title>Tutorial:Quality upcycling math</title>
		<link rel="alternate" type="text/html" href="https://wiki.factorio.com/index.php?title=Tutorial:Quality_upcycling_math&amp;diff=206998"/>
		<updated>2024-11-23T21:30:29Z</updated>

		<summary type="html">&lt;p&gt;Untitled7: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;How do we get the most amount of [[Quality|legendary]] items out of an upcycling plant?&lt;br /&gt;
&lt;br /&gt;
The answer is not quite as straight forward as we&#039;d like it to be, because it depends on a number of factors, luckily there is a finite number of possibilities of what the modules can be, and for the sake of simplicity this tutorial will ignore the productivity gain from [[Technologies#Space_Age|infinite technologies]].&lt;br /&gt;
&lt;br /&gt;
== The crafting machines ==&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Crafting machine || Module slots &amp;lt;math&amp;gt;N&amp;lt;/math&amp;gt; || Base productivity bonus &amp;lt;math&amp;gt;p_0&amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| [[Chemical plant]] || 3 || +0%&lt;br /&gt;
|-&lt;br /&gt;
| [[Assembling machine 3]] || 4 || +0%&lt;br /&gt;
|-&lt;br /&gt;
| [[Foundry]] || 4 || +50%&lt;br /&gt;
|-&lt;br /&gt;
| [[Electromagnetic plant]] || 5 || +50%&lt;br /&gt;
|-&lt;br /&gt;
| [[Cryogenic plant]] || 8 || +0%&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Quality probability ==&lt;br /&gt;
When an item gets produced and the initial roll decides that the quality of the item will increase, there is a 90% chance it will rise one tier, a 9% chance it will rise two, a 0.9% chance it will rise three, and a 0.1% chance it will rise four. This is of course capped if the item already started out at a higher tier.&lt;br /&gt;
&lt;br /&gt;
== Mathematical model ==&lt;br /&gt;
The mathematical model is time discrete. As opposed to dealing with derivatives in respect to time, the next state is a direct function of the previous state.&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;math&amp;gt;m_{i,k}&amp;lt;/math&amp;gt; ... Number of materials of tier &amp;lt;math&amp;gt;i&amp;lt;/math&amp;gt; after the &amp;lt;math&amp;gt;k&amp;lt;/math&amp;gt;-th iteration before being crafted. (this doesn&#039;t mean that an item only needs one type of ingredient, but that &amp;quot;1 materials&amp;quot; can be crafted into 1 item from them)&lt;br /&gt;
* &amp;lt;math&amp;gt;n_{i,k}&amp;lt;/math&amp;gt; ... Number of items of tier &amp;lt;math&amp;gt;i&amp;lt;/math&amp;gt; after the &amp;lt;math&amp;gt;k&amp;lt;/math&amp;gt;-th iteration, after being crafted together.&lt;br /&gt;
* &amp;lt;math&amp;gt;p_0&amp;lt;/math&amp;gt; ... the crafting machines inherent productivity bonus&lt;br /&gt;
* &amp;lt;math&amp;gt;N&amp;lt;/math&amp;gt; ... number of modules the crafting machine can hold&lt;br /&gt;
* &amp;lt;math&amp;gt;q_r = 4 \cdot 6.2 \, \% = 0.248&amp;lt;/math&amp;gt; ... quality probability of the recyclers with 4 [[quality module 3]]&#039;s&lt;br /&gt;
* &amp;lt;math&amp;gt;p_i = p_0 + x_i \cdot 25 \, \%&amp;lt;/math&amp;gt; ... productivity due to &amp;lt;math&amp;gt;x_i&amp;lt;/math&amp;gt; legendary [[productivity module 3]]&#039;s in the crafting machine which takes &amp;lt;math&amp;gt;i&amp;lt;/math&amp;gt;-tier materials&lt;br /&gt;
* &amp;lt;math&amp;gt;q_i = (N-x_i) \cdot 6.2 \, \%&amp;lt;/math&amp;gt; ... quality probability due to &amp;lt;math&amp;gt;(N - x_i)&amp;lt;/math&amp;gt; legendary quality module 3&#039;s in the crafting machine which takes &amp;lt;math&amp;gt;i&amp;lt;/math&amp;gt;-tier materials&lt;br /&gt;
&lt;br /&gt;
=== Recycled materials ===&lt;br /&gt;
When a quarter of all items being recycled and the quality probability rules we can write the equations for the amount of materials received after recycling. This calculation is rather simple, as we the lowest tier can only come forth from it&#039;s own tier failing to raise in quality. The second tier are 90% of tier 1 items that did increase, and all those tier 2 items that didn&#039;t. This continues for all tiers as follows, but legendary items &amp;lt;math&amp;gt;n_{5,k}&amp;lt;/math&amp;gt; will not be recycled&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\begin{align}&lt;br /&gt;
m_{1,k+1} &amp;amp;= \frac{n_{1,k}}{4} \cdot (1 - q_r)\\&lt;br /&gt;
m_{2,k+1} &amp;amp;= \frac{n_{1,k}}{4} \cdot q_r \cdot 0.9 &amp;amp;+&amp;amp; \frac{n_{2,k}}{4} \cdot (1 - q_r)\\&lt;br /&gt;
m_{3,k+1} &amp;amp;= \frac{n_{1,k}}{4} \cdot q_r \cdot 0.09 &amp;amp;+&amp;amp; \frac{n_{2,k}}{4} \cdot q_r \cdot 0.9 &amp;amp;+&amp;amp; \frac{n_{3,k}}{4} \cdot (1 - q_r)\\&lt;br /&gt;
m_{4,k+1} &amp;amp;= \frac{n_{1,k}}{4} \cdot q_r \cdot 0.009 &amp;amp;+&amp;amp; \frac{n_{2,k}}{4} \cdot q_r \cdot 0.09 &amp;amp;+&amp;amp; \frac{n_{3,k}}{4} \cdot q_r \cdot 0.9 &amp;amp;+&amp;amp; \frac{n_{4,k}}{4} \cdot (1 - q_r)\\&lt;br /&gt;
m_{5,k+1} &amp;amp;= \frac{n_{1,k}}{4} \cdot q_r \cdot 0.001 &amp;amp;+&amp;amp; \frac{n_{2,k}}{4} \cdot q_r \cdot 0.01 &amp;amp;+&amp;amp; \frac{n_{3,k}}{4} \cdot q_r \cdot 0.1 &amp;amp;+&amp;amp; \frac{n_{4,k}}{4} \cdot q_r\\&lt;br /&gt;
\end{align}&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
which can also be written as a vector-matrix-multiplication &amp;lt;math&amp;gt;\textbf{m}_{k+1} = \textbf{A} \,\textbf{n}_k&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\underbrace{\begin{bmatrix} m_{1,k+1}\\ m_{2,k+1}\\ m_{3,k+1}\\ m_{4,k+1}\\ m_{5,k+1}\\ \end{bmatrix}}_{\textbf{m}_{k+1}}&lt;br /&gt;
=&lt;br /&gt;
\underbrace{\begin{bmatrix}&lt;br /&gt;
\frac{1 - q_r}{4} &amp;amp; 0 &amp;amp; 0 &amp;amp; 0 &amp;amp; 0\\&lt;br /&gt;
\frac{0.9 \, q_r}{4}   &amp;amp; \frac{1 - q_r}{4} &amp;amp; 0 &amp;amp; 0 &amp;amp; 0\\&lt;br /&gt;
\frac{0.09 \, q_r}{4}  &amp;amp; \frac{0.9 \, q_r}{4}  &amp;amp; \frac{1 - q_r}{4} &amp;amp; 0 &amp;amp; 0 \\&lt;br /&gt;
\frac{0.009 \, q_r}{4} &amp;amp; \frac{0.09 \, q_r}{4} &amp;amp; \frac{0.9 \, q_r}{4} &amp;amp; \frac{1 - q_r}{4} &amp;amp; 0\\&lt;br /&gt;
\frac{0.001 \, q_r}{4} &amp;amp; \frac{0.01 \, q_r}{4} &amp;amp; \frac{0.1 \, q_r}{4} &amp;amp; \frac{q_r}{4} &amp;amp; 0\\&lt;br /&gt;
\end{bmatrix}}_{\textbf{A}}&lt;br /&gt;
\underbrace{\begin{bmatrix} n_{1,k}\\ n_{2,k}\\ n_{3,k}\\ n_{4,k}\\ n_{5,k}\\ \end{bmatrix}}_{\textbf{n}_k}&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As we assume there is nothing to be done about recyclers to make them more effective but fill them with all quality modules, the value of &amp;lt;math&amp;gt;q_r = 0.248&amp;lt;/math&amp;gt; is a constant, and therefore the matrix &amp;lt;math&amp;gt;\textbf{A}&amp;lt;/math&amp;gt; is also a constant. For legendary quality module 3&#039;s, it looks like:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \textbf{A} = &lt;br /&gt;
\begin{bmatrix}&lt;br /&gt;
0.188 &amp;amp; 0 &amp;amp; 0 &amp;amp; 0 &amp;amp; 0 \\&lt;br /&gt;
0.055\,8 &amp;amp; 0.188 &amp;amp; 0 &amp;amp; 0 &amp;amp; 0 \\&lt;br /&gt;
0.005\,58 &amp;amp; 0.055\,8 &amp;amp; 0.188 &amp;amp; 0 &amp;amp; 0 \\&lt;br /&gt;
0.000\,558 &amp;amp; 0.005\,58 &amp;amp; 0.055\,8 &amp;amp; 0.188 &amp;amp; 0 \\&lt;br /&gt;
0.000\,062 &amp;amp; 0.000\,62 &amp;amp; 0.006\,2 &amp;amp; 0.062 &amp;amp; 0 \\&lt;br /&gt;
\end{bmatrix}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Recrafted items ===&lt;br /&gt;
Once more we first check how many items are produced, which is, again, the sum of all possible ways to get to a tier, this time adding productivity &amp;lt;math&amp;gt;p_i&amp;lt;/math&amp;gt;, and bringing along all those items which are already legendary &amp;lt;math&amp;gt;n_{5,k}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\begin{align}&lt;br /&gt;
n_{1,k+1} &amp;amp;= m_{1,k+1} \cdot ( 1 + p_1 ) \cdot (1 - q_1)\\&lt;br /&gt;
n_{2,k+1} &amp;amp;= m_{1,k+1} \cdot ( 1 + p_1 ) \cdot q_1 \cdot 0.9 &amp;amp;+&amp;amp;  m_{2,k+1} \cdot ( 1 + p_2 ) \cdot (1 - q_2)\\&lt;br /&gt;
n_{3,k+1} &amp;amp;= m_{1,k+1} \cdot ( 1 + p_1 ) \cdot q_1 \cdot 0.09 &amp;amp;+&amp;amp;  m_{2,k+1} \cdot ( 1 + p_2 ) \cdot q_2 \cdot 0.9 &amp;amp;+&amp;amp; m_{3,k+1} \cdot ( 1 + p_3 ) \cdot (1 - q_3) \\&lt;br /&gt;
n_{4,k+1} &amp;amp;= m_{1,k+1} \cdot ( 1 + p_1 ) \cdot q_1 \cdot 0.009 &amp;amp;+&amp;amp;  m_{2,k+1} \cdot ( 1 + p_2 ) \cdot q_2 \cdot 0.09 &amp;amp;+&amp;amp; m_{3,k+1} \cdot ( 1 + p_3 ) \cdot q_3 \cdot 0.9  &amp;amp;+&amp;amp; m_{4,k+1} \cdot ( 1 + p_4) \cdot (1 - q_4) \\&lt;br /&gt;
n_{5,k+1} &amp;amp;= m_{1,k+1} \cdot ( 1 + p_1 ) \cdot q_1 \cdot 0.001 &amp;amp;+&amp;amp;  m_{2,k+1} \cdot ( 1 + p_2 ) \cdot q_2 \cdot 0.01 &amp;amp;+&amp;amp; m_{3,k+1} \cdot ( 1 + p_3 ) \cdot q_3 \cdot 0.1  &amp;amp;+&amp;amp; m_{4,k+1} \cdot ( 1 + p_4) \cdot q_4 &amp;amp;+&amp;amp; m_{5,k+1} \cdot ( 1 + p_5) + n_{5,k}\\&lt;br /&gt;
\end{align}&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This can once more be written as a vector-matrix-multiplication &amp;lt;math&amp;gt;\textbf{n}_{k+1} = \textbf{B} \,\textbf{m}_{k+1} + \textbf{C} \,\textbf{n}_{k}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\underbrace{\begin{bmatrix} n_{1,k+1}\\ n_{2,k+1}\\ n_{3,k+1}\\ n_{4,k+1}\\ n_{5,k+1}\\ \end{bmatrix}}_{\textbf{n}_{k+1}} = &lt;br /&gt;
\underbrace{\begin{bmatrix}&lt;br /&gt;
( 1 + p_1 ) \cdot (1 - q_1) &amp;amp; 0 &amp;amp; 0 &amp;amp; 0 &amp;amp; 0 \\&lt;br /&gt;
( 1 + p_1 ) \cdot q_1 \cdot 0.9 &amp;amp;  ( 1 + p_2 ) \cdot (1 - q_2) &amp;amp; 0 &amp;amp; 0 &amp;amp; 0 \\&lt;br /&gt;
( 1 + p_1 ) \cdot q_1 \cdot 0.09 &amp;amp; ( 1 + p_2 ) \cdot q_2 \cdot 0.9 &amp;amp; ( 1 + p_3 ) \cdot (1 - q_3) &amp;amp; 0 &amp;amp; 0 \\&lt;br /&gt;
( 1 + p_1 ) \cdot q_1 \cdot 0.009 &amp;amp; ( 1 + p_2 ) \cdot q_2 \cdot 0.09 &amp;amp; ( 1 + p_3 ) \cdot q_3 \cdot 0.9  &amp;amp; ( 1 + p_4) \cdot (1 - q_4) &amp;amp; 0 \\&lt;br /&gt;
( 1 + p_1 ) \cdot q_1 \cdot 0.001 &amp;amp; ( 1 + p_2 ) \cdot q_2 \cdot 0.01 &amp;amp; ( 1 + p_3 ) \cdot q_3 \cdot 0.1  &amp;amp; ( 1 + p_4) \cdot q_4 &amp;amp; ( 1 + p_5)\\&lt;br /&gt;
\end{bmatrix}}_{B}&lt;br /&gt;
\underbrace{\begin{bmatrix} m_{1,k+1}\\ m_{2,k+1}\\ m_{3,k+1}\\ m_{4,k+1}\\ m_{5,k+1}\\ \end{bmatrix}}_{\textbf{m}_{k+1}}&lt;br /&gt;
+&lt;br /&gt;
\begin{bmatrix}&lt;br /&gt;
0&amp;amp;0&amp;amp;0&amp;amp;0\\&lt;br /&gt;
0&amp;amp;0&amp;amp;0&amp;amp;0\\&lt;br /&gt;
0&amp;amp;0&amp;amp;0&amp;amp;0\\&lt;br /&gt;
0&amp;amp;0&amp;amp;0&amp;amp;0\\&lt;br /&gt;
0&amp;amp;0&amp;amp;0&amp;amp;1\\&lt;br /&gt;
\end{bmatrix}&lt;br /&gt;
\underbrace{\begin{bmatrix} n_{1,k}\\ n_{2,k}\\ n_{3,k}\\ n_{4,k}\\ n_{5,k}\\ \end{bmatrix}}_{\textbf{n}_k}&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Combined model ===&lt;br /&gt;
&lt;br /&gt;
As such we gain an equation for the amount of items for every tier after any amount of iterations&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\begin{align}&lt;br /&gt;
\textbf{n}_{k+1} &lt;br /&gt;
    &amp;amp;= \textbf{B} \, \textbf{m}_{k+1} + \textbf{C} \, \textbf{n}_{k}\\&lt;br /&gt;
    &amp;amp;= \textbf{B} \, \textbf{A} \,\textbf{n}_{k} + \textbf{C} \, \textbf{n}_{k}\\&lt;br /&gt;
    &amp;amp;= (\textbf{B} \, \textbf{A} +\textbf{C} ) \, \textbf{n}_{k}\\&lt;br /&gt;
    &amp;amp;= \textbf{M} \, \textbf{n}_{k}\\&lt;br /&gt;
\textbf{n}_{k+2} &amp;amp;= \textbf{Q} \, \textbf{n}_{k+1} = \textbf{Q} \,  \textbf{Q} \, \textbf{n}_{k} = \textbf{Q}^2 \, \textbf{n}_{k}\\&lt;br /&gt;
&amp;amp;\vdots\\&lt;br /&gt;
\textbf{n}_k &amp;amp;= \textbf{Q}^k \, \textbf{n}_0\\&lt;br /&gt;
\end{align}&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
A realistic starting point for &amp;lt;math&amp;gt;\textbf{n}_0&amp;lt;/math&amp;gt; is only items in tier 1, and if we do not care for any other tiers, we simply choose sufficiently large &amp;lt;math&amp;gt;k = 100&amp;lt;/math&amp;gt;, and, through numeric means, try to maximize a single value. &amp;lt;math&amp;gt;q_{100,\text{crit}}&amp;lt;/math&amp;gt;, which falls in the fifth row, first column, of the Matrix &amp;lt;math&amp;gt;\textbf{Q}&amp;lt;/math&amp;gt; raised to the 100th power.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\begin{align}&lt;br /&gt;
\textbf{n}_k &amp;amp;= Q^k \, \textbf{n}_0\\&lt;br /&gt;
\begin{bmatrix}*\\ *\\ *\\ *\\ n_{5,100} \end{bmatrix} &amp;amp;= &lt;br /&gt;
\begin{bmatrix}&lt;br /&gt;
 * &amp;amp; * &amp;amp; * &amp;amp; * \\&lt;br /&gt;
 * &amp;amp; * &amp;amp; * &amp;amp; * \\&lt;br /&gt;
 * &amp;amp; * &amp;amp; * &amp;amp; * \\&lt;br /&gt;
 * &amp;amp; * &amp;amp; * &amp;amp; * \\&lt;br /&gt;
q_{100,\text{crit}} &amp;amp; * &amp;amp; * &amp;amp; * \\&lt;br /&gt;
\end{bmatrix} \begin{bmatrix}n_{1,0}\\ *\\ *\\ *\\ * \end{bmatrix}\\&lt;br /&gt;
\end{align}&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The choice of optimization method (simplex, branch and bound, etc.) itself is irrelevant, although most software will want the problem to be stated in a way so it can find a minimum, and may require the proper guard rails as to not pick values below 0 or higher than the maximum number of allowed modules.&lt;br /&gt;
&lt;br /&gt;
== Best ratios ==&lt;br /&gt;
This table shows the best ratio for quality to productivity modules in the crafting machines, while the recyclers always take only quality modules. The values are not given in whole numbers because often it is not just a single crafting machine per tier that will be used, then the ratios can change between different crafting machines in the same tier. e.g. &amp;quot;3.67 quality / 1.33 productivity&amp;quot; could have 4 machines where 3 have a ratio 4 to 1, and one a ratio 3 to 2.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tabber&amp;gt;&lt;br /&gt;
common modules = &lt;br /&gt;
&amp;quot;Modules in Tier X&amp;quot; means which Modules need to go into the machines that are set to produce the item at tier X.&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Crafting machine || Modules in Tier 1 || Modules in Tier 2 || Modules in Tier 3 || Modules in Tier 4 || Modules in Tier 5 || percentage yield || items recycled*&lt;br /&gt;
|-&lt;br /&gt;
| Chemical plant || 3 quality &amp;lt;br /&amp;gt;0 productivity || 3 quality &amp;lt;br /&amp;gt;0 productivity || 3 quality &amp;lt;br /&amp;gt;0 productivity || 3 quality &amp;lt;br /&amp;gt;0 productivity  || 0 quality &amp;lt;br /&amp;gt;3 productivity || 0.034014% || 2940&lt;br /&gt;
|-&lt;br /&gt;
| Assembling machine 3 || 4 quality &amp;lt;br /&amp;gt;0 productivity || 4 quality &amp;lt;br /&amp;gt;0 productivity || 4 quality &amp;lt;br /&amp;gt;0 productivity || 4 quality &amp;lt;br /&amp;gt;0 productivity  || 0 quality &amp;lt;br /&amp;gt;4 productivity || 0.046275% || 2161&lt;br /&gt;
|-&lt;br /&gt;
| Foundry || 4 quality &amp;lt;br /&amp;gt;0 productivity || 4 quality &amp;lt;br /&amp;gt;0 productivity || 4 quality &amp;lt;br /&amp;gt;0 productivity || 4 quality &amp;lt;br /&amp;gt;0 productivity  || 0 quality &amp;lt;br /&amp;gt;4 productivity || 0.133814% || 747&lt;br /&gt;
|-&lt;br /&gt;
| Electromagnetic plant || 5 quality &amp;lt;br /&amp;gt;0 productivity || 5 quality &amp;lt;br /&amp;gt;0 productivity || 5 quality &amp;lt;br /&amp;gt;0 productivity || 5 quality &amp;lt;br /&amp;gt;0 productivity  || 0 quality &amp;lt;br /&amp;gt;5 productivity || 0.176712% || 566&lt;br /&gt;
|-&lt;br /&gt;
| Cryogenic plant || 6 quality &amp;lt;br /&amp;gt;2 productivity || 6 quality &amp;lt;br /&amp;gt;2 productivity || 6 quality &amp;lt;br /&amp;gt;2 productivity || 6.5 quality &amp;lt;br /&amp;gt;1.5 productivity  || 0 quality &amp;lt;br /&amp;gt;8 productivity || 0.119134%|| 840&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;nowiki&amp;gt;*&amp;lt;/nowiki&amp;gt; &amp;quot;items recycled&amp;quot; quantifies how many items need to be crafted and put into the entire upcycler, it doesn&#039;t account for those which get recycled multiple times.&lt;br /&gt;
\-\&lt;br /&gt;
uncommon modules = &lt;br /&gt;
&amp;quot;Modules in Tier X&amp;quot; means which Modules need to go into the machines that are set to produce the item at tier X.&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Crafting machine || Modules in Tier 1 || Modules in Tier 2 || Modules in Tier 3 || Modules in Tier 4 || Modules in Tier 5 || percentage yield || items recycled*&lt;br /&gt;
|-&lt;br /&gt;
| Chemical plant || 3 quality &amp;lt;br /&amp;gt;0 productivity || 3 quality &amp;lt;br /&amp;gt;0 productivity || 3 quality &amp;lt;br /&amp;gt;0 productivity || 3 quality &amp;lt;br /&amp;gt;0 productivity  || 0 quality &amp;lt;br /&amp;gt;3 productivity || 0.059498% || 1681&lt;br /&gt;
|-&lt;br /&gt;
| Assembling machine 3 || 3.75 quality &amp;lt;br /&amp;gt;0.25 productivity || 3.75 quality &amp;lt;br /&amp;gt;0.25 productivity || 3.8 quality &amp;lt;br /&amp;gt;0.2 productivity || 3.9 quality &amp;lt;br /&amp;gt;0.1 productivity  || 0 quality &amp;lt;br /&amp;gt;4 productivity || 0.082296% || 1216&lt;br /&gt;
|-&lt;br /&gt;
| Foundry || 4 quality &amp;lt;br /&amp;gt;0 productivity || 4 quality &amp;lt;br /&amp;gt;0 productivity || 4 quality &amp;lt;br /&amp;gt;0 productivity || 4 quality &amp;lt;br /&amp;gt;0 productivity  || 0 quality &amp;lt;br /&amp;gt;4 productivity || 0.243699% || 410&lt;br /&gt;
|-&lt;br /&gt;
| Electromagnetic plant || 4.7 quality &amp;lt;br /&amp;gt;0.3 productivity || 4.67 quality &amp;lt;br /&amp;gt;0.33 productivity || 4.75 quality &amp;lt;br /&amp;gt;0.25 productivity || 4.9 quality &amp;lt;br /&amp;gt;0.1 productivity  || 0 quality &amp;lt;br /&amp;gt;5 productivity || 0.324189% || 309&lt;br /&gt;
|-&lt;br /&gt;
| Cryogenic plant || 4.6 quality &amp;lt;br /&amp;gt;3.4 productivity || 4.6 quality &amp;lt;br /&amp;gt;3.4 productivity || 4.67 quality &amp;lt;br /&amp;gt;3.33 productivity  || 5 quality &amp;lt;br /&amp;gt;3 productivity  || 0 quality &amp;lt;br /&amp;gt;8 productivity || 0.257621% || 389&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;nowiki&amp;gt;*&amp;lt;/nowiki&amp;gt; &amp;quot;items recycled&amp;quot; quantifies how many items need to be crafted and put into the entire upcycler, it doesn&#039;t account for those which get recycled multiple times.&lt;br /&gt;
\-\&lt;br /&gt;
rare modules = &lt;br /&gt;
&amp;quot;Modules in Tier X&amp;quot; means which Modules need to go into the machines that are set to produce the item at tier X.&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Crafting machine || Modules in Tier 1 || Modules in Tier 2 || Modules in Tier 3 || Modules in Tier 4 || Modules in Tier 5 || percentage yield || items recycled*&lt;br /&gt;
|-&lt;br /&gt;
| Chemical plant || 2.8 quality &amp;lt;br /&amp;gt;0.2 productivity || 2.8 quality &amp;lt;br /&amp;gt;0.2 productivity || 2.9 quality &amp;lt;br /&amp;gt;0.1 productivity || 2.9 quality &amp;lt;br /&amp;gt;0.1 productivity  || 0 quality &amp;lt;br /&amp;gt;3 productivity || 0.100660% || 994&lt;br /&gt;
|-&lt;br /&gt;
| Assembling machine 3 || 3 quality &amp;lt;br /&amp;gt;1 productivity || 3.1 quality &amp;lt;br /&amp;gt;0.9 productivity || 3.2 quality &amp;lt;br /&amp;gt;0.8 productivity || 3.33 quality &amp;lt;br /&amp;gt;0.67 productivity  || 0 quality &amp;lt;br /&amp;gt;4 productivity || 0.145220% || 689&lt;br /&gt;
|-&lt;br /&gt;
| Foundry || 3.5 quality &amp;lt;br /&amp;gt;0.5 productivity || 3.5 quality &amp;lt;br /&amp;gt;0.5 productivity || 3.6 quality &amp;lt;br /&amp;gt;0.4 productivity || 3.9 quality &amp;lt;br /&amp;gt;0.1 productivity  || 0 quality &amp;lt;br /&amp;gt;4 productivity || 0.424039% || 236&lt;br /&gt;
|-&lt;br /&gt;
| Electromagnetic plant || 3.6 quality &amp;lt;br /&amp;gt;1.4 productivity || 3.6 quality &amp;lt;br /&amp;gt;1.4 productivity || 3.6 quality &amp;lt;br /&amp;gt;1.4 productivity || 3.9 quality &amp;lt;br /&amp;gt;1.1 productivity  || 0 quality &amp;lt;br /&amp;gt;5 productivity || 0.588510% || 170&lt;br /&gt;
|-&lt;br /&gt;
| Cryogenic plant || 3.6 quality &amp;lt;br /&amp;gt;4.4 productivity || 3.6 quality &amp;lt;br /&amp;gt;4.4 productivity || 3.6 quality &amp;lt;br /&amp;gt;4.4 productivity  || 3.9 quality &amp;lt;br /&amp;gt;4.1 productivity  || 0 quality &amp;lt;br /&amp;gt;8 productivity || 0.565030% || 177&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;nowiki&amp;gt;*&amp;lt;/nowiki&amp;gt; &amp;quot;items recycled&amp;quot; quantifies how many items need to be crafted and put into the entire upcycler, it doesn&#039;t account for those which get recycled multiple times.&lt;br /&gt;
\-\&lt;br /&gt;
epic modules = &lt;br /&gt;
&amp;quot;Modules in Tier X&amp;quot; means which Modules need to go into the machines that are set to produce the item at tier X.&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Crafting machine || Modules in Tier 1 || Modules in Tier 2 || Modules in Tier 3 || Modules in Tier 4 || Modules in Tier 5 || percentage yield || items recycled*&lt;br /&gt;
|-&lt;br /&gt;
| Chemical plant || 2.33 quality &amp;lt;br /&amp;gt;0.67 productivity || 2.4 quality &amp;lt;br /&amp;gt;0.6 productivity || 2.4 quality &amp;lt;br /&amp;gt;0.6 productivity || 2.4 quality &amp;lt;br /&amp;gt;0.6 productivity  || 0 quality &amp;lt;br /&amp;gt;3 productivity || 0.152486% || 656&lt;br /&gt;
|-&lt;br /&gt;
| Assembling machine 3 || 2.5 quality &amp;lt;br /&amp;gt;1.5 productivity || 2.5 quality &amp;lt;br /&amp;gt;1.5 productivity || 2.6 quality &amp;lt;br /&amp;gt;1.4 productivity || 2.8 quality &amp;lt;br /&amp;gt;1.2 productivity  || 0 quality &amp;lt;br /&amp;gt;4 productivity || 0.232966% || 430&lt;br /&gt;
|-&lt;br /&gt;
| Foundry || 2.7 quality &amp;lt;br /&amp;gt;1.3 productivity || 2.7 quality &amp;lt;br /&amp;gt;1.3 productivity || 2.75 quality &amp;lt;br /&amp;gt;1.25 productivity || 3 quality &amp;lt;br /&amp;gt;1 productivity  || 0 quality &amp;lt;br /&amp;gt;4 productivity || 0.664130% || 151&lt;br /&gt;
|-&lt;br /&gt;
| Electromagnetic plant || 2.6 quality &amp;lt;br /&amp;gt;2.4 productivity || 2.6 quality &amp;lt;br /&amp;gt;2.4 productivity || 2.67 quality &amp;lt;br /&amp;gt;2.33 productivity || 2.9 quality &amp;lt;br /&amp;gt;2.1 productivity  || 0 quality &amp;lt;br /&amp;gt;5 productivity || 0.974700% || 103&lt;br /&gt;
|-&lt;br /&gt;
| Cryogenic plant || 2.6 quality &amp;lt;br /&amp;gt;5.4 productivity || 2.6 quality &amp;lt;br /&amp;gt;5.4 productivity || 2.6 quality &amp;lt;br /&amp;gt;4.4 productivity  || 2.8 quality &amp;lt;br /&amp;gt;4.2 productivity  || 0 quality &amp;lt;br /&amp;gt;8 productivity || 1.122444% || 90&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;nowiki&amp;gt;*&amp;lt;/nowiki&amp;gt; &amp;quot;items recycled&amp;quot; quantifies how many items need to be crafted and put into the entire upcycler, it doesn&#039;t account for those which get recycled multiple times.&lt;br /&gt;
\-\&lt;br /&gt;
legendary modules=&lt;br /&gt;
&amp;quot;Modules in Tier X&amp;quot; means which Modules need to go into the machines that are set to produce the item at tier X.&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Crafting machine || Modules in Tier 1 || Modules in Tier 2 || Modules in Tier 3 || Modules in Tier 4 || Modules in Tier 5 || percentage yield || items recycled*&lt;br /&gt;
|-&lt;br /&gt;
| Chemical plant || 1.67 quality &amp;lt;br /&amp;gt;1.33 productivity || 1.67 quality &amp;lt;br /&amp;gt;1.33 productivity || 1.67 quality &amp;lt;br /&amp;gt;1.333 productivity || 1.8 quality &amp;lt;br /&amp;gt;1.2 productivity  || 0 quality &amp;lt;br /&amp;gt;3 productivity || 0.344061% || 291&lt;br /&gt;
|-&lt;br /&gt;
| Assembling machine 3 || 1.67 quality &amp;lt;br /&amp;gt;2.33 productivity || 1.67 quality &amp;lt;br /&amp;gt;2.33 productivity || 1.67 quality &amp;lt;br /&amp;gt;2.33 productivity || 1.8 quality &amp;lt;br /&amp;gt;2.2 productivity  || 0 quality &amp;lt;br /&amp;gt;4 productivity || 0.586191% || 171&lt;br /&gt;
|-&lt;br /&gt;
| Foundry || 1.4 quality &amp;lt;br /&amp;gt;2.6 productivity || 1.4 quality &amp;lt;br /&amp;gt;2.6 productivity || 1.4 quality &amp;lt;br /&amp;gt;2.6 productivity || 1.5 quality &amp;lt;br /&amp;gt;2.5 productivity  || 0 quality &amp;lt;br /&amp;gt;4 productivity || 1.624266% || 62&lt;br /&gt;
|-&lt;br /&gt;
| Electromagnetic plant || 1 quality &amp;lt;br /&amp;gt;4 productivity || 1 quality &amp;lt;br /&amp;gt;4 productivity || 1 quality &amp;lt;br /&amp;gt;4 productivity || 1 quality &amp;lt;br /&amp;gt;4 productivity  || 0 quality &amp;lt;br /&amp;gt;5 productivity || 2.722332% || 37&lt;br /&gt;
|-&lt;br /&gt;
| Cryogenic plant || 0 quality &amp;lt;br /&amp;gt;8 productivity || 0 quality &amp;lt;br /&amp;gt;8 productivity || 0 quality &amp;lt;br /&amp;gt;8 productivity || 0 quality &amp;lt;br /&amp;gt;8 productivity  || 0 quality &amp;lt;br /&amp;gt;8 productivity || 4.835199% || 21&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;nowiki&amp;gt;*&amp;lt;/nowiki&amp;gt; &amp;quot;items recycled&amp;quot; quantifies how many items need to be crafted and put into the entire upcycler, it doesn&#039;t account for those which get recycled multiple times.&lt;br /&gt;
&amp;lt;/tabber&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Number of crafting machines ===&lt;br /&gt;
If we assume a constant input stream of tier 1 items which will always fill back up, we can additionally figure out what ratio of items will be inside the system at once, and with that we can figure out how many crafting machines we need per tier. This is done by setting &amp;lt;math&amp;gt;m_{1,k+1} = 100 \, \% - m_{2,k+1} - m_{3,k+1} - m_{4,k+1}&amp;lt;/math&amp;gt; after each iteration.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tabber&amp;gt;&lt;br /&gt;
per recycler=&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Crafting machine || Recyclers || Machines producing Tier 1 items || Machines producing Tier 2 items || Machines producing Tier 3 items || Machines producing Tier 4 items || Machines producing Tier 5 items&lt;br /&gt;
|-&lt;br /&gt;
| Chemical plant || 1 || 3.4427 || 0.0290 || 1.0086 || 0.0077 || 0.2979&lt;br /&gt;
|-&lt;br /&gt;
| Assembling machine 3 || 1 || 3.3027 || 0.0365 || 1.0657 || 0.0108 || 0.3286&lt;br /&gt;
|-&lt;br /&gt;
| Foundry || 1 || 2.9551 || 0.0563 || 1.1528 || 0.0208 || 0.3653&lt;br /&gt;
|-&lt;br /&gt;
| Electromagnetic plant || 1 || 2.7239 || 0.0709 || 1.1726 || 0.0301 || 0.3474&lt;br /&gt;
|-&lt;br /&gt;
| Cryogenic plant || 1 || 2.3798 || 0.0972 || 1.1517 || 0.0470 || 0.2700&lt;br /&gt;
&lt;br /&gt;
|}&lt;br /&gt;
\-\&lt;br /&gt;
per tier 5 crafter (exact) =&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Crafting machine || Recyclers || Machines producing Tier 1 items || Machines producing Tier 2 items || Machines producing Tier 3 items || Machines producing Tier 4 items || Machines producing Tier 5 items&lt;br /&gt;
|-&lt;br /&gt;
| Chemical plant || 108.8978 || 374.9134 || 43.5367 || 12.7555 || 3.3856 || 1&lt;br /&gt;
|-&lt;br /&gt;
| Assembling machine 3 || 70.4576 || 232.7032 || 33.9340 || 10.9500 || 3.2432 || 1&lt;br /&gt;
|-&lt;br /&gt;
| Foundry || 33.0224 || 97.5872 || 21.8308 || 8.5164 || 3.1550 || 1&lt;br /&gt;
|-&lt;br /&gt;
| Electromagnetic plant || 24.1178 || 65.6959 || 18.4556 || 7.9448 || 3.3747 || 1&lt;br /&gt;
|-&lt;br /&gt;
| Cryogenic plant || 19.9316 || 47.4350 || 18.2124 || 8.8138 || 4.2654 || 1&lt;br /&gt;
|}&lt;br /&gt;
\-\&lt;br /&gt;
per tier 5 crafter (conservative)=&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Crafting machine || Recyclers || Machines producing Tier 1 items || Machines producing Tier 2 items || Machines producing Tier 3 items || Machines producing Tier 4 items || Machines producing Tier 5 items&lt;br /&gt;
|-&lt;br /&gt;
| Chemical plant || 92 || 318 || 37 || 11 || 3 || 1&lt;br /&gt;
|-&lt;br /&gt;
| Assembling machine 3 || 62 || 205 || 30 || 10 || 3 || 1&lt;br /&gt;
|-&lt;br /&gt;
| Foundry || 30 || 89 || 20 || 8 || 3 || 1&lt;br /&gt;
|-&lt;br /&gt;
| Electromagnetic plant || 20 || 56 || 16 || 7 || 3 || 1&lt;br /&gt;
|-&lt;br /&gt;
| Cryogenic plant || 17 || 41 || 16 || 8 || 4 || 1&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;/tabber&amp;gt;&lt;/div&gt;</summary>
		<author><name>Untitled7</name></author>
	</entry>
	<entry>
		<id>https://wiki.factorio.com/index.php?title=Tutorial:Quality_upcycling_math&amp;diff=206997</id>
		<title>Tutorial:Quality upcycling math</title>
		<link rel="alternate" type="text/html" href="https://wiki.factorio.com/index.php?title=Tutorial:Quality_upcycling_math&amp;diff=206997"/>
		<updated>2024-11-23T19:29:29Z</updated>

		<summary type="html">&lt;p&gt;Untitled7: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;How do we get the most amount of [[Quality|legendary]] items out of an upcycling plant?&lt;br /&gt;
&lt;br /&gt;
The answer is not quite as straight forward as we&#039;d like it to be, because it depends on a number of factors, luckily there is a finite number of possibilities of what the modules can be, and for the sake of simplicity this tutorial will ignore the productivity gain from [[Technologies#Space_Age|infinite technologies]].&lt;br /&gt;
&lt;br /&gt;
== The crafting machines ==&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Crafting machine || Module slots &amp;lt;math&amp;gt;N&amp;lt;/math&amp;gt; || Base productivity bonus &amp;lt;math&amp;gt;p_0&amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| [[Chemical plant]] || 3 || +0%&lt;br /&gt;
|-&lt;br /&gt;
| [[Assembling machine 3]] || 4 || +0%&lt;br /&gt;
|-&lt;br /&gt;
| [[Foundry]] || 4 || +50%&lt;br /&gt;
|-&lt;br /&gt;
| [[Electromagnetic plant]] || 5 || +50%&lt;br /&gt;
|-&lt;br /&gt;
| [[Cryogenic plant]] || 8 || +0%&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Quality probability ==&lt;br /&gt;
When an item gets produced and the initial roll decides that the quality of the item will increase, there is a 90% chance it will rise one tier, a 9% chance it will rise two, a 0.9% chance it will rise three, and a 0.1% chance it will rise four. This is of course capped if the item already started out at a higher tier.&lt;br /&gt;
&lt;br /&gt;
== Mathematical model ==&lt;br /&gt;
The mathematical model is time discrete. As opposed to dealing with derivatives in respect to time, the next state is a direct function of the previous state.&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;math&amp;gt;m_{i,k}&amp;lt;/math&amp;gt; ... Number of materials of tier &amp;lt;math&amp;gt;i&amp;lt;/math&amp;gt; after the &amp;lt;math&amp;gt;k&amp;lt;/math&amp;gt;-th iteration before being crafted. (this doesn&#039;t mean that an item only needs one type of ingredient, but that &amp;quot;1 materials&amp;quot; can be crafted into 1 item from them)&lt;br /&gt;
* &amp;lt;math&amp;gt;n_{i,k}&amp;lt;/math&amp;gt; ... Number of items of tier &amp;lt;math&amp;gt;i&amp;lt;/math&amp;gt; after the &amp;lt;math&amp;gt;k&amp;lt;/math&amp;gt;-th iteration, after being crafted together.&lt;br /&gt;
* &amp;lt;math&amp;gt;p_0&amp;lt;/math&amp;gt; ... the crafting machines inherent productivity bonus&lt;br /&gt;
* &amp;lt;math&amp;gt;N&amp;lt;/math&amp;gt; ... number of modules the crafting machine can hold&lt;br /&gt;
* &amp;lt;math&amp;gt;q_r = 4 \cdot 6.2 \, \% = 0.248&amp;lt;/math&amp;gt; ... quality probability of the recyclers with 4 [[quality module 3]]&#039;s&lt;br /&gt;
* &amp;lt;math&amp;gt;p_i = p_0 + x_i \cdot 25 \, \%&amp;lt;/math&amp;gt; ... productivity due to &amp;lt;math&amp;gt;x_i&amp;lt;/math&amp;gt; legendary [[productivity module 3]]&#039;s in the crafting machine which takes &amp;lt;math&amp;gt;i&amp;lt;/math&amp;gt;-tier materials&lt;br /&gt;
* &amp;lt;math&amp;gt;q_i = (N-x_i) \cdot 6.2 \, \%&amp;lt;/math&amp;gt; ... quality probability due to &amp;lt;math&amp;gt;(N - x_i)&amp;lt;/math&amp;gt; legendary quality module 3&#039;s in the crafting machine which takes &amp;lt;math&amp;gt;i&amp;lt;/math&amp;gt;-tier materials&lt;br /&gt;
&lt;br /&gt;
=== Recycled materials ===&lt;br /&gt;
When a quarter of all items being recycled and the quality probability rules we can write the equations for the amount of materials received after recycling. This calculation is rather simple, as we the lowest tier can only come forth from it&#039;s own tier failing to raise in quality. The second tier are 90% of tier 1 items that did increase, and all those tier 2 items that didn&#039;t. This continues for all tiers as follows, but legendary items &amp;lt;math&amp;gt;n_{5,k}&amp;lt;/math&amp;gt; will not be recycled&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\begin{align}&lt;br /&gt;
m_{1,k+1} &amp;amp;= \frac{n_{1,k}}{4} \cdot (1 - q_r)\\&lt;br /&gt;
m_{2,k+1} &amp;amp;= \frac{n_{1,k}}{4} \cdot q_r \cdot 0.9 &amp;amp;+&amp;amp; \frac{n_{2,k}}{4} \cdot (1 - q_r)\\&lt;br /&gt;
m_{3,k+1} &amp;amp;= \frac{n_{1,k}}{4} \cdot q_r \cdot 0.09 &amp;amp;+&amp;amp; \frac{n_{2,k}}{4} \cdot q_r \cdot 0.9 &amp;amp;+&amp;amp; \frac{n_{3,k}}{4} \cdot (1 - q_r)\\&lt;br /&gt;
m_{4,k+1} &amp;amp;= \frac{n_{1,k}}{4} \cdot q_r \cdot 0.009 &amp;amp;+&amp;amp; \frac{n_{2,k}}{4} \cdot q_r \cdot 0.09 &amp;amp;+&amp;amp; \frac{n_{3,k}}{4} \cdot q_r \cdot 0.9 &amp;amp;+&amp;amp; \frac{n_{4,k}}{4} \cdot (1 - q_r)\\&lt;br /&gt;
m_{5,k+1} &amp;amp;= \frac{n_{1,k}}{4} \cdot q_r \cdot 0.001 &amp;amp;+&amp;amp; \frac{n_{2,k}}{4} \cdot q_r \cdot 0.01 &amp;amp;+&amp;amp; \frac{n_{3,k}}{4} \cdot q_r \cdot 0.1 &amp;amp;+&amp;amp; \frac{n_{4,k}}{4} \cdot q_r\\&lt;br /&gt;
\end{align}&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
which can also be written as a vector-matrix-multiplication &amp;lt;math&amp;gt;\textbf{m}_{k+1} = \textbf{A} \,\textbf{n}_k&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\underbrace{\begin{bmatrix} m_{1,k+1}\\ m_{2,k+1}\\ m_{3,k+1}\\ m_{4,k+1}\\ m_{5,k+1}\\ \end{bmatrix}}_{\textbf{m}_{k+1}}&lt;br /&gt;
=&lt;br /&gt;
\underbrace{\begin{bmatrix}&lt;br /&gt;
\frac{1 - q_r}{4} &amp;amp; 0 &amp;amp; 0 &amp;amp; 0 &amp;amp; 0\\&lt;br /&gt;
\frac{0.9 \, q_r}{4}   &amp;amp; \frac{1 - q_r}{4} &amp;amp; 0 &amp;amp; 0 &amp;amp; 0\\&lt;br /&gt;
\frac{0.09 \, q_r}{4}  &amp;amp; \frac{0.9 \, q_r}{4}  &amp;amp; \frac{1 - q_r}{4} &amp;amp; 0 &amp;amp; 0 \\&lt;br /&gt;
\frac{0.009 \, q_r}{4} &amp;amp; \frac{0.09 \, q_r}{4} &amp;amp; \frac{0.9 \, q_r}{4} &amp;amp; \frac{1 - q_r}{4} &amp;amp; 0\\&lt;br /&gt;
\frac{0.001 \, q_r}{4} &amp;amp; \frac{0.01 \, q_r}{4} &amp;amp; \frac{0.1 \, q_r}{4} &amp;amp; \frac{q_r}{4} &amp;amp; 0\\&lt;br /&gt;
\end{bmatrix}}_{\textbf{A}}&lt;br /&gt;
\underbrace{\begin{bmatrix} n_{1,k}\\ n_{2,k}\\ n_{3,k}\\ n_{4,k}\\ n_{5,k}\\ \end{bmatrix}}_{\textbf{n}_k}&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As we assume there is nothing to be done about recyclers to make them more effective but fill them with all quality modules, the value of &amp;lt;math&amp;gt;q_r = 0.248&amp;lt;/math&amp;gt; is a constant, and therefore the matrix &amp;lt;math&amp;gt;\textbf{A}&amp;lt;/math&amp;gt; is also a constant.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \textbf{A} = &lt;br /&gt;
\begin{bmatrix}&lt;br /&gt;
0.188 &amp;amp; 0 &amp;amp; 0 &amp;amp; 0 &amp;amp; 0 \\&lt;br /&gt;
0.055\,8 &amp;amp; 0.188 &amp;amp; 0 &amp;amp; 0 &amp;amp; 0 \\&lt;br /&gt;
0.005\,58 &amp;amp; 0.055\,8 &amp;amp; 0.188 &amp;amp; 0 &amp;amp; 0 \\&lt;br /&gt;
0.000\,558 &amp;amp; 0.005\,58 &amp;amp; 0.055\,8 &amp;amp; 0.188 &amp;amp; 0 \\&lt;br /&gt;
0.000\,062 &amp;amp; 0.000\,62 &amp;amp; 0.006\,2 &amp;amp; 0.062 &amp;amp; 0 \\&lt;br /&gt;
\end{bmatrix}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Recrafted items ===&lt;br /&gt;
Once more we first check how many items are produced, which is, again, the sum of all possible ways to get to a tier, this time adding productivity &amp;lt;math&amp;gt;p_i&amp;lt;/math&amp;gt;, and bringing along all those items which are already legendary &amp;lt;math&amp;gt;n_{5,k}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\begin{align}&lt;br /&gt;
n_{1,k+1} &amp;amp;= m_{1,k+1} \cdot ( 1 + p_1 ) \cdot (1 - q_1)\\&lt;br /&gt;
n_{2,k+1} &amp;amp;= m_{1,k+1} \cdot ( 1 + p_1 ) \cdot q_1 \cdot 0.9 &amp;amp;+&amp;amp;  m_{2,k+1} \cdot ( 1 + p_2 ) \cdot (1 - q_2)\\&lt;br /&gt;
n_{3,k+1} &amp;amp;= m_{1,k+1} \cdot ( 1 + p_1 ) \cdot q_1 \cdot 0.09 &amp;amp;+&amp;amp;  m_{2,k+1} \cdot ( 1 + p_2 ) \cdot q_2 \cdot 0.9 &amp;amp;+&amp;amp; m_{3,k+1} \cdot ( 1 + p_3 ) \cdot (1 - q_3) \\&lt;br /&gt;
n_{4,k+1} &amp;amp;= m_{1,k+1} \cdot ( 1 + p_1 ) \cdot q_1 \cdot 0.009 &amp;amp;+&amp;amp;  m_{2,k+1} \cdot ( 1 + p_2 ) \cdot q_2 \cdot 0.09 &amp;amp;+&amp;amp; m_{3,k+1} \cdot ( 1 + p_3 ) \cdot q_3 \cdot 0.9  &amp;amp;+&amp;amp; m_{4,k+1} \cdot ( 1 + p_4) \cdot (1 - q_4) \\&lt;br /&gt;
n_{5,k+1} &amp;amp;= m_{1,k+1} \cdot ( 1 + p_1 ) \cdot q_1 \cdot 0.001 &amp;amp;+&amp;amp;  m_{2,k+1} \cdot ( 1 + p_2 ) \cdot q_2 \cdot 0.01 &amp;amp;+&amp;amp; m_{3,k+1} \cdot ( 1 + p_3 ) \cdot q_3 \cdot 0.1  &amp;amp;+&amp;amp; m_{4,k+1} \cdot ( 1 + p_4) \cdot q_4 &amp;amp;+&amp;amp; m_{5,k+1} \cdot ( 1 + p_5) + n_{5,k}\\&lt;br /&gt;
\end{align}&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This can once more be written as a vector-matrix-multiplication &amp;lt;math&amp;gt;\textbf{n}_{k+1} = \textbf{B} \,\textbf{m}_{k+1} + \textbf{C} \,\textbf{n}_{k}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\underbrace{\begin{bmatrix} n_{1,k+1}\\ n_{2,k+1}\\ n_{3,k+1}\\ n_{4,k+1}\\ n_{5,k+1}\\ \end{bmatrix}}_{\textbf{n}_{k+1}} = &lt;br /&gt;
\underbrace{\begin{bmatrix}&lt;br /&gt;
( 1 + p_1 ) \cdot (1 - q_1) &amp;amp; 0 &amp;amp; 0 &amp;amp; 0 &amp;amp; 0 \\&lt;br /&gt;
( 1 + p_1 ) \cdot q_1 \cdot 0.9 &amp;amp;  ( 1 + p_2 ) \cdot (1 - q_2) &amp;amp; 0 &amp;amp; 0 &amp;amp; 0 \\&lt;br /&gt;
( 1 + p_1 ) \cdot q_1 \cdot 0.09 &amp;amp; ( 1 + p_2 ) \cdot q_2 \cdot 0.9 &amp;amp; ( 1 + p_3 ) \cdot (1 - q_3) &amp;amp; 0 &amp;amp; 0 \\&lt;br /&gt;
( 1 + p_1 ) \cdot q_1 \cdot 0.009 &amp;amp; ( 1 + p_2 ) \cdot q_2 \cdot 0.09 &amp;amp; ( 1 + p_3 ) \cdot q_3 \cdot 0.9  &amp;amp; ( 1 + p_4) \cdot (1 - q_4) &amp;amp; 0 \\&lt;br /&gt;
( 1 + p_1 ) \cdot q_1 \cdot 0.001 &amp;amp; ( 1 + p_2 ) \cdot q_2 \cdot 0.01 &amp;amp; ( 1 + p_3 ) \cdot q_3 \cdot 0.1  &amp;amp; ( 1 + p_4) \cdot q_4 &amp;amp; ( 1 + p_5)\\&lt;br /&gt;
\end{bmatrix}}_{B}&lt;br /&gt;
\underbrace{\begin{bmatrix} m_{1,k+1}\\ m_{2,k+1}\\ m_{3,k+1}\\ m_{4,k+1}\\ m_{5,k+1}\\ \end{bmatrix}}_{\textbf{m}_{k+1}}&lt;br /&gt;
+&lt;br /&gt;
\begin{bmatrix}&lt;br /&gt;
0&amp;amp;0&amp;amp;0&amp;amp;0\\&lt;br /&gt;
0&amp;amp;0&amp;amp;0&amp;amp;0\\&lt;br /&gt;
0&amp;amp;0&amp;amp;0&amp;amp;0\\&lt;br /&gt;
0&amp;amp;0&amp;amp;0&amp;amp;0\\&lt;br /&gt;
0&amp;amp;0&amp;amp;0&amp;amp;1\\&lt;br /&gt;
\end{bmatrix}&lt;br /&gt;
\underbrace{\begin{bmatrix} n_{1,k}\\ n_{2,k}\\ n_{3,k}\\ n_{4,k}\\ n_{5,k}\\ \end{bmatrix}}_{\textbf{n}_k}&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Combined model ===&lt;br /&gt;
&lt;br /&gt;
As such we gain an equation for the amount of items for every tier after any amount of iterations&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\begin{align}&lt;br /&gt;
\textbf{n}_{k+1} &lt;br /&gt;
    &amp;amp;= \textbf{B} \, \textbf{m}_{k+1} + \textbf{C} \, \textbf{n}_{k}\\&lt;br /&gt;
    &amp;amp;= \textbf{B} \, \textbf{A} \,\textbf{n}_{k} + \textbf{C} \, \textbf{n}_{k}\\&lt;br /&gt;
    &amp;amp;= (\textbf{B} \, \textbf{A} +\textbf{C} ) \, \textbf{n}_{k}\\&lt;br /&gt;
    &amp;amp;= \textbf{M} \, \textbf{n}_{k}\\&lt;br /&gt;
\textbf{n}_{k+2} &amp;amp;= \textbf{Q} \, \textbf{n}_{k+1} = \textbf{Q} \,  \textbf{Q} \, \textbf{n}_{k} = \textbf{Q}^2 \, \textbf{n}_{k}\\&lt;br /&gt;
&amp;amp;\vdots\\&lt;br /&gt;
\textbf{n}_k &amp;amp;= \textbf{Q}^k \, \textbf{n}_0\\&lt;br /&gt;
\end{align}&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
A realistic starting point for &amp;lt;math&amp;gt;\textbf{n}_0&amp;lt;/math&amp;gt; is only items in tier 1, and if we do not care for any other tiers, we simply choose sufficiently large &amp;lt;math&amp;gt;k = 100&amp;lt;/math&amp;gt;, and, through numeric means, try to maximize a single value. &amp;lt;math&amp;gt;q_{100,\text{crit}}&amp;lt;/math&amp;gt;, which falls in the fifth row, first column, of the Matrix &amp;lt;math&amp;gt;\textbf{Q}&amp;lt;/math&amp;gt; raised to the 100th power.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\begin{align}&lt;br /&gt;
\textbf{n}_k &amp;amp;= Q^k \, \textbf{n}_0\\&lt;br /&gt;
\begin{bmatrix}*\\ *\\ *\\ *\\ n_{5,100} \end{bmatrix} &amp;amp;= &lt;br /&gt;
\begin{bmatrix}&lt;br /&gt;
 * &amp;amp; * &amp;amp; * &amp;amp; * \\&lt;br /&gt;
 * &amp;amp; * &amp;amp; * &amp;amp; * \\&lt;br /&gt;
 * &amp;amp; * &amp;amp; * &amp;amp; * \\&lt;br /&gt;
 * &amp;amp; * &amp;amp; * &amp;amp; * \\&lt;br /&gt;
q_{100,\text{crit}} &amp;amp; * &amp;amp; * &amp;amp; * \\&lt;br /&gt;
\end{bmatrix} \begin{bmatrix}n_{1,0}\\ *\\ *\\ *\\ * \end{bmatrix}\\&lt;br /&gt;
\end{align}&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The choice of optimization method (simplex, branch and bound, etc.) itself is irrelevant, although most software will want the problem to be stated in a way so it can find a minimum, and may require the proper guard rails as to not pick values below 0 or higher than the maximum number of allowed modules.&lt;br /&gt;
&lt;br /&gt;
== Best ratios ==&lt;br /&gt;
This table shows the best ratio for quality to productivity modules in the crafting machines, while the recyclers always take only quality modules. The values are not given in whole numbers because often it is not just a single crafting machine per tier that will be used, then the ratios can change between different crafting machines in the same tier. &lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Crafting machine || Modules in Tier 1 || Modules in Tier 2 || Modules in Tier 3 || Modules in Tier 4 || Modules in Tier 5 || Percentage yield of legendary items&lt;br /&gt;
|-&lt;br /&gt;
| [[Chemical plant]] || 1.67 quality / 1.33 productivity || 1.67 quality / 1.33 productivity || 1.67 quality / 1.333 productivity || 1.8 quality / 1.2 productivity  || 0 quality / 3 productivity || 0.344%&lt;br /&gt;
|-&lt;br /&gt;
| [[Assembling machine 3]] || 1.67 quality / 2.33 productivity || 1.67 quality / 2.33 productivity || 1.67 quality / 2.33 productivity || 1.8 quality / 2.2 productivity  || 0 quality / 4 productivity || 0.586%&lt;br /&gt;
|-&lt;br /&gt;
| [[Foundry]] || 1.4 quality / 2.6 productivity || 1.4 quality / 2.6 productivity || 1.4 quality / 2.6 productivity || 1.5 quality / 2.5 productivity  || 0 quality / 4 productivity || 1.624%&lt;br /&gt;
|-&lt;br /&gt;
| [[Electromagnetic plant]] || 1 quality / 4 productivity || 1 quality / 4 productivity || 1 quality / 4 productivity || 1 quality / 4 productivity  || 0 quality / 5 productivity || 2.722%&lt;br /&gt;
|-&lt;br /&gt;
| [[Cryogenic plant]] || 0 quality / 8 productivity || 0 quality / 8 productivity || 0 quality / 8 productivity || 0 quality / 8 productivity  || 0 quality / 8 productivity || 4.835%&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Number of crafting machines ===&lt;br /&gt;
If we assume a constant input stream of tier 1 items which will always fill back up, we can additionally figure out what ratio of items will be inside the system at once, and with that we can figure out how many crafting machines we need per tier. This is done by setting &amp;lt;math&amp;gt;m_{1,k+1} = 100 \, \% - m_{2,k+1} - m_{3,k+1} - m_{4,k+1}&amp;lt;/math&amp;gt; after each iteration.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tabber&amp;gt;&lt;br /&gt;
per recycler=&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Crafting machine || Recyclers || Machines producing Tier 1 items || Machines producing Tier 2 items || Machines producing Tier 3 items || Machines producing Tier 4 items || Machines producing Tier 5 items&lt;br /&gt;
|-&lt;br /&gt;
| [[Chemical plant]] || 1 || 3.4427 || 0.0290 || 1.0086 || 0.0077 || 0.2979&lt;br /&gt;
|-&lt;br /&gt;
| [[Assembling machine 3]] || 1 || 3.3027 || 0.0365 || 1.0657 || 0.0108 || 0.3286&lt;br /&gt;
|-&lt;br /&gt;
| [[Foundry]] || 1 || 2.9551 || 0.0563 || 1.1528 || 0.0208 || 0.3653&lt;br /&gt;
|-&lt;br /&gt;
| [[Electromagnetic plant]] || 1 || 2.7239 || 0.0709 || 1.1726 || 0.0301 || 0.3474&lt;br /&gt;
|-&lt;br /&gt;
| [[Cryogenic plant]] || 1 || 2.3798 || 0.0972 || 1.1517 || 0.0470 || 0.2700&lt;br /&gt;
&lt;br /&gt;
|}&lt;br /&gt;
\-\&lt;br /&gt;
per tier 5 crafter (exact) =&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Crafting machine || Recyclers || Machines producing Tier 1 items || Machines producing Tier 2 items || Machines producing Tier 3 items || Machines producing Tier 4 items || Machines producing Tier 5 items&lt;br /&gt;
|-&lt;br /&gt;
| [[Chemical plant]] || 108.8978 || 374.9134 || 43.5367 || 12.7555 || 3.3856 || 1&lt;br /&gt;
|-&lt;br /&gt;
| [[Assembling machine 3]] || 70.4576 || 232.7032 || 33.9340 || 10.9500 || 3.2432 || 1&lt;br /&gt;
|-&lt;br /&gt;
| [[Foundry]] || 33.0224 || 97.5872 || 21.8308 || 8.5164 || 3.1550 || 1&lt;br /&gt;
|-&lt;br /&gt;
| [[Electromagnetic plant]] || 24.1178 || 65.6959 || 18.4556 || 7.9448 || 3.3747 || 1&lt;br /&gt;
|-&lt;br /&gt;
| [[Cryogenic plant]] || 19.9316 || 47.4350 || 18.2124 || 8.8138 || 4.2654 || 1&lt;br /&gt;
|}&lt;br /&gt;
\-\&lt;br /&gt;
per tier 5 crafter (conservative)=&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Crafting machine || Recyclers || Machines producing Tier 1 items || Machines producing Tier 2 items || Machines producing Tier 3 items || Machines producing Tier 4 items || Machines producing Tier 5 items&lt;br /&gt;
|-&lt;br /&gt;
| [[Chemical plant]] || 92 || 318 || 37 || 11 || 3 || 1&lt;br /&gt;
|-&lt;br /&gt;
| [[Assembling machine 3]] || 62 || 205 || 30 || 10 || 3 || 1&lt;br /&gt;
|-&lt;br /&gt;
| [[Foundry]] || 30 || 89 || 20 || 8 || 3 || 1&lt;br /&gt;
|-&lt;br /&gt;
| [[Electromagnetic plant]] || 20 || 56 || 16 || 7 || 3 || 1&lt;br /&gt;
|-&lt;br /&gt;
| [[Cryogenic plant]] || 17 || 41 || 16 || 8 || 4 || 1&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;/tabber&amp;gt;&lt;/div&gt;</summary>
		<author><name>Untitled7</name></author>
	</entry>
	<entry>
		<id>https://wiki.factorio.com/index.php?title=Tutorial:Quality_upcycling_math&amp;diff=206996</id>
		<title>Tutorial:Quality upcycling math</title>
		<link rel="alternate" type="text/html" href="https://wiki.factorio.com/index.php?title=Tutorial:Quality_upcycling_math&amp;diff=206996"/>
		<updated>2024-11-23T19:11:35Z</updated>

		<summary type="html">&lt;p&gt;Untitled7: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;How do we get the most amount of [[Quality|legendary]] items out of an upcycling plant?&lt;br /&gt;
&lt;br /&gt;
The answer is not quite as straight forward as we&#039;d like it to be, because it depends on a number of factors, luckily there is a finite number of possibilities of what the modules can be, and for the sake of simplicity this tutorial will ignore the productivity gain from [[Technologies#Space_Age|infinite technologies]].&lt;br /&gt;
&lt;br /&gt;
== The crafting machines ==&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Crafting machine || Module slots &amp;lt;math&amp;gt;N&amp;lt;/math&amp;gt; || Base productivity bonus &amp;lt;math&amp;gt;p_0&amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| [[Chemical plant]] || 3 || +0%&lt;br /&gt;
|-&lt;br /&gt;
| [[Assembling machine 3]] || 4 || +0%&lt;br /&gt;
|-&lt;br /&gt;
| [[Foundry]] || 4 || +50%&lt;br /&gt;
|-&lt;br /&gt;
| [[Electromagnetic plant]] || 5 || +50%&lt;br /&gt;
|-&lt;br /&gt;
| [[Cryogenic plant]] || 8 || +0%&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Quality probability ==&lt;br /&gt;
When an item gets produced and the initial roll decides that the quality of the item will increase, there is a 90% chance it will rise one tier, a 9% chance it will rise two, a 0.9% chance it will rise three, and a 0.1% chance it will rise four. This is of course capped if the item already started out at a higher tier.&lt;br /&gt;
&lt;br /&gt;
== Mathematical model ==&lt;br /&gt;
The mathematical model is time discrete. As opposed to dealing with derivatives in respect to time, the next state is a direct function of the previous state.&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;math&amp;gt;m_{i,k}&amp;lt;/math&amp;gt; ... Number of materials of tier &amp;lt;math&amp;gt;i&amp;lt;/math&amp;gt; after the &amp;lt;math&amp;gt;k&amp;lt;/math&amp;gt;-th iteration before being crafted. (this doesn&#039;t mean that an item only needs one type of ingredient, but that &amp;quot;1 materials&amp;quot; can be crafted into 1 item from them)&lt;br /&gt;
* &amp;lt;math&amp;gt;n_{i,k}&amp;lt;/math&amp;gt; ... Number of items of tier &amp;lt;math&amp;gt;i&amp;lt;/math&amp;gt; after the &amp;lt;math&amp;gt;k&amp;lt;/math&amp;gt;-th iteration, after being crafted together.&lt;br /&gt;
* &amp;lt;math&amp;gt;p_0&amp;lt;/math&amp;gt; ... the crafting machines inherent productivity bonus&lt;br /&gt;
* &amp;lt;math&amp;gt;N&amp;lt;/math&amp;gt; ... number of modules the crafting machine can hold&lt;br /&gt;
* &amp;lt;math&amp;gt;q_r = 4 \cdot 6.2 \, % = 0.248&amp;lt;/math&amp;gt; ... quality probability of the recyclers with 4 [[quality module 3]]&#039;s&lt;br /&gt;
* &amp;lt;math&amp;gt;p_i = p_0 + x_i \cdot 25 \, %&amp;lt;/math&amp;gt; ... productivity due to &amp;lt;math&amp;gt;x_i&amp;lt;/math&amp;gt; legendary [[productivity module 3]]&#039;s in the crafting machine which takes &amp;lt;math&amp;gt;i&amp;lt;/math&amp;gt;-tier materials&lt;br /&gt;
* &amp;lt;math&amp;gt;q_i = (N-x_i) \cdot 6.2 \, %&amp;lt;/math&amp;gt; ... quality probability due to &amp;lt;math&amp;gt;(N - x_i)&amp;lt;/math&amp;gt; legendary quality module 3&#039;s in the crafting machine which takes &amp;lt;math&amp;gt;i&amp;lt;/math&amp;gt;-tier materials&lt;br /&gt;
&lt;br /&gt;
=== Recycled materials ===&lt;br /&gt;
When a quarter of all items being recycled and the quality probability rules we can write the equations for the amount of materials received after recycling. This calculation is rather simple, as we the lowest tier can only come forth from it&#039;s own tier failing to raise in quality. The second tier are 90% of tier 1 items that did increase, and all those tier 2 items that didn&#039;t. This continues for all tiers as follows, but legendary items &amp;lt;math&amp;gt;n_{5,k}&amp;lt;/math&amp;gt; will not be recycled&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\begin{align}&lt;br /&gt;
m_{1,k+1} &amp;amp;= \frac{n_{1,k}}{4} \cdot (1 - q_r)\\&lt;br /&gt;
m_{2,k+1} &amp;amp;= \frac{n_{1,k}}{4} \cdot q_r \cdot 0.9 &amp;amp;+&amp;amp; \frac{n_{2,k}}{4} \cdot (1 - q_r)\\&lt;br /&gt;
m_{3,k+1} &amp;amp;= \frac{n_{1,k}}{4} \cdot q_r \cdot 0.09 &amp;amp;+&amp;amp; \frac{n_{2,k}}{4} \cdot q_r \cdot 0.9 &amp;amp;+&amp;amp; \frac{n_{3,k}}{4} \cdot (1 - q_r)\\&lt;br /&gt;
m_{4,k+1} &amp;amp;= \frac{n_{1,k}}{4} \cdot q_r \cdot 0.009 &amp;amp;+&amp;amp; \frac{n_{2,k}}{4} \cdot q_r \cdot 0.09 &amp;amp;+&amp;amp; \frac{n_{3,k}}{4} \cdot q_r \cdot 0.9 &amp;amp;+&amp;amp; \frac{n_{4,k}}{4} \cdot (1 - q_r)\\&lt;br /&gt;
m_{5,k+1} &amp;amp;= \frac{n_{1,k}}{4} \cdot q_r \cdot 0.001 &amp;amp;+&amp;amp; \frac{n_{2,k}}{4} \cdot q_r \cdot 0.01 &amp;amp;+&amp;amp; \frac{n_{3,k}}{4} \cdot q_r \cdot 0.1 &amp;amp;+&amp;amp; \frac{n_{4,k}}{4} \cdot q_r\\&lt;br /&gt;
\end{align}&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
which can also be written as a vector-matrix-multiplication &amp;lt;math&amp;gt;\textbf{m}_{k+1} = \textbf{A} \,\textbf{n}_k&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\underbrace{\begin{bmatrix} m_{1,k+1}\\ m_{2,k+1}\\ m_{3,k+1}\\ m_{4,k+1}\\ m_{5,k+1}\\ \end{bmatrix}}_{\textbf{m}_{k+1}}&lt;br /&gt;
=&lt;br /&gt;
\underbrace{\begin{bmatrix}&lt;br /&gt;
\frac{1 - q_r}{4} &amp;amp; 0 &amp;amp; 0 &amp;amp; 0 &amp;amp; 0\\&lt;br /&gt;
\frac{0.9 \, q_r}{4}   &amp;amp; \frac{1 - q_r}{4} &amp;amp; 0 &amp;amp; 0 &amp;amp; 0\\&lt;br /&gt;
\frac{0.09 \, q_r}{4}  &amp;amp; \frac{0.9 \, q_r}{4}  &amp;amp; \frac{1 - q_r}{4} &amp;amp; 0 &amp;amp; 0 \\&lt;br /&gt;
\frac{0.009 \, q_r}{4} &amp;amp; \frac{0.09 \, q_r}{4} &amp;amp; \frac{0.9 \, q_r}{4} &amp;amp; \frac{1 - q_r}{4} &amp;amp; 0\\&lt;br /&gt;
\frac{0.001 \, q_r}{4} &amp;amp; \frac{0.01 \, q_r}{4} &amp;amp; \frac{0.1 \, q_r}{4} &amp;amp; \frac{q_r}{4} &amp;amp; 0\\&lt;br /&gt;
\end{bmatrix}}_{\textbf{A}}&lt;br /&gt;
\underbrace{\begin{bmatrix} n_{1,k}\\ n_{2,k}\\ n_{3,k}\\ n_{4,k}\\ n_{5,k}\\ \end{bmatrix}}_{\textbf{n}_k}&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As we assume there is nothing to be done about recyclers to make them more effective but fill them with all quality modules, the value of &amp;lt;math&amp;gt;q_r = 0.248&amp;lt;/math&amp;gt; is a constant, and therefore the matrix &amp;lt;math&amp;gt;\textbf{A}&amp;lt;/math&amp;gt; is also a constant.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \textbf{A} = &lt;br /&gt;
\begin{bmatrix}&lt;br /&gt;
0.188 &amp;amp; 0 &amp;amp; 0 &amp;amp; 0 &amp;amp; 0 \\&lt;br /&gt;
0.055\,8 &amp;amp; 0.188 &amp;amp; 0 &amp;amp; 0 &amp;amp; 0 \\&lt;br /&gt;
0.005\,58 &amp;amp; 0.055\,8 &amp;amp; 0.188 &amp;amp; 0 &amp;amp; 0 \\&lt;br /&gt;
0.000\,558 &amp;amp; 0.005\,58 &amp;amp; 0.055\,8 &amp;amp; 0.188 &amp;amp; 0 \\&lt;br /&gt;
0.000\,062 &amp;amp; 0.000\,62 &amp;amp; 0.006\,2 &amp;amp; 0.062 &amp;amp; 0 \\&lt;br /&gt;
\end{bmatrix}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Recrafted items ===&lt;br /&gt;
Once more we first check how many items are produced, which is, again, the sum of all possible ways to get to a tier, this time adding productivity &amp;lt;math&amp;gt;p_i&amp;lt;/math&amp;gt;, and bringing along all those items which are already legendary &amp;lt;math&amp;gt;n_{5,k}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\begin{align}&lt;br /&gt;
n_{1,k+1} &amp;amp;= m_{1,k+1} \cdot ( 1 + p_1 ) \cdot (1 - q_1)\\&lt;br /&gt;
n_{2,k+1} &amp;amp;= m_{1,k+1} \cdot ( 1 + p_1 ) \cdot q_1 \cdot 0.9 &amp;amp;+&amp;amp;  m_{2,k+1} \cdot ( 1 + p_2 ) \cdot (1 - q_2)\\&lt;br /&gt;
n_{3,k+1} &amp;amp;= m_{1,k+1} \cdot ( 1 + p_1 ) \cdot q_1 \cdot 0.09 &amp;amp;+&amp;amp;  m_{2,k+1} \cdot ( 1 + p_2 ) \cdot q_2 \cdot 0.9 &amp;amp;+&amp;amp; m_{3,k+1} \cdot ( 1 + p_3 ) \cdot (1 - q_3) \\&lt;br /&gt;
n_{4,k+1} &amp;amp;= m_{1,k+1} \cdot ( 1 + p_1 ) \cdot q_1 \cdot 0.009 &amp;amp;+&amp;amp;  m_{2,k+1} \cdot ( 1 + p_2 ) \cdot q_2 \cdot 0.09 &amp;amp;+&amp;amp; m_{3,k+1} \cdot ( 1 + p_3 ) \cdot q_3 \cdot 0.9  &amp;amp;+&amp;amp; m_{4,k+1} \cdot ( 1 + p_4) \cdot (1 - q_4) \\&lt;br /&gt;
n_{5,k+1} &amp;amp;= m_{1,k+1} \cdot ( 1 + p_1 ) \cdot q_1 \cdot 0.001 &amp;amp;+&amp;amp;  m_{2,k+1} \cdot ( 1 + p_2 ) \cdot q_2 \cdot 0.01 &amp;amp;+&amp;amp; m_{3,k+1} \cdot ( 1 + p_3 ) \cdot q_3 \cdot 0.1  &amp;amp;+&amp;amp; m_{4,k+1} \cdot ( 1 + p_4) \cdot q_4 &amp;amp;+&amp;amp; m_{5,k+1} \cdot ( 1 + p_5) + n_{5,k}\\&lt;br /&gt;
\end{align}&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This can once more be written as a vector-matrix-multiplication &amp;lt;math&amp;gt;\textbf{n}_{k+1} = \textbf{B} \,\textbf{m}_{k+1} + \textbf{C} \,\textbf{n}_{k}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\underbrace{\begin{bmatrix} n_{1,k+1}\\ n_{2,k+1}\\ n_{3,k+1}\\ n_{4,k+1}\\ n_{5,k+1}\\ \end{bmatrix}}_{\textbf{n}_{k+1}} = &lt;br /&gt;
\underbrace{\begin{bmatrix}&lt;br /&gt;
( 1 + p_1 ) \cdot (1 - q_1) &amp;amp; 0 &amp;amp; 0 &amp;amp; 0 &amp;amp; 0 \\&lt;br /&gt;
( 1 + p_1 ) \cdot q_1 \cdot 0.9 &amp;amp;  ( 1 + p_2 ) \cdot (1 - q_2) &amp;amp; 0 &amp;amp; 0 &amp;amp; 0 \\&lt;br /&gt;
( 1 + p_1 ) \cdot q_1 \cdot 0.09 &amp;amp; ( 1 + p_2 ) \cdot q_2 \cdot 0.9 &amp;amp; ( 1 + p_3 ) \cdot (1 - q_3) &amp;amp; 0 &amp;amp; 0 \\&lt;br /&gt;
( 1 + p_1 ) \cdot q_1 \cdot 0.009 &amp;amp; ( 1 + p_2 ) \cdot q_2 \cdot 0.09 &amp;amp; ( 1 + p_3 ) \cdot q_3 \cdot 0.9  &amp;amp; ( 1 + p_4) \cdot (1 - q_4) &amp;amp; 0 \\&lt;br /&gt;
( 1 + p_1 ) \cdot q_1 \cdot 0.001 &amp;amp; ( 1 + p_2 ) \cdot q_2 \cdot 0.01 &amp;amp; ( 1 + p_3 ) \cdot q_3 \cdot 0.1  &amp;amp; ( 1 + p_4) \cdot q_4 &amp;amp; ( 1 + p_5)\\&lt;br /&gt;
\end{bmatrix}}_{B}&lt;br /&gt;
\underbrace{\begin{bmatrix} m_{1,k+1}\\ m_{2,k+1}\\ m_{3,k+1}\\ m_{4,k+1}\\ m_{5,k+1}\\ \end{bmatrix}}_{\textbf{m}_{k+1}}&lt;br /&gt;
+&lt;br /&gt;
\begin{bmatrix}&lt;br /&gt;
0&amp;amp;0&amp;amp;0&amp;amp;0\\&lt;br /&gt;
0&amp;amp;0&amp;amp;0&amp;amp;0\\&lt;br /&gt;
0&amp;amp;0&amp;amp;0&amp;amp;0\\&lt;br /&gt;
0&amp;amp;0&amp;amp;0&amp;amp;0\\&lt;br /&gt;
0&amp;amp;0&amp;amp;0&amp;amp;1\\&lt;br /&gt;
\end{bmatrix}&lt;br /&gt;
\underbrace{\begin{bmatrix} n_{1,k}\\ n_{2,k}\\ n_{3,k}\\ n_{4,k}\\ n_{5,k}\\ \end{bmatrix}}_{\textbf{n}_k}&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Combined model ===&lt;br /&gt;
&lt;br /&gt;
As such we gain an equation for the amount of items for every tier after any amount of iterations&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\begin{align}&lt;br /&gt;
\textbf{n}_{k+1} &lt;br /&gt;
    &amp;amp;= \textbf{B} \, \textbf{m}_{k+1} + \textbf{C} \, \textbf{n}_{k}\\&lt;br /&gt;
    &amp;amp;= \textbf{B} \, \textbf{A} \,\textbf{n}_{k} + \textbf{C} \, \textbf{n}_{k}\\&lt;br /&gt;
    &amp;amp;= (\textbf{B} \, \textbf{A} +\textbf{C} ) \, \textbf{n}_{k}\\&lt;br /&gt;
    &amp;amp;= \textbf{M} \, \textbf{n}_{k}\\&lt;br /&gt;
\textbf{n}_{k+2} &amp;amp;= \textbf{Q} \, \textbf{n}_{k+1} = \textbf{Q} \,  \textbf{Q} \, \textbf{n}_{k} = \textbf{Q}^2 \, \textbf{n}_{k}\\&lt;br /&gt;
&amp;amp;\vdots\\&lt;br /&gt;
\textbf{n}_k &amp;amp;= \textbf{Q}^k \, \textbf{n}_0\\&lt;br /&gt;
\end{align}&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
A realistic starting point for &amp;lt;math&amp;gt;\textbf{n}_0&amp;lt;/math&amp;gt; is only items in tier 1, and if we do not care for any other tiers, we simply choose sufficiently large &amp;lt;math&amp;gt;k = 100&amp;lt;/math&amp;gt;, and, through numeric means, try to maximize a single value. &amp;lt;math&amp;gt;q_{100,\text{crit}}&amp;lt;/math&amp;gt;, which falls in the fifth row, first column, of the Matrix &amp;lt;math&amp;gt;\textbf{Q}&amp;lt;/math&amp;gt; raised to the 100th power.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\begin{align}&lt;br /&gt;
\textbf{n}_k &amp;amp;= Q^k \, \textbf{n}_0\\&lt;br /&gt;
\begin{bmatrix}*\\ *\\ *\\ *\\ n_{5,100} \end{bmatrix} &amp;amp;= &lt;br /&gt;
\begin{bmatrix}&lt;br /&gt;
 * &amp;amp; * &amp;amp; * &amp;amp; * \\&lt;br /&gt;
 * &amp;amp; * &amp;amp; * &amp;amp; * \\&lt;br /&gt;
 * &amp;amp; * &amp;amp; * &amp;amp; * \\&lt;br /&gt;
 * &amp;amp; * &amp;amp; * &amp;amp; * \\&lt;br /&gt;
q_{100,\text{crit}} &amp;amp; * &amp;amp; * &amp;amp; * \\&lt;br /&gt;
\end{bmatrix} \begin{bmatrix}n_{1,0}\\ *\\ *\\ *\\ * \end{bmatrix}\\&lt;br /&gt;
\end{align}&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The choice of optimization method (simplex, branch and bound, etc.) itself is irrelevant, although most software will want the problem to be stated in a way so it can find a minimum, and may require the proper guard rails as to not pick values below 0 or higher than the maximum number of allowed modules.&lt;br /&gt;
&lt;br /&gt;
== Best ratios ==&lt;br /&gt;
This table shows the best ratio for quality to productivity modules in the crafting machines, while the recyclers always take only quality modules. The values are not given in whole numbers because often it is not just a single crafting machine per tier that will be used, then the ratios can change between different crafting machines in the same tier. &lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Crafting machine || Modules in Tier 1 || Modules in Tier 2 || Modules in Tier 3 || Modules in Tier 4 || Modules in Tier 5 || Percentage yield of legendary items&lt;br /&gt;
|-&lt;br /&gt;
| [[Chemical plant]] || 1.67 quality / 1.33 productivity || 1.67 quality / 1.33 productivity || 1.67 quality / 1.333 productivity || 1.8 quality / 1.2 productivity  || 0 quality / 3 productivity || 0.344%&lt;br /&gt;
|-&lt;br /&gt;
| [[Assembling machine 3]] || 1.67 quality / 2.33 productivity || 1.67 quality / 2.33 productivity || 1.67 quality / 2.33 productivity || 1.8 quality / 2.2 productivity  || 0 quality / 4 productivity || 0.586%&lt;br /&gt;
|-&lt;br /&gt;
| [[Foundry]] || 1.4 quality / 2.6 productivity || 1.4 quality / 2.6 productivity || 1.4 quality / 2.6 productivity || 1.5 quality / 2.5 productivity  || 0 quality / 4 productivity || 1.624%&lt;br /&gt;
|-&lt;br /&gt;
| [[Electromagnetic plant]] || 1 quality / 4 productivity || 1 quality / 4 productivity || 1 quality / 4 productivity || 1 quality / 4 productivity  || 0 quality / 5 productivity || 2.722%&lt;br /&gt;
|-&lt;br /&gt;
| [[Cryogenic plant]] || 0 quality / 8 productivity || 0 quality / 8 productivity || 0 quality / 8 productivity || 0 quality / 8 productivity  || 0 quality / 8 productivity || 4.835%&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Number of crafting machines ===&lt;br /&gt;
If we assume a constant input stream of tier 1 items which will always fill back up, we can additionally figure out what ratio of items will be inside the system at once, and with that we can figure out how many crafting machines we need per tier. This is done by setting &amp;lt;math&amp;gt;m_{1,k+1} = 100% - m_{2,k+1} - m_{3,k+1} - m_{4,k+1}&amp;lt;/math&amp;gt; after each iteration.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tabber&amp;gt;&lt;br /&gt;
per recycler=&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Crafting machine || Recyclers || Machines producing Tier 1 items || Machines producing Tier 2 items || Machines producing Tier 3 items || Machines producing Tier 4 items || Machines producing Tier 5 items&lt;br /&gt;
|-&lt;br /&gt;
| [[Chemical plant]] || 1 || 3.4427 || 0.0290 || 1.0086 || 0.0077 || 0.2979&lt;br /&gt;
|-&lt;br /&gt;
| [[Assembling machine 3]] || 1 || 3.3027 || 0.0365 || 1.0657 || 0.0108 || 0.3286&lt;br /&gt;
|-&lt;br /&gt;
| [[Foundry]] || 1 || 2.9551 || 0.0563 || 1.1528 || 0.0208 || 0.3653&lt;br /&gt;
|-&lt;br /&gt;
| [[Electromagnetic plant]] || 1 || 2.7239 || 0.0709 || 1.1726 || 0.0301 || 0.3474&lt;br /&gt;
|-&lt;br /&gt;
| [[Cryogenic plant]] || 1 || 2.3798 || 0.0972 || 1.1517 || 0.0470 || 0.2700&lt;br /&gt;
&lt;br /&gt;
|}&lt;br /&gt;
\-\&lt;br /&gt;
per tier 5 crafter (exact) =&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Crafting machine || Recyclers || Machines producing Tier 1 items || Machines producing Tier 2 items || Machines producing Tier 3 items || Machines producing Tier 4 items || Machines producing Tier 5 items&lt;br /&gt;
|-&lt;br /&gt;
| [[Chemical plant]] || 108.8978 || 374.9134 || 43.5367 || 12.7555 || 3.3856 || 1&lt;br /&gt;
|-&lt;br /&gt;
| [[Assembling machine 3]] || 70.4576 || 232.7032 || 33.9340 || 10.9500 || 3.2432 || 1&lt;br /&gt;
|-&lt;br /&gt;
| [[Foundry]] || 33.0224 || 97.5872 || 21.8308 || 8.5164 || 3.1550 || 1&lt;br /&gt;
|-&lt;br /&gt;
| [[Electromagnetic plant]] || 24.1178 || 65.6959 || 18.4556 || 7.9448 || 3.3747 || 1&lt;br /&gt;
|-&lt;br /&gt;
| [[Cryogenic plant]] || 19.9316 || 47.4350 || 18.2124 || 8.8138 || 4.2654 || 1&lt;br /&gt;
|}&lt;br /&gt;
\-\&lt;br /&gt;
per tier 5 crafter (conservative)=&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Crafting machine || Recyclers || Machines producing Tier 1 items || Machines producing Tier 2 items || Machines producing Tier 3 items || Machines producing Tier 4 items || Machines producing Tier 5 items&lt;br /&gt;
|-&lt;br /&gt;
| [[Chemical plant]] || 92 || 318 || 37 || 11 || 3 || 1&lt;br /&gt;
|-&lt;br /&gt;
| [[Assembling machine 3]] || 62 || 205 || 30 || 10 || 3 || 1&lt;br /&gt;
|-&lt;br /&gt;
| [[Foundry]] || 30 || 89 || 20 || 8 || 3 || 1&lt;br /&gt;
|-&lt;br /&gt;
| [[Electromagnetic plant]] || 20 || 56 || 16 || 7 || 3 || 1&lt;br /&gt;
|-&lt;br /&gt;
| [[Cryogenic plant]] || 17 || 41 || 16 || 8 || 4 || 1&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;/tabber&amp;gt;&lt;/div&gt;</summary>
		<author><name>Untitled7</name></author>
	</entry>
	<entry>
		<id>https://wiki.factorio.com/index.php?title=Tutorial:Quality_upcycling_math&amp;diff=206995</id>
		<title>Tutorial:Quality upcycling math</title>
		<link rel="alternate" type="text/html" href="https://wiki.factorio.com/index.php?title=Tutorial:Quality_upcycling_math&amp;diff=206995"/>
		<updated>2024-11-23T18:09:16Z</updated>

		<summary type="html">&lt;p&gt;Untitled7: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;How do we get the most amount of [[Quality|legendary]] items out of an upcycling plant?&lt;br /&gt;
&lt;br /&gt;
The answer is not quite as straight forward as we&#039;d like it to be, because it depends on a number of factors, luckily there is a finite number of possibilities of what the modules can be, and for the sake of simplicity this tutorial will ignore the productivity gain from [[Technologies#Space_Age|infinite technologies]].&lt;br /&gt;
&lt;br /&gt;
== The crafting machines ==&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Crafting machine || Module slots &amp;lt;math&amp;gt;N&amp;lt;/math&amp;gt; || Base productivity bonus &amp;lt;math&amp;gt;p_0&amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| [[Chemical plant]] || 3 || +0%&lt;br /&gt;
|-&lt;br /&gt;
| [[Assembling machine 3]] || 4 || +0%&lt;br /&gt;
|-&lt;br /&gt;
| [[Foundry]] || 4 || +50%&lt;br /&gt;
|-&lt;br /&gt;
| [[Electromagnetic plant]] || 5 || +50%&lt;br /&gt;
|-&lt;br /&gt;
| [[Cryogenic plant]] || 8 || +0%&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Quality probability ==&lt;br /&gt;
When an item gets produced and the initial roll decides that the quality of the item will increase, there is a 90% chance it will rise one tier, a 9% chance it will rise two, a 0.9% chance it will rise three, and a 0.1% chance it will rise four. This is of course capped if the item already started out at a higher tier.&lt;br /&gt;
&lt;br /&gt;
== Mathematical model ==&lt;br /&gt;
The mathematical model is time discrete. As opposed to dealing with derivatives in respect to time, the next state is a direct function of the previous state.&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;math&amp;gt;m_{i,k}&amp;lt;/math&amp;gt; ... Number of materials of tier &amp;lt;math&amp;gt;i&amp;lt;/math&amp;gt; after the &amp;lt;math&amp;gt;k&amp;lt;/math&amp;gt;-th iteration before being crafted. (this doesn&#039;t mean that an item only needs one type of ingredient, but that &amp;quot;1 materials&amp;quot; can be crafted into 1 item from them)&lt;br /&gt;
* &amp;lt;math&amp;gt;n_{i,k}&amp;lt;/math&amp;gt; ... Number of items of tier &amp;lt;math&amp;gt;i&amp;lt;/math&amp;gt; after the &amp;lt;math&amp;gt;k&amp;lt;/math&amp;gt;-th iteration, after being crafted together.&lt;br /&gt;
* &amp;lt;math&amp;gt;p_0&amp;lt;/math&amp;gt; ... the crafting machines inherent productivity bonus&lt;br /&gt;
* &amp;lt;math&amp;gt;N&amp;lt;/math&amp;gt; ... number of modules the crafting machine can hold&lt;br /&gt;
* &amp;lt;math&amp;gt;q_r = 4 \cdot 6.2 \, % = 0.248&amp;lt;/math&amp;gt; ... quality probability of the recyclers with 4 [[quality module 3]]&#039;s&lt;br /&gt;
* &amp;lt;math&amp;gt;p_i = p_0 + x_i \cdot 25 \, %&amp;lt;/math&amp;gt; ... productivity due to &amp;lt;math&amp;gt;x_i&amp;lt;/math&amp;gt; legendary [[productivity module 3]]&#039;s in the crafting machine which takes &amp;lt;math&amp;gt;i&amp;lt;/math&amp;gt;-tier materials&lt;br /&gt;
* &amp;lt;math&amp;gt;q_i = (N-x_i) \cdot 6.2 \, %&amp;lt;/math&amp;gt; ... quality probability due to &amp;lt;math&amp;gt;(N - x_i)&amp;lt;/math&amp;gt; legendary quality module 3&#039;s in the crafting machine which takes &amp;lt;math&amp;gt;i&amp;lt;/math&amp;gt;-tier materials&lt;br /&gt;
&lt;br /&gt;
=== Recycled materials ===&lt;br /&gt;
When a quarter of all items being recycled and the quality probability rules we can write the equations for the amount of materials received after recycling. This calculation is rather simple, as we the lowest tier can only come forth from it&#039;s own tier failing to raise in quality. The second tier are 90% of tier 1 items that did increase, and all those tier 2 items that didn&#039;t. This continues for all tiers as follows, but legendary items &amp;lt;math&amp;gt;n_{5,k}&amp;lt;/math&amp;gt; will not be recycled&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\begin{align}&lt;br /&gt;
m_{1,k+1} &amp;amp;= \frac{n_{1,k}}{4} \cdot (1 - q_r)\\&lt;br /&gt;
m_{2,k+1} &amp;amp;= \frac{n_{1,k}}{4} \cdot q_r \cdot 0.9 &amp;amp;+&amp;amp; \frac{n_{2,k}}{4} \cdot (1 - q_r)\\&lt;br /&gt;
m_{3,k+1} &amp;amp;= \frac{n_{1,k}}{4} \cdot q_r \cdot 0.09 &amp;amp;+&amp;amp; \frac{n_{2,k}}{4} \cdot q_r \cdot 0.9 &amp;amp;+&amp;amp; \frac{n_{3,k}}{4} \cdot (1 - q_r)\\&lt;br /&gt;
m_{4,k+1} &amp;amp;= \frac{n_{1,k}}{4} \cdot q_r \cdot 0.009 &amp;amp;+&amp;amp; \frac{n_{2,k}}{4} \cdot q_r \cdot 0.09 &amp;amp;+&amp;amp; \frac{n_{3,k}}{4} \cdot q_r \cdot 0.9 &amp;amp;+&amp;amp; \frac{n_{4,k}}{4} \cdot (1 - q_r)\\&lt;br /&gt;
m_{5,k+1} &amp;amp;= \frac{n_{1,k}}{4} \cdot q_r \cdot 0.001 &amp;amp;+&amp;amp; \frac{n_{2,k}}{4} \cdot q_r \cdot 0.01 &amp;amp;+&amp;amp; \frac{n_{3,k}}{4} \cdot q_r \cdot 0.1 &amp;amp;+&amp;amp; \frac{n_{4,k}}{4} \cdot q_r\\&lt;br /&gt;
\end{align}&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
which can also be written as a vector-matrix-multiplication &amp;lt;math&amp;gt;\textbf{m}_{k+1} = \textbf{A} \,\textbf{n}_k&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\underbrace{\begin{bmatrix} m_{1,k+1}\\ m_{2,k+1}\\ m_{3,k+1}\\ m_{4,k+1}\\ m_{5,k+1}\\ \end{bmatrix}}_{\textbf{m}_{k+1}}&lt;br /&gt;
=&lt;br /&gt;
\underbrace{\begin{bmatrix}&lt;br /&gt;
\frac{1 - q_r}{4} &amp;amp; 0 &amp;amp; 0 &amp;amp; 0 &amp;amp; 0\\&lt;br /&gt;
\frac{0.9 \, q_r}{4}   &amp;amp; \frac{1 - q_r}{4} &amp;amp; 0 &amp;amp; 0 &amp;amp; 0\\&lt;br /&gt;
\frac{0.09 \, q_r}{4}  &amp;amp; \frac{0.9 \, q_r}{4}  &amp;amp; \frac{1 - q_r}{4} &amp;amp; 0 &amp;amp; 0 \\&lt;br /&gt;
\frac{0.009 \, q_r}{4} &amp;amp; \frac{0.09 \, q_r}{4} &amp;amp; \frac{0.9 \, q_r}{4} &amp;amp; \frac{1 - q_r}{4} &amp;amp; 0\\&lt;br /&gt;
\frac{0.001 \, q_r}{4} &amp;amp; \frac{0.01 \, q_r}{4} &amp;amp; \frac{0.1 \, q_r}{4} &amp;amp; \frac{q_r}{4} &amp;amp; 0\\&lt;br /&gt;
\end{bmatrix}}_{\textbf{A}}&lt;br /&gt;
\underbrace{\begin{bmatrix} n_{1,k}\\ n_{2,k}\\ n_{3,k}\\ n_{4,k}\\ n_{5,k}\\ \end{bmatrix}}_{\textbf{n}_k}&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As we assume there is nothing to be done about recyclers to make them more effective but fill them with all quality modules, the value of &amp;lt;math&amp;gt;q_r = 0.248&amp;lt;/math&amp;gt; is a constant, and therefore the matrix &amp;lt;math&amp;gt;\textbf{A}&amp;lt;/math&amp;gt; is also a constant.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \textbf{A} = &lt;br /&gt;
\begin{bmatrix}&lt;br /&gt;
0.188 &amp;amp; 0 &amp;amp; 0 &amp;amp; 0 &amp;amp; 0 \\&lt;br /&gt;
0.055\,8 &amp;amp; 0.188 &amp;amp; 0 &amp;amp; 0 &amp;amp; 0 \\&lt;br /&gt;
0.005\,58 &amp;amp; 0.055\,8 &amp;amp; 0.188 &amp;amp; 0 &amp;amp; 0 \\&lt;br /&gt;
0.000\,558 &amp;amp; 0.005\,58 &amp;amp; 0.055\,8 &amp;amp; 0.188 &amp;amp; 0 \\&lt;br /&gt;
0.000\,062 &amp;amp; 0.000\,62 &amp;amp; 0.006\,2 &amp;amp; 0.062 &amp;amp; 0 \\&lt;br /&gt;
\end{bmatrix}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Recrafted items ===&lt;br /&gt;
Once more we first check how many items are produced, which is, again, the sum of all possible ways to get to a tier, this time adding productivity &amp;lt;math&amp;gt;p_i&amp;lt;/math&amp;gt;, and bringing along all those items which are already legendary &amp;lt;math&amp;gt;n_{5,k}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\begin{align}&lt;br /&gt;
n_{1,k+1} &amp;amp;= m_{1,k+1} \cdot ( 1 + p_1 ) \cdot (1 - q_1)\\&lt;br /&gt;
n_{2,k+1} &amp;amp;= m_{1,k+1} \cdot ( 1 + p_1 ) \cdot q_1 \cdot 0.9 &amp;amp;+&amp;amp;  m_{2,k+1} \cdot ( 1 + p_2 ) \cdot (1 - q_2)\\&lt;br /&gt;
n_{3,k+1} &amp;amp;= m_{1,k+1} \cdot ( 1 + p_1 ) \cdot q_1 \cdot 0.09 &amp;amp;+&amp;amp;  m_{2,k+1} \cdot ( 1 + p_2 ) \cdot q_2 \cdot 0.9 &amp;amp;+&amp;amp; m_{3,k+1} \cdot ( 1 + p_3 ) \cdot (1 - q_3) \\&lt;br /&gt;
n_{4,k+1} &amp;amp;= m_{1,k+1} \cdot ( 1 + p_1 ) \cdot q_1 \cdot 0.009 &amp;amp;+&amp;amp;  m_{2,k+1} \cdot ( 1 + p_2 ) \cdot q_2 \cdot 0.09 &amp;amp;+&amp;amp; m_{3,k+1} \cdot ( 1 + p_3 ) \cdot q_3 \cdot 0.9  &amp;amp;+&amp;amp; m_{4,k+1} \cdot ( 1 + p_4) \cdot (1 - q_4) \\&lt;br /&gt;
n_{5,k+1} &amp;amp;= m_{1,k+1} \cdot ( 1 + p_1 ) \cdot q_1 \cdot 0.001 &amp;amp;+&amp;amp;  m_{2,k+1} \cdot ( 1 + p_2 ) \cdot q_2 \cdot 0.01 &amp;amp;+&amp;amp; m_{3,k+1} \cdot ( 1 + p_3 ) \cdot q_3 \cdot 0.1  &amp;amp;+&amp;amp; m_{4,k+1} \cdot ( 1 + p_4) \cdot q_4 &amp;amp;+&amp;amp; m_{5,k+1} \cdot ( 1 + p_5) + n_{5,k}\\&lt;br /&gt;
\end{align}&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This can once more be written as a vector-matrix-multiplication &amp;lt;math&amp;gt;\textbf{n}_{k+1} = \textbf{B} \,\textbf{m}_{k+1} + \textbf{C} \,\textbf{n}_{k}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\underbrace{\begin{bmatrix} n_{1,k+1}\\ n_{2,k+1}\\ n_{3,k+1}\\ n_{4,k+1}\\ n_{5,k+1}\\ \end{bmatrix}}_{\textbf{n}_{k+1}} = &lt;br /&gt;
\underbrace{\begin{bmatrix}&lt;br /&gt;
( 1 + p_1 ) \cdot (1 - q_1) &amp;amp; 0 &amp;amp; 0 &amp;amp; 0 &amp;amp; 0 \\&lt;br /&gt;
( 1 + p_1 ) \cdot q_1 \cdot 0.9 &amp;amp;  ( 1 + p_2 ) \cdot (1 - q_2) &amp;amp; 0 &amp;amp; 0 &amp;amp; 0 \\&lt;br /&gt;
( 1 + p_1 ) \cdot q_1 \cdot 0.09 &amp;amp; ( 1 + p_2 ) \cdot q_2 \cdot 0.9 &amp;amp; ( 1 + p_3 ) \cdot (1 - q_3) &amp;amp; 0 &amp;amp; 0 \\&lt;br /&gt;
( 1 + p_1 ) \cdot q_1 \cdot 0.009 &amp;amp; ( 1 + p_2 ) \cdot q_2 \cdot 0.09 &amp;amp; ( 1 + p_3 ) \cdot q_3 \cdot 0.9  &amp;amp; ( 1 + p_4) \cdot (1 - q_4) &amp;amp; 0 \\&lt;br /&gt;
( 1 + p_1 ) \cdot q_1 \cdot 0.001 &amp;amp; ( 1 + p_2 ) \cdot q_2 \cdot 0.01 &amp;amp; ( 1 + p_3 ) \cdot q_3 \cdot 0.1  &amp;amp; ( 1 + p_4) \cdot q_4 &amp;amp; ( 1 + p_5)\\&lt;br /&gt;
\end{bmatrix}}_{B}&lt;br /&gt;
\underbrace{\begin{bmatrix} m_{1,k+1}\\ m_{2,k+1}\\ m_{3,k+1}\\ m_{4,k+1}\\ m_{5,k+1}\\ \end{bmatrix}}_{\textbf{m}_{k+1}}&lt;br /&gt;
+&lt;br /&gt;
\begin{bmatrix}&lt;br /&gt;
0&amp;amp;0&amp;amp;0&amp;amp;0\\&lt;br /&gt;
0&amp;amp;0&amp;amp;0&amp;amp;0\\&lt;br /&gt;
0&amp;amp;0&amp;amp;0&amp;amp;0\\&lt;br /&gt;
0&amp;amp;0&amp;amp;0&amp;amp;0\\&lt;br /&gt;
0&amp;amp;0&amp;amp;0&amp;amp;1\\&lt;br /&gt;
\end{bmatrix}&lt;br /&gt;
\underbrace{\begin{bmatrix} n_{1,k}\\ n_{2,k}\\ n_{3,k}\\ n_{4,k}\\ n_{5,k}\\ \end{bmatrix}}_{\textbf{n}_k}&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Combined model ===&lt;br /&gt;
&lt;br /&gt;
As such we gain an equation for the amount of items for every tier after any amount of iterations&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\begin{align}&lt;br /&gt;
\textbf{n}_{k+1} &lt;br /&gt;
    &amp;amp;= \textbf{B} \, \textbf{m}_{k+1} + \textbf{C} \, \textbf{n}_{k}\\&lt;br /&gt;
    &amp;amp;= \textbf{B} \, \textbf{A} \,\textbf{n}_{k} + \textbf{C} \, \textbf{n}_{k}\\&lt;br /&gt;
    &amp;amp;= (\textbf{B} \, \textbf{A} +\textbf{C} ) \, \textbf{n}_{k}\\&lt;br /&gt;
    &amp;amp;= \textbf{M} \, \textbf{n}_{k}\\&lt;br /&gt;
\textbf{n}_{k+2} &amp;amp;= \textbf{Q} \, \textbf{n}_{k+1} = \textbf{Q} \,  \textbf{Q} \, \textbf{n}_{k} = \textbf{Q}^2 \, \textbf{n}_{k}\\&lt;br /&gt;
&amp;amp;\vdots\\&lt;br /&gt;
\textbf{n}_k &amp;amp;= \textbf{Q}^k \, \textbf{n}_0\\&lt;br /&gt;
\end{align}&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
A realistic starting point for &amp;lt;math&amp;gt;\textbf{n}_0&amp;lt;/math&amp;gt; is only items in tier 1, and if we do not care for any other tiers, we simply choose sufficiently large &amp;lt;math&amp;gt;k = 100&amp;lt;/math&amp;gt;, and, through numeric means, try to maximize a single value. &amp;lt;math&amp;gt;q_{100,\text{crit}}&amp;lt;/math&amp;gt;, which falls in the fifth row, first column, of the Matrix &amp;lt;math&amp;gt;\textbf{Q}&amp;lt;/math&amp;gt; raised to the 100th power.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\begin{align}&lt;br /&gt;
\textbf{n}_k &amp;amp;= Q^k \, \textbf{n}_0\\&lt;br /&gt;
\begin{bmatrix}*\\ *\\ *\\ *\\ n_{5,100} \end{bmatrix} &amp;amp;= &lt;br /&gt;
\begin{bmatrix}&lt;br /&gt;
 * &amp;amp; * &amp;amp; * &amp;amp; * \\&lt;br /&gt;
 * &amp;amp; * &amp;amp; * &amp;amp; * \\&lt;br /&gt;
 * &amp;amp; * &amp;amp; * &amp;amp; * \\&lt;br /&gt;
 * &amp;amp; * &amp;amp; * &amp;amp; * \\&lt;br /&gt;
q_{100,\text{crit}} &amp;amp; * &amp;amp; * &amp;amp; * \\&lt;br /&gt;
\end{bmatrix} \begin{bmatrix}n_{1,0}\\ *\\ *\\ *\\ * \end{bmatrix}\\&lt;br /&gt;
\end{align}&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The choice of optimization method (simplex, branch and bound, etc.) itself is irrelevant, although most software will want the problem to be stated in a way so it can find a minimum, and may require the proper guard rails as to not pick values below 0 or higher than the maximum number of allowed modules.&lt;br /&gt;
&lt;br /&gt;
== Best ratios ==&lt;br /&gt;
This table shows the best ratio for quality to productivity modules in the crafting machines, while the recyclers always take only quality modules. The values are not given in whole numbers because often it is not just a single crafting machine per tier that will be used, then the ratios can change between different crafting machines in the same tier. &lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Crafting machine || Modules in Tier 1 || Modules in Tier 2 || Modules in Tier 3 || Modules in Tier 4 || Modules in Tier 5 || Percentage yield of legendary items&lt;br /&gt;
|-&lt;br /&gt;
| [[Chemical plant]] || 1.67 quality / 1.33 productivity || 1.67 quality / 1.33 productivity || 1.67 quality / 1.333 productivity || 1.8 quality / 1.2 productivity  || 0 quality / 3 productivity || 0.344%&lt;br /&gt;
|-&lt;br /&gt;
| [[Assembling machine 3]] || 1.67 quality / 2.33 productivity || 1.67 quality / 2.33 productivity || 1.67 quality / 2.33 productivity || 1.8 quality / 2.2 productivity  || 0 quality / 4 productivity || 0.586%&lt;br /&gt;
|-&lt;br /&gt;
| [[Foundry]] || 1.4 quality / 2.6 productivity || 1.4 quality / 2.6 productivity || 1.4 quality / 2.6 productivity || 1.5 quality / 2.5 productivity  || 0 quality / 4 productivity || 1.624%&lt;br /&gt;
|-&lt;br /&gt;
| [[Electromagnetic plant]] || 1 quality / 4 productivity || 1 quality / 4 productivity || 1 quality / 4 productivity || 1 quality / 4 productivity  || 0 quality / 5 productivity || 2.722%&lt;br /&gt;
|-&lt;br /&gt;
| [[Cryogenic plant]] || 0 quality / 8 productivity || 0 quality / 8 productivity || 0 quality / 8 productivity || 0 quality / 8 productivity  || 0 quality / 8 productivity || 4.835%&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--&lt;br /&gt;
=== Number of crafting machines ===&lt;br /&gt;
If we assume a constant input stream of tier 1 items which will always fill back up, we can additionally figure out what ratio of items will be inside the system at once, and with that we can figure out how many crafting machines we need per tier. This is done by setting &amp;lt;math&amp;gt;m_{1,k+1} = 100% - m_{2,k+1} - m_{3,k+1} - m_{4,k+1}&amp;lt;/math&amp;gt; after each iteration.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tabber&amp;gt;&lt;br /&gt;
per recycler=&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Crafting machine || Recyclers || Machines producing Tier 1 items || Machines producing Tier 2 items || Machines producing Tier 3 items || Machines producing Tier 4 items || Machines producing Tier 5 items&lt;br /&gt;
|-&lt;br /&gt;
| [[Chemical plant]] || 1 || 0.863 || 0.100 || 0.029 || 0.0078 || 0.0023&lt;br /&gt;
|-&lt;br /&gt;
| [[Assembling machine 3]] || 1 || 0.829 || 0.121 || 0.039 || 0.0115 || 0.0036&lt;br /&gt;
|-&lt;br /&gt;
| [[Foundry]] || 1 || 0.744 || 0.167 || 0.065 || 0.024 || 0.008&lt;br /&gt;
|-&lt;br /&gt;
| [[Electromagnetic plant]] || 1 || 0,688 || 0.193 || 0.083 || 0.035 || 0.010&lt;br /&gt;
|-&lt;br /&gt;
| [[Cryogenic plant]] || 1 || 0.603 || 0.231 || 0.112 || 0.054 || 0.013&lt;br /&gt;
|}&lt;br /&gt;
\-\&lt;br /&gt;
per tier 5 crafter (exact) =&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Crafting machine || Recyclers || Machines producing Tier 1 items || Machines producing Tier 2 items || Machines producing Tier 3 items || Machines producing Tier 4 items || Machines producing Tier 5 items&lt;br /&gt;
|-&lt;br /&gt;
| [[Chemical plant]] || 434.591 || 374.913 || 43.537 || 12.756 || 3.386 || 1&lt;br /&gt;
|-&lt;br /&gt;
| [[Assembling machine 3]] || 280.8301 || 232.703 || 33.934 || 10.950 || 3.243 || 1&lt;br /&gt;
|-&lt;br /&gt;
| [[Foundry]] || 131.090 || 97.587 || 21.831 || 8.516 || 3.155 || 1&lt;br /&gt;
|-&lt;br /&gt;
| [[Electromagnetic plant]] || 95.471 || 65.696 || 18.456 || 7.945 || 3.375 || 1&lt;br /&gt;
|-&lt;br /&gt;
| [[Cryogenic plant]] || 78.727 || 47.435 || 18.212 || 8.814 || 4.265 || 1&lt;br /&gt;
|}&lt;br /&gt;
\-\&lt;br /&gt;
per tier 5 crafter (conservative)=&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Crafting machine || Recyclers || Machines producing Tier 1 items || Machines producing Tier 2 items || Machines producing Tier 3 items || Machines producing Tier 4 items || Machines producing Tier 5 items&lt;br /&gt;
|-&lt;br /&gt;
| [[Chemical plant]] || 368	|| 318 || 37 || 11 || 3 || 1&lt;br /&gt;
|-&lt;br /&gt;
| [[Assembling machine 3]] || 247 || 205 || 30 || 10 || 3 || 1&lt;br /&gt;
|-&lt;br /&gt;
| [[Foundry]] || 119 || 89 || 20 || 8 || 3 || 1&lt;br /&gt;
|-&lt;br /&gt;
| [[Electromagnetic plant]] || 81 || 56 || 16 || 7 || 3 || 1&lt;br /&gt;
|-&lt;br /&gt;
| [[Cryogenic plant]] || 68 || 41 || 16 || 8 || 4 || 1&lt;br /&gt;
|}&lt;br /&gt;
\-\&lt;br /&gt;
prettier ratio=&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Crafting machine || Recyclers || Machines producing Tier 1 items || Machines producing Tier 2 items || Machines producing Tier 3 items || Machines producing Tier 4 items || Machines producing Tier 5 items&lt;br /&gt;
|-&lt;br /&gt;
| [[Chemical plant]] || 375 || 350 || 40 || 10 || 4 || 1&lt;br /&gt;
|-&lt;br /&gt;
| [[Assembling machine 3]] || 250 || 200 || 30 || 10 || 4 || 1&lt;br /&gt;
|-&lt;br /&gt;
| [[Foundry]] || 120 || 90 || 20 || 8 || 4 || 1&lt;br /&gt;
|-&lt;br /&gt;
| [[Electromagnetic plant]] || 80 || 60 || 16 || 8 || 4 || 1&lt;br /&gt;
|-&lt;br /&gt;
| [[Cryogenic plant]] || 64 || 48 || 16 || 8 || 4 || 1&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;/tabber&amp;gt;&lt;br /&gt;
--&amp;gt;&lt;/div&gt;</summary>
		<author><name>Untitled7</name></author>
	</entry>
	<entry>
		<id>https://wiki.factorio.com/index.php?title=Tutorial:Quality_upcycling_math&amp;diff=206994</id>
		<title>Tutorial:Quality upcycling math</title>
		<link rel="alternate" type="text/html" href="https://wiki.factorio.com/index.php?title=Tutorial:Quality_upcycling_math&amp;diff=206994"/>
		<updated>2024-11-23T17:34:12Z</updated>

		<summary type="html">&lt;p&gt;Untitled7: Created page with &amp;quot;How do we get the most amount of legendary items out of an upcycling plant?  The answer is not quite as straight forward as we&amp;#039;d like it to be, because it depends on a number of factors, luckily there is a finite number of possibilities of what the modules can be, and for the sake of simplicity this tutorial will ignore the productivity gain from infinite technologies.  == The crafting machines == {| class=&amp;quot;wikitable&amp;quot; ! Crafting mac...&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;How do we get the most amount of [[Quality|legendary]] items out of an upcycling plant?&lt;br /&gt;
&lt;br /&gt;
The answer is not quite as straight forward as we&#039;d like it to be, because it depends on a number of factors, luckily there is a finite number of possibilities of what the modules can be, and for the sake of simplicity this tutorial will ignore the productivity gain from [[Technologies#Space_Age|infinite technologies]].&lt;br /&gt;
&lt;br /&gt;
== The crafting machines ==&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Crafting machine || Module slots &amp;lt;math&amp;gt;N&amp;lt;/math&amp;gt; || Base productivity bonus &amp;lt;math&amp;gt;p_0&amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| [[Chemical plant]] || 3 || +0%&lt;br /&gt;
|-&lt;br /&gt;
| [[Assembling machine 3]] || 4 || +0%&lt;br /&gt;
|-&lt;br /&gt;
| [[Foundry]] || 4 || +50%&lt;br /&gt;
|-&lt;br /&gt;
| [[Electromagnetic plant]] || 5 || +50%&lt;br /&gt;
|-&lt;br /&gt;
| [[Cryogenic plant]] || 8 || +0%&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Quality probability ==&lt;br /&gt;
When an item gets produced and the initial roll decides that the quality of the item will increase, there is a 90% chance it will rise one tier, a 9% chance it will rise two, a 0.9% chance it will rise three, and a 0.1% chance it will rise four. This is of course capped if the item already started out at a higher tier.&lt;br /&gt;
&lt;br /&gt;
== Mathematical model ==&lt;br /&gt;
The mathematical model is time discrete. As opposed to dealing with derivatives in respect to time, the next state is a direct function of the previous state.&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;math&amp;gt;m_{i,k}&amp;lt;/math&amp;gt; ... Number of materials of tier &amp;lt;math&amp;gt;i&amp;lt;/math&amp;gt; after the &amp;lt;math&amp;gt;k&amp;lt;/math&amp;gt;-th iteration before being crafted. (this doesn&#039;t mean that an item only needs one type of ingredient, but that &amp;quot;1 materials&amp;quot; can be crafted into 1 item from them)&lt;br /&gt;
* &amp;lt;math&amp;gt;n_{i,k}&amp;lt;/math&amp;gt; ... Number of items of tier &amp;lt;math&amp;gt;i&amp;lt;/math&amp;gt; after the &amp;lt;math&amp;gt;k&amp;lt;/math&amp;gt;-th iteration, after being crafted together.&lt;br /&gt;
* &amp;lt;math&amp;gt;p_0&amp;lt;/math&amp;gt; ... the crafting machines inherent productivity bonus&lt;br /&gt;
* &amp;lt;math&amp;gt;N&amp;lt;/math&amp;gt; ... number of modules the crafting machine can hold&lt;br /&gt;
* &amp;lt;math&amp;gt;q_r = 4 \cdot 6.2 \, % = 0.248&amp;lt;/math&amp;gt; ... quality probability of the recyclers with 4 [[quality module 3]]&#039;s&lt;br /&gt;
* &amp;lt;math&amp;gt;p_i = p_0 + x_i \cdot 25 \, %&amp;lt;/math&amp;gt; ... productivity due to &amp;lt;math&amp;gt;x_i&amp;lt;/math&amp;gt; legendary [[productivity module 3]]&#039;s in the crafting machine which takes &amp;lt;math&amp;gt;i&amp;lt;/math&amp;gt;-tier materials&lt;br /&gt;
* &amp;lt;math&amp;gt;q_i = (N-x_i) \cdot 6.2 \, %&amp;lt;/math&amp;gt; ... quality probability due to &amp;lt;math&amp;gt;(N - x_i)&amp;lt;/math&amp;gt; legendary quality module 3&#039;s in the crafting machine which takes &amp;lt;math&amp;gt;i&amp;lt;/math&amp;gt;-tier materials&lt;br /&gt;
&lt;br /&gt;
=== Recycled materials ===&lt;br /&gt;
When a quarter of all items being recycled and the quality probability rules we can write the equations for the amount of materials received after recycling. This calculation is rather simple, as we the lowest tier can only come forth from it&#039;s own tier failing to raise in quality. The second tier are 90% of tier 1 items that did increase, and all those tier 2 items that didn&#039;t. This continues for all tiers as follows, but legendary items &amp;lt;math&amp;gt;n_{5,k}&amp;lt;/math&amp;gt; will not be recycled&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\begin{align}&lt;br /&gt;
m_{1,k+1} &amp;amp;= \frac{n_{1,k}}{4} \cdot (1 - q_r)\\&lt;br /&gt;
m_{2,k+1} &amp;amp;= \frac{n_{1,k}}{4} \cdot q_r \cdot 0.9 &amp;amp;+&amp;amp; \frac{n_{2,k}}{4} \cdot (1 - q_r)\\&lt;br /&gt;
m_{3,k+1} &amp;amp;= \frac{n_{1,k}}{4} \cdot q_r \cdot 0.09 &amp;amp;+&amp;amp; \frac{n_{2,k}}{4} \cdot q_r \cdot 0.9 &amp;amp;+&amp;amp; \frac{n_{3,k}}{4} \cdot (1 - q_r)\\&lt;br /&gt;
m_{4,k+1} &amp;amp;= \frac{n_{1,k}}{4} \cdot q_r \cdot 0.009 &amp;amp;+&amp;amp; \frac{n_{2,k}}{4} \cdot q_r \cdot 0.09 &amp;amp;+&amp;amp; \frac{n_{3,k}}{4} \cdot q_r \cdot 0.9 &amp;amp;+&amp;amp; \frac{n_{4,k}}{4} \cdot (1 - q_r)\\&lt;br /&gt;
m_{5,k+1} &amp;amp;= \frac{n_{1,k}}{4} \cdot q_r \cdot 0.001 &amp;amp;+&amp;amp; \frac{n_{2,k}}{4} \cdot q_r \cdot 0.01 &amp;amp;+&amp;amp; \frac{n_{3,k}}{4} \cdot q_r \cdot 0.1 &amp;amp;+&amp;amp; \frac{n_{4,k}}{4} \cdot q_r\\&lt;br /&gt;
\end{align}&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
which can also be written as a vector-matrix-multiplication &amp;lt;math&amp;gt;\textbf{m}_{k+1} = \textbf{A} \,\textbf{n}_k&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\underbrace{\begin{bmatrix} m_{1,k+1}\\ m_{2,k+1}\\ m_{3,k+1}\\ m_{4,k+1}\\ m_{5,k+1}\\ \end{bmatrix}}_{\textbf{m}_{k+1}}&lt;br /&gt;
=&lt;br /&gt;
\underbrace{\begin{bmatrix}&lt;br /&gt;
\frac{1 - q_r}{4} &amp;amp; 0 &amp;amp; 0 &amp;amp; 0 &amp;amp; 0\\&lt;br /&gt;
\frac{0.9 \, q_r}{4}   &amp;amp; \frac{1 - q_r}{4} &amp;amp; 0 &amp;amp; 0 &amp;amp; 0\\&lt;br /&gt;
\frac{0.09 \, q_r}{4}  &amp;amp; \frac{0.9 \, q_r}{4}  &amp;amp; \frac{1 - q_r}{4} &amp;amp; 0 &amp;amp; 0 \\&lt;br /&gt;
\frac{0.009 \, q_r}{4} &amp;amp; \frac{0.09 \, q_r}{4} &amp;amp; \frac{0.9 \, q_r}{4} &amp;amp; \frac{1 - q_r}{4} &amp;amp; 0\\&lt;br /&gt;
\frac{0.001 \, q_r}{4} &amp;amp; \frac{0.01 \, q_r}{4} &amp;amp; \frac{0.1 \, q_r}{4} &amp;amp; \frac{q_r}{4} &amp;amp; 0\\&lt;br /&gt;
\end{bmatrix}}_{\textbf{A}}&lt;br /&gt;
\underbrace{\begin{bmatrix} n_{1,k}\\ n_{2,k}\\ n_{3,k}\\ n_{4,k}\\ n_{5,k}\\ \end{bmatrix}}_{\textbf{n}_k}&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As we assume there is nothing to be done about recyclers to make them more effective but fill them with all quality modules, the value of &amp;lt;math&amp;gt;q_r = 0.248&amp;lt;/math&amp;gt; is a constant, and therefore the matrix &amp;lt;math&amp;gt;\textbf{A}&amp;lt;/math&amp;gt; is also a constant.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \textbf{A} = &lt;br /&gt;
\begin{bmatrix}&lt;br /&gt;
0.188 &amp;amp; 0 &amp;amp; 0 &amp;amp; 0 &amp;amp; 0 \\&lt;br /&gt;
0.055\,8 &amp;amp; 0.188 &amp;amp; 0 &amp;amp; 0 &amp;amp; 0 \\&lt;br /&gt;
0.005\,58 &amp;amp; 0.055\,8 &amp;amp; 0.188 &amp;amp; 0 &amp;amp; 0 \\&lt;br /&gt;
0.000\,558 &amp;amp; 0.005\,58 &amp;amp; 0.055\,8 &amp;amp; 0.188 &amp;amp; 0 \\&lt;br /&gt;
0.000\,062 &amp;amp; 0.000\,62 &amp;amp; 0.006\,2 &amp;amp; 0.062 &amp;amp; 0 \\&lt;br /&gt;
\end{bmatrix}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Recrafted items ===&lt;br /&gt;
Once more we first check how many items are produced, which is, again, the sum of all possible ways to get to a tier, this time adding productivity &amp;lt;math&amp;gt;p_i&amp;lt;/math&amp;gt;, and bringing along all those items which are already legendary &amp;lt;math&amp;gt;n_{5,k}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\begin{align}&lt;br /&gt;
n_{1,k+1} &amp;amp;= m_{1,k+1} \cdot ( 1 + p_1 ) \cdot (1 - q_1)\\&lt;br /&gt;
n_{2,k+1} &amp;amp;= m_{1,k+1} \cdot ( 1 + p_1 ) \cdot q_1 \cdot 0.9 &amp;amp;+&amp;amp;  m_{2,k+1} \cdot ( 1 + p_2 ) \cdot (1 - q_2)\\&lt;br /&gt;
n_{3,k+1} &amp;amp;= m_{1,k+1} \cdot ( 1 + p_1 ) \cdot q_1 \cdot 0.09 &amp;amp;+&amp;amp;  m_{2,k+1} \cdot ( 1 + p_2 ) \cdot q_2 \cdot 0.9 &amp;amp;+&amp;amp; m_{3,k+1} \cdot ( 1 + p_3 ) \cdot (1 - q_3) \\&lt;br /&gt;
n_{4,k+1} &amp;amp;= m_{1,k+1} \cdot ( 1 + p_1 ) \cdot q_1 \cdot 0.009 &amp;amp;+&amp;amp;  m_{2,k+1} \cdot ( 1 + p_2 ) \cdot q_2 \cdot 0.09 &amp;amp;+&amp;amp; m_{3,k+1} \cdot ( 1 + p_3 ) \cdot q_3 \cdot 0.9  &amp;amp;+&amp;amp; m_{4,k+1} \cdot ( 1 + p_4) \cdot (1 - q_4) \\&lt;br /&gt;
n_{5,k+1} &amp;amp;= m_{1,k+1} \cdot ( 1 + p_1 ) \cdot q_1 \cdot 0.001 &amp;amp;+&amp;amp;  m_{2,k+1} \cdot ( 1 + p_2 ) \cdot q_2 \cdot 0.01 &amp;amp;+&amp;amp; m_{3,k+1} \cdot ( 1 + p_3 ) \cdot q_3 \cdot 0.1  &amp;amp;+&amp;amp; m_{4,k+1} \cdot ( 1 + p_4) \cdot q_4 &amp;amp;+&amp;amp; m_{5,k+1} \cdot ( 1 + p_5) + n_{5,k}\\&lt;br /&gt;
\end{align}&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This can once more be written as a vector-matrix-multiplication &amp;lt;math&amp;gt;\textbf{n}_{k+1} = \textbf{B} \,\textbf{m}_{k+1} + \textbf{C} \,\textbf{n}_{k}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\underbrace{\begin{bmatrix} n_{1,k+1}\\ n_{2,k+1}\\ n_{3,k+1}\\ n_{4,k+1}\\ n_{5,k+1}\\ \end{bmatrix}}_{\textbf{n}_{k+1}} = &lt;br /&gt;
\underbrace{\begin{bmatrix}&lt;br /&gt;
( 1 + p_1 ) \cdot (1 - q_1) &amp;amp; 0 &amp;amp; 0 &amp;amp; 0 &amp;amp; 0 \\&lt;br /&gt;
( 1 + p_1 ) \cdot q_1 \cdot 0.9 &amp;amp;  ( 1 + p_2 ) \cdot (1 - q_2) &amp;amp; 0 &amp;amp; 0 &amp;amp; 0 \\&lt;br /&gt;
( 1 + p_1 ) \cdot q_1 \cdot 0.09 &amp;amp; ( 1 + p_2 ) \cdot q_2 \cdot 0.9 &amp;amp; ( 1 + p_3 ) \cdot (1 - q_3) &amp;amp; 0 &amp;amp; 0 \\&lt;br /&gt;
( 1 + p_1 ) \cdot q_1 \cdot 0.009 &amp;amp; ( 1 + p_2 ) \cdot q_2 \cdot 0.09 &amp;amp; ( 1 + p_3 ) \cdot q_3 \cdot 0.9  &amp;amp; ( 1 + p_4) \cdot (1 - q_4) &amp;amp; 0 \\&lt;br /&gt;
( 1 + p_1 ) \cdot q_1 \cdot 0.001 &amp;amp; ( 1 + p_2 ) \cdot q_2 \cdot 0.01 &amp;amp; ( 1 + p_3 ) \cdot q_3 \cdot 0.1  &amp;amp; ( 1 + p_4) \cdot q_4 &amp;amp; ( 1 + p_5)\\&lt;br /&gt;
\end{bmatrix}}_{B}&lt;br /&gt;
\underbrace{\begin{bmatrix} m_{1,k+1}\\ m_{2,k+1}\\ m_{3,k+1}\\ m_{4,k+1}\\ m_{5,k+1}\\ \end{bmatrix}}_{\textbf{m}_{k+1}}&lt;br /&gt;
+&lt;br /&gt;
\begin{bmatrix}&lt;br /&gt;
0&amp;amp;0&amp;amp;0&amp;amp;0\\&lt;br /&gt;
0&amp;amp;0&amp;amp;0&amp;amp;0\\&lt;br /&gt;
0&amp;amp;0&amp;amp;0&amp;amp;0\\&lt;br /&gt;
0&amp;amp;0&amp;amp;0&amp;amp;0\\&lt;br /&gt;
0&amp;amp;0&amp;amp;0&amp;amp;1\\&lt;br /&gt;
\end{bmatrix}&lt;br /&gt;
\underbrace{\begin{bmatrix} n_{1,k}\\ n_{2,k}\\ n_{3,k}\\ n_{4,k}\\ n_{5,k}\\ \end{bmatrix}}_{\textbf{n}_k}&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Combined model ===&lt;br /&gt;
&lt;br /&gt;
As such we gain an equation for the amount of items for every tier after any amount of iterations&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\begin{align}&lt;br /&gt;
\textbf{n}_{k+1} &lt;br /&gt;
    &amp;amp;= \textbf{B} \, \textbf{m}_{k+1} + \textbf{C} \, \textbf{n}_{k}\\&lt;br /&gt;
    &amp;amp;= \textbf{B} \, \textbf{A} \,\textbf{n}_{k} + \textbf{C} \, \textbf{n}_{k}\\&lt;br /&gt;
    &amp;amp;= (\textbf{B} \, \textbf{A} +\textbf{C} ) \, \textbf{n}_{k}\\&lt;br /&gt;
    &amp;amp;= \textbf{M} \, \textbf{n}_{k}\\&lt;br /&gt;
\textbf{n}_{k+2} &amp;amp;= \textbf{Q} \, \textbf{n}_{k+1} = \textbf{Q} \,  \textbf{Q} \, \textbf{n}_{k} = \textbf{Q}^2 \, \textbf{n}_{k}\\&lt;br /&gt;
&amp;amp;\vdots\\&lt;br /&gt;
\textbf{n}_k &amp;amp;= \textbf{Q}^k \, \textbf{n}_0\\&lt;br /&gt;
\end{align}&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
A realistic starting point for &amp;lt;math&amp;gt;\textbf{n}_0&amp;lt;/math&amp;gt; is only items in tier 1, and if we do not care for any other tiers, we simply choose sufficiently large &amp;lt;math&amp;gt;k = 100&amp;lt;/math&amp;gt;, and, through numeric means, try to maximize a single value. &amp;lt;math&amp;gt;q_{100,\text{crit}}&amp;lt;/math&amp;gt;, which falls in the fifth row, first column, of the Matrix &amp;lt;math&amp;gt;\textbf{Q}&amp;lt;/math&amp;gt; raised to the 100th power.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\begin{align}&lt;br /&gt;
\textbf{n}_k &amp;amp;= Q^k \, \textbf{n}_0\\&lt;br /&gt;
\begin{bmatrix}*\\ *\\ *\\ *\\ n_{5,100} \end{bmatrix} &amp;amp;= &lt;br /&gt;
\begin{bmatrix}&lt;br /&gt;
 * &amp;amp; * &amp;amp; * &amp;amp; * \\&lt;br /&gt;
 * &amp;amp; * &amp;amp; * &amp;amp; * \\&lt;br /&gt;
 * &amp;amp; * &amp;amp; * &amp;amp; * \\&lt;br /&gt;
 * &amp;amp; * &amp;amp; * &amp;amp; * \\&lt;br /&gt;
q_{100,\text{crit}} &amp;amp; * &amp;amp; * &amp;amp; * \\&lt;br /&gt;
\end{bmatrix} \begin{bmatrix}n_{1,0}\\ *\\ *\\ *\\ * \end{bmatrix}\\&lt;br /&gt;
\end{align}&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The choice of optimization method (simplex, branch and bound, etc.) itself is irrelevant, although most software will want the problem to be stated in a way so it can find a minimum, and may require the proper guard rails as to not pick values below 0 or higher than the maximum number of allowed modules.&lt;br /&gt;
&lt;br /&gt;
== Best ratios ==&lt;br /&gt;
This table shows the best ratio for quality to productivity modules in the crafting machines, while the recyclers always take only quality modules. The values are not given in whole numbers because often it is not just a single crafting machine per tier that will be used, then the ratios can change between different crafting machines in the same tier. &lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Crafting machine || Modules in Tier 1 || Modules in Tier 2 || Modules in Tier 3 || Modules in Tier 4 || Modules in Tier 5 || Percentage yield of legendary items&lt;br /&gt;
|-&lt;br /&gt;
| [[Chemical plant]] || 1.67 quality / 1.33 productivity || 1.67 quality / 1.33 productivity || 1.67 quality / 1.333 productivity || 1.8 quality / 1.2 productivity  || 0 quality / 3 productivity || 0.344%&lt;br /&gt;
|-&lt;br /&gt;
| [[Assembling machine 3]] || 1.67 quality / 2.33 productivity || 1.67 quality / 2.33 productivity || 1.67 quality / 2.33 productivity || 1.8 quality / 2.2 productivity  || 0 quality / 4 productivity || 0.586%&lt;br /&gt;
|-&lt;br /&gt;
| [[Foundry]] || 1.4 quality / 2.6 productivity || 1.4 quality / 2.6 productivity || 1.4 quality / 2.6 productivity || 1.5 quality / 2.5 productivity  || 0 quality / 4 productivity || 1.624%&lt;br /&gt;
|-&lt;br /&gt;
| [[Electromagnetic plant]] || 1 quality / 4 productivity || 1 quality / 4 productivity || 1 quality / 4 productivity || 1 quality / 4 productivity  || 0 quality / 5 productivity || 2.722%&lt;br /&gt;
|-&lt;br /&gt;
| [[Cryogenic plant]] || 0 quality / 8 productivity || 0 quality / 8 productivity || 0 quality / 8 productivity || 0 quality / 8 productivity  || 0 quality / 8 productivity || 4.835%&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Number of crafting machines ===&lt;br /&gt;
If we assume a constant input stream of tier 1 items which will always fill back up, we can additionally figure out what ratio of items will be inside the system at once, and with that we can figure out how many crafting machines we need per tier. This is done by setting &amp;lt;math&amp;gt;m_{1,k+1} = 100% - m_{2,k+1} - m_{3,k+1} - m_{4,k+1}&amp;lt;/math&amp;gt; after each iteration.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tabber&amp;gt;&lt;br /&gt;
per recycler=&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Crafting machine || Recyclers || Machines producing Tier 1 items || Machines producing Tier 2 items || Machines producing Tier 3 items || Machines producing Tier 4 items || Machines producing Tier 5 items&lt;br /&gt;
|-&lt;br /&gt;
| [[Chemical plant]] || 1 || 0.863 || 0.100 || 0.029 || 0.0078 || 0.0023&lt;br /&gt;
|-&lt;br /&gt;
| [[Assembling machine 3]] || 1 || 0.829 || 0.121 || 0.039 || 0.0115 || 0.0036&lt;br /&gt;
|-&lt;br /&gt;
| [[Foundry]] || 1 || 0.744 || 0.167 || 0.065 || 0.024 || 0.008&lt;br /&gt;
|-&lt;br /&gt;
| [[Electromagnetic plant]] || 1 || 0,688 || 0.193 || 0.083 || 0.035 || 0.010&lt;br /&gt;
|-&lt;br /&gt;
| [[Cryogenic plant]] || 1 || 0.603 || 0.231 || 0.112 || 0.054 || 0.013&lt;br /&gt;
|}&lt;br /&gt;
\-\&lt;br /&gt;
per tier 5 crafter (exact) =&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Crafting machine || Recyclers || Machines producing Tier 1 items || Machines producing Tier 2 items || Machines producing Tier 3 items || Machines producing Tier 4 items || Machines producing Tier 5 items&lt;br /&gt;
|-&lt;br /&gt;
| [[Chemical plant]] || 434.591 || 374.913 || 43.537 || 12.756 || 3.386 || 1&lt;br /&gt;
|-&lt;br /&gt;
| [[Assembling machine 3]] || 280.8301 || 232.703 || 33.934 || 10.950 || 3.243 || 1&lt;br /&gt;
|-&lt;br /&gt;
| [[Foundry]] || 131.090 || 97.587 || 21.831 || 8.516 || 3.155 || 1&lt;br /&gt;
|-&lt;br /&gt;
| [[Electromagnetic plant]] || 95.471 || 65.696 || 18.456 || 7.945 || 3.375 || 1&lt;br /&gt;
|-&lt;br /&gt;
| [[Cryogenic plant]] || 78.727 || 47.435 || 18.212 || 8.814 || 4.265 || 1&lt;br /&gt;
|}&lt;br /&gt;
\-\&lt;br /&gt;
per tier 5 crafter (conservative)=&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Crafting machine || Recyclers || Machines producing Tier 1 items || Machines producing Tier 2 items || Machines producing Tier 3 items || Machines producing Tier 4 items || Machines producing Tier 5 items&lt;br /&gt;
|-&lt;br /&gt;
| [[Chemical plant]] || 368	|| 318 || 37 || 11 || 3 || 1&lt;br /&gt;
|-&lt;br /&gt;
| [[Assembling machine 3]] || 247 || 205 || 30 || 10 || 3 || 1&lt;br /&gt;
|-&lt;br /&gt;
| [[Foundry]] || 119 || 89 || 20 || 8 || 3 || 1&lt;br /&gt;
|-&lt;br /&gt;
| [[Electromagnetic plant]] || 81 || 56 || 16 || 7 || 3 || 1&lt;br /&gt;
|-&lt;br /&gt;
| [[Cryogenic plant]] || 68 || 41 || 16 || 8 || 4 || 1&lt;br /&gt;
|}&lt;br /&gt;
\-\&lt;br /&gt;
prettier ratio=&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Crafting machine || Recyclers || Machines producing Tier 1 items || Machines producing Tier 2 items || Machines producing Tier 3 items || Machines producing Tier 4 items || Machines producing Tier 5 items&lt;br /&gt;
|-&lt;br /&gt;
| [[Chemical plant]] || 375 || 350 || 40 || 10 || 4 || 1&lt;br /&gt;
|-&lt;br /&gt;
| [[Assembling machine 3]] || 250 || 200 || 30 || 10 || 4 || 1&lt;br /&gt;
|-&lt;br /&gt;
| [[Foundry]] || 120 || 90 || 20 || 8 || 4 || 1&lt;br /&gt;
|-&lt;br /&gt;
| [[Electromagnetic plant]] || 80 || 60 || 16 || 8 || 4 || 1&lt;br /&gt;
|-&lt;br /&gt;
| [[Cryogenic plant]] || 64 || 48 || 16 || 8 || 4 || 1&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;/tabber&amp;gt;&lt;/div&gt;</summary>
		<author><name>Untitled7</name></author>
	</entry>
	<entry>
		<id>https://wiki.factorio.com/index.php?title=Recycler&amp;diff=206815</id>
		<title>Recycler</title>
		<link rel="alternate" type="text/html" href="https://wiki.factorio.com/index.php?title=Recycler&amp;diff=206815"/>
		<updated>2024-11-21T20:31:20Z</updated>

		<summary type="html">&lt;p&gt;Untitled7: used math notation&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Languages}}&lt;br /&gt;
{{:Infobox:Recycler}}&lt;br /&gt;
{{Stub}}&lt;br /&gt;
{{About/Space age}}&lt;br /&gt;
&lt;br /&gt;
The &#039;&#039;&#039;recycler&#039;&#039;&#039; is a building that can convert most items into the ingredients used in their recipes, at the cost of losing 75% of said ingredients. In other words, it performs a lossy reversal of crafting.&lt;br /&gt;
&lt;br /&gt;
It has 4 module slots, but it cannot use [[Productivity module]]s.&lt;br /&gt;
&lt;br /&gt;
== Mechanics ==&lt;br /&gt;
&lt;br /&gt;
When an item enters a recycler, the item&#039;s main recipe is found, and the recycler is automatically set to perform its inverse.&lt;br /&gt;
&lt;br /&gt;
For each type of item used as an ingredient in the recycled item&#039;s main recipe, the number of items returned by the recycler is decided by &amp;lt;math&amp;gt;\left \lfloor 0.25 \cdot \tfrac{i}{o} + r \right\rfloor&amp;lt;/math&amp;gt;, where &amp;lt;math&amp;gt;i&amp;lt;/math&amp;gt; is the number of items used as ingredients, &amp;lt;math&amp;gt;o&amp;lt;/math&amp;gt; is the number of items returned by the recipe, and &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt; is a random number that is greater than or equal to 0 but less than 1. On average, this returns exactly 25% of the items needed to craft one item of the same type as the recycled item. For example, recycling a [[processing unit]] always gives 5 [[electronic circuit]]s while having a 50% chance of returning one [[advanced circuit]].&lt;br /&gt;
&lt;br /&gt;
All fluid ingredients are lost when recycling, as the recycler has no fluid output.&lt;br /&gt;
&lt;br /&gt;
Without quality modules, the resulting items have the same quality as the item being recycled, even if the latter was crafted using lower-quality ingredients. Quality modules can further increase the output&#039;s quality, just like with regular non-recycling recipes.&lt;br /&gt;
&lt;br /&gt;
The recycler has 12 internal slots for its output, but can only hold one stack of each item. The recycler will try to eject the contents of these slots, much like a mining drill. It is therefore not necessary to use an inserter to collect its output.&lt;br /&gt;
&lt;br /&gt;
=== Non-recyclable items ===&lt;br /&gt;
&lt;br /&gt;
The broad rule with the recycler&#039;s ability to reverse a recipe is that it can only reverse recipes made in [[Assembling machine]]s of some type. There are many exceptions to this, however. For the purposes of the recycler&#039;s ability to recycle items, the [[Electromagnetic plant]] counts as an &amp;quot;assembler&amp;quot;. So all of its recipes count unless otherwise stated.&lt;br /&gt;
&lt;br /&gt;
Items can have multiple recipes; all that is needed for the recycler to reverse it is to find a single reversible recipe that produces that item.&lt;br /&gt;
&lt;br /&gt;
If no valid recipe producing the item can be reversed, the recycler will return the same item 25% of the time (possibly with a [[Quality]] bonus if the appropriate modules are used), with the other 75% destroying the item.&lt;br /&gt;
&lt;br /&gt;
Assembler recipes which cannot be recycled:&lt;br /&gt;
* All science packs&lt;br /&gt;
* [[Wood processing]]&lt;br /&gt;
* [[Landfill]]&lt;br /&gt;
* [[Tungsten carbide]]&lt;br /&gt;
* [[Superconductor]]&lt;br /&gt;
* [[Biolab]]&lt;br /&gt;
* [[Uranium fuel cell]]&lt;br /&gt;
* [[Holmium plate]] (due to only using a liquid as input)&lt;br /&gt;
* All recipes for [[nutrients]], save the one made from [[spoilage]]&lt;br /&gt;
&lt;br /&gt;
Non-assembler/EMP recipes which can be recycled:&lt;br /&gt;
* [[Battery]]&lt;br /&gt;
* [[Big mining drill]]&lt;br /&gt;
* [[Turbo transport belt]], [[Turbo underground belt]], and [[Turbo splitter]]&lt;br /&gt;
* [[Cryogenic plant]]&lt;br /&gt;
* [[Railgun]]&lt;br /&gt;
* [[Railgun turret]]&lt;br /&gt;
* [[Fusion reactor]]&lt;br /&gt;
* [[Fusion generator]]&lt;br /&gt;
&lt;br /&gt;
=== Unique recycling recipes ===&lt;br /&gt;
&lt;br /&gt;
Some items have unique recycling recipes:&lt;br /&gt;
&lt;br /&gt;
* Recycling [[scrap]] will perform the [[scrap recycling]] recipe, for which there is no inverse, as scrap can not be crafted. This is used to obtain most resources on [[Fulgora]].&lt;br /&gt;
* Recycling one [[nutrients]] will yield 2.5x that amount of [[spoilage]], as if they were made using the [[nutrients from spoilage]] recipe. This is useful for getting rid of excess nutrients, as they cannot be burned directly.&lt;br /&gt;
&lt;br /&gt;
=== Stats ===&lt;br /&gt;
&lt;br /&gt;
The recycling recipe for an item besides scrap takes time equal to 1/16th (0.0625) of the time it takes to craft that item. (Items without recipes, such as ore, are treated as having a crafting time of 0.5 seconds.) But because the recycler has a base crafting speed of 0.5, the time it takes one recycler to recycle one item is effectively 1/8th (0.125) of the item&#039;s crafting time without modules or beacons. For example, the time it takes to craft a [[steel plate]] in a [[stone furnace]] (which has a crafting speed of 1) is 16 seconds, and so recycling a steel plate takes 2 seconds. The following table provides some examples of how long it takes a recycler without modules or beacons to recycle one of that item, and the rate at which it recycles those items.&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;text-align: left !important;&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Recycler Input !! Time !! Rates&lt;br /&gt;
|-&lt;br /&gt;
| {{Imagelink|Processing unit}} || 1.25s || 0.8/s&lt;br /&gt;
|-&lt;br /&gt;
| {{Imagelink|Advanced circuit}} || 0.75s  || 1.33/s&lt;br /&gt;
|-&lt;br /&gt;
| {{Imagelink|Low density structure}} || 1.875s || 0.533/s&lt;br /&gt;
|-&lt;br /&gt;
| {{Imagelink|Steel plate}} || 2.0s || 0.5/s&lt;br /&gt;
|-&lt;br /&gt;
| {{Imagelink|Copper plate}}  || 0.4s || 2.5/s&lt;br /&gt;
|-&lt;br /&gt;
| {{Imagelink|Iron plate}} || 0.4s || 2.5/s&lt;br /&gt;
|-&lt;br /&gt;
| {{Imagelink|Iron ore}} || 0.0625s || 16/s&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The scrap recycling recipe takes .2 seconds, meaning that it actually takes .4 seconds to run in a recycler, so a recycler takes in 2.5 scrap/s. The output rates are as follows:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Input ||  Output || Chance || Rate&lt;br /&gt;
|-&lt;br /&gt;
| rowspan=&amp;quot;12&amp;quot; | {{Imagelink|Scrap|space-age=yes}}&lt;br /&gt;
| {{Imagelink|Processing unit}}  || 2% || 0.05/s&lt;br /&gt;
|-&lt;br /&gt;
| {{Imagelink|Advanced circuit}}  || 3% || 0.075/s&lt;br /&gt;
|-&lt;br /&gt;
| {{Imagelink|Low density structure}}  || 1%  || 0.025/s&lt;br /&gt;
|-&lt;br /&gt;
| {{Imagelink|Solid fuel}}  || 7%  || 0.175/s&lt;br /&gt;
|-&lt;br /&gt;
| {{Imagelink|Steel plate}}  || 4%  || 0.1/s&lt;br /&gt;
|-&lt;br /&gt;
| {{Imagelink|Concrete}}  || 6%  || 0.15/s&lt;br /&gt;
|-&lt;br /&gt;
| {{Imagelink|Battery}}  || 4%  || 0.1/s&lt;br /&gt;
|-&lt;br /&gt;
| {{Imagelink|Ice|space-age=yes}}  || 5%  || 0.125/s&lt;br /&gt;
|-&lt;br /&gt;
| {{Imagelink|Stone}}  || 4% || 0.1/s&lt;br /&gt;
|-&lt;br /&gt;
| {{Imagelink|Holmium ore|space-age=yes}}  || 1%  || 0.025/s&lt;br /&gt;
|-&lt;br /&gt;
| {{Imagelink|Iron gear wheel}}  || 20%  || 0.5/s&lt;br /&gt;
|-&lt;br /&gt;
| {{Imagelink|Copper cable}}  || 3%  || 0.075/s&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
In total, the recycler spits out 1.5 items/s, meaning 10 recyclers are just enough to saturate a yellow belt. The output values are increased by [[Scrap recycling productivity (research)|scrap recycling productivity research]].&lt;br /&gt;
&lt;br /&gt;
== Trivia ==&lt;br /&gt;
* If the recycled item has a fluid ingredient, then the smoke emitted from the recycler matches the fluid in colour.&lt;br /&gt;
&lt;br /&gt;
== Gallery ==&lt;br /&gt;
[[File:Fff-375-recycler-freezeframe.png|500px]]&lt;br /&gt;
&lt;br /&gt;
== History ==&lt;br /&gt;
{{history|2.0.7|&lt;br /&gt;
* Introduced in [[Space Age]]{{SA}} expansion.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
== See also ==&lt;br /&gt;
* [[Quality]]{{SA}}&lt;br /&gt;
&lt;br /&gt;
{{ProductionNav}}&lt;br /&gt;
{{C|Producers}}&lt;/div&gt;</summary>
		<author><name>Untitled7</name></author>
	</entry>
	<entry>
		<id>https://wiki.factorio.com/index.php?title=Tutorial:Solar_power_math&amp;diff=206480</id>
		<title>Tutorial:Solar power math</title>
		<link rel="alternate" type="text/html" href="https://wiki.factorio.com/index.php?title=Tutorial:Solar_power_math&amp;diff=206480"/>
		<updated>2024-11-16T19:18:23Z</updated>

		<summary type="html">&lt;p&gt;Untitled7: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;In this tutorial we will properly quantify the amount of [[solar panel]]s and [[accumulator]]s needed and the proper ratio that is needed between the two buildings.&lt;br /&gt;
&lt;br /&gt;
== Equation symbols and units ==&lt;br /&gt;
The game uses SI units and reflects how they are used in the real world. &#039;&#039;&#039;Energy&#039;&#039;&#039; &amp;lt;math&amp;gt;E&amp;lt;/math&amp;gt; and &#039;&#039;&#039;power&#039;&#039;&#039; &amp;lt;math&amp;gt;P&amp;lt;/math&amp;gt; are often used interchangeably, but power is the first time derivative of energy, i.e. how much energy is used or produced per second. Power can be used to get machines moving, as they perform &#039;&#039;&#039;work&#039;&#039;&#039; &amp;lt;math&amp;gt;W&amp;lt;/math&amp;gt;. A type of work can be lifting some mass against gravitational acceleration for a set distance. Usually there is always a loss of usable energy due to thermal energy being released, but Factorio does not take such losses into consideration. Lastly there is the charge in accumulators. Charge traditionally has the unit Coulomb and the energy in a capacitor depends on the charge and the voltage across it, but as Factorio also doesn&#039;t consider equipment using different voltages, a the charge &amp;lt;math&amp;gt;A&amp;lt;/math&amp;gt; of a factorio-accumulator can be defined to use this combined value.&lt;br /&gt;
&lt;br /&gt;
Therefore the important equation symbols for energy are as follows:&lt;br /&gt;
* &amp;lt;math&amp;gt;E&amp;lt;/math&amp;gt; ... energy, in &amp;lt;math&amp;gt;\mathrm{J}&amp;lt;/math&amp;gt; Joule, also often written in &amp;lt;math&amp;gt;\mathrm{kW} \, \mathrm{h}&amp;lt;/math&amp;gt; kilowatt-hours, where &amp;lt;math&amp;gt;1 \, \mathrm{kW} \, \mathrm{h} = 3\,600\,000 \mathrm{J} = 3.6 \, \mathrm{MJ}&amp;lt;/math&amp;gt;.&lt;br /&gt;
* &amp;lt;math&amp;gt;W&amp;lt;/math&amp;gt; ... performed work, in &amp;lt;math&amp;gt;\mathrm{kg} \, \tfrac{\mathrm{m}}{\mathrm{s}^2} \, \mathrm{m}&amp;lt;/math&amp;gt; or &amp;lt;math&amp;gt;\mathrm{N}\, \mathrm{m}&amp;lt;/math&amp;gt; Newton-meter which is equal to &amp;lt;math&amp;gt;\mathrm{J}&amp;lt;/math&amp;gt; Joule&lt;br /&gt;
* &amp;lt;math&amp;gt;A := \tfrac{1}{2} Q \cdot U^2&amp;lt;/math&amp;gt; ... accumulator charge, in &amp;lt;math&amp;gt;\mathrm{J}&amp;lt;/math&amp;gt; Joule&lt;br /&gt;
&lt;br /&gt;
And the important equation symbols for power are as follows, with dot-notation for the time derivative:&lt;br /&gt;
* &amp;lt;math&amp;gt;P_\text{S} := \tfrac{\mathrm{d}}{\mathrm{d} t} E = \dot{E}&amp;lt;/math&amp;gt; ... supplied power, in &amp;lt;math&amp;gt;\mathrm{W}&amp;lt;/math&amp;gt; Watt, or &amp;lt;math&amp;gt;\tfrac{\mathrm{J}}{\mathrm{s}}&amp;lt;/math&amp;gt; Joule per second.&lt;br /&gt;
* &amp;lt;math&amp;gt;\dot{W} := \tfrac{\mathrm{d} W}{\mathrm{d} t}&amp;lt;/math&amp;gt; ... ongoing mechanical work, in &amp;lt;math&amp;gt;\mathrm{W}&amp;lt;/math&amp;gt; Watt&lt;br /&gt;
* &amp;lt;math&amp;gt;\dot{A} := \tfrac{\mathrm{d} A}{\mathrm{d} t}&amp;lt;/math&amp;gt; ... change in accumulator charge, in &amp;lt;math&amp;gt;\mathrm{W}&amp;lt;/math&amp;gt; Watt&lt;br /&gt;
&lt;br /&gt;
Energy can&#039;t be generated or destroyed, only converted into a different form. This means that the balance of energy must be upheld, and therefore its rate of change must be zero. If we subtract from the supplied power both the ongoing mechanical work and the rate at which accumulators are charging (therefore taking energy from the grid), the result will be zero. As such we can write&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;P_\text{S} - \dot{W} - \dot{A} = 0&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
The player will not have to worry about overproduction, as any power generating equipment will cap its output automatically. Only too little production will no longer provide machines with the amount of power that they desire, causing them to throttle their own power demand and working slower. Therefore in almost all cases these rates will change over time, where solar panels produce energy dependant on the time of day, while machines equally draw more or less power depending on how much they are used. For example, inserters only draw their power when they swing their arms, while only using a tiny fraction of it on standby. As such we introduce notation for various statistically relevant values.&lt;br /&gt;
&lt;br /&gt;
* Average value over an interval &amp;lt;math&amp;gt;T&amp;lt;/math&amp;gt; is annotated with a bar above: &amp;lt;math&amp;gt;\bar{x} = \frac{1}{T} \int_{t}^{t+T} x(t) \mathrm{d}t&amp;lt;/math&amp;gt;&lt;br /&gt;
* Peak value with an upward facing chevron: &amp;lt;math&amp;gt;\hat{x} = \mathrm{max}\big( x(t) \big) &amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;!--* Idle value with a downward facing chevron: &amp;lt;math&amp;gt;\check{x} = \mathrm{min}\big( x(t) \big) &amp;lt;/math&amp;gt;--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Average output of 1 solar panel ==&lt;br /&gt;
&lt;br /&gt;
While only the peak output of a solar panel can be easily be told at &amp;lt;math&amp;gt;\hat{P} = 60 \, \mathrm{kW}&amp;lt;/math&amp;gt;, its exact power output over the day changes with available daylight. Thankfully, if we install some accumulators, they can do the integration for us.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\begin{align}&lt;br /&gt;
0 &amp;amp;= P(t) - \dot{A}(t)\\&lt;br /&gt;
\dot{A}(t) &amp;amp;= P(t)\\&lt;br /&gt;
A(T) &amp;amp;= \int_0^T P(t) \, \mathrm{d}t\\&lt;br /&gt;
\end{align}&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In an experiment with one solar panel and 4 accumulators, we can see that one solar panel will produce 17.6 MJ of energy per day.&lt;br /&gt;
&lt;br /&gt;
[[File:Solar_panel_energy.png|1200px]]&lt;br /&gt;
&lt;br /&gt;
Due to rounding, this could be anywhere between 17.55 MJ and 17.65 MJ, therefore the experiment can be repeated over multiple days.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! day number || accumulator charge || energy produced per day&lt;br /&gt;
|-&lt;br /&gt;
| 1 || 17.6 MJ || 17.6 MJ&lt;br /&gt;
|-&lt;br /&gt;
| 2 || 35.3 MJ || 17.65 MJ&lt;br /&gt;
|-&lt;br /&gt;
| 3 || 52.9 MJ || 17.633 MJ&lt;br /&gt;
|-&lt;br /&gt;
| 4 || 70.6 MJ || 17.65 MJ&lt;br /&gt;
|-&lt;br /&gt;
| 5 || 88.2 MJ || 17.64 MJ&lt;br /&gt;
|-&lt;br /&gt;
| 6 || 106 MJ || 17.666 MJ&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Further experiments show that the true number will swing around and approach 17.64 MJ&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\begin{align}&lt;br /&gt;
A(T) &amp;amp;= 17\,640 \, \mathrm{kJ}\\&lt;br /&gt;
\bar{P} &lt;br /&gt;
 &amp;amp;= \frac{\int_{0}^{T} P(t) \, \mathrm{d}t}{T} &lt;br /&gt;
  = \frac{A(T)}{T}&lt;br /&gt;
  = \frac{17\,640 \, \mathrm{kJ}}{420 \, \mathrm{s}}&lt;br /&gt;
  = 42 \, \mathrm{kW}&lt;br /&gt;
\end{align}&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
A day on Nauvis lasts 7 minutes, or &amp;lt;math&amp;gt; T = 420 \, \mathrm{s}&amp;lt;/math&amp;gt;, which means that each solar panel provides about 42 kW of power on average.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;toccolours mw-collapsible mw-collapsed&amp;quot; style=&amp;quot;  border-color:#141414 #3E3E3E #3E3E3E #141414;border-width: 2px;&amp;quot;&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;Solarpanel output as a function&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible-content&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For further calculations we assume the power output function of a solar panel looks as follows:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\begin{align}&lt;br /&gt;
P(t) &amp;amp;=&lt;br /&gt;
\begin{cases}&lt;br /&gt;
\tfrac{60}{84} t&lt;br /&gt;
&amp;amp; 0 \, \mathrm{s} \leq  t &amp;lt;  \frac{5\,040}{60} \, \mathrm{s}&lt;br /&gt;
\\&lt;br /&gt;
60 &lt;br /&gt;
&amp;amp; \frac{5\,040}{60} \, \mathrm{s} &amp;lt; t \leq \frac{17\,640}{60} \, \mathrm{s}&lt;br /&gt;
\\&lt;br /&gt;
60 - \tfrac{60}{84} \cdot ( t - \frac{17\,640}{60} \, \mathrm{s})&lt;br /&gt;
&amp;amp; \frac{17\,640}{60} \, \mathrm{s} &amp;lt; t \leq \frac{22\,680}{60} \, \mathrm{s}&lt;br /&gt;
\\&lt;br /&gt;
0 &amp;amp; \frac{22\,680}{60} \, \mathrm{s} &amp;lt; t \leq \frac{25\,200}{60} \, \mathrm{s}&lt;br /&gt;
\end{cases}\\&lt;br /&gt;
\int_{0}^{T} P(t) \, \mathrm{d}t &amp;amp;= 17\,640 \, \mathrm{kJ}&lt;br /&gt;
\end{align}&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Knowing how much power a solar panel provides on average we can construct a fitting load to test how much max accumulator charge &amp;lt;math&amp;gt;\hat{A}&amp;lt;/math&amp;gt; is needed.&lt;br /&gt;
&lt;br /&gt;
In a second experiment we take two solar panels on separate grids and put a load of &amp;lt;math&amp;gt;\tfrac{17\,600 \, \mathrm{kJ}}{420 \, \mathrm{s}} \approx 41.9 \, \mathrm{kW}&amp;lt;/math&amp;gt; on one, and one with &amp;lt;math&amp;gt;\tfrac{17\,640 \, \mathrm{kJ}}{420 \, \mathrm{s}} = 42 \, \mathrm{kW}&amp;lt;/math&amp;gt;, which can be achieved with...&lt;br /&gt;
* 8 Assembly machines 2 (5 kW per unit), and&lt;br /&gt;
* 3/4 fast inserters (500 W per unit), and&lt;br /&gt;
* 1/0 regular inserters (400 W per unit).&lt;br /&gt;
To that we add a generous 100 accumulators and observe the energy in the system.&lt;br /&gt;
&amp;lt;tabber&amp;gt;&lt;br /&gt;
41.9 kW grid = [[File:Solar_panel_with_load_41point9kW.png|1200px]]&lt;br /&gt;
\-\&lt;br /&gt;
42 kW grid = [[File:Solar_panel_with_load_42kW.png|1200px]]&lt;br /&gt;
\-\&lt;br /&gt;
42 kW grid (zoomed in) = [[File:Solar_panel_with_load_42kW_zoom.png|1200px]]&lt;br /&gt;
&amp;lt;/tabber&amp;gt;&lt;br /&gt;
Experimental values for the 41.9 kW grid show the first peak has a height of about 4.24 MJ, with each consecutive peak growing higher as the true output of a solar panel is indeed more than 41.9 kW.&amp;lt;br&amp;gt;&lt;br /&gt;
Experimental values for the 42 kW grid show each peak reaching about 4.24 MJ, but falling short for 5 seconds if it has to start from no charge at all. This may be due to the fact that machines start to behave differently when power is low. However, if we start the experiment with some slight pre-existing charge, the system will be stable.&lt;br /&gt;
&lt;br /&gt;
== Accumulators per solar panel ==&lt;br /&gt;
&lt;br /&gt;
4.24 MJ is enough to fill 0.848 accumulators as they can hold a charge of 5 MJ each. Conservatively we can therefore set 0.85 accumulators per solar panel, or a ratio of 20 solar panels to 17 accumulators. A less conservative approach is to use 0.84 accumulators per solar panel, or a ratio of 25 solar panels to 21 accumulators.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;toccolours mw-collapsible mw-collapsed&amp;quot; style=&amp;quot;  border-color:#141414 #3E3E3E #3E3E3E #141414;border-width: 2px;&amp;quot;&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;Analytic solution: 2646/3125&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible-content&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We can set the previously defined power function as the rate of change of the accumulator and subtract it&#039;s average output as the load which the setup should be able to continuously supply. First we check when the power reaches 42 kW&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\begin{align}&lt;br /&gt;
42 &amp;amp;= \frac{60}{84} \cdot t_\text{start}\\&lt;br /&gt;
t_\text{start} &amp;amp;= \frac{3528}{60}&lt;br /&gt;
\end{align}&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Then we shift the function for power in time and reduce it by the 42 kW so that the function will start at zero.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\begin{align}&lt;br /&gt;
\dot{A}(t) &amp;amp;= P(t-\tfrac{3528}{60})-\hat{P} =&lt;br /&gt;
\begin{cases}&lt;br /&gt;
\frac{60\,\mathrm{kW}}{84\,\mathrm{s}} \cdot t&lt;br /&gt;
&amp;amp; 0 \, \mathrm{s} \leq  t &amp;lt;  \frac{1\,512}{60} \, \mathrm{s}&lt;br /&gt;
\\&lt;br /&gt;
60 \,\mathrm{kW} - 42\,\mathrm{kW}&lt;br /&gt;
&amp;amp; \frac{1\,512}{60} \, \mathrm{s} &amp;lt; t \leq \frac{14\,112}{60} \, \mathrm{s}&lt;br /&gt;
\\&lt;br /&gt;
60 \,\mathrm{kW} - \frac{60\,\mathrm{kW}}{84\,\mathrm{s}}\cdot\left(t-\frac{14\,112}{60}\,\mathrm{s}\right)-42\,\mathrm{kW}&lt;br /&gt;
&amp;amp; \frac{14\,112}{60} \, \mathrm{s} &amp;lt; t \leq \frac{19\,152}{60} \, \mathrm{s}&lt;br /&gt;
\\&lt;br /&gt;
- 42\,\mathrm{kW}&lt;br /&gt;
&amp;amp; \frac{19\,152}{60} \, \mathrm{s} &amp;lt; t \leq \frac{21\,680}{60} \, \mathrm{s}&lt;br /&gt;
\\&lt;br /&gt;
\frac{60\,\mathrm{kW}}{84\,\mathrm{s}} \cdot ( t - \frac{21\,672}{60} \, \mathrm{s} ) - 42\,\mathrm{kW}&lt;br /&gt;
&amp;amp; \frac{21\,672}{60} \, \mathrm{s} &amp;lt; t \leq \frac{25\,200}{60} \, \mathrm{s}&lt;br /&gt;
\end{cases}\\&lt;br /&gt;
A(T=420\,\mathrm{s}) &amp;amp;= \int_{0}^{T} \dot{A}(t) \, \mathrm{d}t = 0 \, \mathrm{J}&lt;br /&gt;
\end{align}&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To find the critical point in time &amp;lt;math&amp;gt;t_\text{crit}&amp;lt;/math&amp;gt; at which the accumulator charge reaches it&#039;s peak &amp;lt;math&amp;gt;\hat{A} = A(t_\text{crit})&amp;lt;/math&amp;gt;, we need to see when it&#039;s derivative passes zero. This happens in it&#039;s 3rd section.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\begin{align}&lt;br /&gt;
\dot{A}(t_\text{crit}) = 0 &amp;amp;= 60 \,\mathrm{kW} - \frac{60\,\mathrm{kW}}{84\,\mathrm{s}}\cdot\left(t_\text{crit}-\frac{14\,112}{60}\,\mathrm{s}\right)-42\,\mathrm{kW}\\&lt;br /&gt;
t_\text{crit} &amp;amp;= \frac{(60\,\mathrm{kW} - 42\,\mathrm{kW})}{\frac{60\,\mathrm{kW}}{84\,\mathrm{s}}} + \frac{14\,112}{60}\,\mathrm{s}  = \frac{15\,624}{60}\,\mathrm{s} = 260.4 \, \mathrm{s}\\&lt;br /&gt;
\end{align}&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\begin{array}{rcccccc}&lt;br /&gt;
A(t_\text{crit}) = \displaystyle\int_0^{t_\text{crit}} \dot{A}(t) \, \mathrm{d}t &lt;br /&gt;
 &amp;amp;=&amp;amp; &lt;br /&gt;
   \displaystyle\int_{0\, \mathrm{s}}^{\frac{1\,512}{60}\, \mathrm{s}}  \frac{60\,\mathrm{kW}}{84\,\mathrm{s}} \cdot t \, \mathrm{d}t &lt;br /&gt;
   &amp;amp;+&amp;amp;&lt;br /&gt;
   \displaystyle\int_{\frac{1\,512}{60}\, \mathrm{s}}^{\frac{14\,112}{60}\, \mathrm{s}} 60 \,\mathrm{kW} - 42\,\mathrm{kW} \, \mathrm{d}t&lt;br /&gt;
   &amp;amp;+&amp;amp;&lt;br /&gt;
   \displaystyle\int_{\frac{14\,112}{60}\, \mathrm{s}}^{\frac{15\,624}{60}\, \mathrm{s}} 60 \,\mathrm{kW} - \frac{60\,\mathrm{kW}}{84\,\mathrm{s}}\cdot\left(t-\frac{14\,112}{60}\,\mathrm{s}\right)-42\,\mathrm{kW} \, \mathrm{d}t&lt;br /&gt;
 \\&lt;br /&gt;
 &amp;amp;=&amp;amp; &lt;br /&gt;
   \frac{60\, \mathrm{kW}}{84\, \mathrm{s}}\cdot\frac{1}{2}\cdot\left(\frac{1\,512}{60}\, \mathrm{s}\right)^{2}&lt;br /&gt;
   &amp;amp;+&amp;amp; &lt;br /&gt;
   \left(60\, \mathrm{kW}-42\, \mathrm{kW}\right)\cdot\left(\frac{14\,112}{60}\, \mathrm{s}-\frac{1\,512}{60}\, \mathrm{s}\right)&lt;br /&gt;
   &amp;amp;+&amp;amp; &lt;br /&gt;
   \left(60\, \mathrm{kW}-42\, \mathrm{kW}\right)\cdot\left(\frac{15\,624}{60}\, \mathrm{s}-\frac{14\,112}{60}\, \mathrm{s}\right)-\frac{60\, \mathrm{kW}}{84\, \mathrm{s}}\cdot\frac{1}{2}\cdot\left(\frac{15\,624}{60}\, \mathrm{s}-\frac{14\,112}{60}\, \mathrm{s}\right)^{2}&lt;br /&gt;
 \\&lt;br /&gt;
 &amp;amp;=&amp;amp;&lt;br /&gt;
   \frac{1\,134}{5} \, \mathrm{kJ}&lt;br /&gt;
 &amp;amp;+&amp;amp;&lt;br /&gt;
   3\,780 \, \mathrm{kJ}&lt;br /&gt;
 &amp;amp;+&amp;amp;&lt;br /&gt;
   \frac{1\,134}{5} \, \mathrm{kJ}\\&lt;br /&gt;
 &amp;amp;=&amp;amp; \frac{21\,168}{5} \, \mathrm{kJ}\\&lt;br /&gt;
 &amp;amp;=&amp;amp; 4\,233.6 \, \mathrm{kJ}&lt;br /&gt;
\end{array}&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The true perfect ratio for solar panels to accumulators therefore turns out to be...&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{\tfrac{21\,168}{5} \mathrm{kJ}}{5\,000 \, \mathrm{kJ}} = \frac{2\,646}{3\,125} = 0.846\,72&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
It takes 0.84672 accumulators per solar panel, or a ratio of 2646 accumulators to 3125 solar panels. Speaking conservatively we can take a higher ratio of 0.85 with 17 accumulators to 20 solar panels.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Best ratios ====&lt;br /&gt;
These ratios approach the one we got from the analytic solution, but to get more accurate, they need a larger number of individual equipment to do so.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable mw-collapsible mw-collapsed&amp;quot; style=&amp;quot;width: 25em;&amp;quot;&lt;br /&gt;
|+ more accumulators than necessary&lt;br /&gt;
|-&lt;br /&gt;
! accumulators || solar panels || ratio&lt;br /&gt;
|-&lt;br /&gt;
| 1 || 1 || 1&lt;br /&gt;
|-&lt;br /&gt;
| 6 || 7 || 0.857142857&lt;br /&gt;
|-&lt;br /&gt;
| 17 || 20 || 0.85&lt;br /&gt;
|-&lt;br /&gt;
| 28 || 33 || 0.848484848&lt;br /&gt;
|-&lt;br /&gt;
| 39 || 46 || 0.847826087&lt;br /&gt;
|-&lt;br /&gt;
| 50 || 59 || 0.847457627&lt;br /&gt;
|-&lt;br /&gt;
| 61 || 72 || 0.847222222&lt;br /&gt;
|-&lt;br /&gt;
| 72 || 85 || 0.847058824&lt;br /&gt;
|-&lt;br /&gt;
| 83 || 98 || 0.846938776&lt;br /&gt;
|-&lt;br /&gt;
| 94 || 111 || 0.846846847&lt;br /&gt;
|-&lt;br /&gt;
| 105 || 124 || 0.846774194&lt;br /&gt;
|-&lt;br /&gt;
| 221 || 261 || 0.846743295&lt;br /&gt;
|-&lt;br /&gt;
| 337 || 398 || 0.846733668&lt;br /&gt;
|-&lt;br /&gt;
| 453 || 535 || 0.846728972&lt;br /&gt;
|-&lt;br /&gt;
| 569 || 672 || 0.84672619&lt;br /&gt;
|-&lt;br /&gt;
| 685 || 809 || 0.846724351&lt;br /&gt;
|-&lt;br /&gt;
| 801 || 946 || 0.846723044&lt;br /&gt;
|-&lt;br /&gt;
| 917 || 1083 || 0.846722068&lt;br /&gt;
|-&lt;br /&gt;
| 1033 || 1220 || 0.846721311&lt;br /&gt;
|-&lt;br /&gt;
| 1149 || 1357 || 0.846720707&lt;br /&gt;
|-&lt;br /&gt;
| 1265 || 1494 || 0.846720214&lt;br /&gt;
|-&lt;br /&gt;
| 2646 || 3125 || 0.84672&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable mw-collapsible mw-collapsed&amp;quot; style=&amp;quot;width: 25em;&amp;quot;&lt;br /&gt;
|+ fewer accumulators than necessary&lt;br /&gt;
|-&lt;br /&gt;
! accumulators || solar panels || ratio&lt;br /&gt;
|-&lt;br /&gt;
| 1 || 2 || 0.5&lt;br /&gt;
|-&lt;br /&gt;
| 2 || 3 || 0.666666667&lt;br /&gt;
|-&lt;br /&gt;
| 3 || 4 || 0.75&lt;br /&gt;
|-&lt;br /&gt;
| 4 || 5 || 0.8&lt;br /&gt;
|-&lt;br /&gt;
| 5 || 6 || 0.833333333&lt;br /&gt;
|-&lt;br /&gt;
| 11 || 13 || 0.846153846&lt;br /&gt;
|-&lt;br /&gt;
| 116 || 137 || 0.846715328&lt;br /&gt;
|-&lt;br /&gt;
| 1381 || 1631 || 0.846719804&lt;br /&gt;
|-&lt;br /&gt;
| 2646 || 3125 || 0.84672&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== Testing ratios ====&lt;br /&gt;
The most commonly recommended ratio is 21/25 or 0.84, let&#039;s see how it fairs against 17/20 or 0.84, and then check out ratios for 0.8467 and 0.8469. And for fairness, these tests start off with fully charged accumulators before a load is applied.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tabber&amp;gt;&lt;br /&gt;
84/100 (21/25 or 0.84) = [[File:Solar_panel_21to25.png|1200px]]&lt;br /&gt;
&lt;br /&gt;
fell 0 kJ accumulator charge for 18 seconds&lt;br /&gt;
\-\&lt;br /&gt;
85/100 (17/20 or 0.85) = [[File:Solar_panel_17to20.png|1200px]]&lt;br /&gt;
&lt;br /&gt;
lowest recorded accumulator charge: 959 kJ (11.282 kJ per accumulator)&lt;br /&gt;
\-\&lt;br /&gt;
83/98 (or 0.8469)= [[File:Solar_panel_83to98.png|1200px]]&lt;br /&gt;
&lt;br /&gt;
lowest recorded accumulator charge: 107 kJ (1.289 kJ per accumulator)&lt;br /&gt;
\-\&lt;br /&gt;
116/137 (or 0.8467) = [[File:Solar_panel_116to137.png|1200px]]&lt;br /&gt;
&lt;br /&gt;
fell 0 kJ accumulator charge for half a second&lt;br /&gt;
&amp;lt;/tabber&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The tests support the analytic solution. The ratio for 0.8467 barely falls short of being able to sustain 42 kW of power, while 0.8469 almost fully discharges to 0.025%.&lt;/div&gt;</summary>
		<author><name>Untitled7</name></author>
	</entry>
	<entry>
		<id>https://wiki.factorio.com/index.php?title=Tutorial:Solar_power_math&amp;diff=206478</id>
		<title>Tutorial:Solar power math</title>
		<link rel="alternate" type="text/html" href="https://wiki.factorio.com/index.php?title=Tutorial:Solar_power_math&amp;diff=206478"/>
		<updated>2024-11-16T18:47:16Z</updated>

		<summary type="html">&lt;p&gt;Untitled7: /* Average output of 1 solar panel */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;In this tutorial we will properly quantify the amount of [[solar panel]]s and [[accumulator]]s needed and the proper ratio that is needed between the two buildings.&lt;br /&gt;
&lt;br /&gt;
== Equation symbols and units ==&lt;br /&gt;
The game uses SI units and reflects how they are used in the real world. &#039;&#039;&#039;Energy&#039;&#039;&#039; &amp;lt;math&amp;gt;E&amp;lt;/math&amp;gt; and &#039;&#039;&#039;power&#039;&#039;&#039; &amp;lt;math&amp;gt;P&amp;lt;/math&amp;gt; are often used interchangeably, but power is the first time derivative of energy, i.e. how much energy is used or produced per second. Power can be used to get machines moving, as they perform &#039;&#039;&#039;work&#039;&#039;&#039; &amp;lt;math&amp;gt;W&amp;lt;/math&amp;gt;. A type of work can be lifting some mass against gravitational acceleration for a set distance. Usually there is always a loss of usable energy due to thermal energy being released, but Factorio does not take such losses into consideration. Lastly there is the charge in accumulators. Charge traditionally has the unit Coulomb and the energy in a capacitor depends on the charge and the voltage across it, but as Factorio also doesn&#039;t consider equipment using different voltages, a the charge &amp;lt;math&amp;gt;A&amp;lt;/math&amp;gt; of a factorio-accumulator can be defined to use this combined value.&lt;br /&gt;
&lt;br /&gt;
Therefore the important equation symbols for energy are as follows:&lt;br /&gt;
* &amp;lt;math&amp;gt;E&amp;lt;/math&amp;gt; ... energy, in &amp;lt;math&amp;gt;\mathrm{J}&amp;lt;/math&amp;gt; Joule, also often written in &amp;lt;math&amp;gt;\mathrm{kW} \, \mathrm{h}&amp;lt;/math&amp;gt; kilowatt-hours, where &amp;lt;math&amp;gt;1 \, \mathrm{kW} \, \mathrm{h} = 3\,600\,000 \mathrm{J} = 3.6 \, \mathrm{MJ}&amp;lt;/math&amp;gt;.&lt;br /&gt;
* &amp;lt;math&amp;gt;W&amp;lt;/math&amp;gt; ... performed work, in &amp;lt;math&amp;gt;\mathrm{kg} \, \tfrac{\mathrm{m}}{\mathrm{s}^2} \, \mathrm{m}&amp;lt;/math&amp;gt; or &amp;lt;math&amp;gt;\mathrm{N}\, \mathrm{m}&amp;lt;/math&amp;gt; Newton-meter which is equal to &amp;lt;math&amp;gt;\mathrm{J}&amp;lt;/math&amp;gt; Joule&lt;br /&gt;
* &amp;lt;math&amp;gt;A := \tfrac{1}{2} Q \cdot U^2&amp;lt;/math&amp;gt; ... accumulator charge, in &amp;lt;math&amp;gt;\mathrm{J}&amp;lt;/math&amp;gt; Joule&lt;br /&gt;
&lt;br /&gt;
And the important equation symbols for power are as follows, with dot-notation for the time derivative:&lt;br /&gt;
* &amp;lt;math&amp;gt;P_\text{S} := \tfrac{\mathrm{d}}{\mathrm{d} t} E = \dot{E}&amp;lt;/math&amp;gt; ... supplied power, in &amp;lt;math&amp;gt;\mathrm{W}&amp;lt;/math&amp;gt; Watt, or &amp;lt;math&amp;gt;\tfrac{\mathrm{J}}{\mathrm{s}}&amp;lt;/math&amp;gt; Joule per second.&lt;br /&gt;
* &amp;lt;math&amp;gt;\dot{W} := \tfrac{\mathrm{d} W}{\mathrm{d} t}&amp;lt;/math&amp;gt; ... ongoing mechanical work, in &amp;lt;math&amp;gt;\mathrm{W}&amp;lt;/math&amp;gt; Watt&lt;br /&gt;
* &amp;lt;math&amp;gt;\dot{A} := \tfrac{\mathrm{d} A}{\mathrm{d} t}&amp;lt;/math&amp;gt; ... change in accumulator charge, in &amp;lt;math&amp;gt;\mathrm{W}&amp;lt;/math&amp;gt; Watt&lt;br /&gt;
&lt;br /&gt;
Energy can&#039;t be generated or destroyed, only converted into a different form. This means that the balance of energy must be upheld, and therefore its rate of change must be zero. If we subtract from the supplied power both the ongoing mechanical work and the rate at which accumulators are charging (therefore taking energy from the grid), the result will be zero. As such we can write&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;P_\text{S} - \dot{W} - \dot{A} = 0&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
The player will not have to worry about overproduction, as any power generating equipment will cap its output automatically. Only too little production will no longer provide machines with the amount of power that they desire, causing them to throttle their own power demand and working slower. Therefore in almost all cases these rates will change over time, where solar panels produce energy dependant on the time of day, while machines equally draw more or less power depending on how much they are used. For example, inserters only draw their power when they swing their arms, while only using a tiny fraction of it on standby. As such we introduce notation for various statistically relevant values.&lt;br /&gt;
&lt;br /&gt;
* Average value over an interval &amp;lt;math&amp;gt;T&amp;lt;/math&amp;gt; is annotated with a bar above: &amp;lt;math&amp;gt;\bar{x} = \frac{1}{T} \int_{t}^{t+T} x(t) \mathrm{d}t&amp;lt;/math&amp;gt;&lt;br /&gt;
* Peak value with an upward facing chevron: &amp;lt;math&amp;gt;\hat{x} = \mathrm{max}\big( x(t) \big) &amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;!--* Idle value with a downward facing chevron: &amp;lt;math&amp;gt;\check{x} = \mathrm{min}\big( x(t) \big) &amp;lt;/math&amp;gt;--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Average output of 1 solar panel ==&lt;br /&gt;
&lt;br /&gt;
While only the peak output of a solar panel can be easily be told at &amp;lt;math&amp;gt;\hat{P} = 60 \, \mathrm{kW}&amp;lt;/math&amp;gt;, its exact power output over the day changes with available daylight. Thankfully, if we install some accumulators, they can do the integration for us.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\begin{align}&lt;br /&gt;
0 &amp;amp;= P(t) - \dot{A}(t)\\&lt;br /&gt;
\dot{A}(t) &amp;amp;= P(t)\\&lt;br /&gt;
A(T) &amp;amp;= \int_0^T P(t) \, \mathrm{d}t\\&lt;br /&gt;
\end{align}&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In an experiment with one solar panel and 4 accumulators, we can see that one solar panel will produce 17.6 MJ of energy per day.&lt;br /&gt;
&lt;br /&gt;
[[File:Solar_panel_energy.png|1200px]]&lt;br /&gt;
&lt;br /&gt;
Due to rounding, this could be anywhere between 17.55 MJ and 17.65 MJ, therefore the experiment can be repeated over multiple days.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! day number || accumulator charge || energy produced per day&lt;br /&gt;
|-&lt;br /&gt;
| 1 || 17.6 MJ || 17.6 MJ&lt;br /&gt;
|-&lt;br /&gt;
| 2 || 35.3 MJ || 17.65 MJ&lt;br /&gt;
|-&lt;br /&gt;
| 3 || 52.9 MJ || 17.633 MJ&lt;br /&gt;
|-&lt;br /&gt;
| 4 || 70.6 MJ || 17.65 MJ&lt;br /&gt;
|-&lt;br /&gt;
| 5 || 88.2 MJ || 17.64 MJ&lt;br /&gt;
|-&lt;br /&gt;
| 6 || 106 MJ || 17.666 MJ&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Further experiments show that the true number will swing around and approach 17.64 MJ&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\begin{align}&lt;br /&gt;
A(T) &amp;amp;= 17\,640 \, \mathrm{kJ}\\&lt;br /&gt;
\bar{P} &lt;br /&gt;
 &amp;amp;= \frac{\int_{0}^{T} P(t) \, \mathrm{d}t}{T} &lt;br /&gt;
  = \frac{A(T)}{T}&lt;br /&gt;
  = \frac{17\,640 \, \mathrm{kJ}}{420 \, \mathrm{s}}&lt;br /&gt;
  = 42 \, \mathrm{kW}&lt;br /&gt;
\end{align}&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
A day on Nauvis lasts 7 minutes, or &amp;lt;math&amp;gt; T = 420 \, \mathrm{s}&amp;lt;/math&amp;gt;, which means that each solar panel provides about 42 kW of power on average.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;toccolours mw-collapsible mw-collapsed&amp;quot; style=&amp;quot;  border-color:#141414 #3E3E3E #3E3E3E #141414;border-width: 2px;&amp;quot;&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;Solarpanel output as a function&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible-content&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For further calculations we assume the power output function of a solar panel looks as follows:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\begin{align}&lt;br /&gt;
P(t) &amp;amp;=&lt;br /&gt;
\begin{cases}&lt;br /&gt;
\tfrac{60}{84} t&lt;br /&gt;
&amp;amp; 0 \, \mathrm{s} \leq  t &amp;lt;  \frac{5\,040}{60} \, \mathrm{s}&lt;br /&gt;
\\&lt;br /&gt;
60 &lt;br /&gt;
&amp;amp; \frac{5\,040}{60} \, \mathrm{s} &amp;lt; t \leq \frac{17\,640}{60} \, \mathrm{s}&lt;br /&gt;
\\&lt;br /&gt;
60 - \tfrac{60}{84} \cdot ( t - \frac{17\,640}{60} \, \mathrm{s})&lt;br /&gt;
&amp;amp; \frac{17\,640}{60} \, \mathrm{s} &amp;lt; t \leq \frac{22\,680}{60} \, \mathrm{s}&lt;br /&gt;
\\&lt;br /&gt;
0 &amp;amp; \frac{22\,680}{60} \, \mathrm{s} &amp;lt; t \leq \frac{25\,200}{60} \, \mathrm{s}&lt;br /&gt;
\end{cases}\\&lt;br /&gt;
\int_{0}^{T} P(t) \, \mathrm{d}t &amp;amp;= 17\,640 \, \mathrm{kJ}&lt;br /&gt;
\end{align}&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Accumulators per solar panel ==&lt;br /&gt;
&lt;br /&gt;
Knowing how much power a solar panel provides on average we can construct a fitting load to test how much max accumulator charge &amp;lt;math&amp;gt;\hat{A}&amp;lt;/math&amp;gt; is needed.&lt;br /&gt;
&lt;br /&gt;
In a second experiment we take two solar panels on separate grids and put a load of &amp;lt;math&amp;gt;\tfrac{17\,600 \, \mathrm{kJ}}{420 \, \mathrm{s}} \approx 41.9 \, \mathrm{kW}&amp;lt;/math&amp;gt; on one, and one with &amp;lt;math&amp;gt;\tfrac{17\,640 \, \mathrm{kJ}}{420 \, \mathrm{s}} = 42 \, \mathrm{kW}&amp;lt;/math&amp;gt;, which can be achieved with...&lt;br /&gt;
* 8 Assembly machines 2 (5 kW per unit), and&lt;br /&gt;
* 3/4 fast inserters (500 W per unit), and&lt;br /&gt;
* 1/0 regular inserters (400 W per unit).&lt;br /&gt;
To that we add a generous 100 accumulators and observe the energy in the system.&lt;br /&gt;
&amp;lt;tabber&amp;gt;&lt;br /&gt;
41.9 kW grid = [[File:Solar_panel_with_load_41point9kW.png|1200px]]&lt;br /&gt;
\-\&lt;br /&gt;
42 kW grid = [[File:Solar_panel_with_load_42kW.png|1200px]]&lt;br /&gt;
\-\&lt;br /&gt;
42 kW grid (zoomed in) = [[File:Solar_panel_with_load_42kW_zoom.png|1200px]]&lt;br /&gt;
&amp;lt;/tabber&amp;gt;&lt;br /&gt;
Experimental values for the 41.9 kW grid show the first peak has a height of about 4.24 MJ, with each consecutive peak growing higher as the true output of a solar panel is indeed more than 41.9 kW.&amp;lt;br&amp;gt;&lt;br /&gt;
Experimental values for the 42 kW grid show each peak reaching about 4.24 MJ, but falling short for 5 seconds.&lt;br /&gt;
&lt;br /&gt;
4.24 MJ is enough to fill 0.848 accumulators as they can hold a charge of 5 MJ each. Conservatively we can therefore set 0.85 accumulators per solar panel, or a ratio of 20 solar panels to 17 accumulators. A less conservative approach is to use 0.84 accumulators per solar panel, or a ratio of 25 solar panels to 21 accumulators.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;toccolours mw-collapsible mw-collapsed&amp;quot; style=&amp;quot;  border-color:#141414 #3E3E3E #3E3E3E #141414;border-width: 2px;&amp;quot;&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;Analytic solution: 2646/3125&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible-content&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We can set the previously defined power function as the rate of change of the accumulator and subtract it&#039;s average output as the load which the setup should be able to continuously supply. First we check when the power reaches 42 kW&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\begin{align}&lt;br /&gt;
42 &amp;amp;= \frac{60}{84} \cdot t_\text{start}\\&lt;br /&gt;
t_\text{start} &amp;amp;= \frac{3528}{60}&lt;br /&gt;
\end{align}&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Then we shift the function for power in time and reduce it by the 42 kW so that the function will start at zero.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\begin{align}&lt;br /&gt;
\dot{A}(t) &amp;amp;= P(t-\tfrac{3528}{60})-\hat{P} =&lt;br /&gt;
\begin{cases}&lt;br /&gt;
\frac{60\,\mathrm{kW}}{84\,\mathrm{s}} \cdot t&lt;br /&gt;
&amp;amp; 0 \, \mathrm{s} \leq  t &amp;lt;  \frac{1\,512}{60} \, \mathrm{s}&lt;br /&gt;
\\&lt;br /&gt;
60 \,\mathrm{kW} - 42\,\mathrm{kW}&lt;br /&gt;
&amp;amp; \frac{1\,512}{60} \, \mathrm{s} &amp;lt; t \leq \frac{14\,112}{60} \, \mathrm{s}&lt;br /&gt;
\\&lt;br /&gt;
60 \,\mathrm{kW} - \frac{60\,\mathrm{kW}}{84\,\mathrm{s}}\cdot\left(t-\frac{14\,112}{60}\,\mathrm{s}\right)-42\,\mathrm{kW}&lt;br /&gt;
&amp;amp; \frac{14\,112}{60} \, \mathrm{s} &amp;lt; t \leq \frac{19\,152}{60} \, \mathrm{s}&lt;br /&gt;
\\&lt;br /&gt;
- 42\,\mathrm{kW}&lt;br /&gt;
&amp;amp; \frac{19\,152}{60} \, \mathrm{s} &amp;lt; t \leq \frac{21\,680}{60} \, \mathrm{s}&lt;br /&gt;
\\&lt;br /&gt;
\frac{60\,\mathrm{kW}}{84\,\mathrm{s}} \cdot ( t - \frac{21\,672}{60} \, \mathrm{s} ) - 42\,\mathrm{kW}&lt;br /&gt;
&amp;amp; \frac{21\,672}{60} \, \mathrm{s} &amp;lt; t \leq \frac{25\,200}{60} \, \mathrm{s}&lt;br /&gt;
\end{cases}\\&lt;br /&gt;
A(T=420\,\mathrm{s}) &amp;amp;= \int_{0}^{T} \dot{A}(t) \, \mathrm{d}t = 0 \, \mathrm{J}&lt;br /&gt;
\end{align}&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To find the critical point in time &amp;lt;math&amp;gt;t_\text{crit}&amp;lt;/math&amp;gt; at which the accumulator charge reaches it&#039;s peak &amp;lt;math&amp;gt;\hat{A} = A(t_\text{crit})&amp;lt;/math&amp;gt;, we need to see when it&#039;s derivative passes zero. This happens in it&#039;s 3rd section.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\begin{align}&lt;br /&gt;
\dot{A}(t_\text{crit}) = 0 &amp;amp;= 60 \,\mathrm{kW} - \frac{60\,\mathrm{kW}}{84\,\mathrm{s}}\cdot\left(t_\text{crit}-\frac{14\,112}{60}\,\mathrm{s}\right)-42\,\mathrm{kW}\\&lt;br /&gt;
t_\text{crit} &amp;amp;= \frac{(60\,\mathrm{kW} - 42\,\mathrm{kW})}{\frac{60\,\mathrm{kW}}{84\,\mathrm{s}}} + \frac{14\,112}{60}\,\mathrm{s}  = \frac{15\,624}{60}\,\mathrm{s} = 260.4 \, \mathrm{s}\\&lt;br /&gt;
\end{align}&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\begin{array}{rcccccc}&lt;br /&gt;
A(t_\text{crit}) = \displaystyle\int_0^{t_\text{crit}} \dot{A}(t) \, \mathrm{d}t &lt;br /&gt;
 &amp;amp;=&amp;amp; &lt;br /&gt;
   \displaystyle\int_{0\, \mathrm{s}}^{\frac{1\,512}{60}\, \mathrm{s}}  \frac{60\,\mathrm{kW}}{84\,\mathrm{s}} \cdot t \, \mathrm{d}t &lt;br /&gt;
   &amp;amp;+&amp;amp;&lt;br /&gt;
   \displaystyle\int_{\frac{1\,512}{60}\, \mathrm{s}}^{\frac{14\,112}{60}\, \mathrm{s}} 60 \,\mathrm{kW} - 42\,\mathrm{kW} \, \mathrm{d}t&lt;br /&gt;
   &amp;amp;+&amp;amp;&lt;br /&gt;
   \displaystyle\int_{\frac{14\,112}{60}\, \mathrm{s}}^{\frac{15\,624}{60}\, \mathrm{s}} 60 \,\mathrm{kW} - \frac{60\,\mathrm{kW}}{84\,\mathrm{s}}\cdot\left(t-\frac{14\,112}{60}\,\mathrm{s}\right)-42\,\mathrm{kW} \, \mathrm{d}t&lt;br /&gt;
 \\&lt;br /&gt;
 &amp;amp;=&amp;amp; &lt;br /&gt;
   \frac{60\, \mathrm{kW}}{84\, \mathrm{s}}\cdot\frac{1}{2}\cdot\left(\frac{1\,512}{60}\, \mathrm{s}\right)^{2}&lt;br /&gt;
   &amp;amp;+&amp;amp; &lt;br /&gt;
   \left(60\, \mathrm{kW}-42\, \mathrm{kW}\right)\cdot\left(\frac{14\,112}{60}\, \mathrm{s}-\frac{1\,512}{60}\, \mathrm{s}\right)&lt;br /&gt;
   &amp;amp;+&amp;amp; &lt;br /&gt;
   \left(60\, \mathrm{kW}-42\, \mathrm{kW}\right)\cdot\left(\frac{15\,624}{60}\, \mathrm{s}-\frac{14\,112}{60}\, \mathrm{s}\right)-\frac{60\, \mathrm{kW}}{84\, \mathrm{s}}\cdot\frac{1}{2}\cdot\left(\frac{15\,624}{60}\, \mathrm{s}-\frac{14\,112}{60}\, \mathrm{s}\right)^{2}&lt;br /&gt;
 \\&lt;br /&gt;
 &amp;amp;=&amp;amp;&lt;br /&gt;
   \frac{1\,134}{5} \, \mathrm{kJ}&lt;br /&gt;
 &amp;amp;+&amp;amp;&lt;br /&gt;
   3\,780 \, \mathrm{kJ}&lt;br /&gt;
 &amp;amp;+&amp;amp;&lt;br /&gt;
   \frac{1\,134}{5} \, \mathrm{kJ}\\&lt;br /&gt;
 &amp;amp;=&amp;amp; \frac{21\,168}{5} \, \mathrm{kJ}\\&lt;br /&gt;
 &amp;amp;=&amp;amp; 4\,233.6 \, \mathrm{kJ}&lt;br /&gt;
\end{array}&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The true perfect ratio for solar panels to accumulators therefore turns out to be...&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{\tfrac{21\,168}{5} \mathrm{kJ}}{5\,000 \, \mathrm{kJ}} = \frac{2\,646}{3\,125} = 0.846\,72&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
It takes 0.84672 accumulators per solar panel, or a ratio of 2646 accumulators to 3125 solar panels. Speaking conservatively we can take a higher ratio of 0.85 with 17 accumulators to 20 solar panels.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Best ratios ====&lt;br /&gt;
These ratios approach the one we got from the analytic solution, but to get more accurate, they need a larger number of individual equipment to do so.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable mw-collapsible mw-collapsed&amp;quot; style=&amp;quot;width: 25em;&amp;quot;&lt;br /&gt;
|+ more accumulators than necessary&lt;br /&gt;
|-&lt;br /&gt;
! accumulators || solar panels || ratio&lt;br /&gt;
|-&lt;br /&gt;
| 1 || 1 || 1&lt;br /&gt;
|-&lt;br /&gt;
| 6 || 7 || 0.857142857&lt;br /&gt;
|-&lt;br /&gt;
| 17 || 20 || 0.85&lt;br /&gt;
|-&lt;br /&gt;
| 28 || 33 || 0.848484848&lt;br /&gt;
|-&lt;br /&gt;
| 39 || 46 || 0.847826087&lt;br /&gt;
|-&lt;br /&gt;
| 50 || 59 || 0.847457627&lt;br /&gt;
|-&lt;br /&gt;
| 61 || 72 || 0.847222222&lt;br /&gt;
|-&lt;br /&gt;
| 72 || 85 || 0.847058824&lt;br /&gt;
|-&lt;br /&gt;
| 83 || 98 || 0.846938776&lt;br /&gt;
|-&lt;br /&gt;
| 94 || 111 || 0.846846847&lt;br /&gt;
|-&lt;br /&gt;
| 105 || 124 || 0.846774194&lt;br /&gt;
|-&lt;br /&gt;
| 221 || 261 || 0.846743295&lt;br /&gt;
|-&lt;br /&gt;
| 337 || 398 || 0.846733668&lt;br /&gt;
|-&lt;br /&gt;
| 453 || 535 || 0.846728972&lt;br /&gt;
|-&lt;br /&gt;
| 569 || 672 || 0.84672619&lt;br /&gt;
|-&lt;br /&gt;
| 685 || 809 || 0.846724351&lt;br /&gt;
|-&lt;br /&gt;
| 801 || 946 || 0.846723044&lt;br /&gt;
|-&lt;br /&gt;
| 917 || 1083 || 0.846722068&lt;br /&gt;
|-&lt;br /&gt;
| 1033 || 1220 || 0.846721311&lt;br /&gt;
|-&lt;br /&gt;
| 1149 || 1357 || 0.846720707&lt;br /&gt;
|-&lt;br /&gt;
| 1265 || 1494 || 0.846720214&lt;br /&gt;
|-&lt;br /&gt;
| 2646 || 3125 || 0.84672&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable mw-collapsible mw-collapsed&amp;quot; style=&amp;quot;width: 25em;&amp;quot;&lt;br /&gt;
|+ fewer accumulators than necessary&lt;br /&gt;
|-&lt;br /&gt;
! accumulators || solar panels || ratio&lt;br /&gt;
|-&lt;br /&gt;
| 1 || 2 || 0.5&lt;br /&gt;
|-&lt;br /&gt;
| 2 || 3 || 0.666666667&lt;br /&gt;
|-&lt;br /&gt;
| 3 || 4 || 0.75&lt;br /&gt;
|-&lt;br /&gt;
| 4 || 5 || 0.8&lt;br /&gt;
|-&lt;br /&gt;
| 5 || 6 || 0.833333333&lt;br /&gt;
|-&lt;br /&gt;
| 11 || 13 || 0.846153846&lt;br /&gt;
|-&lt;br /&gt;
| 116 || 137 || 0.846715328&lt;br /&gt;
|-&lt;br /&gt;
| 1381 || 1631 || 0.846719804&lt;br /&gt;
|-&lt;br /&gt;
| 2646 || 3125 || 0.84672&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== Testing ratios ====&lt;br /&gt;
The most commonly recommended ratio is 21/25 or 0.84, let&#039;s see how it fairs against 17/20 or 0.84, and then check out ratios for 0.8467 and 0.8469. And for fairness, these tests start off with fully charged accumulators before a load is applied.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tabber&amp;gt;&lt;br /&gt;
84/100 (21/25 or 0.84) = [[File:Solar_panel_21to25.png|1200px]]&lt;br /&gt;
&lt;br /&gt;
fell 0 kJ accumulator charge for 18 seconds&lt;br /&gt;
\-\&lt;br /&gt;
85/100 (17/20 or 0.85) = [[File:Solar_panel_17to20.png|1200px]]&lt;br /&gt;
&lt;br /&gt;
lowest recorded accumulator charge: 959 kJ (11.282 kJ per accumulator)&lt;br /&gt;
\-\&lt;br /&gt;
83/98 (or 0.8469)= [[File:Solar_panel_83to98.png|1200px]]&lt;br /&gt;
&lt;br /&gt;
lowest recorded accumulator charge: 107 kJ (1.289 kJ per accumulator)&lt;br /&gt;
\-\&lt;br /&gt;
116/137 (or 0.8467) = [[File:Solar_panel_116to137.png|1200px]]&lt;br /&gt;
&lt;br /&gt;
fell 0 kJ accumulator charge for half a second&lt;br /&gt;
&amp;lt;/tabber&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The tests support the analytic solution. The ratio for 0.8467 barely falls short of being able to sustain 42 kW of power, while 0.8469 almost fully discharges to 0.025%.&lt;/div&gt;</summary>
		<author><name>Untitled7</name></author>
	</entry>
	<entry>
		<id>https://wiki.factorio.com/index.php?title=Tutorial:Solar_power_math&amp;diff=206477</id>
		<title>Tutorial:Solar power math</title>
		<link rel="alternate" type="text/html" href="https://wiki.factorio.com/index.php?title=Tutorial:Solar_power_math&amp;diff=206477"/>
		<updated>2024-11-16T18:43:03Z</updated>

		<summary type="html">&lt;p&gt;Untitled7: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;In this tutorial we will properly quantify the amount of [[solar panel]]s and [[accumulator]]s needed and the proper ratio that is needed between the two buildings.&lt;br /&gt;
&lt;br /&gt;
== Equation symbols and units ==&lt;br /&gt;
The game uses SI units and reflects how they are used in the real world. &#039;&#039;&#039;Energy&#039;&#039;&#039; &amp;lt;math&amp;gt;E&amp;lt;/math&amp;gt; and &#039;&#039;&#039;power&#039;&#039;&#039; &amp;lt;math&amp;gt;P&amp;lt;/math&amp;gt; are often used interchangeably, but power is the first time derivative of energy, i.e. how much energy is used or produced per second. Power can be used to get machines moving, as they perform &#039;&#039;&#039;work&#039;&#039;&#039; &amp;lt;math&amp;gt;W&amp;lt;/math&amp;gt;. A type of work can be lifting some mass against gravitational acceleration for a set distance. Usually there is always a loss of usable energy due to thermal energy being released, but Factorio does not take such losses into consideration. Lastly there is the charge in accumulators. Charge traditionally has the unit Coulomb and the energy in a capacitor depends on the charge and the voltage across it, but as Factorio also doesn&#039;t consider equipment using different voltages, a the charge &amp;lt;math&amp;gt;A&amp;lt;/math&amp;gt; of a factorio-accumulator can be defined to use this combined value.&lt;br /&gt;
&lt;br /&gt;
Therefore the important equation symbols for energy are as follows:&lt;br /&gt;
* &amp;lt;math&amp;gt;E&amp;lt;/math&amp;gt; ... energy, in &amp;lt;math&amp;gt;\mathrm{J}&amp;lt;/math&amp;gt; Joule, also often written in &amp;lt;math&amp;gt;\mathrm{kW} \, \mathrm{h}&amp;lt;/math&amp;gt; kilowatt-hours, where &amp;lt;math&amp;gt;1 \, \mathrm{kW} \, \mathrm{h} = 3\,600\,000 \mathrm{J} = 3.6 \, \mathrm{MJ}&amp;lt;/math&amp;gt;.&lt;br /&gt;
* &amp;lt;math&amp;gt;W&amp;lt;/math&amp;gt; ... performed work, in &amp;lt;math&amp;gt;\mathrm{kg} \, \tfrac{\mathrm{m}}{\mathrm{s}^2} \, \mathrm{m}&amp;lt;/math&amp;gt; or &amp;lt;math&amp;gt;\mathrm{N}\, \mathrm{m}&amp;lt;/math&amp;gt; Newton-meter which is equal to &amp;lt;math&amp;gt;\mathrm{J}&amp;lt;/math&amp;gt; Joule&lt;br /&gt;
* &amp;lt;math&amp;gt;A := \tfrac{1}{2} Q \cdot U^2&amp;lt;/math&amp;gt; ... accumulator charge, in &amp;lt;math&amp;gt;\mathrm{J}&amp;lt;/math&amp;gt; Joule&lt;br /&gt;
&lt;br /&gt;
And the important equation symbols for power are as follows, with dot-notation for the time derivative:&lt;br /&gt;
* &amp;lt;math&amp;gt;P_\text{S} := \tfrac{\mathrm{d}}{\mathrm{d} t} E = \dot{E}&amp;lt;/math&amp;gt; ... supplied power, in &amp;lt;math&amp;gt;\mathrm{W}&amp;lt;/math&amp;gt; Watt, or &amp;lt;math&amp;gt;\tfrac{\mathrm{J}}{\mathrm{s}}&amp;lt;/math&amp;gt; Joule per second.&lt;br /&gt;
* &amp;lt;math&amp;gt;\dot{W} := \tfrac{\mathrm{d} W}{\mathrm{d} t}&amp;lt;/math&amp;gt; ... ongoing mechanical work, in &amp;lt;math&amp;gt;\mathrm{W}&amp;lt;/math&amp;gt; Watt&lt;br /&gt;
* &amp;lt;math&amp;gt;\dot{A} := \tfrac{\mathrm{d} A}{\mathrm{d} t}&amp;lt;/math&amp;gt; ... change in accumulator charge, in &amp;lt;math&amp;gt;\mathrm{W}&amp;lt;/math&amp;gt; Watt&lt;br /&gt;
&lt;br /&gt;
Energy can&#039;t be generated or destroyed, only converted into a different form. This means that the balance of energy must be upheld, and therefore its rate of change must be zero. If we subtract from the supplied power both the ongoing mechanical work and the rate at which accumulators are charging (therefore taking energy from the grid), the result will be zero. As such we can write&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;P_\text{S} - \dot{W} - \dot{A} = 0&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
The player will not have to worry about overproduction, as any power generating equipment will cap its output automatically. Only too little production will no longer provide machines with the amount of power that they desire, causing them to throttle their own power demand and working slower. Therefore in almost all cases these rates will change over time, where solar panels produce energy dependant on the time of day, while machines equally draw more or less power depending on how much they are used. For example, inserters only draw their power when they swing their arms, while only using a tiny fraction of it on standby. As such we introduce notation for various statistically relevant values.&lt;br /&gt;
&lt;br /&gt;
* Average value over an interval &amp;lt;math&amp;gt;T&amp;lt;/math&amp;gt; is annotated with a bar above: &amp;lt;math&amp;gt;\bar{x} = \frac{1}{T} \int_{t}^{t+T} x(t) \mathrm{d}t&amp;lt;/math&amp;gt;&lt;br /&gt;
* Peak value with an upward facing chevron: &amp;lt;math&amp;gt;\hat{x} = \mathrm{max}\big( x(t) \big) &amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;!--* Idle value with a downward facing chevron: &amp;lt;math&amp;gt;\check{x} = \mathrm{min}\big( x(t) \big) &amp;lt;/math&amp;gt;--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Average output of 1 solar panel ==&lt;br /&gt;
&lt;br /&gt;
While only the peak output of a solar panel can be easily be told at &amp;lt;math&amp;gt;\hat{P} = 60 \, \mathrm{kW}&amp;lt;/math&amp;gt;, its exact power output over the day changes with available daylight. Thankfully, if we install some accumulators, they can do the integration for us.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\begin{align}&lt;br /&gt;
0 &amp;amp;= P(t) - \dot{A}(t)\\&lt;br /&gt;
\dot{A}(t) &amp;amp;= P(t)\\&lt;br /&gt;
A(T) &amp;amp;= \int_0^T P(t) \, \mathrm{d}t\\&lt;br /&gt;
\end{align}&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In an experiment with one solar panel and 4 accumulators, we can see that one solar panel will produce 17.6 MJ of energy per day.&lt;br /&gt;
&lt;br /&gt;
[[File:Solar_panel_energy.png|1200px]]&lt;br /&gt;
&lt;br /&gt;
Due to rounding, this could be anywhere between 17.55 MJ and 17.65 MJ, therefore the experiment can be repeated over multiple days.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! day number || accumulator charge || energy produced per day&lt;br /&gt;
|-&lt;br /&gt;
| 1 || 17.6 MJ || 17.6 MJ&lt;br /&gt;
|-&lt;br /&gt;
| 2 || 35.3 MJ || 17.65 MJ&lt;br /&gt;
|-&lt;br /&gt;
| 3 || 52.9 MJ || 17.633 MJ&lt;br /&gt;
|-&lt;br /&gt;
| 4 || 70.6 MJ || 17.65 MJ&lt;br /&gt;
|-&lt;br /&gt;
| 5 || 88.2 MJ || 17.64 MJ&lt;br /&gt;
|-&lt;br /&gt;
| 6 || 106 MJ || 17.666 MJ&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Further experiments show that the true number will swing around and approach 17.64 MJ&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\begin{align}&lt;br /&gt;
A(T) &amp;amp;= 17\,640 \, \mathrm{kJ}\\&lt;br /&gt;
\bar{P} &lt;br /&gt;
 &amp;amp;= \frac{\int_{0}^{T} P(t) \, \mathrm{d}t}{T} &lt;br /&gt;
  = \frac{A(T)}{T}&lt;br /&gt;
  = \frac{17\,640 \, \mathrm{kJ}}{420 \, \mathrm{s}}&lt;br /&gt;
  \approx 42 \, \mathrm{kW}&lt;br /&gt;
\end{align}&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
A day on Nauvis lasts 7 minutes, or &amp;lt;math&amp;gt; T = 420 \, \mathrm{s}&amp;lt;/math&amp;gt;, which means that each solar panel provides about 42 kW of power on average.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;toccolours mw-collapsible mw-collapsed&amp;quot; style=&amp;quot;  border-color:#141414 #3E3E3E #3E3E3E #141414;border-width: 2px;&amp;quot;&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;Solarpanel output as a function&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible-content&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For further calculations we assume the power output function of a solar panel looks as follows:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\begin{align}&lt;br /&gt;
P(t) &amp;amp;=&lt;br /&gt;
\begin{cases}&lt;br /&gt;
\tfrac{60}{84} t&lt;br /&gt;
&amp;amp; 0 \, \mathrm{s} \leq  t &amp;lt;  \frac{5\,040}{60} \, \mathrm{s}&lt;br /&gt;
\\&lt;br /&gt;
60 &lt;br /&gt;
&amp;amp; \frac{5\,040}{60} \, \mathrm{s} &amp;lt; t \leq \frac{17\,640}{60} \, \mathrm{s}&lt;br /&gt;
\\&lt;br /&gt;
60 - \tfrac{60}{84} \cdot ( t - \frac{17\,640}{60} \, \mathrm{s})&lt;br /&gt;
&amp;amp; \frac{17\,640}{60} \, \mathrm{s} &amp;lt; t \leq \frac{22\,680}{60} \, \mathrm{s}&lt;br /&gt;
\\&lt;br /&gt;
0 &amp;amp; \frac{22\,680}{60} \, \mathrm{s} &amp;lt; t \leq \frac{25\,200}{60} \, \mathrm{s}&lt;br /&gt;
\end{cases}\\&lt;br /&gt;
\int_{0}^{T} P(t) \, \mathrm{d}t &amp;amp;= 17\,640 \, \mathrm{kJ}&lt;br /&gt;
\end{align}&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Accumulators per solar panel ==&lt;br /&gt;
&lt;br /&gt;
Knowing how much power a solar panel provides on average we can construct a fitting load to test how much max accumulator charge &amp;lt;math&amp;gt;\hat{A}&amp;lt;/math&amp;gt; is needed.&lt;br /&gt;
&lt;br /&gt;
In a second experiment we take two solar panels on separate grids and put a load of &amp;lt;math&amp;gt;\tfrac{17\,600 \, \mathrm{kJ}}{420 \, \mathrm{s}} \approx 41.9 \, \mathrm{kW}&amp;lt;/math&amp;gt; on one, and one with &amp;lt;math&amp;gt;\tfrac{17\,640 \, \mathrm{kJ}}{420 \, \mathrm{s}} = 42 \, \mathrm{kW}&amp;lt;/math&amp;gt;, which can be achieved with...&lt;br /&gt;
* 8 Assembly machines 2 (5 kW per unit), and&lt;br /&gt;
* 3/4 fast inserters (500 W per unit), and&lt;br /&gt;
* 1/0 regular inserters (400 W per unit).&lt;br /&gt;
To that we add a generous 100 accumulators and observe the energy in the system.&lt;br /&gt;
&amp;lt;tabber&amp;gt;&lt;br /&gt;
41.9 kW grid = [[File:Solar_panel_with_load_41point9kW.png|1200px]]&lt;br /&gt;
\-\&lt;br /&gt;
42 kW grid = [[File:Solar_panel_with_load_42kW.png|1200px]]&lt;br /&gt;
\-\&lt;br /&gt;
42 kW grid (zoomed in) = [[File:Solar_panel_with_load_42kW_zoom.png|1200px]]&lt;br /&gt;
&amp;lt;/tabber&amp;gt;&lt;br /&gt;
Experimental values for the 41.9 kW grid show the first peak has a height of about 4.24 MJ, with each consecutive peak growing higher as the true output of a solar panel is indeed more than 41.9 kW.&amp;lt;br&amp;gt;&lt;br /&gt;
Experimental values for the 42 kW grid show each peak reaching about 4.24 MJ, but falling short for 5 seconds.&lt;br /&gt;
&lt;br /&gt;
4.24 MJ is enough to fill 0.848 accumulators as they can hold a charge of 5 MJ each. Conservatively we can therefore set 0.85 accumulators per solar panel, or a ratio of 20 solar panels to 17 accumulators. A less conservative approach is to use 0.84 accumulators per solar panel, or a ratio of 25 solar panels to 21 accumulators.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;toccolours mw-collapsible mw-collapsed&amp;quot; style=&amp;quot;  border-color:#141414 #3E3E3E #3E3E3E #141414;border-width: 2px;&amp;quot;&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;Analytic solution: 2646/3125&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible-content&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We can set the previously defined power function as the rate of change of the accumulator and subtract it&#039;s average output as the load which the setup should be able to continuously supply. First we check when the power reaches 42 kW&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\begin{align}&lt;br /&gt;
42 &amp;amp;= \frac{60}{84} \cdot t_\text{start}\\&lt;br /&gt;
t_\text{start} &amp;amp;= \frac{3528}{60}&lt;br /&gt;
\end{align}&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Then we shift the function for power in time and reduce it by the 42 kW so that the function will start at zero.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\begin{align}&lt;br /&gt;
\dot{A}(t) &amp;amp;= P(t-\tfrac{3528}{60})-\hat{P} =&lt;br /&gt;
\begin{cases}&lt;br /&gt;
\frac{60\,\mathrm{kW}}{84\,\mathrm{s}} \cdot t&lt;br /&gt;
&amp;amp; 0 \, \mathrm{s} \leq  t &amp;lt;  \frac{1\,512}{60} \, \mathrm{s}&lt;br /&gt;
\\&lt;br /&gt;
60 \,\mathrm{kW} - 42\,\mathrm{kW}&lt;br /&gt;
&amp;amp; \frac{1\,512}{60} \, \mathrm{s} &amp;lt; t \leq \frac{14\,112}{60} \, \mathrm{s}&lt;br /&gt;
\\&lt;br /&gt;
60 \,\mathrm{kW} - \frac{60\,\mathrm{kW}}{84\,\mathrm{s}}\cdot\left(t-\frac{14\,112}{60}\,\mathrm{s}\right)-42\,\mathrm{kW}&lt;br /&gt;
&amp;amp; \frac{14\,112}{60} \, \mathrm{s} &amp;lt; t \leq \frac{19\,152}{60} \, \mathrm{s}&lt;br /&gt;
\\&lt;br /&gt;
- 42\,\mathrm{kW}&lt;br /&gt;
&amp;amp; \frac{19\,152}{60} \, \mathrm{s} &amp;lt; t \leq \frac{21\,680}{60} \, \mathrm{s}&lt;br /&gt;
\\&lt;br /&gt;
\frac{60\,\mathrm{kW}}{84\,\mathrm{s}} \cdot ( t - \frac{21\,672}{60} \, \mathrm{s} ) - 42\,\mathrm{kW}&lt;br /&gt;
&amp;amp; \frac{21\,672}{60} \, \mathrm{s} &amp;lt; t \leq \frac{25\,200}{60} \, \mathrm{s}&lt;br /&gt;
\end{cases}\\&lt;br /&gt;
A(T=420\,\mathrm{s}) &amp;amp;= \int_{0}^{T} \dot{A}(t) \, \mathrm{d}t = 0 \, \mathrm{J}&lt;br /&gt;
\end{align}&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To find the critical point in time &amp;lt;math&amp;gt;t_\text{crit}&amp;lt;/math&amp;gt; at which the accumulator charge reaches it&#039;s peak &amp;lt;math&amp;gt;\hat{A} = A(t_\text{crit})&amp;lt;/math&amp;gt;, we need to see when it&#039;s derivative passes zero. This happens in it&#039;s 3rd section.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\begin{align}&lt;br /&gt;
\dot{A}(t_\text{crit}) = 0 &amp;amp;= 60 \,\mathrm{kW} - \frac{60\,\mathrm{kW}}{84\,\mathrm{s}}\cdot\left(t_\text{crit}-\frac{14\,112}{60}\,\mathrm{s}\right)-42\,\mathrm{kW}\\&lt;br /&gt;
t_\text{crit} &amp;amp;= \frac{(60\,\mathrm{kW} - 42\,\mathrm{kW})}{\frac{60\,\mathrm{kW}}{84\,\mathrm{s}}} + \frac{14\,112}{60}\,\mathrm{s}  = \frac{15\,624}{60}\,\mathrm{s} = 260.4 \, \mathrm{s}\\&lt;br /&gt;
\end{align}&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\begin{array}{rcccccc}&lt;br /&gt;
A(t_\text{crit}) = \displaystyle\int_0^{t_\text{crit}} \dot{A}(t) \, \mathrm{d}t &lt;br /&gt;
 &amp;amp;=&amp;amp; &lt;br /&gt;
   \displaystyle\int_{0\, \mathrm{s}}^{\frac{1\,512}{60}\, \mathrm{s}}  \frac{60\,\mathrm{kW}}{84\,\mathrm{s}} \cdot t \, \mathrm{d}t &lt;br /&gt;
   &amp;amp;+&amp;amp;&lt;br /&gt;
   \displaystyle\int_{\frac{1\,512}{60}\, \mathrm{s}}^{\frac{14\,112}{60}\, \mathrm{s}} 60 \,\mathrm{kW} - 42\,\mathrm{kW} \, \mathrm{d}t&lt;br /&gt;
   &amp;amp;+&amp;amp;&lt;br /&gt;
   \displaystyle\int_{\frac{14\,112}{60}\, \mathrm{s}}^{\frac{15\,624}{60}\, \mathrm{s}} 60 \,\mathrm{kW} - \frac{60\,\mathrm{kW}}{84\,\mathrm{s}}\cdot\left(t-\frac{14\,112}{60}\,\mathrm{s}\right)-42\,\mathrm{kW} \, \mathrm{d}t&lt;br /&gt;
 \\&lt;br /&gt;
 &amp;amp;=&amp;amp; &lt;br /&gt;
   \frac{60\, \mathrm{kW}}{84\, \mathrm{s}}\cdot\frac{1}{2}\cdot\left(\frac{1\,512}{60}\, \mathrm{s}\right)^{2}&lt;br /&gt;
   &amp;amp;+&amp;amp; &lt;br /&gt;
   \left(60\, \mathrm{kW}-42\, \mathrm{kW}\right)\cdot\left(\frac{14\,112}{60}\, \mathrm{s}-\frac{1\,512}{60}\, \mathrm{s}\right)&lt;br /&gt;
   &amp;amp;+&amp;amp; &lt;br /&gt;
   \left(60\, \mathrm{kW}-42\, \mathrm{kW}\right)\cdot\left(\frac{15\,624}{60}\, \mathrm{s}-\frac{14\,112}{60}\, \mathrm{s}\right)-\frac{60\, \mathrm{kW}}{84\, \mathrm{s}}\cdot\frac{1}{2}\cdot\left(\frac{15\,624}{60}\, \mathrm{s}-\frac{14\,112}{60}\, \mathrm{s}\right)^{2}&lt;br /&gt;
 \\&lt;br /&gt;
 &amp;amp;=&amp;amp;&lt;br /&gt;
   \frac{1\,134}{5} \, \mathrm{kJ}&lt;br /&gt;
 &amp;amp;+&amp;amp;&lt;br /&gt;
   3\,780 \, \mathrm{kJ}&lt;br /&gt;
 &amp;amp;+&amp;amp;&lt;br /&gt;
   \frac{1\,134}{5} \, \mathrm{kJ}\\&lt;br /&gt;
 &amp;amp;=&amp;amp; \frac{21\,168}{5} \, \mathrm{kJ}\\&lt;br /&gt;
 &amp;amp;=&amp;amp; 4\,233.6 \, \mathrm{kJ}&lt;br /&gt;
\end{array}&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The true perfect ratio for solar panels to accumulators therefore turns out to be...&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{\tfrac{21\,168}{5} \mathrm{kJ}}{5\,000 \, \mathrm{kJ}} = \frac{2\,646}{3\,125} = 0.846\,72&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
It takes 0.84672 accumulators per solar panel, or a ratio of 2646 accumulators to 3125 solar panels. Speaking conservatively we can take a higher ratio of 0.85 with 17 accumulators to 20 solar panels.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Best ratios ====&lt;br /&gt;
These ratios approach the one we got from the analytic solution, but to get more accurate, they need a larger number of individual equipment to do so.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable mw-collapsible mw-collapsed&amp;quot; style=&amp;quot;width: 25em;&amp;quot;&lt;br /&gt;
|+ more accumulators than necessary&lt;br /&gt;
|-&lt;br /&gt;
! accumulators || solar panels || ratio&lt;br /&gt;
|-&lt;br /&gt;
| 1 || 1 || 1&lt;br /&gt;
|-&lt;br /&gt;
| 6 || 7 || 0.857142857&lt;br /&gt;
|-&lt;br /&gt;
| 17 || 20 || 0.85&lt;br /&gt;
|-&lt;br /&gt;
| 28 || 33 || 0.848484848&lt;br /&gt;
|-&lt;br /&gt;
| 39 || 46 || 0.847826087&lt;br /&gt;
|-&lt;br /&gt;
| 50 || 59 || 0.847457627&lt;br /&gt;
|-&lt;br /&gt;
| 61 || 72 || 0.847222222&lt;br /&gt;
|-&lt;br /&gt;
| 72 || 85 || 0.847058824&lt;br /&gt;
|-&lt;br /&gt;
| 83 || 98 || 0.846938776&lt;br /&gt;
|-&lt;br /&gt;
| 94 || 111 || 0.846846847&lt;br /&gt;
|-&lt;br /&gt;
| 105 || 124 || 0.846774194&lt;br /&gt;
|-&lt;br /&gt;
| 221 || 261 || 0.846743295&lt;br /&gt;
|-&lt;br /&gt;
| 337 || 398 || 0.846733668&lt;br /&gt;
|-&lt;br /&gt;
| 453 || 535 || 0.846728972&lt;br /&gt;
|-&lt;br /&gt;
| 569 || 672 || 0.84672619&lt;br /&gt;
|-&lt;br /&gt;
| 685 || 809 || 0.846724351&lt;br /&gt;
|-&lt;br /&gt;
| 801 || 946 || 0.846723044&lt;br /&gt;
|-&lt;br /&gt;
| 917 || 1083 || 0.846722068&lt;br /&gt;
|-&lt;br /&gt;
| 1033 || 1220 || 0.846721311&lt;br /&gt;
|-&lt;br /&gt;
| 1149 || 1357 || 0.846720707&lt;br /&gt;
|-&lt;br /&gt;
| 1265 || 1494 || 0.846720214&lt;br /&gt;
|-&lt;br /&gt;
| 2646 || 3125 || 0.84672&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable mw-collapsible mw-collapsed&amp;quot; style=&amp;quot;width: 25em;&amp;quot;&lt;br /&gt;
|+ fewer accumulators than necessary&lt;br /&gt;
|-&lt;br /&gt;
! accumulators || solar panels || ratio&lt;br /&gt;
|-&lt;br /&gt;
| 1 || 2 || 0.5&lt;br /&gt;
|-&lt;br /&gt;
| 2 || 3 || 0.666666667&lt;br /&gt;
|-&lt;br /&gt;
| 3 || 4 || 0.75&lt;br /&gt;
|-&lt;br /&gt;
| 4 || 5 || 0.8&lt;br /&gt;
|-&lt;br /&gt;
| 5 || 6 || 0.833333333&lt;br /&gt;
|-&lt;br /&gt;
| 11 || 13 || 0.846153846&lt;br /&gt;
|-&lt;br /&gt;
| 116 || 137 || 0.846715328&lt;br /&gt;
|-&lt;br /&gt;
| 1381 || 1631 || 0.846719804&lt;br /&gt;
|-&lt;br /&gt;
| 2646 || 3125 || 0.84672&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== Testing ratios ====&lt;br /&gt;
The most commonly recommended ratio is 21/25 or 0.84, let&#039;s see how it fairs against 17/20 or 0.84, and then check out ratios for 0.8467 and 0.8469. And for fairness, these tests start off with fully charged accumulators before a load is applied.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tabber&amp;gt;&lt;br /&gt;
84/100 (21/25 or 0.84) = [[File:Solar_panel_21to25.png|1200px]]&lt;br /&gt;
&lt;br /&gt;
fell 0 kJ accumulator charge for 18 seconds&lt;br /&gt;
\-\&lt;br /&gt;
85/100 (17/20 or 0.85) = [[File:Solar_panel_17to20.png|1200px]]&lt;br /&gt;
&lt;br /&gt;
lowest recorded accumulator charge: 959 kJ (11.282 kJ per accumulator)&lt;br /&gt;
\-\&lt;br /&gt;
83/98 (or 0.8469)= [[File:Solar_panel_83to98.png|1200px]]&lt;br /&gt;
&lt;br /&gt;
lowest recorded accumulator charge: 107 kJ (1.289 kJ per accumulator)&lt;br /&gt;
\-\&lt;br /&gt;
116/137 (or 0.8467) = [[File:Solar_panel_116to137.png|1200px]]&lt;br /&gt;
&lt;br /&gt;
fell 0 kJ accumulator charge for half a second&lt;br /&gt;
&amp;lt;/tabber&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The tests support the analytic solution. The ratio for 0.8467 barely falls short of being able to sustain 42 kW of power, while 0.8469 almost fully discharges to 0.025%.&lt;/div&gt;</summary>
		<author><name>Untitled7</name></author>
	</entry>
	<entry>
		<id>https://wiki.factorio.com/index.php?title=File:Solar_panel_116to137.png&amp;diff=206476</id>
		<title>File:Solar panel 116to137.png</title>
		<link rel="alternate" type="text/html" href="https://wiki.factorio.com/index.php?title=File:Solar_panel_116to137.png&amp;diff=206476"/>
		<updated>2024-11-16T18:28:01Z</updated>

		<summary type="html">&lt;p&gt;Untitled7: {{Screenshot}}&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Summary ==&lt;br /&gt;
{{Screenshot}}&lt;/div&gt;</summary>
		<author><name>Untitled7</name></author>
	</entry>
	<entry>
		<id>https://wiki.factorio.com/index.php?title=File:Solar_panel_83to98.png&amp;diff=206475</id>
		<title>File:Solar panel 83to98.png</title>
		<link rel="alternate" type="text/html" href="https://wiki.factorio.com/index.php?title=File:Solar_panel_83to98.png&amp;diff=206475"/>
		<updated>2024-11-16T18:27:57Z</updated>

		<summary type="html">&lt;p&gt;Untitled7: {{Screenshot}}&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Summary ==&lt;br /&gt;
{{Screenshot}}&lt;/div&gt;</summary>
		<author><name>Untitled7</name></author>
	</entry>
	<entry>
		<id>https://wiki.factorio.com/index.php?title=File:Solar_panel_17to20.png&amp;diff=206474</id>
		<title>File:Solar panel 17to20.png</title>
		<link rel="alternate" type="text/html" href="https://wiki.factorio.com/index.php?title=File:Solar_panel_17to20.png&amp;diff=206474"/>
		<updated>2024-11-16T18:27:48Z</updated>

		<summary type="html">&lt;p&gt;Untitled7: {{Screenshot}}&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Summary ==&lt;br /&gt;
{{Screenshot}}&lt;/div&gt;</summary>
		<author><name>Untitled7</name></author>
	</entry>
	<entry>
		<id>https://wiki.factorio.com/index.php?title=File:Solar_panel_21to25.png&amp;diff=206473</id>
		<title>File:Solar panel 21to25.png</title>
		<link rel="alternate" type="text/html" href="https://wiki.factorio.com/index.php?title=File:Solar_panel_21to25.png&amp;diff=206473"/>
		<updated>2024-11-16T18:27:12Z</updated>

		<summary type="html">&lt;p&gt;Untitled7: {{Screenshot}}&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Summary ==&lt;br /&gt;
{{Screenshot}}&lt;/div&gt;</summary>
		<author><name>Untitled7</name></author>
	</entry>
	<entry>
		<id>https://wiki.factorio.com/index.php?title=Tutorial:Solar_power_math&amp;diff=206419</id>
		<title>Tutorial:Solar power math</title>
		<link rel="alternate" type="text/html" href="https://wiki.factorio.com/index.php?title=Tutorial:Solar_power_math&amp;diff=206419"/>
		<updated>2024-11-15T22:53:07Z</updated>

		<summary type="html">&lt;p&gt;Untitled7: /* Accumulators per solar panel */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;In this tutorial we will properly quantify the amount of [[solar panel]]s and [[accumulator]]s needed and the proper ratio that is needed between the two buildings.&lt;br /&gt;
&lt;br /&gt;
== Equation symbols and units ==&lt;br /&gt;
The game uses SI units and reflects how they are used in the real world. &#039;&#039;&#039;Energy&#039;&#039;&#039; &amp;lt;math&amp;gt;E&amp;lt;/math&amp;gt; and &#039;&#039;&#039;power&#039;&#039;&#039; &amp;lt;math&amp;gt;P&amp;lt;/math&amp;gt; are often used interchangeably, but power is the first time derivative of energy, i.e. how much energy is used or produced per second. Power can be used to get machines moving, as they perform &#039;&#039;&#039;work&#039;&#039;&#039; &amp;lt;math&amp;gt;W&amp;lt;/math&amp;gt;. A type of work can be lifting some mass against gravitational acceleration for a set distance. Usually there is always a loss of usable energy due to thermal energy being released, but Factorio does not take such losses into consideration. Lastly there is the charge in accumulators. Charge traditionally has the unit Coulomb and the energy in a capacitor depends on the charge and the voltage across it, but as Factorio also doesn&#039;t consider equipment using different voltages, a the charge &amp;lt;math&amp;gt;A&amp;lt;/math&amp;gt; of a factorio-accumulator can be defined to use this combined value.&lt;br /&gt;
&lt;br /&gt;
Therefore the important equation symbols for energy are as follows:&lt;br /&gt;
* &amp;lt;math&amp;gt;E&amp;lt;/math&amp;gt; ... energy, in &amp;lt;math&amp;gt;\mathrm{J}&amp;lt;/math&amp;gt; Joule, also often written in &amp;lt;math&amp;gt;\mathrm{kW} \, \mathrm{h}&amp;lt;/math&amp;gt; kilowatt-hours, where &amp;lt;math&amp;gt;1 \, \mathrm{kW} \, \mathrm{h} = 3\,600\,000 \mathrm{J} = 3.6 \, \mathrm{MJ}&amp;lt;/math&amp;gt;.&lt;br /&gt;
* &amp;lt;math&amp;gt;W&amp;lt;/math&amp;gt; ... performed work, in &amp;lt;math&amp;gt;\mathrm{kg} \, \tfrac{\mathrm{m}}{\mathrm{s}^2} \, \mathrm{m}&amp;lt;/math&amp;gt; or &amp;lt;math&amp;gt;\mathrm{N}\, \mathrm{m}&amp;lt;/math&amp;gt; Newton-meter which is equal to &amp;lt;math&amp;gt;\mathrm{J}&amp;lt;/math&amp;gt; Joule&lt;br /&gt;
* &amp;lt;math&amp;gt;A := \tfrac{1}{2} Q \cdot U^2&amp;lt;/math&amp;gt; ... accumulator charge, in &amp;lt;math&amp;gt;\mathrm{J}&amp;lt;/math&amp;gt; Joule&lt;br /&gt;
&lt;br /&gt;
And the important equation symbols for power are as follows, with dot-notation for the time derivative:&lt;br /&gt;
* &amp;lt;math&amp;gt;P_\text{S} := \tfrac{\mathrm{d}}{\mathrm{d} t} E = \dot{E}&amp;lt;/math&amp;gt; ... supplied power, in &amp;lt;math&amp;gt;\mathrm{W}&amp;lt;/math&amp;gt; Watt, or &amp;lt;math&amp;gt;\tfrac{\mathrm{J}}{\mathrm{s}}&amp;lt;/math&amp;gt; Joule per second.&lt;br /&gt;
* &amp;lt;math&amp;gt;\dot{W} := \tfrac{\mathrm{d} W}{\mathrm{d} t}&amp;lt;/math&amp;gt; ... ongoing mechanical work, in &amp;lt;math&amp;gt;\mathrm{W}&amp;lt;/math&amp;gt; Watt&lt;br /&gt;
* &amp;lt;math&amp;gt;\dot{A} := \tfrac{\mathrm{d} A}{\mathrm{d} t}&amp;lt;/math&amp;gt; ... change in accumulator charge, in &amp;lt;math&amp;gt;\mathrm{W}&amp;lt;/math&amp;gt; Watt&lt;br /&gt;
&lt;br /&gt;
Energy can&#039;t be generated or destroyed, only converted into a different form. This means that the balance of energy must be upheld, and therefore its rate of change must be zero. If we subtract from the supplied power both the ongoing mechanical work and the rate at which accumulators are charging (therefore taking energy from the grid), the result will be zero. As such we can write&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;P_\text{S} - \dot{W} - \dot{A} = 0&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
The player will not have to worry about overproduction, as any power generating equipment will cap its output automatically. Only too little production will no longer provide machines with the amount of power that they desire, causing them to throttle their own power demand and working slower. Therefore in almost all cases these rates will change over time, where solar panels produce energy dependant on the time of day, while machines equally draw more or less power depending on how much they are used. For example, inserters only draw their power when they swing their arms, while only using a tiny fraction of it on standby. As such we introduce notation for various statistically relevant values.&lt;br /&gt;
&lt;br /&gt;
* Average value over an interval &amp;lt;math&amp;gt;T&amp;lt;/math&amp;gt; is annotated with a bar above: &amp;lt;math&amp;gt;\bar{x} = \frac{1}{T} \int_{t}^{t+T} x(t) \mathrm{d}t&amp;lt;/math&amp;gt;&lt;br /&gt;
* Peak value with an upward facing chevron: &amp;lt;math&amp;gt;\hat{x} = \mathrm{max}\big( x(t) \big) &amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;!--* Idle value with a downward facing chevron: &amp;lt;math&amp;gt;\check{x} = \mathrm{min}\big( x(t) \big) &amp;lt;/math&amp;gt;--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Average output of 1 solar panel ==&lt;br /&gt;
&lt;br /&gt;
While only the peak output of a solar panel can be easily be told at &amp;lt;math&amp;gt;\hat{P} = 60 \, \mathrm{kW}&amp;lt;/math&amp;gt;, its exact power output over the day changes with available daylight. Thankfully, if we install some accumulators, they can do the integration for us.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\begin{align}&lt;br /&gt;
0 &amp;amp;= P(t) - \dot{A}(t)\\&lt;br /&gt;
\dot{A}(t) &amp;amp;= P(t)\\&lt;br /&gt;
A(T) &amp;amp;= \int_0^T P(t) \, \mathrm{d}t\\&lt;br /&gt;
\end{align}&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In an experiment with one solar panel and 4 accumulators, we can see that one solar panel will produce 17.6 MJ of energy per day.&lt;br /&gt;
&lt;br /&gt;
[[File:Solar_panel_energy.png|1200px]]&lt;br /&gt;
&lt;br /&gt;
Due to rounding, this could be anywhere between 17.55 MJ and 17.65 MJ, therefore the experiment can be repeated over multiple days.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! day number || accumulator charge || energy produced per day&lt;br /&gt;
|-&lt;br /&gt;
| 1 || 17.6 MJ || 17.6 MJ&lt;br /&gt;
|-&lt;br /&gt;
| 2 || 35.3 MJ || 17.65 MJ&lt;br /&gt;
|-&lt;br /&gt;
| 3 || 52.9 MJ || 17.633 MJ&lt;br /&gt;
|-&lt;br /&gt;
| 4 || 70.6 MJ || 17.65 MJ&lt;br /&gt;
|-&lt;br /&gt;
| 5 || 88.2 MJ || 17.64 MJ&lt;br /&gt;
|-&lt;br /&gt;
| 6 || 106 MJ || 17.666 MJ&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Further experiments show that the true number will swing around and approach 17.64 MJ&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\begin{align}&lt;br /&gt;
A(T) &amp;amp;= 17\,640 \, \mathrm{kJ}\\&lt;br /&gt;
\bar{P} &lt;br /&gt;
 &amp;amp;= \frac{\int_{0}^{T} P(t) \, \mathrm{d}t}{T} &lt;br /&gt;
  = \frac{A(T)}{T}&lt;br /&gt;
  = \frac{17\,640 \, \mathrm{kJ}}{420 \, \mathrm{s}}&lt;br /&gt;
  \approx 42 \, \mathrm{kW}&lt;br /&gt;
\end{align}&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
A day on Nauvis lasts 7 minutes, or &amp;lt;math&amp;gt; T = 420 \, \mathrm{s}&amp;lt;/math&amp;gt;, which means that each solar panel provides about 42 kW of power on average.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;toccolours mw-collapsible mw-collapsed&amp;quot;&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;Solarpanel output as a function&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible-content&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For further calculations we assume the power output function of a solar panel looks as follows:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\begin{align}&lt;br /&gt;
P(t) &amp;amp;=&lt;br /&gt;
\begin{cases}&lt;br /&gt;
\tfrac{60}{84} t&lt;br /&gt;
&amp;amp; 0 \, \mathrm{s} \leq  t &amp;lt;  \frac{5\,040}{60} \, \mathrm{s}&lt;br /&gt;
\\&lt;br /&gt;
60 &lt;br /&gt;
&amp;amp; \frac{5\,040}{60} \, \mathrm{s} &amp;lt; t \leq \frac{17\,640}{60} \, \mathrm{s}&lt;br /&gt;
\\&lt;br /&gt;
60 - \tfrac{60}{84} \cdot ( t - \frac{17\,640}{60} \, \mathrm{s})&lt;br /&gt;
&amp;amp; \frac{17\,640}{60} \, \mathrm{s} &amp;lt; t \leq \frac{22\,680}{60} \, \mathrm{s}&lt;br /&gt;
\\&lt;br /&gt;
0 &amp;amp; \frac{22\,680}{60} \, \mathrm{s} &amp;lt; t \leq \frac{25\,200}{60} \, \mathrm{s}&lt;br /&gt;
\end{cases}\\&lt;br /&gt;
\int_{0}^{T} P(t) \, \mathrm{d}t &amp;amp;= 17\,640 \, \mathrm{kJ}&lt;br /&gt;
\end{align}&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Accumulators per solar panel ==&lt;br /&gt;
&lt;br /&gt;
Knowing how much power a solar panel provides on average we can construct a fitting load to test how much max accumulator charge &amp;lt;math&amp;gt;\hat{A}&amp;lt;/math&amp;gt; is needed.&lt;br /&gt;
&lt;br /&gt;
In a second experiment we take two solar panels on separate grids and put a load of &amp;lt;math&amp;gt;\tfrac{17\,600 \, \mathrm{kJ}}{420 \, \mathrm{s}} \approx 41.9 \, \mathrm{kW}&amp;lt;/math&amp;gt; on one, and one with &amp;lt;math&amp;gt;\tfrac{17\,640 \, \mathrm{kJ}}{420 \, \mathrm{s}} = 42 \, \mathrm{kW}&amp;lt;/math&amp;gt;, which can be achieved with...&lt;br /&gt;
* 8 Assembly machines 2 (5 kW per unit), and&lt;br /&gt;
* 3/4 fast inserters (500 W per unit), and&lt;br /&gt;
* 1/0 regular inserters (400 W per unit).&lt;br /&gt;
To that we add a generous 100 accumulators and observe the energy in the system.&lt;br /&gt;
&amp;lt;tabber&amp;gt;&lt;br /&gt;
41.9 kW grid = [[File:Solar_panel_with_load_41point9kW.png|1200px]]&lt;br /&gt;
\-\&lt;br /&gt;
42 kW grid = [[File:Solar_panel_with_load_42kW.png|1200px]]&lt;br /&gt;
\-\&lt;br /&gt;
42 kW grid (zoomed in) = [[File:Solar_panel_with_load_42kW_zoom.png|1200px]]&lt;br /&gt;
&amp;lt;/tabber&amp;gt;&lt;br /&gt;
Experimental values for the 41.9 kW grid show the first peak has a height of about 4.24 MJ, with each consecutive peak growing higher as the true output of a solar panel is indeed more than 41.9 kW.&amp;lt;br&amp;gt;&lt;br /&gt;
Experimental values for the 42 kW grid show each peak reaching about 4.24 MJ, but falling short for 5 seconds.&lt;br /&gt;
&lt;br /&gt;
4.24 MJ is enough to fill 0.848 accumulators as they can hold a charge of 5 MJ each. Conservatively we can therefore set 0.85 accumulators per solar panel, or a ratio of 20 solar panels to 17 accumulators. A less conservative approach is to use 0.84 accumulators per solar panel, or a ratio of 25 solar panels to 21 accumulators.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;toccolours mw-collapsible mw-collapsed&amp;quot;&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;Analytic solution&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible-content&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We can set the previously defined power function as the rate of change of the accumulator and subtract it&#039;s average output as the load which the setup should be able to continuously supply. First we check when the power reaches 42 kW&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\begin{align}&lt;br /&gt;
42 &amp;amp;= \frac{60}{84} \cdot t_\text{start}\\&lt;br /&gt;
t_\text{start} &amp;amp;= \frac{3528}{60}&lt;br /&gt;
\end{align}&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Then we shift the function for power in time and reduce it by the 42 kW so that the function will start at zero.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\begin{align}&lt;br /&gt;
\dot{A}(t) &amp;amp;= P(t-\tfrac{3528}{60})-\hat{P} =&lt;br /&gt;
\begin{cases}&lt;br /&gt;
\frac{60\,\mathrm{kW}}{84\,\mathrm{s}} \cdot t&lt;br /&gt;
&amp;amp; 0 \, \mathrm{s} \leq  t &amp;lt;  \frac{1\,512}{60} \, \mathrm{s}&lt;br /&gt;
\\&lt;br /&gt;
60 \,\mathrm{kW} - 42\,\mathrm{kW}&lt;br /&gt;
&amp;amp; \frac{1\,512}{60} \, \mathrm{s} &amp;lt; t \leq \frac{14\,112}{60} \, \mathrm{s}&lt;br /&gt;
\\&lt;br /&gt;
60 \,\mathrm{kW} - \frac{60\,\mathrm{kW}}{84\,\mathrm{s}}\cdot\left(t-\frac{14\,112}{60}\,\mathrm{s}\right)-42\,\mathrm{kW}&lt;br /&gt;
&amp;amp; \frac{14\,112}{60} \, \mathrm{s} &amp;lt; t \leq \frac{19\,152}{60} \, \mathrm{s}&lt;br /&gt;
\\&lt;br /&gt;
- 42\,\mathrm{kW}&lt;br /&gt;
&amp;amp; \frac{19\,152}{60} \, \mathrm{s} &amp;lt; t \leq \frac{21\,680}{60} \, \mathrm{s}&lt;br /&gt;
\\&lt;br /&gt;
\frac{60\,\mathrm{kW}}{84\,\mathrm{s}} \cdot ( t - \frac{21\,672}{60} \, \mathrm{s} ) - 42\,\mathrm{kW}&lt;br /&gt;
&amp;amp; \frac{21\,672}{60} \, \mathrm{s} &amp;lt; t \leq \frac{25\,200}{60} \, \mathrm{s}&lt;br /&gt;
\end{cases}\\&lt;br /&gt;
A(T=420\,\mathrm{s}) &amp;amp;= \int_{0}^{T} \dot{A}(t) \, \mathrm{d}t = 0 \, \mathrm{J}&lt;br /&gt;
\end{align}&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To find the critical point in time &amp;lt;math&amp;gt;t_\text{crit}&amp;lt;/math&amp;gt; at which the accumulator charge reaches it&#039;s peak &amp;lt;math&amp;gt;\hat{A} = A(t_\text{crit})&amp;lt;/math&amp;gt;, we need to see when it&#039;s derivative passes zero. This happens in it&#039;s 3rd section.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\begin{align}&lt;br /&gt;
\dot{A}(t_\text{crit}) = 0 &amp;amp;= 60 \,\mathrm{kW} - \frac{60\,\mathrm{kW}}{84\,\mathrm{s}}\cdot\left(t_\text{crit}-\frac{14\,112}{60}\,\mathrm{s}\right)-42\,\mathrm{kW}\\&lt;br /&gt;
t_\text{crit} &amp;amp;= \frac{(60\,\mathrm{kW} - 42\,\mathrm{kW})}{\frac{60\,\mathrm{kW}}{84\,\mathrm{s}}} + \frac{14\,112}{60}\,\mathrm{s}  = \frac{15\,624}{60}\,\mathrm{s} = 260.4 \, \mathrm{s}\\&lt;br /&gt;
\end{align}&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\begin{array}{rcccccc}&lt;br /&gt;
A(t_\text{crit}) = \displaystyle\int_0^{t_\text{crit}} \dot{A}(t) \, \mathrm{d}t &lt;br /&gt;
 &amp;amp;=&amp;amp; &lt;br /&gt;
   \displaystyle\int_{0\, \mathrm{s}}^{\frac{1\,512}{60}\, \mathrm{s}}  \frac{60\,\mathrm{kW}}{84\,\mathrm{s}} \cdot t \, \mathrm{d}t &lt;br /&gt;
   &amp;amp;+&amp;amp;&lt;br /&gt;
   \displaystyle\int_{\frac{1\,512}{60}\, \mathrm{s}}^{\frac{14\,112}{60}\, \mathrm{s}} 60 \,\mathrm{kW} - 42\,\mathrm{kW} \, \mathrm{d}t&lt;br /&gt;
   &amp;amp;+&amp;amp;&lt;br /&gt;
   \displaystyle\int_{\frac{14\,112}{60}\, \mathrm{s}}^{\frac{15\,624}{60}\, \mathrm{s}} 60 \,\mathrm{kW} - \frac{60\,\mathrm{kW}}{84\,\mathrm{s}}\cdot\left(t-\frac{14\,112}{60}\,\mathrm{s}\right)-42\,\mathrm{kW} \, \mathrm{d}t&lt;br /&gt;
 \\&lt;br /&gt;
 &amp;amp;=&amp;amp; &lt;br /&gt;
   \frac{60\, \mathrm{kW}}{84\, \mathrm{s}}\cdot\frac{1}{2}\cdot\left(\frac{1\,512}{60}\, \mathrm{s}\right)^{2}&lt;br /&gt;
   &amp;amp;+&amp;amp; &lt;br /&gt;
   \left(60\, \mathrm{kW}-42\, \mathrm{kW}\right)\cdot\left(\frac{14\,112}{60}\, \mathrm{s}-\frac{1\,512}{60}\, \mathrm{s}\right)&lt;br /&gt;
   &amp;amp;+&amp;amp; &lt;br /&gt;
   \left(60\, \mathrm{kW}-42\, \mathrm{kW}\right)\cdot\left(\frac{15\,624}{60}\, \mathrm{s}-\frac{14\,112}{60}\, \mathrm{s}\right)-\frac{60\, \mathrm{kW}}{84\, \mathrm{s}}\cdot\frac{1}{2}\cdot\left(\frac{15\,624}{60}\, \mathrm{s}-\frac{14\,112}{60}\, \mathrm{s}\right)^{2}&lt;br /&gt;
 \\&lt;br /&gt;
 &amp;amp;=&amp;amp;&lt;br /&gt;
   \frac{1\,134}{5} \, \mathrm{kJ}&lt;br /&gt;
 &amp;amp;+&amp;amp;&lt;br /&gt;
   3\,780 \, \mathrm{kJ}&lt;br /&gt;
 &amp;amp;+&amp;amp;&lt;br /&gt;
   \frac{1\,134}{5} \, \mathrm{kJ}\\&lt;br /&gt;
 &amp;amp;=&amp;amp; \frac{21\,168}{5} \, \mathrm{kJ}\\&lt;br /&gt;
 &amp;amp;=&amp;amp; 4\,233.6 \, \mathrm{kJ}&lt;br /&gt;
\end{array}&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The true perfect ratio for solar panels to accumulators therefore turns out to be...&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{\tfrac{21\,168}{5} \mathrm{kJ}}{5\,000 \, \mathrm{kJ}} = \frac{2\,646}{3\,125} = 0.846\,72&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
It takes 0.84672 accumulators per solar panel, or a ratio of 2646 accumulators to 3125 solar panels. Speaking conservatively we can take a higher ratio of 0.85 with 17 accumulators to 20 solar panels&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;/div&gt;</summary>
		<author><name>Untitled7</name></author>
	</entry>
	<entry>
		<id>https://wiki.factorio.com/index.php?title=Tutorial:Solar_power_math&amp;diff=206418</id>
		<title>Tutorial:Solar power math</title>
		<link rel="alternate" type="text/html" href="https://wiki.factorio.com/index.php?title=Tutorial:Solar_power_math&amp;diff=206418"/>
		<updated>2024-11-15T22:51:58Z</updated>

		<summary type="html">&lt;p&gt;Untitled7: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;In this tutorial we will properly quantify the amount of [[solar panel]]s and [[accumulator]]s needed and the proper ratio that is needed between the two buildings.&lt;br /&gt;
&lt;br /&gt;
== Equation symbols and units ==&lt;br /&gt;
The game uses SI units and reflects how they are used in the real world. &#039;&#039;&#039;Energy&#039;&#039;&#039; &amp;lt;math&amp;gt;E&amp;lt;/math&amp;gt; and &#039;&#039;&#039;power&#039;&#039;&#039; &amp;lt;math&amp;gt;P&amp;lt;/math&amp;gt; are often used interchangeably, but power is the first time derivative of energy, i.e. how much energy is used or produced per second. Power can be used to get machines moving, as they perform &#039;&#039;&#039;work&#039;&#039;&#039; &amp;lt;math&amp;gt;W&amp;lt;/math&amp;gt;. A type of work can be lifting some mass against gravitational acceleration for a set distance. Usually there is always a loss of usable energy due to thermal energy being released, but Factorio does not take such losses into consideration. Lastly there is the charge in accumulators. Charge traditionally has the unit Coulomb and the energy in a capacitor depends on the charge and the voltage across it, but as Factorio also doesn&#039;t consider equipment using different voltages, a the charge &amp;lt;math&amp;gt;A&amp;lt;/math&amp;gt; of a factorio-accumulator can be defined to use this combined value.&lt;br /&gt;
&lt;br /&gt;
Therefore the important equation symbols for energy are as follows:&lt;br /&gt;
* &amp;lt;math&amp;gt;E&amp;lt;/math&amp;gt; ... energy, in &amp;lt;math&amp;gt;\mathrm{J}&amp;lt;/math&amp;gt; Joule, also often written in &amp;lt;math&amp;gt;\mathrm{kW} \, \mathrm{h}&amp;lt;/math&amp;gt; kilowatt-hours, where &amp;lt;math&amp;gt;1 \, \mathrm{kW} \, \mathrm{h} = 3\,600\,000 \mathrm{J} = 3.6 \, \mathrm{MJ}&amp;lt;/math&amp;gt;.&lt;br /&gt;
* &amp;lt;math&amp;gt;W&amp;lt;/math&amp;gt; ... performed work, in &amp;lt;math&amp;gt;\mathrm{kg} \, \tfrac{\mathrm{m}}{\mathrm{s}^2} \, \mathrm{m}&amp;lt;/math&amp;gt; or &amp;lt;math&amp;gt;\mathrm{N}\, \mathrm{m}&amp;lt;/math&amp;gt; Newton-meter which is equal to &amp;lt;math&amp;gt;\mathrm{J}&amp;lt;/math&amp;gt; Joule&lt;br /&gt;
* &amp;lt;math&amp;gt;A := \tfrac{1}{2} Q \cdot U^2&amp;lt;/math&amp;gt; ... accumulator charge, in &amp;lt;math&amp;gt;\mathrm{J}&amp;lt;/math&amp;gt; Joule&lt;br /&gt;
&lt;br /&gt;
And the important equation symbols for power are as follows, with dot-notation for the time derivative:&lt;br /&gt;
* &amp;lt;math&amp;gt;P_\text{S} := \tfrac{\mathrm{d}}{\mathrm{d} t} E = \dot{E}&amp;lt;/math&amp;gt; ... supplied power, in &amp;lt;math&amp;gt;\mathrm{W}&amp;lt;/math&amp;gt; Watt, or &amp;lt;math&amp;gt;\tfrac{\mathrm{J}}{\mathrm{s}}&amp;lt;/math&amp;gt; Joule per second.&lt;br /&gt;
* &amp;lt;math&amp;gt;\dot{W} := \tfrac{\mathrm{d} W}{\mathrm{d} t}&amp;lt;/math&amp;gt; ... ongoing mechanical work, in &amp;lt;math&amp;gt;\mathrm{W}&amp;lt;/math&amp;gt; Watt&lt;br /&gt;
* &amp;lt;math&amp;gt;\dot{A} := \tfrac{\mathrm{d} A}{\mathrm{d} t}&amp;lt;/math&amp;gt; ... change in accumulator charge, in &amp;lt;math&amp;gt;\mathrm{W}&amp;lt;/math&amp;gt; Watt&lt;br /&gt;
&lt;br /&gt;
Energy can&#039;t be generated or destroyed, only converted into a different form. This means that the balance of energy must be upheld, and therefore its rate of change must be zero. If we subtract from the supplied power both the ongoing mechanical work and the rate at which accumulators are charging (therefore taking energy from the grid), the result will be zero. As such we can write&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;P_\text{S} - \dot{W} - \dot{A} = 0&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
The player will not have to worry about overproduction, as any power generating equipment will cap its output automatically. Only too little production will no longer provide machines with the amount of power that they desire, causing them to throttle their own power demand and working slower. Therefore in almost all cases these rates will change over time, where solar panels produce energy dependant on the time of day, while machines equally draw more or less power depending on how much they are used. For example, inserters only draw their power when they swing their arms, while only using a tiny fraction of it on standby. As such we introduce notation for various statistically relevant values.&lt;br /&gt;
&lt;br /&gt;
* Average value over an interval &amp;lt;math&amp;gt;T&amp;lt;/math&amp;gt; is annotated with a bar above: &amp;lt;math&amp;gt;\bar{x} = \frac{1}{T} \int_{t}^{t+T} x(t) \mathrm{d}t&amp;lt;/math&amp;gt;&lt;br /&gt;
* Peak value with an upward facing chevron: &amp;lt;math&amp;gt;\hat{x} = \mathrm{max}\big( x(t) \big) &amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;!--* Idle value with a downward facing chevron: &amp;lt;math&amp;gt;\check{x} = \mathrm{min}\big( x(t) \big) &amp;lt;/math&amp;gt;--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Average output of 1 solar panel ==&lt;br /&gt;
&lt;br /&gt;
While only the peak output of a solar panel can be easily be told at &amp;lt;math&amp;gt;\hat{P} = 60 \, \mathrm{kW}&amp;lt;/math&amp;gt;, its exact power output over the day changes with available daylight. Thankfully, if we install some accumulators, they can do the integration for us.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\begin{align}&lt;br /&gt;
0 &amp;amp;= P(t) - \dot{A}(t)\\&lt;br /&gt;
\dot{A}(t) &amp;amp;= P(t)\\&lt;br /&gt;
A(T) &amp;amp;= \int_0^T P(t) \, \mathrm{d}t\\&lt;br /&gt;
\end{align}&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In an experiment with one solar panel and 4 accumulators, we can see that one solar panel will produce 17.6 MJ of energy per day.&lt;br /&gt;
&lt;br /&gt;
[[File:Solar_panel_energy.png|1200px]]&lt;br /&gt;
&lt;br /&gt;
Due to rounding, this could be anywhere between 17.55 MJ and 17.65 MJ, therefore the experiment can be repeated over multiple days.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! day number || accumulator charge || energy produced per day&lt;br /&gt;
|-&lt;br /&gt;
| 1 || 17.6 MJ || 17.6 MJ&lt;br /&gt;
|-&lt;br /&gt;
| 2 || 35.3 MJ || 17.65 MJ&lt;br /&gt;
|-&lt;br /&gt;
| 3 || 52.9 MJ || 17.633 MJ&lt;br /&gt;
|-&lt;br /&gt;
| 4 || 70.6 MJ || 17.65 MJ&lt;br /&gt;
|-&lt;br /&gt;
| 5 || 88.2 MJ || 17.64 MJ&lt;br /&gt;
|-&lt;br /&gt;
| 6 || 106 MJ || 17.666 MJ&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Further experiments show that the true number will swing around and approach 17.64 MJ&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\begin{align}&lt;br /&gt;
A(T) &amp;amp;= 17\,640 \, \mathrm{kJ}\\&lt;br /&gt;
\bar{P} &lt;br /&gt;
 &amp;amp;= \frac{\int_{0}^{T} P(t) \, \mathrm{d}t}{T} &lt;br /&gt;
  = \frac{A(T)}{T}&lt;br /&gt;
  = \frac{17\,640 \, \mathrm{kJ}}{420 \, \mathrm{s}}&lt;br /&gt;
  \approx 42 \, \mathrm{kW}&lt;br /&gt;
\end{align}&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
A day on Nauvis lasts 7 minutes, or &amp;lt;math&amp;gt; T = 420 \, \mathrm{s}&amp;lt;/math&amp;gt;, which means that each solar panel provides about 42 kW of power on average.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;toccolours mw-collapsible mw-collapsed&amp;quot;&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;Solarpanel output as a function&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible-content&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For further calculations we assume the power output function of a solar panel looks as follows:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\begin{align}&lt;br /&gt;
P(t) &amp;amp;=&lt;br /&gt;
\begin{cases}&lt;br /&gt;
\tfrac{60}{84} t&lt;br /&gt;
&amp;amp; 0 \, \mathrm{s} \leq  t &amp;lt;  \frac{5\,040}{60} \, \mathrm{s}&lt;br /&gt;
\\&lt;br /&gt;
60 &lt;br /&gt;
&amp;amp; \frac{5\,040}{60} \, \mathrm{s} &amp;lt; t \leq \frac{17\,640}{60} \, \mathrm{s}&lt;br /&gt;
\\&lt;br /&gt;
60 - \tfrac{60}{84} \cdot ( t - \frac{17\,640}{60} \, \mathrm{s})&lt;br /&gt;
&amp;amp; \frac{17\,640}{60} \, \mathrm{s} &amp;lt; t \leq \frac{22\,680}{60} \, \mathrm{s}&lt;br /&gt;
\\&lt;br /&gt;
0 &amp;amp; \frac{22\,680}{60} \, \mathrm{s} &amp;lt; t \leq \frac{25\,200}{60} \, \mathrm{s}&lt;br /&gt;
\end{cases}\\&lt;br /&gt;
\int_{0}^{T} P(t) \, \mathrm{d}t &amp;amp;= 17\,640 \, \mathrm{kJ}&lt;br /&gt;
\end{align}&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Accumulators per solar panel ==&lt;br /&gt;
&lt;br /&gt;
Knowing how much power a solar panel provides on average we can construct a fitting load to test how much max accumulator charge &amp;lt;math&amp;gt;\hat{A}&amp;lt;/math&amp;gt; is needed.&lt;br /&gt;
&lt;br /&gt;
In a second experiment we take two solar panels on separate grids and put a load of &amp;lt;math&amp;gt;\tfrac{17\,600 \, \mathrm{kJ}}{420 \, \mathrm{s}} \approx 41.9 \, \mathrm{kW}&amp;lt;/math&amp;gt; on one, and one with &amp;lt;math&amp;gt;\tfrac{17\,640 \, \mathrm{kJ}}{420 \, \mathrm{s}} = 42 \, \mathrm{kW}&amp;lt;/math&amp;gt;, which can be achieved with...&lt;br /&gt;
* 8 Assembly machines 2 (5 kW per unit), and&lt;br /&gt;
* 3/4 fast inserters (500 W per unit), and&lt;br /&gt;
* 1/0 regular inserters (400 W per unit).&lt;br /&gt;
To that we add a generous 100 accumulators and observe the energy in the system.&lt;br /&gt;
&amp;lt;tabber&amp;gt;&lt;br /&gt;
41.9 kW grid = [[File:Solar_panel_with_load_41point9kW.png|1200px]]&lt;br /&gt;
\-\&lt;br /&gt;
42 kW grid = [[File:Solar_panel_with_load_42kW.png|1200px]]&lt;br /&gt;
\-\&lt;br /&gt;
42 kW grid (zoomed in) = [[File:Solar_panel_with_load_42kW_zoom.png|1200px]]&lt;br /&gt;
&amp;lt;/tabber&amp;gt;&lt;br /&gt;
Experimental values for the 41.9 kW grid show the first peak has a height of about 4.24 MJ, with each consecutive peak growing higher as the true output of a solar panel is indeed more than 41.9 kW.&amp;lt;br&amp;gt;&lt;br /&gt;
Experimental values for the 42 kW grid show each peak reaching about 4.24 MJ, but falling short for 5 seconds.&lt;br /&gt;
&lt;br /&gt;
4.24 MJ is enough to fill 0.848 accumulators as they can hold a charge of 5 MJ each. Conservatively we can therefore set 0.85 accumulators per solar panel, or a ratio of 20 solar panels to 17 accumulators. A less conservative approach is to use 0.84 accumulators per solar panel, or a ratio of 25 solar panels to 21 accumulators.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;toccolours mw-collapsible mw-collapsed&amp;quot;&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;Analytic solution&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible-content&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We can set the previously defined power function as the rate of change of the accumulator and subtract it&#039;s average output as the load which the setup should be able to continuously supply. First we check when the power reaches 42 kW&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\begin{align}&lt;br /&gt;
42 &amp;amp;= \frac{60}{84} \cdot t_\text{start}\\&lt;br /&gt;
t_\text{start} = \frac{3528}{60}&lt;br /&gt;
\end{align}&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Then we shift the function for power in time and reduce it by the 42 kW so that the function will start at zero.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\begin{align}&lt;br /&gt;
\dot{A}(t) &amp;amp;= P(t-\tfrac{3528}{60})-\hat{P} =&lt;br /&gt;
\begin{cases}&lt;br /&gt;
\frac{60\,\mathrm{kW}}{84\,\mathrm{s}} \cdot t&lt;br /&gt;
&amp;amp; 0 \, \mathrm{s} \leq  t &amp;lt;  \frac{1\,512}{60} \, \mathrm{s}&lt;br /&gt;
\\&lt;br /&gt;
60 \,\mathrm{kW} - 42\,\mathrm{kW}&lt;br /&gt;
&amp;amp; \frac{1\,512}{60} \, \mathrm{s} &amp;lt; t \leq \frac{14\,112}{60} \, \mathrm{s}&lt;br /&gt;
\\&lt;br /&gt;
60 \,\mathrm{kW} - \frac{60\,\mathrm{kW}}{84\,\mathrm{s}}\cdot\left(t-\frac{14\,112}{60}\,\mathrm{s}\right)-42\,\mathrm{kW}&lt;br /&gt;
&amp;amp; \frac{14\,112}{60} \, \mathrm{s} &amp;lt; t \leq \frac{19\,152}{60} \, \mathrm{s}&lt;br /&gt;
\\&lt;br /&gt;
- 42\,\mathrm{kW}&lt;br /&gt;
&amp;amp; \frac{19\,152}{60} \, \mathrm{s} &amp;lt; t \leq \frac{21\,680}{60} \, \mathrm{s}&lt;br /&gt;
\\&lt;br /&gt;
\frac{60\,\mathrm{kW}}{84\,\mathrm{s}} \cdot ( t - \frac{21\,672}{60} \, \mathrm{s} ) - 42\,\mathrm{kW}&lt;br /&gt;
&amp;amp; \frac{21\,672}{60} \, \mathrm{s} &amp;lt; t \leq \frac{25\,200}{60} \, \mathrm{s}&lt;br /&gt;
\end{cases}\\&lt;br /&gt;
A(T=420\,\mathrm{s}) &amp;amp;= \int_{0}^{T} \dot{A}(t) \, \mathrm{d}t = 0 \, \mathrm{J}&lt;br /&gt;
\end{align}&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To find the critical point in time &amp;lt;math&amp;gt;t_\text{crit}&amp;lt;/math&amp;gt; at which the accumulator charge reaches it&#039;s peak &amp;lt;math&amp;gt;\hat{A} = A(t_\text{crit})&amp;lt;/math&amp;gt;, we need to see when it&#039;s derivative passes zero. This happens in it&#039;s 3rd section.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\begin{align}&lt;br /&gt;
\dot{A}(t_\text{crit}) = 0 &amp;amp;= 60 \,\mathrm{kW} - \frac{60\,\mathrm{kW}}{84\,\mathrm{s}}\cdot\left(t_\text{crit}-\frac{14\,112}{60}\,\mathrm{s}\right)-42\,\mathrm{kW}\\&lt;br /&gt;
t_\text{crit} &amp;amp;= \frac{(60\,\mathrm{kW} - 42\,\mathrm{kW})}{\frac{60\,\mathrm{kW}}{84\,\mathrm{s}}} + \frac{14\,112}{60}\,\mathrm{s}  = \frac{15\,624}{60}\,\mathrm{s} = 260.4 \, \mathrm{s}\\&lt;br /&gt;
\end{align}&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\begin{array}{rcccccc}&lt;br /&gt;
A(t_\text{crit}) = \displaystyle\int_0^{t_\text{crit}} \dot{A}(t) \, \mathrm{d}t &lt;br /&gt;
 &amp;amp;=&amp;amp; &lt;br /&gt;
   \displaystyle\int_{0\, \mathrm{s}}^{\frac{1\,512}{60}\, \mathrm{s}}  \frac{60\,\mathrm{kW}}{84\,\mathrm{s}} \cdot t \, \mathrm{d}t &lt;br /&gt;
   &amp;amp;+&amp;amp;&lt;br /&gt;
   \displaystyle\int_{\frac{1\,512}{60}\, \mathrm{s}}^{\frac{14\,112}{60}\, \mathrm{s}} 60 \,\mathrm{kW} - 42\,\mathrm{kW} \, \mathrm{d}t&lt;br /&gt;
   &amp;amp;+&amp;amp;&lt;br /&gt;
   \displaystyle\int_{\frac{14\,112}{60}\, \mathrm{s}}^{\frac{15\,624}{60}\, \mathrm{s}} 60 \,\mathrm{kW} - \frac{60\,\mathrm{kW}}{84\,\mathrm{s}}\cdot\left(t-\frac{14\,112}{60}\,\mathrm{s}\right)-42\,\mathrm{kW} \, \mathrm{d}t&lt;br /&gt;
 \\&lt;br /&gt;
 &amp;amp;=&amp;amp; &lt;br /&gt;
   \frac{60\, \mathrm{kW}}{84\, \mathrm{s}}\cdot\frac{1}{2}\cdot\left(\frac{1\,512}{60}\, \mathrm{s}\right)^{2}&lt;br /&gt;
   &amp;amp;+&amp;amp; &lt;br /&gt;
   \left(60\, \mathrm{kW}-42\, \mathrm{kW}\right)\cdot\left(\frac{14\,112}{60}\, \mathrm{s}-\frac{1\,512}{60}\, \mathrm{s}\right)&lt;br /&gt;
   &amp;amp;+&amp;amp; &lt;br /&gt;
   \left(60\, \mathrm{kW}-42\, \mathrm{kW}\right)\cdot\left(\frac{15\,624}{60}\, \mathrm{s}-\frac{14\,112}{60}\, \mathrm{s}\right)-\frac{60\, \mathrm{kW}}{84\, \mathrm{s}}\cdot\frac{1}{2}\cdot\left(\frac{15\,624}{60}\, \mathrm{s}-\frac{14\,112}{60}\, \mathrm{s}\right)^{2}&lt;br /&gt;
 \\&lt;br /&gt;
 &amp;amp;=&amp;amp;&lt;br /&gt;
   \frac{1\,134}{5} \, \mathrm{kJ}&lt;br /&gt;
 &amp;amp;+&amp;amp;&lt;br /&gt;
   3\,780 \, \mathrm{kJ}&lt;br /&gt;
 &amp;amp;+&amp;amp;&lt;br /&gt;
   \frac{1\,134}{5} \, \mathrm{kJ}\\&lt;br /&gt;
 &amp;amp;=&amp;amp; \frac{21\,168}{5} \, \mathrm{kJ}\\&lt;br /&gt;
 &amp;amp;=&amp;amp; 4\,233.6 \, \mathrm{kJ}&lt;br /&gt;
\end{array}&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The true perfect ratio for solar panels to accumulators therefore turns out to be...&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{\tfrac{21\,168}{5} \mathrm{kJ}}{5\,000 \, \mathrm{kJ}} = \frac{2\,646}{3\,125} = 0.846\,72&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
It takes 0.84672 accumulators per solar panel, or a ratio of 2646 accumulators to 3125 solar panels. Speaking conservatively we can take a higher ratio of 0.85 with 17 accumulators to 20 solar panels&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;/div&gt;</summary>
		<author><name>Untitled7</name></author>
	</entry>
	<entry>
		<id>https://wiki.factorio.com/index.php?title=File:Solar_panel_with_load_42kW_zoom.png&amp;diff=206415</id>
		<title>File:Solar panel with load 42kW zoom.png</title>
		<link rel="alternate" type="text/html" href="https://wiki.factorio.com/index.php?title=File:Solar_panel_with_load_42kW_zoom.png&amp;diff=206415"/>
		<updated>2024-11-15T22:27:19Z</updated>

		<summary type="html">&lt;p&gt;Untitled7: {{Screenshot}}&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Summary ==&lt;br /&gt;
{{Screenshot}}&lt;/div&gt;</summary>
		<author><name>Untitled7</name></author>
	</entry>
	<entry>
		<id>https://wiki.factorio.com/index.php?title=File:Solar_panel_with_load_42kW.png&amp;diff=206414</id>
		<title>File:Solar panel with load 42kW.png</title>
		<link rel="alternate" type="text/html" href="https://wiki.factorio.com/index.php?title=File:Solar_panel_with_load_42kW.png&amp;diff=206414"/>
		<updated>2024-11-15T22:10:44Z</updated>

		<summary type="html">&lt;p&gt;Untitled7: {{Screenshot}}&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Summary ==&lt;br /&gt;
{{Screenshot}}&lt;/div&gt;</summary>
		<author><name>Untitled7</name></author>
	</entry>
	<entry>
		<id>https://wiki.factorio.com/index.php?title=Tutorial:Solar_power_math&amp;diff=206238</id>
		<title>Tutorial:Solar power math</title>
		<link rel="alternate" type="text/html" href="https://wiki.factorio.com/index.php?title=Tutorial:Solar_power_math&amp;diff=206238"/>
		<updated>2024-11-13T22:02:42Z</updated>

		<summary type="html">&lt;p&gt;Untitled7: Created page with &amp;quot;In this tutorial we will properly quantify the amount of solar panels and accumulators needed and the proper ratio that is needed between the two buildings.  == Equation symbols and units == The game uses SI units and reflects how they are used in the real world. &amp;#039;&amp;#039;&amp;#039;Energy&amp;#039;&amp;#039;&amp;#039; &amp;lt;math&amp;gt;E&amp;lt;/math&amp;gt; and &amp;#039;&amp;#039;&amp;#039;power&amp;#039;&amp;#039;&amp;#039; &amp;lt;math&amp;gt;P&amp;lt;/math&amp;gt; are often used interchangeably, but power is the first time derivative of energy, i.e. how much energy is used or produced per second. Power can...&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;In this tutorial we will properly quantify the amount of [[solar panel]]s and [[accumulator]]s needed and the proper ratio that is needed between the two buildings.&lt;br /&gt;
&lt;br /&gt;
== Equation symbols and units ==&lt;br /&gt;
The game uses SI units and reflects how they are used in the real world. &#039;&#039;&#039;Energy&#039;&#039;&#039; &amp;lt;math&amp;gt;E&amp;lt;/math&amp;gt; and &#039;&#039;&#039;power&#039;&#039;&#039; &amp;lt;math&amp;gt;P&amp;lt;/math&amp;gt; are often used interchangeably, but power is the first time derivative of energy, i.e. how much energy is used or produced per second. Power can be used to get machines moving, as they perform &#039;&#039;&#039;work&#039;&#039;&#039; &amp;lt;math&amp;gt;W&amp;lt;/math&amp;gt;. A type of work can be lifting some mass against gravitational acceleration for a set distance. Usually there is always a loss of usable energy due to thermal energy being released, but Factorio does not take such losses into consideration. Lastly there is the charge in accumulators. Charge traditionally has the unit Coulomb and the energy in a capacitor depends on the charge and the voltage across it, but as Factorio also doesn&#039;t consider equipment using different voltages, a the charge &amp;lt;math&amp;gt;A&amp;lt;/math&amp;gt; of a factorio-accumulator can be defined to use this combined value.&lt;br /&gt;
&lt;br /&gt;
Therefore the important equation symbols for energy are as follows:&lt;br /&gt;
* &amp;lt;math&amp;gt;E&amp;lt;/math&amp;gt; ... energy, in &amp;lt;math&amp;gt;\mathrm{J}&amp;lt;/math&amp;gt; Joule, also often written in &amp;lt;math&amp;gt;\mathrm{kW} \, \mathrm{h}&amp;lt;/math&amp;gt; kilowatt-hours, where &amp;lt;math&amp;gt;1 \, \mathrm{kW} \, \mathrm{h} = 3\,600\,000 \mathrm{J} = 3.6 \, \mathrm{MJ}&amp;lt;/math&amp;gt;.&lt;br /&gt;
* &amp;lt;math&amp;gt;W&amp;lt;/math&amp;gt; ... performed work, in &amp;lt;math&amp;gt;\mathrm{kg} \, \tfrac{\mathrm{m}}{\mathrm{s}^2} \, \mathrm{m}&amp;lt;/math&amp;gt; or &amp;lt;math&amp;gt;\mathrm{N}\, \mathrm{m}&amp;lt;/math&amp;gt; Newton-meter which is equal to &amp;lt;math&amp;gt;\mathrm{J}&amp;lt;/math&amp;gt; Joule&lt;br /&gt;
* &amp;lt;math&amp;gt;A := \tfrac{1}{2} Q \cdot U^2&amp;lt;/math&amp;gt; ... accumulator charge, in &amp;lt;math&amp;gt;\mathrm{J}&amp;lt;/math&amp;gt; Joule&lt;br /&gt;
&lt;br /&gt;
And the important equation symbols for power are as follows, with dot-notation for the time derivative:&lt;br /&gt;
* &amp;lt;math&amp;gt;P_\text{S} := \tfrac{\mathrm{d}}{\mathrm{d} t} E = \dot{E}&amp;lt;/math&amp;gt; ... supplied power, in &amp;lt;math&amp;gt;\mathrm{W}&amp;lt;/math&amp;gt; Watt, or &amp;lt;math&amp;gt;\tfrac{\mathrm{J}}{\mathrm{s}}&amp;lt;/math&amp;gt; Joule per second.&lt;br /&gt;
* &amp;lt;math&amp;gt;\dot{W} := \tfrac{\mathrm{d} W}{\mathrm{d} t}&amp;lt;/math&amp;gt; ... ongoing mechanical work, in &amp;lt;math&amp;gt;\mathrm{W}&amp;lt;/math&amp;gt; Watt&lt;br /&gt;
* &amp;lt;math&amp;gt;\dot{A} := \tfrac{\mathrm{d} A}{\mathrm{d} t}&amp;lt;/math&amp;gt; ... change in accumulator charge, in &amp;lt;math&amp;gt;\mathrm{W}&amp;lt;/math&amp;gt; Watt&lt;br /&gt;
&lt;br /&gt;
Energy can&#039;t be generated or destroyed, only converted into a different form. This means that the balance of energy must be upheld, and therefore its rate of change must be zero. If we subtract from the supplied power both the ongoing mechanical work and the rate at which accumulators are charging (therefore taking energy from the grid), the result will be zero. As such we can write&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;P_\text{S} - \dot{W} - \dot{A} = 0&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
The player will not have to worry about overproduction, as any power generating equipment will cap its output automatically. Only too little production will no longer provide machines with the amount of power that they desire, causing them to throttle their own power demand and working slower. Therefore in almost all cases these rates will change over time, where solar panels produce energy dependant on the time of day, while machines equally draw more or less power depending on how much they are used. For example, inserters only draw their power when they swing their arms, while only using a tiny fraction of it on standby. As such we introduce notation for various statistically relevant values.&lt;br /&gt;
&lt;br /&gt;
* Average value over an interval &amp;lt;math&amp;gt;T&amp;lt;/math&amp;gt; is annotated with a bar above: &amp;lt;math&amp;gt;\bar{x} = \frac{1}{T} \int_{t}^{t+T} x(t) \mathrm{d}t&amp;lt;/math&amp;gt;&lt;br /&gt;
* Peak value with an upward facing chevron: &amp;lt;math&amp;gt;\hat{x} = \mathrm{max}\big( x(t) \big) &amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;!--* Idle value with a downward facing chevron: &amp;lt;math&amp;gt;\check{x} = \mathrm{min}\big( x(t) \big) &amp;lt;/math&amp;gt;--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Average output of 1 solar panel ==&lt;br /&gt;
&lt;br /&gt;
While only the peak output of a solar panel can be easily be told at &amp;lt;math&amp;gt;\hat{P} = 60 \, \mathrm{kW}&amp;lt;/math&amp;gt;, its exact power output over the day changes with available daylight. Thankfully, if we install some accumulators, they can do the integration for us.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\begin{align}&lt;br /&gt;
0 &amp;amp;= P(t) - \dot{A}(t)\\&lt;br /&gt;
\dot{A}(t) &amp;amp;= P(t)\\&lt;br /&gt;
A(T) &amp;amp;= \int_0^T P(t) \, \mathrm{d}t\\&lt;br /&gt;
\end{align}&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In an experiment with one solar panel and 4 accumulators, we can see that one solar panel will produce 17.6 MJ of energy per day.&lt;br /&gt;
&lt;br /&gt;
[[File:Solar_panel_energy.png|1200px]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\begin{align}&lt;br /&gt;
A(T) &amp;amp;= 17\,600 \, \mathrm{kJ}\\&lt;br /&gt;
\bar{P} &lt;br /&gt;
 &amp;amp;= \frac{\int_{0}^{T} P(t) \, \mathrm{d}t}{T} &lt;br /&gt;
  = \frac{A(T)}{T}&lt;br /&gt;
  = \frac{17\,600 \, \mathrm{kJ}}{420 \, \mathrm{s}}&lt;br /&gt;
  = \frac{880}{21} \, \mathrm{kW}&lt;br /&gt;
  \approx 41.9 \, \mathrm{kW}&lt;br /&gt;
\end{align}&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
A day on Nauvis lasts 7 minutes, or &amp;lt;math&amp;gt; T = 420 \, \mathrm{s}&amp;lt;/math&amp;gt;, which means that each solar panel averages about 41.9 kW of power.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;toccolours mw-collapsible mw-collapsed&amp;quot;&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;Solarpanel output as a function&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible-content&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For further calculations we assume the power output function of a solar panel looks as follows:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\begin{align}&lt;br /&gt;
P(t) &amp;amp;=&lt;br /&gt;
\begin{cases}&lt;br /&gt;
\tfrac{60}{84} t&lt;br /&gt;
&amp;amp; 0 \, \mathrm{s} \leq  t &amp;lt;  \frac{5\,040}{60} \, \mathrm{s}&lt;br /&gt;
\\&lt;br /&gt;
60 &lt;br /&gt;
&amp;amp; \frac{5\,040}{60} \, \mathrm{s} &amp;lt; t \leq \frac{17\,600}{60} \, \mathrm{s}&lt;br /&gt;
\\&lt;br /&gt;
60 - \tfrac{60}{84} \cdot ( t - \frac{17\,600}{60} \, \mathrm{s})&lt;br /&gt;
&amp;amp; \frac{17\,600}{60} \, \mathrm{s} &amp;lt; t \leq \frac{22\,640}{60} \, \mathrm{s}&lt;br /&gt;
\\&lt;br /&gt;
0 &amp;amp; \frac{22\,640}{60} \, \mathrm{s} &amp;lt; t \leq \frac{25\,200}{60} \, \mathrm{s}&lt;br /&gt;
\end{cases}\\&lt;br /&gt;
\int_{0}^{T} P(t) \, \mathrm{d}t &amp;amp;= 17\,600 \, \mathrm{kJ}&lt;br /&gt;
\end{align}&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Accumulators per solar panel ==&lt;br /&gt;
&lt;br /&gt;
Knowing how much power a solar panel provides on average we can construct a fitting load to test how much max accumulator charge &amp;lt;math&amp;gt;\hat{A}&amp;lt;/math&amp;gt; is needed.&lt;br /&gt;
&lt;br /&gt;
In an experiment we take one solar panel and put on a load of 41.9 kW, which can be achieved with...&lt;br /&gt;
* 8 Assembly machines 2 (&amp;lt;math&amp;gt;\check{P}_\text{AM2} = 5 \, \mathrm{kW} &amp;lt;/math&amp;gt; per unit)&lt;br /&gt;
* 1 inserter (&amp;lt;math&amp;gt;\check{P}_\text{I} = 400 \, \mathrm{W} &amp;lt;/math&amp;gt; per unit)&lt;br /&gt;
* 3 fast inserters (&amp;lt;math&amp;gt;\check{P}_\text{I2} = 500 \, \mathrm{W} &amp;lt;/math&amp;gt; per unit)&lt;br /&gt;
To that we add a generous 100 accumulators and observe the energy in the system.&lt;br /&gt;
&lt;br /&gt;
[[File:Solar_panel_with_load_41point9kW.png|1200px]]&lt;br /&gt;
&lt;br /&gt;
Experimental values show the first peak has a height of about 4.24 MJ, with each consecutive peak growing higher as the true output of a solar panel is ever so slightly more than 41.9 kW.&lt;br /&gt;
4.24 MJ is enough to fill 0.848 accumulators as they can hold a charge of 5 MJ each. Conservatively we can therefore set 0.85 accumulators per solar panel, or a ratio of 20 solar panels to 17 accumulators. A less conservative approach is to use 0.84 accumulators per solar panel, or a ratio of 25 solar panels to 21 accumulators.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;toccolours mw-collapsible mw-collapsed&amp;quot;&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;Analytic solution&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible-content&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We can set the previously defined power function as the rate of change of the accumulator and subtract it&#039;s average output as the load which the setup should be able to continuously supply. Further, we shift the function in time so that the function will start at zero.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\begin{align}&lt;br /&gt;
\dot{A}(t) &amp;amp;= P(t-\tfrac{176}{3})-\hat{P} =&lt;br /&gt;
\begin{cases}&lt;br /&gt;
\frac{60\,\mathrm{kW}}{84\,\mathrm{s}} \cdot t - \frac{880}{21}\,\mathrm{kW}&lt;br /&gt;
&amp;amp; 0 \, \mathrm{s} \leq  t &amp;lt;  \frac{1\,520}{60} \, \mathrm{s}&lt;br /&gt;
\\&lt;br /&gt;
60 \,\mathrm{kW} - \frac{880}{21}\,\mathrm{kW}&lt;br /&gt;
&amp;amp; \frac{1\,520}{60} \, \mathrm{s} &amp;lt; t \leq \frac{14\,080}{60} \, \mathrm{s}&lt;br /&gt;
\\&lt;br /&gt;
60 \,\mathrm{kW} - \frac{60\,\mathrm{kW}}{84\,\mathrm{s}}\cdot\left(t_\text{crit}-\frac{17\,600}{60}\,\mathrm{s}\right)-\frac{880}{21}\,\mathrm{kW}&lt;br /&gt;
&amp;amp; \frac{14\,080}{60} \, \mathrm{s} &amp;lt; t \leq \frac{19\,120}{60} \, \mathrm{s}&lt;br /&gt;
\\&lt;br /&gt;
- \frac{880}{21}\,\mathrm{kW}&lt;br /&gt;
&amp;amp; \frac{19\,120}{60} \, \mathrm{s} &amp;lt; t \leq \frac{21\,680}{60} \, \mathrm{s}&lt;br /&gt;
\\&lt;br /&gt;
\frac{60\,\mathrm{kW}}{84\,\mathrm{s}} \cdot ( t - \frac{14\,080}{60} \, \mathrm{s} ) - \frac{880}{21}\,\mathrm{kW}&lt;br /&gt;
&amp;amp; \frac{21\,680}{60} \, \mathrm{s} &amp;lt; t \leq \frac{25\,200}{60} \, \mathrm{s}&lt;br /&gt;
\end{cases}\\&lt;br /&gt;
A(T=420\,\mathrm{s}) &amp;amp;= \int_{0}^{T} \dot{A}(t) \, \mathrm{d}t = 0 \, \mathrm{J}&lt;br /&gt;
\end{align}&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To find the critical point in time &amp;lt;math&amp;gt;t_\text{crit}&amp;lt;/math&amp;gt; at which the accumulator charge reaches it&#039;s peak &amp;lt;math&amp;gt;\hat{A} = A(t_\text{crit})&amp;lt;/math&amp;gt;, we need to see when it&#039;s derivative passes zero.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\begin{align}&lt;br /&gt;
\dot{A}(t_\text{crit}) = 0 &amp;amp;= 60 \,\mathrm{kW} - \frac{60\,\mathrm{kW}}{84\,\mathrm{s}}\cdot\left(t_\text{crit}-\frac{14\,080}{60}\,\mathrm{s}\right)-\frac{880}{21}\,\mathrm{kW}\\&lt;br /&gt;
t_\text{crit} &amp;amp;= \frac{(60\,\mathrm{kW} - \frac{880}{21}\,\mathrm{kW})}{\frac{60\,\mathrm{kW}}{84\,\mathrm{s}}} + \frac{14\,080}{60}\,\mathrm{s}  = 260 \, \mathrm{s}\\&lt;br /&gt;
A(t_\text{crit}) &amp;amp;= \int_0^{t_\text{crit}} \dot{A}(t) \, \mathrm{d}t = \frac{2327}{548} \, \mathrm{MJ} = 4.246 \, \mathrm{MJ}&lt;br /&gt;
\end{align}&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The true perfect ratio for solar panels to accumulators therefore turns out to be...&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{5}{\frac{2327}{548}} = \frac{2\,740}{2\,327} \approx \frac{617}{524} \approx \frac{20}{17} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
It takes 0.84927 accumulators per solar panel, or a ratio of 617 solar panels to 524 accumulators. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;/div&gt;</summary>
		<author><name>Untitled7</name></author>
	</entry>
	<entry>
		<id>https://wiki.factorio.com/index.php?title=File:Solar_panel_with_load_41point9kW.png&amp;diff=206222</id>
		<title>File:Solar panel with load 41point9kW.png</title>
		<link rel="alternate" type="text/html" href="https://wiki.factorio.com/index.php?title=File:Solar_panel_with_load_41point9kW.png&amp;diff=206222"/>
		<updated>2024-11-13T20:17:55Z</updated>

		<summary type="html">&lt;p&gt;Untitled7: {{Screenshot}}&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Summary ==&lt;br /&gt;
{{Screenshot}}&lt;/div&gt;</summary>
		<author><name>Untitled7</name></author>
	</entry>
	<entry>
		<id>https://wiki.factorio.com/index.php?title=File:Solar_panel_energy.png&amp;diff=206216</id>
		<title>File:Solar panel energy.png</title>
		<link rel="alternate" type="text/html" href="https://wiki.factorio.com/index.php?title=File:Solar_panel_energy.png&amp;diff=206216"/>
		<updated>2024-11-13T20:06:49Z</updated>

		<summary type="html">&lt;p&gt;Untitled7: {{Screenshot}}&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Summary ==&lt;br /&gt;
{{Screenshot}}&lt;/div&gt;</summary>
		<author><name>Untitled7</name></author>
	</entry>
	<entry>
		<id>https://wiki.factorio.com/index.php?title=Tutorial:Applied_power_math&amp;diff=205917</id>
		<title>Tutorial:Applied power math</title>
		<link rel="alternate" type="text/html" href="https://wiki.factorio.com/index.php?title=Tutorial:Applied_power_math&amp;diff=205917"/>
		<updated>2024-11-11T07:29:45Z</updated>

		<summary type="html">&lt;p&gt;Untitled7: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Languages}}&lt;br /&gt;
In this tutorial we&#039;ll be answering the question: &#039;&#039;&#039;how much coal is needed to power a factory?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
First off, we need to know: how much power does our factory use? That&#039;s easy - you can check the electricity tab by clicking on a power pole.&lt;br /&gt;
&lt;br /&gt;
[[File:power-details.png|800px]]&lt;br /&gt;
&lt;br /&gt;
Here we see one radar using 300 kW of electrical power &amp;lt;math&amp;gt;P&amp;lt;/math&amp;gt;. Factorio uses real science here. The unit of power, or energy transfer, is measured in Watt (W). A kilowatt (kW) is 1000 W, a megawatt (MW) is 1000 kW, and if you&#039;re lucky enough to ever make a factory big enough, a gigawatt (GW) is 1000 MW.&lt;br /&gt;
&lt;br /&gt;
So that answers the question of how much power our factory uses. To keep our factory running at full speed we need to maintain 300 kW. For ease of comparison, we&#039;ll convert that to 0.3 MW.&lt;br /&gt;
&lt;br /&gt;
Next question! How much energy &amp;lt;math&amp;gt;E&amp;lt;/math&amp;gt; is released when burning one piece of coal? That&#039;s also easy, because it tells us when we hover over it: 4 MJ.&lt;br /&gt;
&lt;br /&gt;
[[File:coal-joules.png|300px]]&lt;br /&gt;
&lt;br /&gt;
A Joule is the standard measure of energy &amp;lt;math&amp;gt;E&amp;lt;/math&amp;gt;. As with Watts a kilojoule (kJ) is 1000 J, and so on. There is a fixed relationship between Joules and Watts. &#039;&#039;&#039;1 Joule of energy can provide 1 Watt of power for 1 second of time.&#039;&#039;&#039; So one Joule is equal to one Wattsecond.&lt;br /&gt;
As a formula:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\begin{align}&lt;br /&gt;
E &amp;amp;= P \cdot t\\&lt;br /&gt;
\left[ \text{J} \right] &amp;amp;= \left[ \text{W} \right] \cdot \left[ \text{s} \right]&lt;br /&gt;
\end{align}&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
So to run our factory at 0.3 MW, we need to consume 0.3 MJ every second.&lt;br /&gt;
&lt;br /&gt;
== Quiz ==&lt;br /&gt;
&lt;br /&gt;
How long could one piece of coal &amp;lt;math&amp;gt;E = 4 \, \text{MJ}&amp;lt;/math&amp;gt; run&lt;br /&gt;
our single radar &amp;lt;math&amp;gt;P = 0.3 \, \text{MW}&amp;lt;/math&amp;gt;?&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;toccolours mw-collapsible mw-collapsed&amp;quot;&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;Expand to reveal answer&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible-content&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\begin{align}&lt;br /&gt;
J &amp;amp;= P \cdot t \\&lt;br /&gt;
t &amp;amp;= \frac{J}{P} \\&lt;br /&gt;
  &amp;amp;= \frac{4 \, \text{MJ}}{0.3 \, \text{MW}} &lt;br /&gt;
   = \frac{4\,000\,000 \, \text{J}}{300\,000 \, \text{W}} &lt;br /&gt;
   = 13.333 \text{s}&lt;br /&gt;
\end{align}&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
A bit more than 13 seconds.&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
What is the maximum size factory (in watts)&lt;br /&gt;
a single piece of coal &amp;lt;math&amp;gt;E = 4 \text{MJ} &amp;lt;/math&amp;gt; could run for &amp;lt;math&amp;gt;t = 5 \text{s}&amp;lt;/math&amp;gt;?&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;toccolours mw-collapsible mw-collapsed&amp;quot;&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;Expand to reveal answer&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible-content&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\begin{align}&lt;br /&gt;
J &amp;amp;= P \cdot t \\&lt;br /&gt;
P &amp;amp;= \frac{J}{t} \\&lt;br /&gt;
  &amp;amp;= \frac{4 \, \text{MJ}}{5 \, \text{s}} &lt;br /&gt;
   = \frac{4\,000\,000 \, \text{J}}{5 \, \text{s}} &lt;br /&gt;
   = 800\,000 \, \text{W}&lt;br /&gt;
   = 0.8 \, \text{MW}\\&lt;br /&gt;
\end{align}&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
0.8 megawatts.&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;BONUS!&#039;&#039;&#039; A metric ton of real world coal &amp;lt;math&amp;gt;m = 1 \, \text{ton}&amp;lt;/math&amp;gt; can [http://hypertextbook.com/facts/2006/LunChen.shtml produce about 7.2 GJ in an electrical power plant]. How much does a piece of Factorio coal weigh?&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;toccolours mw-collapsible mw-collapsed&amp;quot;&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;Expand to reveal answer&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible-content&amp;quot;&amp;gt;&lt;br /&gt;
The energy ratios will match the weight ratios, so:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\begin{align}&lt;br /&gt;
\frac{m_\text{Factorio}}{m_\text{real}} = \frac{E_\text{Factorio}}{E_\text{real}} \quad \Leftrightarrow \quad&lt;br /&gt;
m_\text{Factorio} &amp;amp;= \frac{E_\text{Factorio} \cdot m_\text{real}}{E_\text{real}} \\&lt;br /&gt;
 1 \, \text{unit} &amp;amp;= \frac{4 \, \text{MJ}\cdot 1 \, \text{ton}}{7.2 \, \text{GJ}}\\&lt;br /&gt;
                  &amp;amp;= \frac{4\,000\,000 \, \text{J}\cdot 1\,000 \,\text{kg}}{7\,200\,000\,000 \, \text{J}}\\&lt;br /&gt;
                  &amp;amp;= 0.555\,555 \, \text{kg}\\&lt;br /&gt;
                  &amp;amp;= 555.555 \, \text{g}\\&lt;br /&gt;
\end{align}&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
About 555g! Still doesn&#039;t explain how our character can carry so much of it...&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now we have everything we need to answer our initial question: &#039;&#039;&#039;how much coal do we need to power our factory?&#039;&#039;&#039; Well, the question actually needs to be a bit more precise: how much coal do we need &#039;&#039;per second&#039;&#039; to power our factory?&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;toccolours mw-collapsible mw-collapsed&amp;quot;&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;Aside: why did the radar run for 20s and not 13.5s (50% of 27s)?&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible-content&amp;quot;&amp;gt;&lt;br /&gt;
Because it doesn&#039;t turn on and off instantly&amp;lt;!--. As you can see in the graph --&amp;gt;, the radar&#039;s demand of electrical power ramps up before reaching its operating power demand, therefore its electrical power usage is a function of time &amp;lt;math&amp;gt;p_\text{el}(t)&amp;lt;/math&amp;gt;. When speaking of a machine using power over time, the common equation symbol is &amp;lt;math&amp;gt;W&amp;lt;/math&amp;gt; for &#039;&#039;&#039;performed work&#039;&#039;&#039;, which must be equal to the amount of &#039;&#039;&#039;energy supplied&#039;&#039;&#039;&amp;lt;math&amp;gt;E_{supply}&amp;lt;/math&amp;gt;. To easier visualize the amount of energy or work, in the real world, instead of Joule, the unit in use is the kilowatt-hour (kWh).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;E_{supply} = W = \int p_\text{el}(t) \mathop{}\!\mathrm{d} t&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
However, as the accuracy of integration is not required, to conservatively approximate the required power supply the equation can be simplified by treating the average power &amp;lt;math&amp;gt;\bar{P}_\text{el}&amp;lt;/math&amp;gt; as the radars peak operating power &amp;lt;math&amp;gt;\hat{P}_\text{el}&amp;lt;/math&amp;gt; within a duration &amp;lt;math&amp;gt;T&amp;lt;/math&amp;gt; as a constant.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\begin{align}&lt;br /&gt;
E_{supply} &amp;amp;= \int_{t_0}^{t_0 + T} \hat{P}_\text{el}(t) \mathop{}\!\mathrm{d}t&lt;br /&gt;
           &amp;amp;= \hat{P}_\text{el} \cdot T&lt;br /&gt;
\end{align}&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For completeness sake it should be mentioned that the boilers turn 4 MJ of &#039;&#039;&#039;chemical energy&#039;&#039;&#039; &amp;lt;math&amp;gt;E_\text{chem}&amp;lt;/math&amp;gt; stored in coal, to 4 MJ of &#039;&#039;&#039;thermal energy&#039;&#039;&#039; &amp;lt;math&amp;gt;E_\text{therm}&amp;lt;/math&amp;gt; stored in the steam, which steam turbines only consume as the grid demands &#039;&#039;&#039;electrical energy&#039;&#039;&#039; &amp;lt;math&amp;gt;E_\text{el}&amp;lt;/math&amp;gt;, where the grid then transfers &#039;&#039;&#039;electrical power per second&#039;&#039;&#039;. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Quiz ==&lt;br /&gt;
&lt;br /&gt;
How much coal per second is needed to power a 20 MW factory?&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;toccolours mw-collapsible mw-collapsed&amp;quot;&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;Expand to reveal answer&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible-content&amp;quot;&amp;gt;&lt;br /&gt;
Since &amp;lt;math&amp;gt;E = P \cdot t&amp;lt;/code&amp;gt;, a 20 MW factory will consume 20 MJ/s. Since coal contains 4 MJ, we&#039;ll need &#039;&#039;&#039;5 coal per second&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
5 \cdot 4\, \text{MJ} = 20 \, \text{MW}&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;BONUS!&#039;&#039;&#039; How many [[Mining|mining drills]] are needed to produce that much coal?&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;toccolours mw-collapsible mw-collapsed&amp;quot;&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;Expand to reveal answer&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible-content&amp;quot;&amp;gt;&lt;br /&gt;
Per the linked page, an electric mining drill mine 0.5 coal per second, so we&#039;ll need &#039;&#039;&#039;10 electric mining drills&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{5 \, \text{units}}{\text{s}}{0.5\, \frac{\text{units}}{\text{s}}} = 5&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;SECOND BONUS!&#039;&#039;&#039; The average American household uses [https://www.eia.gov/tools/faqs/faq.php?id=97&amp;amp;t=3 3.2 GJ in a month] (typically expressed as &#039;&#039;888 kilowatt-hours&#039;&#039;). How much Factorio coal would be needed to power one of these homes for that period, and how many homes could a steam engine support ([[Steam_engine|900 kW]]), assuming the power is used at a constant rate? (Assume 30 days in a month.)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;toccolours mw-collapsible mw-collapsed&amp;quot;&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;Expand to reveal answer&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible-content&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\begin{align}&lt;br /&gt;
3.2 \, \mathrm{GJ} &amp;amp;= 3\,200 \, \mathrm{MJ}\\&lt;br /&gt;
\frac{3\,200 \, \mathrm{MJ}}{4 \, \mathrm{MJ}} &amp;amp;= 800\\&lt;br /&gt;
\\&lt;br /&gt;
3\,200 \, \mathrm{MJ} &amp;amp;\cdot \frac{1 \, \mathrm{m}}{30 \, \mathrm{d}} \cdot \frac{1 \, \mathrm{d}}{24 \, \mathrm{h}}  \cdot \frac{1 \, \mathrm{h}}{60 \, \mathrm{min}}   \cdot \frac{1 \, \mathrm{min}}{60 \, \mathrm{s}} = 1\,234.567\,9 \, \mathrm{W}\\&lt;br /&gt;
\frac{900 \, \mathrm{kW}}{1\,234.567\,9 \, \mathrm{W}} &amp;amp;= 729&lt;br /&gt;
\end{align}&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
800 pieces of coal per household and a single steam engine could power 729 households exactly.&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;/div&gt;</summary>
		<author><name>Untitled7</name></author>
	</entry>
	<entry>
		<id>https://wiki.factorio.com/index.php?title=Factorio_talk:Style_guide&amp;diff=205412</id>
		<title>Factorio talk:Style guide</title>
		<link rel="alternate" type="text/html" href="https://wiki.factorio.com/index.php?title=Factorio_talk:Style_guide&amp;diff=205412"/>
		<updated>2024-11-08T15:13:44Z</updated>

		<summary type="html">&lt;p&gt;Untitled7: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== How can I add a blueprint? ==&lt;br /&gt;
I would like to edit https://wiki.factorio.com/Tutorial:Combinator_tutorial#Memory, and I would like to add blueprints to make it easier to follow along. I would very much appreciate some guidance on the preferred way of sharing blueprints here on the Wiki.&lt;br /&gt;
--[[User:Ndh|Ndh]] ([[User talk:Ndh|talk]]) 17:30, 27 June 2024 (UTC)&lt;br /&gt;
: Hey, you interest is appreciated! You can use [[Template:BlueprintString]] for blueprint strings, see [[Inserters#Inserter_Throughput]] for example. [[Tutorial:Circuit_network_cookbook#Memory_Cell_/_Counter]] may also interest you. Happy editing! -- [[User:Bilka|Bilka]] ([[User talk:Bilka|talk]]) - &amp;lt;span style=&amp;quot;color:#FF0000&amp;quot;&amp;gt;Admin&amp;lt;/span&amp;gt; 17:50, 27 June 2024 (UTC)&lt;br /&gt;
:: Ooooh that is awesome! Thank you so much! Although now I&#039;m wondering how I could have found this. On the left there is a list of links under &amp;quot;Editor Help&amp;quot;, but &amp;quot;Templates&amp;quot; links to some generic mediawiki page. Would it be possible maybe to change this link to https://wiki.factorio.com/Category:Templates instead? Both https://wiki.factorio.com/Special:WhatLinksHere/Category:Templates and https://wiki.factorio.com/Special:WhatLinksHere/Category:Documentation_templates are pretty empty right now. Or maybe the style guide would be the better place? --[[User:Ndh|Ndh]] ([[User talk:Ndh|talk]]) 18:02, 27 June 2024 (UTC)&lt;br /&gt;
::: Usually people find the templates by seeing them used on the wiki. But that doesn&#039;t refute your point, so I linked to the category in the style guide section about templates. -- [[User:Bilka|Bilka]] ([[User talk:Bilka|talk]]) - &amp;lt;span style=&amp;quot;color:#FF0000&amp;quot;&amp;gt;Admin&amp;lt;/span&amp;gt; 15:05, 30 August 2024 (UTC)&lt;br /&gt;
&lt;br /&gt;
== Adding &#039;Quality&#039; to Non-Space-Age Pages ==&lt;br /&gt;
&lt;br /&gt;
I was editing the page for the Solar panel infobox to include quality information, but I wanted to check if there was a certain way we wanted to do this.&lt;br /&gt;
Either adding it directly to the boxes quality affects, like the first image attached:&lt;br /&gt;
[[File:Solarpanelquality-editor question.png|thumb]]&lt;br /&gt;
&lt;br /&gt;
Or if we should use the quality infobox template and list the items changed, like the second image attatched:&lt;br /&gt;
[[File:Solarpanelquality-editor question2.png|thumb]]&lt;br /&gt;
&lt;br /&gt;
Are either of these appropriate? If so which one? Is there another way that would work better to the style and legibility of the wiki?&lt;br /&gt;
--[[User:Soundfoam|Soundfoam]] ([[User talk:Soundfoam|talk]]) 7:49, 29 October 2024 (UTC)&lt;br /&gt;
: The quality effects should be noted in the row of the property they affect, so for example directly in the health row. So like in your first image. You can find documentation on the infoboxes, including how to do the quality, on [[Template:Infobox]]. -- [[User:Bilka|Bilka]] ([[User talk:Bilka|talk]]) - &amp;lt;span style=&amp;quot;color:#FF0000&amp;quot;&amp;gt;Admin&amp;lt;/span&amp;gt; 15:17, 1 November 2024 (UTC)&lt;br /&gt;
&lt;br /&gt;
{{clear}}&lt;br /&gt;
&lt;br /&gt;
== Draft: equation style guide ==&lt;br /&gt;
&lt;br /&gt;
This is not a guide on proper LaTeX syntax within the math environment, such a guide can be found here: [https://www.mediawiki.org/wiki/Extension:Math/Syntax Extension:Math/Syntax].&lt;br /&gt;
&lt;br /&gt;
Unfortunately, the more specific the styles are the more difficult they are to be implemented by a laymen not familiar with LaTeX. &lt;br /&gt;
However, LaTeX already is a hurdle of entry, and it doesn&#039;t have a very wide usecase except more niche places on the wiki like the Tutorial namespace.&lt;br /&gt;
&amp;lt;div style=&amp;quot;&lt;br /&gt;
    margin: 15px;&lt;br /&gt;
    padding: 5px 10px;&lt;br /&gt;
    border-radius: 0;&lt;br /&gt;
    background: #242324;&lt;br /&gt;
    border-color: #141414 #3E3E3E #3E3E3E #141414;&lt;br /&gt;
    border-style: solid;&lt;br /&gt;
    border-width: 3px;&amp;quot;&amp;gt;&lt;br /&gt;
=== Preferred Notation ===&lt;br /&gt;
* &#039;&#039;&#039;Multiplication&#039;&#039;&#039;: In multiplication of scalar values &amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;\cdot&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt; is preferred over &amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;\times&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;. However, &amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;*&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt; may not be used.&lt;br /&gt;
* &#039;&#039;&#039;Division&#039;&#039;&#039;: Divisions must be handled as fractions &amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;\frac{...}{...}&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;. The &amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;\div&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt; operator may not be used.&lt;br /&gt;
* &#039;&#039;&#039;Differential d&#039;&#039;&#039;: The differential d must be non-italicized as &amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;&amp;lt;math&amp;gt;\mathrm{d}&amp;lt;/math&amp;gt;&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;.&lt;br /&gt;
* &#039;&#039;&#039;Function names&#039;&#039;&#039;A number of functions already exist in the math environment like &amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;&amp;lt;math&amp;gt;\sin \log \exp \ln&amp;lt;/math&amp;gt;&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt; resulting in &amp;lt;math&amp;gt;\sin \log \exp \ln&amp;lt;/math&amp;gt;. If an editor wants to use other functions like the binary logarithm (logarithmus dualis) they can use &amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;\mathrm{...}&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt; to revert the italics to write &amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;&amp;lt;math&amp;gt;\log_2 = \mathrm{ld}&amp;lt;/math&amp;gt;&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt; resulting in &amp;lt;math&amp;gt;\log_2 = \mathrm{ld}&amp;lt;/math&amp;gt;.&lt;br /&gt;
* &#039;&#039;&#039;Function arguments&#039;&#039;&#039;: Parentheses around function arguments are must be used &amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;&amp;lt;math&amp;gt;\sin (\alpha)&amp;lt;/math&amp;gt;&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt; &amp;lt;math&amp;gt;\sin (\alpha)&amp;lt;/math&amp;gt;, they may not be omitted.&lt;br /&gt;
* &#039;&#039;&#039;Time derivatives&#039;&#039;&#039;: Dot notation may be used for time derivatives, like &amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;&amp;lt;math&amp;gt;\dot{m} := \tfrac{\mathrm{d}m}{\mathrm{d}t}&amp;lt;/math&amp;gt;&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt; &amp;lt;math&amp;gt;\dot{m} := \tfrac{\mathrm{d}m}{\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Units ===&lt;br /&gt;
* &#039;&#039;&#039;Units should not be italicized&#039;&#039;&#039;, but symbols in equations are italicized by default, therefore the exceptions must be treated by wrapping them in &amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;\mathrm{...}&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;. And between the quantity and the unit should be a small gap, which can be done in the math environment with a &amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;\,&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
: Example: &amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;&amp;lt;math&amp;gt;t = 15 \, \mathrm{s}&amp;lt;/math&amp;gt;&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt; results in &amp;lt;math&amp;gt;t = 15 \, \mathrm{s}&amp;lt;/math&amp;gt;&lt;br /&gt;
* &#039;&#039;&#039;Compound of multiple units&#039;&#039;&#039;: the different units should also be separated by a small gap. If a unit is fractional, it should use text style fractions &amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;\tfrac{...}{...}&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;, especially for inline equations.&lt;br /&gt;
: Example 1: Energy usage in kilowatt-hours: &amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;&amp;lt;math&amp;gt;E = 720 \, \mathrm{kW}\, \mathrm{h}&amp;lt;/math&amp;gt;&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt; results in &amp;lt;math&amp;gt;E = 720 \, \mathrm{kW}\, \mathrm{h}&amp;lt;/math&amp;gt;&lt;br /&gt;
: Example 2: Resource flow in units per minute: &amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;&amp;lt;math&amp;gt;\dot{m} = 750 \, \tfrac{\mathrm{u}}{\mathrm{min}}&amp;lt;/math&amp;gt; science&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt; results in &amp;lt;math&amp;gt;\dot{m} = 750 \, \tfrac{\mathrm{u}}{\mathrm{min}}&amp;lt;/math&amp;gt; science&lt;br /&gt;
&amp;lt;!---&lt;br /&gt;
*** Incorrect: &amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;&amp;lt;math&amp;gt;t = 15 \mathrm{s}&amp;lt;/math&amp;gt;&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt; &amp;lt;math&amp;gt;t = 15 \mathrm{s}&amp;lt;/math&amp;gt;&lt;br /&gt;
*** Incorrect: &amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;&amp;lt;math&amp;gt;t = 15 \, s&amp;lt;/math&amp;gt;&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt; &amp;lt;math&amp;gt;t = 15 \, s&amp;lt;/math&amp;gt;&lt;br /&gt;
*** Incorrect: &amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;&amp;lt;math&amp;gt;t = 15s&amp;lt;/math&amp;gt;&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt; &amp;lt;math&amp;gt;t = 15s&amp;lt;/math&amp;gt;&lt;br /&gt;
*** Incorrect: units per minute: &amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;&amp;lt;math&amp;gt;750\frac{\mathrm{u}}{\mathrm{min}}&amp;lt;/math&amp;gt; science&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt; &amp;lt;math&amp;gt;750\frac{\mathrm{u}}{\mathrm{min}}&amp;lt;/math&amp;gt; science&lt;br /&gt;
--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Separators ===&lt;br /&gt;
* &#039;&#039;&#039;Symbol separator&#039;&#039;&#039;: Symbols separated by no operator are implied to get multiplied together. However, as one symbol can consist of multiple glyphs, they should be separated by a small gap. A small gap can be done in the math environment with a &amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;\,&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;.&lt;br /&gt;
: Example: &amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;&amp;lt;math&amp;gt;\Delta F = k \, \Delta x&amp;lt;/math&amp;gt;&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt; &amp;lt;math&amp;gt;\Delta F = k \, \Delta x&amp;lt;/math&amp;gt;&lt;br /&gt;
* &#039;&#039;&#039;Quantity seperator&#039;&#039;&#039;: When symbols are replaced by the quantity and unit they represent, a operator must be given. &lt;br /&gt;
: Example: &amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;&amp;lt;math&amp;gt;10 \, \mathrm{N} = 50 \, \tfrac{\mathrm{N}}{\mathrm{m}} \cdot 0.2 \, \mathrm{N}&amp;lt;/math&amp;gt;&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt; &amp;lt;math&amp;gt;10 \, \mathrm{N} = 50 \, \tfrac{\mathrm{N}}{\mathrm{m}} \cdot 0.2 \, \mathrm{N}&amp;lt;/math&amp;gt;&lt;br /&gt;
* &#039;&#039;&#039;Thousands separator&#039;&#039;&#039;: To aid the eye, but be non-intrusive or confusing, the thousands separator should be a small gap, not a comma or period. This should also apply to every thousandth after the decimal place.&lt;br /&gt;
: Example: &amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;&amp;lt;math&amp;gt;12 \, \mathrm{MJ} = 12\,000\,000 \, \mathrm{J}&amp;lt;/math&amp;gt;&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt; &amp;lt;math&amp;gt;12 \, \mathrm{MJ} = 12\,000\,000 \, \mathrm{J}&amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;!--** Incorrect: &amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;&amp;lt;math&amp;gt;12 \, \mathrm{MJ} = 12 000 000 \, \mathrm{J}&amp;lt;/math&amp;gt;&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt; &amp;lt;math&amp;gt;12 \, \mathrm{MJ} = 12 000 000 \, \mathrm{J}&amp;lt;/math&amp;gt;&lt;br /&gt;
** Incorrect: &amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;&amp;lt;math&amp;gt;12 \, \mathrm{MJ} = 12.000.000 \, \mathrm{J}&amp;lt;/math&amp;gt;&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt; &amp;lt;math&amp;gt;12 \, \mathrm{MJ} = 12.000.000 \, \mathrm{J}&amp;lt;/math&amp;gt;&lt;br /&gt;
** Incorrect: &amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;&amp;lt;math&amp;gt;12 \, \mathrm{MJ} = 12,000,000 \, \mathrm{J}&amp;lt;/math&amp;gt;&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt; &amp;lt;math&amp;gt;12 \, \mathrm{MJ} = 12,000,000 \, \mathrm{J}&amp;lt;/math&amp;gt;&lt;br /&gt;
--&amp;gt;&lt;br /&gt;
* &#039;&#039;&#039;Decimal separator&#039;&#039;&#039;: The decimal separator is a period in America and most English-speaking countries, but a comma in Europe and most Arabic-speaking countries. As the wiki is in English, the decimal separator should also be period.&lt;br /&gt;
: Example: &amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;&amp;lt;math&amp;gt;\pi = 3.141\,592\,653\,589&amp;lt;/math&amp;gt;&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt; &amp;lt;math&amp;gt;\pi = 3.141\,592\,653\,589&amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;!--** Incorrect: &amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;&amp;lt;math&amp;gt;\pi = 3,141\,592\,653\,589&amp;lt;/math&amp;gt;&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt; &amp;lt;math&amp;gt;\pi = 3,141\,592\,653\,589&amp;lt;/math&amp;gt;&lt;br /&gt;
--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Large equations ===&lt;br /&gt;
Equations that will span multiple lines should be placed in their own paragraphs. Then they should be properly aligned in either an &amp;lt;code&amp;gt;align&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;array&amp;lt;/code&amp;gt; environment&lt;br /&gt;
&amp;lt;div style=&amp;quot;display:flex; flex-wrap: wrap; column-gap: 1em;&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;div&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\begin{align}&lt;br /&gt;
E &amp;amp;= \int_{t_0}^{t_1} P(t) \, \mathrm{d}t \qquad P(t) \approx P_\mbox{peak}\\&lt;br /&gt;
  &amp;amp;= \int_{t_0}^{t_1} P_\mbox{peak} \, \mathrm{d}t\\&lt;br /&gt;
  &amp;amp;= P_\mbox{peak} \, \int_{t_0}^{t_1} \, \mathrm{d}t\\&lt;br /&gt;
  &amp;amp;= P_\mbox{peak} \, (t_1 - t_0)\\&lt;br /&gt;
\end{align}&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&amp;lt;div&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\begin{align}&lt;br /&gt;
E &amp;amp;= \int_{t_0}^{t_1} P(t) \, \mathrm{d}t \qquad P(t) \approx P_\mbox{peak}\\&lt;br /&gt;
  &amp;amp;= \int_{t_0}^{t_1} P_\mbox{peak} \, \mathrm{d}t\\&lt;br /&gt;
  &amp;amp;= P_\mbox{peak} \, \int_{t_0}^{t_1} \, \mathrm{d}t\\&lt;br /&gt;
  &amp;amp;= P_\mbox{peak} \, (t_1 - t_0)\\&lt;br /&gt;
\end{align}&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;/div&gt;</summary>
		<author><name>Untitled7</name></author>
	</entry>
	<entry>
		<id>https://wiki.factorio.com/index.php?title=Factorio_talk:Style_guide&amp;diff=205409</id>
		<title>Factorio talk:Style guide</title>
		<link rel="alternate" type="text/html" href="https://wiki.factorio.com/index.php?title=Factorio_talk:Style_guide&amp;diff=205409"/>
		<updated>2024-11-08T15:13:15Z</updated>

		<summary type="html">&lt;p&gt;Untitled7: /* Draft: equation style guide */ new section&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== How can I add a blueprint? ==&lt;br /&gt;
I would like to edit https://wiki.factorio.com/Tutorial:Combinator_tutorial#Memory, and I would like to add blueprints to make it easier to follow along. I would very much appreciate some guidance on the preferred way of sharing blueprints here on the Wiki.&lt;br /&gt;
--[[User:Ndh|Ndh]] ([[User talk:Ndh|talk]]) 17:30, 27 June 2024 (UTC)&lt;br /&gt;
: Hey, you interest is appreciated! You can use [[Template:BlueprintString]] for blueprint strings, see [[Inserters#Inserter_Throughput]] for example. [[Tutorial:Circuit_network_cookbook#Memory_Cell_/_Counter]] may also interest you. Happy editing! -- [[User:Bilka|Bilka]] ([[User talk:Bilka|talk]]) - &amp;lt;span style=&amp;quot;color:#FF0000&amp;quot;&amp;gt;Admin&amp;lt;/span&amp;gt; 17:50, 27 June 2024 (UTC)&lt;br /&gt;
:: Ooooh that is awesome! Thank you so much! Although now I&#039;m wondering how I could have found this. On the left there is a list of links under &amp;quot;Editor Help&amp;quot;, but &amp;quot;Templates&amp;quot; links to some generic mediawiki page. Would it be possible maybe to change this link to https://wiki.factorio.com/Category:Templates instead? Both https://wiki.factorio.com/Special:WhatLinksHere/Category:Templates and https://wiki.factorio.com/Special:WhatLinksHere/Category:Documentation_templates are pretty empty right now. Or maybe the style guide would be the better place? --[[User:Ndh|Ndh]] ([[User talk:Ndh|talk]]) 18:02, 27 June 2024 (UTC)&lt;br /&gt;
::: Usually people find the templates by seeing them used on the wiki. But that doesn&#039;t refute your point, so I linked to the category in the style guide section about templates. -- [[User:Bilka|Bilka]] ([[User talk:Bilka|talk]]) - &amp;lt;span style=&amp;quot;color:#FF0000&amp;quot;&amp;gt;Admin&amp;lt;/span&amp;gt; 15:05, 30 August 2024 (UTC)&lt;br /&gt;
&lt;br /&gt;
== Adding &#039;Quality&#039; to Non-Space-Age Pages ==&lt;br /&gt;
&lt;br /&gt;
I was editing the page for the Solar panel infobox to include quality information, but I wanted to check if there was a certain way we wanted to do this.&lt;br /&gt;
Either adding it directly to the boxes quality affects, like the first image attached:&lt;br /&gt;
[[File:Solarpanelquality-editor question.png|thumb]]&lt;br /&gt;
&lt;br /&gt;
Or if we should use the quality infobox template and list the items changed, like the second image attatched:&lt;br /&gt;
[[File:Solarpanelquality-editor question2.png|thumb]]&lt;br /&gt;
&lt;br /&gt;
Are either of these appropriate? If so which one? Is there another way that would work better to the style and legibility of the wiki?&lt;br /&gt;
--[[User:Soundfoam|Soundfoam]] ([[User talk:Soundfoam|talk]]) 7:49, 29 October 2024 (UTC)&lt;br /&gt;
: The quality effects should be noted in the row of the property they affect, so for example directly in the health row. So like in your first image. You can find documentation on the infoboxes, including how to do the quality, on [[Template:Infobox]]. -- [[User:Bilka|Bilka]] ([[User talk:Bilka|talk]]) - &amp;lt;span style=&amp;quot;color:#FF0000&amp;quot;&amp;gt;Admin&amp;lt;/span&amp;gt; 15:17, 1 November 2024 (UTC)&lt;br /&gt;
&lt;br /&gt;
== Draft: equation style guide ==&lt;br /&gt;
&lt;br /&gt;
This is not a guide on proper LaTeX syntax within the math environment, such a guide can be found here: [https://www.mediawiki.org/wiki/Extension:Math/Syntax Extension:Math/Syntax].&lt;br /&gt;
&lt;br /&gt;
Unfortunately, the more specific the styles are the more difficult they are to be implemented by a laymen not familiar with LaTeX. &lt;br /&gt;
However, LaTeX already is a hurdle of entry, and it doesn&#039;t have a very wide usecase except more niche places on the wiki like the Tutorial namespace.&lt;br /&gt;
&amp;lt;div style=&amp;quot;&lt;br /&gt;
    margin: 15px;&lt;br /&gt;
    padding: 5px 10px;&lt;br /&gt;
    border-radius: 0;&lt;br /&gt;
    background: #242324;&lt;br /&gt;
    border-color: #141414 #3E3E3E #3E3E3E #141414;&lt;br /&gt;
    border-style: solid;&lt;br /&gt;
    border-width: 3px;&amp;quot;&amp;gt;&lt;br /&gt;
=== Preferred Notation ===&lt;br /&gt;
* &#039;&#039;&#039;Multiplication&#039;&#039;&#039;: In multiplication of scalar values &amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;\cdot&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt; is preferred over &amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;\times&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;. However, &amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;*&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt; may not be used.&lt;br /&gt;
* &#039;&#039;&#039;Division&#039;&#039;&#039;: Divisions must be handled as fractions &amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;\frac{...}{...}&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;. The &amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;\div&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt; operator may not be used.&lt;br /&gt;
* &#039;&#039;&#039;Differential d&#039;&#039;&#039;: The differential d must be non-italicized as &amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;&amp;lt;math&amp;gt;\mathrm{d}&amp;lt;/math&amp;gt;&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;.&lt;br /&gt;
* &#039;&#039;&#039;Function names&#039;&#039;&#039;A number of functions already exist in the math environment like &amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;&amp;lt;math&amp;gt;\sin \log \exp \ln&amp;lt;/math&amp;gt;&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt; resulting in &amp;lt;math&amp;gt;\sin \log \exp \ln&amp;lt;/math&amp;gt;. If an editor wants to use other functions like the binary logarithm (logarithmus dualis) they can use &amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;\mathrm{...}&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt; to revert the italics to write &amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;&amp;lt;math&amp;gt;\log_2 = \mathrm{ld}&amp;lt;/math&amp;gt;&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt; resulting in &amp;lt;math&amp;gt;\log_2 = \mathrm{ld}&amp;lt;/math&amp;gt;.&lt;br /&gt;
* &#039;&#039;&#039;Function arguments&#039;&#039;&#039;: Parentheses around function arguments are must be used &amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;&amp;lt;math&amp;gt;\sin (\alpha)&amp;lt;/math&amp;gt;&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt; &amp;lt;math&amp;gt;\sin (\alpha)&amp;lt;/math&amp;gt;, they may not be omitted.&lt;br /&gt;
* &#039;&#039;&#039;Time derivatives&#039;&#039;&#039;: Dot notation may be used for time derivatives, like &amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;&amp;lt;math&amp;gt;\dot{m} := \tfrac{\mathrm{d}m}{\mathrm{d}t}&amp;lt;/math&amp;gt;&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt; &amp;lt;math&amp;gt;\dot{m} := \tfrac{\mathrm{d}m}{\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Units ===&lt;br /&gt;
* &#039;&#039;&#039;Units should not be italicized&#039;&#039;&#039;, but symbols in equations are italicized by default, therefore the exceptions must be treated by wrapping them in &amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;\mathrm{...}&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;. And between the quantity and the unit should be a small gap, which can be done in the math environment with a &amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;\,&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
: Example: &amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;&amp;lt;math&amp;gt;t = 15 \, \mathrm{s}&amp;lt;/math&amp;gt;&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt; results in &amp;lt;math&amp;gt;t = 15 \, \mathrm{s}&amp;lt;/math&amp;gt;&lt;br /&gt;
* &#039;&#039;&#039;Compound of multiple units&#039;&#039;&#039;: the different units should also be separated by a small gap. If a unit is fractional, it should use text style fractions &amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;\tfrac{...}{...}&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;, especially for inline equations.&lt;br /&gt;
: Example 1: Energy usage in kilowatt-hours: &amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;&amp;lt;math&amp;gt;E = 720 \, \mathrm{kW}\, \mathrm{h}&amp;lt;/math&amp;gt;&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt; results in &amp;lt;math&amp;gt;E = 720 \, \mathrm{kW}\, \mathrm{h}&amp;lt;/math&amp;gt;&lt;br /&gt;
: Example 2: Resource flow in units per minute: &amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;&amp;lt;math&amp;gt;\dot{m} = 750 \, \tfrac{\mathrm{u}}{\mathrm{min}}&amp;lt;/math&amp;gt; science&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt; results in &amp;lt;math&amp;gt;\dot{m} = 750 \, \tfrac{\mathrm{u}}{\mathrm{min}}&amp;lt;/math&amp;gt; science&lt;br /&gt;
&amp;lt;!---&lt;br /&gt;
*** Incorrect: &amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;&amp;lt;math&amp;gt;t = 15 \mathrm{s}&amp;lt;/math&amp;gt;&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt; &amp;lt;math&amp;gt;t = 15 \mathrm{s}&amp;lt;/math&amp;gt;&lt;br /&gt;
*** Incorrect: &amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;&amp;lt;math&amp;gt;t = 15 \, s&amp;lt;/math&amp;gt;&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt; &amp;lt;math&amp;gt;t = 15 \, s&amp;lt;/math&amp;gt;&lt;br /&gt;
*** Incorrect: &amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;&amp;lt;math&amp;gt;t = 15s&amp;lt;/math&amp;gt;&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt; &amp;lt;math&amp;gt;t = 15s&amp;lt;/math&amp;gt;&lt;br /&gt;
*** Incorrect: units per minute: &amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;&amp;lt;math&amp;gt;750\frac{\mathrm{u}}{\mathrm{min}}&amp;lt;/math&amp;gt; science&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt; &amp;lt;math&amp;gt;750\frac{\mathrm{u}}{\mathrm{min}}&amp;lt;/math&amp;gt; science&lt;br /&gt;
--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Separators ===&lt;br /&gt;
* &#039;&#039;&#039;Symbol separator&#039;&#039;&#039;: Symbols separated by no operator are implied to get multiplied together. However, as one symbol can consist of multiple glyphs, they should be separated by a small gap. A small gap can be done in the math environment with a &amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;\,&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;.&lt;br /&gt;
: Example: &amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;&amp;lt;math&amp;gt;\Delta F = k \, \Delta x&amp;lt;/math&amp;gt;&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt; &amp;lt;math&amp;gt;\Delta F = k \, \Delta x&amp;lt;/math&amp;gt;&lt;br /&gt;
* &#039;&#039;&#039;Quantity seperator&#039;&#039;&#039;: When symbols are replaced by the quantity and unit they represent, a operator must be given. &lt;br /&gt;
: Example: &amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;&amp;lt;math&amp;gt;10 \, \mathrm{N} = 50 \, \tfrac{\mathrm{N}}{\mathrm{m}} \cdot 0.2 \, \mathrm{N}&amp;lt;/math&amp;gt;&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt; &amp;lt;math&amp;gt;10 \, \mathrm{N} = 50 \, \tfrac{\mathrm{N}}{\mathrm{m}} \cdot 0.2 \, \mathrm{N}&amp;lt;/math&amp;gt;&lt;br /&gt;
* &#039;&#039;&#039;Thousands separator&#039;&#039;&#039;: To aid the eye, but be non-intrusive or confusing, the thousands separator should be a small gap, not a comma or period. This should also apply to every thousandth after the decimal place.&lt;br /&gt;
: Example: &amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;&amp;lt;math&amp;gt;12 \, \mathrm{MJ} = 12\,000\,000 \, \mathrm{J}&amp;lt;/math&amp;gt;&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt; &amp;lt;math&amp;gt;12 \, \mathrm{MJ} = 12\,000\,000 \, \mathrm{J}&amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;!--** Incorrect: &amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;&amp;lt;math&amp;gt;12 \, \mathrm{MJ} = 12 000 000 \, \mathrm{J}&amp;lt;/math&amp;gt;&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt; &amp;lt;math&amp;gt;12 \, \mathrm{MJ} = 12 000 000 \, \mathrm{J}&amp;lt;/math&amp;gt;&lt;br /&gt;
** Incorrect: &amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;&amp;lt;math&amp;gt;12 \, \mathrm{MJ} = 12.000.000 \, \mathrm{J}&amp;lt;/math&amp;gt;&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt; &amp;lt;math&amp;gt;12 \, \mathrm{MJ} = 12.000.000 \, \mathrm{J}&amp;lt;/math&amp;gt;&lt;br /&gt;
** Incorrect: &amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;&amp;lt;math&amp;gt;12 \, \mathrm{MJ} = 12,000,000 \, \mathrm{J}&amp;lt;/math&amp;gt;&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt; &amp;lt;math&amp;gt;12 \, \mathrm{MJ} = 12,000,000 \, \mathrm{J}&amp;lt;/math&amp;gt;&lt;br /&gt;
--&amp;gt;&lt;br /&gt;
* &#039;&#039;&#039;Decimal separator&#039;&#039;&#039;: The decimal separator is a period in America and most English-speaking countries, but a comma in Europe and most Arabic-speaking countries. As the wiki is in English, the decimal separator should also be period.&lt;br /&gt;
: Example: &amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;&amp;lt;math&amp;gt;\pi = 3.141\,592\,653\,589&amp;lt;/math&amp;gt;&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt; &amp;lt;math&amp;gt;\pi = 3.141\,592\,653\,589&amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;!--** Incorrect: &amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;&amp;lt;math&amp;gt;\pi = 3,141\,592\,653\,589&amp;lt;/math&amp;gt;&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt; &amp;lt;math&amp;gt;\pi = 3,141\,592\,653\,589&amp;lt;/math&amp;gt;&lt;br /&gt;
--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Large equations ===&lt;br /&gt;
Equations that will span multiple lines should be placed in their own paragraphs. Then they should be properly aligned in either an &amp;lt;code&amp;gt;align&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;array&amp;lt;/code&amp;gt; environment&lt;br /&gt;
&amp;lt;div style=&amp;quot;display:flex; flex-wrap: wrap; column-gap: 1em;&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;div&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\begin{align}&lt;br /&gt;
E &amp;amp;= \int_{t_0}^{t_1} P(t) \, \mathrm{d}t \qquad P(t) \approx P_\mbox{peak}\\&lt;br /&gt;
  &amp;amp;= \int_{t_0}^{t_1} P_\mbox{peak} \, \mathrm{d}t\\&lt;br /&gt;
  &amp;amp;= P_\mbox{peak} \, \int_{t_0}^{t_1} \, \mathrm{d}t\\&lt;br /&gt;
  &amp;amp;= P_\mbox{peak} \, (t_1 - t_0)\\&lt;br /&gt;
\end{align}&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&amp;lt;div&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\begin{align}&lt;br /&gt;
E &amp;amp;= \int_{t_0}^{t_1} P(t) \, \mathrm{d}t \qquad P(t) \approx P_\mbox{peak}\\&lt;br /&gt;
  &amp;amp;= \int_{t_0}^{t_1} P_\mbox{peak} \, \mathrm{d}t\\&lt;br /&gt;
  &amp;amp;= P_\mbox{peak} \, \int_{t_0}^{t_1} \, \mathrm{d}t\\&lt;br /&gt;
  &amp;amp;= P_\mbox{peak} \, (t_1 - t_0)\\&lt;br /&gt;
\end{align}&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;/div&gt;</summary>
		<author><name>Untitled7</name></author>
	</entry>
	<entry>
		<id>https://wiki.factorio.com/index.php?title=Electric_furnace&amp;diff=204163</id>
		<title>Electric furnace</title>
		<link rel="alternate" type="text/html" href="https://wiki.factorio.com/index.php?title=Electric_furnace&amp;diff=204163"/>
		<updated>2024-11-01T14:07:42Z</updated>

		<summary type="html">&lt;p&gt;Untitled7: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Languages}}&lt;br /&gt;
{{:Infobox:Electric furnace}}&lt;br /&gt;
&lt;br /&gt;
The &#039;&#039;&#039;electric furnace&#039;&#039;&#039; is the third and last tier of furnace. As its name implies, it uses [[electric system|electricity]] rather than [[fuel]] to operate, removing the need for a fuel belt.&lt;br /&gt;
&lt;br /&gt;
The electric furnace smelts items at the same speed as a [[steel furnace]], and also has two slots for [[module|modules]]. However, it is slightly larger than the other two tiers of furnaces; it occupies a 3×3 area instead of a 2×2 area.&lt;br /&gt;
&lt;br /&gt;
== Output ==&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! rowspan=&amp;quot;2&amp;quot; | Resource&lt;br /&gt;
! {{Imagelink|Stone furnace}}&lt;br /&gt;
! {{Imagelink|Steel furnace}}&lt;br /&gt;
! {{Imagelink|Electric furnace}}&lt;br /&gt;
|-&lt;br /&gt;
| &#039;&#039;&#039;Coal consumption&#039;&#039;&#039;: 0.0225/sec&lt;br /&gt;
| &#039;&#039;&#039;Coal consumption&#039;&#039;&#039;: 0.0225/sec&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot; | Iron&lt;br /&gt;
| {{Icon|Iron plate|0.3125}} 0.3125/sec&lt;br /&gt;
| {{Icon|Iron plate|0.625}} 0.625/sec&lt;br /&gt;
| {{Icon|Iron plate|0.625}} 0.625/sec&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot; | Copper&lt;br /&gt;
| {{Icon|Copper plate|0.3125}} 0.3125/sec&lt;br /&gt;
| {{Icon|Copper plate|0.625}} 0.625/sec&lt;br /&gt;
| {{Icon|Copper plate|0.625}} 0.625/sec&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot; | Stone brick&lt;br /&gt;
| {{Icon|Stone brick|0.3125}} 0.3125/sec&lt;br /&gt;
| {{Icon|Stone brick|0.625}} 0.625/sec&lt;br /&gt;
| {{Icon|Stone brick|0.625}} 0.625/sec&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot; | Steel plate&lt;br /&gt;
| {{Icon|Steel plate|0.0625}} 0.0625/sec&lt;br /&gt;
| {{Icon|Steel plate|0.125}} 0.125/sec&lt;br /&gt;
| {{Icon|Steel plate|0.125}} 0.125/sec&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Quality&#039;s effect on output ==&lt;br /&gt;
&lt;br /&gt;
[[Quality]] (from the [[Space Age]] expansion) does not affect coal or power consumption for furnaces, but does affect how quickly they process things. This stacks multiplicatively with [[Speed module]]s.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; &lt;br /&gt;
! Resource&lt;br /&gt;
! [[File:quality_normal.png|15px|link=Quality]] Normal&lt;br /&gt;
! [[File:quality_uncommon.png|15px|link=Quality]] Uncommon&lt;br /&gt;
! [[File:quality_rare.png|15px|link=Quality]] Rare&lt;br /&gt;
! [[File:quality_epic.png|15px|link=Quality]] Epic&lt;br /&gt;
! [[File:quality_legendary.png|15px|link=Quality]] Legendary&lt;br /&gt;
|-&lt;br /&gt;
! {{Icon|Iron plate}}{{Icon|Copper plate}}{{Icon|Stone brick}}&lt;br /&gt;
| 0.625/sec || 0.8125/sec || 1/sec || 1.1875/sec || 1.5625/sec&lt;br /&gt;
|-&lt;br /&gt;
! {{Icon|Lithium plate|space-age=yes}} &lt;br /&gt;
| 0.3125/sec || 0.40625/sec || 0.5/sec || 0.59375/sec || 0.78125/sec&lt;br /&gt;
|-&lt;br /&gt;
! {{Icon|Steel plate}} &lt;br /&gt;
| 0.125/sec || 0.1625/sec || 0.2/sec || 0.2375/sec || 0.3125/sec&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== History ==&lt;br /&gt;
{{history|0.6.1|&lt;br /&gt;
* Now has the same smelting speed as the steel furnace.}}&lt;br /&gt;
&lt;br /&gt;
{{history|0.6.0|&lt;br /&gt;
* Introduced}}&lt;br /&gt;
&lt;br /&gt;
== See also ==&lt;br /&gt;
* [[Electric system]]&lt;br /&gt;
&lt;br /&gt;
{{ProductionNav}}&lt;br /&gt;
{{C|Furnaces}}&lt;/div&gt;</summary>
		<author><name>Untitled7</name></author>
	</entry>
	<entry>
		<id>https://wiki.factorio.com/index.php?title=Infobox:Boiler&amp;diff=204156</id>
		<title>Infobox:Boiler</title>
		<link rel="alternate" type="text/html" href="https://wiki.factorio.com/index.php?title=Infobox:Boiler&amp;diff=204156"/>
		<updated>2024-11-01T13:25:24Z</updated>

		<summary type="html">&lt;p&gt;Untitled7: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{infobox&lt;br /&gt;
|required-technologies = Steam power&lt;br /&gt;
|resistance = {{Translation|Explosion}}: 0/30%&amp;lt;br&amp;gt;{{Translation|Fire}}: 0/90%&amp;lt;br&amp;gt;{{Translation|Impact}}: 0/30%&lt;br /&gt;
|mining-time = 0.2&lt;br /&gt;
|map-color = 006090&lt;br /&gt;
|prototype-type = boiler&lt;br /&gt;
|internal-name = boiler&lt;br /&gt;
|image = Boiler entity&lt;br /&gt;
|category = Production&lt;br /&gt;
|health = {{Quality|200|260|320|380|500}}&lt;br /&gt;
|stack-size   =50&lt;br /&gt;
|dimensions   =2×3&lt;br /&gt;
|energy       =1.8 {{Translation|MW}} burner&lt;br /&gt;
|power-output  =1.8 {{Translation|MW}}&amp;lt;br /&amp;gt;({{Translation|liquid heat}})&lt;br /&gt;
|pollution = 30{{Translation|/m}}&lt;br /&gt;
|fluid-storage-volume ={{Translation|Input}}: 200&amp;lt;br&amp;gt;{{Translation|Output}}: 200&lt;br /&gt;
|valid-fuel = Wood + Coal + Solid fuel + Rocket fuel + Nuclear fuel&lt;br /&gt;
|recipe = Time, 0.5 + Pipe, 4 + Stone furnace, 1&lt;br /&gt;
|total-raw = Time, 3 + Iron plate, 4 + Stone, 5&lt;br /&gt;
|producers = Assembling machine + Player&lt;br /&gt;
}}&amp;lt;noinclude&amp;gt;[[category:Infobox page]]&amp;lt;/noinclude&amp;gt;&lt;/div&gt;</summary>
		<author><name>Untitled7</name></author>
	</entry>
	<entry>
		<id>https://wiki.factorio.com/index.php?title=Belt_transport_system&amp;diff=204154</id>
		<title>Belt transport system</title>
		<link rel="alternate" type="text/html" href="https://wiki.factorio.com/index.php?title=Belt_transport_system&amp;diff=204154"/>
		<updated>2024-11-01T12:43:00Z</updated>

		<summary type="html">&lt;p&gt;Untitled7: /* Belt throughput */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Languages}}&lt;br /&gt;
[[File:transport_belt_preview.png|right]]The belt transport system is the first system the [[player]] will use to transport items from place to place. It, along with [[Railway|trains]], and [[Logistic network|Logistic robots]], makes up the systems of item transportation in Factorio.&lt;br /&gt;
&lt;br /&gt;
Belts specifically are used to transport items and run without using energy. Belts can also interact with other moving entities such as [[player]]s, [[vehicle]]s and [[enemies]], also allowing for faster or slower movement speed.&lt;br /&gt;
&lt;br /&gt;
== Belt tier overview ==&lt;br /&gt;
[[File:Transport_belts_speed.gif|300px|thumb|top|Animation showing the three types of belt and their speed (from top to bottom: regular belts, fast belts, and express belts).]]&lt;br /&gt;
There are 3 different tiers of belts available for use. The [[transport belt]] has a yellow color and is the slowest, as well as the cheapest to craft. The next tier up, the [[fast transport belt]] has a red color and is twice as fast as the standard transport belt. The [[express transport belt]] is the final tier. It is colored blue and is three times faster than normal belts, or 1.5× faster than red belts.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! [[Transport belts]] !!  [[Underground belts]] !!  [[Splitters]] !! Max. throughput&amp;lt;br&amp;gt;(Items/[[Time#Seconds|second]]) !! Needed research&lt;br /&gt;
|-&lt;br /&gt;
| {{Imagelink|Transport belt}}&lt;br /&gt;
| {{Imagelink|Underground belt}}&lt;br /&gt;
| {{Imagelink|Splitter|Splitter}} &lt;br /&gt;
| 15&lt;br /&gt;
| [[Logistics (research)]]&amp;lt;sup&amp;gt;1&amp;lt;/sup&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| {{Imagelink|Fast transport belt}}&lt;br /&gt;
| {{Imagelink|Fast underground belt}}&lt;br /&gt;
| {{Imagelink|Fast splitter}} &lt;br /&gt;
| 30&lt;br /&gt;
| [[Logistics 2 (research)]]&lt;br /&gt;
|-&lt;br /&gt;
| {{Imagelink|Express transport belt}}&lt;br /&gt;
| {{Imagelink|Express underground belt}}&lt;br /&gt;
| {{Imagelink|Express splitter}}&lt;br /&gt;
| 45&lt;br /&gt;
| [[Logistics 3 (research)]]&lt;br /&gt;
|-&lt;br /&gt;
| {{Imagelink|Turbo transport belt|space-age=yes}}&lt;br /&gt;
| {{Imagelink|Turbo underground belt|space-age=yes}}&lt;br /&gt;
| {{Imagelink|Turbo splitter|space-age=yes}}&lt;br /&gt;
| 60&lt;br /&gt;
| [[Turbo transport belt (research)]]&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;sup&amp;gt;(1)&amp;lt;/sup&amp;gt; Only for the underground belt and splitter. The basic transport belt is available at the start of the game.&lt;br /&gt;
&lt;br /&gt;
Regardless of the belt tier, a fully filled straight transport belt holds 8 items in total. For more information on this, see [[Transport belts/Physics]] and [https://factorio.com/blog/post/fff-276 Friday Facts #276 - Belt item spacing].&lt;br /&gt;
{{clear}}&lt;br /&gt;
&lt;br /&gt;
== Belt mechanics ==&lt;br /&gt;
&lt;br /&gt;
=== Merging and un-merging belts ===&lt;br /&gt;
&lt;br /&gt;
Belts of all tiers have 2 lanes for items to ride on. This allows for either a double flow of one material, or to transport two different materials on the same belt. Mixed belts can be beneficial for&lt;br /&gt;
smelting ore, or producing items with many different ingredients such as [[Utility science pack]]. The belt can be unmerged using a splitter filter. It is also possible to unmerge a mixed belt by using underground belts since an underground belt will block half of the belt. &lt;br /&gt;
&lt;br /&gt;
[[File:Transport_belts_2_lanes.gif|top]]&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;[[File:Transport_belts_unmerge.gif|top]]&lt;br /&gt;
&lt;br /&gt;
Belts going across a splitter will have items from the splitter moving to one side of the crossing belt.&lt;br /&gt;
&lt;br /&gt;
[[File:splitters_to_one_side.gif|top|Splitters moving objects to just one side of a belt.]]&lt;br /&gt;
&lt;br /&gt;
Commonly, merging and un-merging is done by using a [[splitter]]. The trick in the second gif is better described in the &#039;&#039;&#039;[[Belt_transport_system#Separating_belt_lanes|underground belt]]&#039;&#039;&#039; section.&lt;br /&gt;
&lt;br /&gt;
=== Lane balance ===&lt;br /&gt;
&lt;br /&gt;
Due to how items are placed onto belts by [[inserters]], their lanes can sometimes become unbalanced. In order to&lt;br /&gt;
maintain throughput, balancing the lanes may be necessary. The gifs below show two ways how to do this. The former only works if only one lane is in use initially. For further explanation of the mechanics, see [[Balancer mechanics#Lane_balancers|lane balancers]].&lt;br /&gt;
&lt;br /&gt;
[[File:Transport_belts_balance1.gif|top]]&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;[[File:Transport_belts_balance2.gif|top]]&lt;br /&gt;
&lt;br /&gt;
=== Belt throughput ===&lt;br /&gt;
[[File:Stack inserters fill express belt.gif|frame|230px|right|4 [[bulk inserter]]s can compress an express belt at stack size 12 for the left inserters and stack size 8 for the right inserters.]]&lt;br /&gt;
Maximizing the throughput means ensuring that as many items as possible are transported. Therefore some definitions need to&lt;br /&gt;
be introduced:&lt;br /&gt;
&lt;br /&gt;
; Speed &lt;br /&gt;
: How fast a belt moves in tiles per second. This is 1.875, 3.75, 5.625 and 7.5 for basic, fast, express and turbo belts respectively.&lt;br /&gt;
; Density &lt;br /&gt;
: How tight are the items put onto the belts; each straight belt piece can hold exactly 8 items.&lt;br /&gt;
; Throughput &lt;br /&gt;
: This is speed × density. It describes how many items pass by at a given time.&lt;br /&gt;
&lt;br /&gt;
So, there are three opportunities to enhance the throughput:&lt;br /&gt;
&lt;br /&gt;
; More density &lt;br /&gt;
:Sometimes items have small gaps in between each other that aren&#039;t big enough for other items to fit in. However, mining drills, inserters, and belt sideloading can still force an item into these gaps, temporarily squashing the items on the belt. The squashed gap is extended to normal size once the front of the belt starts to move again.&lt;br /&gt;
; More speed &lt;br /&gt;
:If the belts in the factory are already at maximum density, their speed can still be upgraded with better belts.  Finding the bottleneck is the first thing that needs to be done, usually it can be discovered quite easily. There will be a part of the belt where the items don&#039;t move quickly (or at all) or stop at maximum density and suddenly they come to a point where this &#039;stop and go&#039; effect releases itself, the bottleneck has been found. In most cases, this will be the place where belt optimization is needed.&lt;br /&gt;
; More belts &lt;br /&gt;
:Adding additional parallel belts can also increase the throughput. Simply place more belts carrying the item that needs throughput.&lt;br /&gt;
&lt;br /&gt;
=== Belt tricks ===&lt;br /&gt;
&lt;br /&gt;
Moving fast can be essential to defend alien attacks in time. Running on a belt will increase or decrease the movement speed of the [[player]] accordingly to the belts speed. That is why building a belt towards your defenses can be beneficial.&lt;br /&gt;
&lt;br /&gt;
However, the player is not the only unit that can be moved by transport belts. Additionally, biters and spitters can be moved. This can be abused to improve your defense. Firstly, biters will have a harder time to reach your walls when placing express transport belt in front of them. Secondly, spitters can be moved closer to your walls. That way more turrets can attack a single spitter at once.&lt;br /&gt;
&lt;br /&gt;
Another useful usage is [[car]]s on transport belts. Cars have an inventory and can be filled by [[inserters]]. So, they can be used as moving boxes on belts. This has several advantages: Firstly the throughput of the belt-car-boxes is amazingly high, secondly the inserter stack size bonus does apply here and makes inserters more effective.&lt;br /&gt;
&lt;br /&gt;
== Splitters ==&lt;br /&gt;
&lt;br /&gt;
[[Splitters]] are another form of item manipulation. Splitters are a 2×1 entity that splits incoming items on belts&lt;br /&gt;
from up to two input to up to two outputs, in a 1:1 ratio. They are used to divide resources between two belts, or balance&lt;br /&gt;
multiple belts.&lt;br /&gt;
&lt;br /&gt;
=== Mechanics ===&lt;br /&gt;
&lt;br /&gt;
The behavior of splitters looks simple at first glance. But they are not that simple. Splitters have an astonishing amount of uses.&lt;br /&gt;
&lt;br /&gt;
* Splitters have two input belts and two output belts. If the splitter receives items on one belt, it will split the input evenly between its two outputs. If one of the outputs is fully backed-up and the splitter cannot split evenly, it will put all input on its other output.&lt;br /&gt;
* Splitters can also merge belts, taking two inputs and one output.&lt;br /&gt;
* Splitters preserve the lanes of the items, by moving through the splitter an item on the right lane will not be moved to the left lane, and vice versa.&lt;br /&gt;
* Splitters can prioritize one input and/or one output. Clicking on a splitter opens its GUI where the priorities can be set.&lt;br /&gt;
* One output of the splitter can be filtered to one item. Items of that type will only go to that output, and not to the other one.&lt;br /&gt;
&lt;br /&gt;
The speed of the splitter is the same as its relevant type of belt, so in order to properly join/split belts, the splitter must be the same speed as the incoming belts. Otherwise the splitter will become a bottleneck.&lt;br /&gt;
&lt;br /&gt;
==== Priority ====&lt;br /&gt;
For both the input and output side of the splitter it is possible to set the priority to either left or right.&lt;br /&gt;
&lt;br /&gt;
A splitter where the input priority has been set will first try to consume the specified input side, and will only&lt;br /&gt;
consume the other input once there is a gap on the prioritized input belt.&lt;br /&gt;
&lt;br /&gt;
Similarly a splitter where the output priority has been set will try to redirect all incoming items&lt;br /&gt;
to the specified output, and will only output on the other output once the specified output is full.&lt;br /&gt;
&lt;br /&gt;
==== Filter ====&lt;br /&gt;
If a specific item is set in the splitter&#039;s filter slot, the slider for the output priority will&lt;br /&gt;
be used for the filter instead. All items of the set type will be redirected to that specific output&lt;br /&gt;
and all other items are directed to the other output. The input priority can be set independently of the filter.&lt;br /&gt;
&lt;br /&gt;
=== Balancing ===&lt;br /&gt;
&lt;br /&gt;
{{Main|Balancer mechanics}}&lt;br /&gt;
&lt;br /&gt;
Balancers are used to evenly distribute items over multiple belts or multiple belt lanes.&lt;br /&gt;
&lt;br /&gt;
=== Manipulating belt lanes ===&lt;br /&gt;
&amp;lt;gallery mode=&amp;quot;slideshow&amp;quot;&amp;gt;&lt;br /&gt;
File:Swap_belt_lanes.png|Swapping lanes on a belt with a different item per belt lane.&lt;br /&gt;
File:Splitter_seperate_belt_lanes.png|Separating lanes with different items on them.&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== [[Circuit network]] ==&lt;br /&gt;
&lt;br /&gt;
[[File:transport_belt_circuits.png|thumb|200px|Two belts connected to a [[constant combinator]].]][[Red wire|Red]] or [[green wire]]s can be connected to segments of transport belts to use them as part of a circuit. Belts connected to the circuit network will appear with a yellow cage above them, with a moving red scanner within it. When a belt is connected to a circuit, a GUI can be accessed from the connected belt for settings on how the belt will be used for a circuit; there are two modes of operation that can be used:&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Enable/disable&#039;&#039;&#039; - A circuit condition dictates whether or not the belt will allow items through.&amp;lt;br /&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;Read belt contents&#039;&#039;&#039; - If enabled, the contents on the belt will be read.&lt;br /&gt;
&lt;br /&gt;
The belt&#039;s GUI will also have a &amp;quot;content read mode&amp;quot; setting, which can be set to either &#039;&#039;&#039;pulse&#039;&#039;&#039; or &#039;&#039;&#039;hold&#039;&#039;&#039;. &#039;&#039;&#039;Pulse&#039;&#039;&#039; will read the belt&#039;s contents for only one [[Time|tick]], while &#039;&#039;&#039;hold&#039;&#039;&#039; will read the belt&#039;s contents continuously on every tick.&lt;br /&gt;
&lt;br /&gt;
[[File:transport_belt_circuit_gui.png|thumb|right|Transport belt GUI.|130px]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;gallery mode=&amp;quot;slideshow&amp;quot;&amp;gt;&lt;br /&gt;
File:transport_belt_circuit_example1.gif|A small example of a transport belt circuit reading belt contents to trigger two lamps.&lt;br /&gt;
File:transport_belt_circuit_example2.gif|[[Fast inserter]]s are activated by the [[arithmetic combinator]]s&#039; setup; when a specific item enters a belt segment that&#039;s connected to the circuit network, the inserters place the same item on another belt.&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
{{clear}}&lt;br /&gt;
&lt;br /&gt;
== Underground belts ==&lt;br /&gt;
&lt;br /&gt;
Underground belts can be used to cross different flows of items without interfering. They move items like a [[Transport belts|normal belt]].&lt;br /&gt;
&lt;br /&gt;
[[File:4-6-8.png|thumb|right|Underground lengths|200px]]&lt;br /&gt;
* Underground belts can cross any number of entities and all types of ground, like water and grass. (as long as the input and output endpoints are on land)&lt;br /&gt;
* Underground belts can cross other underground entities (any number of underground belts or underground pipes). They won&#039;t be mixed.&lt;br /&gt;
* For the connection only the endpoints (entry-side and exit-side) are relevant.&lt;br /&gt;
* The underground distance is 4, 6 and 8 [[Map_structure#Tile|tiles]], respectivly, for the three belt types.&lt;br /&gt;
* An underground belt pair that bridges a gap of 4 tiles stores up to 44 items. An express underground belt pair at max length stores up to 72 items.&lt;br /&gt;
* The half of the underground belt tile with a belt can accept input from the side. The other half (with a tunnel entrance) blocks incoming items.&lt;br /&gt;
&lt;br /&gt;
=== Separating belt lanes ===&lt;br /&gt;
&amp;lt;gallery mode=&amp;quot;slideshow&amp;quot;&amp;gt;&lt;br /&gt;
File:Block belt lane.png|This is built by placing one underground belt and then using R to reverse its direction. This converts the underground belt entrance to an exit (and vice versa).&lt;br /&gt;
File:Transport belts unmerge.gif|This can also be used to split the lanes of a belt onto seperate belts instead of using a splitter filter.&amp;lt;/gallery&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Braiding ===&lt;br /&gt;
&amp;lt;gallery mode=&amp;quot;slideshow&amp;quot;&amp;gt;&lt;br /&gt;
File:underground_belt_braiding.gif|Different types of underground belts can be braided together along the same line of tiles, with items staying in their respective belt types.&lt;br /&gt;
File:underground_belt_braiding2.gif|The same concept, but with a different belt design.&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Braiding can be particularly useful where more than two input lanes are required while also avoiding the use of a parallel belt/[[long-handed inserter]] combination. For example, this can be useful if there is limited space, such as when using a beacon. With a beacon range of 3 orthogonal tiles, two of which would be occupied by a belt and inserter, it would not be possible to place the parallel belt in the third space and still have a beacon on the same side, as the assembler would now be in the fourth tile and not in range. With the space saved by braiding, this is now possible.&lt;br /&gt;
&lt;br /&gt;
== See also ==&lt;br /&gt;
* [[Splitters]]&lt;br /&gt;
* [[Transport belts]]&lt;br /&gt;
* [[Underground belts]]&lt;br /&gt;
&lt;br /&gt;
{{C|Logistics{{!}}#Belt transport system}} {{C|Belt transport system{{!}}#Belt transport system}}&lt;/div&gt;</summary>
		<author><name>Untitled7</name></author>
	</entry>
	<entry>
		<id>https://wiki.factorio.com/index.php?title=Talk:Electric_furnace&amp;diff=204084</id>
		<title>Talk:Electric furnace</title>
		<link rel="alternate" type="text/html" href="https://wiki.factorio.com/index.php?title=Talk:Electric_furnace&amp;diff=204084"/>
		<updated>2024-10-31T20:47:54Z</updated>

		<summary type="html">&lt;p&gt;Untitled7: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Quality table: what are the rows for? ==&lt;br /&gt;
[[User:Omnifarious]], there are 4 rows with different values for each quality. What do they mean if electric furnaces can only have 2 modules max? A column is missing to explain them. [[User:Vadcx|Vadcx]] ([[User talk:Vadcx|talk]]) 12:10, 31 October 2024 (UTC)&lt;br /&gt;
: [[User:Untitled7]] I have no idea what the current table is supposed to be either. I&#039;d guess that the table is supposed to look like this:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;margin-left:1.6em&amp;quot; &amp;lt;!-- the margin-left and Crafting Speeds are only here for the discussion, shouldn&#039;t be in the final version --&amp;gt;&lt;br /&gt;
! Resource&lt;br /&gt;
! [[File:quality_normal.png|15px|link=Quality]] Normal&amp;lt;br&amp;gt;&amp;lt;span title=&amp;quot;Crafting Speed&amp;quot; style=&amp;quot;text-decoration: dotted underline;&amp;quot;&amp;gt;Speed: 2&amp;lt;/span&amp;gt;&lt;br /&gt;
! [[File:quality_uncommon.png|15px|link=Quality]] Uncommon&amp;lt;br&amp;gt;&amp;lt;span title=&amp;quot;Crafting Speed&amp;quot; style=&amp;quot;text-decoration: dotted underline;&amp;quot;&amp;gt;Speed: 2.6&amp;lt;/span&amp;gt;&lt;br /&gt;
! [[File:quality_rare.png|15px|link=Quality]] Rare&amp;lt;br&amp;gt;&amp;lt;span title=&amp;quot;Crafting Speed&amp;quot; style=&amp;quot;text-decoration: dotted underline;&amp;quot;&amp;gt;Speed: 3.2&amp;lt;/span&amp;gt;&lt;br /&gt;
! [[File:quality_epic.png|15px|link=Quality]] Epic&amp;lt;br&amp;gt;&amp;lt;span title=&amp;quot;Crafting Speed&amp;quot; style=&amp;quot;text-decoration: dotted underline;&amp;quot;&amp;gt;Speed: 3.8&amp;lt;/span&amp;gt;&lt;br /&gt;
! [[File:quality_legendary.png|15px|link=Quality]] Legendary&amp;lt;br&amp;gt;&amp;lt;span title=&amp;quot;Crafting Speed&amp;quot; style=&amp;quot;text-decoration: dotted underline;&amp;quot;&amp;gt;Speed: 5&amp;lt;/span&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| {{Icon|Iron plate}} {{Icon|Copper plate}} {{Icon|Stone brick}} || 0.625/s || 0.8125/s || 1/s || 1.1875/s || 1.5625/s&lt;br /&gt;
|-&lt;br /&gt;
| {{Icon|Steel plate}} || 0.125/s || 0.1625/s || 0.2/s || 0.2375/s || 0.3125/s&lt;br /&gt;
|}&lt;br /&gt;
: --[[User:Untitled7|Untitled7]] ([[User talk:Untitled7|talk]]) 20:47, 31 October 2024 (UTC)&lt;/div&gt;</summary>
		<author><name>Untitled7</name></author>
	</entry>
	<entry>
		<id>https://wiki.factorio.com/index.php?title=Infobox:Electric_furnace&amp;diff=204069</id>
		<title>Infobox:Electric furnace</title>
		<link rel="alternate" type="text/html" href="https://wiki.factorio.com/index.php?title=Infobox:Electric_furnace&amp;diff=204069"/>
		<updated>2024-10-31T20:13:37Z</updated>

		<summary type="html">&lt;p&gt;Untitled7: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{infobox&lt;br /&gt;
|resistance = {{Translation|Fire}}: 0/80%&lt;br /&gt;
|mining-time = 0.2&lt;br /&gt;
|map-color = 006090&lt;br /&gt;
|prototype-type = furnace&lt;br /&gt;
|internal-name = electric-furnace&lt;br /&gt;
|category = Production&lt;br /&gt;
|health = {{Quality|350|455|560|665|875}}&lt;br /&gt;
|dimensions=3×3&lt;br /&gt;
|image=Electric furnace entity&lt;br /&gt;
|energy=180 {{Translation|kW}} electric&lt;br /&gt;
|crafting-speed={{Quality|2|2.6|3.2|3.8|5}}&lt;br /&gt;
|drain=6 {{Translation|kW}} electric&lt;br /&gt;
|modules=2&lt;br /&gt;
|pollution = 1{{Translation|/m}}&lt;br /&gt;
|stack-size=50&lt;br /&gt;
|recipe = Time, 5 + Advanced circuit, 5 + Steel plate, 10 + Stone brick, 10&lt;br /&gt;
|total-raw = Time, 52.5 + Copper plate, 25 + Iron plate, 10 + Plastic bar, 10 + Steel plate, 10 + Stone brick, 10&lt;br /&gt;
|required-technologies = Advanced material processing 2&lt;br /&gt;
|producers = Assembling machine + Player&lt;br /&gt;
|consumers = Production science pack&lt;br /&gt;
}}&amp;lt;noinclude&amp;gt;[[Category:Infobox page]]&amp;lt;/noinclude&amp;gt;&lt;/div&gt;</summary>
		<author><name>Untitled7</name></author>
	</entry>
	<entry>
		<id>https://wiki.factorio.com/index.php?title=Recycler&amp;diff=204044</id>
		<title>Recycler</title>
		<link rel="alternate" type="text/html" href="https://wiki.factorio.com/index.php?title=Recycler&amp;diff=204044"/>
		<updated>2024-10-31T19:27:47Z</updated>

		<summary type="html">&lt;p&gt;Untitled7: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Languages}}&lt;br /&gt;
{{:Infobox:Recycler}}&lt;br /&gt;
{{Stub}}&lt;br /&gt;
{{About/Space age}}&lt;br /&gt;
&lt;br /&gt;
The &#039;&#039;&#039;recycler&#039;&#039;&#039; is a building that can convert most items into the ingredients used in their recipes, at the cost of losing 75% of said ingredients. In other words, it performs a lossy reversal of crafting.&lt;br /&gt;
&lt;br /&gt;
It has 4 module slots, but it cannot use [[Productivity module]]s.&lt;br /&gt;
&lt;br /&gt;
== Mechanics ==&lt;br /&gt;
&lt;br /&gt;
When an item enters a recycler, the item&#039;s main recipe is found, and the recycler is automatically set to perform its inverse.&lt;br /&gt;
&lt;br /&gt;
For each type of item used as an ingredient in the recycled item&#039;s main recipe, the number of items returned by the recycler is decided by &amp;lt;code&amp;gt;floor(0.25 * i / o + r)&amp;lt;/code&amp;gt;, where &amp;lt;code&amp;gt;i&amp;lt;/code&amp;gt; is the number of items used as ingredients, &amp;lt;code&amp;gt;o&amp;lt;/code&amp;gt; is the number of items returned by the recipe, and &amp;lt;code&amp;gt;r&amp;lt;/code&amp;gt; is a random number that is greater than or equal to 0 but less than 1. On average, this returns exactly 25% of the items needed to craft one item of the same type as the recycled item. For example, recycling a [[processing unit]] always gives 5 [[electronic circuit]]s while having a 50% chance of returning one [[advanced circuit]].&lt;br /&gt;
&lt;br /&gt;
All fluid ingredients are lost when recycling, as the recycler has no fluid output.[https://www.reddit.com/r/factorio/comments/16d7h82/friday_facts_375_quality/jzpac1z/]&lt;br /&gt;
&lt;br /&gt;
Without quality modules, the resulting items have the same quality as the item being recycled, even if the latter was crafted using lower-quality ingredients. Quality modules can further increase the output&#039;s quality, just like with regular non-recycling recipes.&lt;br /&gt;
&lt;br /&gt;
The recycler has 12 internal slots for its output, but can only hold one stack of each item. The recycler will try to eject the contents of these slots, much like a mining drill. It is therefore not necessary to use an inserter to collect its output.&lt;br /&gt;
&lt;br /&gt;
=== Non-recyclable items ===&lt;br /&gt;
Some items, such as ores, have no recipe, and can therefore not be recycled. There are also some recipes that are irreversible, which include smelting and chemical processes.[https://discord.com/channels/139677590393716737/603392474458882065/1149692470511276152]&lt;br /&gt;
&lt;br /&gt;
When an item with no reversible recipe is &amp;quot;recycled&amp;quot;, then the same item has a 25% chance of being returned, and a 75% chance of being destroyed instead. This can be used to destroy unwanted items, such as byproducts from [[scrap recycling]].&lt;br /&gt;
&lt;br /&gt;
Irreversible recipes include (but may not be limited to:&lt;br /&gt;
* Recipes performed in furnaces or chemical plants&lt;br /&gt;
* Recipes for science packs&lt;br /&gt;
* Recipes for [[uranium fuel cell]]s&lt;br /&gt;
* Recipes for [[biolab]]s or [[captive biter spawner]]s&lt;br /&gt;
* Recipes for spoilable products&lt;br /&gt;
&lt;br /&gt;
=== Unique recycling recipes ===&lt;br /&gt;
&lt;br /&gt;
Some items have unique recycling recipes:&lt;br /&gt;
&lt;br /&gt;
* Recycling [[scrap]] will perform the [[scrap recycling]] recipe, for which there is no inverse, as scrap can not be crafted. This is used to obtain most resources on [[Fulgora]].&lt;br /&gt;
* Recycling one [[nutrients]] will yield 2.5x that amount of [[spoilage]]. This is useful for getting rid of excess nutrients, as they cannot be burned directly.&lt;br /&gt;
&lt;br /&gt;
=== Stats ===&lt;br /&gt;
Scrap recycling rates:&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Input ||  Output || Chance || Rate&lt;br /&gt;
|-&lt;br /&gt;
| rowspan=&amp;quot;12&amp;quot; | {{Imagelink|Scrap|space-age=yes}}&lt;br /&gt;
| {{Imagelink|Processing unit}}  || 2% || 0.05/s&lt;br /&gt;
|-&lt;br /&gt;
| {{Imagelink|Advanced circuit}}  || 3% || 0.08/s&lt;br /&gt;
|-&lt;br /&gt;
| {{Imagelink|Low density structure}}  || 1%  || 0.02/s&lt;br /&gt;
|-&lt;br /&gt;
| {{Imagelink|Solid fuel}}  || 7%  || 0.19/s&lt;br /&gt;
|-&lt;br /&gt;
| {{Imagelink|Steel plate}}  || 4%  || 0.11/s&lt;br /&gt;
|-&lt;br /&gt;
| {{Imagelink|Concrete}}  || 6%  || 0.16/s&lt;br /&gt;
|-&lt;br /&gt;
| {{Imagelink|Battery}}  || 4%  || 0.11/s&lt;br /&gt;
|-&lt;br /&gt;
| {{Imagelink|Ice|space-age=yes}}  || 5%  || 0.13/s&lt;br /&gt;
|-&lt;br /&gt;
| {{Imagelink|Stone}}  || 4% || 0.11/s&lt;br /&gt;
|-&lt;br /&gt;
| {{Imagelink|Holmium ore|space-age=yes}}  || 1%  || 0.02/s&lt;br /&gt;
|-&lt;br /&gt;
| {{Imagelink|Iron gear wheel}}  || 20%  || 0.55/s&lt;br /&gt;
|-&lt;br /&gt;
| {{Imagelink|Copper cable}}  || 3%  || 0.08/s&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Alternatively, the recycler takes in 2.5 scrap/s and spits out 1.47 items/s, meaning 10 recyclers are enough to almost saturate a yellow belt. &amp;lt;br&amp;gt;&lt;br /&gt;
Additionally the recycling times for various items are different from the usual 0.125s. This is not an exhaustive list and is specified in item/s input.&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;text-align: left !important;&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Recycler Input !! Rates&lt;br /&gt;
|-&lt;br /&gt;
| {{Imagelink|Processing unit}}  || 0.8/s&lt;br /&gt;
|-&lt;br /&gt;
| {{Imagelink|Advanced circuit}}  || 1.33/s&lt;br /&gt;
|-&lt;br /&gt;
| {{Imagelink|Low density structure}}  || 0.5/s&lt;br /&gt;
|-&lt;br /&gt;
| {{Imagelink|Steel plate}}  || 0.5/s&lt;br /&gt;
|-&lt;br /&gt;
| {{Imagelink|Copper plate}}  || 2.5/s&lt;br /&gt;
|-&lt;br /&gt;
| {{Imagelink|Iron plate}}  || 2.5/s&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Trivia ==&lt;br /&gt;
* If the recycled item has a fluid ingredient, then the smoke emitted from the recycler matches the fluid in colour.&lt;br /&gt;
&lt;br /&gt;
== Gallery ==&lt;br /&gt;
[[File:Fff-375-recycler-freezeframe.png|500px]]&lt;br /&gt;
&lt;br /&gt;
== History ==&lt;br /&gt;
{{history|2.0.7|&lt;br /&gt;
* Introduced in [[Space Age]]{{SA}} expansion.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
== See also ==&lt;br /&gt;
* [[Quality]]{{SA}}&lt;br /&gt;
&lt;br /&gt;
{{ProductionNav}}&lt;br /&gt;
{{C|Producers}}&lt;/div&gt;</summary>
		<author><name>Untitled7</name></author>
	</entry>
	<entry>
		<id>https://wiki.factorio.com/index.php?title=Recycler&amp;diff=203966</id>
		<title>Recycler</title>
		<link rel="alternate" type="text/html" href="https://wiki.factorio.com/index.php?title=Recycler&amp;diff=203966"/>
		<updated>2024-10-31T08:53:05Z</updated>

		<summary type="html">&lt;p&gt;Untitled7: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Languages}}&lt;br /&gt;
{{:Infobox:Recycler}}&lt;br /&gt;
{{Stub}}&lt;br /&gt;
{{About/Space age}}&lt;br /&gt;
&lt;br /&gt;
The &#039;&#039;&#039;recycler&#039;&#039;&#039; is a building that can convert most items into the ingredients used in their recipes, at the cost of losing 75% of said ingredients. In other words, it performs a lossy reversal of crafting.&lt;br /&gt;
&lt;br /&gt;
It has 4 module slots, but it cannot use [[Productivity module]]s.&lt;br /&gt;
&lt;br /&gt;
== Mechanics ==&lt;br /&gt;
&lt;br /&gt;
When an item enters a recycler, the item&#039;s main recipe is found, and the recycler is automatically set to perform its inverse.&lt;br /&gt;
&lt;br /&gt;
For each type of item used as an ingredient in the recycled item&#039;s main recipe, the number of items returned by the recycler is decided by &amp;lt;code&amp;gt;floor(0.25 * i / o + r) * 100%&amp;lt;/code&amp;gt;, where &amp;lt;code&amp;gt;i&amp;lt;/code&amp;gt; is the number of items used as ingredients, &amp;lt;code&amp;gt;o&amp;lt;/code&amp;gt; is the number of items returned by the recipe, and &amp;lt;code&amp;gt;r&amp;lt;/code&amp;gt; is a random number that is greater than or equal to 0 but less than 1. On average, this returns exactly 25% of the items needed to craft one item of the same type as the recycled item. For example, recycling a [[processing unit]] always gives 5 [[electronic circuit]]s while having a 50% chance of returning one [[advanced circuit]].&lt;br /&gt;
&lt;br /&gt;
All fluid ingredients are lost when recycling, as the recycler has no fluid output.[https://www.reddit.com/r/factorio/comments/16d7h82/friday_facts_375_quality/jzpac1z/]&lt;br /&gt;
&lt;br /&gt;
Without quality modules, the resulting items have the same quality as the item being recycled, even if the latter was crafted using lower-quality ingredients. Quality modules can further increase the output&#039;s quality, just like with regular non-recycling recipes.&lt;br /&gt;
&lt;br /&gt;
The recycler has 12 internal slots for its output, but can only hold one stack of each item. The recycler will try to eject the contents of these slots, much like a mining drill. It is therefore not necessary to use an inserter to collect its output.&lt;br /&gt;
&lt;br /&gt;
=== Non-recyclable items ===&lt;br /&gt;
Some items, such as ores, have no recipe, and can therefore not be recycled. There are also some recipes that are irreversible, which include smelting and chemical processes.[https://discord.com/channels/139677590393716737/603392474458882065/1149692470511276152]&lt;br /&gt;
&lt;br /&gt;
When an item with no reversible recipe is &amp;quot;recycled&amp;quot;, then the same item has a 25% chance of being returned, and a 75% chance of being destroyed instead. This can be used to destroy unwanted items, such as byproducts from [[scrap recycling]].&lt;br /&gt;
&lt;br /&gt;
Irreversible recipes include (but may not be limited to:&lt;br /&gt;
* Recipes performed in furnaces or chemical plants&lt;br /&gt;
* Recipes for science packs&lt;br /&gt;
* Recipes for [[uranium fuel cell]]s&lt;br /&gt;
* Recipes for [[biolab]]s or [[captive biter spawner]]s&lt;br /&gt;
* Recipes for spoilable products&lt;br /&gt;
&lt;br /&gt;
=== Scrap recycling ===&lt;br /&gt;
As a special case, recycling [[scrap]] will perform the [[scrap recycling]] recipe, for which there is no inverse, as scrap can not be crafted. This is used to obtain most resources on [[Fulgora]].&lt;br /&gt;
&lt;br /&gt;
=== Stats ===&lt;br /&gt;
Scrap recycling rates:&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Input !! Output&lt;br /&gt;
|-&lt;br /&gt;
| {{Imagelink|Scrap|space-age=yes}} || &lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
| {{Imagelink|Processing unit}}  || 2% || 0.05/s&lt;br /&gt;
|-&lt;br /&gt;
| {{Imagelink|Advanced circuit}}  || 3% || 0.08/s&lt;br /&gt;
|-&lt;br /&gt;
| {{Imagelink|Low density structure}}  || 1%  || 0.02/s&lt;br /&gt;
|-&lt;br /&gt;
| {{Imagelink|Solid fuel}}  || 7%  || 0.19/s&lt;br /&gt;
|-&lt;br /&gt;
| {{Imagelink|Steel plate}}  || 4%  || 0.11/s&lt;br /&gt;
|-&lt;br /&gt;
| {{Imagelink|Concrete}}  || 6%  || 0.16/s&lt;br /&gt;
|-&lt;br /&gt;
| {{Imagelink|Battery}}  || 4%  || 0.11/s&lt;br /&gt;
|-&lt;br /&gt;
| {{Imagelink|Ice|space-age=yes}}  || 5%  || 0.13/s&lt;br /&gt;
|-&lt;br /&gt;
| {{Imagelink|Stone}}  || 4% || 0.11/s&lt;br /&gt;
|-&lt;br /&gt;
| {{Imagelink|Holmium ore|space-age=yes}}  || 1%  || 0.02/s&lt;br /&gt;
|-&lt;br /&gt;
| {{Imagelink|Iron gear wheel}}  || 20%  || 0.55/s&lt;br /&gt;
|-&lt;br /&gt;
| {{Imagelink|Copper cable}}  || 3%  || 0.08/s&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Alternatively, the recycler takes in 2.5 scrap/s and spits out 1.47 items/s, meaning 10 recyclers are enough to almost saturate a yellow belt. &amp;lt;br&amp;gt;&lt;br /&gt;
Additionally the recycling times for various items are different from the usual 0.125s. This is not an exhaustive list and is specified in item/s input.&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;text-align: left !important;&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Recycler Input !! Rates&lt;br /&gt;
|-&lt;br /&gt;
| {{Imagelink|Processing unit}}  || 0.8/s&lt;br /&gt;
|-&lt;br /&gt;
| {{Imagelink|Advanced circuit}}  || 1.33/s&lt;br /&gt;
|-&lt;br /&gt;
| {{Imagelink|Low density structure}}  || 0.5/s&lt;br /&gt;
|-&lt;br /&gt;
| {{Imagelink|Steel plate}}  || 0.5/s&lt;br /&gt;
|-&lt;br /&gt;
| {{Imagelink|Copper plate}}  || 2.5/s&lt;br /&gt;
|-&lt;br /&gt;
| {{Imagelink|Iron plate}}  || 2.5/s&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Trivia ==&lt;br /&gt;
* If the recycled item has a fluid ingredient, then the smoke emitted from the recycler matches the fluid in colour.&lt;br /&gt;
&lt;br /&gt;
== Gallery ==&lt;br /&gt;
[[File:Fff-375-recycler-freezeframe.png|500px]]&lt;br /&gt;
&lt;br /&gt;
== History ==&lt;br /&gt;
{{history|2.0.7|&lt;br /&gt;
* Introduced in [[Space Age]]{{SA}} expansion.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
== See also ==&lt;br /&gt;
* [[Quality]]{{SA}}&lt;br /&gt;
&lt;br /&gt;
{{ProductionNav}}&lt;br /&gt;
{{C|Producers}}&lt;/div&gt;</summary>
		<author><name>Untitled7</name></author>
	</entry>
	<entry>
		<id>https://wiki.factorio.com/index.php?title=Recycler&amp;diff=203964</id>
		<title>Recycler</title>
		<link rel="alternate" type="text/html" href="https://wiki.factorio.com/index.php?title=Recycler&amp;diff=203964"/>
		<updated>2024-10-31T08:09:47Z</updated>

		<summary type="html">&lt;p&gt;Untitled7: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Languages}}&lt;br /&gt;
{{:Infobox:Recycler}}&lt;br /&gt;
{{Stub}}&lt;br /&gt;
{{About/Space age}}&lt;br /&gt;
&lt;br /&gt;
The &#039;&#039;&#039;recycler&#039;&#039;&#039; is a building that can convert most items into the ingredients used in their recipes, at the cost of losing 75% of said ingredients. In other words, it performs a lossy reversal of crafting.&lt;br /&gt;
&lt;br /&gt;
It has 4 module slots, but it cannot use [[Productivity module]]s.&lt;br /&gt;
&lt;br /&gt;
== Mechanics ==&lt;br /&gt;
&lt;br /&gt;
When an item enters a recycler, the item&#039;s main recipe is found, and the recycler is automatically set to perform its inverse.&lt;br /&gt;
&lt;br /&gt;
For each type of item used as an ingredient in the recycled item&#039;s main recipe, the number of items returned by the recycler is decided by &amp;lt;code&amp;gt;floor(0.25 * i / o + r) * 100%&amp;lt;/code&amp;gt;, where &amp;lt;code&amp;gt;i&amp;lt;/code&amp;gt; is the number of items used as ingredients, &amp;lt;code&amp;gt;o&amp;lt;/code&amp;gt; is the number of items returned by the recipe, and &amp;lt;code&amp;gt;r&amp;lt;/code&amp;gt; is a random number that is greater than or equal to 0 but less than 1. On average, this returns exactly 25% of the items needed to craft one item of the same type as the recycled item. For example, recycling a [[processing unit]] always gives 5 [[electronic circuit]]s while having a 50% chance of returning one [[advanced circuit]].&lt;br /&gt;
&lt;br /&gt;
All fluid ingredients are lost when recycling, as the recycler has no fluid output.[https://www.reddit.com/r/factorio/comments/16d7h82/friday_facts_375_quality/jzpac1z/]&lt;br /&gt;
&lt;br /&gt;
Without quality modules, the resulting items have the same quality as the item being recycled, even if the latter was crafted using lower-quality ingredients. Quality modules can further increase the output&#039;s quality, just like with regular non-recycling recipes.&lt;br /&gt;
&lt;br /&gt;
The recycler has 12 internal slots for its output, but can only hold one stack of each item. The recycler will try to eject the contents of these slots, much like a mining drill. It is therefore not necessary to use an inserter to collect its output.&lt;br /&gt;
&lt;br /&gt;
=== Non-recyclable items ===&lt;br /&gt;
Some items, such as ores, have no recipe, and can therefore not be recycled. There are also some recipes that are irreversible, which include smelting and chemical processes.[https://discord.com/channels/139677590393716737/603392474458882065/1149692470511276152]&lt;br /&gt;
&lt;br /&gt;
When an item with no reversible recipe is &amp;quot;recycled&amp;quot;, then the same item has a 25% chance of being returned, and a 75% chance of being destroyed instead. This can be used to destroy unwanted items, such as byproducts from [[scrap recycling]].&lt;br /&gt;
&lt;br /&gt;
Irreversible recipes include (but may not be limited to:&lt;br /&gt;
* Recipes performed in furnaces or chemical plants&lt;br /&gt;
* Recipes for science packs&lt;br /&gt;
* Recipes for [[uranium fuel cell]]s&lt;br /&gt;
* Recipes for [[biolab]]s or [[captive biter spawner]]s&lt;br /&gt;
* Recipes for spoilable products&lt;br /&gt;
&lt;br /&gt;
=== Scrap recycling ===&lt;br /&gt;
As a special case, recycling [[scrap]] will perform the [[scrap recycling]] recipe, for which there is no inverse, as scrap can not be crafted. This is used to obtain most resources on [[Fulgora]].&lt;br /&gt;
&lt;br /&gt;
=== Stats ===&lt;br /&gt;
Scrap recycling rates:&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Input !! Output&lt;br /&gt;
|-&lt;br /&gt;
| {{Imagelink|Scrap|space-age=yes}} || &lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! style=&amp;quot;text-align: left !important;&amp;quot; | {{Imagelink|Processing unit}}  || 2% || 0.05/s&lt;br /&gt;
|-&lt;br /&gt;
! style=&amp;quot;text-align: left !important;&amp;quot; | {{Imagelink|Advanced circuit}}  || 3% || 0.08/s&lt;br /&gt;
|-&lt;br /&gt;
! style=&amp;quot;text-align: left !important;&amp;quot; | {{Imagelink|Low density structure}}  || 1%  || 0.02/s&lt;br /&gt;
|-&lt;br /&gt;
! style=&amp;quot;text-align: left !important;&amp;quot; | {{Imagelink|Solid fuel}}  || 7%  || 0.19/s&lt;br /&gt;
|-&lt;br /&gt;
! style=&amp;quot;text-align: left !important;&amp;quot; | {{Imagelink|Steel plate}}  || 4%  || 0.11/s&lt;br /&gt;
|-&lt;br /&gt;
! style=&amp;quot;text-align: left !important;&amp;quot; | {{Imagelink|Concrete}}  || 6%  || 0.16/s&lt;br /&gt;
|-&lt;br /&gt;
! style=&amp;quot;text-align: left !important;&amp;quot; | {{Imagelink|Battery}}  || 4%  || 0.11/s&lt;br /&gt;
|-&lt;br /&gt;
! style=&amp;quot;text-align: left !important;&amp;quot; | {{Imagelink|Ice|space-age=yes}}  || 5%  || 0.13/s&lt;br /&gt;
|-&lt;br /&gt;
! style=&amp;quot;text-align: left !important;&amp;quot; | {{Imagelink|Stone}}  || 4% || 0.11/s&lt;br /&gt;
|-&lt;br /&gt;
! style=&amp;quot;text-align: left !important;&amp;quot; | {{Imagelink|Holmium ore|space-age=yes}}  || 1%  || 0.02/s&lt;br /&gt;
|-&lt;br /&gt;
! style=&amp;quot;text-align: left !important;&amp;quot; | {{Imagelink|Iron gear wheel}}  || 20%  || 0.55/s&lt;br /&gt;
|-&lt;br /&gt;
! style=&amp;quot;text-align: left !important;&amp;quot; | {{Imagelink|Copper cable}}  || 3%  || 0.08/s&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Alternatively, the recycler takes in 2.5 scrap/s and spits out 1.47 items/s, meaning 10 recyclers are enough to almost saturate a yellow belt. &amp;lt;br&amp;gt;&lt;br /&gt;
Additionally the recycling times for various items are different from the usual 0.125s. This is not an exhaustive list and is specified in item/s input.&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;text-align: left !important;&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Recycler Input !! Rates&lt;br /&gt;
|-&lt;br /&gt;
! style=&amp;quot;text-align: left !important;&amp;quot; | {{Imagelink|Processing unit}}  || 0.8/s&lt;br /&gt;
|-&lt;br /&gt;
! style=&amp;quot;text-align: left !important;&amp;quot; | {{Imagelink|Advanced circuit}}  || 1.33/s&lt;br /&gt;
|-&lt;br /&gt;
! style=&amp;quot;text-align: left !important;&amp;quot; | {{Imagelink|Low density structure}}  || 0.5/s&lt;br /&gt;
|-&lt;br /&gt;
! style=&amp;quot;text-align: left !important;&amp;quot; | {{Imagelink|Steel plate}}  || 0.5/s&lt;br /&gt;
|-&lt;br /&gt;
! style=&amp;quot;text-align: left !important;&amp;quot; | {{Imagelink|Copper plate}}  || 2.5/s&lt;br /&gt;
|-&lt;br /&gt;
! style=&amp;quot;text-align: left !important;&amp;quot; | {{Imagelink|Iron plate}}  || 2.5/s&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Trivia ==&lt;br /&gt;
* If the recycled item has a fluid ingredient, then the smoke emitted from the recycler matches the fluid in colour.&lt;br /&gt;
&lt;br /&gt;
== Gallery ==&lt;br /&gt;
[[File:Fff-375-recycler-freezeframe.png|500px]]&lt;br /&gt;
&lt;br /&gt;
== History ==&lt;br /&gt;
{{history|2.0.7|&lt;br /&gt;
* Introduced in [[Space Age]]{{SA}} expansion.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
== See also ==&lt;br /&gt;
* [[Quality]]{{SA}}&lt;br /&gt;
&lt;br /&gt;
{{ProductionNav}}&lt;br /&gt;
{{C|Producers}}&lt;/div&gt;</summary>
		<author><name>Untitled7</name></author>
	</entry>
	<entry>
		<id>https://wiki.factorio.com/index.php?title=Template:Quality&amp;diff=203935</id>
		<title>Template:Quality</title>
		<link rel="alternate" type="text/html" href="https://wiki.factorio.com/index.php?title=Template:Quality&amp;diff=203935"/>
		<updated>2024-10-30T21:05:47Z</updated>

		<summary type="html">&lt;p&gt;Untitled7: restored previous version as bug occurred in a different Template&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;span style=&amp;quot;white-space: nowrap;&amp;quot;&amp;gt;{{{1}}}&amp;lt;/span&amp;gt; | &amp;lt;!--&lt;br /&gt;
--&amp;gt;&amp;lt;span style=&amp;quot;white-space: nowrap;&amp;quot;&amp;gt;[[File:quality_uncommon.png |12px|link=Quality{{If language suffix}}]]{{{2}}}&amp;lt;/span&amp;gt; | &amp;lt;!--&lt;br /&gt;
--&amp;gt;&amp;lt;span style=&amp;quot;white-space: nowrap;&amp;quot;&amp;gt;[[File:quality_rare.png     |12px|link=Quality{{If language suffix}}]]{{{3}}}&amp;lt;/span&amp;gt; | &amp;lt;!--&lt;br /&gt;
--&amp;gt;&amp;lt;span style=&amp;quot;white-space: nowrap;&amp;quot;&amp;gt;[[File:quality_epic.png     |12px|link=Quality{{If language suffix}}]]{{{4}}}&amp;lt;/span&amp;gt; | &amp;lt;!--&lt;br /&gt;
--&amp;gt;&amp;lt;span style=&amp;quot;white-space: nowrap;&amp;quot;&amp;gt;[[File:quality_legendary.png|12px|link=Quality{{If language suffix}}]]{{{5}}}&amp;lt;/span&amp;gt;&amp;lt;!--&lt;br /&gt;
&lt;br /&gt;
--&amp;gt;&amp;lt;noinclude&amp;gt;{{Documentation}}&amp;lt;/noinclude&amp;gt;&lt;/div&gt;</summary>
		<author><name>Untitled7</name></author>
	</entry>
	<entry>
		<id>https://wiki.factorio.com/index.php?title=Template:Type&amp;diff=203934</id>
		<title>Template:Type</title>
		<link rel="alternate" type="text/html" href="https://wiki.factorio.com/index.php?title=Template:Type&amp;diff=203934"/>
		<updated>2024-10-30T21:00:25Z</updated>

		<summary type="html">&lt;p&gt;Untitled7: potential bugfix for Infobox rows that use the Quality template v3&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{#switch:{{lc:{{#explode:{{{1}}}| |-1}}}}&lt;br /&gt;
| burner = {{#sub:{{{1}}}|0|-{{#len:{{#explode:{{{1}}}| |-1}}}}}} ([[Fuel{{If language suffix}}|{{Translation|burner}}]])&lt;br /&gt;
| electric = {{#sub:{{{1}}}|0|-{{#len:{{#explode:{{{1}}}| |-1}}}}}} ([[Electric system{{If language suffix}}|{{Translation|electric}}]])&lt;br /&gt;
| explosion | explosive = {{#sub:{{{1}}}|0|-{{#len:{{#explode:{{{1}}}| |-1}}}}}} ([[Damage{{If language suffix}}|explosive]])&lt;br /&gt;
| physical = {{#sub:{{{1}}}|0|-{{#len:{{#explode:{{{1}}}| |-1}}}}}} ([[Damage{{If language suffix}}|physical]])&lt;br /&gt;
| poison = {{#sub:{{{1}}}|0|-{{#len:{{#explode:{{{1}}}| |-1}}}}}}/s ([[Damage{{If language suffix}}|poison]])&lt;br /&gt;
| laser = {{#sub:{{{1}}}|0|-{{#len:{{#explode:{{{1}}}| |-1}}}}}}([[Damage{{If language suffix}}|laser]])&lt;br /&gt;
}}&amp;lt;noinclude&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{Documentation}}&lt;br /&gt;
[[Category:Templates]]&lt;br /&gt;
&amp;lt;/noinclude&amp;gt;&lt;/div&gt;</summary>
		<author><name>Untitled7</name></author>
	</entry>
	<entry>
		<id>https://wiki.factorio.com/index.php?title=Template:Type&amp;diff=203933</id>
		<title>Template:Type</title>
		<link rel="alternate" type="text/html" href="https://wiki.factorio.com/index.php?title=Template:Type&amp;diff=203933"/>
		<updated>2024-10-30T20:57:07Z</updated>

		<summary type="html">&lt;p&gt;Untitled7: Undo revision 203932 by Untitled7 (talk)&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{#explode:{{{1}}}| |0}} {{#explode:{{{1}}}| |1}} {{#switch:{{lc:{{#explode:{{{1}}}| |-1}}}}&lt;br /&gt;
| burner = ([[Fuel{{If language suffix}}|{{Translation|burner}}]])&lt;br /&gt;
| electric = ([[Electric system{{If language suffix}}|{{Translation|electric}}]])&lt;br /&gt;
| explosion | explosive = ([[Damage{{If language suffix}}|explosive]])&lt;br /&gt;
| physical = ([[Damage{{If language suffix}}|physical]])&lt;br /&gt;
| poison = /s ([[Damage{{If language suffix}}|poison]])&lt;br /&gt;
| laser = ([[Damage{{If language suffix}}|laser]])&lt;br /&gt;
}}&amp;lt;noinclude&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{Documentation}}&lt;br /&gt;
[[Category:Templates]]&lt;br /&gt;
&amp;lt;/noinclude&amp;gt;&lt;/div&gt;</summary>
		<author><name>Untitled7</name></author>
	</entry>
	<entry>
		<id>https://wiki.factorio.com/index.php?title=Template:Type&amp;diff=203932</id>
		<title>Template:Type</title>
		<link rel="alternate" type="text/html" href="https://wiki.factorio.com/index.php?title=Template:Type&amp;diff=203932"/>
		<updated>2024-10-30T20:56:33Z</updated>

		<summary type="html">&lt;p&gt;Untitled7: potential bugfix for Infobox rows that use the Quality template v2&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{#vardefine|unit|{{lc:{{#explode:{{{1}}}| |-1}}}}}}{{#replace:{{{1}}}|{{#switch:{{#var:unit}}|&amp;lt;nowiki&amp;gt; &amp;lt;/nowiki&amp;gt;}} {{#switch:{{#var:unit}}&lt;br /&gt;
| burner = ([[Fuel{{If language suffix}}|{{Translation|burner}}]])&lt;br /&gt;
| electric = ([[Electric system{{If language suffix}}|{{Translation|electric}}]])&lt;br /&gt;
| explosion | explosive = ([[Damage{{If language suffix}}|explosive]])&lt;br /&gt;
| physical = ([[Damage{{If language suffix}}|physical]])&lt;br /&gt;
| poison = /s ([[Damage{{If language suffix}}|poison]])&lt;br /&gt;
| laser = ([[Damage{{If language suffix}}|laser]])&lt;br /&gt;
}}&amp;lt;noinclude&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{Documentation}}&lt;br /&gt;
[[Category:Templates]]&lt;br /&gt;
&amp;lt;/noinclude&amp;gt;&lt;/div&gt;</summary>
		<author><name>Untitled7</name></author>
	</entry>
	<entry>
		<id>https://wiki.factorio.com/index.php?title=Template:Type&amp;diff=203931</id>
		<title>Template:Type</title>
		<link rel="alternate" type="text/html" href="https://wiki.factorio.com/index.php?title=Template:Type&amp;diff=203931"/>
		<updated>2024-10-30T20:52:08Z</updated>

		<summary type="html">&lt;p&gt;Untitled7: potential bugfix for Infobox rows that use the Quality template&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{#explode:{{{1}}}| |0}} {{#explode:{{{1}}}| |1}} {{#switch:{{lc:{{#explode:{{{1}}}| |-1}}}}&lt;br /&gt;
| burner = ([[Fuel{{If language suffix}}|{{Translation|burner}}]])&lt;br /&gt;
| electric = ([[Electric system{{If language suffix}}|{{Translation|electric}}]])&lt;br /&gt;
| explosion | explosive = ([[Damage{{If language suffix}}|explosive]])&lt;br /&gt;
| physical = ([[Damage{{If language suffix}}|physical]])&lt;br /&gt;
| poison = /s ([[Damage{{If language suffix}}|poison]])&lt;br /&gt;
| laser = ([[Damage{{If language suffix}}|laser]])&lt;br /&gt;
}}&amp;lt;noinclude&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{Documentation}}&lt;br /&gt;
[[Category:Templates]]&lt;br /&gt;
&amp;lt;/noinclude&amp;gt;&lt;/div&gt;</summary>
		<author><name>Untitled7</name></author>
	</entry>
	<entry>
		<id>https://wiki.factorio.com/index.php?title=Template:Quality&amp;diff=203930</id>
		<title>Template:Quality</title>
		<link rel="alternate" type="text/html" href="https://wiki.factorio.com/index.php?title=Template:Quality&amp;diff=203930"/>
		<updated>2024-10-30T20:46:09Z</updated>

		<summary type="html">&lt;p&gt;Untitled7: another test&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;span style=&amp;quot;white-space:nowrap;&amp;quot;&amp;gt;{{{1}}}&amp;lt;/span&amp;gt;｜&amp;lt;!--&lt;br /&gt;
--&amp;gt;&amp;lt;span style=&amp;quot;white-space:nowrap;&amp;quot;&amp;gt;[[File:quality_uncommon.png|12px|link=Quality{{If language suffix}}]]{{{2}}}&amp;lt;/span&amp;gt;｜&amp;lt;!--&lt;br /&gt;
--&amp;gt;&amp;lt;span style=&amp;quot;white-space:nowrap;&amp;quot;&amp;gt;[[File:quality_rare.png|12px|link=Quality{{If language suffix}}]]{{{3}}}&amp;lt;/span&amp;gt;｜&amp;lt;!--&lt;br /&gt;
--&amp;gt;&amp;lt;span style=&amp;quot;white-space:nowrap;&amp;quot;&amp;gt;[[File:quality_epic.png|12px|link=Quality{{If language suffix}}]]{{{4}}}&amp;lt;/span&amp;gt;｜&amp;lt;!--&lt;br /&gt;
--&amp;gt;&amp;lt;span style=&amp;quot;white-space:nowrap;&amp;quot;&amp;gt;[[File:quality_legendary.png|12px|link=Quality{{If language suffix}}]]{{{5}}}&amp;lt;/span&amp;gt;&amp;lt;!--&lt;br /&gt;
&lt;br /&gt;
--&amp;gt;&amp;lt;noinclude&amp;gt;{{Documentation}}&amp;lt;/noinclude&amp;gt;&lt;/div&gt;</summary>
		<author><name>Untitled7</name></author>
	</entry>
	<entry>
		<id>https://wiki.factorio.com/index.php?title=Template:Quality&amp;diff=203929</id>
		<title>Template:Quality</title>
		<link rel="alternate" type="text/html" href="https://wiki.factorio.com/index.php?title=Template:Quality&amp;diff=203929"/>
		<updated>2024-10-30T20:44:41Z</updated>

		<summary type="html">&lt;p&gt;Untitled7: reverted previous and removed all whitespace&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;span style=&amp;quot;white-space:nowrap;&amp;quot;&amp;gt;{{{1}}}&amp;lt;/span&amp;gt; | &amp;lt;!--&lt;br /&gt;
--&amp;gt;&amp;lt;span style=&amp;quot;white-space:nowrap;&amp;quot;&amp;gt;[[File:quality_uncommon.png|12px|link=Quality{{If language suffix}}]]{{{2}}}&amp;lt;/span&amp;gt; | &amp;lt;!--&lt;br /&gt;
--&amp;gt;&amp;lt;span style=&amp;quot;white-space:nowrap;&amp;quot;&amp;gt;[[File:quality_rare.png|12px|link=Quality{{If language suffix}}]]{{{3}}}&amp;lt;/span&amp;gt; | &amp;lt;!--&lt;br /&gt;
--&amp;gt;&amp;lt;span style=&amp;quot;white-space:nowrap;&amp;quot;&amp;gt;[[File:quality_epic.png|12px|link=Quality{{If language suffix}}]]{{{4}}}&amp;lt;/span&amp;gt; | &amp;lt;!--&lt;br /&gt;
--&amp;gt;&amp;lt;span style=&amp;quot;white-space:nowrap;&amp;quot;&amp;gt;[[File:quality_legendary.png|12px|link=Quality{{If language suffix}}]]{{{5}}}&amp;lt;/span&amp;gt;&amp;lt;!--&lt;br /&gt;
&lt;br /&gt;
--&amp;gt;&amp;lt;noinclude&amp;gt;{{Documentation}}&amp;lt;/noinclude&amp;gt;&lt;/div&gt;</summary>
		<author><name>Untitled7</name></author>
	</entry>
	<entry>
		<id>https://wiki.factorio.com/index.php?title=Template:Quality&amp;diff=203926</id>
		<title>Template:Quality</title>
		<link rel="alternate" type="text/html" href="https://wiki.factorio.com/index.php?title=Template:Quality&amp;diff=203926"/>
		<updated>2024-10-30T20:39:51Z</updated>

		<summary type="html">&lt;p&gt;Untitled7: test with different unicode character for vertical bar&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;span style=&amp;quot;white-space: nowrap;&amp;quot;&amp;gt;{{{1}}}&amp;lt;/span&amp;gt;｜&amp;lt;!--&lt;br /&gt;
--&amp;gt;&amp;lt;span style=&amp;quot;white-space: nowrap;&amp;quot;&amp;gt;[[File:quality_uncommon.png |12px|link=Quality{{If language suffix}}]]{{{2}}}&amp;lt;/span&amp;gt;｜&amp;lt;!--&lt;br /&gt;
--&amp;gt;&amp;lt;span style=&amp;quot;white-space: nowrap;&amp;quot;&amp;gt;[[File:quality_rare.png     |12px|link=Quality{{If language suffix}}]]{{{3}}}&amp;lt;/span&amp;gt;｜&amp;lt;!--&lt;br /&gt;
--&amp;gt;&amp;lt;span style=&amp;quot;white-space: nowrap;&amp;quot;&amp;gt;[[File:quality_epic.png     |12px|link=Quality{{If language suffix}}]]{{{4}}}&amp;lt;/span&amp;gt;｜&amp;lt;!--&lt;br /&gt;
--&amp;gt;&amp;lt;span style=&amp;quot;white-space: nowrap;&amp;quot;&amp;gt;[[File:quality_legendary.png|12px|link=Quality{{If language suffix}}]]{{{5}}}&amp;lt;/span&amp;gt;&amp;lt;!--&lt;br /&gt;
&lt;br /&gt;
--&amp;gt;&amp;lt;noinclude&amp;gt;{{Documentation}}&amp;lt;/noinclude&amp;gt;&lt;/div&gt;</summary>
		<author><name>Untitled7</name></author>
	</entry>
	<entry>
		<id>https://wiki.factorio.com/index.php?title=File:Space-Age-logo.png&amp;diff=203858</id>
		<title>File:Space-Age-logo.png</title>
		<link rel="alternate" type="text/html" href="https://wiki.factorio.com/index.php?title=File:Space-Age-logo.png&amp;diff=203858"/>
		<updated>2024-10-30T09:42:52Z</updated>

		<summary type="html">&lt;p&gt;Untitled7: {{Promotional Material}}&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Summary ==&lt;br /&gt;
{{Promotional Material}}&lt;/div&gt;</summary>
		<author><name>Untitled7</name></author>
	</entry>
	<entry>
		<id>https://wiki.factorio.com/index.php?title=File:Factorio-Space-Age-logo.png&amp;diff=203857</id>
		<title>File:Factorio-Space-Age-logo.png</title>
		<link rel="alternate" type="text/html" href="https://wiki.factorio.com/index.php?title=File:Factorio-Space-Age-logo.png&amp;diff=203857"/>
		<updated>2024-10-30T09:42:08Z</updated>

		<summary type="html">&lt;p&gt;Untitled7: {{Promotional Material}}&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Summary ==&lt;br /&gt;
{{Promotional Material}}&lt;/div&gt;</summary>
		<author><name>Untitled7</name></author>
	</entry>
	<entry>
		<id>https://wiki.factorio.com/index.php?title=Template:Quality&amp;diff=203729</id>
		<title>Template:Quality</title>
		<link rel="alternate" type="text/html" href="https://wiki.factorio.com/index.php?title=Template:Quality&amp;diff=203729"/>
		<updated>2024-10-29T08:40:33Z</updated>

		<summary type="html">&lt;p&gt;Untitled7: stopped the unit from wrapping without the corresponding quality icon&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;span style=&amp;quot;white-space: nowrap;&amp;quot;&amp;gt;{{{1}}}&amp;lt;/span&amp;gt; | &amp;lt;!--&lt;br /&gt;
--&amp;gt;&amp;lt;span style=&amp;quot;white-space: nowrap;&amp;quot;&amp;gt;[[File:quality_uncommon.png |12px|link=Quality{{If language suffix}}]]{{{2}}}&amp;lt;/span&amp;gt; | &amp;lt;!--&lt;br /&gt;
--&amp;gt;&amp;lt;span style=&amp;quot;white-space: nowrap;&amp;quot;&amp;gt;[[File:quality_rare.png     |12px|link=Quality{{If language suffix}}]]{{{3}}}&amp;lt;/span&amp;gt; | &amp;lt;!--&lt;br /&gt;
--&amp;gt;&amp;lt;span style=&amp;quot;white-space: nowrap;&amp;quot;&amp;gt;[[File:quality_epic.png     |12px|link=Quality{{If language suffix}}]]{{{4}}}&amp;lt;/span&amp;gt; | &amp;lt;!--&lt;br /&gt;
--&amp;gt;&amp;lt;span style=&amp;quot;white-space: nowrap;&amp;quot;&amp;gt;[[File:quality_legendary.png|12px|link=Quality{{If language suffix}}]]{{{5}}}&amp;lt;/span&amp;gt;&amp;lt;!--&lt;br /&gt;
&lt;br /&gt;
--&amp;gt;&amp;lt;noinclude&amp;gt;{{Documentation}}&amp;lt;/noinclude&amp;gt;&lt;/div&gt;</summary>
		<author><name>Untitled7</name></author>
	</entry>
</feed>