I'm trying to numerically solve the radial equation for the 3D hydrogen atom problem, i.e., to find $R(r)$ which satisfies: $$ -\frac{\hbar^2}{2m}\left[\frac{1}{r}\frac{d}{dr}\left(r^2\frac{dR(r)}{dr}\right)-\frac{l(l+1)}{r^2}R(r)\right]-\frac{1}{4\pi\epsilon_0 r}R(r)=ER(r). $$
The problem is that the NDEigensystem
gives me non-sense answers. This is my code:
- First, I set all the constants as the unity: $\hbar=m=\epsilon_0=1$ and $l=0$.
h = 1;
m = 1;
ϵ0 = 1;
Z = 1;
e = 1;
l = 0;
a0 = (4 π ϵ0 h^2)/(m e^2);
- I define the Hamiltonian:
Hcoul =
-(h^2/(2 m))*(D[R[r], {r, 2}]/2 +
1/r D[R[r], r] - (l (l + 1))/r^2 R[r]) - (Z*e^2)/(4 π ϵ0 r) R[r];
- I use the PDEigensystem routine as follows:
{vals, funs} =
NDEigensystem[
{Hcoul, DirichletCondition[R[r] == 0, True]}, R[r], {r, 0, 2000}, 10,
Method ->
{"Eigensystem" -> {"Arnoldi", "Criteria" -> "RealPart"},
"SpatialDiscretization" ->
{"FiniteElement", {"MeshOptions" -> {"MaxCellMeasure" -> 0.05}}}}];
From the above, I get the following eigenvalues:
{2.89232*10^-6, 0.0000188806, 0.0000364341, 0.0000554983,
0.0000760327, 0.0000980063, 0.000121395, 0.000146177, 0.000172338,
0.000199864}
but analytically I know that the answer is $$ E_n=-\frac{1}{32\pi^2n^2}=\left\{-0.00316629, -0.000791572, -0.00035181, -0.000197893, -0.000126651, \ -0.0000879524\right\}. $$
Moreover, when I plot the numerical wave functions, comparing with the analitycal solution:
f[r_, n_, l_] :=
Sqrt[((2 Z)/(n a0))^3*(n - l - 1)!/(2 n ((n + l)!)^3)]
Exp[-((Z r)/(n a0))] ((2 Z r)/(n a0))^l
LaguerreL[n - l - 1, 2 l + 1, (2 Z r)/(n a0)];
Show[
Plot[{f[r, 1, 0]}, {r, 0, 200},
PlotStyle -> {{Dashed, Blue}}, PlotRange -> All],
Plot[Evaluate[funs[[1]]], {r, 0, 500},
PlotRange -> All, PlotStyle -> Blue]]
I get this:
The dashed curve is the analytical solution whereas the line is numerical. Additionally, many numerical solutions are the same:
Show[Plot[Evaluate[funs], {r, 0, 500}, PlotRange -> All]]
Do you know what I'm doing wrong? Is there something that I'm not considering?