An AC grid is balanced when total generation equals total demand. Any mismatch changes the kinetic energy stored in the spinning generators, so the frequency drifts. In per-unit form the aggregated swing equation is
2H d(df)/dt = Pm + Pbat + Pwind - dPload - D df
H is the inertia constant (seconds of rated power stored as rotation). Initial rate of change of frequency: RoCoF = -dP f0 / (2H).
- Governor droop with turbine lag:
Tg dPm/dt = Pagc - df/R - Pm. With droop alone the steady error is df = -dP / (D + 1/R); a battery responding proportionally adds a term Kb in the denominator.
- Secondary control (AGC) integrates the error,
dPagc/dt = -Ki df, and restores 50 Hz exactly once the balance is rebuilt.
- Wind and solar are connected through inverters and add almost no inertia; the model reduces H by the wind share,
H_eff = H (1 - wind), which makes the first seconds faster and deeper. Wind variability is an Ornstein-Uhlenbeck random signal.
Honest simplifications: one-area (copper-plate) model, no voltage or network limits, one lumped governor and turbine, no generator limits, battery without state-of-charge limits, 1000 MW base. A real smart grid also coordinates demand response, forecasting and voltage control, which are not modelled here. All parameter values are illustrative.
Checks shown in the page: steady frequency error against -dP/(D+1/R+Kb); AGC drives the error to zero; the initial df/dt against -dP/(2H); droop-only error against -dP R.