
% take:
% u=0.001*uni
% fu = u.*(1-u);

global dx dxx D oos allt allx allu;
N=50;dt=0.0002;tf=10;L=0;R=pi-2;snaps=50;disp=50;D=1;
PDE_integrator(N,dt,tf,L,R,disp,snaps)

M=max(allu,[],2);
lambda=1-D*(pi/(R-L))^2
figure(10)
clf
subplot(3,1,1)
set(gca,'FontSize',16)
plot(allt,log(M),'o-',allt,log(M(1)*exp(lambda*allt)),'r');
ylabel('log(max(u(x,t)))');
title('L<L_c');
axis tight
legend('data','theory')

pause

N=50;dt=0.002;tf=40;L=0;R=pi+1;snaps=50;disp=50;D=1;
PDE_integrator(N,dt,tf,L,R,disp,snaps)

M=max(allu,[],2);
lambda=1-D*(pi/(R-L))^2
figure(10)
subplot(3,1,2)
set(gca,'FontSize',16)
plot(allt,log(M),'o-',allt,log(M(1)*exp(lambda*allt)),'r');
ylabel('log(max(u(x,t)))');
title('L>L_c');
axis tight
legend('data','theory',2)

pause

N=50;dt=0.002;tf=20;L=0;R=pi+20;snaps=50;disp=50;D=1;
PDE_integrator(N,dt,tf,L,R,disp,snaps)

M=max(allu,[],2);
lambda=1-D*(pi/(R-L))^2
figure(10)
subplot(3,1,3)
set(gca,'FontSize',16)
plot(allt,log(M),'o-',allt,log(M(1)*exp(lambda*allt)),'r');
xlabel('t'); ylabel('log(max(u(x,t)))');
title('L>>L_c');
axis tight
legend('data','theory',2)
