# Building Polytropic Structure Files¶

This appendix describes the **build_poly** executable, which
builds a composite polytropic stellar model and writes it to a file in
the `POLY`

format (see the poly-format section).

## Composite Polytropes¶

A composite polytropic model comprises \(N\) regions extending from the origin out to the stellar surface. In the \(i\)’th region (\(1 \leq i \leq N\)), the density and pressure are related by the polytropic equation of state

where \(K_{i}\) and the polytropic index \(n_{i}\) are constant across the region (but may differ from one region to the next). At the \(N-1\) boundaries between adjacent regions, the pressure is required to be continuous but the density may jump.

The structure of a composite polytrope is found by integrating the composite Lane-Emden equation

in each region. Here, the independent variable is

where \(\rho_{\rm c}\) is the central density of the star. In the first region, the initial conditions are

and \(B_{1} = 1\). In the subsequent regions, the initial conditions are

where \(\xi_{i-1/2}\) is the coordinate of the boundary between the \(i-1\) and \(i\) regions; moreover,

and the recurrence for \(t_{i}\) is

with \(t_{1} = 1\) and

quantifying the density jump at \(\xi_{i-1/2}\).

The surface of the composite polytropic model, \(\xi=\xi_{\rm s}\), is defined implicitly by the boundary condition

### Pre-Requisites¶

In addition to GYRE’s general pre-requisites (see the
Installation chapter), **build_poly** needs a
thread-safe version of the ODEPACK ordinary
differential integrator library. This library is shipped with version
20.3.2 (and more recent) of the MESA SDK.

### Compiling¶

The **build_poly** executable is automatically compiled when
GYRE is built, and installed in the

directory
(see the Installation chapter).*$GYRE_DIR*/bin