set(0,                           ...
   'defaultaxesfontsize', 20,   ...
   'defaultaxeslinewidth', 1.2, ...
   'defaultlinelinewidth', 2.0, ...
   'defaultpatchlinewidth', 0.7); 

clear all
a0 =sqrt(3);

klist = [a0/9,a0/18,a0/27];
v = [1:10000]/10000;
for j = 1:3
    a = klist(j);
 sig= v./((a^2+v.^2).* (1-v));
 
 figure(1)
 plot(sig,v,'linewidth',2)
 hold on
 axis([0 10 0 1])
 xlabel('\sigma','fontsize',20)
 ylabel('v','fontsize',20)
end
text(7.5,0.15,'\kappa=\surd{3}/27','fontsize',20)
text(1.7,0.4,'\kappa=\surd{3}/9','fontsize',20)

text(3.5,0.1,'\kappa=\surd{3}/18','fontsize',20)

 hold off
 
 ks =[0:.001:0.25]';
 N = length(ks);
 s = [0:.01:30];
 k = ks.^2;
 R=4*k.*(k+1).^2*s.^3+(12*k.^2-20*k)*s.^2+12*k*s-ones(N,1)*s+4;
 
 figure(3)
 contour(s,ks,R,[0 0],'linewidth',2)
 hold on
 plot(27/8,sqrt(3)/9,'*','linewidth',2)
 %plot(s,1./(2*s),'--')
 axis([0 30 0 0.25])
  xlabel('\sigma','fontsize',22)
 ylabel('\kappa','fontsize',22)
 text(5,0.04,'bistable','fontsize',20)
 text(10,0.1,'monostable','fontsize',20)
 text(2.5,0.205,'(27/8,\surd{3}/9)','fontsize',20)
 hold off
 
 sglist = [27/8,30/8,4,5];
 for j = 1:4
     sg = sglist(j)
  
 k=v./(sg*(1-v))-v.^2;
  
 figure(4)
 plot(sqrt(k),v ,'linewidth',2)
 hold on
 end
 
  axis([0 0.4 0 1])
  xlabel('\kappa','fontsize',20)
  ylabel('v','fontsize',20)
  text(0.2,0.25,'\sigma=27/8','fontsize',20)
text(0.13,0.48,'\sigma=15/4','fontsize',20)
text(0.03,0.5,'\sigma=4','fontsize',20)

text(0.01,0.32,'\sigma=5','fontsize',20)
  
  hold off
 