% Problem 3.31

num=[1 9 20];
den=[1 6 11 6];
disp('System transfer function')
printsys(num,den,'s')

disp(' ')
disp('State space model')
[A,B,C,D]=tf2ss(num,den)

[V,Diag]=eig(A);
disp(' ')
disp('System''s modal form')
Am=inv(V)*A*V
Bm=inv(V)*B
Cm=C*V
D=0

% Alternative way
disp(' ')
disp('An alternative way using RESIDUE function:')
[r,p,k]=residue(num,den);
A=diag(p,0)
B=ones(3,1)
C=r'
D=0