Why the controllability matrix $C$ of a matrix $A$ has full rank but the controllability Gramian matrix is singular and notinvertible?

I have an implementation which is working on a matrix $$A$$. Actually I am checking it's Gramian matrix. If my understanding is correct, a linear time invariant system with adjacency matrix $$A$$, $$\dot x(t) = Ax(t) + Bu$$ is controllable if the controllability matrix

$$C = \begin{bmatrix} B & AB & A^2B & \dots & A^{n-1}B\end{bmatrix}$$

has full row rank. Then we have the controllability Gramian

$$\textit{W} = \int^{t_1}_{t_0} e^{At}BB^Te^{A^Tt} \, \mathrm d t$$

If the systme is controllable, the controllability Gramian matrix is positive definite. If controllability matrix $$C$$ does not satisfy the full row rank requirement the system is not controllable and the controllability Gramian $$W$$ is singular and not invertible.

But, I have a matirx $$A$$ which it's controllability matrix $$C$$ has full rank and shows that system is controllable but the Gramian matrix $$W$$ is singular and not invertible. What does it mean ? and what condition makes this state?

For example. suppose the adjacency matrix $$A$$ is: $$A= \begin{bmatrix} 0& 0& 1 \\ 1& 0& 1 \\ 1& 1& 0 \\ \end{bmatrix}$$ and the input matrix $$B$$ is: $$B= \begin{bmatrix} 1 \\ 0 \\ 0 \\ \end{bmatrix}$$ So the controllability matrix $$C$$: $$C= \begin{bmatrix} 1& 0& 1 \\ 0& 1& 1 \\ 0& 1& 0 \\ \end{bmatrix}$$ has full rank, but the Gramian matrix is singular. $$W= \begin{bmatrix} 1.56& 1.09& 1.09 \\ 1.09& 0.93& 0.93 \\ 1.09& 0.93& 0.93 \\ \end{bmatrix}$$

• What are the associated matrices? Because could it be that the $C$ is actually not full rank but due to numerical rounding only appears to be full rank, or the Gramian only appears to be not positive definite due to numerical rounding? Mar 17 '20 at 19:21
• @KwinvanderVeen, I have checked the controllability by other ways, like maximum matching. If you run maximum matching on the bipartite graph corresponding to the graph, the unmatched nodes are drivers to create matrix $B$. In this way there is not numerical rounding. So I am sure that the system is controllable. Mar 17 '20 at 21:24
• It shouldn't be possible. Maybe you can share the actual values of $A$ and $B$. Mar 18 '20 at 6:55
• @obareey could you clarify your comment please Mar 18 '20 at 7:17
• @KwinvanderVeen I have edited the post by associated matrices Mar 18 '20 at 7:27

The problem is that you have miscalculated the controllability matrix. We find that $$C = \pmatrix{1&0&1\\0&1&1\\0&1&1}.$$ The second and third rows are identical, so we see that $$C$$ fails to have full row rank. So, the system is not controllable, and it makes sense that the controllability Gramian that you attained was singular.
An explanation of why $$C$$ the system is not controllable in this case: note that the column-vector $$B$$ is a linear combination of the eignvectors of $$A$$ associated with eigenvalues $$\lambda_{\pm} = \frac{1 \pm \sqrt{5}}{2}$$, namely $$v_{\pm} = \left(\frac{-1 \pm \sqrt{5}}{2}, 1,1 \right).$$ We see that $$(1,0,0) = \frac 1{\sqrt{5}}(v_+ - v_-)$$.
• The adjacency matrix that you have provided is not symmetric, which is a bit strange. That said, we get the same answer in the end (the upper-right entry of $C$ changes to a $2$). Mar 18 '20 at 8:22
• I mean that we get the same answer if we replace $A$ with $$A = \pmatrix{0&1&1\\1&0&1\\1&1&0}.$$ Mar 18 '20 at 8:32
• Your controllability gramian (I assume you took $t_0 = 0, t_1 = 1$) seems to be correct Mar 18 '20 at 8:44
• @Omnomnomnom it is not just the first entry of the second column, namely the following system matrix is also always uncontrollable with the given $B$: $$A = \pmatrix{0&w&x\\1&y&1-y\\1&1-z&z}$$ Mar 19 '20 at 10:55
• @samie I found an explanation: for all of these matrices $A$, $A^T$ has $(0,-1,1)$ as an eigenvector, which means that $(0,-1,1)^\perp$ is an invariant subspace of $A$. Hence, the vector $B = (1,0,0)$ is taken from a proper invariant subspace of $A$, which means that the resulting controllability matrix does not have full rank. Mar 19 '20 at 11:53