contr - controllability, controllable subspace, staircase
[n,[U]]=contr(A,B,[tol]) gives the controllable form of an (A,B) pair.(dx/dt = A x + B u or x(n+1) = A x(n) +b u(n)). The n first columns of U make a basis for the controllable subspace.
If V=U(:,1:n), then V'*A*V and V'*B give the controllable part of the (A,B) pair.
The pair (Bc, Ac) is in staircase controllable form.
|B |sI-A * . . . * * |
| 1| 11 . . . |
| | A sI-A . . . |
| | 21 22 . . . |
| | . . * * |
[U'BV|sI - U'AU] = |0 | 0 . . |
| | A sI-A * |
| | p,p-1 pp |
| | |
|0 | 0 0 sI-A |
| | p+1,p+1|
Slicot library (see ab01od in SCIDIR/routines/slicot).
W=ssrand(2,3,5,list('co',3)); //cont. subspace has dim 3.
A=W("A");B=W("B");
[n,U]=contr(A,B);n
A1=U'*A*U;
spec(A1(n+1:$,n+1:$)) //uncontrollable modes
spec(A+B*rand(3,5))