Consider the one-dimensional Schrodinger equation
$$-\frac{1}{2}D^2 \psi(x)+V(x)\psi(x)=E\psi(x)$$
where $D^2=\dfrac{d^2}{dx^2},V(x)=-\dfrac{1}{|x|}$.
I want to calculate the ground state energy(which is known to be $-0.5$) with finite difference method.
Suppose $\psi(-a)=\psi(a)=0$ for sufficiently large $a$.
Split $[-a,a]$ into $N$ sub-intervals with equal length $h$: $$-a=x_1<x_2<\cdots<x_{N+1}=a$$ $x_{i+1}-x_i=h.$
Now use
$$D^2\psi(x_n)\to\frac{\psi(x_{n-1})-2\psi(x_{n})+\psi(x_{n+1})}{2h^2}$$
and
$$-\frac{1}{2}D^2 \psi(x_n)+V(x_n)\psi(x_n)=E\psi(x_n)$$
we get
$$-y_{n-1}+2(1+V_n h^2)y_n-y_{n+1}=2h^2 Ey_n$$
where $y_n=\psi(x_n)$.
Recall that $y_1=y_{N+1}=0$, we get
$$H \begin{pmatrix} y_2 \\ \vdots \\ y_N \end{pmatrix} = 2h^2E \begin{pmatrix} y_2 \\ \vdots \\ y_N \end{pmatrix} $$
where
$$H=\begin{pmatrix} 2(1+V_2h^2) & -1 & & \\ -1 & 2(1+V_3h^2) & \ddots & \\ & \ddots & \ddots & -1 \\ & & -1 & 2(1+V_Nh^2) \end{pmatrix}$$
is a $N-1$ tridiagonal matrix.
If the least eigenvalue of $H$ is $\lambda$, then I expect $\dfrac{\lambda}{2h^2}$ to approximate the ground state energy $E$.
So I write a MATLAB program:
function m = onedimen1(a,M)
N = 2*M+1;
h = 2*a/N;
t = -a;
for i = 1 : N-2
t = t+h;
H(i,i) = 2*(1+vp(t)*h*h);
H(i+1,i) = -1;
H(i,i+1) = -1;
end
H(N-1,N-1) = 2*(1+vp(t+h)*h*h);
m1=eig(H)/(2*h*h);
m = m1(1:5);
function y = vp(x)
y = - 1/(abs(x)) ;
end
end
but when I try
onedimen1(10,100)
onedimen1(10,1000)
the least eigenvalue of $H$ divided by $2h^2$ appears to be too small(and tends to negative infinity when $N$ increases), but the second largest divided by $2h^2$ is always near $-0.5$.
Can anyone explain why?
(P.S. If I change $V(x)$ to $V(x)=\dfrac{1}{|x|}$ then the least eigenvalue of $H$ is stable)