# Controllability Gramian

In control theory, we may need to find out whether or not a system such as

${\displaystyle {\begin{array}{c}{\dot {\boldsymbol {x}}}(t){\boldsymbol {=Ax}}(t)+{\boldsymbol {Bu}}(t)\\{\boldsymbol {y}}(t)={\boldsymbol {Cx}}(t)+{\boldsymbol {Du}}(t)\end{array}}}$

is controllable or not, where ${\displaystyle {\boldsymbol {A}}}$, ${\displaystyle {\boldsymbol {B}}}$, ${\displaystyle {\boldsymbol {C}}}$ and ${\displaystyle {\boldsymbol {D}}}$ are, respectively, ${\displaystyle n\times n}$, ${\displaystyle n\times p}$, ${\displaystyle q\times n}$ and ${\displaystyle q\times p}$ matrices.

One of the many ways one can achieve such goal is by the use of the Controllability Gramian.

## Controllability in LTI Systems

Linear Time Invariant (LTI) Systems are those systems in which the parameters ${\displaystyle {\boldsymbol {A}}}$, ${\displaystyle {\boldsymbol {B}}}$, ${\displaystyle {\boldsymbol {C}}}$ and ${\displaystyle {\boldsymbol {D}}}$ are invariant with respect to time.

One can observe if the LTI system is or is not controllable simply by looking at the pair ${\displaystyle ({\boldsymbol {A}},{\boldsymbol {B}})}$. Then, we can say that the following statements are equivalent:

1. The pair ${\displaystyle ({\boldsymbol {A}},{\boldsymbol {B}})}$ is controllable.

2. The ${\displaystyle n\times n}$ matrix

${\displaystyle {\boldsymbol {W_{c}}}(t)=\int _{0}^{t}e^{{\boldsymbol {A}}\tau }{\boldsymbol {BB^{T}}}e^{{\boldsymbol {A}}^{T}\tau }d\tau =\int _{0}^{t}e^{{\boldsymbol {A}}(t-\tau )}{\boldsymbol {BB^{T}}}e^{{\boldsymbol {A}}^{T}(t-\tau )}d\tau }$

is nonsingular for any ${\displaystyle t>0}$.

3. The ${\displaystyle n\times np}$ controllability matrix

${\displaystyle {\mathcal {C}}=[{\begin{array}{ccccc}{\boldsymbol {B}}&{\boldsymbol {AB}}&{\boldsymbol {A^{2}B}}&...&{\boldsymbol {A^{n-1}B}}\end{array}}]}$

has rank n.

4. The ${\displaystyle n\times (n+p)}$ matrix

${\displaystyle [{\begin{array}{cc}{\boldsymbol {A}}{\boldsymbol {-\lambda }}{\boldsymbol {I}}&{\boldsymbol {B}}\end{array}}]}$

has full row rank at every eigenvalue ${\displaystyle \lambda }$ of ${\displaystyle {\boldsymbol {A}}}$.

5. If, in addition, all eigenvalues of ${\displaystyle {\boldsymbol {A}}}$ have negative real parts (${\displaystyle {\boldsymbol {A}}}$ is stable), then the unique solution of

${\displaystyle {\boldsymbol {A}}{\boldsymbol {W}}_{c}+{\boldsymbol {W}}_{c}{\boldsymbol {A^{T}}}=-{\boldsymbol {BB^{T}}}}$

is positive definite. The solution is called the Controllability Gramian and can be expressed as

${\displaystyle {\boldsymbol {W_{c}}}=\int _{0}^{\infty }e^{{\boldsymbol {A}}\tau }{\boldsymbol {BB^{T}}}e^{{\boldsymbol {A}}^{T}\tau }d\tau }$

In the following section we are going to take a closer look at the Controllability Gramian.

## Controllability Gramian

The controllability Gramian can be found as the solution of the Lyapunov equation given by

${\displaystyle {\boldsymbol {A}}{\boldsymbol {W}}_{c}+{\boldsymbol {W}}_{c}{\boldsymbol {A^{T}}}=-{\boldsymbol {BB^{T}}}}$

In fact, we can see that if we take

${\displaystyle {\boldsymbol {W_{c}}}=\int _{0}^{\infty }e^{{\boldsymbol {A}}\tau }{\boldsymbol {BB^{T}}}e^{{\boldsymbol {A}}^{T}\tau }d\tau }$

as a solution, we are going to find that:

