🔍Nonlinear Equations
Systems of Nonlinear Equations
The Jacobian, Newton's method in n dimensions, finite-difference Jacobians, damping, Broyden and power flow
The Northeast blackout, 9 November 1965
A cold November evening; the transmission lines into southern Ontario are heavily loaded. At 5:16 p.m. a small power swing reaches a protective relay on one of the lines out of the Sir Adam Beck hydroelectric station No. 2, near Niagara Falls. The relay's setting is wrong for that load, and it does what it was set to do: it trips the line. The power that line carried shifts instantly onto its neighbours, which overload and trip in turn, and within five minutes the failure has cascaded through the interconnected grid of Ontario, New York and New England.
Within minutes about 30 million people have lost power. Some will be without it for up to 13 hours.
Preventing a cascade starts with a question that sounds simple: given the generation and the loads, what voltage will each bus in the network settle at, and how much power will flow in each line? The answer is the solution of the power-flow equations — two nonlinear equations per bus, full of sines and cosines, every one coupled to its neighbours. A large grid has thousands of buses.
Two years after the blackout, in November 1967, William Tinney and Clifford Hart of the Bonneville Power Administration published Power Flow Solution by Newton's Method. Combined with ordering techniques that exploit how few lines connect each bus, it made large networks practical to solve in a handful of iterations. Grid operators have used Newton–Raphson power flow ever since.
Write the system as with and . Newton's 1669 idea carries over unchanged: near a guess, replace by its linear approximation and solve that instead. The derivative of a vector function is a matrix — the Jacobian.
Row i of the Jacobian is the gradient of equation i. The linearisation is the multivariable Taylor expansion truncated after its linear term.
💡Newton's method for systems
Setting the linearisation to zero gives the Newton step:
- Evaluate and .
- Solve the linear system .
- Update .
📐A circle and a hyperbola
Solve , . With ,
From : , and solving gives . The residual norms then go
— quadratic. The answer is ; the exact value is . Note that vanishes on the lines : a start there gives a singular Jacobian, and Newton cannot take a step.
Using a term like nonlinear science is like referring to the bulk of zoology as the study of non-elephant animals.
Where the cost goes. Each Newton step for unknowns needs
- the Jacobian: partial derivatives. If you cannot differentiate by hand, approximate column by a finite difference, — extra evaluations of . Lesson 1-3 tells you to take .
- a linear solve: about operations for a dense matrix by Gaussian elimination, far less if is sparse.
For a 100-unknown problem with a finite-difference Jacobian, five Newton iterations cost 506 evaluations of . When evaluating means running a simulation, that is the bill that matters.
💡Broyden's method
Charles Broyden's idea (1965): compute the Jacobian once, then update it cheaply instead of recomputing it. After a step with change , require the new approximation to satisfy the secant equation — the multi-dimensional version of the secant slope — while changing as little as possible:
A rank-one update, one evaluation of per iteration. Convergence becomes superlinear rather than quadratic, so it takes more iterations — but far fewer evaluations. On a 100-unknown benchmark: Newton 5 iterations / 506 evaluations, Broyden 13 iterations / 114 evaluations.
Derivation
What Broyden's update does, and does not, change
It satisfies the secant equation. Multiply the update by the step ; the scalar cancels:
It changes nothing else. For any direction perpendicular to the step, , so
The one step we just took tells us how changes along , and nothing about other directions. Broyden's update uses exactly that information and keeps every other direction as it was — the smallest change consistent with the new evidence. In one dimension there is only one direction, and the update reduces to the secant slope of lesson 2-2.
Making Newton global. The full Newton step can overshoot just as it did in one dimension. The standard remedy is a line search: compute the Newton direction , then take with until the residual actually decreases. Near the solution is always accepted and quadratic convergence returns. Trust-region methods instead limit the length of the step; MINPACK's
hybrd (Powell's hybrid method, 1970) — the default in scipy.optimize.root — blends Newton and steepest-descent directions within a trust region and updates the Jacobian with Broyden's formula.📐Two-bus power flow
A slack bus holds per unit at angle 0. A line of impedance per unit feeds bus 2, which draws , per unit. The unknowns are bus 2's voltage magnitude and angle ; the two equations say that the complex power injected at bus 2, , equals minus the load.
From the flat start , — every bus at nominal voltage, the convention since Tinney and Hart — Newton with a finite-difference Jacobian drives the mismatch . Bus 2 settles at 0.9757 pu, −2.17°. A real grid has the same structure with thousands of buses and a Jacobian that is almost entirely zeros.
Derivation
Where the two power-flow equations come from
Represent each bus voltage by a complex number, (a magnitude and a phase angle), and the line by its admittance .
Currents from voltages. The current flowing from bus 2 into the line is by Ohm's law. Collected for both buses, with the admittance matrix
Power from current. The complex power a bus injects into the network is (voltage times the complex conjugate of current); its real part is active power , its imaginary part reactive power . Bus 2 injects nothing of its own — it absorbs the load — so
One complex equation is two real ones: real parts equal and imaginary parts equal. Two unknowns, and ; two equations — the mismatch function of the lab. In a grid with buses, is with a nonzero entry for every line, which is why it is sparse.
💡Following a solution: load stepping and arc-length continuation
Engineering systems usually come as families with a load parameter — the load on a structure, the demand on a grid. The natural strategy is load stepping: solve at , and use that solution as the starting guess for , so Newton always starts close. It breaks down at a limit point, where becomes singular and the solution curve turns back on itself.
A shallow two-bar truss loaded at its apex (in normalised units, ) can carry at most , at deflection . Stepping the load by 0.05, Newton converges in 5–6 iterations up to ; at it fails to converge in 50 — there is no nearby solution — and at it lands on : the truss has snapped through to an inverted shape. Arc-length methods (Riks, 1979; Crisfield, 1981) make an unknown too and add one equation fixing the length of each step along the curve. The enlarged Jacobian stays nonsingular at the limit point, and the method follows the whole path: up to 0.385, down to at — where the load would have to pull the other way to hold the truss — and up again. The same idea traces the 'nose curve' of a power grid to its voltage-collapse point (continuation power flow) and finds buckling and collapse loads in nonlinear finite element analysis.
Derivation
Where the truss's limit points are
For load stepping, the equation at load is , and Newton needs its derivative
The load–deflection curve turns back where — exactly where and Newton's step is undefined. Solve the quadratic:
The loads there are , the maximum the truss can carry, and . Between the two the slope is negative: more deflection with less load, a state no load-controlled test can hold. Any load above 0.3849 has only the solution beyond the second limit point — which is why load stepping jumps to , the inverted truss.
🕰Basins of attraction
In 1879 Arthur Cayley asked a deceptively simple question: for Newton's method on in the complex plane, which starting points lead to which of the three roots? He solved the quadratic case and admitted the cubic was harder. It is: the boundaries between the three basins are fractals, with all three colours arbitrarily close to every boundary point. The interactive draws them. They are a vivid reminder that 'close enough to the root' can be a very strange set.
💡Where you will use this
Power Systems: Newton–Raphson load flow, exactly as in the lab, on the whole grid. Rocket Propulsion: chemical-equilibrium codes such as NASA's CEA solve for the combustion products by Newton on a system of element balances. Structures and Geotechnics: nonlinear finite elements assemble a 'tangent stiffness matrix' — a Jacobian — and take Newton steps on it. Spacecraft Attitude Control and GNSS Navigation: the position fix from four pseudoranges is a nonlinear system solved by Newton-type iteration.
📚Further reading
- J. E. Dennis Jr. and Robert Schnabel, Numerical Methods for Unconstrained Optimization and Nonlinear Equations (Prentice-Hall, 1983; SIAM Classics 1996) — Newton's method for systems, line searches and Broyden's update, derived carefully.
- C. T. Kelley, Solving Nonlinear Equations with Newton's Method (SIAM, 2003) — finite-difference Jacobians, globalisation and Broyden in practice.
- William Tinney and Clifford Hart, 'Power flow solution by Newton's method', IEEE Transactions on Power Apparatus and Systems PAS-86(11), 1449–1460 (1967) — the paper behind every load-flow program.
↓But there is a problem
Look back at step 2 of Newton's method for systems: solve . We have treated that as one line of code,
np.linalg.solve.
For two unknowns it is. For a grid of 10,000 buses, a structural model with a million degrees of freedom or a CFD mesh with a hundred million cells, that one line is almost the entire cost of the simulation — and done naively, it can also be where all the accuracy is lost.
How do you solve — quickly, and correctly? That is the next unit.