% STANDARD APPROACH 
clear all
[t,x] = ode45(@memoscRHS,[0 200],[0.006,0.02,-0.3,0,0]',odeset('MaxStep',1e-1),memoscparam(1));
xplot=x; tplot=t;
clf
plot(tplot(:,1),xplot(:,4),'-b',tplot(:,1),xplot(:,5),'-r')

clear all
[t,x] = ode45(@memoscRHS,[0 200],[0.006,0.02,-0.3,0,0]',odeset('MaxStep',1e-2),memoscparam(1));
xplot=x; tplot=t;
clf
plot(tplot(:,1),xplot(:,4),'-b',tplot(:,1),xplot(:,5),'-r')

clear all
[t,x] = ode45(@memoscRHS,[0 200],[0.006,0.02,-0.3,0,0]',odeset('MaxStep',1e-3),memoscparam(1));
xplot=x; tplot=t;
clf
plot(tplot(:,1),xplot(:,4),'-b',tplot(:,1),xplot(:,5),'-r')

clear all
[t,x] = ode45(@memoscRHS,[0 200],[0.006,0.02,-0.3,0,0]',odeset('MaxStep',1e-4),memoscparam(1));
xplot=x; tplot=t;
clf
plot(tplot(:,1),xplot(:,4),'-b',tplot(:,1),xplot(:,5),'-r')

clear all
[t,x] = ode45(@memoscRHS,[0 200],[0.006,0.02,-0.3,0,0]',odeset('MaxStep',1e-5),memoscparam(1));
xplot=x; tplot=t;
clf
plot(tplot(:,1),xplot(:,4),'-b',tplot(:,1),xplot(:,5),'-r')

clear all
[t,x] = ode45(@memoscRHS,[0 200],[0.006,0.02,-0.3,0,0]',odeset('MaxStep',5e-6),memoscparam(1));
xplot=x; tplot=t;
clf
plot(tplot(:,1),xplot(:,4),'-b',tplot(:,1),xplot(:,5),'-r')

% POINCARE MAP APPROACH
clear all; 
[tplot,xplot]=memoscIntegrate(memoscparam(1),[0.006,0.02,-0.3,0,0]',odeset('MaxStep',1e-0,'Events',@memoscEvents),200);
clf
plot(tplot(:,1),xplot(:,4),'-b',tplot(:,1),xplot(:,5),'-r')

clear all; 
[tplot,xplot]=memoscIntegrate(memoscparam(1),[0.006,0.02,-0.3,0,0]',odeset('MaxStep',1e-1,'Events',@memoscEvents),200);
clf
plot(tplot(:,1),xplot(:,4),'-b',tplot(:,1),xplot(:,5),'-r')

clear all; 
[tplot,xplot]=memoscIntegrate(memoscparam(1),[0.006,0.02,-0.3,0,0]',odeset('MaxStep',1e-2,'Events',@memoscEvents),200);
clf
plot(tplot(:,1),xplot(:,4),'-b',tplot(:,1),xplot(:,5),'-r')

clear all; 
[tplot,xplot]=memoscIntegrate(memoscparam(1),[0.006,0.02,-0.3,0,0]',odeset('MaxStep',1e-3,'Events',@memoscEvents),200);
clf
plot(tplot(:,1),xplot(:,4),'-b',tplot(:,1),xplot(:,5),'-r')
