Search

Search papers and lessons

Lyapunov Stability

Level 4 · 10 min read

Lyapunov stability decides whether a system settles back to equilibrium after a small push, by finding an energy-like function that never increases along its trajectories.

On this page

  • Colour = topic mix
  • Calculus
  • Discrete math
  • Linear algebra
  • Control systems
  • Sign in to see your progress

TL;DR

Lyapunov stability asks whether a system that starts near an equilibrium stays near it, and whether it returns. You do not have to solve the equations to answer this. You look for a function of the state that acts like energy: it is positive everywhere except at the equilibrium, and it never increases along any trajectory. If you can find such a function, the state is pushed toward the bottom of the energy landscape, and the equilibrium is stable.

Where you'll see it: in checking that a controller really brings a robot arm, aircraft or power grid back to its set point, in proving that a learning algorithm's dynamics converge, and in the stability proofs behind model predictive control and switched systems.

Intuition

A ball in a bowl

Put a ball at the bottom of a smooth bowl. Nudge it and it rolls back to the bottom. Put the same ball on top of a hill and a small nudge sends it away. Nobody needs the exact path of the ball to tell these apart. The bowl's height is enough: the ball always goes downhill, and the bottom is the lowest point.

Lyapunov's idea is to find a height function for a dynamical system. If the height is always decreasing along the motion, the state must settle toward the lowest point. The height function is called a Lyapunov function. It plays the role of energy, but it does not have to be the physical energy. It only has to be positive away from equilibrium and never increase.

The plot shows the simplest case, a bowl V(x)=x2/2V(x) = x^2/2 with its lowest point at x=0x = 0. A state anywhere on the curve has positive height, and the ball's motion goes from high to low.

−2−1.5−1−0.500.511.5200.511.52state xV(x)
  • V(x) = x^2/2
A bowl-shaped height function. Motion that always lowers V must end at the bottom, the equilibrium x = 0.

Why the idea is needed

Most nonlinear systems cannot be solved in closed form. The pendulum, the aircraft's attitude and the arm's joint dynamics have no simple formula for their trajectory. Linearizing them around the equilibrium gives a useful answer for small motions, but it says nothing about how large a push the system can take. Lyapunov's method answers that question directly from the equations, without integrating them, and it also works when the system is nonlinear, switching or time-varying.

The math

Equilibria and the two kinds of stability

Consider the autonomous system x˙=f(x)\dot{\mathbf{x}} = \mathbf{f}(\mathbf{x}), where x\mathbf{x} is the state vector and the dot means the time derivative. An equilibrium x⋆\mathbf{x}^\star satisfies f(x⋆)=0\mathbf{f}(\mathbf{x}^\star) = \mathbf{0}, so a state that starts there stays there.

Definition: Stability and asymptotic stability

The equilibrium x⋆\mathbf{x}^\star is stable if for every radius ε>0\varepsilon > 0 there is a radius δ>0\delta > 0 such that a trajectory starting within δ\delta of x⋆\mathbf{x}^\star stays within ε\varepsilon of it for all later times. It is asymptotically stable if it is stable and, in addition, every trajectory starting close enough converges to x⋆\mathbf{x}^\star.

Stable means the system does not drift away after a small push. Asymptotically stable adds that it comes back. A pendulum with friction is asymptotically stable at the bottom. An ideal frictionless pendulum is stable but not asymptotically stable, because it keeps swinging with the same amplitude forever.

The direct method

Let V:Rn→RV : \mathbb{R}^n \to \mathbb{R} be a continuously differentiable function. Along a trajectory, the chain rule gives its rate of change:

V˙(x)=ddtV(x(t))=∑i=1n∂V∂xi x˙i=∇V(x)⋅f(x).\dot{V}(\mathbf{x}) = \frac{d}{dt} V(\mathbf{x}(t)) = \sum_{i=1}^{n} \frac{\partial V}{\partial x_i}\,\dot{x}_i = \nabla V(\mathbf{x}) \cdot \mathbf{f}(\mathbf{x}).

Definition: Lyapunov function

Let x⋆=0\mathbf{x}^\star = \mathbf{0} be an equilibrium, after a change of coordinates if needed. A function VV is a Lyapunov function for it if:

  1. V(0)=0V(\mathbf{0}) = 0 and V(x)>0V(\mathbf{x}) > 0 for every x≠0\mathbf{x} \neq \mathbf{0} near zero (positive definite), and
  2. V˙(x)<0\dot{V}(\mathbf{x}) \lt 0 for every x≠0\mathbf{x} \neq \mathbf{0} near zero (negative definite).

If condition 2 holds with V˙≤0\dot{V} \le 0 instead, the equilibrium is stable. If V˙<0\dot{V} \lt 0 strictly, it is asymptotically stable. The result is Lyapunov's direct method: the proof never needs the trajectory itself.

