%Script for test calculations using efd to calculate call values.
%Initial and boundary values provided by u0(*), uL(*) and uh(*).
%xL and xH are converted from sL and sH.
[junk,x]=hf(0,[sL,sH],0,0);	% Convert [sL,sH] to xL, xH.
xL=x(1);
xH=x(2);
% Run explicit method
efd
% Compute true values: BSCall and convert to heat variables
[junk,s]=fh(0,x,0,0);
true=hf(BSCall(s,T,K),s,0,T); 
% Display results
plot(x,true,'r')
hold on
plot(x,u,'*')
% Print summary
title('Explict Finite Difference Results (in heat variables)')
hold off
fprintf('\n[xL,xH]=[%g , %g]\n',xL,xH)
fprintf('dx=%g, using N+1=%g x-intervals.\n',dx,N+1)
fprintf('T=%g, dt=%g, using M=%g time steps.\n',T,dt,M)
fprintf('alpha=%g\n',alpha)
fprintf('Minimal M for stability=%g\n',ceil(2*T/(dx^2)))
fprintf('Maximum error=%g\n\r',max(abs(u-true)))