2
$\begingroup$

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]
$\endgroup$
6
  • 1
    $\begingroup$ Publish your code for clarity. $\endgroup$ Sep 30, 2019 at 3:04
  • $\begingroup$ I added my code $\endgroup$
    – Lucas
    Sep 30, 2019 at 3:32
  • $\begingroup$ 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. $\endgroup$
    – Lucas
    Sep 30, 2019 at 4:19
  • $\begingroup$ 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 $\endgroup$
    – Lucas
    Sep 30, 2019 at 4:52
  • $\begingroup$ Yes, but it will assume that you want $y(-5)=0$ and $y(5)=0$, not periodicity. $\endgroup$
    – SPPearce
    Sep 30, 2019 at 5:30

2 Answers 2

3
$\begingroup$

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.

$\endgroup$
2
$\begingroup$

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}]}

Figure 1

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.