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

Adding boundary position parameter to initial condition.

parent 19e95405
No related branches found
No related tags found
No related merge requests found
...@@ -3,19 +3,19 @@ ...@@ -3,19 +3,19 @@
% (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.
a = -50; a = -50;
b = 0.05; b = 0.1;
c = 1/1000000000; c = 1/100000;
u0 = 0.1; u0 = 0.3;
%% Solve pde %% Solve pde
x = [linspace(49, 55, 600), linspace(55.01, 200, 300)]; x = [linspace(49, 55, 600), linspace(55.01, 200, 300)];
t = linspace(0, 100, 100); t = linspace(0, 1, 10000);
fh_ic = @(x) flory_ic(x, 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);
fh_pde = @(x, t, u, dudx) flory_hugg_pde(x, t, u, dudx, a, b, c, u0); fh_pde = @(x, t, u, dudx) flory_hugg_pde(x, t, u, dudx, a, b, c, u0);
sol = pdepe(0, fh_pde, fh_ic, fh_bc, x, t); sol = pdepe(0, fh_pde, fh_ic, fh_bc, x, t);
%% Plotting %% Plotting
figure(1); hold on; figure(1); hold on;
for i = 1:100 for i = 1:1000
cla; xlim([49, 53]); ylim([0, 1.5]); cla; xlim([49, 53]); ylim([0, 1.5]);
plot(x, phi_tot(x, a, b, u0)); plot(x, sol(i, :)); pause(0.01); plot(x, phi_tot(x, a, b, u0)); plot(x, sol(i, :)); pause(0.01);
end end
...@@ -39,8 +39,8 @@ f = ((u0+1)-pt)/pt*(pt*dudx-u*gra_a); ...@@ -39,8 +39,8 @@ f = ((u0+1)-pt)/pt*(pt*dudx-u*gra_a);
s = 0; s = 0;
end end
function u = flory_ic(x, u0) function u = flory_ic(x, a, u0)
if x<50 if x < -a
u = 0.0; u = 0.0;
else else
u = u0; u = 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