In-Class Assignment 11#
Stellar Atmospheres#
Learning Objectives#
explore conditions at / near the stellar photosphere
compare surface conditions to analytic estimates
qualitatively describe properties of the stellar atmosphere
(optional) use
tulipsto visualize the stellar atmosphere
import numpy as np
import matplotlib.pyplot as plt
import pandas as pd
a. Stellar Atmosphere in a Solar-like star#
Individually/ with the person next to you:#
Download, or reuse from a previous class:
New \(1 M_\odot\) MS model: 1m_ms_profile.data;
Using the \(1M_\odot\) model MESA profile data (1m_ms_profile.data):
Plot the log gas pressure (\(P_{\rm{gas}}\)) and log radiation pressure (\(P_{\rm{rad}}\)) as a function of the log
optical_depth(\(\tau\)) (x-axis).
We saw in HKT 4.3 that we can use the equation of HSE to calculate photospheric pressure as a function of \(g\) and \(\tau\).
Eq. 4.48
where \(g_{\rm{s}}=G M/R^2\) and \(L_{\rm{edd}}= 4 \pi c G M/\kappa_{\rm{P}}\) is the Eddington critical luminosity
and Eq. 4.54
Use this equation to compute the analytical estimate for pressure at the photosphere for this model (ignoring the eddington luminosity term).
Add this estimated value to the same plot using a plt.axhline for the value obtained.
Hint: dont forget to take the log of the value and make sure you are in CGS.
Also plot the ratio of the total luminosity to that of the Eddington luminosity as a function of optical depth again.
# load the 1m data here
#one_m_ms_profile = pd.read_csv('###',sep=r'\s+',header=4)
#list(one_m_ms_profile)
msun_cgs  = 2e33
G_cgs = 6.67e-8
#one_m_ms_profile_Pgas = one_m_ms_profile['pgas'] # radiation pressure
#one_m_ms_profile_Prad = one_m_ms_profile['prad'] # gas pressure
#one_m_ms_profile_kappa = one_m_ms_profile['##'] # kappa
#one_m_ms_profile_total_mass = max(one_m_ms_profile['mass'])*msun_cgs # M 
#one_m_ms_profile_total_radius_cm = max(one_m_ms_profile['radius_cm']) # R
#one_m_ms_profile_tau = one_m_ms_profile['##
#one_m_ms_profile_L = 10**(one_m_ms_profile['##
#one_m_ms_profile_Ledd = 10**(one_m_ms_profile['##
#gs = (G_cgs*X/(XX)**2)
#P = 2./3. * ### # the photosphere value of the opacity is at index `[0]`
## 1-3 result here
#plt.title('1$M_\odot$ MESA Model During H-burning')
#plt.plot(np.log10(tau),
#         np.log10(gas),label=r'$P_{\rm{gas}}$')
#plt.plot(np.log10(tau),
#         np.log10(Prad),label=r'$P_{\rm{rad}}$')
#plt.axhline(np.log10(P),color='k',lw=1,ls='--',label=r'HKT 4.54 Approximation')
#plt.legend()
#plt.xlabel(r'$\rm{log}_{10}(\tau)$')
#plt.ylabel(r'$\rm{log}~P \ (\rm{erg\ \rm{s}^{-1}})$')
## 4 result here
#plt.title('1$M_\odot$ MESA Model During H-burning')
#plt.plot(np.log10(one_m_ms_profile_tau),
#         np.log10(L/Ledd))
#plt.axhline(0,lw=0.5,ls='-.',color='k') # when L > Ledd
#plt.xlabel(r'$\rm{log}_{10}(\tau)$')
#plt.ylabel(r'$\rm{log}~ (L/L_{\rm{Edd}})$')
With your larger group, try to answer the following:#
Where is the surface (or in this case the atmosphere) on this plot?
Your group’s response.
Does the estimated pressure for this model match the value at the photosphere?
Your group’s response.
In the second plot, does the luminosity ever exceed the eddington luminosity in the model near the atmosphere?
Your group’s response.
What might these results suggest about the validity of the analytical estimate we compared against?
Your group’s response.
b. Stellar Atmosphere in a Massive star#
Individually/ with the person next to you:#
Download, or reuse from a previous class:
\(20 M_\odot\) MS model: 20m_ms_profile.data;
Using the \(20M_\odot\) model MESA profile data (20m_ms_profile.data):
Plot the log gas pressure (\(P_{\rm{gas}}\)) and log radiation pressure (\(P_{\rm{rad}}\)) as a function of the
optical_depth(\(\tau\)) (x-axis).Use this equation to compute the analytical estimate for pressure at the photosphere for this model (ignoring the eddington luminosity term).
Add this estimated value to the same plot using a plt.axhline for the value obtained.
Hint: dont forget to take the log of the value and make sure you are in CGS.
Also plot the ratio of the total luminosity to that of the Eddington luminosity as a function of optical depth again.
This plot shows the ranges over which MESA uses different atmosphere boundary conditions.
# load data with pandas
#one_m_ms_profile = pd.read_csv('data/20m_ms_profile.data',sep=r'\s+',header=4)
#list(one_m_ms_profile)
# load variables here - you can resuse from part a.
#one_m_ms_profile_Pgas = one_m_ms_profile['##'] # radiation pressure
#one_m_ms_profile_Prad = one_m_ms_profile['##'] # gas pressure
# compute g at the surface
#gs = (G_cgs*
# compute analytical P value
#P = 2./3.# the photosphere value of the opacity is at index `[0]`
## 1-3 result here
#plt.title('20$M_\odot$ MESA Model During H-burning')
#plt.plot(np.log10(tau),
#         np.log10(Pgas),label=r'$P_{\rm{gas}}$')
#plt.plot(np.log10(tau),
#         np.log10(Prad),label=r'$P_{\rm{rad}}$')
#plt.axhline(np.log10(P),color='k',lw=1,ls='--',label=r'HKT 4.54 Approximation')
#plt.legend()
#plt.xlabel(r'$\rm{log}_{10}(\tau)$')
#plt.ylabel(r'$\rm{log}~P \ (\rm{dyne\ \rm{cm}^{-2}})$')
## 1-2 result here
#plt.title('20$M_\odot$ MESA Model During H-burning')
#plt.plot(np.log10(tau),
#         np.log10(L/oLedd),label=r'$L/L_{\rm{Edd}}$')
#plt.axhline(0,lw=0.5,ls='-.',color='k')
#plt.xlabel(r'$\rm{log}_{10}(\tau)$')
#plt.ylabel(r'$\rm{log}~ (L/L_{\rm{Edd}})$')
With your larger group, try to answer the following:#
How do the different pressure contributions differ in this model compared to the previous one?
Your group’s response.
Does the estimated pressure for this model match the value at the photosphere?
Your group’s response.
In the second plot, does the luminosity ever exceed the eddington luminosity in the model near the atmosphere?
Your group’s response.
What might these results suggest about the validity of the analytical estimate we compared against?
Your group’s response.