| Author |
Comment/Response |
D
|
02/21/13 11:52am
I don't believe the problem is in the code because the program runs fully through on another computer. I believe it has something to do with how my computer is analyzing the notebook when it comes to NDsolve.
xM = 15
x0=-8
a = 0.5;
barrierHeight = 5.5 10^-7;
barrierV[x_] := Which[x < 0, 0, x > a, 0, True, barrierHeight]
c = 3000;
hbarc = 0.00197;
hbar = hbarc/ c
mass = 1000;
hbarSqOver2mass = (hbarc^2)/ (2 mass)
E1 = 4.9 10^-7
kzero = Sqrt[E1/hbarSqOver2mass ]
lambda = 2 \[Pi]/ kzero
v = E1/ (hbar)
\[Sigma] = 1
\[Omega]1 = c hbarc kzero/ mass
\[Omega]2 = c hbarc/ mass
\[Psi]pkt[v_, \[Sigma]_, \[Omega]1_, \[Omega]2_][x_,
t_] = (\[Sigma]^2/\[Pi])^(1/4)
Exp[I (kzero x - v t)]/((\[Sigma]^2 + I \[Omega]2 t )^(1/2))
Exp[-((x - \[Omega]1 t)^2/(2 (\[Sigma]^2 + I \[Omega]2 t) ))];
\[Chi][x_] := \[Psi]pkt[v, \[Sigma], \[Omega]1, \[Omega]2][x - x0, 0]
enforceBCs[\[Psi]_, x_,
xM_] := \[Psi] - (((\[Psi] /. x -> -xM) - (\[Psi] /. x -> xM))/
2*(Cos[(x + xM)/(2 xM) Pi] + 1) + (\[Psi] /. x -> xM))
schroedingerEq =
I hbar D[\[CapitalPsi][x, t], {t, 1}] == -
hbarSqOver2mass D[\[CapitalPsi][x, t], {x, 2}] +
barrierV[x] \[CapitalPsi][x, t]
(nsol = NDSolve[{schroedingerEq, \[CapitalPsi][x, 0] ==
enforceBCs[\[Chi][x], x, xM], \[CapitalPsi][xM, t] ==
0, \[CapitalPsi][-xM, t] == 0}, \[CapitalPsi][x, t], {x, -xM,
xM}, {t, 0, 200}, AccuracyGoal -> 3,
PrecisionGoal -> 3]) // Timing
URL: , |
|