# Finding eigenvectors of a differential operator

How can I find the eigenvalues and eigenvectors(numerically) of the below matrix equation:

$$\qquad \hat{A}\left({\begin{array}{c} y_1(x,\theta)\\ y_2(x,\theta) \\ \end{array} } \right)= a\left({\begin{array}{c} y_1(x,\theta)\\ y_2(x,\theta) \\ \end{array} } \right)$$

Where $$\hat{A}$$ is a differential operator that can be represented as 2X2 matrix, with second derivatives with respect to $$x$$ and $$\theta$$.

I wish to find the functions $$y_1$$ and $$y_2$$, and the eigenvalues $$a$$ numerically with Mathematica. I tried using NDEigensystem but to no success.

If needed I can also specify the operator $$\hat{A}$$ in matrix form.

### Edit

Here is my attempted code:

f1[x_, θ_] := x^2 + Cos[θ]
f2[x_, θ_] := x^2 + x + Cos[θ]
eqns =
{-D[D[y1[x, θ], x], x] - D[D[y1[x, θ], θ], θ] + f1[x, θ]*y1[x, θ] + x*y2[x, θ],
-D[D[y2[x, θ], x], x] - D[D[y2[x, θ], θ], θ] + f2[x, θ]*y2[x, θ] + x*y1[x, θ]}

NDEigensystem[eqns, {y1, y2}, {{x, -5, 5}, {θ, 0, 2 Pi}}, 4]

• Publish your code for clarity. Sep 30, 2019 at 3:04
• I added my code Sep 30, 2019 at 3:32
• For a differential equation. I thought that I would need BC if I used methods like NDSolve, but when using NDEigensystem for some differential operators I usually did not specify them, so I didn't think that I to specify them. However, the boundary conditions are going to be periodicity in $\theta$ in $2Pi$, that the functions y1 and y2 are going to be even or odd functions, and that at x=0 we can take y1 to be y2 =1. Sep 30, 2019 at 4:19
• For example, if I want to find energy eigenvalues/eigenvectors of a quartic potential, simply writing: NDEigensystem[-y''[x]/2 + y[x]*x^4, y, {x, -5, 5}, 4] will find the eigenvalues/eigenvectors without specifying the BC Sep 30, 2019 at 4:52
• Yes, but it will assume that you want $y(-5)=0$ and $y(5)=0$, not periodicity. Sep 30, 2019 at 5:30

This is a simple typo. Use:

NDEigensystem[eqns, {y1, y2}, {x, -5, 5}, {θ, 0, 2 Pi}, 4]
(* {{-0.0329282, 0.526089, 0.940386, 1.4994},... *)


not the {{x, -5, 5}, {θ, 0, 2 Pi}} you have.

Homogeneous boundary conditions are used here.

f1[x_, θ_] := x^2 + Cos[θ]
f2[x_, θ_] := x^2 + x + Cos[θ]
eqns = {-D[D[y1[x, θ], x], x] -
D[D[y1[x, θ], θ], θ] +
f1[x, θ]*y1[x, θ] +
x*y2[x, θ], -D[D[y2[x, θ], x], x] -
D[D[y2[x, θ], θ], θ] +
f2[x, θ]*y2[x, θ] + x*y1[x, θ]};

{vals, funs} =
NDEigensystem[{eqns,
DirichletCondition[{y1[x, θ] == 0, y2[x, θ] == 0},
x == -5 || x == 5],
DirichletCondition[{y1[x, θ] == 0,
y2[x, θ] == 0}, θ == 0 || θ == 2 Pi]}, {y1,
y2}, {x, -5, 5}, {θ, 0, 2 Pi}, 4];

{Table[Plot3D[
funs[[i, 1]][x, θ], {x, -5, 5}, {θ, 0, 2 Pi},
Mesh -> None, ColorFunction -> Hue, PlotRange -> All,
PlotLabel -> vals[[i]]], {i, 4}],
Table[Plot3D[
funs[[i, 2]][x, θ], {x, -5, 5}, {θ, 0, 2 Pi},
Mesh -> None, ColorFunction -> Hue, PlotRange -> All,
PlotLabel -> vals[[i]]], {i, 4}]}