-
Notifications
You must be signed in to change notification settings - Fork 0
/
chi_vs_phi_comparison.m
43 lines (39 loc) · 1.06 KB
/
chi_vs_phi_comparison.m
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
theta = pi/2;
mu = 0;
alpha = 1;
k = 25;
omega = 25;
time = 2;
N = 1;
mesh = .01;
step = 1/mesh;
L = 1;
times = (0:mesh:time)+1e-6;
space = (mu-2:mesh:mu+2);
for t = 1:length(times)
psiFrame = NaN(size(space));
chiSumFrame = NaN(size(space));
transportFrame = NaN(size(space));
chiFrame = NaN(size(space));
for i = 1:length(space)
psi = psiPlus(times(t),space(i),theta,alpha,k,mu,omega,step,L);
phi = phiPlus(times(t),space(i),theta,alpha,k,mu,omega,step);
transport = -phiPlus(times(t)-L+space(i),L,theta,alpha,k,mu,omega,step);
psiFrame(i) = abs(psi).^2;
chiSumFrame(i) = abs(psi-phi-transport).^2;
transportFrame(i) = abs(transport).^2;
chiFrame(i) = abs(psi-phi).^2;
end
hold on
plot(space,psiFrame)
plot(space,chiSumFrame)
plot(space,transportFrame)
plot(space,chiFrame)
xlim([space(1) space(length(space))])
ylim([0 .4])
xlabel('position')
legend({'psi','chiSum','transport','chi'},'Location','southwest');
M(t) = getframe;
hold off
clf
end