Supply must equal demand, second by second
Electrical energy cannot be stored in the wires, so at every instant generation must match load plus losses. The spinning machines on the grid hold kinetic energy E_k = Σ Hi Si (H is the inertia constant in seconds, S the rating in MVA). Any imbalance changes that energy: d(E_k f2/f02)/dt = Pm - Pe, so the frequency obeys the swing equation df/dt = f02 ΔP / (2 E_k f), which at f ≈ f0 is the familiar RoCoF = f0 ΔP / (2 H S). Here f0 = 50 Hz. With E_k = 27 GW s a 420 MW loss starts at 0.4 Hz/s; with only 12 GW s (sunny noon) it starts at about twice that. Wind turbines and solar inverters are connected through power electronics and contribute no inertia, which is why high shares of them make the frequency less stiff.
Four layers of control
Inertia acts in the first second by physics alone. Primary control: each governor changes power by ΔP = -(Δf / f0) Pmax / R with droop R = 4 to 5 %, limited by the headroom the unit keeps; steam units answer in two steps (a fast high-pressure part, then the reheater), hydro units start by moving the wrong way (water hammer, (1 - sTw)/(1 + sTw/2)) and need transient droop to stay stable. The load itself helps: about 1.3 % less power per 1 % frequency drop. After the nadir the frequency settles at Δf = ΔP / (Kgov + Kload). Secondary control (AGC) is an integrator, dP/dt = -B Δf / TI, that moves the set-points of units with room to ramp until the frequency is back at 50 Hz (minutes). Tertiary dispatch re-plans the units every 15 minutes along the demand forecast. Fast batteries respond within about 0.3 s.
When there is not enough generation
If the available power is less than the demand even after all reserves are used, the frequency keeps falling. Automatic under-frequency load shedding (UFLS) trips one block at each of 49.0, 48.8, 48.6 and 48.4 Hz; below about 47.5 Hz generators protect themselves and the system blacks out. A planned shortage is handled the other way round: the dispatcher cuts whole blocks ahead of time, rolling outages, and rotates which blocks are off so that no consumer carries the burden for long. The model sheds just enough blocks that available generation, plus a 3.5 % reserve, covers the forecast peak. When a block returns, its demand is higher than normal for a while (cold-load pickup, modelled as 1 + 0.9 e-t/20 min), so generation is pre-positioned before a block is restored and restoration proceeds one feeder (one eighth of a block) at a time.
Lines and transformers
For a given power the current is I = P / (√3 V cosφ) and the loss in the conductors is 3 I2R: doubling the voltage halves the current and cuts the loss to a quarter. That is why bulk power moves at 220 to 750 kV and is stepped down in substations. A transformer has a fixed no-load loss P0 (the core) and a load loss PkK2 (the windings) with K = S/Sn. Its life is set by the winding hot-spot, θh = θa + Δθor[(1 + R K2)/(1 + R)]x + Hgr Ky, with the oil responding over a couple of hours; the insulation ages 2(θh - 98)/6 times faster than at 98 C. That is why one bank out of four ("N-1") must never leave the others overloaded for long.
Black start and restoration
After a blackout there is no grid to start the plants. Hydro units can start on their own (water and station batteries): one unit energises its line, then the substation and the trunk. Each reconnection step is a load step on a very small, low-inertia island, so steps are kept to a few percent of the online capacity and the frequency is held within a narrow band before the next step. Thermal units need hours to heat up from cold (about 40 min from hot), so they join later, then the interconnection, and wind and solar last, because inverters need a stiff grid to follow. Experiment C finds the largest safe step.
What is simplified
The grid is one frequency area (a single centre of inertia) with 17 synchronous units, aggregated renewables and a lumped network: active power only, no voltages, reactive power, line limits or faults, and no frequency differences between regions. Flows are computed from the generation and load and not from a full power flow, and losses are recomputed from those flows every second. Generation numbers (units, ratings, droops, time constants) are typical orders of magnitude for a 5 to 6 GW system, not data of any real utility. Demand profiles are generic. In the experiments the tripped unit's own inertia is left on the system so that the textbook RoCoF formula applies exactly; in the interactive trips it is removed. Transformer ratings, thermal constants and loss figures follow the IEC 60076-7 loading guide in simplified form. The 3D layout is a stylised map, not to scale, and the city stands for the whole national load.
Educational model. Real outage schedules, protection settings and restoration plans are set by the transmission system operator and carried out by trained dispatchers; during real outages follow the guidance of your local authority and network operator. No company, product or location is represented.