1.7 How to check that state space system \(x'=Ax+Bu\) is controllable?

A system described by \begin {align*} x' &= Ax+Bu \\ y &= Cx+Du \end {align*}

Is controllable if for any initial state \(x_0\) and any final state \(x_f\) there exist an input \(u\) which moves the system from \(x_0\) to \(x_f\) in finite time. Only the matrix \(A\) and \(B\) are needed to decide on controllability. If the rank of \[ [B \> AB\> A^2B\> \ldots \> A^{n-1}B] \] is \(n\) which is the number of states, then the system is controllable. Given the matrix \[ A=\left ( {\begin {array}{cccc} 0&1&0&0\\ 0&0&-1&0\\ 0&0&0&1\\ 0&0&5&0 \end {array}} \right ) \] And \[ B=\left ( {\begin {array}{c} 0\\ 1\\ 0\\ -2 \end {array}} \right ) \]

Mathematica

A0 = {{0, 1, 0, 0}, 
      {0, 0, -1, 0}, 
      {0, 0, 0, 1}, 
      {0, 0, 5, 0}}; 
B0 = {{0}, {1}, {0}, {-2}}; 
sys = StateSpaceModel[{A0, B0}]; 
m = ControllabilityMatrix[sys]
 

\[ \left ( {\begin {array}{cccc} 0 & 1 & 0 & 2 \\ 1 & 0 & 2 & 0 \\ 0 & -2 & 0 & -10 \\ -2 & 0 & -10 & 0 \\ \end {array}} \right ) \]

ControllableModelQ[sys]
 

True

MatrixRank[m]
 

4

 

Matlab

A0 = [0 1 0 0; 
      0 0 -1 0; 
      0 0 0 1; 
      0 0 5 0]; 
B0 = [0 1 0 -2]'; 
sys = ss(A0,B0,[],[]); 
m   = ctrb(sys)
 

m = 
     0     1     0     2 
     1     0     2     0 
     0    -2     0   -10 
    -2     0   -10     0
 

rank(m)
 

4

 

Maple

restart: 
alias(DS=DynamicSystems): 
A:=Matrix( [ [0,1,0,0], 
             [0,0,-1,0], 
             [0,0,0,1], 
             [0,0,5,0] 
           ] 
          ); 
B:=Matrix([[0],[1],[0],[-2]]); 
sys:=DS:-StateSpace(A,B); 
m:=DS:-ControllabilityMatrix(sys);
 

\[ \left [ {\begin {array}{cccc} 0&1&0&2\\ \noalign {\medskip }1&0&2&0 \\ \noalign {\medskip }0&-2&0&-10\\ \noalign {\medskip }-2&0&-10&0 \end {array}} \right ] \]

DS:-Controllable(sys,method=rank);
 

true

DS:-Controllable(sys,method=staircase);
 

true

LinearAlgebra:-Rank(m);
 

4