
function demo_errore_In
% Demo di "calcola_In" che la valuta "In" per n=1,2,...,20.

% calcolo Ik
for k=1:20
    S(k)=calcola_In(k);
    fprintf('\n \t k: %2.0f S(k): %1.15e',k,S(k));
end

% soluzione
sol=2.553074606441994e-01;

% errore assoluto
err=abs(S-sol);

% ultimo erroe compiuto
fprintf('\n \n \t err(end): %1.5e \n',err(end));

% grafico errore
semilogy(1:20,err);

%--------------------------------------
%
%    RISULTATI:
%
%    sol: ?2.553074606441994e-01
%
%  	 k:  1 S(k): 2.552083333333333e-01
%  	 k:  2 S(k): 2.553059895833333e-01
%  	 k:  3 S(k): 2.553074428013393e-01
%  	 k:  4 S(k): 2.553074604619748e-01
%  	 k:  5 S(k): 2.553074606425949e-01
%  	 k:  6 S(k): 2.553074606441869e-01
%  	 k:  7 S(k): 2.553074606441992e-01
%  	 k:  8 S(k): 2.553074606441993e-01
%  	 k:  9 S(k): 2.553074606441993e-01
%  	 k: 10 S(k): 2.553074606441993e-01
%  	 k: 11 S(k): 2.553074606441993e-01
%  	 k: 12 S(k): 2.553074606441993e-01
%  	 k: 13 S(k): 2.553074606441993e-01
%  	 k: 14 S(k): 2.553074606441993e-01
%  	 k: 15 S(k): 2.553074606441993e-01
%  	 k: 16 S(k): 2.553074606441993e-01
%  	 k: 17 S(k): 2.553074606441993e-01
%  	 k: 18 S(k): 2.553074606441993e-01
%  	 k: 19 S(k): 2.553074606441993e-01
%  	 k: 20 S(k): 2.553074606441993e-01
%  
%  	 err(end): 5.55112e-17 
%
%--------------------------------------