Reverse boundary conditions in a one-dimensional degenerate PDE

2 views (last 30 days)
I want to solve a PDE with convection and diffusion, which has travelling waves solutions which go from 1 to 0 and travel from left to right as the picture attached. It happens that this equation also has the same solutions but travelling from right to left and going from 0 to 1 (like the attached picture, the last profile from right to left is the first one).
To obtain the normal (left to right) profiles the initial conditions could be for example a step function or a tanh. The boundary conditions are u(xl,t)=1 and u(xr,t)=0. This is how I code this:
function [pl,ql,pr,qr] = pdex1bc(xl,ul,xr,ur,t) pl = ul; ql = 0; pr = ur; qr = 0;
If I want to obtain the right to left profiles, strictly speaking I only need to "reverse" the boundary and initial conditions appropriately. That is, for example a –tanh (instead of +) and something like: u(xl,t)=0 and u(xr,t)=1. This is how I changed it:
function [pl,ql,pr,qr] = pdex1bc(xl,ul,xr,ur,t) pl = ur; ql = 0; pr = ul; qr = 0;
However this does not work, i get the following error:
Error using pdepe (line 293) Spatial discretization has failed. Discretization supports only parabolic and elliptic equations, with flux term involving spatial derivative.
Error in test4 (line 50) sol = pdepe(m,@pdex1pde,@pdex1ic1,@pdex1bc,x,t);
which is weird because the normal case works fine (that is the normal case already had convection and density dependent diffusion), I think that I am not putting the BC properly.
I must add that I have been able to show that these type of waves are solutions using another numerical software (and by changing the initial and boundary conditions is how I obtained it). So it’s just a matter of coding the initial conditions properly I think.
If you have guys have any advise I will appreciate it vey much.
I am using Matlab_R2014a and the PDE solver is pdepe. I can send you my code if needed. Many thanks in advance.
  1 Comment
Torsten
Torsten on 6 Mar 2015
Yes, it would be helpful if you include the code for the case where pdepe fails.
Best wishes
Torsten.

Sign in to comment.

Answers (0)

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!