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

MAJOR BUG FIXED. x domain now starts at zero. pdepe enforces no-flux for...

MAJOR BUG FIXED. x domain now starts at zero. pdepe enforces no-flux for spherical coordinates at absolute zero, not at the beginning of the domain.
parent 594c6e92
No related branches found
No related tags found
No related merge requests found
...@@ -2,26 +2,24 @@ ...@@ -2,26 +2,24 @@
% unbleached species. Model is assumed to be equilibrated % unbleached species. Model is assumed to be equilibrated
% (bleached+unbleached=const.=pt). Then bleached species initial % (bleached+unbleached=const.=pt). Then bleached species initial
% conditions are introduced. Integration of model via pdepe. % conditions are introduced. Integration of model via pdepe.
pa = '/Users/hubatsch/ownCloud/Dropbox_Lars_Christoph/DropletFRAP/FRAP_paper/';
a = -50; a = -1;
b = 0.025; b = 0.025;
c = 1/100; c = 1/100;
u0 = 0.05; u0 = 0.05;
e = 0.4; e = 0.4;
%% Make useful mesh (by inverting the tanh profile and using this as spacing) %% Make useful mesh (by inverting the tanh profile and using this as spacing)
x = linspace(49.0, 51, 3000); x = linspace(-a-1, -a+1, 3000);
g = gamma0(x, a, 1*b, e); g = gamma0(x, a, 1*b, e);
g_unique = unique(g); g_unique = unique(g);
x = linspace(g_unique(1), g_unique(end-1), 300); x = linspace(g_unique(1), g_unique(end-1), 300);
g_inv = spacing(x, a, 2*b, e); g_inv = spacing(x, a, 2*b, e);
g_inv = g_inv(2:end-1); g_inv = g_inv(2:end-1);
x = [linspace(49.0, g_inv(2), 30), g_inv(3:end-2), ... x = [linspace(-a-1, g_inv(2), 30), g_inv(3:end-2), ...
linspace(g_inv(end-1), 51, 30), linspace(51.1, 300, 300)]; linspace(g_inv(end-1), -a+1, 30), linspace(-a+1.1, 300, 300)];
%% Solve pde %% Solve pde
tic tic
% x = [linspace(49.0, 49.8, 30), linspace(49.81, 50.2, 1000), ...
% linspace(50.21, 51, 30) linspace(51.01, 200, 600)];
t = linspace(0.001, 4, 500); t = linspace(0.001, 4, 500);
fh_ic = @(x) flory_ic(x, a, u0); fh_ic = @(x) flory_ic(x, a, u0);
fh_bc = @(xl, ul, xr, ur, t) flory_bc(xl, ul, xr, ur, t, u0); fh_bc = @(xl, ul, xr, ur, t) flory_bc(xl, ul, xr, ur, t, u0);
...@@ -31,7 +29,7 @@ toc ...@@ -31,7 +29,7 @@ toc
%% Plotting %% Plotting
figure(1); hold on; figure(1); hold on;
for i = 1:length(t) for i = 1:length(t)
cla; xlim([49, 53]); ylim([0, 0.7]); cla; xlim([-a-1, -a+3]); ylim([0, 0.7]);
ax = gca; ax = gca;
ax.FontSize = 16; ax.FontSize = 16;
xlabel('position'); ylabel('volume fraction'); xlabel('position'); ylabel('volume fraction');
...@@ -46,9 +44,10 @@ xlim([49, 53]); ylim([0, 0.5]); ...@@ -46,9 +44,10 @@ xlim([49, 53]); ylim([0, 0.5]);
ax = gca; ax = gca;
ax.FontSize = 16; ax.FontSize = 16;
xlabel('position'); ylabel('volume fraction'); xlabel('position'); ylabel('volume fraction');
plot(x, sol(1:2:300, :), 'LineWidth', 2, 'Color', [135/255 204/255 250/255]);%[0 0.4470 0.7410] plot(x, sol(1:2:300, :), 'LineWidth', 2, 'Color', [135/255 204/255 250/255]);
plot(x, phi_tot(x, a, b, e, u0), 'LineWidth', 4, 'LineStyle', '--', 'Color', [247/255, 139/255, 7/255]); plot(x, phi_tot(x, a, b, e, u0), 'LineWidth', 4, 'LineStyle', '--', 'Color',...
print('/Users/hubatsch/ownCloud/Dropbox_Lars_Christoph/DropletFRAP/FRAP_paper/ternary_time_course', '-depsc'); [247/255, 139/255, 7/255]);
print([pa, 'ternary_time_course'], '-depsc');
%% Plot and check derivatives of pt %% Plot and check derivatives of pt
figure; hold on; figure; hold on;
x = linspace(40, 60, 100000); x = linspace(40, 60, 100000);
...@@ -74,9 +73,9 @@ end ...@@ -74,9 +73,9 @@ end
function u = flory_ic(x, a, u0) function u = flory_ic(x, a, u0)
% FRAP initial condition % FRAP initial condition
% if x < -a; u = 0.0; else; u = u0; end if x < -a; u = 0.0; else; u = u0; end
% Peak outside initial condition % Peak outside initial condition
if (x < -a+0.2) && (x > -a+0.1); u = 10; else; u = 0; end % if (x < -a+0.2) && (x > -a+0.1); u = 10; else; u = 0; end
% u = 0.3; % u = 0.3;
% u = phi_tot(x, -50, 1); % u = phi_tot(x, -50, 1);
end end
......
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