blob: 66458ac0fc603033200536e180b4df208b9fec5a (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
|
//OCF form
s=%s
A=[1 2 1;0 1 3;1 1 1]
B=[1;0;1]
[row,col]=size(A)
c=s*eye(row,col)-A
x=det(c)
r=coeff(x)
M=[r(1,2) r(1,3) 1;r(1,3) 1 0;1 0 0]
S=[B A*B A^2*B]
disp(S,"controllability matrix=")
if (det(S)==0) then
printf("system cannot be transformed into ccf form")
else
printf("system can be transformed into ccf form")
end
P=S*M
disp(P,"P=")
Accf=inv(P)*A*P
Bccf=inv(P)*B
disp(Accf,"Accf=")
disp(Bccf,"Bccf=")
|