# Equations of State for the TOV equations¶

## Background¶

In the simplest models, neutron stars consist only of neutrons, protons, and electrons at \(T=0\). The thermodynamic identity is

where \(P\) is the pressure, \(\varepsilon\) is the energy density, \(n_i\) is the number density of particle \(i\), and \(\mu_i\) is the chemical potential of particle \(i\). Presuming charge neutrality, \(n_p=n_e\) and beta-equilibrium, \(\mu_n=\mu_p+\mu_e\), this simplifies to

where the baryon density is \(n_B \equiv n_n+n_p\) and the baryon chemical potential is \(\mu_B \equiv \mu_n\). Thus, in this simple model, the thermodynamic properties of neutron star matter behave as if matter only has one component. Given the relationship between energy density and baryon density, one can obtain the baryon chemical potential and the pressure directly

The speed of sound is

where \(\mathrm{comp}\) indicates that the derivative is to be performed at fixed composition (e.g. a fixed ratio between the neutron, proton, and electron densities).

## Class infrastructure¶

The TOV solver requires the EOS to be specified as an object of type eos_tov. The documentation of this parent class contains more information. The class eos_tov_interp is used most frequently. It uses linear interpolation to interpolate a user-specified table object. A faster lower-level EOS interpolation is performed by eos_tov_vectors. The Buchdahl EOS is given in eos_tov_buchdahl, a single polytrope EOS is given in eos_tov_polytrope, a linear EOS is given in eos_tov_linear, and an EOS with a polynomial form for the speed of sound is given in eos_cs2_poly

## From pressure and energy density¶

Given a relationship between pressure and energy density in beta-equilibrium, one can obtain the baryon density and the baryon chemical potential up to a constant. To see this, start with the thermodynamic identity

Then, expressing the pressure in terms of the energy density

Now we integrate, to get

where \(C\) is an undetermined constant. If we create a new integration variable for the energy density and presume that \(\varepsilon_1 \equiv \varepsilon(n_B = n_{B,1})\), then we can fix \(C\)

Going back to the original thermodynamic identity, we can also write

to obtain (similar to the method above)

and thus if \(P_1=P(\mu_B=\mu_{B,1})\):

At low densities, if one assumes the low-density equation of state made of an ideal gas of nuclei, then at \(P=0\), \(\mu_{B}\) is about 931 MeV (approximately the atomic mass unit, \(m_u\)). Then we get