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

Moving boundary agrees in principle with Langevin.

parent 60a71257
No related branches found
No related tags found
No related merge requests found
......@@ -31,5 +31,5 @@ function create_mesh(T)
% % end
% T.x = [linspace(3, 5., 500), linspace(5.05, 6.05, 3000),...
% linspace(6.06, 7.1, 500), linspace(7.15, 20, 3000)];
T.x = linspace(0, 20, 10000);
T.x = linspace(0, 20, 8000);
end
......@@ -10,8 +10,9 @@ end
if strcmp(mode, 'mov')
figure(20); hold on;
for i = 1:nth:length(T.t)
cla; xlim([-T.a-1, -T.a+3]); ylim([0, 1.2]);
cla; xlim([-T.a-1, -T.a+3]);
xlim([0, 20]);
ylim([0, 5.2]);
ax = gca;
ax.FontSize = 12;
xlabel('position'); ylabel('probability [not normalized]');
......@@ -21,7 +22,7 @@ if strcmp(mode, 'mov')
text(abs(-T.a+2), 0.7, num2str(T.t(i)));
shg
% pause();
print([num2str(i),'.png'],'-dpng')
% print([num2str(i),'.png'],'-dpng')
end
elseif strcmp(mode, 'plot')
figure(20);
......
......@@ -18,10 +18,11 @@ function [c, f ,s] = flory_hugg_pde(x, t, u, dudx, a, b, e, u0,...
pt = Ternary_model.phi_tot(x, a, b, e, u0, v*t);
gra_a = Ternary_model.gradient_analytical(x, a, b, e, v*t);
% g0 = Ternary_model.gamma0(x, a+t*v, b, e_g0, u_g0, v*t);
g0 = 1;
g0 = 0.5;
c = 1;
% f = g0*(1-pt)/pt*(pt*dudx-u*gra_a);
f = g0*(dudx-5*u*gra_a);
chi_phi = -4.530864768482371;
f = g0*(dudx+chi_phi*u*gra_a);
s = 0;
end
......@@ -49,7 +50,11 @@ elseif strcmp(ic, 'Gauss')
end
elseif strcmp(ic, 'Uniform')
% Uniform concentration
u = u0-e;
if x > -a
u = 1/24;
else
u = 1;
end
elseif isnumeric(ic)
% use ic as initial condition by interpolating the given values between
% 0 and a
......
......@@ -42,13 +42,21 @@ p_in = @(D_p, D_m, ga, x0, x, t) 1./(sqrt(pi*t)*(sqrt(D_m)+...
x_left = linspace(-4, 0, 1000);
x_right = linspace(0, 4, 1000);
%% Moving boundary
t = linspace(0, 10, 300);
tic
T_mov = Ternary_model(0, 'Uniform', [-10, b(7/3, 10^-6), 0.5, e(7/3),...
0, 1, 10, 7, 0.5], t, 0.02);
T_mov.solve_tern_frap()
toc
%%
csvwrite('MovingBound.csv', [T_mov.x', T_mov.sol(1, :)', T_mov.sol(end, :)'])
%% FRAP client
t = linspace(0, 15, 300);
tic
T_mov = Ternary_model(0, 'Uniform', [-20, b(7/3, 10^-6), 0.5, e(7/3),...
0, 1, 20, 7, 0.5], t, 0.02);
T_mov = Ternary_model(0, 'FRAP', [-10, b(7/3, 10^-6), 0.5, e(7/3),...
0, 1, 10, 7, 0.5], t, 0.02);
T_mov.solve_tern_frap()
toc
%% Plot with full ternary model
T_temp = T_mov;
D_m = 1*(1-T_temp.u0-T_temp.e); % to make equal to ternary FRAP
......
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