L = 2
V[x_] =
Piecewise[{
{Infinity, x <= -L},
{0, -L < x < L},
{Infinity, x >= L}
}];
{vals, funs} =
NDEigensystem[
{-Laplacian[u[x], {x}] + V[x]*u[x],
DirichletCondition[u[x] == 0, True]},
u[x], {x, -2, 2}, 10,
Method -> {"SpatialDiscretization" -> {"FiniteElement", {"MeshOptions" -> {MaxCellMeasure -> 0.01}}}}
]
Where have I made a mistake?