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

plot_sim can now work with two species.

parent b047d291
No related branches found
No related tags found
No related merge requests found
...@@ -18,26 +18,37 @@ if strcmp(mode, 'mov') ...@@ -18,26 +18,37 @@ if strcmp(mode, 'mov')
axis([0, T.system_size, 0, max(T.sol(:))]); axis([0, T.system_size, 0, max(T.sol(:))]);
ax = gca; ax.FontSize = 12; ax = gca; ax.FontSize = 12;
xlabel('position'); ylabel('probability [not normalized]'); xlabel('position'); ylabel('probability [not normalized]');
plot(T.x, T.phi_tot(T.x, T.a, T.b, T.e, T.u0, T.t(i)*T.v), 'LineWidth', 2, ... plot(T.x, T.phi_tot(T.x, T.a, T.b, T.e, T.u0, T.t(i)*T.v),...
'LineStyle', '--'); 'LineWidth', 2, 'LineStyle', '--');
plot(T.x, T.sol(i, :), 'LineWidth', 2); if length(size(T.sol))==2
plot(T.x, T.sol(i, :), 'LineWidth', 2);
elseif length(size(T.sol))==3
plot(T.x, T.sol(i, :, 1), 'LineWidth', 2, 'Color', color);
plot(T.x, T.sol(i, :, 2), 'LineWidth', 2, 'Color', 'k');
end
text(abs(-T.a+2), 0.7, num2str(T.t(i))); text(abs(-T.a+2), 0.7, num2str(T.t(i)));
shg; pause(); shg; pause();
% print([num2str(i),'.png'],'-dpng') % print([num2str(i),'.png'],'-dpng')
end end
elseif strcmp(mode, 'plot') elseif strcmp(mode, 'plot')
figure(20); figure(20); hold on;
% cla;
hold on;
xlim([-inf, -2*T.a]); %ylim([-inf, max(T.sol(:))]); xlim([-inf, -2*T.a]); %ylim([-inf, max(T.sol(:))]);
ax = gca; ax = gca;
ax.FontSize = 12; ax.FontSize = 12;
xlabel('x [\mum]'); ylabel('volume fraction'); xlabel('x [\mum]'); ylabel('volume fraction');
% N = max(max(T.sol([1, 2:nth:si(1)], :))); % N = max(max(T.sol([1, 2:nth:si(1)], :)));
N = 1; N = 1;
plot(T.x*x_scale, T.sol([1, start:nth:si(1)], :)/N, 'LineWidth', 1, 'Color', color);
plot(T.x*x_scale, Ternary_model.phi_tot(T.x, T.a, T.b, T.e, T.u0, 0),... plot(T.x*x_scale, Ternary_model.phi_tot(T.x, T.a, T.b, T.e, T.u0, 0),...
'LineWidth', 1, 'LineStyle', '--', 'Color', [0.97, 0.55, 0.03]); 'LineWidth', 1, 'LineStyle', '--', 'Color', [0.97, 0.55, 0.03]);
if length(size(T.sol))==2
plot(T.x*x_scale, T.sol([1, start:nth:si(1)], :)/N, 'LineWidth', 1,...
'Color', color);
elseif length(size(T.sol))==3
plot(T.x*x_scale, T.sol([1, start:nth:si(1)], :, 1)/N, 'LineWidth', 1,...
'Color', color);
plot(T.x*x_scale, T.sol([1, start:nth:si(1)], :, 2)/N, 'LineWidth', 1,...
'Color', 'k');
end
end end
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