Skip to content
Snippets Groups Projects
Commit 1eb13e11 authored by Lars Hubatsch's avatar Lars Hubatsch
Browse files

Trying to combine lb with corrected i->i, o->o.

parent ba6b4fcd
No related branches found
No related tags found
No related merge requests found
......@@ -3,35 +3,24 @@ function p = int_prob(l, T, x0, direc, ind_t, bp, ind_delta, lb, T_mov)
% 2: left->left, -2: right->right
% ind_t ... time index at which propagators are evaluated
% bp ... boundary position at t==ind_t
<<<<<<< Updated upstream
% lb ... distance from boundary not to take into account
=======
ss = T{1}.system_size;
>>>>>>> Stashed changes
delta_x0 = diff(x0);
p = 0;
if lb ~= 0 && abs(direc)==2
disp('Jump within same phase not implemented for lb!=0');
p = nan;
return;
end
for i = 1:length(delta_x0)
x = (x0(i)+x0(i+1))/2;
% 1. cond.: corr. starting point? 2. cond: jumped outside of domain?
corr_starting_point = direc*x < direc*bp-lb;
if abs(direc) == 1 % jump across the boundary?
<<<<<<< Updated upstream
corr_end_point = direc*(x-l) > direc*(bp-T{i}.v*T{1}.t(ind_delta+1))+lb;
elseif abs(direc) == 2 % jump within the same phase?
if lb ~= 0
disp('Jump within same phase not implemented for lb!=0');
break;
end
l = abs(l); % both directions need to be considered.
if (x < bp)
if (x + l < bp); right = 1; else; right = 0; end
if (x - l > 0); left = 1; else; left = 0; end
else
if (x + l < T{1}.system_size); right =1; else; right = 0; end
if (x -l > bp); left = 1; else; left = 0; end
=======
corr_end_point = direc*(x-l) > direc*(bp-T{i}.v*T{1}.t(ind_delta+1));
elseif direc == 2 % jump left -> left
if l < 0 && x-l < bp; corr_end_point = 1; else; corr_end_point=0; end
if l > 0 % jump to left
......@@ -44,7 +33,6 @@ for i = 1:length(delta_x0)
corr_end_point = 1;
% Reflecting boundary if jumping out on right side of system
if x-l > ss; x = 2*ss+l-x; end
>>>>>>> Stashed changes
end
end
if corr_starting_point && corr_end_point
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment