% espde4.m
xspan=[0,3]; tspan=[0,2000];
k=237; rho=2700; c=897;mu=k/(c*rho);
f=@(t,x) 0+0*x+0*t;
u0=@(x) (500*(x>1 & x<2)+250*(x<=1|x>=2));
g=@(t,x) 250+0*t+0*x;
% deltat=0.25, h=0.01

nstep=[300,8000];
[xh,uh]=heat_be(xspan,tspan,nstep,mu,u0,g,f);

nframes=20;
tt=linspace(0,1,nframes);
figure(1); clf
Mv=moviein(nframes);
k=1;
for n=1:nframes
  plot(xh,uh(:,k),'c','Linewidth',2); grid on;
  axis([0 3 250 500]);
  Mv(:,n) = getframe;
  k=k+nstep(2)/20;
end
movie(Mv,3);
