Clear the fault in time and the grid holds. Too late, and it falls.
An AC power grid runs on synchronous machines spinning in lockstep. When a short circuit hits, each generator's rotor swings — and the question that keeps the lights on is whether they swing and re-settle, or whether one accelerates past the point of no return, slips out of step, and triggers a cascade. The margin is measured in tens of milliseconds: the critical clearing time. This program models that swing from the single-machine textbook case up to a multi-machine grid, the way PSS®E and PSCAD do — and ends on the inertia question the renewables transition is forcing.

A generator is a mass on a spring made of electricity.
The swing equation governs a synchronous machine's rotor angle: mechanical power in, electrical power out, and an inertia that resists change. The electrical power transferred across the network follows P = Pmax·sin δ — a curve with a stable equilibrium where the machine normally sits and an unstable one past the peak. Push the angle beyond that peak and the restoring power falls instead of rising: the machine runs away. Everything in transient stability is about staying on the right side of that curve.


You can predict the limit without simulating it.
The equal-area criterion turns the stability question into geometry: during the fault the machine accelerates, accumulating an area under the power-angle curve; after clearing it must give that energy back as an equal decelerating area before the angle reaches the point of no return. Set the two areas equal and you get the critical clearing angle in closed form — and it matches the time-domain simulation to under 2%. Theory and simulation agreeing is what lets you trust the limit on a grid too large to eyeball.

Real grids have many machines — and they argue.
One machine against an infinite bus is the textbook; a real grid is dozens of machines coupled through a network, swinging against each other. Reduce the network to the generator nodes and the same swing dynamics produce inter-area oscillations — groups of machines rocking against other groups — that must damp out after a disturbance. The program builds a multi-machine system, finds its equilibrium, faults a line, and shows the machines either staying in step or one of them losing synchronism, with its own critical clearing time.

Less spinning iron means a twitchier grid.
Synchronous generators carry physical inertia — spinning mass that resists frequency change and buys time after a disturbance. Replace them with inverter-based wind and solar and that inertia falls, so the same generation-load imbalance produces a steeper rate-of-change-of-frequency and a deeper frequency nadir. The program quantifies it: halve the inertia and the RoCoF doubles. It's the stability concern the energy transition is forcing onto every grid operator, modelled directly.

Every number re-derived at sign-off.
The V&V notebook rebuilds the machines and network from scratch and re-derives each requirement against theory, printing a PASS/FAIL board.
| Result | Requirement | |
|---|---|---|
| SMIB stable vs pole-slip | 0.97 / 330 rad | R-01 |
| Equal-area vs simulation | 1.9% | R-02 < few % |
| Multi-machine synchronism | 40.2° spread | R-03 |
| PSS settling improvement | 20 → 5.2 s | R-04 |
| Frequency nadir / RoCoF | 59.56 Hz; ×2 | R-05 |
Classical machines, validated against theory.
The deliverable is ten notebooks and the dossier — the swing equations on a reduced network are a causal ODE system, not an acausal one, so there's no custom block or canvas. The machines use the classical constant-voltage-behind-reactance model (not detailed two-axis dynamics with full exciter/governor models — though the stabilizer notebook adds damping control); the network is Kron-reduced and balanced positive-sequence; there's no protection-relay modelling, and parameters are indicative. What the program proves is the core of transient stability — the swing, the critical clearing time, the equal-area criterion, multi-machine stability, and the inertia question — every number re-runnable and checked against closed-form theory where it exists. It is the AC-dynamics counterpart to the DC microgrid flagship.
Stress-test your own grid.
Book a walkthrough and we'll set up your machines, your network and your fault, and run the transient-stability and critical-clearing-time studies live.
