# Solve dimensionless PDE in polar coordinate over a semi-circular re

I am trying to solve the following BVP in mathematica

using the following code:

    (*Define the parameters*)
center = {0, 0};
startAngle = 0;
endAngle = Pi;
parameter = 10.0;(*Change this to your desired parameter*)(*Create a \
semi-circular mesh*)semiCircleMesh =

(*Define the polar coordinates*)
r = Sqrt[x^2 + y^2];
\[Phi] = ArcTan[x, y];

(*Define the Poisson equation in polar coordinates with a parameter*)
\

\[CapitalOmega] = semiCircleMesh;
eqn = D[s[r, \[Phi]], {r, 2}] + (1/r) D[
s[r, \[Phi]], {r, 1}] + (1/r^2) D[s[r, \[Phi]], {\[Phi], 2}] ==
parameter^2*s[r, \[Phi]];

(*Define boundary conditions*)
boundaryCondition = {DirichletCondition[s[r, \[Phi]] == 0, True]};

(*Solve the polar PDE*)
sol = NDSolve[{eqn, boundaryCondition},
s, {r, \[Phi]} \[Element] \[CapitalOmega]];

(*Visualize the solution*)
ContourPlot[
Evaluate[s[r, \[Phi]] /.
sol], {r, \[Phi]} \[Element] \[CapitalOmega], AspectRatio -> 1,
Contours -> 20, ColorFunction -> "Potential",
PlotLegends -> Automatic, Axes -> True, AxesLabel -> {"r", "\[Phi]"}]


But I am confused how to define these four boundary condition and How to use FEM NDSolve for this problem?

in V 13.3.1

ClearAll["Global*"];
k = 10;
pde = Laplacian[u[r, θ], {r, θ}, "Polar"] == k^2*u[r, θ];
bc = u[1, θ] == 1;
sol = NDSolveValue[{pde, bc}, u, {r, 0, 1}, {θ, 0, Pi}]


ParametricPlot3D[{r Cos[θ], r Sin[θ], sol[r, θ]}, {r, 0, 1}, {θ, 0, Pi}]


Neumann B.C. already build in by default so no need to specify.

Trying to draw a contour plot over a semi-circular region

ContourPlot[sol[Sqrt[x^2 + y^2], ArcTan[x, y]], {x, -1, 1}, {y, 0, 1},
Contours -> 50, ColorFunction -> "Pastel",
AspectRatio -> Automatic,PlotLegends->Automatic]


ps. I tried ColorFunction -> "Potential"` you used but that was not accepted, saying it could not find it.

• Trying to get a contour plot of the solution over a semicircular region. Could you please help?? Sep 22 at 17:04