${\displaystyle {\begin{array}{ccccc}{\boldsymbol {A}}{\boldsymbol {W}}_{c}+{\boldsymbol {W}}_{c}{\boldsymbol {A^{T}}}&=&\int _{0}^{\infty }{\boldsymbol {A}}e^{{\boldsymbol {A}}\tau }{\boldsymbol {BB^{T}}}e^{{\boldsymbol {A}}^{T}\tau }d\tau &+&\int _{0}^{\infty }e^{{\boldsymbol {A}}\tau }{\boldsymbol {BB^{T}}}e^{{\boldsymbol {A}}^{T}\tau }{\boldsymbol {A^{T}}}d\tau \\&=&\int _{0}^{\infty }{\frac {d}{d\tau }}(e^{{\boldsymbol {A}}\tau }{\boldsymbol {B}}{\boldsymbol {B}}^{T}e^{{\boldsymbol {A}}^{T}\tau })d\tau &=&e^{{\boldsymbol {A}}t}{\boldsymbol {B}}{\boldsymbol {B}}^{T}e^{{\boldsymbol {A}}^{T}t}|_{t=0}^{\infty }\\&=&{\boldsymbol {0}}-{\boldsymbol {BB^{T}}}\\&=&{\boldsymbol {-BB^{T}}}\end{array}}}$

Where we used the fact that ${\displaystyle e^{{\boldsymbol {A}}t}=0}$ at ${\displaystyle t=\infty }$ for stable ${\displaystyle {\boldsymbol {A}}}$ (all its eigenvalues have negative real part). This shows us that ${\displaystyle {\boldsymbol {W}}_{c}}$ is indeed the solution for the Lyapunov equation under analysis.

### Properties

We can see that ${\displaystyle {\boldsymbol {BB^{T}}}}$ is a symmetric matrix, therefore, so is ${\displaystyle {\boldsymbol {W}}_{c}}$.

We can use again the fact that, if ${\displaystyle {\boldsymbol {A}}}$ is stable (all its eigenvalues have negative real part) to show that ${\displaystyle {\boldsymbol {W}}_{c}}$ is unique. In order to prove so, suppose we have two different solutions for

${\displaystyle {\boldsymbol {A}}{\boldsymbol {W}}_{c}+{\boldsymbol {W}}_{c}{\boldsymbol {A^{T}}}=-{\boldsymbol {BB^{T}}}}$

and they are given by ${\displaystyle {\boldsymbol {W}}_{c1}}$ and ${\displaystyle {\boldsymbol {W}}_{c2}}$. Then we have:

${\displaystyle {\boldsymbol {A}}{\boldsymbol {(W}}_{c1}-{\boldsymbol {W}}_{c2})+{\boldsymbol {(W}}_{c1}-{\boldsymbol {W}}_{c2}){\boldsymbol {A^{T}}}={\boldsymbol {0}}}$

Multiplying by ${\displaystyle e^{{\boldsymbol {A}}t}}$ by the left and by ${\displaystyle e^{{\boldsymbol {A}}^{T}t}}$ by the right, would lead us to

