Clock speed

Production and power buildings, such as Miners, Constructors or Biomass Burners, can have their clock speed set to any percentage between 1.0000% and 250.0000% with four decimals. For production buildings, this allows them to operate slower or faster at the cost of greatly reduced or increased power usage. For power buildings the maximum power output and accompanying fuel consumption can be increased in tandem, granting more utility from a single building. Overclocking and underclocking both have utility in optimizing a factory, helping to synchronize production, increasing energy efficiency and smoothing out the peaks in power consumption.

Terminology
Clock speed is the speed of operation of a building. 250% clock speed means the building will operate 2.5x as fast.

Overclocking refers to setting the clock speed above 100%.

Underclocking refers to setting the clock speed below 100%. Underclocking does not require any Power Shards.

Obtaining
The ability to change clock speeds can be unlocked in the. Confusingly, the research is named "Overclock Production", but unlocks underclocking as well.

required to increase clock speeds above 100% can be crafted from, which can be found all over the world.

Purpose
There are multiple ways changing clock speeds can be used to. This is especially matching production and consumption rates of machines to make a factory line operate at maximum efficiency, saving space by overclocking, or saving power by underclocking.

For matching production and consumption rates, both overclocking and underclocking is viable. It is up to you to decide whether to overclock using Power Shards, saving a little space and using a little extra power, or do the opposite by underclocking, which does not require Power Shards.

Clock speed affects production buildings/resource extractors and power generators differently, see below.

Configuration
Clock speed can only be configured in buildings that support it. That includes production buildings with configurable recipes, resource extractors and power generators. Other power consumers, such as Hypertube Entrances, Pipeline Pumps or Train Stations, cannot be overclocked.

Clock speed can be set using a menu within each building's UI, accessed by interacting with it. Buildings that require a recipe set need to have it set first. can be inserted into this menu, increasing the maximum allowed clock speed by 50%, up to 3 times. There are multiple ways to set a clock speed in this menu:
 * Dragging the slider, changing values in 1% increments
 * Entering a percentage directly
 * Entering a formula, which will be evaluated left-to-right
 * Entering a target production rate directly, from which the closest percentage will be calculated
 * Entering a formula for target production rate

Additionally, recipe and clock speed configuration can be copied + and pasted + between buildings of the same type. If Power Shards are required, they will be automatically inserted into a machine the configuration is being pasted into, if there are enough Shards in the inventory.

The result configuration is always stored as a percentage with four decimal spaces of precision. Internally, the exact values calculated from the configured clock speed are used. However, the user interface often rounds or truncates values, thus listing inaccurate results.

Buildings underclocked to have active power consumption below the idle rate of 0.1 MW will still use 0.1 MW while idle.

Clock speed for production buildings
Production buildings craft at a rate proportional to their clock speed, but their power consumption changes polynomially N=1.321928. As the item production rate increases, the ingredient consumption rate increases as well. This means that it costs more power to produce the same amount of resources using buildings at higher clock speeds, but saves space.

The table below shows five different clock speeds on a Constructor, for example, producing Iron Rod that takes 4 seconds.

The formula for power usage is:

$$power\ usage = initial\ power\ usage \times \left( \frac{clock\ speed}{100} \right )^{1.321928}$$ where $$clock\ speed$$ is a number with up to 4 decimals between 1 and 250, and both $$power\ usage$$ and $$initial\ power\ usage$$ are measured in MW.

The exponent 1.321928 is $$\log_2 (2.5)$$ rounded down, meaning you need 2.5x more power to double your productivity, this applies at any clock speed.

For relative energy usage per item produced, subtract the exponent factor by 1, that is,

$$energy\ usage = initial\ energy\ usage \times \left( \frac{clock\ speed}{100} \right )^{0.321928}$$

Remarkable clock speeds

 * At 59% clock speed (59.1943) your power consumption is halved but you still produce 59% of the items, so by adding another 59% building you will produce 18% more items than a single 100% building for the same power usage.
 * At 169% clock speed (168.9353) your power consumption is equal to the consumption of 2 100% buildings but you will produce $$200/169 \approx 18%$$ less items.
 * At 230% clock speed (229.5770) your power consumption is equal to the consumption of 3 100% buildings but you will produce $$300/230 \approx 30%$$ less items.

Basic underclocking
Power is an important parameter in any factory and some basic underclocking can help you reduce its usage.

If you replace a building set at 100% clock speed with 2 buildings set at 50%, your production will remain the same but your power usage will be reduced by 20%.

This can be computed as follows:

