clear all

global e

e=-0.5;

dt=0.01;


Tp=2*pi;

Nt=ceil(20*Tp/dt);t=zeros(Nt,1);x=t;y=t;

x0=[0.5;0];
xt=x0;
x(1)=xt(1);y(1)=xt(2);

for it=2:Nt;
    
    tp=t(it-1);
    k1=fdot2d(xt,tp);
    k2=fdot2d(xt+0.5*k1*dt,tp+0.5*dt);
    k3=fdot2d(xt+0.5*k2*dt,tp+0.5*dt);
    k4=fdot2d(xt+k3*dt,tp+dt);
    xt=xt+dt/6*(k1+2*k2+2*k3+k4);
    
    
    t(it)=(it-1)*dt;
   
    x(it)=xt(1);y(it)=xt(2);
end;



figure(35);hold on
plot(x,y,'k',2*sin(t),-2*cos(t),'--r','Linewidth',2)
xlabel('$x$','Interpreter','latex','Fontsize',24)
ylabel('$y$','Interpreter','latex','Fontsize',24)
%axis([-3 3 -3 3])
axis('square')
    
