D=600; M=300; m=50; 
K1=3000; K2=3e4; x1o=1.5; x2o=.75; g=9.8; 
A = [0 0 1 0; 0 0 0 1; 
    -K1/M   K1/M    -D/M    D/M; 
    K1/m    -(K1+K2)/m  D/m     -D/m]; 
B = [0 0 0; 0 0 0; 
     1/M    0  x1o*K1/M-g;
     -1/m   K2/m    (-x1o*K1+x2o*K2)/m-g];

C = [1 -1 0 0]; 
L = ( place(A',C',[-1 -1.1 -1.2 -1.3]) )'; 
Xo = rand(4,1); 

 
% sys = ss(A,B,[1 1 0 0; 0 1 0 0],[0 0 0; 0 0 0]); 
%
% [V,D] = eig(A); 
% [Vr,Dr] = cdf2rdf(V,D); 
%
% T = 0:0.01:5; U = [zeros(size(T)); zeros(size(T)); 
%                        ones(size(T))]; 
% Y = lsim(sys,U,T,Vr*[0.1 0.1 0 0]'); 
% plot(T,Y)
