I'm looking to verify the output of a call to NDEigensystem
. I'm doing this by plotting the operator acting on the Interpolating Function outputs versus the eigenvalue times the interpolating eigenfunctions. Something is going wrong, as it seems to me that by the properties of eigenvalues and eigenvectors, the plots should line up.
Here's my code:
ClearAll
b:= 1
c:= 1
h[x_] := -b x + c Cos[2x] / 2
Lh[l_, x_] := (D[l[z],z,z] -(1/4)(D[h[z],z])^2l[z]) /. z :> x
{vals, funs} = NDEigensystem[{-Lh[l,x], l[0] == l[Pi]}, l[x], {x, 0, Pi}, 5]
For[i=1, i<6, i++, f[x_] := funs[[i]]; v := vals[[i]];
P1 = Plot[-Lh[f,x], {x,0, Pi}, PlotStyle -> Red ];
P2 = Plot[v f[x], {x,0,Pi}, Axes->False];
Print[Overlay[{P1, P2}]]]
And my ouput is:
For $L$ a differential operator on $L^2(S^1)$ with eigenfunction $u$ and eigenvector $\lambda$, we should have $Lu(x) = \lambda u(x)\, \forall x \in S^1$. However, according to the plots, this seems to not be the case.
Where is my error? Thanks!