# Control Systems/Controllability and Observability

## System Interaction

In the world of control engineering, there are a slew of systems available that need to be controlled. The task of a control engineer is to design controller and compensator units to interact with these pre-existing systems. However, some systems simply cannot be controlled (or, more often, cannot be controlled in specific ways). The concept of controllability refers to the ability of a controller to arbitrarily alter the functionality of the system plant.

The state-variable of a system, x, represents the internal workings of the system that can be separate from the regular input-output relationship of the system. This also needs to be measured, or observed. The term observability describes whether the internal state variables of the system can be externally measured.

## Controllability

We will start off with the definitions of the term controllability, and the related term reachability

Controllability
A system with internal state vector x is called controllable if and only if the system states can be changed by changing the system input.
Reachability
A particular state x1 is called reachable if there exists an input that transfers the state of the system from the initial state x0 to x1 in some finite time interval [t0, t).

We can also write out the definition of reachability more precisely:

A state x1 is called reachable at time t1 if for some finite initial time t0 there exists an input u(t) that transfers the state x(t) from the origin at t0 to x1.

A system is reachable at time t1 if every state x1 in the state-space is reachable at time t1.

Similarly, we can more precisely define the concept of controllability:

A state x0 is controllable at time t0 if for some finite time t1 there exists an input u(t) that transfers the state x(t) from x0 to the origin at time t1.

A system is called controllable at time t0 if every state x0 in the state-space is controllable.

### Controllability Matrix

For LTI (linear time-invariant) systems, a system is reachable if and only if its controllability matrix, ζ, has a full row rank of p, where p is the dimension of the matrix A, and p × q is the dimension of matrix B.

[Controllability Matrix]

$\zeta = \begin{bmatrix}B & AB & A^2B & \cdots & A^{p-1}B\end{bmatrix} \in R^{p \times pq}$

A system is controllable or "Controllable to the origin" when any state x1 can be driven to the zero state x = 0 in a finite number of steps.

A system is controllable when the rank of the system matrix A is p, and the rank of the controllability matrix is equal to:

$Rank(\zeta) = Rank(A^{-1}\zeta) = p$

If the second equation is not satisfied, the system is not .

MATLAB allows one to easily create the controllability matrix with the ctrb command. To create the controllabilty matrix $\zeta$ simply type

zeta=ctrb(A,B)

where A and B are mentioned above. Then in order to determine if the system is controllable or not one can use the rank command to determine if it has full rank.

If

$Rank(A) < p$

Then controllability does not imply reachability.

• Reachability always implies controllability.
• Controllability only implies reachability when the state transition matrix is nonsingular.

### Determining Reachability

There are four methods that can be used to determine if a system is reachable or not:

1. If the p rows of $\phi(t, \tau)B(t)$ are linearly independent over the field of complex numbers. That is, if the rank of the product of those two matrices is equal to p for all values of t and τ
2. If the rank of the controllability matrix is the same as the rank of the system matrix A.
3. If the rank of $\operatorname{rank}[\lambda I - A, B] = p$ for all eigenvalues λ of the matrix A.
4. If the rank of the reachability gramian (described below) is equal to the rank of the system matrix A.

Each one of these conditions is both necessary and sufficient. If any one test fails, all the tests will fail, and the system is not reachable. If any test is positive, then all the tests will be positive, and the system is reachable.

### Gramians

Gramians are complicated mathematical functions that can be used to determine specific things about a system. For instance, we can use gramians to determine whether a system is controllable or reachable. Gramians, because they are more complicated than other methods, are typically only used when other methods of analyzing a system fail (or are too difficult).

All the gramians presented on this page are all matrices with dimension p × p (the same size as the system matrix A).

All the gramians presented here will be described using the general case of Linear time-variant systems. To change these into LTI (time-invariant equations), the following substitutions can be used:

$\phi(t, \tau) \to e^{A(t-\tau)}$
$\phi'(t, \tau) \to e^{A'(t-\tau)}$

Where we are using the notation X' to denote the transpose of a matrix X (as opposed to the traditional notation XT).

### Reachability Gramian

We can define the reachability gramian as the following integral:

[Reachability Gramian]

$W_r(t_0, t_1) = \int_{t_0}^{t_1}\phi(t_1, \tau)B(\tau)B'(\tau)\phi'(t_1, \tau)d\tau$

The system is reachable if the rank of the reachability gramian is the same as the rank of the system matrix:

$\operatorname{rank}(W_r) = p$

### Controllability Gramian

We can define the controllability gramian of a system (A, B) as:

[Controllability Gramian]

$W_c(t_0, t_1) = \int_{t_0}^{t_1}\phi(t_0, \tau)B(\tau)B'(\tau)\phi'(t_0, \tau)d\tau$

The system is controllable if the rank of the controllability gramian is the same as the rank of the system matrix:

$\operatorname{rank}(W_c) = p$

