# Lyapunov function

In the theory of ordinary differential equations (ODEs), Lyapunov functions, named after Aleksandr Lyapunov, are scalar functions that may be used to prove the stability of an equilibrium of an ODE. Lyapunov functions (also called Lyapunov’s second method for stability) are important to stability theory of dynamical systems and control theory. A similar concept appears in the theory of general state-space Markov chains usually under the name Foster–Lyapunov functions.
For certain classes of ODEs, the existence of Lyapunov functions is a necessary and sufficient condition for stability. Whereas there is no general technique for constructing Lyapunov functions for ODEs, in many specific cases the construction of Lyapunov functions is known. For instance, quadratic functions suffice for systems with one state, the solution of a particular linear matrix inequality provides Lyapunov functions for linear systems, and conservation laws can often be used to construct Lyapunov functions for physical systems.

## Definition

A Lyapunov function for an autonomous dynamical system
    ${\begin{cases}g:\mathbb {R} ^{n}\to \mathbb {R} ^{n}&\\{\dot {y}}=g(y)\end{cases}}$
with an equilibrium point at $y=0$ is a scalar function $V:\mathbb {R} ^{n}\to \mathbb {R}$ that is continuous, has continuous first derivatives, is strictly positive for $y\neq 0$, and for which the time derivative ${\dot {V}}=\nabla {V}\cdot g$ is non positive (these conditions are required on some region containing the origin). The (stronger) condition that $-\nabla {V}\cdot g$ is strictly positive for $y\neq 0$ is sometimes stated as $-\nabla {V}\cdot g$ is locally positive definite, or $\nabla {V}\cdot g$ is locally negative definite.

### Further discussion of the terms arising in the definition

Lyapunov functions arise in the study of equilibrium points of dynamical systems. In $\mathbb {R} ^{n},$ an arbitrary autonomous dynamical system can be written as
    ${\dot {y}}=g(y)$
for some smooth $g:\mathbb {R} ^{n}\to \mathbb {R} ^{n}.$
An equilibrium point is a point $y^{*}$ such that $g\left(y^{*}\right)=0.$ Given an equilibrium point, $y^{*},$ there always exists a coordinate transformation $x=y-y^{*},$ such that:
    ${\begin{cases}{\dot {x}}={\dot {y}}=g(y)=g\left(x+y^{*}\right)=f(x)\\f(0)=0\end{cases}}$
Thus, in studying equilibrium points, it is sufficient to assume the equilibrium point occurs at $0$.
By the chain rule, for any function, $H:\mathbb {R} ^{n}\to \mathbb {R} ,$ the time derivative of the function evaluated along a solution of the dynamical system is
    ${\dot {H}}={\frac {d}{dt}}H(x(t))={\frac {\partial H}{\partial x}}\cdot {\frac {dx}{dt}}=\nabla H\cdot {\dot {x}}=\nabla H\cdot f(x).$
A function $H$ is defined to be locally positive-definite function (in the sense of dynamical systems) if both $H(0)=0$ and there is a neighborhood of the origin, ${\mathcal {B}}$, such that:
    $H(x)>0\quad \forall x\in {\mathcal {B}}\setminus \{0\}.$

## Basic Lyapunov theorems for autonomous systems

Let $x^{*}=0$ be an equilibrium point of the autonomous system
    ${\dot {x}}=f(x).$
and use the notation ${\dot {V}}(x)$ to denote the time derivative of the Lyapunov-candidate-function $V$:
    ${\dot {V}}(x)={\frac {d}{dt}}V(x(t))={\frac {\partial V}{\partial x}}\cdot {\frac {dx}{dt}}=\nabla V\cdot {\dot {x}}=\nabla V\cdot f(x).$

### Locally asymptotically stable equilibrium

If the equilibrium point is isolated, the Lyapunov-candidate-function $V$ is locally positive definite, and the time derivative of the Lyapunov-candidate-function is locally negative definite:
    ${\dot {V}}(x)<0\quad \forall x\in {\mathcal {B}}(0)\setminus \{0\},$
for some neighborhood ${\mathcal {B}}(0)$ of origin, then the equilibrium is proven to be locally asymptotically stable.

### Stable equilibrium

If $V$ is a Lyapunov function, then the equilibrium is Lyapunov stable. The converse is also true, and was proved by José Luis Massera.

### Globally asymptotically stable equilibrium

If the Lyapunov-candidate-function $V$ is globally positive definite, radially unbounded, the equilibrium isolated and the time derivative of the Lyapunov-candidate-function is globally negative definite:
    ${\dot {V}}(x)<0\quad \forall x\in \mathbb {R} ^{n}\setminus \{0\},$
then the equilibrium is proven to be globally asymptotically stable.
The Lyapunov-candidate function $V(x)$ is radially unbounded if
    $\|x\|\to \infty \Rightarrow V(x)\to \infty .$
(This is also referred to as norm-coercivity.)

## Example

Consider the following differential equation on $\mathbb {R}$:
    ${\dot {x}}=-x.$
Considering that $x^{2}$ is always positive around the origin it is a natural candidate to be a Lyapunov function to help us study $x$. So let $V(x)=x^{2}$ on $\mathbb {R}$. Then,
    ${\dot {V}}(x)=V'(x){\dot {x}}=2x\cdot (-x)=-2x^{2}<0.$
This correctly shows that the above differential equation, $x,$ is asymptotically stable about the origin. Note that using the same Lyapunov candidate one can show that the equilibrium is also globally asymptotically stable.