1

I'm creating a numerical integration model of a white dwarf. So I've started with calculating electron pressure vs number density across a wide range of values.

Using the equations of state in Lagrangian form, $$\frac{\mathrm{d}r}{\mathrm{d}m}=\frac{1}{4\pi r^2\rho},\quad\frac{\mathrm{d}P}{\mathrm{d}m}=-\frac{Gm}{4\pi r^4}$$

I'm starting with a set value for the centre density, then going shell by shell integrating with step size $\mathrm{d}m$ (such as in the photo below) and calculating radius, density and pressure.

enter image description here

My question is: How do I treat this mathematically? For example, for the first equation, moving $r^2 \mathrm{d}r$ to the left side and the rest to the right, and then integrating both sides. Do I integrate from 0 to $\mathrm{d}m$ for the first shell on both sides? I'm just not sure how to treat $\mathrm{d}m$ since in a way it's a constant.

I've been trying to find a single example of someone using numbers or even doing something similar online, to understand how to treat $\mathrm{d}m$ in this situation, but to no avail.

I'm planning on coding this in Python, so bonus points if you have any great functions/packages as well.

Kyle Kanos
  • 28,229
  • 41
  • 68
  • 131

1 Answers1

1

Conceptually:

Start with a central density and calculate the central pressure (you need a third equation - the equation of state to connect pressure and density).

Then add a shell of mass $dm$ and hence calculate the mass interior to the shell boundary. The $dr/dm$ equation then tells you what this corresponds to in terms of a step in radius. For the first shell you could use $$ dm \simeq 4\pi r^3 \rho_c/3\ . $$

The $dP/dm$ equation tells you by how much the pressure has changed and this must be put into the equation of state to determine what the new density is at the next shell.

Stop the integration once the pressure reaches zero. At this point you have the total mass and radius of your star.

Of course there are nuances connected with how you approximate the average value of density across the shell, rather than taking the value at the shell boundary etc., but these are all standard numerical problems that can be treated with higher order integration schemes like Runge-Kutta.

ProfRob
  • 130,455