So I wanted to figure out how much Hydrogen/Oxygen Tanks I needed per Wind turbine to ensure consistent power. For that, I needed a good idea of how wind turbines generate power, whether it was random, randomwalk, or what. It does produce tons, or average, or die out mostly or entirely, and isn't blatantly obvious from playing. I mostly want to know if I am correct.
Looking at the code, it is somewhat complex, but can be split into a few sections. Surprisingly, it is almost perfectly slaved to the Day-night cycle.
The first section is a 4-part composite sin-wave. It pretty much matches the day-night cycle, with it dropping during night and growing during the day, offset somewhat, to counter the smoothing that occurs later.
The other 3 wave parts are over tiny durations making the wave extremely jagged and irregular, causing wind to constantly jump around, but not really change the overall yield.
There are two random factors, a noise generator which adds a bell-curve random number, and a Momentum factor, which random-walks while having a weak gravity pulling it back to zero.
The Wave and the Momentum factor both average zero. While wave can give a +- 3.95 value depending on how the interfereance occurs, it cancels out on average. the momentum can, theoretically get a ridiculous +-50 modifier, though since it move such a tiny distance, that is an infinitesimal chance. It can still occasionally heavily increase or decrease wind yield. And it also has a decay function moving it towards zero.
Noise is rand(3) + rand(5), so a bell curve of some description. Average of 4.
Adding those together can give a huge range, but will mostly range from -4 to 8, averaging +4.
Then subtract 0.1 and divde by 6, for average of 0.65
The current wind factor is interpolated towards the new value, at a variable rate of 5% to 30%. This whole thing also runs every 2 ish seconds.
At this point, I have a bit of trouble. Depending on the resulting factor, it does some other equations, clamping and downscaling for above values of 1. Within 0-1 range however, it squares the value before downscaling, which throws my ability to visualize the distribution, because I can't just look at the average anymore.
That final value is the new wind rate, ranging from 0 to 1, multiplied by the max wind yield. It looks like it should average ~42% of max yield, instead of the 40% the tooltip claims. However, since I am rather fuzzy on the logic, and am pretty sure it gets distorted by the square root, am almost certainly wrong here.
Is any of this wrong, and is it actually very closely tied to the solar cycle? Such that it mostly yields 100% during the day and 0% during the night, roughly following Solar mechanics, albiet both more smoothly and more turbulently?
Would I be safe in assuming that, mostly, it cycles between 0 and 100% yield daily, averaging 40%?
Basic, t1 Hydrogen/Oxygen storage cells seems to be ~12.8% efficient. Using 42.2 KJ to produce 1 steam, worth 5.6 kj in a turbine.
At this point, I am uncertain how to continue. I was going to try and use the solar calculator, but it assumes 100% efficient storage, and also that trapezoid wave.