l=0.2;  %axe inter-roue


% Parametres du controleur d'orientation
alpha=1/l;
omega=1;
ksi=0.005;


ki_teta=omega*omega/alpha;
kp_teta=2*ksi*omega/alpha;
a = kp_teta/l
b = ki_teta/l

%periode d'echantillonage
T = 0.000001; 


p=[ (4+2*a*T+b*T*T)  (-2*a*T -2*b*T*T)  b*T*T];
H = hurwitz(p,2)

csq = 4 + 2*a*T + b*T*T;
c = sqrt(csq)
gamma =  b*T*T 


%p_0(s) = c^2 s^2 + 2 s c + bT^2 
%p_1(s) = (-2aT - 2bT^2 - 2c) s  

p0 = [c*c  2*c  b*T*T];
r = roots(p0)

p1 = [1 0];

% construire matrice Hurwitz pour chaque polynome

H0= [ 2*c 0; c*c gamma];
H1= [ 1 0; 0 0];

%H0 = hurwitz(p0,2)
%H1 = hurwitz(p1,1)

H0inv = inv(H0);

M =  -H0inv*H1;

lambda = eig(M)