Hydrostatic equilibrium in optical depth (source code)

= Hydrostatic equilibrium in optical depth
{title2=$dP/d\tau=g/\kappa$}

In a <plane-parallel atmosphere>, take the vertical coordinate $z$ positive outward, inward-increasing <optical depth> $\tau$, positive <opacity> $\kappa$ and approximately constant downward <gravitational acceleration> $g$. Then
$$
\frac{d\tau}{dz}=-\kappa\rho,\qquad
\frac{dP}{dz}=-\rho g,\qquad
\frac{dP}{d\tau}=\frac g\kappa.
$$
Thus the <hydrostatic equilibrium> equation becomes a relation between <pressure> and <optical depth>, rather than geometric height. Its integrated form is
$$
P(\tau)=P(0)+\int_0^\tau\frac{g(t)}{\kappa(t)}\,dt.
$$
If $g$ and $\kappa$ vary little, $P(\tau)\simeq P(0)+g\tau/\kappa$. The familiar $P\simeq g\tau/\kappa$ additionally neglects the external <pressure> $P(0)$. For the <Eddington surface boundary condition> at $\tau=2/3$, this gives $P_{\rm phot}\simeq2g/(3\kappa)$ under the same assumptions. A <grey atmosphere> with strongly pressure- or temperature-dependent <opacity> requires the <integral>, as in the <grey-atmosphere pressure with power-law opacity> calculation.