-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathplot_statistics_single.m
69 lines (63 loc) · 2 KB
/
plot_statistics_single.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
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
txt = {strcat('theta=',string(theta)),strcat('mu=',string(mu)),strcat('alpha=',string(alpha)),strcat('k=',string(k)),strcat('omega=',string(omega)),strcat('L=',string(L))};
figure(1)
hold on;
xlim([-L,L])
ylim([0 time])
for x=1:N
figure(1)
plot(traj_free(x,:),tt_free,'Color',[0 0.4470 0.7410]);
drawnow
plot(traj_boundary(x,:),tt_boundary,'Color',[0.8500 0.3250 0.0980]);
drawnow
end
xlabel('Position','FontSize',20);
ylabel('Time','FontSize',20);
title('Trajectories');
legend({'free evolution','with boundary condition'},'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(q0,yy_free);
scatter(q0,yy_boundary);
xlabel('Initial position of particle','FontSize',20);
ylabel('Time of detection','FontSize',20);
title('Detection time with respect to initial position');
xlim([-L,L])
ylim([0 time])
legend({'free evolution','with boundary condition'},'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_free);
cdfplot(yy_boundary);
plot(times,cumtrapz(times,mu_phi));
plot(times,cumtrapz(times,mu_psi));
xlabel('Time','Fontsize',20)
title('Cumulative distribution of detection times');
xlim([0 time])
ylim([0 1])
legend({'free evolution','with boundary condition','free evolution','with boundary condition'},'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_free,N/10);
histogram(yy_boundary,N/10);
plot(times,mu_phi*10);
plot(times,mu_psi*10);
xlabel('Time','Fontsize',20)
title('Histogram and pdf of detection times');
xlim([0 time])
legend({'free evolution','with boundary condition','free evolution','with boundary condition'},'Location','southwest');
xlimits=xlim;
ylimits=ylim;
text(xlimits(1)+(xlimits(2)-xlimits(1))/16,(ylimits(2)-ylimits(1))*5/8,txt);
hold off