From 936276be46f71d720566232264ebf4310d4778c9 Mon Sep 17 00:00:00 2001 From: Lars Hubatsch <hubatsch@pks.mpg.de> Date: Thu, 19 Dec 2019 17:11:25 +0100 Subject: [PATCH] Matlab code for ternary model for unbleached molecules seems to work properly now. Problem before: volume fraction not defined properly and thus low mobility inside. --- ternary_frap.m | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/ternary_frap.m b/ternary_frap.m index 6fd49a7..044c34a 100644 --- a/ternary_frap.m +++ b/ternary_frap.m @@ -3,25 +3,22 @@ % (bleached+unbleached=const.=pt). Then bleached species initial % conditions are introduced. Integration of model via pdepe. -% Still not sure whether this solution is correct. Diffusion seems to slow -% towards the end! - a = -50; -b = 0.1; +b = 0.01; c = 1/100000; u0 = 0.3; %% Solve pde x = [linspace(49, 55, 600), linspace(55.01, 200, 300)]; -t = linspace(0, 1, 10000); +t = linspace(0, 0.001, 1000); fh_ic = @(x) flory_ic(x, a, u0); fh_bc = @(xl, ul, xr, ur, t) flory_bc(xl, ul, xr, ur, t, u0); fh_pde = @(x, t, u, dudx) flory_hugg_pde(x, t, u, dudx, a, b, c, u0); sol = pdepe(0, fh_pde, fh_ic, fh_bc, x, t); %% Plotting figure(1); hold on; -for i = 1:1000 +for i = 1:length(t) cla; xlim([49, 53]); ylim([0, 1.5]); - plot(x, phi_tot(x, a, b, u0)); plot(x, sol(i, :)); pause(0.01); + plot(x, phi_tot(x, a, b, u0)); plot(x, sol(i, :)); pause(0.03); end %% Plot and check derivatives of pt @@ -39,7 +36,7 @@ function [c, f ,s] = flory_hugg_pde(x, t, u, dudx, a, b, c_p, u0) pt = phi_tot(x, a, b, u0); gra_a = gradient_analytical(x, a, b); c = c_p; -f = ((u0+1)-pt)/pt*(pt*dudx-u*gra_a); +f = ((u0+1.3)-pt)/pt*(pt*dudx-u*gra_a); s = 0; end -- GitLab