%### n=2 ###
clear all
p.L=0.025;
p.C=0.025;
p.alpha=0.825;
p.beta=10;
p.r0=1.0;
p.n=2;
opts=odeset('RelTol',1e-3);
tskip=1000;
tend=100;

for i=1:2
  xstart=zeros(3*p.n,1);
  if i==1; p.G=0.1; end
  if i==2; p.G=0.11; end

  xstart=[-0.8,-0.3,-1.5,-0.81,-0.31,-1.51]';
  [t,x] = ode45(@mlcnRHS,[0 tskip],xstart,opts,p);
  xstart=x(end,:);
  [t,x] = ode45(@mlcnRHS,[0 tend],xstart,opts,p);
  xplot=x; tplot=t;

  FileName="mlcn2";
  if i==1; s="a"; end
  if i==2; s="b"; end

  clf
  plot(xplot(:,2),xplot(:,5),'-b')
  grid on;
  set(gcf,'PaperUnits','inch','PaperPosition',[0.25 0.25 4.5 2.5])
  text(12.0,-12.0,sprintf('y_%d',0),'FontSize',18)
  text(-12.0,12.0,sprintf('y_%d',1),'FontSize',18)
  set(gca,'XTickLabel',[]);
  set(gca,'YTickLabel',[]);
  axis([-15 15 -15 15])
  epsfilename=sprintf('%sy0y1%s.eps',FileName,s);
  print('-depsc',epsfilename);

  clf
  plot(xplot(:,1),xplot(:,2),'-b')
  grid on;
  set(gcf,'PaperUnits','inch','PaperPosition',[0.25 0.25 4.5 2.5])
  text(8.0,-12.0,sprintf('x_%d',0),'FontSize',18)
  text(-8.0,12.0,sprintf('y_%d',0),'FontSize',18)
  set(gca,'XTickLabel',[]);
  set(gca,'YTickLabel',[]);
  axis([-10 10 -15 15])
  epsfilename=sprintf('%sx0y0%s.eps',FileName,s);
  print('-depsc',epsfilename);
end
