# Lyapunov equation

In control theory, the discrete Lyapunov equation is of the form

$AXA^{H}-X+Q=0$ where $Q$ is a Hermitian matrix and $A^{H}$ is the conjugate transpose of $A$ . The continuous Lyapunov equation is of form: $AX+XA^{H}+Q=0$ .

The Lyapunov equation occurs in many branches of control theory, such as stability analysis and optimal control. This and related equations are named after the Russian mathematician Aleksandr Lyapunov.

## Application to stability

In the following theorems $A,P,Q\in \mathbb {R} ^{n\times n}$ , and $P$ and $Q$ are symmetric. The notation $P>0$ means that the matrix $P$ is positive definite.

Theorem (continuous time version). Given any $Q>0$ , there exists a unique $P>0$ satisfying $A^{T}P+PA+Q=0$ if and only if the linear system ${\dot {x}}=Ax$ is globally asymptotically stable. The quadratic function $V(x)=x^{T}Px$ is a Lyapunov function that can be used to verify stability.

Theorem (discrete time version). Given any $Q>0$ , there exists a unique $P>0$ satisfying $A^{T}PA-P+Q=0$ if and only if the linear system $x_{t+1}=Ax_{t}$ is globally asymptotically stable. As before, $z^{T}Pz$ is a Lyapunov function.

## Computational aspects of solution

Specialized software is available for solving Lyapunov equations. For the discrete case, the Schur method of Kitagawa is often used. For the continuous Lyapunov equation the method of Bartels and Stewart can be used.

## Analytic solution

Defining the $\operatorname {vec} (A)$ operator as stacking the columns of a matrix $A$ and $A\otimes B$ as the Kronecker product of $A$ and $B$ , the continuous time and discrete time Lyapunov equations can be expressed as solutions of a matrix equation. Furthermore, if the matrix $A$ is stable, the solution can also be expressed as an integral (continuous time case) or as an infinite sum (discrete time case).

### Discrete time

Using the result that $\operatorname {vec} (ABC)=(C^{T}\otimes A)\operatorname {vec} (B)$ , one has

$(I_{n^{2}}-{\bar {A}}\otimes A)\operatorname {vec} (X)=\operatorname {vec} (Q)$ where $I_{n^{2}}$ is a conformable identity matrix. One may then solve for $\operatorname {vec} (X)$ by inverting or solving the linear equations. To get $X$ , one must just reshape $\operatorname {vec} (X)$ appropriately.

Moreover, if $A$ is stable, the solution $X$ can also be written as

$X=\sum _{k=0}^{\infty }A^{k}Q(A^{H})^{k}$ .

For comparison, consider the one-dimensional case, where this just says that the solution of $(1-a^{2})\,x=q$ is $x={\tfrac {q}{1-a^{2}}}=\sum _{k=0}^{\infty }q\,a^{2k}$ .

### Continuous time

Using again the Kronecker product notation and the vectorization operator, one has the matrix equation

$(I_{n}\otimes A+{\bar {A}}\otimes I_{n})\operatorname {vec} X=-\operatorname {vec} Q,$ where ${\bar {A}}$ denotes the matrix obtained by complex conjugating the entries of $A$ .

Similar to the discrete-time case, if $A$ is stable, the solution $X$ can also be written as

$X=\int \limits _{0}^{\infty }\mathrm {e} ^{A\,\tau }Q\mathrm {e} ^{A^{H}\,\tau }d\tau$ .

For comparison, consider the one-dimensional case, where this just says that the solution of $2\,a\,x=-q$ is $x={\tfrac {-q}{2\,a}}=\int _{0}^{\infty }q\,\mathrm {e} ^{2\,a\,\tau }d\tau$ .