The perfect acc./solarpanel ratio. Wiki seems wrong

Post all other topics which do not belong to any other category.
Post Reply
Jupiter
Fast Inserter
Fast Inserter
Posts: 174
Joined: Thu Jun 23, 2016 2:38 pm
Contact:

The perfect acc./solarpanel ratio. Wiki seems wrong

Post by Jupiter »

I'm going to be rather pedantic about this to avoid useless discussions caused by miscommunication. Sry for the wall of text.

I was doing some research about this and I found this thread: http://forums.factorio.com/viewtopic.php?f=5&t=5594.

In it the OP calculates the perfect ratio of accumulator/solar panel ratio to be 0.84 accumulators for every panel.
I believe that his method was correct (after some help of others) but the numbers he used as input are now very old (accurate as of 0.11.8 according to the wiki). So I wondered if they have changed since then.

To be clear, he used the following information from the wiki (https://wiki.factorio.com/index.php?title=Game-day):
1 game day = 25000 ticks
day-phase = 12500 ticks (or 50% of a game day)
dusk and dawn phase are equal and are 5000 ticks each (or 20% of game day)
night phase = 2500 ticks (or 10% of a game day)

So I took a good look at that wiki page and found that the numbers in the table are not consistent with each other. The table specifies the duration of each phase both in ticks and in seconds and they match up. But it also specifies at what point during a game day each phase starts and ends and those numbers say something different.
For example, dusk would start at 25% of a day and end at 42% of a day. That implies that dusk would be 42-25 = 17% of a game day. But 17% of 25000 ticks is 4250 ticks and not 5000 ticks. The same goes for night and dawn. So this wiki page is at least partially incorrect.

Then I decided to measure some things by my self. I used the mod EvoGui for this. It shows the current time of the day and the current brightness level (using LuaSurface.darkness). I noted down at what times the brightness changes and I measured the duration of a complete day using a stop watch. The duration of a day was always 7 minutes and a couple of seconds, including the intermittent autosaves and the occasional lagspike (doing this on my lappy). This confirms that a game day actually does last for 25000 ticks.

This is what I noted down for the individual phases:
dawn starts at 02:00 and ends at 06:00, lasting for 4 game-day hours total.
The day-phase starts at 06:00 and ends at 18:00, lasting for 12 hours.
Dusk starts at 18:00 and ends at 22:00, giving 4 hours.
Night then starts at 22:00 and ends at 02:00 for 4 hours.

This completely contradicts the right hand side of that table (tick duration and second duration) on the wiki while confirming the left hand side of the table (duration as a percentage of a day). This also means that the input used in the ratio calculation is wrong. This is what you get when using the new inputs:

(copied from the original thread and modified)

=============================================
n / m = (E_acc / P') * (o / c) = [(t1 + t3) * [t2 + t3 * (t1 + t3) / T] / T] * (o/c)

o = 60 kW
c = 5000 kJ
t1 = 0.5 (as before)
t2 = 1/6 (=0.16666667)
t3 = 1/6 (=0.16666667) (which is counted twice, visible in the graph in the first post)
T = 1.0

Times are in fraction of day, so they must be multiplied by (25 000 / 60). With these numbers, the numerical application gives us :

n / m = [(0.5 + 1/6) * [1/6 + 1/6*((0.5+1/6) / 1.0] / 1.0] * (25 000 / 60) * (60 / 5000) = 0.92592593
=============================================

Where n is the number of accumulators you need, m is the number of solar panels you need, E_acc is the energy stored in all needed accumulators when fully charged, P' is the power output of all solar panels (being power requirements of base + power requirements to charge all accumulators during the day+dusk+dawn), o is the output of a singel panel at 100% brightness, c is the capacity of an accumulator, t1 is the duration of the day-phase as a percentage of a whole game-day, t2 is the duration of the night phase and t3 is the duration of both dusk and dawn. T is just the duration of a complete day.
The derivation of the equation can be found in the linked thread.

Conclusion: the ratio is different from 0.84 and thus any solarpanel field designs need to be adjusted to this.

I hope that everything is clear and if I have made any mistakes I would love to know.

Shokubai
Filter Inserter
Filter Inserter
Posts: 470
Joined: Mon May 02, 2016 3:17 pm
Contact:

Re: The perfect acc./solarpanel ratio. Wiki seems wrong

Post by Shokubai »

Just to sum up and make sure I follow your argument. The essential difference here is the length of cycles.

Old Info
Full day - 25000 -1
Day - 12500- 0.5
Night - 2500- 0.10
Dawn or Dusk - 5000- 0.2/ea

Your Info
Full day - 24966 - 1
Day - 12482 - 0.5
Night - 3994 - 0.16
Dawn or Dusk - 4245 - 0.17

Essentially you suggest that Night is longer while dawn/dusk are slightly shorter than they used to be.

Further along in the same post it was noted by @mikehend the day/night cycle changed with 11.8 to data that matches your numbers. @jonesblitz did the math with this ratio.
New Numbers
Type - Game Ticks - Ratio of a day
Full day - 24966 - 1
Day - 12482 - 0.5
Night - 3994 - 0.16
Dawn or Dusk - 4245 - 0.17
[(.16+.17((.5 + .17)/1)] * [(.5 + .17) / 1] * 60 / 5000 * 24966 /60
[(.16 + .17 (.67)] * [.67] * 24966/5000
[((16/100)+(17/100)(67/100)] * [67/100] * [24966 / 5000]
[((16/100)+(1139/10000)] * [67/100] * [24966 / 5000]
[(1600/10000) + (1139/10000)] * [6700/10000] * [24966/5000]
[2739/10000] * [6700/10000] * [24966/5000]
[18351300/100000000] * [ ( 24966 / 5000) * (20000 / 20000)] (bringing everything to similar denominator)
[18351300/100000000] * [ 499320000 / 100000000] (dropping 100 off all numbers)
[183513 / 1000000 ] * [ 4993200 / 1000000]
916,317,111,600 / 1,000,000,000,000
9,163,171,116 / 10,000,000,000
.9163171116
since you need more you can not round down so roughly .92 or 92 accumulators per 100 solar panels (23:25 or 46:50)
or inversely you get roughly 1.091325249022011 solar panels per accumulator
His math matches yours.
by Koub » Thu Apr 14, 2016 6:58 pm

So the day is 291.66 s effective light and 125 s effective dark or equivalently 70% full brightness, 30% full darkness.

This is where you get it wrong. It's correct to calculate the average output of your solar panels.
It's incorrect to calculate the solar panel / accumulator ratio, because what you assert (without saying it) is that at exactly half way between the last tick of full light and the first tick to full night, you switch from solar power to accu power. This is false, and it's what makes your calculations false.
Still further....there is more debate and more math...and even this post from June of this year.
by Koub » Mon Jun 20, 2016 5:18 pm

Hint to all people who feel the urge to do the math by themselves (which I strongly encourage) : do whatever math you want. If the result is not a 0.84 accu per panel (or close to 1.19 panel per accumulator), then your math is wrong :mrgreen:
You exactly duplicate numbers found by others in 2014 for length of day/night cycles but those numbers seem to be debunked as recently as last month in more than a few threads.
Last edited by Shokubai on Sun Jul 03, 2016 3:10 pm, edited 5 times in total.

hoho
Filter Inserter
Filter Inserter
Posts: 677
Joined: Sat Jan 18, 2014 11:23 am
Contact:

Re: The perfect acc./solarpanel ratio. Wiki seems wrong

Post by hoho »

There is also the little thing that this ratio assumes stable power usage. If one uses laser turrets then there WILL be massive fluctluations and it makes sense to use more accumulators than that ratio would suggest.

Personally, I just have two blueprints - one for just solars, one for just accumulators. I'll just slap them down depending on if I need higher capacity or production :)

Jupiter
Fast Inserter
Fast Inserter
Posts: 174
Joined: Thu Jun 23, 2016 2:38 pm
Contact:

Re: The perfect acc./solarpanel ratio. Wiki seems wrong

Post by Jupiter »

Shokubai wrote:Just to sum up and make sure I follow your argument. The essential difference here is the length of cycles.

Old Info
Full day - 25000 -1
Day - 12500- 0.5
Night - 2500- 0.10
Dawn or Dusk - 5000- 0.2/ea

Your Info
Full day - 24966 - 1
Day - 12482 - 0.5
Night - 3994 - 0.16
Dawn or Dusk - 4245 - 0.17

Essentially you suggest that Night is longer while dawn/dusk are slightly shorter than they used to be.
Yes, exactly.
Shokubai wrote:Further along in the same post it was noted by @mikehend the day/night cycle changed with 11.8 to data that matches your numbers. @jonesblitz did the math with this ratio.
New Numbers
Type - Game Ticks - Ratio of a day
Full day - 24966 - 1
Day - 12482 - 0.5
Night - 3994 - 0.16
Dawn or Dusk - 4245 - 0.17
[(.16+.17((.5 + .17)/1)] * [(.5 + .17) / 1] * 60 / 5000 * 24966 /60
[(.16 + .17 (.67)] * [.67] * 24966/5000
[((16/100)+(17/100)(67/100)] * [67/100] * [24966 / 5000]
[((16/100)+(1139/10000)] * [67/100] * [24966 / 5000]
[(1600/10000) + (1139/10000)] * [6700/10000] * [24966/5000]
[2739/10000] * [6700/10000] * [24966/5000]
[18351300/100000000] * [ ( 24966 / 5000) * (20000 / 20000)] (bringing everything to similar denominator)
[18351300/100000000] * [ 499320000 / 100000000] (dropping 100 off all numbers)
[183513 / 1000000 ] * [ 4993200 / 1000000]
916,317,111,600 / 1,000,000,000,000
9,163,171,116 / 10,000,000,000
.9163171116
since you need more you can not round down so roughly .92 or 92 accumulators per 100 solar panels (23:25 or 46:50)
or inversely you get roughly 1.091325249022011 solar panels per accumulator
His math matches yours.
Yes, the only difference is that I observed the dusk, night and dawn phases to have the exact same length, not the 16%, 16% and 17% lengths. I don't know where the small difference in total day length came from though. My measurements of the length of a full day aren't precise enough to pin point it at exactly 25000 ticks.
Shokubai wrote:
by Koub » Mon Jun 20, 2016 5:18 pm

Hint to all people who feel the urge to do the math by themselves (which I strongly encourage) : do whatever math you want. If the result is not a 0.84 accu per panel (or close to 1.19 panel per accumulator), then your math is wrong :mrgreen:
My math is the same as what was used to calculate the 0.84. I just use different inputs.
Shokubai wrote: You exactly duplicate numbers found by others in 2014 for length of day/night cycles but those numbers seem to be debunked as recently as last month in more than a few threads.
Well, all I can say is that I know what I saw happening in my game and it does not match with what the wiki says and what was used in the calculation of 0.84. Maybe you can try it yourself if your not convinced.

If I could test my numbers in practice with an actual base, I would but my (very first) base isn't at that point yet. Dunno how long it will be until it is.

daniel34
Global Moderator
Global Moderator
Posts: 2761
Joined: Thu Dec 25, 2014 7:30 am
Contact:

Re: The perfect acc./solarpanel ratio. Wiki seems wrong

Post by daniel34 »

Jupiter wrote:t1 = 0.5 (as before)
t2 = 1/6 (=0.16666667)
t3 = 1/6 (=0.16666667) (which is counted twice, visible in the graph in the first post)
I don't know if your measurement for daytime is off or if it's different for solar panels, but your t2 (night) and t3 (dawn/dusk) are wrong.

Proof 1:
Put down a solar panel and a few accumulators at night (when output is zero) and let the accus charge for a day, until it is night again. You'll see in the electric network info that they stored 17.5 MJ.
With the old t1/t2/t3 this is calculated as 25000*(t1+t3) = 25000*0.7 = 17500 --> it checks out.
With your numbers you would get 25000*0.6666 = 16666.

Proof 2:
Combinators only work (change the value) when they have energy. Have an arithmetic combinator count the ticks for a game-day (like in Proof 1) while connected to a solar panel, it will count 22416 ticks. It should count 22500 (day/dawn/dusk) but loses a few when the output is < 1 kW.
This proves that night is at most 2584 ticks long, or 0.10336 (upper limit for t2).
quick links: log file | graphical issues | wiki

XKnight
Filter Inserter
Filter Inserter
Posts: 329
Joined: Thu May 28, 2015 10:40 pm
Contact:

Re: The perfect acc./solarpanel ratio. Wiki seems wrong

Post by XKnight »

Shokubai wrote: Old Info
Full day - 25000 -1
Day - 12500- 0.5
Night - 2500- 0.10
Dawn or Dusk - 5000- 0.2/ea

Your Info
Full day - 24966 - 1
Day - 12482 - 0.5
Night - 3994 - 0.16
Dawn or Dusk - 4245 - 0.17
After performing several expiriments on 0.13.3 without any mods, I can confirm that:
- full day length is 25000 ticks
- day time is 12500 ticks
- dawn or dusk time is 5000 ticks
- night time is 2500 ticks
Information on wiki is 100% correct.

If you have any doubts you can repeat my expiriments by yourself:
My expiriments

Qon
Smart Inserter
Smart Inserter
Posts: 2119
Joined: Thu Mar 17, 2016 6:27 am
Contact:

Re: The perfect acc./solarpanel ratio. Wiki seems wrong

Post by Qon »

Don't feed the troll guys.

He isn't going to test anything in game even though he has been proven wrong in another thread. Just make sure he doesn't try to screw up the numbers in the wiki and leave the thread to die.

DaveMcW wrote:LuaSurface.darkness (which the mod uses) is capped at 0.85, it is completely useless for calculating solar panels.

Anyone who thinks 0.84 is wrong should test it with 50 solar panels, 42 accumulators, and 7 radars before trying to do math.
Reading this didn't help him. If he was intrested in the truth this thread wouldn't even have been created. He is probably going to create a new thread again soon because he doesn't like that people disagree even when he is wrong.

Just so you guys aren't wasting any more of your time.

Jupiter
Fast Inserter
Fast Inserter
Posts: 174
Joined: Thu Jun 23, 2016 2:38 pm
Contact:

Re: The perfect acc./solarpanel ratio. Wiki seems wrong

Post by Jupiter »

Oké, I am convinced.

I managed to create a solar panel and an accumulator.
This is what I saw happening:

Image

Watch the time and the brightness. Brightness is still 14% and it is still well before 02:00 am (at which point the brightness will get larger than 14%).
This definitely shows in which way my measurement was flawed. It's because of a (for now seemingly) very strange quirk in the API.
I saw someone in another thread making the comment that LuaSurface.darkness (used by EvoGui) is capped at 0.85. What I thought was that this is just how the game works: at 85% darkness a solar panel produces 0 W power.
The only way I can explain this quirk is that it only corresponds to visual brightness but that this is simply not the number used by solar panels.

Jupiter
Fast Inserter
Fast Inserter
Posts: 174
Joined: Thu Jun 23, 2016 2:38 pm
Contact:

Re: The perfect acc./solarpanel ratio. Wiki seems wrong

Post by Jupiter »

Qon wrote:Don't feed the troll guys.

He isn't going to test anything in game even though he has been proven wrong in another thread. Just make sure he doesn't try to screw up the numbers in the wiki and leave the thread to die.

DaveMcW wrote:LuaSurface.darkness (which the mod uses) is capped at 0.85, it is completely useless for calculating solar panels.

Anyone who thinks 0.84 is wrong should test it with 50 solar panels, 42 accumulators, and 7 radars before trying to do math.
Reading this didn't help him. If he was intrested in the truth this thread wouldn't even have been created. He is probably going to create a new thread again soon because he doesn't like that people disagree even when he is wrong.

Just so you guys aren't wasting any more of your time.
I read this message right after posting my previous one. As I said, I (incorrectly) assumed that it is just how the game works: solar panels produce 0 power at 14% brightness but it apparently only corresponds to actual visual brightness and is not the number used by solar panels. I fully concede on all points.

Except for the fact that the wiki is still wrong. Some numbers are correct (namely the durations in tick and in seconds) but the percentages are wrong now. (Im talking about the table at https://wiki.factorio.com/index.php?title=Game-day)

Qon
Smart Inserter
Smart Inserter
Posts: 2119
Joined: Thu Mar 17, 2016 6:27 am
Contact:

Re: The perfect acc./solarpanel ratio. Wiki seems wrong

Post by Qon »

Jupiter wrote:I fully concede on all points.

Except for the fact that the wiki is still wrong. Some numbers are correct (namely the durations in tick and in seconds) but the percentages are wrong now. (Im talking about the table at https://wiki.factorio.com/index.php?title=Game-day)
Thank you.

And yes the "Time of day at start" and "Time of day at end" on that wiki page doesn't seem to correspond to the tick durations. Those are a bit tricky to measure though. Easily calculated if we know what time is 0 (still midpoint of the day?) and that it is length 1 (could have changed). For that you would have to read the variables in the game with commands to make sure.

Jupiter
Fast Inserter
Fast Inserter
Posts: 174
Joined: Thu Jun 23, 2016 2:38 pm
Contact:

Re: The perfect acc./solarpanel ratio. Wiki seems wrong

Post by Jupiter »

Qon wrote:
Jupiter wrote:I fully concede on all points.

Except for the fact that the wiki is still wrong. Some numbers are correct (namely the durations in tick and in seconds) but the percentages are wrong now. (Im talking about the table at https://wiki.factorio.com/index.php?title=Game-day)
Thank you.

And yes the "Time of day at start" and "Time of day at end" on that wiki page doesn't seem to correspond to the tick durations. Those are a bit tricky to measure though. Easily calculated if we know what time is 0 (still midpoint of the day?) and that it is length 1 (could have changed). For that you would have to read the variables in the game with commands to make sure.
If you start a new game then EvoGui shows a starting time of 12:00. As for measuring the length of the phases, XKnight already did this using combinators in his last post.

BlakeMW
Filter Inserter
Filter Inserter
Posts: 950
Joined: Thu Jan 21, 2016 9:29 am
Contact:

Re: The perfect acc./solarpanel ratio. Wiki seems wrong

Post by BlakeMW »

hoho wrote:There is also the little thing that this ratio assumes stable power usage. If one uses laser turrets then there WILL be massive fluctluations and it makes sense to use more accumulators than that ratio would suggest.
Btw this is a fallacy. In practise if you don't have excess solar then day time attacks will deplete the accumulators and result in less than full charge entering night. Extra solar is a wonderful thing because the solar panels can directly power lasers during the day and accumulators will be kept at full charge.

Look at is this way, excess accumulators *only* work if you have an excess of solar electricity to put into them. So the excess solar panels (above and beyond the ratio) need to come first, then you can build excess accumulators back up to the ideal ratio if you like.

Qon
Smart Inserter
Smart Inserter
Posts: 2119
Joined: Thu Mar 17, 2016 6:27 am
Contact:

Re: The perfect acc./solarpanel ratio. Wiki seems wrong

Post by Qon »

BlakeMW wrote:
hoho wrote:There is also the little thing that this ratio assumes stable power usage. If one uses laser turrets then there WILL be massive fluctluations and it makes sense to use more accumulators than that ratio would suggest.
Btw this is a fallacy. In practise if you don't have excess solar then day time attacks will deplete the accumulators and result in less than full charge entering night. Extra solar is a wonderful thing because the solar panels can directly power lasers during the day and accumulators will be kept at full charge.

Look at is this way, excess accumulators *only* work if you have an excess of solar electricity to put into them. So the excess solar panels (above and beyond the ratio) need to come first, then you can build excess accumulators back up to the ideal ratio if you like.
Only if attacks are common. If attacks happen seldom then the average energy drain over a game-week goes down and you don't need enough solar to fill the accumulators every day, as long as it fills up before next attack.

bobucles
Smart Inserter
Smart Inserter
Posts: 1669
Joined: Wed Jun 10, 2015 10:37 pm
Contact:

Re: The perfect acc./solarpanel ratio. Wiki seems wrong

Post by bobucles »

You only need to drift into extra accumulators if there is an attack every day or so. In that case you can just wait 2 days for the extra accumulators to charge. If the attacks are non stop then you can treat it like a regular drain and use the ratio.

Zaflis
Filter Inserter
Filter Inserter
Posts: 416
Joined: Sun Apr 24, 2016 12:51 am
Contact:

Re: The perfect acc./solarpanel ratio. Wiki seems wrong

Post by Zaflis »

Just verifying that this is the way it works? Be the day change linear or curved, this way of averaging is still valid.
sun_phase.png
sun_phase.png (36.7 KiB) Viewed 6238 times
What the actual times for dusk and dawn are i don't know, but with this in mind you don't need to care about the changing aspect of solar power in the math. It's either full power or no power.

edit:
If these are true:
1 game day = 25000 ticks
day-phase = 12500 ticks (or 50% of a game day)
dusk and dawn phase are equal and are 5000 ticks each (or 20% of game day)
night phase = 2500 ticks (or 10% of a game day)

Then solar power runs at max (12500+5000)/25000 * 100% = exactly 70% of the day. If it produces 60kW, then average production is 42kW.

Qon
Smart Inserter
Smart Inserter
Posts: 2119
Joined: Thu Mar 17, 2016 6:27 am
Contact:

Re: The perfect acc./solarpanel ratio. Wiki seems wrong

Post by Qon »

Zaflis wrote:Just verifying that this is the way it works? Be the day change linear or curved, this way of averaging is still valid. If it produces 60kW, then average production is 42kW.
Yes, if you want to know the game nychthemeron average it is correct.

BlakeMW
Filter Inserter
Filter Inserter
Posts: 950
Joined: Thu Jan 21, 2016 9:29 am
Contact:

Re: The perfect acc./solarpanel ratio. Wiki seems wrong

Post by BlakeMW »

So it turns out The Ultimate Question of Life, the Universe, and Everything is "On average how much does a solar panel in factorio generate"

Jupiter
Fast Inserter
Fast Inserter
Posts: 174
Joined: Thu Jun 23, 2016 2:38 pm
Contact:

Re: The perfect acc./solarpanel ratio. Wiki seems wrong

Post by Jupiter »

BlakeMW wrote:So it turns out The Ultimate Question of Life, the Universe, and Everything is "On average how much does a solar panel in factorio generate"
Yes, of course. Nothing else than that matters.

torham
Fast Inserter
Fast Inserter
Posts: 187
Joined: Sun May 25, 2014 1:40 pm
Contact:

Re: The perfect acc./solarpanel ratio. Wiki seems wrong

Post by torham »

I know its far from optimal, but my strategy is this:
- If my accumulators get more than 1/2 discharged during the night, I build more accumulators.
- If my accumulators take longer than 1/2 day to recharge, I build more solar panels.

This way I have always spare energy in case of large biter attacks, or just if I decide to expand production somewhere. Both accumulators and solar panels are fairly cheap to make, so why skimp?

Tnarg
Long Handed Inserter
Long Handed Inserter
Posts: 67
Joined: Tue Apr 19, 2016 8:23 am
Contact:

Re: The perfect acc./solarpanel ratio. Wiki seems wrong

Post by Tnarg »

torham wrote:Both accumulators and solar panels are fairly cheap to make, so why skimp?
I'm playing marathon mod and am only 15 hours in. At this point accumulators are too costly to make. I'm just trying to build solar panels to fully power my base during day time to cut down my coal usage. I have a large, power hungry base and I only have 2 coal trains. ~When I get to the point where I build accumulators I will be very interested in the ratios.

Post Reply

Return to “General discussion”