Each 50% building will use $$100 \times \left( \frac{50}{100} \right )^{1.321928} \approx 40%$$ of the initial power, 2 buildings 80%, so you will save 20% of the initial power usage.

By spreading your production evenly over more buildings you can save more power, however gains are less and less substantial as more buildings are added:

This example uses a base clock speed of 100% but you can use a different one, you will always get 20% power savings by spreading your production evenly over 2 buildings and other savings will be identical for $$n$$ buildings as well.

Underclocking can also save which are best used in power generators, miners and extractors (see below), so it's even more profitable when some of your buildings are set at clock speeds higher than 100%, for instance:

To sum up, this method allows you to maintain your production while reducing power usage, but there is a more advanced underclocking method allowing you to increase your production while maintaining the same power usage, this is described in the next section.

Advanced underclocking
The following setups have the same power usage:

You have to balance the complexity of logistics for having multiple buildings with production gains.

In the table above production is rounded for clarity, exact values can be computed using the following formulas:

Clock speed for $$n$$ buildings:

$$clock\ speed = base\ clock\ speed \times \exp\left( \frac {-\ln \left( n\right)} {1.321928} \right )$$

Production % for $$n$$ buildings:

$$production = n \times clock\ speed$$

In the table above $$base\ clock\ speed = 100$$, but you can use any base clock speed between 1 and 250 in the formula, allowing you to underclock any of your buildings while maintaining the same power usage and getting additional power-free production.

Production gains will always be the same for $$n$$ buildings compared to the base clock speed, for instance for a base clock speed of 250:

Additional notes regarding this technique:
 * Added production is power-free but obviously not resource-free, you must have enough resources to support it.
 * If the added production is not needed in your current production line, you can send the surplus off to another line using a, into the or into a green  with an adequate "eco"  on it.

Equalization of clock speeds
To optimize power usage it's always better to equalize clock speeds rather than having different clock speeds on the same production line.

For instance if you have 2, one set at 100% and the other one at 50%, they require $$75 + 30 = 105$$ MW, by setting them both at $$(100 + 50)/2 = 75%$$ they only require $$2 \times 51.27 \approx 102.5$$ MW.

Equalization can save (150% + 50% -> 100% + 100%, you gain one power shard), however if the resulting clock speed is higher than 100% (for instance 150% + 100% -> 125% + 125%), equalization may also require more power shards. In this case you can solve the problem by adding more production buildings.

Clock speed for power generators
Power generators both generate power and consume fuel proportionally to their clock speed. A 1% increase in their clock speed causes them to produce 1% more power and consume 1% more fuel. The same amount of power is always produced from the same amount of fuel. Thus, overclocking generators simply saves space, but might cost a large amount of for large power plants.

The table below details the rates of a fueled with. The same logic applies to all other power generators, excluding, which cannot be overclocked at all.

Fuel burn time formula
$$fuel\ burn\ time = initial\ fuel\ burn\ time \times {\frac{100}{clock\ speed}} $$

where $$clock\ speed $$ is a number with up to 4 decimals between 1 and 250, and both $$fuel\ burn\ time $$ and $$initial\ fuel\ burn\ time $$ are measured in seconds.

Power capacity/fuel consumption rate formula
$$power\ capacity = initial\ power\ capacity \times {\frac{clock\ speed}{100}} $$ where $$clock\ speed $$ is a number with up to 4 decimals between 1 and 250, and both $$power\ capacity $$ and $$initial\ power\ capacity $$ are measured in MW. replace $$power\ capacity $$ and $$initial\ power\ capacity $$ with $$fuel\ consumption\ rate $$ and $$initial\ fuel\ consumption\ rate $$ measured in parts per minute or to get the fuel consumption rate.

Clock speed for miners and extractors
Overclocking Miners and Oil Extractors is highly beneficial as it allows you to extract more ore/oil per node. In terms of energy per ore/oil extracted, an overclocked miner/extractor on a higher-purity node can also be more efficient than a non-overclocked one on a lower-purity node. Defining the energy efficiency as the energy required per ore or oil extracted: More generally, stepping up the node purity by one level while simultaneously multiplying the clock speed by $$ 2^{5/3} \approx 3.175$$ results in the same energy efficiency (energy requirement per ore or oil extracted).
 * mining a pure node at 250% has the same energy efficiency as mining a normal node at 78.74% or an impure node at 24.80%
 * mining a normal node at 250% has the same energy efficiency as mining an impure node at 78.74%

