# solving wave equation in polar

I want to solve the wave equation under polar coordinates.This is my code:

NDSolveValue[
{
(Derivative[0,2,0][ϕ][r,θ,t]/r
+ Derivative[1,0,0][ϕ][r,θ,t])/r
+ Derivative[2,0,0][ϕ][r,θ,t]
== Derivative[0,0,2][ϕ][r,θ,t],
ϕ[10,θ,t] == 0,
Derivative[0,0,1][ϕ][r,θ,0] == 0,
ϕ[r,θ,0] == Exp[-5*r^2]
},
ϕ[r,θ,t],
{r,0,10},
{θ,0,2*Pi},
{t,0,50}
]


But this is returning error that infinite expression 1/0 encountered.What is the way out?

• Actually the mathematica code got this form after copy pasting,i dont know how to change it to that form. – user157588 May 13 '18 at 9:37
• What did you expect to happen at $r=0$? If you ask for a solution for $2\leq r\leq 10$, you get some more useful warning and solutions – Lukas Lang May 13 '18 at 9:43
• And regarding the formatting of the code: In this case, InputForm[Hold[…]] gives you something that is more readable as plain text – Lukas Lang May 13 '18 at 9:46
• I'm missing boundary conditions here. What's supposed to happen at r = 0? Where is the periodic boundary condition for theta? Also, strictly speaking your initial condition is in conflict with your BC at r==10. – Sjoerd Smit May 14 '18 at 13:04

Here is a work around. I am not sure why it fails in polar, but changing the PDE to use Cartesian coordinates works.

ClearAll[x, y, r, t];
region = Disk[{0, 0}, 10];
r = Sqrt[x^2 + y^2];
pde = D[u[x, y, t], {t, 2}] == Laplacian[u[x, y, t], {x, y}];
ic  = {u[x, y, 0] == Exp[-5*r^2], Derivative[0, 0, 1][u][x, y, 0] == 0};
bc  = DirichletCondition[u[x, y, t] == 0, r == 10];

solM2 = NDSolveValue[{pde, bc, ic}, u, {t, 0, 5}, Element[{x, y}, region]];


The animation code is

framesNDSolveM2 = Table[
Grid[{{Row[{"time = ", t}]},
{Plot3D[solM2[x, y, t],
Element[{x, y}, solM2["ElementMesh"]],
PlotRange -> {-0.5, 0.5},
Boxed -> True, Axes -> True,
Mesh -> 20,
ImageSize -> 300,
ViewPoint -> {2.17, -2.4, 1},
BoxRatios -> {1, 1, 1}]
}}
], {t, 0, 5, .01}];


Now

Manipulate[
framesNDSolveM2[[i]],
{{i, 1, "time"}, 1, Length[framesNDSolveM2], 1}
]