I'm solving a quantum mechanical problem, and the quantization condition requires me to solve the equation $$ U\left(\frac12(\ell+1-E), \ell+1, r^2\right) = 0, $$ where $U(a,b,z)$ is the confluent hypergeometric function of the second kind, $r>0$ is a fixed positive real number, and $\ell\geq0$ is a fixed non-negative integer; I am looking for the sequence $E_1,E_2,E_3,\ldots$ of zeros on the energy parameter $E$, as a function of the other two parameters $r$ and $\ell$.
The best I've found so far is to use the asymptotics of the zeros, DLMF (13.9.16), as the starting point in Mathematica's FindRoot
function:
Block[{ℓ = 0, a},
(*a=1/2 (1-e+ℓ);*)
ListLinePlot[
Table[
Chop[
Table[
{r, (ℓ + 1 - 2 a)} /. FindRoot[
HypergeometricU[a, 1 + ℓ, r^2]/Gamma[1 - a] == 0
, {a, -n - 2/π r Sqrt[n] - (2 r^2)/π^2 + (ℓ + 1)/2 + 1/4}
]
, {r, 0.01, 8, 0.2}]
]
, {n, 1, 10}]
, ImageSize -> 700
, Frame -> True
, GridLines -> All
, FrameLabel -> {"Radius of inner boundary", "Energy eigenvalue"}
] /. {Line[pts_] -> {PointSize[0.01], Line[pts], Point[pts]}}
]
Here $a= (\ell+1-E)/2$ for convenience, generally negative, and I've added a factor of $1/\Gamma(1-a)$ to counteract the exponential growth of $U$ as a function of $E$. This works quite well for middling parameters:
These are the various zeros (i.e. different $E_n$'s as different lines) for $\ell=0$ as a function of $r$ between $0$ and $8$.
However, if I use nonzero $\ell$s (for low $r$'s) or I expand to a bigger box in $r$, this method starts bugging out:
This brings me to my question: Are there good standard methods for solving this root-finding problem? How can I stabilize it in the cases where it's bugging out?
If those solutions are already implemented in Mathematica, then all the better!
HypergeometricU[-e,1,r^2]/(Gamma[1+e]Exp[r^2/2])
, the function $U$ itself appears to be computed incorrectly for $r=10,e>75$, so I think this failure is not due to the guess but due toHypergeometricU
. $\endgroup$