Match a harmonic in an empty outer shell
At the surface of a source-containing sphere of radius \(a\) prescribe \(V(a,\theta)=V_a\cos\theta\). Outside this sphere there is no charge. Insert \(V=f(r)\cos\theta\) in Laplace's equation. The angular Laplacian supplies the eigenvalue \(-2\), so \((r^2 f')'-2f=0\). A power-law trial gives
Decay at infinity removes the growing term and the open-space reference is \(f_\infty=V_a(a/r)^2\).
Terminate the calculation at \(R\) and ground the artificial wall. The two boundary equations instead give
A well-converged interior solve can reproduce this answer perfectly while retaining a systematic exterior-domain bias. An alternative boundary condition is \(f'(R)+2f(R)/R=0\). It admits the decaying dipole and annihilates the unwanted growing coefficient. A single local coefficient matches one spherical-harmonic order exactly.
Estimate the error before refining the mesh
At \(r=2a\) with \(R=5a\), the grounded boundary gives
The amplitude error is about minus 5.65 percent. At a fixed observation radius, the leading bias decreases with the inverse cube of \(R\). Refining the interior grid at fixed \(R\) cannot remove it. Compare a second-order radial difference solution with both analytic curves to measure the two errors independently.
To see what the linear solver actually controls, put a uniform grid on \(r/a\). Approximate the outgoing flux \(r^2 f'\) at the right face by \(r_{i+1/2}^2(f_{i+1}-f_i)/h\) and form the same quantity at the left face. Subtract the fluxes, divide by \(h\) and equate to \(2f_i\). The resulting tridiagonal system has positive diagonal \(2+(r_{i+1/2}^2+r_{i-1/2}^2)/h^2\). Move the known inner and outer boundary terms to the right-hand side. For the grounded wall the outer contribution is zero; the inner value is the amplitude unit.
At \(r/a=2\) the open-domain amplitude is 0.2500. The grounded reference gives 0.2359 when \(R/a=5\). Repeating at \(R/a=10\) raises that prediction to 0.24825. Keep the physical grid spacing fixed when making this domain comparison. If the cell count stays fixed, increasing the radius also coarsens the mesh, and the two effects can mask each other. The first figure supplies both analytical references needed to separate them.
Open full-size diagram
Open full-size diagramExercise · size the exterior shell
For a probe at \(2a\), require an error below one percent. What radius is needed?
Work through the solution
The exact relative bias magnitude is \(7/[(R/a)^3-1]\). Hence \((R/a)^3>701\) or \(R/a>8.883\). A value of nine satisfies the condition before numerical discretisation is considered.
Exercise · change the angular dependence
What Robin coefficient would match a pure exterior quadrupole?
Work through the solution
A decaying multipole of order \(\ell\) behaves as \(r^{-(\ell+1)}\). Its logarithmic slope at \(R\) is \(-(\ell+1)/R\), so the quadrupole needs \(3/R\). A superposition of orders requires angular information or an exterior operator that acts differently on each mode.
Try it · Open domain
Change the inputs and compare the recalculated curves with the preceding derivation and baseline figure. The axes give the units; the numerical readout states the model assumptions and any limiting cases. Reset the inputs to return to the reference setting.
Download the corresponding editable notebook. The browser recalculates the reduced equations directly; the notebook exposes the full calculation and its checks.