As a test of my ability to master the Method of Lines I tried to NDSolve
the PDE's system
$$\partial_t \varphi = \varpi\qquad\partial_t\varpi=\frac{1}{r}\partial^2_r(r\varphi)-\varphi$$
in the area
$$(t,r)\in[0,1]\times[0,1] $$
along with initial-boundary conditions
$$ \varphi(0,r)=\cos(\pi r)\qquad \varpi(0,r)=\sin(\pi r)\qquad \varpi(t,1)=0 $$
The problem is mathematically well posed:
1.Boundary condition $\varpi(t,1)=0$ implies $\varphi(t,1)=const.$
2.Initial data at $r=0$ should evolve in time just as at any other point inside the sphere of radius $R=1$.
However my code
rmax = 1; tmax = 1; e = 10^-21;
s = NDSolve[{D[φ[t, r], t] == p[t, r],
D[p[t, r], t] == D[r*φ[t, r], {r, 2}]/r - φ[t, r],
p[0, r] == Sin[ π*r/rmax], φ[0, r] == Cos[ π*r/rmax],
p[t, rmax] == 0}, {p, φ}, {t, 0, tmax}, {r, e, rmax},
Method -> {"MethodOfLines",
"SpatialDiscretization" -> {"TensorProductGrid",
"MinPoints" -> 80, "MaxPoints" -> 100,
"DifferenceOrder" -> "Pseudospectral"}}];
results in the following error:
NDSolve::bcart: Warning: an insufficient number of boundary conditions have been specified for the direction of independent variable r. Artificial boundary effects may be present in the solution
How can I make Method of lines and Mathematica understand that boundary conditions are just fine?
PS: The equations above are the Klein-Gordon equations for scalar field of mass $m=1$ in hamiltonian form and assuming spherical symmetry.