I need to solve a 2D linear elliptical equation in polar coordinates using NDSolve, but I can’t seem to get Mathematica to accept the required periodic boundary conditions. My actual differential equation has complicated coefficients, but the same problem appears if I try to solve the Laplace equation, as indicated below. What am I doing wrong?
s=NDSolve[{r^2*D[V[r,phi],r,r]+r*D[V[r,phi],r]+D[V[r,phi],phi,phi]==0,V[1,phi]==0,
V[2,phi]==Sin[phi],V[r,2*Pi]==V[r,0],Derivative[0,1][V][r,2*Pi]
==Derivative[0,1][V][r,0]},V,{r,1,2},{phi,0,2*Pi}]
(* NDSolve[{(V^(0,2))[r,phi]+r (V^(1,0))[r,phi]+r^2 (V^(2,0))[r,phi]==0,V[1,phi]==0,
V[2,phi]==Sin[phi],V[r,2 π]==V[r,0],(V^(0,1))[r,2 π]
==(V^(0,1))[r,0]},V,{r,1,2},{phi,0,2 π}] *)
Evaluate[V[1.5,2]/.s]
This last line yields
ReplaceAll::reps: {NDSolve[{(V^(0,2))[r,phi]+r (V^(1,0))[r,phi]+r^2 (V^(2,0))[r,phi]==0,V[1,phi]==0,V[2,phi]==Sin[phi],V[r,2 π]==V[r,0],(V^(0,1))[r,2 π]==(V^(0,1))[r,0]},V,{r,1,2},{phi,0,2 π}]} is neither a list of replacement rules nor a valid dispatch table, and so cannot be used for replacing. >>
(* V[1.5,2]/. NDSolve[{(V^(0,2))[r,phi]+r (V^(1,0))[r,phi]+r^2 (V^(2,0))[r,phi]==0,
V[1,phi]==0,V[2,phi]==Sin[phi],V[r,2 π]==V[r,0],(V^(0,1))[r,2 π]==
(V^(0,1))[r,0]},V,{r,1,2},{phi,0,2 π}] *)
{}
button above the edit window. The edit window help button?
is also useful for learning how to format your questions and answers. Also, it's better without the In/Out tags (many put comment signs(*
,*)
around the output). That makes it easier for those who might help you to copy the code into Mathematica. The easier it is, the more likely they will try. $\endgroup$FiniteElementMethod
, as described here. $\endgroup$