From: Jeremy Teo on
Hi Rachael,

I'm also trying to simulate diffusive point sources in a 2D rectangular domain. Was wondering if you have settled your queries, would very much like to ask your advice on this. I've never use Matlab for simulations before.

Jeremy

"Rachael " <seestuffgo(a)gmail.com> wrote in message <gq0ab0$ci6$1(a)fred.mathworks.com>...
> Hi Torsten,
>
> Thanks very much for your answer. I can see why the symmetric condition is required.
>
> I am wondering if there is any way I can still impose this boundary condition in matlab. I am dealing with a point source of diffusing compound at r=0 that is not depleted over time (thus C = 1). Obviously this is a theoretical condition, but it is applied in a variety of problems in my field.
>
> I suppose the actual boundary condition is that C = 1 from 0<r<ic at all times. I am trying to think of a way to incorporate this into an if statement in the equation definition but no success yet. I suppose I could come up with PDE that changes slowly over the distance and constrains C = 1 at r = ic, but that seems like a poor fix.
>
> Any suggestions?
> Rachael
>
>
>
> Let du/dt = 0 for the finite radius:
>
>
> function [c,f,s ] = eq_PDEbb (r,t,u,dudr)
> if r<ic
> c = 1;
> f = 0;
> s = 0;
> else
> c = 1;
> f = D*dudr;
> s = 0;
> end
> end
>
> runs and fixes the left border to 1, but still doesn't fix the border I care about (at r = ic) to 1.
>
> let du/dx = 0 for r<ic
>
> function [c,f,s ] = eq_PDEbb (r,t,u,dudr)
> if r<ic
> c = 0;
> f = 1;
> s = 0;
> else
> c = 1;
> f = D*dudr;
> s = 0;
> end
> end
>
> doesn't run for obvious reasons
>
> > In cylindrical or spherical coordinates, the boundary
> > condition at r=0 always has to be the symmetric one:
> > du/dr = 0. All other boundary conditions do not make
> > sense because at r=0, there is no area
> > over which a substance could diffuse into the domain.
> >
> > Best wishes
> > Torsten.