% Usage: err = schrodinger_fd_err(Ns, V, m)
%
% Return the absolute error in the m-th eigenvalue of the Schrodinger 
% operator for the potential V(x), using a finite-difference scheme
% with Ns points.  If Ns is an array, return an array of errors.

function err = schrodinger_fd_err(Ns, V, m)
  for i = 1:length(Ns)
    E1 = schrodinger_fd(Ns(i), V, m);
    E2 = schrodinger_fd(2*Ns(i), V, m);
    err(i) = abs(E1(m) - E2(m));
    disp(sprintf('done %d/%d\n', i, length(Ns)));
  end
