⛰️Numerical Optimisation
Line Search and Gradient Methods
Optimality conditions, golden-section and Brent in one dimension, steepest descent, Armijo backtracking
Paris, 1847
Augustin-Louis Cauchy, the most prolific mathematician of his century, is thinking about astronomy. Determining the orbit of a body from observations means solving a system of nonlinear equations in several unknowns, and the methods of the day are laborious.
In a three-page note to the Académie des Sciences — Méthode générale pour la résolution des systèmes d'équations simultanées — he proposes something new. Combine the equations into a single function that is zero exactly at the solution and positive elsewhere: the sum of their squares. Then repeatedly move the unknowns in the direction in which that function decreases fastest — against its gradient — by an amount chosen to make it as small as possible along that line.
It is the first gradient method, and the ancestor of every optimisation algorithm in this unit. The same idea, with millions of unknowns and some refinements, trains today's neural networks.
An optimisation problem asks for the that minimises an objective : mass, cost, fuel, error, energy. (Maximising is minimising .) For a smooth , a local minimum satisfies the first-order condition — a nonlinear system (Unit 2) — and the second-order condition that the Hessian is positive semi-definite (positive definite guarantees a strict local minimum). A local minimum need not be global; for convex every local minimum is global.
Derivation
Where the optimality conditions come from, and why is steepest
Expand about a candidate point in a direction (multivariable Taylor, lesson 2-4):
First order. If , take with a small : the change is , negative for small enough . So was not a minimum. At a minimum the gradient must vanish.
Second order. With , the change is to leading order. A minimum needs it to be for every direction: the Hessian is positive semi-definite. If it is positive definite every direction goes strictly uphill — a strict local minimum.
The steepest direction. For a unit direction the rate of change of is . By the Cauchy–Schwarz inequality , with equality only for . Cauchy's direction is the one that decreases fastest — locally.
💡One dimension: golden-section search and Brent
A function that decreases then increases on (unimodal) can be minimised without derivatives by shrinking a bracket — like bisection (lesson 2-1) but with two interior points: compare and and discard the part of the interval beyond the larger one. Placing the points at the golden-ratio positions lets one of them be reused each step, so every step costs one evaluation and shrinks the bracket by .
For an aircraft's drag , golden-section search finds the minimum-drag speed 230.0327 m/s to in 43 evaluations. Brent's method (1973) —
scipy.optimize.minimize_scalar — adds parabolic interpolation through three points and needs only 16. One-dimensional minimisation is also the inner loop of most multi-dimensional methods: the line search.Derivation
The golden ratio, and the minimum-drag speed
Why 0.618. Scale the bracket to and place the two interior points symmetrically at and . Suppose , so we keep . To reuse the surviving point, must sit in the new bracket where sat in the old one — at the fraction of its length:
Every step then costs one new evaluation and keeps 0.618 of the bracket — slower per step than bisection's 0.5, but bisection needs a sign, which a minimum does not provide.
The exact answer the lab checks against. For :
At , : the parasite drag (growing with speed) equals the induced drag (falling with speed) — the classical condition for minimum drag.
💡Steepest descent
At , is the direction of fastest local decrease. Step
with a step length from a line search. For a quadratic with exact line searches the error shrinks per step by at most — the condition number of the Hessian again (lesson 4-3). With , steepest descent needs 105, 1,169 and 12,838 iterations: the zig-zag across a narrow valley that you met in the CG interactive.
Inexact line searches. Minimising exactly along each line wastes evaluations. The Armijo condition (1966) asks only for sufficient decrease: accept if with a small such as , halving from 1 until it holds (backtracking). Together with a curvature condition (Wolfe) this guarantees convergence of descent methods without ever solving the 1-D problem exactly.
📐Rosenbrock's valley
Howard Rosenbrock's 1960 test function has its minimum at at the bottom of a long, narrow, curved valley. Steepest descent with Armijo backtracking from the standard start reaches the minimum to in the gradient after 10,916 iterations. Every step goes almost straight across the valley floor. The landscape is not hard to understand; the method is simply blind to curvature.
It seems that perfection is attained not when there is nothing more to add, but when there is nothing more to remove.
💡Where you will use this
Optimal Guidance: gradient-based trajectory optimisation, and the inner loops of sequential convex programming. Structures: sizing and topology optimisation use gradients computed by adjoint methods. Control: tuning gains to minimise a cost. Machine learning: stochastic gradient descent — Cauchy's method with noisy gradients — is how every neural network is trained.
📚Further reading
- Jorge Nocedal and Stephen Wright, Numerical Optimization (2nd ed., Springer, 2006), chapters 2–3, 'Fundamentals of Unconstrained Optimization' and 'Line Search Methods' — optimality conditions, Armijo and Wolfe conditions, steepest descent.
- Stephen Boyd and Lieven Vandenberghe, Convex Optimization (Cambridge University Press, 2004), chapter 9, 'Unconstrained minimization' — free online from the authors; why convexity makes local minima global.
- Augustin-Louis Cauchy, 'Méthode générale pour la résolution des systèmes d'équations simultanées', Comptes Rendus de l'Académie des Sciences 25, 536–538 (1847) — three pages.
↓But there is a problem
Steepest descent uses only the slope. Ten thousand iterations for a two-variable function is the price of ignoring curvature — the very information Newton's method used in Unit 2 to double its digits every step.
In 1959 William Davidon, a physicist at the Argonne National Laboratory, was tired of waiting for his slow minimisation runs to finish on the laboratory's computer. He invented a method that learns the curvature as it goes, from nothing but gradients. His report was rejected by the journal he sent it to. It circulated for thirty years as a technical report, and was finally published — as the lead article of the first issue of a new journal — in 1991.