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

Adding entropy change for moving boundary.

parent 2f38c793
No related branches found
No related tags found
No related merge requests found
......@@ -50,23 +50,28 @@ T_mov.solve_tern_frap();
toc
%%
csvwrite('MovingBound.csv', [T_mov.x', T_mov.sol(1, :)', T_mov.sol(end, :)'])
%% Flux moving boundary
%% Flux and entropy change for moving boundary
chi_phi = -4.530864768482371;
i = 300;
s_dot = zeros(1, length(T_mov.t));
for i = 1:length(T_mov.t)
x_interp = (T_mov.x(1:end-1)+T_mov.x(2:end))/2;
u = T_mov.sol(i, :);
u_interp = (u(1:end-1)+u(2:end))/2;
g0 = 0.5;
gra_a = Ternary_model.gradient_analytical(x_interp, T_mov.a, T_mov.b,...
T_mov.e, T_mov.v*T_mov.t(i));
dudx = diff(u)./diff(T_mov.x);
f = -dudx-chi_phi.*u_interp.*gra_a;
figure; hold on;
plot(0:10, zeros(1, 11), 'LineWidth', 2);
plot(x_interp, f, 'LineWidth', 2)
set(gca,'fontsize', 18)
make_graph_pretty(['x [' char(956) 'm]'], 'flux', '', [0, 10, -5.2, 0.1])
s = '~/Nextcloud/Langevin_vs_MeanField/Data_Figs_FokkPla/Mov_Bou_Flux.csv';
csvwrite(s, [x_interp; f])
f = -g0*(dudx+chi_phi.*u_interp.*gra_a);
s_dot(i) = sum(x_interp.*f.^2./(g0.*u_interp));
% figure(1); hold on;
% plot(0:10, zeros(1, 11), 'LineWidth', 2);
% plot(x_interp, f, 'LineWidth', 2)
% set(gca,'fontsize', 18)
% make_graph_pretty(['x [' char(956) 'm]'], 'flux', '', [0, 10, -5.2, 0.1])
end
s = '~/Nextcloud/Langevin_vs_MeanField/Data_Figs_FokkPla/';
csvwrite([s, 'Mov_Bou_Flux.csv'], [x_interp; f])
csvwrite([s, 'Mov_Bou_Entr.csv'], [T_mov.t; s_dot])
%% FRAP jump length
t = linspace(0, 5, 300);
T_mov = Ternary_model(0, 'FRAP', {-5, b(7/3, 10^-6), 0.5, e(7/3),...
......@@ -74,7 +79,8 @@ T_mov = Ternary_model(0, 'FRAP', {-5, b(7/3, 10^-6), 0.5, e(7/3),...
T_mov.solve_tern_frap();
csvwrite('FRAP.csv', [T_mov.x', T_mov.sol(1, :)', T_mov.sol(end, :)'])
%% Calculate fluxes FRAP
%% Flux and entropy change for FRAP
s_dot = zeros(1, length(T_mov.t));
for i = 1:length(T_mov.t)
x_interp = (T_mov.x(1:end-1)+T_mov.x(2:end))/2;
u = T_mov.sol(i, :);
......
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