Solution (source code)

= Solution

<Hydrostatic balance> is $dP/dr=-GM(r)\rho/r^2$. A free-fall estimate gives $t_{\mathrm{dyn}}\sim\sqrt{R_\odot^3/(GM_\odot)}\simeq1.6\times10^3$ s; a <test particle> falling in a fixed point-mass field adds factor $\pi/(2\sqrt2)$, giving about 30 minutes.

For an ideal nonrelativistic gas with negligible boundary <pressure>, the <virial theorem> is $2U+\Omega=0$, so total <energy> is $\Omega/2$. Since $\Omega=-\int_0^M Gm\,dm/r(m)$ and $r\leq R$, $|\Omega|\geq GM^2/(2R)$. This is a \i[minimum magnitude], not a <lower bound> on the negative <energy>: unrestricted central concentration can make the latter arbitrarily negative. A uniform-density estimate gives $\Omega=-3GM^2/(5R)$ and available contraction <energy> $3GM^2/(10R)$. Its release at present solar <luminosity> lasts $\boxed{t\sim10^7\ \mathrm{yr}}$ (order $10^7$–$10^8$ years for alternative structural estimates), much less than a nuclear-burning lifetime.