% How to use this algorithm?

%   1.
%   Initial values
%           A: truncated upper bound on x of the grid
%           T: maturity date
%           M: the number of subintervals of time
%           N: the number of subintervals of x movements
%           sigma: the volatility of the underlying stock
%           r: risk-free rate
%           hx: vector of initial conditions

A = 100;
T = 1;
M = 250;
N = 250;
sigma = 0.15;

dx = 2 * A / N;
dt = T / M;

% Initial conditions
h = @(x) sin(x);
hx = zeros(N+1,1);
for i = 1:(N+1)
    x(i) = -A + i * dx;
    hx(i) = sin(x(i));
end
