clc
close all
clear all

x_min = 0   ;
x_max = 1   ;
dx    = 0.01;
x = [x_min:dx:x_max]' ;

t_end = 5   ;
dt    = 0.01;
t     = 0   ;
c = 1;
 
U = exp(-(x-0.5).^2 / 0.02);
%U_prev = ... ;


it = 0;

while t < t_end
    
    U = question1(U,dx,dt,c);
%    U = question2(U,dx,dt,c);    
%    U = question3(U,dx,dt,c);      

%     U_new = question4(U,U_prev,dx,dt,c) ;
%     U_prev = U;
%     U = U_new;
     
   t=t+dt;
   it = it +1;
   if mod(it,1) == 0 
      plot(x,U);
      title(['Result at t=',num2str(t)])
      axis([0 1 -0.1 1.1])
      pause(0.2)

   end

end
    