${\displaystyle e^{{\boldsymbol {A}}t}[{\boldsymbol {A}}{\boldsymbol {(W}}_{c1}-{\boldsymbol {W}}_{c2})+{\boldsymbol {(W}}_{c1}-{\boldsymbol {W}}_{c2}){\boldsymbol {A^{T}}}]e^{{\boldsymbol {A^{T}}}t}={\frac {d}{dt}}[e^{{\boldsymbol {A}}t}[({\boldsymbol {W}}_{c1}-{\boldsymbol {W}}_{c2})e^{{\boldsymbol {A^{T}}}t}]={\boldsymbol {0}}}$

Integrating from ${\displaystyle 0}$ to ${\displaystyle \infty }$:

${\displaystyle [e^{{\boldsymbol {A}}t}[({\boldsymbol {W}}_{c1}-{\boldsymbol {W}}_{c2})e^{{\boldsymbol {A^{T}}}t}]|_{t=0}^{\infty }={\boldsymbol {0}}}$

using the fact that ${\displaystyle e^{{\boldsymbol {A}}t}\rightarrow 0}$ as ${\displaystyle t\rightarrow \infty }$:

${\displaystyle {\boldsymbol {0}}-({\boldsymbol {W}}_{c1}-{\boldsymbol {W}}_{c2})={\boldsymbol {0}}}$

In other words, ${\displaystyle {\boldsymbol {W}}_{c}}$ has to be unique.

Also, we can see that

${\displaystyle {\boldsymbol {x^{T}W_{c}x}}=\int _{0}^{\infty }{\boldsymbol {x}}^{T}e^{{\boldsymbol {A}}t}{\boldsymbol {BB^{T}}}e^{{\boldsymbol {A}}^{T}t}{\boldsymbol {x}}dt=\int _{0}^{\infty }\left\Vert {\boldsymbol {B^{T}e^{{\boldsymbol {A}}^{T}t}{\boldsymbol {x}}}}\right\Vert _{2}^{2}dt}$

is positive for any t, and that makes ${\displaystyle {\boldsymbol {W}}_{c}}$ a positive definite matrix.

More properties of controllable systems can be found in [1], as well as the proof for the other equivalent statements of “The pair ${\displaystyle ({\boldsymbol {A}},{\boldsymbol {B}})}$ is controllable” presented in section Controllability in LTI Systems.

## Discrete Time Systems

For discrete time systems as

${\displaystyle {\begin{array}{c}{\boldsymbol {x}}[k+1]{\boldsymbol {=Ax}}[k]+{\boldsymbol {Bu}}[k]\\{\boldsymbol {y}}[k]={\boldsymbol {Cx}}[k]+{\boldsymbol {Du}}[k]\end{array}}}$

One can check that there are equivalences for the statement “The pair ${\displaystyle ({\boldsymbol {A}},{\boldsymbol {B}})}$ is controllable” (the equivalences are much alike for the continuous time case).

We are interested in the equivalence that claims that, if “The pair ${\displaystyle ({\boldsymbol {A}},{\boldsymbol {B}})}$ is controllable” and all the eigenvalues of ${\displaystyle {\boldsymbol {A}}}$ have magnitude less than ${\displaystyle 1}$ (${\displaystyle {\boldsymbol {A}}}$ is stable), then the unique solution of

${\displaystyle W_{dc}-{\boldsymbol {A}}{\boldsymbol {W}}_{dc}{\boldsymbol {A^{T}}}={\boldsymbol {BB^{T}}}}$

is positive definite and given by

${\displaystyle {\boldsymbol {W}}_{dc}=\sum _{m=0}^{\infty }{\boldsymbol {A}}^{m}{\boldsymbol {BB}}^{T}({\boldsymbol {A}}^{T})^{m}}$

That is called the discrete Controllability Gramian. We can easily see the correspondence between discrete time and the continuous time case, that is, if we can check that ${\displaystyle {\boldsymbol {W}}_{dc}}$ is positive definite, and all eigenvalues of ${\displaystyle {\boldsymbol {A}}}$ have magnitude less than ${\displaystyle 1}$, the system ${\displaystyle ({\boldsymbol {A}},{\boldsymbol {B}})}$ is controllable. More properties and proofs can be found in [2].

## Linear Time Variant Systems

Linear time variant (LTV) systems are those in the form:

${\displaystyle {\begin{array}{c}{\dot {\boldsymbol {x}}}(t){\boldsymbol {=A}}(t){\boldsymbol {x}}(t)+{\boldsymbol {B}}(t){\boldsymbol {u}}(t)\\{\boldsymbol {y}}(t)={\boldsymbol {C}}(t){\boldsymbol {x}}(t)\end{array}}}$

That is, the matrices ${\displaystyle {\boldsymbol {A}}}$, ${\displaystyle {\boldsymbol {B}}}$ and ${\displaystyle {\boldsymbol {C}}}$ have entries that varies with time. Again, as well as in the continuous time case and in the discrete time case, one may be interested in discovering if the system given by the pair ${\displaystyle ({\boldsymbol {A}}(t),{\boldsymbol {B}}(t))}$ is controllable or not. This can be done in a very similar way of the preceding cases.

The system ${\displaystyle ({\boldsymbol {A}}(t),{\boldsymbol {B}}(t))}$ is controllable at time ${\displaystyle t_{0}}$ if and only if there exists a finite ${\displaystyle t_{1}>t_{0}}$ such that the ${\displaystyle n\times n}$ matrix also called the Controllability Gramian is given by

${\displaystyle {\boldsymbol {W}}_{c}(t_{0},t_{1})=\int _{_{0}}^{^{\infty }}{\boldsymbol {\Phi }}(t_{1},\tau ){\boldsymbol {B}}(\tau ){\boldsymbol {B}}^{T}(\tau ){\boldsymbol {\Phi }}^{T}(t_{1},\tau )d\tau }$

where ${\displaystyle {\boldsymbol {\Phi }}(t,\tau )}$ is the state transition matrix of ${\displaystyle {\boldsymbol {\dot {x}}}={\boldsymbol {A}}(t){\boldsymbol {x}}}$ is nonsingular.

Again, we have a similar method to determine if a system is or not a controllable system.

### Properties of ${\displaystyle {\boldsymbol {W}}_{c}(t_{0},t_{1})}$

We have that the Controllability Gramian ${\displaystyle {\boldsymbol {W}}_{c}(t_{0},t_{1})}$ have the following property:

${\displaystyle {\boldsymbol {W}}_{c}(t_{0},t_{1})={\boldsymbol {W}}_{c}(t_{0},t)+{\boldsymbol {\Phi }}(t,t_{0}){\boldsymbol {W}}_{c}(t,t_{0}){\boldsymbol {\Phi }}^{T}(t,t_{0})}$

that can easily be seen by the definition of ${\displaystyle {\boldsymbol {W}}_{c}(t_{0},t_{1})}$ and by the property of the state transition matrix that claims that:

${\displaystyle {\boldsymbol {\Phi }}(t_{0},t_{1})={\boldsymbol {\Phi }}(t_{1},\tau ){\boldsymbol {\Phi }}(\tau ,t_{0})}$

More about the Controllability Gramian can be found in [3].