Eigenproblems

Find an eigenfunction for the finite square well eigenproblem , , , where is a square well potential of height 5.

 In[1]:= XW[x_] := If[Abs[x] < 1, 0, 5]; Plot[W[x], {x, -5, 5}, Filling -> {1 -> 0}, PlotLabel -> W, ImageSize -> Medium]
 Out[1]=

Start by plotting solutions of for .

 In[2]:= Xpfun = ParametricNDSolveValue[{-y''[x] + W[x] y[x] == \[Lambda] y[x], y[0] == 1, y'[0] == 0}, y, {x, -50, 50}, {\[Lambda]}]; Plot[Evaluate@Table[pfun[\[Lambda]][x], {\[Lambda], 0, 5, 1}], {x, -2, 2}, ImageSize -> Medium]
 Out[2]=

The true eigenfunctions satisfy . These can be approximated by finding functions with . Because the equation is symmetric in , only solutions with need to be found. Plot for .

 In[3]:= XPlot[pfun[\[Lambda]][5], {\[Lambda], 0, 13}, ImageSize -> Medium]
 Out[3]=

The root is the approximate eigenvalue.

 In[4]:= Xval = Map[FindRoot[pfun[\[Lambda]][5], {\[Lambda], #}] &, {-2}]
 Out[4]=

Plot the approximate eigenfunction together with solutions for nearby .

 In[5]:= XShow[Plot[ Evaluate@Table[pfun[\[Lambda]][x], {\[Lambda], 1, 3, .1}], {x, -6, 6}, PlotRange -> {-1, 1}, PlotStyle -> Lighter[Gray, .5]], Plot[Evaluate[pfun[\[Lambda]][x] /. val], {x, -6, 6}, PlotStyle -> Thick], ImageSize -> Medium]
 Out[5]=