
clear all
%determines the stability of the limit cycle of the dan der Pol with
%parameter e<<1

Nt=100;
e=0.1;

tt=linspace(0,2*pi,Nt);

dt=tt(2)-tt(1);

Phi=eye(2);

%A=[0, 1;-1-2*e*x*y,-e*(x^2-1)]; 

for it=1:Nt-1

    xp=2*cos(tt(it));
    yp=-2*sin(tt(it));
   
    A=[0, 1;-1-2*e*xp*yp,-e*(xp^2-1)]; 
    Phi=expm(A*dt)*Phi;

end

D=exp(-2*pi*e);
%[det(Phi),D]

Phi

S=abs(eig(Phi))

lambda=log(max(S))/(2*pi)