Since, for the same clock rate, higher-purity nodes require significantly less energy per ore or oil extracted, a simple strategy for reducing power consumption associated with extraction is: A more optimal approach is detailed below, but the power savings relative to this simple strategy are generally modest.
 * 1) fully overclock pure nodes (or, for Miner Mk.3, overclock pure nodes to 162.5%, due to the Mk.5 belt limit) before extracting anything from normal nodes, then
 * 2) fully overclock normal nodes before extracting anything from impure nodes.

Optimization
When you have access to more than enough nodes to satisfy your extraction requirements, the most power-efficient way of extracting ore or oil involves taking a lot from the pure nodes, a moderate amount from the normal nodes, and a tiny amount from the impure nodes, so that the energy efficiency per ore or oil extracted is the same across all nodes. Suppose that you have access to and that you will be tapping each node with an extractor with a base extraction rate of $$ B $$ as described below: If your target extraction rate is $$ X $$ ore or oil per minute, the most energy-efficient clock rates can be determined as follows   Calculate the power consumption required for the simple approach described above (overclocking high purity before tapping lower purity). This is an optimistic upper bound on the power you could save by fully optimizing the clock speeds - does it seem like a lot to you? If not, then you shouldn't bother with this optimization.  Solve for $$ c $$ as: $$ c = \frac{X}{B (2 \cdot n_\text{p} + \underbrace{2^{-5/3}}_{\approx 0.315} \cdot n_\text{n} + \underbrace{2^{-13/3}}_{\approx 0.0496} \cdot n_\text{i})} $$  Assuming no belt or clock limits, the ideal clock rates would be: Unfortunately, this operating point will not always be realizable, either because: In these cases, the pure extractors should be set to the highest usable clock rate (162.5% for Mk.3 miners with Mk.5 belts, 250% for Oil Extractors with Mk.2 pipes) and then the algorithm should be repeated to determine how best to use the normal and impure nodes to gather the balance of the ore or oil. If this second solution requires the normal extractors to be set to a clock rate over 250%, then the normal extractors should be set to 250% and the impure extractors should be set to whatever rate is required to gather the balance of the ore or oil. If this again requires a clock rate over 250%, then X is too high for given nodes.
 * $$ n_\text{p} $$ pure nodes
 * $$ n_\text{n} $$ normal nodes
 * $$ n_\text{i} $$ impure nodes
 * $$ 100% \cdot c $$ for each pure node
 * $$ 100% \cdot c / 2^{5/3} \approx 31.5% \cdot c $$ for each normal node
 * $$ 100% \cdot c / 2^{10/3} \approx 9.92% \cdot c $$ for each impure node
 * it requires the pure extractors to operate at a clock speed over 250%, or
 * it requires the pure extractors to exceed the Mk.5 belt limit of 780 items/min or the Mk.2 pipe limit of 600 fluid/min



For example, if you would like to extract 1800 oil from a combination of 2 pure nodes, 3 normal nodes, and 5 impure nodes, then This would require 582.83 MW, a savings of 110.3 MW.
 * $$ B = 120$$ oil/min for an oil extractor
 * $$ n_\text{p} = 2$$, $$n_\text{n} = 3$$, and $$ n_\text{i} = 5$$
 * $$ X = 1800$$ oil/min
 * The simple way to achieve this extraction rate is to fully overclock both pure nodes (1200 oil/min) and then tap and fully overclock just two normal nodes (600 oil/min). This would require 4 fully overclocked Oil Extractors, which would consume 693.14 MW. This is therefore the optimistic upper bound on the power savings. It seems worthwhile, although we should remember that this is an optimistic estimate and our actual savings will likely be lower.
 * The calculation gives $$ c = 2.889 $$, so
 * The pure extractors should be operated at 288.9%. This exceeds 250%, so we instead must assume that the 2 pure extractors operate at 250%, collectively producing 1200 oil/min
 * As a sub-calculation, we repeat with $$ n_\text{p} = \mathbf{0}$$, $$n_\text{n} = 3$$, $$ n_\text{i} = 5$$, $$ X = \mathbf{600}$$ oil/min. This gives $$ c= 4.19$$, so
 * The normal nodes should be operated at 132.0%
 * The impure nodes should be operated at 41.58%

History

 * Patch 0.7.0.0:
 * Changed production building and extractor exponent from 1.6 to 1.321928
 * Changed power generators' operating rate to match their clock speed, thus scaling linearly
 * Patch 0.4.0.4: Fixed overclocking not showing the correct value when pasting settings in some situations
 * Patch 0.4.0.3: Changed the number of decimals in overclocking from 1 to 4
 * Patch 0.4.0.0: It is now possible to set decimal percentages as clock speed, the game no longer rounds it to the nearest whole percentage