Since your Dirichlet boundary conditions $A(a,\theta)=0$ is rotationally symmetric, you can solve the problem by separation of variables. Here is a way to do all the formal steps of this method in Mathematica. First I define only the left-hand side of the equation as an operator helmholtz
, and then I introduce the separation ansatz to get a new form helmholtz2
on which the separation of variables can be performed.
helmholtz =
Function[A,
D[A, {r, 2}] + D[A, r]/r + D[A, {θ, 2}]/r^2 + k^2 A];
ansatz = ar[r] aθ[θ];
helmholtz2 =
Subtract @@ Simplify[helmholtz[ansatz]/ansatz == 0, r > 0]
$$\frac{\text{a$\theta $}''(\theta )}{\text{a$\theta $}(\theta
)}+\frac{r \left(r
\text{ar}''(r)+\text{ar}'(r)\right)}{\text{ar}(r)}+k^2 r^2$$
rSolution =
DSolve[Select[helmholtz2, FreeQ[#, θ] &] == C[1]^2, ar[r], r]
$$\left\{\left\{\text{ar}(r)\to c_2 J_{c_1}(k r)+c_3 Y_{c_1}(k
r)\right\}\right\}$$
θSolution =
DSolve[Select[helmholtz2, FreeQ[#, r] &] == -C[1]^2,
aθ[θ], θ, GeneratedParameters -> B]
$$\left\{\left\{\text{a$\theta $}(\theta )\to B(2) \sin \left(c_1
\theta \right)+B(1) \cos \left(c_1 \theta \right)\right\}\right\}$$
generalSolution = ansatz /. Flatten[Join[rSolution, θSolution]]
$$\left(B(2) \sin \left(c_1 \theta \right)+B(1) \cos \left(c_1 \theta
\right)\right) \left(c_2 J_{c_1}(k r)+c_3 Y_{c_1}(k r)\right)$$
Here the undetermined coefficients are named C[1]
for the separation constant, C[2]
and C[3]
for the radial amplitudes, and B[1]
, B[2]
for the angular function. The latter is displayed a little differently in the pasted output (TeXForm
), but I need to do this because the solutions to the two separated equations must have separately named constants. This is what the GeneratedParameters
is for.
In the separation step, I used the fact that helmholtz2
was correctly simplified by Mathematica to have only terms dependent on one variable at a time. Then I use Select
to obtain the r
dependent terms and set them equal to the separation constant C[1]^2
, likewise with the angle-dependent term (equated to the negative of the same constant).
The rest is done by DSolve
.
Here I confirm that the solution is in fact correct:
FullSimplify[helmholtz[generalSolution] == 0]
(* ==> True *)
DSolve
isn't good at solving PDE, and this is just one of the PDEs it can't handle (at least now), see here for details. If your final target is to get a numeric solution, considerNDSolve
. Also, you can refer to this answer. $\endgroup$ – xzczd Apr 25 '14 at 14:36