In-Class Assignment 13#

ZAMS and Evolution on The Main-Sequence#

Learning Objectives#

  • explore surface stellar properties at ZAMS through the main-sequence

  • explore central stellar properties at ZAMS through the main-sequence

  • produce and analyze perceived color plots using tulips

import numpy as np
import matplotlib.pyplot as plt
import pandas as pd

a. ZAMS and Evolution on the Main-Sequence#

Individually/ with the person next to you:#

Download, or reuse from a previous class:

Using the all three MESA history data:

  1. Compute the index at which the star reaches the zero age main-sequence, in MESA this is defined as

 L_nuc_burn_total >= s% L_phot*s% Lnuc_div_L_zams_limit

where a value Lnuc_div_L_zams_limit=0.99.

  1. Compute the index at which the star reaches the terminal age main-sequence, that is when it has depleted or reached a central value of about \(X_{\rm{c}}({^{1}\rm{H}})\lesssim 10^{-3}\).

  2. Plot the an HR diagram x-axis (\(\textrm{log}T_{\rm{eff.}}\)) versus y axis (\(\textrm{log}L\)) only over the range from idx ZAMS to idx TAMS. Reference for indexing in Python.

Hint: the sytax would be like [one_m_ZAMS_idx : one_m_TAMS_idx] at the end of each array you plot.

Hint: Compare with Pols Figure 9.9.

# load data with pandas
#one_m_ms_history = pd.read_csv('data/M1_default_trimmed_history.data',sep=r'\s+',header=4)
#five_m_ms_history = pd.read_csv('data/5m_history.data',sep=r'\s+',header=4)
#eleven_m_ms_history = pd.read_csv('data/11m_subsolar_history.data',sep=r'\s+',header=4)
#list(one_m_ms_history)
#Lnuc_div_L_zams_limit = 
#center_h1_lim = 
### 1 m sun vars
#one_m_ms_history_logTeff = one_m_ms_history['##'] # log Teff
#one_m_ms_history_logL = one_m_ms_history['##'] # log L
#one_m_ms_history_logLH = one_m_ms_history['##'] # log LH (log Lnuc)
#one_m_ms_history_h1 = one_m_ms_history['##'] # central h1 mass fraction

# use np where to get the index at start of ZAMS and end of MS (TAMS)
#one_m_ZAMS_idx_array = np.where(one_m_ms_history_logLH > Lnuc_div_L_zams_limit * one_m_ms_history_logL)[0]
#one_m_ZAMS_idx = one_m_ZAMS_idx_array[0]
#one_m_TAMS_idx_array = np.where(one_m_ms_history_h1 < center_h1_lim)[0]
#one_m_TAMS_idx = one_m_TAMS_idx_array[0]
#print(one_m_ZAMS_idx,one_m_TAMS_idx)


### 5 m sun vars
#five_m_ms_history_logTeff = five_m_ms_history['#'] # log Teff
#five_m_ms_history_logL = five_m_ms_history['##'] # log L
#five_m_ms_history_logLH = five_m_ms_history['###'] # log LH (log Lnuc)
#five_m_ms_history_h1 = five_m_ms_history['##'] # central h1 mass fraction

#five_m_ZAMS_idx_array = np.where(five_m_ms_history_logLH > Lnuc_div_L_zams_limit * five_m_ms_history_logL)[0]
#five_m_ZAMS_idx = five_m_ZAMS_idx_array[0]
#five_m_TAMS_idx_array = np.where(five_m_ms_history_h1 < center_h1_lim)[0]
#five_m_TAMS_idx = five_m_TAMS_idx_array[0]
#print(five_m_ZAMS_idx,five_m_TAMS_idx)

### 11 m sun vars
#eleven_m_ms_history_logTeff = eleven_m_ms_history['##'] # log Teff
#eleven_m_ms_history_logL = eleven_m_ms_history['##'] # log L
#eleven_m_ms_history_logLH = eleven_m_ms_history['##'] # log LH (log Lnuc)
#eleven_m_ms_history_h1 = eleven_m_ms_history['##'] # central h1 mass fraction

#eleven_m_ZAMS_idx_array = np.where(eleven_m_ms_history_logLH > Lnuc_div_L_zams_limit * eleven_m_ms_history_logL)[0]
#eleven_m_ZAMS_idx = eleven_m_ZAMS_idx_array[0]
#eleven_m_TAMS_idx_array = np.where(eleven_m_ms_history_h1 < center_h1_lim)[0]
#eleven_m_TAMS_idx = eleven_m_TAMS_idx_array[0]
#print(eleven_m_ZAMS_idx,eleven_m_TAMS_idx)
## 1-2 result here
#plt.title('MESA Models HR Diagram from ZAMS to TAMS')

#plt.plot(one_m_var[one_m_ZAMS_idx:one_m_TAMS_idx],
#         one_m_var[one_m_ZAMS_idx:one_m_TAMS_idx],label=r'$1M_{\odot}$')

#plt.plot(five_m_var[five_m_ZAMS_idx:five_m_TAMS_idx],
#         five_m_var[five_m_ZAMS_idx:five_m_TAMS_idx],label=r'$5M_{\odot}$')

#plt.plot(eleven_m_var[eleven_m_ZAMS_idx:eleven_m_TAMS_idx],
#         eleven_m_var[eleven_m_ZAMS_idx:eleven_m_TAMS_idx],label=r'$11M_{\odot}$')

#plt.gca().invert_xaxis()

#plt.legend()
#plt.xlabel(r'$\rm{log}_{10}~T_{\rm{eff}}~(\rm{K})$')
#plt.ylabel(r'$\rm{log}~L \ (L_{\odot})$')

With your larger group, try to answer the following:#

  1. Describe the qualitative properties of the 3 stellar models while on the main-sequence.

Your groups thoughtful response.

  1. Why might the change in radius of the 1 Msun model be modest in comparison to the more massive models?

Hint: Pols Eqn 9.14.

Your groups thoughtful response.

  1. Why do the more massive star models go to the right on the HRD before turning left (blueward) before hydrogen depletion? What is happening to the core at this time?

Your groups thoughtful response.

  1. The core at its blueist point in the HRD, eventually reaches a new hydrostatic equilibrium with the now H depleted core and a new energy source (prior to Core He Burning.). What might be this energy source be and where is it located?

Your groups thoughtful response.

b. Structure Evolution on the Main-Sequence#

Individually/ with the person next to you:#

Using only the \(5M_{\odot}\) MESA history data:

  1. Plot the central mean molecular weight (mu), \(\rho\), \(T\), \(R\) at the surface, and \(L_{\rm{nuc.,H}}\) as a function of model number, all normalized by their values at ZAMS.

Hint: the sytax would be like [one_m_ZAMS_idx : one_m_TAMS_idx] at the end of each array you plot.

Hint: Compare with Pols Figure 9.9

# spaghetti code thats not important
#five_m_ms_history_center_P_norm = 10**(five_m_ms_history['log_center_P'])/10**(five_m_ms_history['log_center_P'][five_m_ZAMS_idx]) # central P
#five_m_ms_history_center_T_norm = 10**(five_m_ms_history['log_center_T'])/10**(five_m_ms_history['log_center_T'][five_m_ZAMS_idx]) # central T
#five_m_ms_history_surface_R_norm = 10**(five_m_ms_history['log_R'])/10**(five_m_ms_history['log_R'][five_m_ZAMS_idx]) # surface R (Rsun)
#five_m_ms_history_center_mu_norm = five_m_ms_history['center_mu']/five_m_ms_history['center_mu'][five_m_ZAMS_idx] # central mu
#five_m_ms_history_model_number = five_m_ms_history['model_number'] # model_number
#five_m_ms_history_log_LH_norm = 10**(five_m_ms_history['log_LH'])/10**(five_m_ms_history['log_LH'][five_m_ZAMS_idx]) # log_LH
## 1-2 result here
#plt.title('5$M_{\odot}$ Structure Properties from ZAMS to TAMS')

#plt.plot(five_m_ms_history_model_number[five_m_ZAMS_idx:five_m_TAMS_idx],
#         five_m_ms_history_center_mu_norm[five_m_ZAMS_idx:five_m_TAMS_idx],
#         label=r'$\mu$')