The reason this works is that VV is a height that is positive and decreasing along the motion. A trajectory starting at height V0V_0 can never be higher than V0V_0, so it stays inside a sublevel set {x:V(x)≤V0}\{ \mathbf{x} : V(\mathbf{x}) \le V_0 \}. For a positive definite VV those sets shrink to the origin as V0V_0 shrinks, which is exactly the statement of stability.

Two refinements matter in practice:

  • Global stability. If VV grows without bound as ∥x∥→∞\|\mathbf{x}\| \to \infty (radially unbounded) and V˙<0\dot{V} \lt 0 everywhere except at the origin, then every trajectory converges to the origin, not only those that start nearby.
  • LaSalle's invariance principle. If V˙≤0\dot{V} \le 0 but is zero on some set, the trajectory must end up in the largest invariant set inside that zero set. If that set is just the origin, the equilibrium is asymptotically stable even though V˙\dot{V} is not strictly negative.

The linear case

For x˙=Ax\dot{\mathbf{x}} = \mathbf{A}\mathbf{x}, try a quadratic V(x)=x⊤PxV(\mathbf{x}) = \mathbf{x}^\top \mathbf{P}\mathbf{x} with P\mathbf{P} symmetric and positive definite. Then

V˙=x⊤(A⊤P+PA)x.\dot{V} = \mathbf{x}^\top(\mathbf{A}^\top \mathbf{P} + \mathbf{P}\mathbf{A})\mathbf{x}.

Choose a positive definite Q\mathbf{Q} and solve the Lyapunov equation A⊤P+PA=−Q\mathbf{A}^\top \mathbf{P} + \mathbf{P}\mathbf{A} = -\mathbf{Q}. If a positive definite P\mathbf{P} exists, the origin is asymptotically stable. The existence of P\mathbf{P} is equivalent to all eigenvalues of A\mathbf{A} having negative real part, which links this method to eigenvalues and to the Linear Dynamical System lesson. For linear systems the eigenvalue test is simpler, but the Lyapunov equation generalises to systems where no such test exists.

Worked examples

Example
A scalar system, one step at a time

Take x˙=−x3\dot{x} = -x^3 with equilibrium x=0x = 0. Try V(x)=x22V(x) = \dfrac{x^2}{2}.

  1. Positive definite: V(0)=0V(0) = 0, and V(x)=x2/2>0V(x) = x^2/2 \gt 0 for x≠0x \neq 0.
  2. Derivative along the motion: V˙=dVdx x˙=x⋅(−x3)=−x4\dot{V} = \dfrac{dV}{dx}\,\dot{x} = x \cdot (-x^3) = -x^4.
  3. Negative definite: −x4<0-x^4 \lt 0 for every x≠0x \neq 0.
  4. Conclusion: the origin is asymptotically stable. The bound V≤V0V \le V_0 keeps ∣x∣|x| below (2V0)1/2(2V_0)^{1/2}, so a start at x=0.5x = 0.5 (where V=0.125V = 0.125) stays within ∣x∣≤0.5|x| \le 0.5 and goes to zero.

Interpretation: the choice V=x2/2V = x^2/2 is the energy of a spring, and the damping term −x3-x^3 removes energy faster the farther xx is from zero. We did not solve the equation, which here has the closed form x(t)=x0/1+2x02tx(t) = x_0 / \sqrt{1 + 2 x_0^2 t}, so the proof is shorter than the solution.

Example
A damped pendulum, where the derivative is only semidefinite

The pendulum with friction is θ¨=−sin⁡θ−c θ˙\ddot{\theta} = -\sin\theta - c\,\dot{\theta}, with c>0c \gt 0. Write it as a first-order system with x1=θx_1 = \theta and x2=θ˙x_2 = \dot{\theta}:

x˙1=x2,x˙2=−sin⁡x1−c x2.\dot{x}_1 = x_2, \qquad \dot{x}_2 = -\sin x_1 - c\,x_2.

Take the energy as the Lyapunov candidate: kinetic energy plus potential energy, measured from the bottom, V(x)=12x22+(1−cos⁡x1)V(\mathbf{x}) = \tfrac{1}{2}x_2^2 + (1 - \cos x_1).

  1. Positive definite: near the origin, 1−cos⁡x1≈x12/21 - \cos x_1 \approx x_1^2/2, so VV is positive except at (0,0)(0, 0).
  2. Compute ∇V=(sin⁡x1,  x2)\nabla V = (\sin x_1, \; x_2) and f=(x2,  −sin⁡x1−c x2)\mathbf{f} = (x_2, \; -\sin x_1 - c\,x_2).
  3. Derivative: V˙=sin⁡x1⋅x2+x2⋅(−sin⁡x1−c x2)=−c x22\dot{V} = \sin x_1 \cdot x_2 + x_2 \cdot (-\sin x_1 - c\,x_2) = -c\,x_2^2.
  4. Numerical check at (x1,x2)=(0.5,1)(x_1, x_2) = (0.5, 1) with c=0.5c = 0.5: ∇V⋅f=0.4794⋅1+1⋅(−0.4794−0.5)=−0.5\nabla V \cdot \mathbf{f} = 0.4794 \cdot 1 + 1 \cdot (-0.4794 - 0.5) = -0.5, which equals −c x22=−0.5-c\,x_2^2 = -0.5.
  5. The derivative is only negative semidefinite. It is zero whenever x2=0x_2 = 0, including at x1=0.5x_1 = 0.5. Here LaSalle's principle applies. A trajectory that stays on x2=0x_2 = 0 must have x˙2=−sin⁡x1=0\dot{x}_2 = -\sin x_1 = 0, so x1x_1 is 00 or π\pi, and π\pi is the far-away upright position, not near the origin. The only invariant subset near the origin is the origin itself, so the equilibrium is asymptotically stable.

