Build a wind, solar and battery grid on a hill, then watch 168 hours of Weibull-distributed wind and solar geometry decide how much gas you still burn.
Sweeps battery energy from 0 to 4x your setting over 8 different weather weeks with the same wind/solar settings.
The science
Wind speed distribution. Hourly hub-height wind speed follows a Weibull law, f(v) = (k/c) (v/c)^(k-1) exp(-(v/c)^k), mean c Gamma(1+1/k). Here the series is made from a correlated Gaussian process (hour-to-hour correlation rho) mapped through the Weibull inverse CDF, so the histogram is right and the gusts persist like weather does.
Power curve. Below cut-in (3 m/s) a turbine gives nothing; between cut-in and rated speed (12 m/s) the cubic law P = 1/2 rho A Cp v^3 applies, normalised so rated power is reached at 12 m/s; above that, pitch control holds the power flat until cut-out at 25 m/s. Rated power P_r = 1/2 rho (pi D^2 / 4) v_r^3 Cp with Cp = 0.45, below the Betz limit 16/27 = 0.593.
Capacity factor. CF = mean power / rated power = integral P(v)/P_r f(v) dv; the page integrates this with Simpson's rule and compares it with the average of a 20 year hourly sample. Doubling the mean wind speed barely changes CF near rated speed but multiplies output by 8 in the cubic region: that is why wind is so variable.
Sun. Declination delta = 23.44 deg sin(2 pi (284 + n)/365), solar elevation sin(beta) = sin(phi) sin(delta) + cos(phi) cos(delta) cos(h), clear-sky irradiance (Haurwitz) G = 1098 sin(beta) exp(-0.059/sin(beta)) W/m2, scaled by a random clearness index. PV output = peak power x G/1000 x performance ratio 0.82.
Battery and dispatch. Surplus charges the battery (limited by power rating and free space), a deficit discharges it, the remainder is served by gas; any surplus the battery cannot take is curtailed. Round-trip efficiency is split equally into charge and discharge: eta = sqrt(eta_rt) each way. Gas emissions use a typical 0.4 t CO2/MWh combined-cycle figure.
Honest simplifications. No transmission limits, ramp limits, wake losses, forecast error, battery ageing or reserve requirements; one wind site and one weather series for the whole grid; demand is a synthetic daily shape; gas capacity is unlimited. Real grids need all of those. Weather is a seeded pseudo-random series, not a forecast. The 3D scene is stylised and its particle speeds are only illustrative.
Model and assets: Blender (hill, turbine, panels, battery, houses) + Three.js. Independent educational model.