Mathematica Asked by Anthony on October 16, 2020
First I solved for the eigenfunctions and stored them as "funs":
A = 0.05; Subscript[V, 0] = 1 ; d = 2;
schröd = -A*d^2 [Pi]*D[[Psi][n, [CurlyPhi]], {[CurlyPhi], 2}] + A/(4 [Pi]) ([CurlyPhi]*[CurlyPhi]*[Psi][n, [CurlyPhi]] +
2 I*D[[Psi][n, [CurlyPhi]], {n, 1}] -
D[[Psi][n, [CurlyPhi]], {n, 2}]) - Subscript[V,
0] ((Cos[2 [Pi]*d*n]) + Cos[[CurlyPhi]]) [Psi][n, [CurlyPhi]]; Subscript[n, min] = -1/2; Subscript[n, max] = 1/2; Subscript[ [CurlyPhi], min] = -[Pi]; Subscript[[CurlyPhi], max] = [Pi];
{vals, funs} = NDEigensystem[{schröd,
PeriodicBoundaryCondition[[Psi][n, [CurlyPhi]],
Subscript[[CurlyPhi], min] <= [CurlyPhi] <=
Subscript[[CurlyPhi], max] && n == Subscript[n, max] ,
FindGeometricTransform[{{Subscript[n, min],
Subscript[[CurlyPhi], min]}, {Subscript[n, min],
Subscript[[CurlyPhi], max]}}, {{Subscript[n, max],
Subscript[[CurlyPhi], min]}, {Subscript[n, max],
Subscript[[CurlyPhi], max]}}][[2]]],
PeriodicBoundaryCondition[Exp[I 2 [Pi] n]*[Psi][n, [CurlyPhi]],
Subscript[n, min] <= n <= Subscript[n, max] && [CurlyPhi] ==
Subscript[[CurlyPhi], max],
FindGeometricTransform[{{Subscript[n, min],
Subscript[[CurlyPhi], min]}, {Subscript[n, max],
Subscript[[CurlyPhi], min]}}, {{Subscript[n, min],
Subscript[[CurlyPhi], max]}, {Subscript[n, max],
Subscript[[CurlyPhi], max]}}][[2]]]}, [Psi][
n, [CurlyPhi]] , {n, [CurlyPhi]} [Element]
Rectangle[{Subscript[n, min], Subscript[[CurlyPhi],
min]}, {Subscript[n, max], Subscript[[CurlyPhi], max]}], 8];
But the returned eigenfunctions are not in the order that I expected, namely with the ground state first, first excited state second etc.
I've realised one of the reasons the graphs were not as expected is that I unwittingly wasn't plotting the eigenfunctions I thought I was. NDEigenSystem returns eigenfunctions in order of the magnitude of their eigenvalue which implies that the first one it returns is the ground state, the second the first excited state etc.. However, if a lot of your eigenvalues are around zero, and imaginary, ordering by magnitude of eigenvalue doesn't necessarily give the ground state first. I solved this rookie error by adding a constant of 1 to my hamiltonian (simply adding +[Psi][n, [CurlyPhi]] at the end of my "schröd"), which is allowed because we can define where the ground state energy is however we want, as we are interested in energy differences.
Correct answer by Anthony on October 16, 2020
Get help from others!
Recent Answers
Recent Questions
© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP