In-Class Assignment 7#
Identifying Different Regimes in Solar-like and Non-Solar like Stellar Model#
Learning Objectives#
explore the stellar structure of a massive star on the main-sequence
determine the radiative diffusion dominated regions
determine where convection dominates
explore opacity profiles in solar models
define core structure in stellar models
import matplotlib.pyplot as plt
import numpy as np
import pandas as pd
a. Locating the Radiative Diffusion Dominated Regime in a Massive star#
Download the following model files locally. These data were produced using the MESA 20m_ms.data test suite.
New \(20.0 M_{\odot}\) Main-Sequence profile data: 20m_ms.data;
Plot the radiative luminosity
lum_raddivided by the total luminosityluminosityas a function of radius (in units of Rsun) using the MESA data.Locate the approximate fractional radius and annotate where the \(L_{\rm{rad}}/L<1\) using
plt.axvlinewith a black dashed or dotted line.Describe in a few sentences the results of your plot and what could be happening in the region where radiation luminosity is non-dominant. Why does this suggest the core is burning convectively? What is different from the 1M model?
## load MESA data here
#massive_star_ms_profile = pd.read_csv('data/20m_ms.data',sep=r'\s+',header=4)
#list(massive_star_ms_profile)
lsun_cgs = 3.826e33 # erg / sec (1 Lsun)
rsun_cgs = 6.96e10  # cm
# obtain mesa variables here
#massive_star_ms_radius_cm = massive_star_ms_profile['#
#massive_star_ms_lum_cgs = massive_star_ms_profile['#
#massive_star_ms_lum_rad_cgs = massive_star_ms_profile['#
## 1-2 result here
#plt.plot(massive_star_ms_radius_cm/rsun_cgs,###,label=r'$L_{rad}/L$')
#plt.axvline(##,color='k',ls='--')
#plt.legend()
#plt.xlabel(r'$r/R_{\odot}$')
#plt.ylabel(r'$l/l_{\rm{tot}}$')
3 result here in words#
\(\ldots\)
b. Locating the Non-Diffusion Dominated Regime in a Massive star#
Using the same MESA data:
Next, compute the radial radiative flux (\(F_{\rm{rad}}\)) and the total convective flux (\(F_{\rm{conv}}\)) as a function of radius (in units of Rsun) and plot them on the same plot and label. Normalize both fluxes by their maximum values for comparison using
max(). Make sure to use cgs!
Hint: Use our relation for the Flux where \(F=l~/4\pi r^2\),
On this same plot, again label the approximate location where \(F_{\rm{rad}}\) < \(F_{\rm{conv}}\) in this case.
This plot suggests we transition from radiation diffusion dominated to convection dominated in the core.
Confirm this result by plotting our opacity \(\kappa\) as a function of radius on a seperate plot. On this same plot, compute an analytical estimate for \(\kappa_{\rm{es}}\) and \(\kappa_{\rm{bf}}\) using the MESA data for \(Z\),\(\rho\),\(T\), etc.
Hint:
Use this plot to determine the dominant source of opacity in the core of a massive star on the main-sequence and describe that in a few sentences.
# 1 result here - be sure to convert to CGS before computing the Flux!
#massive_star_ms_lum_conv_cgs = massive_star_ms_profile['lum_conv'] * lsun_cgs
#massive_star_ms_flux = massive_star_ms_lum_cgs / (4 * np.pi * ##)
#massive_star_ms_flux_rad = massive_star_ms_lum_rad_cgs / ##
#massive_star_ms_flux_conv = massive_star_ms_lum_conv_cgs /##
# plot the fluxes here 
#plt.plot(##,label=r'$F_{rad}$')
#plt.plot(##,label=r'$F_{conv}$')
#plt.axvline(##,color='k',ls='--')
#plt.legend()
# obtain opacity here
#massive_star_ms_kappa = massive_star_ms_profile['##
#massive_star_ms_h1 = massive_star_ms_profile[###] # X
#massive_star_ms_Z = massive_star_ms_profile['z_mass_fraction_metals']
#massive_star_ms_Rho = ##
#massive_star_ms_T = ##
#kappa_bf = ##
#kappa_es = ##
# plot kappa here 
#plt.plot(massive_star_ms_radius_cm/rsun_cgs,##,label='$\kappa$')
#plt.plot(massive_star_ms_radius_cm/rsun_cgs,##,label='$\kappa_{bf}$')
#plt.plot(massive_star_ms_radius_cm/rsun_cgs,##,label='$\kappa_{es}$')
#plt.ylim(0,1)
#plt.legend()
b 4 result here in words#
\(\ldots\)
c. Defining a Core-Boundary in a Massive star#
Using the same MESA data:
Reproduce your Flux plots from part B.2.
Our goal is to add a few more things to this plot.
Plot the normalized nuclear energy generation as a function of radius (in units of Rsun) on the same plot and label.
On the same plot, plot the normalized convective velocity
conv_vel.Then, use that to determine the approximate location where \(\epsilon_{\rm{nuc,normalized}}\rightarrow0\), we will define this as the edge of the hydrogen burning core.
Lastly, annotate the three regions on the same plot, ‘core’, ‘radiative’, and ‘convective’ using annotate.
# obtain eps nuc and conv_vel
#massive_star_ms_eps_nuc = #massive_star_ms_profile['##
#massive_star_ms_conv_vel = #massive_star_ms_profile['##
# plot everything combined and annotated
#plt.plot(massive_star_ms_radius_cm/rsun_cgs,
#         ##,
#         label=r'$F_{rad}$')
#plt.plot(massive_star_ms_radius_cm/rsun_cgs,
#         ##,
#         label=r'$F_{conv}$')
#plt.plot(massive_star_ms_radius_cm/rsun_cgs,
#         ##,
#         label=r'$\epsilon_{\rm{nuc}}$')
#plt.plot(massive_star_ms_radius_cm/rsun_cgs,
#         ##,
#         label=r'$v_{\rm{conv}}$')
#plt.axvline(##,color='k',ls='--')
#plt.annotate('convective core',xy=(##))
#plt.annotate('radiative',xy=(##))
#plt.ylabel('Normalized Variable')
#plt.title('20Msun Massive Star on Main-Sequence')
#plt.xlabel('r/Rsun')
#plt.legend()
d. (Bonus) Locating the Non-Diffusion Dominated Regime in a Solar-like star#
Using the same MESA data from the last class:
New \(1.0 M_{\odot}\) Main-Sequence profile data: 1m_pre_ms_to_wd.data;
Plot opacity \(\kappa\) as a function of radius on a seperate plot. On this same plot, compute an analytical estimate for \(\kappa_{\rm{es}}\) and \(\kappa_{\rm{bf}}\), and \(\kappa_{\rm{ff}}\) using the MESA data for \(Z\),\(\rho\),\(T\), etc.
Hint:
Hint: use
plt.ylim(0,30)to zoom in.
Use this plot to determine the dominant source of opacity in a solar-like star.
#massive_star_ms_profile = pd.read_csv('data/1m_pre_ms_to_wd.data',sep=r'\s+',header=4)
# obtain opacity here
#massive_star_ms_radius_cm = massive_star_ms_profile['##
#massive_star_ms_kappa = massive_star_ms_profile['##
#massive_star_ms_h1 = massive_star_ms_profile['##
#massive_star_ms_Z = massive_star_ms_profile['##
#kappa_bf = #
#kappa_ff = #
#kappa_es = #
# plot kappa here 
#plt.plot(massive_star_ms_radius_cm/rsun_cgs,##,label='$\kappa$')
#plt.plot(massive_star_ms_radius_cm/rsun_cgs,##,label='$\kappa_{bf}$')
#plt.plot(massive_star_ms_radius_cm/rsun_cgs,##,label='$\kappa_{ff}$')
#plt.plot(massive_star_ms_radius_cm/rsun_cgs,##,label='$\kappa_{es}$')
#plt.ylim(0,30)
#plt.axvline(0.70,color='k',ls='--')
#plt.axvline(0.24,color='k',ls='--')
#plt.legend()