diff --git a/@Ternary_model/Ternary_model.m b/@Ternary_model/Ternary_model.m index 45178ccfbf0c705ce132eee86f476cadb3ca9852..18f0e53854d06afcc6260fcebcf13575ed47d64c 100644 --- a/@Ternary_model/Ternary_model.m +++ b/@Ternary_model/Ternary_model.m @@ -22,7 +22,7 @@ classdef Ternary_model < handle u0 = 0.05; e = 0.4; e_g0 = 0.16; % mobility spread. Also used in square mobility ansatz. - ic_c = 0; % initial concentration inside droplet + ic_c % initial concentration inside droplet u_g0 = 0.2; system_size = 300; x0 = 1; % Center of Gauss initial condition diff --git a/int_prob.m b/int_prob.m index 79cf09cb3eaf16094242a826a65c852982364613..60fc26cdbdcd55615d049f517bc95e2b063c5fdd 100644 --- a/int_prob.m +++ b/int_prob.m @@ -1,5 +1,6 @@ function p = int_prob(l, T, x0, direc, ind_t, bp, ind_delta, T_mov) % direc ... change direction of jumps, 1: left->right, -1: right->left +% 2: left->left, -2: right->right % ind_t ... time index at which propagators are evaluated % bp ... boundary position at t==ind_t delta_x0 = diff(x0); @@ -8,7 +9,11 @@ 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; - corr_end_point = direc*(x-l) > direc*(bp-T{i}.v*T{1}.t(ind_delta+1)); + if abs(direc) == 1 % jump across the boundary? + corr_end_point = direc*(x-l) > direc*(bp-T{i}.v*T{1}.t(ind_delta+1)); + elseif abs(direc) == 2 % jump within the same phase? + corr_end_point = direc*(x-l) < direc*(bp-T{i}.v*T{1}.t(ind_delta+1)); + end if corr_starting_point && corr_end_point if nargin==7 p_i = @(j) interp1(T{j}.x, T{j}.sol(ind_t, :), x-l); diff --git a/prob_laplace.m b/prob_laplace.m index 0f311b800a01a3d8d9dd913d21960072649585fb..2149d2720d4bb794ef9ccbb698703e6c2c3b8f61 100644 --- a/prob_laplace.m +++ b/prob_laplace.m @@ -399,10 +399,10 @@ end %% %%%%%%%%%%%%%%%%%%%%%% FRAP JUMP LENGTH DISTRIBUTION %%%%%%%%%%%%%%%%%%% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -params = {-5, b(7/3, 10^-6), 0.5, e(7/3), 0, 1, 10, 7, 0, 'Constituent'}; +params = {-5, b(7/3, 10^-6), 0.5, e(7/3), 0, 1, 10, 7, 0, 'Constituent', 0}; t = linspace(0, 5, 51); direc = 1; % 1: jump from left to right, -1: jump from right to left. -x0 = sort(5-direc*(0:0.002:4.01)); +x0 = sort(5-abs(direc)/direc*(0:0.002:4.01)); %% Run simulations for 'delta' IC across outside F = {}; parfor i = 1:length(x0) @@ -415,7 +415,7 @@ end %% Calc. probs. for each jump length in ls and sum over time T_mov = Ternary_model(0, 'FRAP', params, t, 0.2); T_mov.solve_tern_frap(); -ls = -direc*(0.001:0.04:4); +ls = -abs(direc)/direc*(0.001:0.04:4); n_T=45; p = nan(length(ls), n_T); for j = 1:n_T