03-HydroStaticEQ#
TODO: Please enter your name
0. We start by importing the modules#
Numpy – operations on arrays and matrixes (and pi)
Matplotlib pyplot – plotting library
Astropy units – defined quantities with units. We also import the CDS conversions
import numpy as np
import matplotlib.pyplot as plt
%matplotlib inline
# This option enables plots to be inline,
# as opposed to opening in a separate window.
from astropy import constants as const
import astropy.units as u
from astropy.units import cds
cds.enable()
<astropy.units.core._UnitContext at 0x10ec6f910>
1. Solving the equation of hydrostatic equilibium with known density.#
a. In class: the constant density case#
For a density that is constant inside of the star, we found that
where \(P_o\) is the pressure at the center (\(r=0\))
We will add this curve to the graph of \(P(r)/P_c\) versus \(r/R_\star\) below.
b. At home: the decreasing density case#
Now let’s consider a density that varies as
as we did for the previous notebook L02.
follow the same procedure to find \(\frac{P(r)}{P_o}\), and add it to the plot below.
TODO : follow the same procedure to find \(\frac{P(r)}{P_o}\) for the decreasing density case. Write your solution below. This means starting from the HS differential equation, but you can use results from notebook L02. Transform your integral to a unitless-form before performing the integration. Use Latex formatting to render the math
TODO : Add this curve to the graph below, with a label in the legend.
fig, ax = plt.subplots(1,1, figsize=(6,6))
# The subplot routine creates a figure object (in the variable "fig"), which contains
# here a single plotting window called "axes" (in the variable "ax")
ax.set_xlabel(r'$r/R_\star$') # the "r" is to say there is latex formatted strings.
ax.set_xlim(0,1)
ax.set_ylabel(r'$P/P_c$')
#-------------------------------------------------------
# In class
# define an array of r / Rs, from 0 to 1, with 100 elements
# For constant density
#-------------------------------------------------------
# For linearly decreasing density (portfolio)
# At home
#-------------------------------------------------------
ax.legend(loc=0, fontsize=15)
plt.tight_layout()
# arrange the plot nicely
No artists with labels found to put in legend. Note that artists whose label start with an underscore are ignored when legend() is called with no argument.

TODO: Please write a small paragraph with an interpretation of the result obtained:
2. Now we would like to calculate the numerical value of the central pressure for a star of \(1M_\odot\) and \(1R_\odot\).#
To give an idea, the values of density and pressure at the center of the Sun from sophisticated models are 165 g/cm \(^3\) and \(2.5\times10^{17} \mathrm{dyn / cm}^2\), respectively.
a. In class: the constant density case#
We know that
Therefore the density is
The central pressure is
where the surface acceleration \(g_\star = GM_\star / R_\star^2\).
############
# In class
############
# Let's start with a demo on how to use the unit capabilities of astropy
TODO: Please write a small paragraph with an interpretation of the result obtained:
b. At home: the linearly decreasing density case#
TODO: Now, you will derive expressions for the central density and central pressure (following the procedure above) for the case where we take the density to be \(\rho = \rho_c\left(1-\frac{r}{R_\star}\right)\). Write your solution below in latex to render the math. You can refer to results (scaled equations) from your previous notebooks.
TODO: In the code cell below, use the astropy constant and unit packages to calculate the numerical values of the central density and central pressure for the decreasing density case. Make sure that the units are in the cgs pressure units, and that your ‘print’ statements include a label in front of the value.
#################
# At home
#################
TODO: Please write a small paragraph with an interpretation of the result obtained:
3. Reading assignement: “what can we measure about stars” – part 2#
In this graduate course, we are making an advanced physical and mathematical model of star.
But it is still good to learn and/or remind ourselves about which physical characteristics of stars we can actually measure. You might have covered some of this in some details in previous physics or astro courses (at UD PHYS 133, 144, 333, or 469) – but it is still a good idea to have a quick look at the suggested reading below before crafting your paragraph.
One other thing that can be measured is the distance to a star.
TODO: Have a look at section 19.2 “Celestial Distances > Surveying the Stars” of the Open Stack Astronomy online textbook, and write a short conceptual paragraph about how astronomer can determine the distance to (nearby) stars. You might also find is interesting to have a quick look at the GAIA space mission: https://sci.esa.int/web/gaia/-/28820-summary