I would like to solve an axisymmetric Poisson equation on a disk with FEM.
The code for Cartesian coordinates works fine:
NDSolve[{Laplacian[u[x, y], {x, y}, "Cartesian"] == x^2 + y^2, DirichletCondition[u[x, y] == 0, True]}, u, {x, y} \[Element] Disk[], Method -> "FiniteElement"]
But going axisymmetric (which should make equation easier) leads to error:
NDSolve[{Laplacian[u[r], {r, phi}, "Polar"] == r^2, DirichletCondition[u[r] == 0, r == 1]}, u, {r, 0, 1}, Method -> "FiniteElement"]
(* NDSolve::femcnmd: "The PDE coefficient {{1/r}} does not evaluate to a numeric matrix of dimensions {1,1}. " *)
It seems that Mathematica doesn't like 1/r
term in polar laplacian. Multiplying by r
the both sides of the equation solves the problem, but not always. Moreover, I would like to keep code free of such "patches" to be flexible to change the coordinate system without rewriting code.
What the reason of the error? Do you have any suggestion about how to solve it?