Message Boards Message Boards

NDSolve error solving the Schrödinger equation?

Posted 2 years ago

The code does not run, can someone help? I should see a moving plot of the wave function

time = 3600; alpha = 0.2; mu = 1; beta = 1/10; omega = 
1/10000; d = 21; q := (d - 1)/2;

g[n_] := 
N[Sum[Exp[-Pi alpha (m d + n)^2/d], {m, -Infinity, Infinity}]];

gamma := Normalize[Table[g[n], {n, -q, q}]];

T[n_, m_] := N[(1/(100 d)) Sum[k Exp[2 Pi I (m - n) k/d], {k, -q, q}]]
H[n_, m_, t_] := (1/(2 mu)) Sum[T[n, k] T[k, m], {k, -q, q}]
+beta (n/100) Cos[omega t] DiscreteDelta[n - m];

eqns = {Table[
phi[n][t] == Sum[-I H[n, m, t] phi[m][t], {m, 1, d}], {n, 1, d}], 
Table[phi[n][0] == gamma[[n]], {n, 1, d}]};

ndsolve = NDSolve[eqns, Table[phi[n], {n, d}], {t, 30000}];

Phi = Normalize[
Table[Evaluate[Abs[phi[n][time]] /. ndsolve][[1]], {n, 1, d}]];

ListPlot[Table[{n, Phi[[n + q + 1]]^2}, {n, -q, q}], Filling -> Axis]
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard

Group Abstract Group Abstract