1
.TH canon 1 "April 1993" "Scilab Group" "Scilab Function"
4
canon - canonical controllable form
7
[Ac,Bc,U,ind]=canon(A,B)
15
: current basis (square nonsingular matrix)
18
: vector of integers, controllability indices
20
gives the canonical controllable form of the pair \fV(A,B)\fR.
22
\fVAc=inv(U)*A*U, Bc=inv(U)*B\fR
24
The vector \fVind\fR is made of the \fVepsilon_i\fR's indices
25
of the pencil \fV[sI - A , B]\fR (decreasing order).
26
For example with \fVind=[3,2]\fR, \fVAc\fR and \fVBc\fR are as follows:
30
Ac= [0,1,0,0,0] Bc=[0]
34
If \fV(A,B)\fR is controllable, by an appropriate choice
35
of \fVF\fR the \fV*\fR entries of \fVAc+Bc*F\fR
36
can be arbitrarily set to desired values (pole placement).
49
X=rand(5,5);A=X*A*inv(X);B=X*B; //Controllable pair
50
[Ac,Bc,U,ind]=canon(A,B); //Two indices --> ind=[3.2];
51
index=1;for k=1:size(ind,'*')-1,index=[index,1+sum(ind(1:k))];end
52
Acstar=Ac(index,:);Bcstar=Bc(index,:);
54
p1=s^3+2*s^2-5*s+3;p2=(s-5)*(s-3);
55
//p1 and p2 are desired closed-loop polynomials with degrees 3,2
56
c1=coeff(p1);c1=c1($-1:-1:1);c2=coeff(p2);c2=c2($-1:-1:1);
57
Acstardesired=[-c1,0,0;0,0,0,-c2];
58
//Acstardesired(index,:) is companion matrix with char. pol=p1*p2
59
F=Bcstar\\(Acstardesired-Acstar); //Feedbak gain
60
Ac+Bc*F // Companion form
61
spec(A+B*F/U) // F/U is the gain matrix in original basis.
64
obsv_mat, cont_mat, ctr_gram, contrss, ppol, contr, stabil