Infinite Potential Well - Perturbed

An infinite square well is perturbed by a rectangular “bump” at the center of the well. Energy eigenfunctions are found by varying the energy until the wave function equals zero at the right side of the well. The resulting energies may be compared with the corresponding values for the unperturbed well (shown as dashed lines).

Manipulate[
Module[{e0,s},
e0=Pi^2/16;
s=NDSolve[{y''[x]+e0*(e-v[x,h,w])y[x]==0,y'[-2]==e+3,y[-2]==0},y,{x,-2,2}];
Plot[{2*Evaluate[y[x]/.s],1.5*v[x,h,w],1.5*e,1.5,6,13.5,24},{x,-2,2},PlotRange->{{-2.05,2.05},{-15,32}},
Filling->{2->{Axis,LightGray}},PlotStyle->{{Blue,Thick},LightGray,{Red,Thick},{Red,Dashed},{Red,Dashed},{Red,Dashed},{Red,Dashed}},
Ticks->{None},
Axes->{True,False},
AxesStyle->Thick,
Epilog->{{Thick,Arrow[{{-2,0},{-2,32}}]},{Thick,Arrow[{{2,0},{2,32}}]}},ImageSize->{500,300}]],
{{e,4,"energy"},.1,20,Appearance->"Labeled"},
Delimiter,
{{h,10,"bump height"},0,20,Appearance->"Labeled"},
{{w,1,"bump width"},.4,2,Appearance->"Labeled"},
SynchronousUpdating->False,
Initialization:>(
v[x_,h_,w_]:=Piecewise[{{0,x<-w/2},{0,x>w/2}},h];
)
]