#plt.plot(five_m_ms_history_model_number[five_m_ZAMS_idx:five_m_TAMS_idx],
#         five_m_ms_history_center_P_norm[five_m_ZAMS_idx:five_m_TAMS_idx],
#         label=r'$P_{\rm{c}}$')

#plt.plot(five_m_ms_history_model_number[five_m_ZAMS_idx:five_m_TAMS_idx],
#         five_m_ms_history_center_T_norm[five_m_ZAMS_idx:five_m_TAMS_idx],
#         label=r'$T_{\rm{c}}$')

#plt.plot(five_m_ms_history_model_number[five_m_ZAMS_idx:five_m_TAMS_idx],
#         five_m_ms_history_log_LH_norm[five_m_ZAMS_idx:five_m_TAMS_idx],
#         label=r'$L_{\rm{H}}$')

#plt.plot(five_m_ms_history_model_number[five_m_ZAMS_idx:five_m_TAMS_idx],
#         five_m_ms_history_surface_R_norm[five_m_ZAMS_idx:five_m_TAMS_idx],
#         label=r'$R$')

#plt.xlim()

#plt.legend()
#plt.xlabel(r'$\rm{Model \ Number}$')
#plt.ylabel(r'$\rm{Variable \ Normalized \ by \ ZAMS \ Value}$')

With your larger group, try to answer the following:#

  1. What does the above plot show and why might it be important to our understanding of stars on the MS?

Your groups thoughtful response.

  1. Describe in a few sentences the qualitative properties of the core (or central) values on the main-sequence.

Your groups thoughtful response.

  1. The radius at the surface peaks at some point on the MS, does this relate to your result from 7a. If so, how? What is happening to mu at this inflection point?

Your groups thoughtful response.

  1. What is happening to mu at this inflection point of the radius?

Your groups thoughtful response.

  1. Eventually the star with proceed with a inert He core overlaid with a thick H-burning shell. What might you expect that to to mean for the surface radius? What trajectory would the star take when this shell is formed?

Your groups thoughtful response.

c. Perceived color diagram on the MS using Tulips#

Perceived Color

The color is determined using the colorpy package, which approximates the spectrum of a star using its effective temperature. According to the 1931 color matching functions of the Commission Internationale de l’Eclairage, this spectrum is converted to the approximate RGB color the human eye will perceive.

Individually/ with the person next to you:#

  1. In your current working directory create a folder called LOGS.

  2. Copy your 5m_history.data into this directory and rename it history.data. It will look in this directory for a file called history.data.

  3. Create your data object for analysis using mesaPlot:

m5 = mp.MESA()
  1. Load the history data using this object:

m5.loadHistory(filename_in=`YOUR_PATH_NAME`+ "history.data")
  1. Now, using tulips to produce an perceived_color plot using your history data. It will create a series of these plots based on your defined step size N.

# only uncomment if you were able to successfully install
#import tulips

# note the capital `P`
#import mesaPlot as mp
# Specify  directory of MESA model
#SINGLE_M11_DIR = "../../tulips/MESA_DIR_EXAMPLE/"
#SINGLE_M5_DIR = "./data/LOGS/"

#m5 = mp.MESA()
#m5.loadHistory(filename_in=SINGLE_M5_DIR + "history.data")

#idx_low = 0
#idx_upper = 400 
#N = 2 
#tulips.perceived_color(m5, time_ind=(idx_low, idx_upper , N), 
#                       fps=10, output_fname="perceived_color", fig_size=(10, 8))
#plt.show()
#from IPython.display import Video

#Video("perceived_color.mp4", embed=True, width=700, height=600)

With your larger group, try to answer the following:#

  1. Using the perceived color plot, discuss and identify the impact on the color of the star once the thick H-shell has been formed and its evolution in the HRD. That is, over which frames/time in the visualzation is the star undergoing thick H-shell burning.

Hint: Start by idenifying the ZAMS and TAMS (including when our R reaches a max before contracting again).

Your groups thoughtful response.