Note
Go to the end to download the full example code.
Faraday’s polarized dielectric: bound charge in a sphere, and its magnetic twin#
Faraday’s picture of a dielectric (1837) was a material whose particles become small dipoles in an applied field. Mossotti (1850) and Clausius (1879) made it quantitative. The dipoles add up to a polarization \(\mathbf P\), which acts like a bound charge \(\rho_b = -\nabla\cdot\mathbf P\) that partly screens the applied field. A sphere of permittivity \(\varepsilon_r\) in a uniform field \(E_0\) is the classic case (Griffiths Example 4.7). Its interior field is uniform and reduced,
and outside it adds the field of a point dipole \(p = 4\pi\varepsilon_0 a^3\,\frac{\varepsilon_r - 1}{\varepsilon_r + 2}\,E_0\). The local field the Clausius–Mossotti relation rests on is this same \((\varepsilon_r + 2)/3\) factor.
The magnetic counterpart is a uniformly magnetized sphere (Griffiths Example 6.1). Its bound “magnetic charge” \(\nabla\cdot\mathbf M\) on the surface gives a uniform interior \(\mathbf H = -\mathbf M/3\), so \(\mathbf B = \tfrac23\mu_0\mathbf M\).
Here solve_poisson_dielectric(),
bound_charge_density() and
magnetized_body_field() reproduce all three.
A dielectric sphere in a uniform field#
The box faces hold the exact exterior potential, and the grid solves for everything inside.
E0, a, eps_r = 1.0, 0.5, 4.0
x = np.linspace(-1, 1, 49)
h = x[1] - x[0]
X, Y, Z = np.meshgrid(x, x, x, indexing="ij")
r = np.sqrt(X**2 + Y**2 + Z**2)
eps = np.where(r < a, eps_r, 1.0)
K = (eps_r - 1) / (eps_r + 2)
phi0 = -E0 * Z + K * E0 * a**3 * Z / np.maximum(r, 1e-12) ** 3
sol = solve_poisson_dielectric(np.zeros_like(X), eps, h, phi0=phi0, tol=1e-10)
E = electric_field_from_potential(sol.phi, h)
inside = r < 0.35
E_in = np.mean(E[2][inside])
rho_b = bound_charge_density(sol.phi, eps, h)
p = np.sum(Z * rho_b) * h**3
p_exact = 4 * np.pi * EPS0 * a**3 * K * E0
print(f"interior E_z = {E_in:.4f}, 3 E0/(eps_r + 2) = {3 * E0 / (eps_r + 2):.4f}")
print(f"bound-charge dipole p = {p:.4e} C m, closed form {p_exact:.4e}")
interior E_z = 0.5054, 3 E0/(eps_r + 2) = 0.5000
bound-charge dipole p = 7.2581e-12 C m, closed form 6.9541e-12
A uniformly magnetized sphere#
xm = np.linspace(-1, 1, 65)
hm = xm[1] - xm[0]
Xm, Ym, Zm = np.meshgrid(xm, xm, xm, indexing="ij")
rm = np.sqrt(Xm**2 + Ym**2 + Zm**2)
M0, R = 1e5, 0.3
M = np.zeros((3, *Xm.shape))
M[2] = np.where(rm < R, M0, 0.0)
B, H = magnetized_body_field(M, hm)
inside_m = rm < 0.2
B_in = np.mean(B[2][inside_m])
H_in = np.mean(H[2][inside_m])
print(f"interior B_z / (mu0 M) = {B_in / (MU0 * M0):.4f} (2/3), H_z / M = {H_in / M0:.4f} (-1/3)")
fig, axes = plt.subplots(1, 3, figsize=(15, 4.5))
k = len(x) // 2
axes[0].imshow(rho_b[:, k, :].T, origin="lower", extent=[-1, 1, -1, 1], cmap="RdBu_r")
axes[0].add_patch(plt.Circle((0, 0), a, fill=False, color="k", ls="--"))
axes[0].set_title(r"bound charge $\rho_b = -\nabla\cdot P$ (y = 0)")
axes[1].plot(x, E[2][k, k, :], "o", ms=4, label=r"grid $E_z$ on the z axis")
Ez_exact = np.where(np.abs(x) < a, 3 * E0 / (eps_r + 2), E0 * (1 + 2 * K * a**3 / np.maximum(np.abs(x), 1e-12) ** 3))
axes[1].plot(x, Ez_exact, "k-", label="Griffiths Ex. 4.7")
axes[1].set_xlabel("z")
axes[1].set_title(rf"dielectric sphere, $\varepsilon_r = {eps_r:g}$")
axes[1].legend(fontsize=8)
km = len(xm) // 2
axes[2].plot(xm, B[2][km, km, :] / (MU0 * M0), "o", ms=4, label=r"$B_z/\mu_0M$")
axes[2].plot(xm, H[2][km, km, :] / M0, "s", ms=4, label=r"$H_z/M$")
axes[2].axhline(2 / 3, color="k", ls=":")
axes[2].axhline(-1 / 3, color="k", ls=":")
axes[2].set_xlabel("z")
axes[2].set_title("magnetized sphere")
axes[2].legend(fontsize=8)
fig.tight_layout()
plt.show()

interior B_z / (mu0 M) = 0.6728 (2/3), H_z / M = -0.3272 (-1/3)
Check#
Interior field 3 E0/(eps_r + 2); the bound charge is neutral and carries the closed-form dipole; the magnetized sphere has B = (2/3) mu0 M and H = -M/3 inside.
Total running time of the script: (0 minutes 0.341 seconds)