Boundary condition with pdepe function in spherical symmetry

Hello,
I am trying to solve a partial differential equation in Matlab thanks to pdepe function in spherical symmetry.
I am studying a system, forming a hollow sphere of cells which are diffusing. I want the cells to diffuse outside the sphere, and I need to prevent them from diffusing inside the sphere. In other words, I want to set the solution of the equation at zero inside a sphere of a certain radius.
Do you have an idea of what boundary condition could permit me to do that ?
Thanks a lot for any idea, Mo

 Accepted Answer

I found the solution of my problem, if it can help someone. It is very easy.
pdepe cannot handle internal boundray conditions. So to solve my problem, I set the terms c, f, and s of the pdefun function to zero for a radius lower than the radius of the hollow sphere. It has the form:
function [c,f,s] = pdefun(r,t,u,dudr)
r0 = 3; % radius of the hollow sphere
c = 1*(r>r0);
f = dudr*(r>r0);
s = u*(r>r0);
Hope that it will help someone.
Mo

More Answers (0)

Asked:

on 8 May 2015

Answered:

on 13 May 2015

Community Treasure Hunt

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

Start Hunting!