I need to solve a PDE where one of the variables is an angle, so I need to know how to deal with periodic boundary conditions.
As a warm up, I am trying to solve the Helmholtz equation in polar coordinates, where the solutions should be Bessel functions multiplied by complex exponentials.
I tried the following code:
NDSolve[{x D[u[x, t], x] + x^2 D[u[x, t], x, x] + D[u[x, t], t, t] + x^2 u[x, t] == 0, u[b, t] == 1, (D [u[x, t], x] /. x -> b) == 0.5, u[x, 0] == u[x, 2 Pi], (D[u[x, t], t] /. t -> 0) == (D[u[x, t], t] /. t -> 2 Pi)}, u[x, t], {x, b, 100}, {t, 0, 2*Pi}]
where i have set b=0.0001 because setting b=0 gives rise to singularities for some reason. One solution to this equation is BesselJ[0,x] + BesselJ[1,x], but it is not the only one: adding any combination of higher order Bessel functions one gets infinite other solutions.
The weird thing is that I noticed, by plotting the result, that Mathematica is giving me only BesselJ[0,x] as the solution! Anyone knows what might be happening?
u[b, t] == 1
guarantees that there is no azimuthal dependence, which in turn allows onlyBesselJ[0, x]
as a solution. Also, Bessel's equation is singular atx == 0
, andb > 0
is necessary to avoid it. $\endgroup$