S9 · Lesson 44 · Lyapunov stability
Proving stability with an energy-like function: Lyapunov's direct method, the Lyapunov equation for linear systems, energy arguments for nonlinear ones, and estimates of the region of attraction
Poles settle stability for linear systems. For nonlinear ones, linearization (lesson 3) tells you only what happens close to an equilibrium, and nothing about how close is close enough. Lyapunov's idea, from 1892, was to generalize energy: if some positive quantity of the state never increases along every trajectory, the state can't run away, and if it always decreases, the state must settle. Finding such a function proves stability without solving the equations at all, and its level sets give a region from which recovery is guaranteed.
- The curve is the energy of a damped oscillator started at x = 1 at rest.
- Its rate of change is : never positive, and zero only at the instants when the velocity passes through zero, which is why the curve descends in steps.
- That's a Lyapunov function: with ζ > 0 it proves the oscillator settles, without solving for x(t).
Predict
A damped pendulum 1 m long hangs at rest and is struck. With friction, what initial angular speed guarantees, by an energy argument, that it never swings over the top?
The energy per unit is , and friction makes . Reaching the top needs s⁻², so starting with , that is rad/s, keeps it below forever: a level set of V bounds the region the state can reach.
Name it
Lyapunov's direct method
For with an equilibrium at 0, suppose a function V(x) is
- positive definite: V(0) = 0 and V(x) > 0 elsewhere, and
- non-increasing along trajectories: .
Then the equilibrium is stable. If everywhere except 0, it's asymptotically stable. If but only on a set containing no complete trajectory except the equilibrium, LaSalle's principle still gives asymptotic stability, as for the oscillator above, whose vanishes only at isolated instants.
Linear systems: the Lyapunov equation
For , try . Then , so choose a positive-definite Q and solve
A has all its eigenvalues in the left half-plane exactly when the solution P is positive definite. For one state, , this is , so . For the companion form with Q = I:
The same equation gives the LQR cost (lesson 38) and the steady-state covariance of a system driven by noise.
Regions of attraction
Where holds only in part of the state space, the largest level set lying entirely inside that part is a region from which every trajectory converges: an estimate, usually conservative, of the region of attraction. For , gives , negative for |x| < 1, so every start with |x| < 1 returns to 0. Here that's exact: the system has other equilibria at ±1.
Worked example
Solve the Lyapunov equation for , and check it proves stability.
Show the solution
- Write out P.
- The equation's entries.
- Solve.
- Check it's positive definite. , and
- Conclusion. So proves stability, matching A's eigenvalues at −1 and −2.
Answer = 1.25 and = 0.25; P is positive definite, so the origin is stable.
Worked example
A damped pendulum 1 m long hangs at rest. What initial angular speeds are guaranteed never to carry it over the top?
Show the solution
- Energy function.
- It never grows. With friction,
- Energy at the top.
- Safe starting speeds. Any start with , that is stays in the set V < 19.62 forever and, by LaSalle, settles at the bottom.
- Faster starts. They may or may not go over; the energy argument is silent, since friction may remove enough on the way up.
Answer any initial angular speed below 6.26 rad/s is guaranteed never to carry it over the top.
Worked example
For , estimate the region of attraction of x = 0 with .
Show the solution
- Derivative of V.
- Where it's negative. For , so every start with |x| < 2 returns to zero.
- Check against the equilibria. The other equilibria sit at , x = ±2, so the estimate is exact; beyond them the cubic term wins and the state escapes.
Answer every start with |x| < 2 returns to zero, and that estimate is exact.
Check
Solve for .
(a)
What is ?
(b)
What is ?
(c)
What is ?
Check
The scalar system has the Lyapunov function with .
(a)
What is P?
(b)
At what rate does V decay, in s⁻¹?
Check
A damped pendulum 0.5 m long hangs at rest and is struck.
(a)
What energy per unit , in s⁻², does it need to reach the top?
(b)
Below what initial angular speed is it guaranteed never to go over?
Write units the way you normally would: 1.5 rad/s and 1500 mrad/s are the same answer.
Check
The system is studied with .
(a)
Within what |x| is negative?
Check
has the Lyapunov function with ; the state starts at (3, 0).
(a)
What is V at the start?
(b)
What is , the integrated squared state?
Check
A candidate Lyapunov function has everywhere, but whenever the velocity is zero, as for a damped oscillator's energy. What can be concluded?
Check
The Lyapunov equation for .
Step 1
What is ?
Type it the way you would write it, like 3sin(2πft) or 3*sin(2*pi*f*t). Angles can be in radians or carry a degree sign, like 45°.
Step 2
What is ?
Step 3
What is det P (positive for every stable A)?
Check
Write lyap2(A, Q): solve for 2 × 2 lists A and symmetric Q, returning P as a 2 × 2 list, by solving the three linear equations for ; and is_pos_def(P).
Python 3.14 with numpy and matplotlib, running in your browser. Tab indents; press Esc and then Tab to move on.
Explain why
How can a Lyapunov function prove a nonlinear system stable without solving its equations?
A Lyapunov function is a positive measure of how far the state is from equilibrium, like stored energy, that can be checked to never increase along the system's motion just by computing its rate of change from the differential equation at each point, without solving for the trajectory. If that rate is never positive, the state can never wander farther than the level of the function it started at, which proves stability. If the rate is negative everywhere except the equilibrium, or zero only where no trajectory can stay, the state must keep losing that measure and settle at the equilibrium. Where the rate is negative only in part of the state space, the largest level set inside that part gives a region from which recovery is guaranteed.
Practice
Keep practicing
8 kinds of problem on this topic, dealt one at a time with new numbers every time, for as long as you like.