0
$\begingroup$

There is the following system $H=-\frac{1}{2}\Delta-a\frac{1}{r}$, where a is a parameter. I'd like to find eigenvalues and eigenfunctions depending on the parameter. To solve a differential equation with parameters, there is ParametricNDSolveValue. Is there something similar in case of NDEigensystem?

ClearAll["Global`*"]
rmax = 20; a = 1;
HH = -(1/2)*Laplacian[u[r], {r, \[Theta], \[Phi]}, "Spherical"] - 
   a*1/r*u[r];

{vals, funs} = 
  NDEigensystem[{HH + u[r]}, u[r], {r, 0, rmax}, 50, 
   Method -> {"SpatialDiscretization" -> {"FiniteElement", \
{"MeshOptions" -> {"MaxCellMeasure" -> 0.015}}}, 
     "Eigensystem" -> {"Arnoldi", "MaxIterations" -> 10000}}];
Sort[vals] - 1
(*{-0.5, -0.125018, -0.0616851, -0.0225138, 0.0582443, 0.168841, \
0.306885, 0.471408, 0.661866, 0.877922, 1.11936, 1.38602, 1.6778, \
1.99462, 2.33642, 2.70316, 3.09479, 3.51129, 3.95264, 4.41881, \
4.9098, 5.42558, 5.96614, 6.53148, 7.12159, 7.73645, 8.37606, \
9.04042, 9.72952, 10.4434, 11.1819, 11.9452, 12.7332, 13.546, \
14.3834, 15.2456, 16.1325, 17.0441, 17.9804, 18.9414, 19.9271, \
20.9375, 21.9727, 23.0325, 24.117, 25.2263, 26.3602, 27.5188, \
28.7021, 29.9101}*)
funs[[1 ;; 5]]
$\endgroup$
3
  • 1
    $\begingroup$ All operators whose names begin with "N" are numerical operators, therefore they can not deal with parameters. But instead of "NEigensystem", use "DEigensystem that can deal with parameters." Further, why do you write "HH+u[r]" and not "HH? Where does the additional u[r] come from? $\endgroup$ Jun 30, 2023 at 14:37
  • $\begingroup$ @Daniel Huber in my case, the system is more complicated than in the question, it is not solved analytically, only numerically. But ParametricNDSolveValue is with the "N" and it deals with parameters or not? $\endgroup$
    – Mam Mam
    Jun 30, 2023 at 15:18
  • $\begingroup$ @Daniel Huber, thanks! I added a function to the equation and then subtracted from the eigenvalues to get the eigenvalues I wanted. I did it because sometimes NDEigensystem does not return the minimum eigenvalue and the corresponding eigenfunction. This issue is discussed in more detail in the answer to this question mathematica.stackexchange.com/questions/235662/… $\endgroup$
    – Mam Mam
    Jun 30, 2023 at 15:19

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.