From aa4c9dd8096116a94719772ea4cf4512999b1f4c Mon Sep 17 00:00:00 2001 From: Lars Hubatsch <hubatsch@pks.mpg.de> Date: Tue, 14 Jan 2020 19:18:03 +0100 Subject: [PATCH] Frank's solution to probability problem via Laplace transform. Weirdly only works for one side right now. --- prob_laplace.m | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 prob_laplace.m diff --git a/prob_laplace.m b/prob_laplace.m new file mode 100644 index 0000000..ff8f03f --- /dev/null +++ b/prob_laplace.m @@ -0,0 +1,16 @@ +%% Frank's solution to the transfer/rate problem via Laplace transform +x0 = 1; +p_out = @(D_p, D_m, ga, x0, x, t) 1./(2*sqrt(D_p*pi*t))*... + (exp(-(x+x0).^2./(4*D_p*t))*(ga*sqrt(D_p)-sqrt(D_m))./... + (ga*sqrt(D_p)+sqrt(D_m))+exp(-(x-x0).^2./(4*D_p*t))); +p_in = @(D_p, D_m, ga, x0, x, t) 1./(sqrt(pi*t)*(sqrt(D_m)+ga*sqrt(D_p)))*... + exp(-(x-x0*sqrt(D_m/D_p)).^2/(4*D_m*t)); +x_in = linspace(-4, 0, 1000); +x_out = linspace(0, 4, 1000); +for i = 1:100 + figure(1); hold on; cla; + plot(x_out, p_out(0.85, 0.15, 1/5.66, x0, x_out, i/10)); + plot(x_in, p_in(0.85, 0.15, 1/5.66, x0, x_in, i/10)); + axis([-4, 4, 0, 2]); + shg; pause(); +end \ No newline at end of file -- GitLab