% traveling wave profile for Fisher's equation
function fisher_plot
global c

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

u = [-0.2:.01:1];
cval = [0.5,2.0, 3.0];
t_end = 50;
tstep = 0.1;

%specify the output points
tspan = [0:tstep:t_end];

 u0 = [0.999,-0.001];
for j = 1:3
    c = cval(j);
[T,S] = ode23(@deRHS,tspan, u0, odeset('maxstep',1));  
if (j<3)
figure(1) 

plot(S(:,1),S(:,2),'linewidth',2)
xlabel('U','fontsize',20)
ylabel('W','fontsize',20)
annotation('textarrow',[0.45,0.37 ],[0.16,0.23 ],'linewidth',2)
hold on

plot([-.4,1],[0,0])
text(0.48,-0.2,'c = 2','fontsize',20);
text(0.44,-.1,'c = 0.5','fontsize',20)
axis([-.4 1 -.25 .25])
set(gca, 'XTick', -.4:0.2:1 );
 
 
end

figure(2)
plot(T-t_end/2,S(:,1),'linewidth',2)
xlabel('\zeta','fontsize',20)
ylabel('U_c(\zeta)','fontsize',20)
axis([-t_end/2 t_end/2 -0.4 1])
hold on
end

figure(1)
plot(u,-u.*(1-u),'--','linewidth',2)
hold off


figure(2)
plot(T-t_end/2,zeros(length(T),1))
text(-3.8,0.7,'c = 3','fontsize',20);
text(-3.8,0.1,'c = 2','fontsize',20)
text(-13,-0.15,'c = 0.5','fontsize',20)
set(gca, 'XTick',-25:5:25 );

hold off
 

%the right hand side for ode simulation:
function s_prime=deRHS(t,s)
global  c
 u = s(1);
 g = s(2);
 Fu = g/c;
 Fg = -c*(g+u.*(1-u));
 
s_prime = [Fu;Fg];

