From a4d33682aaec2b715fccff648d1a019eab1970ab Mon Sep 17 00:00:00 2001 From: Lars Hubatsch <hubatsch@pks.mpg.de> Date: Tue, 8 Dec 2020 16:49:17 +0100 Subject: [PATCH] Introduce defaults parameters for pdepe. --- @Ternary_model/create_mesh.m | 2 +- @Ternary_model/solve_tern_frap.m | 5 ++--- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/@Ternary_model/create_mesh.m b/@Ternary_model/create_mesh.m index 6646f2f..f29f7b8 100644 --- a/@Ternary_model/create_mesh.m +++ b/@Ternary_model/create_mesh.m @@ -41,4 +41,4 @@ elseif strcmp(T.mode, 'Client') && T.v ~= 0 linspace(T.x(ind_minus)+0.0001, T.x(ind_plus)-0.0001, 1000),... T.x(ind_plus:end)]; end -end +end \ No newline at end of file diff --git a/@Ternary_model/solve_tern_frap.m b/@Ternary_model/solve_tern_frap.m index 0abd8fb..2b17c88 100644 --- a/@Ternary_model/solve_tern_frap.m +++ b/@Ternary_model/solve_tern_frap.m @@ -7,13 +7,12 @@ fh_bc = @(xl, ul, xr, ur, t) flory_bc(xl, ul, xr, ur, t, T.u0, T.e); fh_pde = @(x, t, u, dudx) flory_hugg_pde(x, t, u, dudx, T.a, T.b, T.e,... T.u0, T.e_g0, T.u_g0, T.v,... T.mode); -T.sol = pdepe(T.geometry, fh_pde, fh_ic, fh_bc, T.x, T.t); +opts = odeset('RelTol',1e-3,'AbsTol',1e-6); +T.sol = pdepe(T.geometry, fh_pde, fh_ic, fh_bc, T.x, T.t, opts); toc end %% Function definitions for pde solver - - function u = flory_ic(x, a, b, u0, e, ic, x0, ic_c) if strcmp(ic, 'FRAP') % FRAP initial condition -- GitLab