Skip to content
Snippets Groups Projects
Commit 8cd4f95d authored by Lars Hubatsch's avatar Lars Hubatsch
Browse files

Making initial condition a parameter.

parent fe020ac8
No related branches found
No related tags found
No related merge requests found
......@@ -7,6 +7,7 @@ classdef Ternary_model < handle
properties
pa = '/Users/hubatsch/ownCloud/Dropbox_Lars_Christoph/DropletFRAP/FRAP_paper/';
g0
ic = 'FRAP'
sol
t
x
......@@ -20,8 +21,9 @@ classdef Ternary_model < handle
o_g0 = 0.2;
end
methods
function T = Ternary_model(t, params)
function T = Ternary_model(ic, params, t)
T.t = t;
T.ic = ic;
if ~isempty(params)
T.a = params(1);
T.b = params(2);
......
function solve_tern_frap(T)
%SOLVE_TERN_FRAP solves Fokker Planck equation for ternary FRAP
% Assumes fixed profile of phi_tot
fh_ic = @(x) flory_ic(x, T.a, T.u0);
fh_ic = @(x) flory_ic(x, T.a, T.u0, T.ic);
fh_bc = @(xl, ul, xr, ur, t) flory_bc(xl, ul, xr, ur, t, T.u0);
fh_pde = @(x, t, u, dudx) flory_hugg_pde(x, t, u, dudx, T.a, T.b, T.e, T.u0,...
T.e_g0, T.o_g0);
......@@ -23,27 +23,28 @@ f = g0*(1-pt)/pt*(pt*dudx-u*gra_a);
s = 0;
end
function u = flory_ic(x, a, u0)
function u = flory_ic(x, a, u0, ic)
if strcmp(ic, 'FRAP')
% FRAP initial condition
if x < -a; u = 0.0; else; u = u0; end
% Peak outside initial condition
% if (x < -a+0.2) && (x > -a+0.1); u = 10; else; u = 0; end
% u = 0.3;
% u = phi_tot(x, -50, 1);
%%
%% Frank/Jonathan/Stefano solution to the transfer/rate problem via Laplace transform
% x0 = 3;
% D_m = 0.11;%g0(1)*(1-u0-e)/(u0+e); % to make equal to ternary FRAP
% D_p = 0.342;%g0(end)*(1-u0)/u0;
% ga = 1/9;
% 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)));
% if x > -a
% u = p_out(D_p, D_m, ga, x0, x, 3/100);
% else
% u = 0;
% end
elseif strcmp(ic, 'Gauss')
% Frank/Jonathan/Stefano solution to the transfer/rate problem via
% Laplace transform
x0 = 3;
D_m = 0.11;%g0(1)*(1-u0-e)/(u0+e); % to make equal to ternary FRAP
D_p = 0.342;%g0(end)*(1-u0)/u0;
ga = 1/9;
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)));
if x > -a
u = p_out(D_p, D_m, ga, x0, x, 3/100);
else
u = 0;
end
else
disp('Initial condition not supported');
end
end
function [pl,ql,pr,qr] = flory_bc(xl, ul, xr, ur, t, u0)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment