Cubic polytropic interior (source code)

= Cubic polytropic interior

The interior <Helmholtz equation> for a <polytrope of index one> also admits a positive solution vanishing on the faces of a cube:
$$
\rho(x,y,z)=\rho_c\sin\frac{\pi x}{L}\sin\frac{\pi y}{L}\sin\frac{\pi z}{L},
\qquad L^2=\frac{3\pi K}{2G}.
$$
Its central value is $\rho_c$ and its average is $\bar\rho=8\rho_c/\pi^3$. Together with $\Phi=C-2K\rho$, it solves the interior <hydrostatic equilibrium> and <Poisson equation for Newtonian gravity>. A local interior solution need not match the external field of its own mass.