Adding more boundary conditions to pdepe

6 views (last 30 days)
so bcfun has the following signiture
function [pl,ql,pr,qr] = bcfun(xl,ul,xr,ur,t)
So it lets me set BCs at the left and right BCs.
My spacial domain is divided into 3 parts 0 to a, a to b, and then b to L. a, b, L are just arbitrary lengths. This means I need to have a BC at 0, a, b, and L.
So my question is that is it possible to set BCs at a and b. It is straight forward setting BCs at 0 and L but I cannot find a way to set them for the boundarys in the middle (if it is even possible)

Accepted Answer

Torsten
Torsten on 5 Feb 2023
Moved: Torsten on 5 Feb 2023
So my question is that is it possible to set BCs at a and b.
It depends what boundary conditions you want to set. If it is simply continuity of function and first derivative, you don't need to divide the region in parts. It's enough to include a and b in the mesh you supply to "pdepe". If you want to set jump conditions, it's not possible with "pdepe".
  6 Comments
Mohamad Keblawi
Mohamad Keblawi on 6 Feb 2023
Edited: Mohamad Keblawi on 6 Feb 2023
Gotcha, So if I can couple the my BCs at a and b to my left and right BCs then I'll be to put it in the pdepe bcfun. I appreiciate your help.
Torsten
Torsten on 6 Feb 2023
So if I can couple the my BCs at a and b to my left and right BCs then I'll be to put it in the pdepe bcfun. I appreiciate your help.
No.
For pdepe, you can only prescribe boundary conditions at both ends of the integration interval. You cannot put additional boundary conditions in the function bcfun.
If you want to solve problems which are somehow differently defined in two or three regions, you can nonetheless use pdepe if over the separation points, you want to prescribe continuity of the solution and the flux. In this case, you only have to include the points separating the regions in your mesh vector. Changes to bcfun don't need to be made.
If you want to prescribe more difficult transmission conditions at the points that separate two regions (e.g. jump conditions), pdepe cannot be used.

Sign in to comment.

More Answers (0)

Products


Release

R2022b

Community Treasure Hunt

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

Start Hunting!