Ello,
I would like to reproduce the analytical solution of the following eigenvalue problem, or at the least confirm them numerically (especially the eigenvalues):
$$ - \frac{1}{2} y^{\prime \prime} - 6\epsilon \operatorname{sech}^2 \Big( \sqrt{2 \epsilon} ( x-z) \Big) y + \epsilon y = \lambda y $$ where $ \epsilon$ is a parameter, $z$ an arbitrary constant and $\lambda$ the sought eigenvalue(s).
I know there are two bound states, going to $0$ as $x \to \pm \infty$, given by the eigenfunctions
$$y_0 (x) = \sqrt{3/4} (2 \epsilon)^{1/4} \operatorname{sech}^2\Big(\sqrt{2 \epsilon}(x-z) \Big) $$ with eigenvalue $$ \lambda_0 = - 3 \epsilon $$ and $$y_1(x) = \sqrt{3/2} (2 \epsilon)^{1/4} \frac{\operatorname{sinh} \Big(\sqrt{2 \epsilon}(x-z) \Big)}{\operatorname{cosh}^2\Big(\sqrt{2 \epsilon}(x-z) \Big)} $$ with eigenvalue $$\lambda_1 = 0 $$
I tried to follow the approach presented in the answer to the post How to solve a Sturm-Liouville problem with Mathematica (or, how to go from the complex to the general real solution)?, starting with
PiecewiseExpand[
DSolveValue[{-0.5*f''[x] - 6*eps*Sech[Sqrt[2*eps]*(x - z)]^2*f[x] +
eps*f[x] - v*f[x] == 0, f[-Infinity] == 0, f[Infinity] == 0},
f[x], x]]
I apppreciate how naive and optimistic the boundary condition definition is, but not getting errors I stubbornly proceeded. Nevertheless I get the error
Solve::inex: Solve was unable to solve the system with inexact coefficients or the system obtained by
direct rationalization of inexact numbers present in the system. Since many of the methods used by
Solve require exact input, providing Solve with an exact version of the system may help.
Out= DSolveValue[{eps f[x] - v f[x] -
6 eps f[x] Sech[Sqrt[2] Sqrt[eps] (x - z)]^2 -
0.5 (f^′′)[x] == 0, f[-∞] == 0,
f[∞] == 0}, f[x], x]
Do I have to abandon any hope of getting symbolic solutions? Are there any other approaches I could use? I have Mathematica 11.2. Any hint would be most appreciated, thanks.
I tried a numerical approach, setting $\epsilon =1, z = 0$, but even then I am not getting the negative eigenvalue at all
{eigN1, funcN1} =
With[{eps = 1},
N@DEigensystem[{-0.5*f''[x] -
6*eps*Sech[Sqrt[2*eps]*(x - 0)]^2*f[x] + eps*f[x],
DirichletCondition[f[x] == 0, True]}, f[x], {x, -2000, 2000},
6]];
Plot[funcN1, {x, -200, 200}, PlotLegends -> eigN1]
EDIT
I am considering the given equation to get the method working, as I know its analytical solution. The eigenvalue equation I am ultimately interested in is
$$ - \frac{1}{2} y^{\prime \prime} - \epsilon^2 \exp{\Big( \frac{\epsilon z}{2} (x^2-1)\Big)} y = \lambda y $$
EDIT FOLLOWING THE COMMENT FROM ALEXEI BOULBITCH
Thanks for pointing to your work. The "Manipulate" block makes my PC crash, but I extracted the relevant code portion below. I multiplied the whole equation by $-1$, to get the second derivative positive, I am still not so sure how to deal with the method. I tried using the analytical solution as initial condition (inverted sign with respect to the first eigenfunction I wrote down in the post above), and it seems to work (as it does not evolve much up at the beginning, for relatively short times) but then it diverges (say $t > 1000$, as it should do I think, as the eigenvalue is negative and the eigenfunction is unstable). If use one of our initial conditions, it seems to converge to a different solution (even for long times) (your Gaussian) or issues errors (your third initial condition). I am trying to thoroughly check all the signs and other typos, but I am wondering if in general your "gradient flow" type method is suitable at all to find an eigenfunction with a negative eigenvalue, as such eigenfunctions are unstable, in my understanding. Below the code using your third boundary condition. The exact eigenfunction is also written after the "solution" command.
equation[λ_] :=
D[u[x, τ], τ] ==
0.5*D[u[x, τ], {x, 2}] -
6*1*Sech[Sqrt[2*1]*(x - 0)]^2*u[x, τ] -
1*u[x, τ] + λ *u[x, τ]
solution[λ_, τm_, L_, initialCondition_] :=
NDSolve[{equation[λ], u[-L, τ] == 0, u[L, τ] == 0,
initialCondition}, u[x, τ], {x, -L, L}, {τ, 0, τm},
Method -> {"MethodOfLines",
"SpatialDiscretization" -> {"TensorProductGrid",
"MinPoints" -> 5 L}}]
u[x, 0] == -Sqrt[3/4]*(2*1)^(1/4)*Sech[Sqrt[2*1]*(x - 0)]^2;
tmax = 2;
λ = -2.99;
Plot[
Evaluate[
u[x, τ] /.
solution[λ, tmax, 10,
u[x, 0] == 0.3*10^-4 (x + 10) (10 - x)^3] /. τ ->
tmax ], {x, -10, 10}, PlotTheme -> "Classic",
PlotRange -> {{-10.2, 11}, {0, 1.}}, PlotStyle -> {Blue, Thick},
AxesLabel -> {Style[x, 16], Style[u[x, Style["t", Italic]], 16]},
TicksStyle -> Directive[12], AxesStyle -> Arrowheads[0.03],
ImageSize -> 400]