# Finding Possible Unobservable C matrices

As it's known, for a LTI state-space (i.e., $$\dot{x} = Ax + Bu$$, $$y = Cx + Du$$), the observability matrix is

$$Ob = \left[\begin{array}{c} C \\ CA \\ CA^2 \\ \vdots \end{array} \right]$$

and the system has at least one unobservable state if the observability matrix is not full rank.

Suppose that you have a set A and B matrix and, for the sake of argument, lets assume $$D=0$$. You need to decide C matrices (for example, if you were deciding between different sensors). Is it possible to solve for the entire set of possible C matrices that make the system observable or unobservable? Is it just a matter of exhaustion? I would assume it's some sort of linear algebra problem, but I'm not sure how to go about it.

I am not an expert on the obervability matrix or how it is used in practice.

But my preliminary calculations show that it depends very much on the eigenvalue structure of $$A$$, how many sensors you need to make the observability matrix maximum rank. Say, for example, you want to check if one sensor is enough to make the system observable. Then you would start with a $$1\times n$$ matrix $$C=c^T$$, where $$c$$ is an $$n$$-vector that represents the 'projection direction' of the sensor.

Having an observability matrix $$O$$ with a maximum row rank is equivalent to saying that $$O^T$$ has maximum column rank and thus, the vectors $$c,A^Tc,(A^T)^2c,\dots, (A^T)^{n-1}c$$ are linearly independent.

Suppose that $$A$$ and hence, $$A^T$$ is diagonalizable (which I think is most often the case if a physically relevant system is investigated), then $$A^T=\Psi \Lambda \Psi^{-1}$$ where $$\Lambda = {\rm diag}(\lambda_1,\dots,\lambda_n)$$ and the eigenvalues $$\lambda_i$$ are generally complex. If we apply the respective powers to $$c$$ we obtain $$(A^T)^kc = \Psi \Lambda^k \Psi^{-1}c$$ The eigenvector matrix $$\Psi$$ in front of it is irrelevant for the question of linear independence because $$\Psi$$ is invertible. We can also express $$c$$ in terms of the eigenvectors by definig the new vector $$\tilde{c}=\Psi^{-1}c$$. So after all, we want to check, whether the vectors $$v_{(k)}=\Lambda^k \tilde{c}$$ for $$k=0,\dots,n-1$$ are linearly independent, which means that there are no coefficients $$\alpha_k$$ such that $$\left(\sum_{k=0}^{n-1} \alpha_k\Lambda^k\right) \tilde{c}=0$$ or componentwise $$\left(\sum_{k=0}^{n-1} \alpha_k\lambda_i^k\right) \tilde{c}_i=0$$ for all $$i=1,\dots,n$$. The coefficients $$\alpha_k$$ together represent a polynomial $$p(\lambda):=\sum_{k=0}^{n-1} \alpha_k\lambda^k$$ So the only case where a single sensor setup could fail is if there exists a polynomial $$p(\lambda)$$ whose roots are the eigenvalues that correspond to non-zero components of $$\tilde{c}$$: $$p(\lambda_i)\tilde{c}_i=0$$ It is pretty easy to construct such a polynomial if less than $$n$$ components of $$\tilde{c}$$ are $$\not=0$$: we simply build the polynomial from up to $$n-1$$ eigenvalues' linear factors. However, if all components of $$\tilde{c}$$ are $$\not=0$$ and all eigenvalues are different, then the only polynomial (up to scaling) that vanishes for all eigenvalues is $$p(\lambda)=\prod_{i=1}^n (\lambda-\lambda_i)$$ and this polynomial has degree $$n$$ and not degree $$n-1$$ as presupposed.

On the other hand, if two or more eigenvalues are equal (for example $$\lambda_n=\lambda_ {n-1}$$ without loss of generality) it is sufficient to construct the polynomial $$p(\lambda)=\prod_{i=1}^{n-1} (\lambda-\lambda_i)$$ which is now degree $$n-1$$ and vanishes for all eigenvalues although $$\tilde{c}$$ has no zero components. So we conclude:

1. if all the eigenvalues of $$A^T$$ are distinct, we can simply choose a single sensor $$\tilde{c}$$ (in the basis of eigenvectors) with all nonzero components to obtain an observable system
2. if at least two eigenvectors are equal, it is not possible to choose an observable single-sensor system, and we have to increase the number of sensors

I think this consideration can be extended to higher numbers of sensors accordingly. But most importantly, this consideration shows that the eigenvalue structure of $$A$$ and/or $$A^T$$ matters very much with respect to what makes a set of sensors observable.