Tools › Electrical and Controls › Power Systems › Power Flow Solver › Method
Power Flow Solver: Method
Open the Power Flow Solver tool
Power Flow Solver: Admittance Matrix, Newton-Raphson and Gauss-Seidel, Step by Step
The tool finds the steady-state voltage at every bus of a power network from the generation and load at each bus, then the power flowing in every line and transformer and the power lost on the way. It prints the working as well as the answer: the bus admittance matrix, and for each iteration the mismatches, the Jacobian, the corrections and the new voltages.
The idea: power in equals power out at every bus
A bus is a node of the network: a substation bar where generators, loads, lines and transformers meet. In a balanced three-phase system one phase tells the whole story, so the network is solved as a single-phase circuit in per unit: every power is divided by a common base (usually 100 MVA), every voltage by the nominal voltage of its bus, and every impedance by Zbase = kV² / MVA. A voltage of 1.0 per unit is then "nominal" everywhere, and transformers at their nominal ratio disappear from the circuit.
The loads are specified as powers, not as impedances, and power is voltage times current. That makes the equations nonlinear: they cannot be solved in one step like an ordinary circuit, and the answer is found by iteration.

Each bus has four quantities: voltage magnitude |V|, voltage angle δ, real power P and reactive power Q injected (generation less load). Two are given and two are found:
- PQ bus (a load bus): P and Q are given; |V| and δ are found.
- PV bus (a generator bus): P and |V| are given, because a generator holds its terminal voltage; δ and the reactive power it needs are found.
- Slack bus (one only): |V| and δ are given (the angle reference); P and Q are found. The slack bus is needed because the losses are not known until the problem is solved, so one generator must be left free to make up the balance.
The bus admittance matrix
A line or transformer between buses i and k is a series impedance R + jX, with admittance y = 1 / (R + jX), and half of its line charging susceptance B at each end. The network equations are I = Y V, where the bus admittance matrix Y = G + jB is built by inspection:
Yii = sum of everything connected to bus i = Σ (y + jB / 2) + shunts Yik = −yik
A transformer whose tap is off nominal by the ratio a (tap on the from bus) adds y / a² to the from bus, y to the to bus and −y / a to the off-diagonal entries. A shunt capacitor of Q Mvar at nominal voltage adds jQ / Sbase to its bus.
The power equations
With Vi = |Vi| ∠ δi and δik = δi − δk, the power injected into the network at bus i is
Pi = Σk |Vi| |Vk| (Gik cos δik + Bik sin δik) Qi = Σk |Vi| |Vk| (Gik sin δik − Bik cos δik)
The solution is the set of voltages for which these equal the scheduled injections. The difference at any trial set of voltages is the mismatch: ΔPi = Psched − Pi, ΔQi = Qsched − Qi.
Newton-Raphson
Newton's method replaces the curved equations by their tangent at the present point and solves that linear problem for a correction:
[ΔP, ΔQ] = J · [Δδ, Δ|V|] then δ ← δ + Δδ, |V| ← |V| + Δ|V|
There is one ΔP equation and one unknown angle for every bus but the slack, and one ΔQ equation and one unknown magnitude for every PQ bus. The Jacobian J holds the partial derivatives (angles in radians):
∂Pi / ∂δi = −Qi − Bii |Vi|² ∂Pi / ∂δk = |Vi| |Vk| (Gik sin δik − Bik cos δik)
∂Pi / ∂|Vi| = Pi / |Vi| + Gii |Vi| ∂Pi / ∂|Vk| = |Vi| (Gik cos δik + Bik sin δik)
∂Qi / ∂δi = Pi − Gii |Vi|² ∂Qi / ∂δk = −|Vi| |Vk| (Gik cos δik + Bik sin δik)
∂Qi / ∂|Vi| = Qi / |Vi| − Bii |Vi| ∂Qi / ∂|Vk| = |Vi| (Gik sin δik − Bik cos δik)
The tool solves the linear system by LU decomposition with partial pivoting. Some textbooks write the magnitude corrections as Δ|V| / |V| and multiply the matching Jacobian columns by |V|; the corrections and the answer are the same. Near the solution the error is roughly squared at every iteration, so three to five iterations are typical whatever the size of the system. The iteration stops when the largest mismatch is below the tolerance.
Gauss-Seidel
The older method solves each bus equation for its own voltage and sweeps through the buses, always using the newest values:
Vi = (1 / Yii) [ (Pi − jQi) / Vi* − Σk≠i Yik Vk ]
At a PV bus the reactive power is not known, so it is first computed from the present voltages, Qi = −Im{ Vi* Σk Yik Vk }; the new voltage keeps its computed angle and is reset to the set-point magnitude. At PQ buses an acceleration factor α pushes each new voltage past the computed one, Vnew = Vold + α (Vcomputed − Vold). Each sweep is simple arithmetic, but the error shrinks only by a fixed fraction per sweep and the number of sweeps grows with the number of buses. On this page both methods stop on the same test (largest power mismatch), so their iteration counts can be compared on one chart.
Generator reactive limits
A generator can hold its voltage only while the reactive power that takes lies inside its capability, Qmin to Qmax. When the converged solution asks a PV bus for more, the tool holds that generator at the limit, releases its voltage (the bus becomes a PQ bus with one more unknown and one more equation) and continues iterating. Each switch is reported with the reactive power that was needed and the voltage the bus settles at.
Flows and losses
With the voltages known, the current entering a branch at bus i is Iik = (Vi − Vk) y + Vi (jB / 2), and the power entering is Sik = Vi Iik*. The loss of the branch is Sik + Ski; the total real loss equals total generation less total load, which the page prints as a check.
A two-bus case by hand
For one line R + jX (no charging) from a source at V1 to a load P + jQ, eliminating the angle gives a quadratic in u = |V2|²:
u² + [2 (P R + Q X) − V1²] u + (P² + Q²)(R² + X²) = 0
The larger root is the operating voltage. When the load is raised until the two roots meet, the line is at its maximum power transfer; beyond that the quadratic has no real root and no power flow solution exists. The tool's two-bus case can be checked against this formula to every printed digit, and its "too much load" case shows what an iteration does when there is nothing to converge to.
What it assumes
- Balanced three-phase steady state: one phase of the positive-sequence network. Unbalanced loads and faults need sequence networks (see Unbalanced Fault Analysis).
- Loads are constant powers, whatever the voltage. Generators hold their voltage set-points inside their reactive limits; one slack bus supplies the balance.
- Lines and transformers are fixed π circuits. Taps are fixed at the entered ratio (no automatic tap changing), there are no phase shifters, and shunts are fixed susceptances.
- A PV bus that reaches a reactive limit stays at that limit; the tool says so when the voltage later moves in the direction that would release it, but does not switch the bus back.
- With branch data in ohms, each branch is converted on the base impedance of its to bus; a transformer's impedance must be referred to that side.
When it misleads
- No convergence is not proof that no solution exists, and a converged answer is one solution of equations that have several. From a flat start Newton-Raphson normally finds the high-voltage operating solution; from an unusual starting point, or near the limit of power transfer, it can land on a low-voltage solution that no real system would operate at. Look at the voltages.
- Constant-power loads make a heavily loaded case look worse than a system whose loads fall with voltage, and the study says nothing about what happens on the way to the steady state (stability, motor stalling, protection).
- The slack bus absorbs all the imbalance. If the scheduled generation is far from the load, the slack generation may be far beyond what that machine could deliver; the page states the number and leaves the judgment to the reader.
- The loading percentage compares MVA flow with the entered rating. It is a ratio, not a thermal, voltage-drop or contingency check.
- The IEEE 14-bus archive file carries a stored solution rounded to three or four figures; this page's voltages agree with it to within 0.0013 pu and 0.02°, the slack power to 0.01 MW, and the generator reactive outputs to within 1.7 Mvar.
Common mistakes
- Mixing bases: reactances given on a machine's own MVA rating must be converted to the system base, Xnew = Xold × Sbase, new / Sbase, old, before they go into the table.
- Forgetting the minus sign off the diagonal (Yik = −yik), or leaving the line charging or a shunt out of the diagonal.
- Using impedances where admittances belong: Yik is built from y = 1 / (R + jX), not from 1 / R and 1 / X separately.
- Angles in degrees inside the Newton-Raphson update: the Jacobian is per radian, so Δδ comes out in radians.
- Signs of the schedule: load is negative injection; Psched = (Pgen − Pload) / Sbase.
- Writing a Q equation for a PV bus, or forgetting to add one when the generator hits a reactive limit.
- Entering the total line charging twice, or half of it: the table takes the total B of the line.
- Putting the transformer tap on the wrong bus: here the tap is on the from bus.
Related tools
Circuit Analysis (DC and AC) solves a network of impedances and sources, where the equations are linear. Voltage Drop and Short Circuit treats radial building feeders. Unbalanced Fault Analysis finds fault currents with sequence networks; a power flow gives the prefault voltages such a study starts from.