Flexible equation for accumulator/solar pannel ratio

Post all other topics which do not belong to any other category.
Post Reply
pedrodu36
Manual Inserter
Manual Inserter
Posts: 2
Joined: Wed Aug 23, 2023 12:04 pm
Contact:

Flexible equation for accumulator/solar pannel ratio

Post by pedrodu36 »

Hi all,

I have recently been playing with solar panels and accumulator with varying day/night cycles (SE). I sorted an analytical solution to quickly calculate na, the optimal (minimum) number of accumulator per solar pannel. Thought I'll put it here 'cause I'm proud and it might help someone else.

-

Known variables:
  • td = 1 day cycle (Default: 416.666 seconds)
  • rd, rm, re, rn = daytime ratio for day, morning, evening and night respectively (Default: 0.5, 0.2, 0.2, 0.1)
  • Ps = Power of one solar pannel (Default 60kW)
  • Pin = Charging power of an accumulator (300kW)
    Pout = Output power of an accumulator (300kW)
    E = Maximum charge of an accumulator (5MJ)
Calculate:
  • r = rd + (rm + re)/2
  • Pe = E/td
  • a = (1-r)/r
  • b = r² - r*rd + rn
  • (Pin/a)
  • (Pe/b)
Solution:
  • IF (Pe/b) < (Pin/a) AND (Pe/b) < Pout
    >>>>>>> nₐ = (r*Ps) / (Pe/b)
  • ELSE IF Pout < (Pin/a)
    >>>>>>> nₐ = (r*Ps) / Pout
  • ELSE
    >>>>>>> nₐ = (r*Ps) / (Pin/a)
-

Notes:

  • This solution is a standalone no brain set of equations that will give you the optimal ratio of accumulator to solar panels. Try yourself with the numerical values I gave for the known variables. In less than 3 minutes you'll find the answer nₐ=0.84).
  • The average power of one solar panel is r*Ps
  • In the solution, the first condition is the case of a charge limited accumulator. The second is an output power limited and third a charging power limited case.
  • You can check this topic for more details on the functionment of solar panels and accumulators in factorio: viewtopic.php?f=5&t=5594


Cheers
Last edited by pedrodu36 on Thu Oct 19, 2023 11:57 pm, edited 18 times in total.

FuryoftheStars
Smart Inserter
Smart Inserter
Posts: 2554
Joined: Tue Apr 25, 2017 2:01 pm
Contact:

Re: Flexible equation for accumulator/solar pannel ratio

Post by FuryoftheStars »

Hmm, this is somewhat interesting, though you mention that this is the number of accumulators to solar panels, ie accumulator:solar, however when I plug vanilla values into your formula, I'm not getting a result that seems to jive with that.

Adjusting the power output of solar panels to 60 kW, accumulator in/out to 300 kW, and accumulator max charge to 5 MJ (the rest of the values about day seem correct to vanilla), your formula gives me (assuming I did it right) 1.05.

Taking the known vanilla ratio (here: https://wiki.factorio.com/Solar_panel) of 21 accumulators to 25 solar panels (to sustain 1 MW of power through the night) gives a ratio of 0.84 (even using the 20:23.8 figure yields 0.84 and change).

Now, flipping this so we have solar:accumulator gets us closer to the 1.05: 1.19 and change (or 1.19 using 23.8:20), which could be attributed to some rounding/calculation errors from either side. So I think this worth a relook at least to make sure the formula is applying them in the ratio that you expected?

If that is the case, it seems like it still might be off some, but this might be attributed to the idea of "minimum number of" accumulators to solar panels, as there may be a bit of extra padded into the wiki values (to avoid that true balance point as it may still cause a momentary blip in power). And/or the morning/evening calculations of solar panels may be slightly off.

(Edit: Replaced image with hopefully slightly less blurry one.)
Attachments
Screenshot 2023-10-18 222643.png
Screenshot 2023-10-18 222643.png (65.79 KiB) Viewed 722 times
My Mods: Classic Factorio Basic Oil Processing | Sulfur Production from Oils | Wood to Oil Processing | Infinite Resources - Normal Yield | Tree Saplings (Redux) | Alien Biomes Tweaked | Restrictions on Artificial Tiles

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

Re: Flexible equation for accumulator/solar pannel ratio

Post by Koub »

Isn't this what you're looking for : viewtopic.php?f=5&t=5594 ?
Koub - Please consider English is not my native language.

pedrodu36
Manual Inserter
Manual Inserter
Posts: 2
Joined: Wed Aug 23, 2023 12:04 pm
Contact:

Re: Flexible equation for accumulator/solar pannel ratio

Post by pedrodu36 »

Hi, thank you for your answer Furyofstars.

1.05 is coherent with my logic. I consider the following: The solar accumulator must be able to hold a charge equal to to the average output of the solar panel multiplied by the time of the night. In the vanilla case, one solar panel has an average output of 42kW. The night has a length of 0.3 times 416.666. 42kW*0.3*416.666 is 5250kJ, which is 1.05 times the charge of the accumulator.

I have however simplified the evening and morning phase in my model. I consider them equal to a half-half full power, no power time for the solar panel. This gives an the same average power output as the actual linear function that goes from top to 0 in that period of time.

-

The 0.84 implies that 20 accumulator sustain 1MW during the night. That corresponds to a charge of 1000*0.3*416.666 =125 MJ. 20 accumulators have a charge of 100MJ. This seems coherent with my symplified model (that gives night time = 0.3) being wrong. I will look on that and come back here.

-

Edit: Used a more fitting model. Should be correct now.

Post Reply

Return to “General discussion”