My calculation for optimal solar panel / accumulator ratio
My calculation for optimal solar panel / accumulator ratio
I was trying to figure out the best ratio of solar panels to accumulators to optimize sanity. That is, I want a ratio that I can count on to work day and night and have a figure in my head for how much electricity I'm going to get from it. Wanting to 'do it on my own," I did a napkin calculation, and got a particular value -- 20 solar panels to 21 accumulators, yeilding 840kW of power -- which differs from the 21:25 'perfect' or the 20:24 'good enough' values I discovered on the Factorio wiki afterwards. I read a chunk of the posts that gave those calculations, and they're certainly solid. But the number I got was different, and I'm curious about why there's a difference. Anyway, here's what I did.
First, a few base facts and values. A solar panel generates 60kW during the daytime. A accumulator can store 5MJ. Factorio daylight lasts for 208.33s, dusk and dawn last for 83.33s, and night lasts for 41.66s. The solar panel's output scales linearly as time progresses through dusk and dawn, decreasing and increasing respectively.
My approach is to combine three things into an array: accumulators, 'output' solar panels, and 'charging' solar panels. The 'charging' solar panels (chargers) are there ONLY to charge the accumulators during the day, and won't be supplying electricity to the grid. The goal, then, is this: given some number of solar panels, how many accumulators do you need so that your electricity output from the array remains constant through the day?
Worded another way, this question is: for how long can one accumulator 'behave' like a solar panel? The answer is, for a fully-charged accumulator: 5MJ / 60kW = 5,000,000 / 60,000 = 83.33s. How long do we need? Well, during either dusk or dawn, the accumulators will be supplying half of the electricity from the array, while the output solar panels will be supplying the other half. While in reality this shift is a smooth gradient, there's a handy simplification I can make here, which is that I can consider the accumulators are supplying electricity for half of the time of dusk/dawn at a constant rate of 60W (I'm stealing a result from calculus, the mean value theorem of integrals if you're curious). So, in total, the accumulator will be supplying power for 41.66s (night) and 83.33s (combined halves of dawn and dusk) = 125s.
So, a full accumulator can supply 83.33s of 'solar panel' time, and we need 125s. So, that's 1.5 accumulators to act like one output solar panel all night long. As I have yet to figure out how to make half of an accumulator, let's just make that 2 output solar panels to 3 accumulators.
Now we need to add charging solar panels, or 'chargers.' The other side of the coin I mentioned earlier is that, during dusk and dawn, the solar panel will supply half of the electricity overall. So, that's 83.33s of 60kW, combined with the 208.33s of pure daylight 60kW, giving us 208.33s + 83.33s = 291.66s of 60kW, which translates to 291.66 * 60 = 17,499.6kJ = 17.5MJ (I'm rounding a touch). Since one accumulator can hold 5MJ, that means that over the course of one day, one solar panel can charge 17.5 / 5 = 3.5 accumulators!
What that means, simply put, is that one charger added to our 2 output solar panel / 3 accumulator array will not only charge all three accumulators, but have half of an accumulator's worth of charge left over. Since we want whole numbers, I will keep adding 2:3 groups to the overall array until I get six of those leftover halves -- that is, 3 free accumulators worth of charge -- so I can add a seventh 2:3 group with no chargers needed. This means that I've no wasted charging going on, and everything is nice and tidy.
What this means is that I've got 7 groups of 2:3, with 6 solar chargers, bringing my total solar panel count to 20, and my total accumulator count to 21. So, my final ratio here is 20 solar / 21 accumulator. Of course, the array in total is only supplying 14 output solar panels worth of electricity, which is 14*60kW = 840kW. But, that's a known quantity, and you can plan your base accordingly.
So. 20:21, 840kW of uninterrupted power. Is there anything wrong here? The numbers seem unusually nice to me -- they were kind of spot on in a lot of cases! Or... did I just rediscover something I didn't encounter earlier?
First, a few base facts and values. A solar panel generates 60kW during the daytime. A accumulator can store 5MJ. Factorio daylight lasts for 208.33s, dusk and dawn last for 83.33s, and night lasts for 41.66s. The solar panel's output scales linearly as time progresses through dusk and dawn, decreasing and increasing respectively.
My approach is to combine three things into an array: accumulators, 'output' solar panels, and 'charging' solar panels. The 'charging' solar panels (chargers) are there ONLY to charge the accumulators during the day, and won't be supplying electricity to the grid. The goal, then, is this: given some number of solar panels, how many accumulators do you need so that your electricity output from the array remains constant through the day?
Worded another way, this question is: for how long can one accumulator 'behave' like a solar panel? The answer is, for a fully-charged accumulator: 5MJ / 60kW = 5,000,000 / 60,000 = 83.33s. How long do we need? Well, during either dusk or dawn, the accumulators will be supplying half of the electricity from the array, while the output solar panels will be supplying the other half. While in reality this shift is a smooth gradient, there's a handy simplification I can make here, which is that I can consider the accumulators are supplying electricity for half of the time of dusk/dawn at a constant rate of 60W (I'm stealing a result from calculus, the mean value theorem of integrals if you're curious). So, in total, the accumulator will be supplying power for 41.66s (night) and 83.33s (combined halves of dawn and dusk) = 125s.
So, a full accumulator can supply 83.33s of 'solar panel' time, and we need 125s. So, that's 1.5 accumulators to act like one output solar panel all night long. As I have yet to figure out how to make half of an accumulator, let's just make that 2 output solar panels to 3 accumulators.
Now we need to add charging solar panels, or 'chargers.' The other side of the coin I mentioned earlier is that, during dusk and dawn, the solar panel will supply half of the electricity overall. So, that's 83.33s of 60kW, combined with the 208.33s of pure daylight 60kW, giving us 208.33s + 83.33s = 291.66s of 60kW, which translates to 291.66 * 60 = 17,499.6kJ = 17.5MJ (I'm rounding a touch). Since one accumulator can hold 5MJ, that means that over the course of one day, one solar panel can charge 17.5 / 5 = 3.5 accumulators!
What that means, simply put, is that one charger added to our 2 output solar panel / 3 accumulator array will not only charge all three accumulators, but have half of an accumulator's worth of charge left over. Since we want whole numbers, I will keep adding 2:3 groups to the overall array until I get six of those leftover halves -- that is, 3 free accumulators worth of charge -- so I can add a seventh 2:3 group with no chargers needed. This means that I've no wasted charging going on, and everything is nice and tidy.
What this means is that I've got 7 groups of 2:3, with 6 solar chargers, bringing my total solar panel count to 20, and my total accumulator count to 21. So, my final ratio here is 20 solar / 21 accumulator. Of course, the array in total is only supplying 14 output solar panels worth of electricity, which is 14*60kW = 840kW. But, that's a known quantity, and you can plan your base accordingly.
So. 20:21, 840kW of uninterrupted power. Is there anything wrong here? The numbers seem unusually nice to me -- they were kind of spot on in a lot of cases! Or... did I just rediscover something I didn't encounter earlier?
Re: My calculation for optimal solar panel / accumulator ratio
Everyone makes the same mistake. The real anwser is 100s. The first 30% of dawn and dusk do not need accumulators, since the solar panels are producing above the daily average.Galdoc wrote:How long do we need? Well, during either dusk or dawn, the accumulators will be supplying half of the electricity from the array, while the output solar panels will be supplying the other half. While in reality this shift is a smooth gradient, there's a handy simplification I can make here, which is that I can consider the accumulators are supplying electricity for half of the time of dusk/dawn at a constant rate of 60W (I'm stealing a result from calculus, the mean value theorem of integrals if you're curious). So, in total, the accumulator will be supplying power for 41.66s (night) and 83.33s (combined halves of dawn and dusk) = 125s.
Re: My calculation for optimal solar panel / accumulator ratio
I'm sorry, but I don't understand the connection. Can you clarify?
Edit: Oh, I see. So, you're saying that the actual dip in production of the solar panels doesn't actually begin until later in dusk? So, the full 'uptime' of the solar panels is longer than for pure daylight?
Edit: Oh, I see. So, you're saying that the actual dip in production of the solar panels doesn't actually begin until later in dusk? So, the full 'uptime' of the solar panels is longer than for pure daylight?
Re: My calculation for optimal solar panel / accumulator ratio
This is where I got my data from. As I'm new, it didn't let me post this in my original post, though I tried:
https://wiki.factorio.com/index.php?title=Game-day
https://wiki.factorio.com/index.php?title=Game-day
Re: My calculation for optimal solar panel / accumulator ratio
Oh, I see, you totally missed the 42kW per solar panel calculation.
Your 2 output solar panels are producing 291.66s of 60 kW... in a 416.66s day! Your average output is only 42kW. So your accumulators only need to output 42 kW. Since the solar panels are producing above 42 kW for 30% of dawn/dusk, your accumulators only need to run for 100s.
Edit:
Your 2 output solar panels are producing 291.66s of 60 kW... in a 416.66s day! Your average output is only 42kW. So your accumulators only need to output 42 kW. Since the solar panels are producing above 42 kW for 30% of dawn/dusk, your accumulators only need to run for 100s.
Edit:
You stated it yourself, solar panels only produce 70% of their listed electriciy. You don't have to overbuild accumulators to match 100%.Galdoc wrote:So, my final ratio here is 20 solar / 21 accumulator. Of course, the array in total is only supplying 14 output solar panels worth of electricity
Re: My calculation for optimal solar panel / accumulator ratio
No, I didn't totally miss it, it's just not relevant to my calculation. It's not that it isn't useful of course, it just wasn't the approach I took. You see, I wanted to maximize sanity specifically -- that is, I want to put an array down and just know that it's going to, overall, churn out as close to exactly the same power regardless as to whether or not it's day or night, no peaks, no valleys.
For reference, I did that calculation, and the value I got for the average daily output of a solar panel is 42.06kW, though obviously, that's close enough to 42 to just use the integer.
My math isn't wrong, my goal is just different. Unless I'm mistaken (and I could be; I don't know which post you're referencing, or if it's merely the 'general wisdom'), the goal of the calculation you're speaking of is putting the bar of energy produced by a solar panel at its daily average of 42kW, and then placing enough accumulators so that they compensate for the 100s that the solar panel production dips below that average. My bar is at 60kW, which obviously isn't their average, but rather their peak production, so my numbers turned out differently.
Now, if my goal doesn't lead to optimal sanity, then yeah, I have a problem ... but I don't see the flaw yet. Thank you for the critiques, though; I appreciate it!
For reference, I did that calculation, and the value I got for the average daily output of a solar panel is 42.06kW, though obviously, that's close enough to 42 to just use the integer.
My math isn't wrong, my goal is just different. Unless I'm mistaken (and I could be; I don't know which post you're referencing, or if it's merely the 'general wisdom'), the goal of the calculation you're speaking of is putting the bar of energy produced by a solar panel at its daily average of 42kW, and then placing enough accumulators so that they compensate for the 100s that the solar panel production dips below that average. My bar is at 60kW, which obviously isn't their average, but rather their peak production, so my numbers turned out differently.
Now, if my goal doesn't lead to optimal sanity, then yeah, I have a problem ... but I don't see the flaw yet. Thank you for the critiques, though; I appreciate it!
Re: My calculation for optimal solar panel / accumulator ratio
For reference, I was just spitting out numbers from this thread: viewtopic.php?t=5594
Anyway, I think the flaw is you assume your 6 recharge solar panels must route 100% of their power through the accumulators. This is not true - for the darkest 70% of dawn/dusk they can direct all their power to boosting the 14 output panels. And a bit more in the brightest 30% of dawn/dusk.
duration of darkest part: 70% * 166.66s = 116.66s
average brightness of darkest part: 70% * 60 kW / 2 = 21 kW
6 recharge panels * 116.66s * 21 kW = 14,700 kJ direct transferred
duration of brightest part: 30% * 166.66s = 50s
average missing brightness of brightest part: 30% * 60 kW / 2 = 9 kW
6 recharge panels * 50s * 9 kW = 2700 kJ direct transferred
(14,700 kJ + 2700 kJ) / 5MJ = 3.48 accumulators saved
21 - 3.48 = 17.52 accumulators
17.52 / 20 = 0.876... not quite 0.84. I must have messed up somewhere.
But that is the basic idea.
Anyway, I think the flaw is you assume your 6 recharge solar panels must route 100% of their power through the accumulators. This is not true - for the darkest 70% of dawn/dusk they can direct all their power to boosting the 14 output panels. And a bit more in the brightest 30% of dawn/dusk.
duration of darkest part: 70% * 166.66s = 116.66s
average brightness of darkest part: 70% * 60 kW / 2 = 21 kW
6 recharge panels * 116.66s * 21 kW = 14,700 kJ direct transferred
duration of brightest part: 30% * 166.66s = 50s
average missing brightness of brightest part: 30% * 60 kW / 2 = 9 kW
6 recharge panels * 50s * 9 kW = 2700 kJ direct transferred
(14,700 kJ + 2700 kJ) / 5MJ = 3.48 accumulators saved
21 - 3.48 = 17.52 accumulators
17.52 / 20 = 0.876... not quite 0.84. I must have messed up somewhere.

Re: My calculation for optimal solar panel / accumulator ratio
Hm. I will take a look at this tomorrow -- it seems like I'll have to think about it a bit more.
One thing I just played with was I laid out six solar panels and it seemed to charge the 21 accumulators darn near perfectly, filling them up just as their last current was extinguished.
Still, more numbers to crunch. Thanks again!
One thing I just played with was I laid out six solar panels and it seemed to charge the 21 accumulators darn near perfectly, filling them up just as their last current was extinguished.
Still, more numbers to crunch. Thanks again!
Re: My calculation for optimal solar panel / accumulator ratio
Aha, I need to use the 14 panels during the brightest part.
duration of brightest part: 30% * 166.66s = 50s
average missing brightness of brightest part: 30% * 60 kW / 2 = 9 kW
14 output panels * 50s * 9 kW = 6300 kJ direct transferred
(14,700 kJ + 6300 kJ) / 5MJ = 4.2 accumulators saved
21 - 4.2 = 16.8 accumulators
16.8 / 20 = 0.84 accumulator/solar panel ratio
If you want to eliminate fractional accumulators you can redo the math with 35 output solar panels. This also powers exactly 7 radars, making it easy to experimentally verify.
duration of brightest part: 30% * 166.66s = 50s
average missing brightness of brightest part: 30% * 60 kW / 2 = 9 kW
14 output panels * 50s * 9 kW = 6300 kJ direct transferred
(14,700 kJ + 6300 kJ) / 5MJ = 4.2 accumulators saved
21 - 4.2 = 16.8 accumulators
16.8 / 20 = 0.84 accumulator/solar panel ratio
If you want to eliminate fractional accumulators you can redo the math with 35 output solar panels. This also powers exactly 7 radars, making it easy to experimentally verify.
Re: My calculation for optimal solar panel / accumulator ratio
So, I took a look at what you're doing. It's a little hard for me to follow, but my guess is that somewhere in all of that averaging, something is getting lost.
I did another test this morning. In the dead of night, I set out six solar panels and 21 accumulators, and measured the charge after one full day cycle, meaning I took a reading in the dead of the next night. I had a full charge. Then, I tried it again, but with 22 accumulators -- which would be 110MJ -- but it only charged to 105MJ. To be fair, it added a fractional extra bit, as it didn't *quite* turn off exactly on the button, but it was only a few seconds of low-solar-output charging that we're talking about.
So, actually, yes, six solar panels exactly fill the 21 accumulators with negligible power output to anything else over the course of one day. Now, I just need to check to make sure those 21 accumulators behave like 14 solar panels overnight -- and yeah, I'm probably just going to use Radars to test this.
I did another test this morning. In the dead of night, I set out six solar panels and 21 accumulators, and measured the charge after one full day cycle, meaning I took a reading in the dead of the next night. I had a full charge. Then, I tried it again, but with 22 accumulators -- which would be 110MJ -- but it only charged to 105MJ. To be fair, it added a fractional extra bit, as it didn't *quite* turn off exactly on the button, but it was only a few seconds of low-solar-output charging that we're talking about.
So, actually, yes, six solar panels exactly fill the 21 accumulators with negligible power output to anything else over the course of one day. Now, I just need to check to make sure those 21 accumulators behave like 14 solar panels overnight -- and yeah, I'm probably just going to use Radars to test this.
-
- Filter Inserter
- Posts: 814
- Joined: Fri Apr 29, 2016 5:27 pm
- Contact:
Re: My calculation for optimal solar panel / accumulator ratio
That thing that you are not accounting for is that at the start of dusk and near the end of dawn, solar production is already above demand, and hence the excess is charging your accumulators during those timeframes (this is net after the intended power usage). So the total time in which the solar panels are charging the accumulators is not just daylight, but some of dawn and dusk as well, and even after solar power drops below the usage level, it is still providing some power until night begins (or conversely, before solar power has returned to a high enough level to supply all non-accumulator charging usage). This is why your numbers are different from the perfect 21:25.
Re: My calculation for optimal solar panel / accumulator ratio
Okay, so I did get a little bit more experimental data.
I set out five arrays -- that's 100 solar panels and 105 accumulators. My projected power output for each array is about 840kW, so that's 4200kW. That looks like 14 radars. I basically waited until broad daylight, filled the arrays completely, and laid out the radars so that they had a constant draw of 4200kW. I then watched the output as a few days went by. Here's what I saw.
The consumption of the radars never once faltered. So, at the least, I'm giving them the right amount of power. However, the accumulators depleted only down to 105MJ, which means each accumulator still retained 1MJ of power inside. What's interesting to note, though, is that by the time they'd gone from that minimum charge to full capacity, the solar panels had *exactly* stopped charging them. That is, they cycled back to full right when they were supposed to.
I am currently doing an experiment to see if starting the cycle with depleted accumulators will eliminate the 105MJ thing, but I'm not sure. If that doesn't explain it away, I'll have to do some more thinking.
I set out five arrays -- that's 100 solar panels and 105 accumulators. My projected power output for each array is about 840kW, so that's 4200kW. That looks like 14 radars. I basically waited until broad daylight, filled the arrays completely, and laid out the radars so that they had a constant draw of 4200kW. I then watched the output as a few days went by. Here's what I saw.
The consumption of the radars never once faltered. So, at the least, I'm giving them the right amount of power. However, the accumulators depleted only down to 105MJ, which means each accumulator still retained 1MJ of power inside. What's interesting to note, though, is that by the time they'd gone from that minimum charge to full capacity, the solar panels had *exactly* stopped charging them. That is, they cycled back to full right when they were supposed to.
I am currently doing an experiment to see if starting the cycle with depleted accumulators will eliminate the 105MJ thing, but I'm not sure. If that doesn't explain it away, I'll have to do some more thinking.
Re: My calculation for optimal solar panel / accumulator ratio
I am not certain that's right. I am taking that into account. The solar panels responsible for charging are adding *just* enough power to the array to charge the accumulators. They're not contributing to the grid that's tapping power from the array, not on a whole. It's not a matter of them being above average or whatever.
It's like filling a bucket. The size of the bucket is some MJ deep. Those six chargers are pouring in watts, and though they're not doing so at a constant rate all day, the total daily contribution is close enough to exact.
It's like filling a bucket. The size of the bucket is some MJ deep. Those six chargers are pouring in watts, and though they're not doing so at a constant rate all day, the total daily contribution is close enough to exact.
Re: My calculation for optimal solar panel / accumulator ratio
Great! Run it for 2 days and watch the power on the 14 radars - it should never drop.Galdoc wrote:I set out five arrays -- that's 100 solar panels and 105 accumulators. My projected power output for each array is about 840kW, so that's 4200kW. That looks like 14 radars.
Now delete 21 accumulators and run it for 2 more days - the radar power will STILL not drop.
Re: My calculation for optimal solar panel / accumulator ratio
Whelp. The data is in. I did exactly what you said -- I deleted the 21 accumulators and, starting from daylight, it didn't drop. Excellent. 