Interpretation: friction drains the pendulum's energy, and the energy VV measures what is left. The derivative V˙\dot{V} is zero only when the pendulum is momentarily still, and the position where it is still must also be the bottom, which is the only place it can stay.

Tradeoffs and failure modes

SituationWhat goes wrongBetter choice
No Lyapunov function is foundFailing to find VV proves nothing about stability. The method gives only sufficient conditionsTry a physical energy, a quadratic form for a linearized model, or a sum-of-squares search that looks for VV numerically
V˙\dot{V} is only semidefiniteThe strict test fails even when the system is stableLaSalle's invariance principle
Stability is needed only near the equilibriumThe estimate of the region of attraction, the set of starts that converge, may be smallUse a larger candidate VV or a sum-of-squares region estimate
Several modes that switch between each otherEvery mode can be stable on its own while a switching pattern makes the whole system unstable, so a Lyapunov function must decrease in every modeCommon Lyapunov function, or a piecewise one with a dwell-time condition
Discrete-time systemsThe rate of change is replaced by the difference V(xk+1)−V(xk)V(\mathbf{x}_{k+1}) - V(\mathbf{x}_k)Same idea with the difference in place of the derivative
The state is linearThe eigenvalue test is exact and simplerUse the eigenvalues, and reserve the Lyapunov equation for when you also need a bound or a robust margin

History

Aleksandr Mikhailovich Lyapunov, a Russian mathematician working on the stability of motion, published his general method in his 1892 doctoral dissertation, The General Problem of the Stability of Motion. The problem came from celestial mechanics and the stability of mechanical systems, where one needs to know whether a motion settles or runs away without solving its equations. Lyapunov's approach was largely overlooked in the West for decades. It became central to control theory in the middle of the twentieth century, when engineers adopted it for nonlinear and switched systems, and the invariance principle of LaSalle followed in the 1960s. Its lasting appeal is that a single inequality on an energy-like function can prove a result about a system whose trajectories cannot be written down.

Check yourself

QuestionState the two conditions a function V must satisfy to show that an equilibrium is asymptotically stable.Show answer

VV must be positive definite near the equilibrium, with V=0V = 0 at the equilibrium and V>0V \gt 0 elsewhere nearby. Its derivative along trajectories, V˙=∇V⋅f\dot{V} = \nabla V \cdot \mathbf{f}, must be strictly negative for every nonzero state near the equilibrium. A weaker condition V˙≤0\dot{V} \le 0 gives stability without convergence.

QuestionFor x˙=−2x\dot{x} = -2x and V(x)=x2V(x) = x^2, compute V˙\dot{V} and state what it proves.Show answer

V˙=dVdx x˙=2x⋅(−2x)=−4x2\dot{V} = \dfrac{dV}{dx}\,\dot{x} = 2x \cdot (-2x) = -4x^2. For every x≠0x \neq 0 this is negative, and VV is positive definite, so the origin is asymptotically stable. The true solution x(t)=x0e−2tx(t) = x_0 e^{-2t} confirms it, but the proof used only the sign of V˙\dot{V}.

QuestionWhy does the existence of a Lyapunov function prove stability even though the trajectory is never computed?Show answer

Along any trajectory VV can only decrease, so the trajectory cannot leave a sublevel set {V≤V0}\{V \le V_0\} it starts inside. Because VV is positive definite, those sublevel sets shrink to the equilibrium as V0V_0 shrinks. Stability is the statement that small starts stay in small sets, and the monotone decrease of VV gives that directly.

QuestionA linear system has A=(01−4−2)\mathbf{A} = \begin{pmatrix} 0 & 1 \\ -4 & -2 \end{pmatrix}. Is the origin asymptotically stable? Answer using the trace and determinant.Show answer

For a 2×22 \times 2 matrix, the eigenvalues have negative real parts exactly when the trace is negative and the determinant is positive. The trace is −2-2 and the determinant is 0⋅(−2)−1⋅(−4)=40 \cdot (-2) - 1 \cdot (-4) = 4. Both conditions hold, so the origin is asymptotically stable, and a positive definite P\mathbf{P} solves the Lyapunov equation for any positive definite Q\mathbf{Q}.

Sources