I worked with/helped develop a TOV solver (which is a code in C) that makes model neutron stars (i.e. given a starting central density, outputs the properties of the resulting star). We're most interested in the masses and radii of these stars.
There were two types of equations of state: analytic and tabular. The analytic equation of state was given by the Tolman-Oppenheimer-Volkoff (TOV) equation:
It looks really scary... but luckily the program solved it, so I didn't have to :] The equation basically describes a spherically symmetric, isotropic star in static gravitational equilibrium.
The other equations of state came in the form of density-pressure tables from different researchers in the field. I wrote a function that interpolated the pressure-density relationship so that the code could use it instead of the TOV equation to create a model neutron star.
I also had to look at the constraints for the mass-radius plot.
Minimum Maximal Mass Constraint
The first constraint is based on the observation of a 2 solar-mass neutron star. Any equation of
state that does not predict a mass that reaches two solar masses is disproved by obesrvation.
General Relativity Constraint
The GR constraint requires R > 2GM/c2 because neutron stars must have a radius that
is greater than the Schwarzschild Radius. Any proposed neutron star with a radius below
the threshold would in reality be a black hole.
Finite Pressure Constraint
The finite pressure constraint, according to Lattimer and Prakash (2007) , requires
R >(9/4)GM/c2.
Causality Constraint
To obtain the causal constraint, we recreated the procedures of Koranda et al. (1997) ,
and Lattimer and Prakash (2007). To avoid a supraluminous equation of state in which
the speed of sound is faster than the speed of light, it is necessary that
.
Rotational Constraint
For a fully relativistic star, the rotational limit can be expressed as
The final mass-radius plot that includes all of the EOS that I worked with looked like this: