From: thaihang le on
Dear all,

I have a PDE in cylindrical coordinate but i cant imply the boundary
condition :
In the text book, i have this equation :

eqn = D[u[r,z],{z,2}]+D[u[r,z],{r,2}+D[u[r,z],{r,1}]*1/r == 0

b1 = ( D[u[r,z],{z,1}]/.z->0 ) ==0
b2 = ( D[u[r,z],{r,1}]/.r->10^-5 ) ==0
b3= u[r,2]==1
b4 =u[2,z] ==1

NDSolve[{eqn,b1,b2,b3,b4},u,{r,0,2},{z,0,2}] ==> Error : u[2,z]==1 is
not specified on single edge

and i dont use b4 :
NDSolve[{eqn,b1,b2,b3},u,{r,0,2},{z,0,2}] ===> Error : Number of
constraint (1) is not equal total diff (2).

I cant find the solution ....

==================================================================================

In fact, i want to find the solution of this problem, using NDSolve.
The problem is stated in this demonstration :
http://demonstrations.wolfram.com/ScanningElectrochemicalMicroscopyDiffusionOnAMicrodiskElectr/


Thanks for your help !

From: schochet123 on
The reason for the message about a condition
"not specified on single edge" is that
the boundary condition b2 is not given on
an edge of the domain. The fact that
condition b3 is mentioned in the error message
instead of b2 seems to be a bug in the error handling code.

However, if you change the domain to {r,10^{-5),1} you will discover
the sad fact that NDSolve does not handle pure multidimensional boundary
value problems, only initial boundary value problems. You will therefore
have to code it yourself or look for a person or a Package that has
already done so. Note that the demonstration you cite uses an exact formula
from some book, although they claim, without providing code that NDSolve
obtains their solution, which is hard to tell since their boundary conditions
seem either garbled or incomplete.

Steve

On Jun 21, 9:10 am, thaihang le <thaihang...(a)gmail.com> wrote:
>
> eqn = D[u[r,z],{z,2}]+D[u[r,z],{r,2}+D[u[r,z],{r,1}]*1/r == 0
>
> b1 = ( D[u[r,z],{z,1}]/.z->0 ) ==0
> b2 = ( D[u[r,z],{r,1}]/.r->10^-5 ) ==0
> b3= u[r,2]==1
> b4 =u[2,z] ==1
>
> NDSolve[{eqn,b1,b2,b3,b4},u,{r,0,2},{z,0,2}] ==> Error : u[2,z]===
1 is
> not specified on single edge
>
> and i dont use b4 :
> NDSolve[{eqn,b1,b2,b3},u,{r,0,2},{z,0,2}] ===> Error : Number of
> constraint (1) is not equal total diff (2).
>

From: Oliver Ruebenkoenig on

Hi,

On Mon, 21 Jun 2010, schochet123 wrote:

> The reason for the message about a condition
> "not specified on single edge" is that
> the boundary condition b2 is not given on
> an edge of the domain. The fact that
> condition b3 is mentioned in the error message
> instead of b2 seems to be a bug in the error handling code.
>
> However, if you change the domain to {r,10^{-5),1} you will discover
> the sad fact that NDSolve does not handle pure multidimensional boundary
> value problems, only initial boundary value problems. You will therefore
> have to code it yourself or look for a person or a Package that has
> already done so. Note that the demonstration you cite uses an exact formula

http://library.wolfram.com/infocenter/Conferences/7549/

Perhaps this helps,

Oliver

> from some book, although they claim, without providing code that NDSolve
> obtains their solution, which is hard to tell since their boundary conditions
> seem either garbled or incomplete.
>
> Steve
>
> On Jun 21, 9:10 am, thaihang le <thaihang...(a)gmail.com> wrote:
>>
>> eqn = D[u[r,z],{z,2}]+D[u[r,z],{r,2}+D[u[r,z],{r,1}]*1/r == 0
>>
>> b1 = ( D[u[r,z],{z,1}]/.z->0 ) ==0
>> b2 = ( D[u[r,z],{r,1}]/.r->10^-5 ) ==0
>> b3= u[r,2]==1
>> b4 =u[2,z] ==1
>>
>> NDSolve[{eqn,b1,b2,b3,b4},u,{r,0,2},{z,0,2}] ==> Error : u[2,z]===
> 1 is
>> not specified on single edge
>>
>> and i dont use b4 :
>> NDSolve[{eqn,b1,b2,b3},u,{r,0,2},{z,0,2}] ===> Error : Number of
>> constraint (1) is not equal total diff (2).
>>
>
>

From: thaihang le on
Dear Steve,

Thank you for your great help.

With your answer, no i understand. Solving PDE is not as simple
although we know the equation and boundary. The most important is how
to imply it in Mathematica.

Mathematica uses Method of lines and solve very well simple PDE. But
as my problem, the boundary condition is split in two domains :

At z= 0 :
When r < 1 : The dirichlet boundary is used : u[r,z] =0
When r > 1 : the Neumann is used : D[u[r,z],{r,1}] = 0

That's why i dont know how to imply this in Mathematica. For example,
if the boundary is the same like this :

r < 1 : u[r,z]=0
r> 1 : u[r,z] =1

I can imply in Mathematica as : z=0 : u[r,0] == If[r > 1, 1, 0].

Thanks again Steve.
I try to go by another approach.

From: schochet123 on
Please note the recent message with Subject: Help me : Solve a simple
PDE in Mathematica
by Oliver Ruebenkoenig from Wolfram
who points out his Package available at
http://library.wolfram.com/infocenter/Conferences/7549/

It uses a finite element method to discretize multi-dimensional pure
boundary value problems and then solves the resulting system of linear
equations

This will probably solve your problem.

It can also solve time-dependent problems by using NDSolve on the
discretized system.

Very nice job, Oliver

Steve

On Jun 22, 2:02 pm, thaihang le <thaihang...(a)gmail.com> wrote:
> Dear Steve,
>
> Thank you for your great help.
>
> With your answer, no i understand. Solving PDE is not as simple
> although we know the equation and boundary. The most important is how
> to imply it in Mathematica.
>
> Mathematica uses Method of lines and solve very well simple PDE. But
> as my problem, the boundary condition is split in two domains :
>
> At z= 0 :
> When r < 1 : The dirichlet boundary is used : u[r,z] =0
> When r > 1 : the Neumann is used : D[u[r,z],{r,1}] = 0
>
> That's why i dont know how to imply this in Mathematica. For example,
> if the boundary is the same like this :
>
> r < 1 : u[r,z]=0
> r> 1 : u[r,z] =1
>
> I can imply in Mathematica as : z=0 : u[r,0] == If[r > 1, 1, 0].
>
> Thanks again Steve.
> I try to go by another approach.