Presets
Playback
Site and weather
Latitude and date set the sun; cloud cover and shadow size set the solar flicker.
Solar field
Panel area and efficiency.
Wind farm
Turbines, rotor size and power coefficient.
Hydro plant
Dam head, flow and penstock.
Battery
Energy, power and efficiency.
Demand and playback
Town load and simulation speed.
Camera
Layers
Quality
Model checks
The science
What the grid has to do
Electricity cannot be stored cheaply in the wires, so at every minute generation must equal demand plus whatever goes into storage, minus whatever comes out. This lab simulates one site with four parts: a solar field, a wind farm, a hydro plant on a dam and a battery. It steps in one-minute increments and books every megawatt-hour, so you can see where cloud shadows and calm spells hurt and what storage or hydro buys back.
Solar and the cloud shadow
The sun's elevation comes from the declination delta = 23.45 deg sin(360 (284 + n)/365) and the hour angle: sin(alt) = sin(lat) sin(delta) + cos(lat) cos(delta) cos(15 deg (t - 12)). Clear-sky sunlight on a horizontal plane is the Haurwitz fit GHI = 1098 sin(alt) exp(-0.057/sin(alt)) W/m2. Cloud cover N (fraction of sky) lowers the mean with the Kasten-Czeplak relation kc = 1 - 0.75 N^3.4. The minute-to-minute flicker is a correlated random process (Ornstein-Uhlenbeck) whose memory time is the cloud shadow size divided by the wind speed, so small fast shadows flicker quickly and big slow ones sweep over for an hour. Its spread is 0.8 kc sqrt(N (1-N)), largest for broken cloud; the index is clamped to 0.08 to 1.1 and the centre is shifted so the clamped mean still equals the Kasten-Czeplak value (check 4). Panel output is P = GHI A eta (1 - 0.004 (Tcell - 25)) PR, with cell temperature Tcell = Tair + 25/800 GHI (NOCT 45 C) and a performance ratio PR of 0.86 for wiring, inverter and soiling losses.
Wind
One turbine extracts P = 1/2 rho A Cp v^3 between cut-in (3 m/s) and rated speed (12 m/s), then stays at rated power until cut-out at 25 m/s; rho follows the air temperature, and a 0.9 factor stands for wake and availability losses. Cp cannot exceed the Betz limit 16/27 = 0.593 (check 2). Wind speed at hub height is drawn from a Weibull distribution with shape 2 (the Rayleigh case) through a correlated Gaussian process with a 3 hour memory, so the long-run statistics are exact while individual hours stay realistic.
Hydro
Power is P = rho g Q (H - hf) eta, where friction in the penstock costs hf = f (L/D) v^2 / 2g (Darcy, f = 0.015). Because friction grows as the square of the flow, there is a best flow: setting dP/dQ = 0 gives hf = H/3, Q* = (pi D^2/4) sqrt(2 g H D / (3 f L)). The simulator caps the flow at Q*. In "follows the deficit" mode the plant opens just enough to cover what solar and wind leave open; otherwise it runs at its allowed flow. Water supply is treated as unlimited: there is no reservoir level or river inflow.
Battery and dispatch
Surplus charges the battery up to its power limit and free capacity; what does not fit is curtailed. A deficit is met from the battery up to its power limit and stored energy; the rest is unserved. The round-trip efficiency is split evenly between charging and discharging (each sqrt(eff)). Demand is a smooth daily curve with an evening peak whose 24 hour mean equals the slider.
Simplifications to keep in mind
- One point site: a real solar farm is spread over kilometres, so cloud flicker averages out partly across it; here all panels see the same sky.
- No transmission limits, inverter clipping, battery ageing or degradation, forecast errors or market prices.
- Wind and clouds are statistically linked only through the shadow memory time; the drawn clouds are decoration, not the source of the flicker.
- The CO2 figure assumes the renewable energy displaces gas generation at 0.4 t per MWh, an assumption rather than a measurement.
- Temperature is a simple daily sine; day-of-year changes only the sun.
Independent checks
Five checks run live: (1) the energy books close; (2) a numerical integral of the turbine power curve over the Weibull wind matches a Monte Carlo run; (3) the closed-form best hydro flow matches a numerical search; (4) the clamped cloud index has the Kasten-Czeplak mean; (5) closed-form day length matches a numerical sunrise search.
What to try
- Load Clear summer day and watch solar fill the afternoon while the battery charges, then empties into the evening peak.
- Load Broken cloud, fast flicker and compare the sunlight curve with the clear-sky curve; then raise the shadow size to 10 km and see slower, deeper dips.
- Load No storage at all and watch the surplus being curtailed at noon and the shortfall at night; then give it 200 MWh.
- Raise the penstock flow beyond the cap and see that the output does not grow: friction.
- Switch hydro between following the deficit and running at a fixed flow.