I am trying to calculate eigensystems for a matrix Ap
, which I have provided an example of which in this thread. The matrix in general has a dependency on a variable a
and its read
Ap[a_, kx_, ky_] := {0.5 a u1[kx, ky] + 3 kx u2[kx, ky] + 3 ky u2[kx, ky] + D[u2[kx, ky], kx], 2 kx u1[kx, ky] + 2 ky u1[kx, ky] - D[u1[kx, ky], kx] - 0.3 a kx u2[kx, ky]}
I then called
{vals, vecs} = NDEigensystem[ Ap[1, kx, ky], {u1[kx, ky], u2[kx, ky]}, {kx, -3, 3}, {ky, -3, 3}, 10, Method -> {"SpatialDiscretization" -> {"FiniteElement", {"MeshOptions" -> {MaxCellMeasure -> 0.01}}}}];
In addition, I have tried to incorporate the insertion of variable a
in the matrix using the suggestion here as
p[a_, n_] :=
Block[{aval = a, nmax = n}, {vals, vecs} =
NDEigensystem[
Ap[aval, kx, ky], {u1[kx, ky], u2[kx, ky]}, {kx, -3, 3}, {ky, -3,
3}, nmax,
Method -> {"SpatialDiscretization" -> {"FiniteElement", \
{"MeshOptions" -> {MaxCellMeasure -> 0.01}}}}];
Table[
Plot3D[vecs[[i]], {kx, -3, 3}, {ky, -3, 3}, PlotRange -> All,
Mesh -> None, PlotLabel -> vals[[i]], ColorFunction -> "Rainbow",
AxesLabel -> {"kx", "ky", ""}], {i, 1, nmax}]
]
p[1.0, 10]
Is there a possibility to generate vals[a,kx,ky]
?
vals[a,kx,ky]
andvecs[a,kx,ky]
? Based on my attempt above, I can getvals
but don't have access to thek
variables yet. $\endgroup$