If the system is time-invariant, there are two important points to be made. First, the reachability gramian and the controllability gramian reduce to be the same equation. Therefore, for LTI systems, if we have found one gramian, then we automatically know both gramians. Second, the controllability gramian can also be found as the solution to the following Lyapunov equation:

$AW_c + W_cA' = -BB'$

Many software packages, notably MATLAB, have functions to solve the Lyapunov equation. By using this last relation, we can also solve for the controllability gramian using these existing functions.

## Observability

The state-variables of a system might not be able to be measured for any of the following reasons:

1. The location of the particular state variable might not be physically accessible (a capacitor or a spring, for instance).
2. There are no appropriate instruments to measure the state variable, or the state-variable might be measured in units for which there does not exist any measurement device.
3. The state-variable is a derived "dummy" variable that has no physical meaning.

If things cannot be directly observed, for any of the reasons above, it can be necessary to calculate or estimate the values of the internal state variables, using only the input/output relation of the system, and the output history of the system from the starting time. In other words, we must ask whether or not it is possible to determine what the inside of the system (the internal system states) is like, by only observing the outside performance of the system (input and output)? We can provide the following formal definition of mathematical observability:

Observability
A system with an initial state, $x(t_0)$ is observable if and only if the value of the initial state can be determined from the system output y(t) that has been observed through the time interval $t_0. If the initial state cannot be so determined, the system is unobservable.
Complete Observability
A system is said to be completely observable if all the possible initial states of the system can be observed. Systems that fail this criteria are said to be unobservable.
Detectability
A system is Detectable if all states that cannot be observed decay to zero asymptotically.
Constructability
A system is constructable if the present state of the system can be determined from the present and past outputs and inputs to the system. If a system is observable, then it is also constructable. The relationship does not work the other way around.

A system state xi is unobservable at a given time ti if the zero-input response of the system is zero for all time t. If a system is observable, then the only state that produces a zero output for all time is the zero state. We can use this concept to define the term state-observability.

State-Observability
A system is completely state-observable at time t0 or the pair (A, C) is observable at t0 if the only state that is unobservable at t0 is the zero state x = 0.

### Constructability

A state x is unconstructable at a time t1 if for every finite time t < t1 the zero input response of the system is zero for all time t.

A system is completely state constructable at time t1 if the only state x that is unconstructable at t0 is x = 0.

If a system is observable at an initial time t0, then it is constructable at some time t > t0, if it is constructable at t1.

### Observability Matrix

The observability of the system is dependant only on the system states and the system output, so we can simplify our state equations to remove the input terms:

Matrix Dimensions:
A: p × p
B: p × q
C: r × p
D: r × q

$x'(t) = Ax(t)$
$y(t) = Cx(t)$

Therefore, we can show that the observability of the system is dependant only on the coefficient matrices A and C. We can show precisely how to determine whether a system is observable, using only these two matrices. If we have the observability matrix Q:

[Observability Matrix]

$Q = \begin{bmatrix}C\\CA\\CA^2\\\vdots\\CA^{p-1}\end{bmatrix}$

we can show that the system is observable if and only if the Q matrix has a rank of p. Notice that the Q matrix has the dimensions pr × p.

MATLAB allows one to easily create the observability matrix with the obsv command. To create the observabilty matrix $Q$ simply type

Q=obsv(A,C)

where A and C are mentioned above. Then in order to determine if the system is observable or not one can use the rank command to determine if it has full rank.

### Observability Gramian

We can define an observability gramian as:

[Observability Gramian]

$W_o(t_0, t_1) = \int_{t_0}^{t_1} \phi'(\tau, t_0)C'(\tau)C(\tau)\phi(\tau, t_0)d\tau$

A system is completely state observable at time t0 < t < t1 if and only if the rank of the observability gramian is equal to the size p of the system matrix A.

If the system (A, B, C, D) is time-invariant, we can construct the observability gramian as the solution to the Lyapunov equation:

$A'W_o + W_oA = -C'C$

### Constructability Gramian

We can define a constructability gramian as:

[Constructability Gramian]

$W_{cn}(t_0, t_1) = \int_{t_0}^{t_1} \phi'(\tau, t_1)C'(\tau)C(\tau)\phi(\tau, t_1)d\tau$

A system is completely state observable at an initial time t0 if and only if there exists a finite t1 such that:

$\operatorname{rank} (W_0) = \operatorname{rank} (W_{cn}) = p$

Notice that the constructability and observability gramians are very similar, and typically they can both be calculated at the same time, only substituting in different values into the state-transition matrix.

## Duality Principle

The concepts of controllability and observability are very similar. In fact, there is a concrete relationship between the two. We can say that a system (A, B) is controllable if and only if the system (A', C, B', D) is observable. This fact can be proven by plugging A' in for A, and B' in for C into the observability Gramian. The resulting equation will exactly mirror the formula for the controllability gramian, implying that the two results are the same.