To be able to apply the differential equation capabilities of Mathematica to my graduate thesis, I am trying to apply NDEigensystem to an eigenproblem whose solution I know, but I am having some trouble doing so.
As a test problem, I am using an algebraic version of the Mathieu equation,
$$(1-\zeta^{2})w^{\prime\prime}-\zeta w^{\prime}+\left(a+2q-4q\zeta^{2}\right)w=0$$
For this example I set $q=4/3$ and take only the first three eigenpairs:
m = 3; q = 4/3;
op = -(1 - ζ^2) u''[ζ] + ζ u'[ζ] + 2 q (2 ζ^2 - 1) u[ζ];
bc = DirichletCondition[u[ζ] == 0, True];
{λ, fl} = NDEigensystem[{op, bc}, u, {ζ, 0, 1}, m];
I chose the Mathieu equation as a nontrivial example as Mathematica already has a function for its evaluation:
λt = Table[MathieuCharacteristicB[2 k, q], {k, m}];
flt = Table[With[{k = k, q = q},
MathieuS[MathieuCharacteristicB[2 k, q], q, ArcCos[#]] &], {k, m}];
The problem is, I do not get the expected eigenvalues!
λ
(* {4.0708, 17.3259, 39.1877} *)
N[λt]
(* {3.85298, 16.0581, 36.0254} *)
And of course, plotting shows that the eigenequation is not satisfied at all:
With[{u = fl[[1]], b = λ[[1]]},
Plot[(1 - ζ^2) u''[ζ] - ζ u'[ζ] + (b + 2 q - 4 q ζ^2) u[ζ], {ζ, 0, 1}]]
With[{u = flt[[1]], b = λt[[1]]},
Plot[(1 - ζ^2) u''[ζ] - ζ u'[ζ] + (b + 2 q - 4 q ζ^2) u[ζ], {ζ, 0, 1}]]
What was wrong with my attempt? If I can get this example to work, I should be able to apply it to my actual, more complicated problem, so any good ideas would be welcome.