AC power flow
The calculation every grid operator runs, and the one that gets harder the closer a network is to its limits. The network is an admittance matrix, the unknowns are the voltage angles and magnitudes, and Newton-Raphson converges quadratically because it rebuilds the Jacobian at every step — which is what a stressed system needs.
| Bus | Type | V (pu) | Angle | P (pu) | Q (pu) |
|---|---|---|---|---|---|
| 1 | slack | 1.0000 | 0.00° | 0.5094 | 0.1463 |
| 2 | PV | 1.0000 | -0.14° | 0.4000 | 0.1818 |
| 3 | PQ | 0.9814 | -1.47° | -0.9000 | -0.3000 |
The slack bus absorbs whatever the rest of the network cannot balance, which is why its injection is an output rather than an input. Its real power equals the total load plus the losses.
P_i = Σ V_i V_j (G_ij cos θ_ij + B_ij sin θ_ij) · Polar form, per bus.
J Δx = [ΔP, ΔQ] · Jacobian rebuilt every iteration.
Y_ij = −1/(R_ij + jX_ij) · Diagonal sums the branches at the bus.
P_loss = Σ (P_ij + P_ji) · The difference between what enters and leaves.
A clear path from inputs to results.
The calculation every grid operator runs, and the one that gets harder the closer a network is to its limits. The network is an admittance matrix, the unknowns are the voltage angles and magnitudes, and Newton-Raphson converges quadratically because it rebuilds the Jacobian at every step.
How to use
- Set the slack voltage and the generation at the PV bus.
- Set the load at the PQ bus.
- Enter the line impedances.
- Read the bus voltages and angles, the line flows and the losses.
The formula
Reference: Grainger & Stevenson, Power System Analysis; the Newton-Raphson formulation follows the standard polar Jacobian.
Worked example
A three-bus network with 0.9 pu of load
- Slack at 1.0 pu, 0.4 pu of generation at bus 2.
- 0.9 pu of real and 0.3 pu of reactive load at bus 3.
- All three lines 2% resistance and 6% reactance.
- 1
The admittance matrix is built from the three lines.
- 2
Starting from a flat start, the mismatch is computed at every bus except the slack.
- 3
The Jacobian is rebuilt and the state updated; the mismatch falls from order one to 8.6×10⁻¹² in three iterations.
- 4
The load bus settles at 0.9814 pu and −1.47°.
- 5
The slack supplies 0.5094 pu, of which 0.00939 is lost in the lines — about 1% of the load.
V₃ 0.9814 pu · 3 iterations · 0.94% losses.
Interpreting the result
The voltage at the load bus is the number that matters: below about 0.95 pu equipment starts to misbehave, and below 0.8 the network is near the nose of its PV curve where no solution exists. Push the load slider up and watch the voltage fall and then the solver fail — that failure is voltage collapse, not a numerical problem.
Assumptions & limitations
- Three buses: one slack, one PV generator, one PQ load.
- No shunts, no transformers, no reactive limits.
- Line charging is neglected.
- A flat start and a dense linear solve, which is fine at this size.
Frequently asked questions
Why does Newton-Raphson converge so fast?
Because it uses the exact Jacobian at every iteration, so the error squares each time. Three or four iterations is normal; Gauss-Seidel would need dozens and would diverge on a stressed case.
Why is the slack bus an output?
Because it absorbs whatever the rest of the network cannot balance. Its real power equals the total load plus the losses, which are only known after the solution.
What happens when the load is too high?
The Jacobian becomes singular at the nose of the PV curve. The solver either fails to converge or converges to a low-voltage solution that is not physically reachable.
What is per unit?
Every quantity is normalised by a base, so a 100 MVA base makes 1.0 pu equal 100 MW and the arithmetic becomes dimensionless.
Methodology last reviewed 2026-10-22. Results are informational and not financial or engineering advice — see our disclaimer.