A static star has two unknown radial profiles: the mass inside each sphere and the pressure at that sphere. The equation of state connects pressure to the energy density that gravitates.
Mass inside a sphere
Use circumferential radius r, defined by the circumference of a great circle on each shell. In a static spherical metric choose the radial factor (1−2m/r)−1. This defines the mass function. The time factor is e2ϕ(r). We work in geometrical units with G=c=1.
The time-time Einstein equation relates the change of mass to local energy density. The coordinate shell factor appears because this is the mass in the metric, not the sum of the baryon rest masses in proper volume.
drdm=4πr2ε
Pressure and energy density both have units of inverse square kilometers in the geometric-prefactor convention.
The radial Einstein equation sets the gradient of the time factor. Conservation of the perfect-fluid stress-energy tensor gives dP/dr=−(ε+P)dϕ/dr. The pressure falls outward because the lapse increases outward. Substituting the gradient gives the TOV equation.
With small pressure and weak gravity the pressure equation becomes dP/dr≃−ρGm/r2 in ordinary units. Deep in a compact star, pressure appears both in the fluid inertia and in the gravity term.
drdϕ=r(r−2m)m+4πr3P
The mass inside the shell and its pressure determine the time gradient.
drdP=−(ε+P)r(r−2m)m+4πr3P
This equation assumes a static, spherical perfect fluid with isotropic pressure.
Select a central pressure. Close to the center, m≃4πεcr3/3 supplies the regular starting condition. The pressure starts flat. Follow it down until it vanishes. That sets the circumferential radius and the total gravitational mass. Match the lapse there to the vacuum Schwarzschild metric.
Take our SLy fit at 1.4 solar masses and 11.706 km. The solar gravitational radius is 1.476625 km, so the star’s compactness is about 0.1766. The redshift is about 0.243. A photon emitted at the surface with an energy of 1 keV would arrive far away with about 0.804 keV under this static model.
1+z=(1−Rc22GM)−1/2
This compares proper clocks at the stationary stellar surface and far away from the star.