
help heat1

display('hit any key for more')
pause

t_0 = 0;
t_f = 1;
N = 128;
M = 100;

[u1,err,x,t1] = heat1(t_0,t_f,M,N);
figure(1)
for j=0:20
     plot(x,u1(:,j+1),'.-')
     title(t1(j+1),'FontSize',16)
     xlabel('Explicit Euler','FontSize',16)
     pause(1)
end

figure(2)
plot(t1,log10(max(abs(u1))))
title('log10(maximum of u) versus time','FontSize',16)
xlabel('notice that things start to grow exponentially shortly before time 0.2')

display('hit any key for more')
pause


M = 1000;
[u2,err,x,t2] = heat1(t_0,t_f,M,N);
figure(2)
for j=0:20
     plot(x,u2(:,10*j+1),'.-')
     axis([0,2*pi,-1.1,1.1])
     xlabel('Explicit Euler','FontSize',16)
     title(t2(10*j+1),'FontSize',16)
     pause(1)
end

display('hit any key for more')
pause


help heat3

display('hit any key for more')
pause


M = 100;
[u3,err,x,t1] = heat3(t_0,t_f,M,N);
figure(1)
for j=0:20
     plot(x,u3(:,j+1),'.-')
     axis([0,2*pi,-1.1,1.1])
     xlabel('fully implicit','FontSize',16)
     title(t1(j+1),'FontSize',16)
     pause(1)
end

display('hit any key for more')
pause

help heat_cn

display('hit any key for more')
pause

[u4,err,x,t1] = heat_cn(t_0,t_f,M,N);
figure(1)
for j=0:20
     plot(x,u4(:,j+1),'.-')
     axis([0,2*pi,-1.1,1.1])
     xlabel('Crank-Nicolson','FontSize',16)
     title(t1(j+1),'FontSize',16)
     pause(1)
end

whos
