Solution Method

Specification

The structure of a composite polytrope is specified completely by

  • a set of \(\nreg\) polytropic indices \(n_{i}\)

  • a set of \(\nreg-1\) boundary coordinates \(z_{i+1/2}\)

  • a set of \(\nreg-1\) density jumps \(\Delta_{i+1/2} \equiv \ln [\rho_{i+1}(z_{i+1/2})/\rho_{i}(z_{i+1/2})]\)

Although the normalizing densities \(\rho_{i,0}\) have so far been left unspecified, it’s convenient to choose them as the density at the beginning of their respective regions.

Solution

The structure equations may be solved as an initial value problem. In the first region (\(i=1\)) this IVP involves integrating the Lane-Emden equation 31 from the center \(z=0\) to the first boundary \(z=z_{3/2}\), with the initial conditions

\[\begin{split}\left. \begin{gathered} \theta_{i} = 1, \\ \theta'_{i} = 0, \\ B_{1} = 1, \\ t_{1} = 1 \end{gathered} \right\} \quad \text{at}\ z=0\end{split}\]

(here, \(t_{i} \equiv \rho_{i,0}/\rho_{1,0}\)).

The IVP in the intermediate regions (\(i = 2,\ldots,\nreg-1\)) involves integrating from \(z=z_{i-1/2}\) to \(z=z_{i+1/2}\), with initial conditions established from the preceding region via

\[\begin{split}\left. \begin{aligned} \theta_{i} &= 1, \\ \ln t_{i} &= \ln t_{i-1} + n_{i-1} \ln \theta_{i-1} - n_{i} \ln \theta_{i} + \Delta_{i-1/2}, \\ B_{i} &= \frac{n_{i-1} + 1}{n_{i} + 1} \frac{\theta_{i}^{n_{i}+1}}{\theta_{i-1}^{n_{i-1}+1}} \frac{t_{i}^{2}}{t_{i-1}^{2}} \, B_{i-1}, \\ \theta'_{i} &= \frac{B_{i}}{B_{i-1}} \frac{t_{i-1}}{t_{i}} \, \theta'_{i-1}. \end{aligned} \right\} \quad \text{at}\ z=z_{i-1/2}\end{split}\]

The IVP in the final region (\(i=\nreg\)) involves integrating from \(z_{\nreg-1/2}\) until \(\theta_{\nreg} = 0\). This point defines the stellar surface, \(z=z_{\rm s}\). For some choices of \(n_{i}\), \(z_{i+1/2}\) and/or \(\Delta_{i+1/2}\), the point \(\theta=0\) can arise in an earlier region \(i = \nreg_{\rm t} < \nreg\); in such cases, the model specification must be truncated to \(\nreg_{\rm t}\) regions.

Output Grid

The solution is recorded at a sequence of points \(z_{j}\), whose spacing is set by two parameters: a uniform spacing \(\Delta z\) and a logarithmic spacing \(\Delta \ln z\) (respectively, the --dz and --dlnz options of build_poly). Successive points are separated by

\[z_{j+1} - z_{j} = \max(\Delta z, \Delta \ln z \, z_{j}),\]

so the points are uniformly spaced near the center, and uniformly spaced in \(\ln z\) beyond \(z = \Delta z/\Delta \ln z\). Each region boundary \(z_{i+1/2}\) and the surface \(z_{\rm s}\) is also recorded, with a double point at each boundary.

The logarithmic spacing matters for strongly condensed models. Because \(z\) is scaled to the first region, a large negative density jump \(\Delta_{i+1/2}\) makes the outer regions extend to very large \(z\) (for a red-giant-like model with a small, dense core, \(z_{\rm s}\) can be thousands of times \(z_{3/2}\)). With uniform spacing alone, resolving the core then requires an enormous number of points in the envelope; logarithmic spacing keeps the point count manageable while every point remains an exact solution of the Lane-Emden equation. The default \(\Delta \ln z = 0\) gives uniform spacing everywhere.