From 0d3c09bcc53ec59dc9d0acf793a6492ad2444118 Mon Sep 17 00:00:00 2001 From: Lars Hubatsch <hubatsch@pks.mpg.de> Date: Fri, 15 Jan 2021 11:31:07 +0100 Subject: [PATCH] WIP: adapt for jumps in to in, out to out. --- @Ternary_model/Ternary_model.m | 2 +- int_prob.m | 7 ++++++- prob_laplace.m | 6 +++--- 3 files changed, 10 insertions(+), 5 deletions(-) diff --git a/@Ternary_model/Ternary_model.m b/@Ternary_model/Ternary_model.m index 45178cc..18f0e53 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 79cf09c..60fc26c 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 0f311b8..2149d27 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 -- GitLab