-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathplot_statistics.asv
94 lines (86 loc) · 3.43 KB
/
plot_statistics.asv
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
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
% txt = {strcat('theta\_ph=',string(theta_ph)),strcat('theta\_el=',string(theta_el)),strcat('mu\_ph=',string(mu_ph)),strcat('mu\_el=',string(mu_el)),strcat('alpha\_ph=',string(alpha_ph)),strcat('alpha\_el=',string(alpha_el)),strcat('k\_ph=',string(k_ph)),strcat('k\_el=',string(k_el)),strcat('omega=',string(omega))};
txt = {strcat('theta=',string(theta_el)),strcat('sigma=',string(alpha_el)),strcat('k=',string(k_el)),strcat('omega=',string(omega))};
figure(1)
hold on;
xlim([pos_alice pos_bob])
ylim([0 time])
for x=1:N
figure(1)
plot(traj_interacting_photon(x,:),tt_interacting_photon,'Color',[0 0.4470 0.7410]);
drawnow
plot(traj_single_free(x,:),tt_single_free,'Color',[0.8500 0.3250 0.0980]);
drawnow
plot(traj_single_boundary(x,:),tt_single_boundary,'Color',[0.9290 0.6940 0.1250]);
drawnow
end
xlabel('Position','FontSize',20);
ylabel('Time','FontSize',20);
title('Trajectories');
legend({'interacting photon','noninteracting electron','single electron w/ boundary'},'Location','southwest');
xlimits=xlim;
ylimits=ylim;
text(xlimits(1)+(xlimits(2)-xlimits(1))/16,(ylimits(2)-ylimits(1))*1/4,txt);
hold off
figure(2)
hold on;
scatter(initvals(1,:),yy_photon);
scatter(initvals(2,:),yy_single_free);
scatter(initvals(2,:),yy_single_boundary);
xlabel('Initial position','FontSize',20);
ylabel('Arrival time','FontSize',20);
title('Arrival time of photon vs electron at Alice');
xlim([pos_alice,pos_bob])
ylim([0 time])
legend({'interacting photon','noninteracting electron','single electron w/ boundary'},'Location','southwest');
xlimits=xlim;
ylimits=ylim;
text(xlimits(1)+(xlimits(2)-xlimits(1))/16,(ylimits(2)-ylimits(1))*5/8,txt);
hold off
figure(3)
hold on;
cdfplot(yy_photon);
cdfplot(yy_single_free);
cdfplot(yy_single_boundary);
% plot(times_prob,cumtrapz(times_prob,mu_fun_photon));
plot(times,cumtrapz(times_prob,mu_fun_single_free));
plot(times,cumtrapz(times_prob,mu_fun_single_boundary));
xlabel('Time','Fontsize',20)
title('Cumulative distributions of arrival times at Alice');
xlim([0 time])
ylim([0 1])
legend({'interacting photon','noninteracting electron','single electron w/ boundary','noninteracting electron','single electron w/ boundary'},'Location','southwest');
xlimits=xlim;
ylimits=ylim;
text(xlimits(1)+(xlimits(2)-xlimits(1))/16,(ylimits(2)-ylimits(1))*5/8,txt);
hold off
figure(4)
hold on;
histogram(yy_photon);
histogram(yy_single_free);
histogram(yy_single_boundary);
% plot(times_prob,mu_fun_photon);
plot(times,mu_fun_single_free);
plot(times,mu_fun_single_boundary);
xlabel('Time','Fontsize',20)
title('Histogram and pdf of arrival times at Alice');
xlim([0 time])
legend({'interacting photon','noninteracting electron','single electron w/ boundary','noninteracting electron','single electron w/ boundary'},'Location','southwest');
xlimits=xlim;
ylimits=ylim;
text(xlimits(1)+(xlimits(2)-xlimits(1))/16,(ylimits(2)-ylimits(1))*5/8,txt);
hold off
figure(5)
hold on;
scatter(initvals(1,:),yy_photon);
scatter(initvals(2,:)-mu_el,yy_single_free);
scatter(initvals(2,:)-mu_el,yy_single_boundary);
xlabel('Initial position','FontSize',20);
ylabel('Arrival time','FontSize',20);
title('Arrival times of photon vs electron at Alice, electron starting position shifted to mu\_ph');
xlim([pos_alice,pos_bob])
ylim([0 time])
legend({'interacting photon','noninteracting electron','single electron w/ boundary'},'Location','southwest');
xlimits=xlim;
ylimits=ylim;
text(xlimits(1)+(xlimits(2)-xlimits(1))/16,(ylimits(2)-ylimits(1))*5/8,txt);
hold off