Tutorial:Solar power math

From Official Factorio Wiki
Jump to navigation Jump to search

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. Energy and power 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 work . 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't consider equipment using different voltages, a the charge of a factorio-accumulator can be defined to use this combined value.

Therefore the important equation symbols for energy are as follows:

  • ... energy, in Joule, also often written in kilowatt-hours, where .
  • ... performed work, in or Newton-meter which is equal to Joule
  • ... accumulator charge, in Joule

And the important equation symbols for power are as follows, with dot-notation for the time derivative:

  • ... supplied power, in Watt, or Joule per second.
  • ... ongoing mechanical work, in Watt
  • ... change in accumulator charge, in Watt

Energy can'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

.

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.

  • Average value over an interval is annotated with a bar above:
  • Peak value with an upward facing chevron:

Average output of 1 solar panel

While only the peak output of a solar panel can be easily be told at , its exact power output over the day changes with available daylight. Thankfully, if we install some accumulators, they can do the integration for us.

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.

Solar panel energy.png

A day on Nauvis lasts 7 minutes, or , which means that each solar panel averages about 41.9 kW of power.

Solarpanel output as a function

For further calculations we assume the power output function of a solar panel looks as follows:

Accumulators per solar panel

Knowing how much power a solar panel provides on average we can construct a fitting load to test how much max accumulator charge is needed.

In an experiment we take one solar panel and put on a load of 41.9 kW, which can be achieved with...

  • 8 Assembly machines 2 ( per unit)
  • 1 inserter ( per unit)
  • 3 fast inserters ( per unit)

To that we add a generous 100 accumulators and observe the energy in the system.

Solar panel with load 41point9kW.png

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. 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.

Analytic solution

We can set the previously defined power function as the rate of change of the accumulator and subtract it'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.

To find the critical point in time at which the accumulator charge reaches it's peak , we need to see when it's derivative passes zero.

The true perfect ratio for solar panels to accumulators therefore turns out to be...

It takes 0.84927 accumulators per solar panel, or a ratio of 617 solar panels to 524 accumulators.