
function demo_calore(theta,sigma)

if nargin < 2,sigma=1;end

mV=[2 4 8 16]; tfin=5;       % SETTINGS.

% ESEMPIO.
G=@(x,t) (-0.1+pi^2)*(exp((-0.1)*t).*sin(pi*x));
d0=@(t) zeros(size(t));
d1=@(t) exp((-0.1)*t).*sin(pi);
f=@(x) sin(pi*x);
solution=@(x,t) exp((-0.1)*t).*sin(pi*x);

fprintf('\n \t [THETA]:%3.3f [TFIN]:%3.3f [SIGMA]:%1.1e',theta,tfin,sigma);

err_hist=[];
for k=1:length(mV)
    m=mV(k); % ANALISI SUDD. m PUNTI SPAZIALI.
    [V_hist,x_mid,t_mid,hx,ht]=metodolinee(theta,tfin,m,f,d0,d1,G,sigma);
    U=feval(solution,x_mid,t_mid(end));    
    err=norm(U'-V_hist(end,:),inf); % ERRORE METODO.
    err_hist=[err_hist;err]; 
    fprintf('\n \t [m]: %3.0f [ERROR]: %2.2e [hx]: %2.2e [ht]: %2.2e',...
        m,err,hx,ht);
end
fprintf('\n \n');