From 788bf5977b817e56a28208c047921e43ef88ba31 Mon Sep 17 00:00:00 2001 From: Lars Hubatsch <hubatsch@pks.mpg.de> Date: Mon, 9 Nov 2020 22:16:43 +0100 Subject: [PATCH] Generalizing jump lengths distros. --- prob_laplace.m | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/prob_laplace.m b/prob_laplace.m index 737bb6f..d38125c 100644 --- a/prob_laplace.m +++ b/prob_laplace.m @@ -193,7 +193,7 @@ params = {-5, b(7.7/3, 10^-6), 0.5, e(7.7/3), 0, 1, 10, 7, 0,... 'Constituent', 0}; t = [0, 0.05, 0.1, 1]; direc = 1; -x0 = sort(5-direc*(0:0.001:3.01)); +x0 = sort(5-direc*(0:0.001:4.01)); %% Run simulations for 'delta' IC across outside T = {}; parfor i = 1:length(x0) @@ -205,19 +205,23 @@ parfor i = 1:length(x0) end % save prob_laplace_X_7_7_short_2 %% Calculate probabilities for each jump length in ls. -ls = -direc*(0.000:0.001:3); +l_max = 4; +t_ind = 4; +ls = -direc*(0.000:0.001:l_max); p = nan(1, length(ls)); tic parfor i = 1:length(ls) tic - p(i) = int_prob(ls(i), T, x0, direc, 3, 5, 0); + p(i) = int_prob(ls(i), T, x0, direc, t_ind, 5, 0); toc end toc %% Normalization factor -N = normalization(T, x0, 0, 3, direc, 5) +N = normalization(T, x0, 0, t_ind, direc, -params{1}) % N = sum(p)*0.001; -% m = sum(ls.*p/N)/3001*3; +m = sum(ls.*p/N)/length(p)*l_max; +% should sum to one +sum(p/N)/length(p)*l_max %% sum((T{1}.sol(1, 1:end-1)+T{1}.sol(1, 2:end))/2.*diff(T{1}.x)) %% Do we need to look at the left side as well? -- GitLab