In-Class Assignment 28#
Note due for credit, in-class participation only
Wolf-Rayet Stars#
Learning Objectives#
compare the Schonberg-Chandrasekhar limit to models of low mass and intermediate mass stars
compare luminsity relations for low and intermediate mass stars
import numpy as np
import matplotlib.pyplot as plt
import pandas as pd
Download the following model files locally. These data were produced using the 80m_zams_to_cc
test suite.
\(80 M_{\odot}\): 80m_zams_to_cc_history.data;
# load data and see which variables are available
#history = pd.read_csv('80m_zams_to_cc_history.data',sep=r'\s+',header=4)
#history.head(10)
a. - Mass loss evolution of WR stars#
Using the \(80M_{\odot}\) MESA history dataset:
Plot an HR diagram of the model as a scatter plot, but color the data according to the
log_abs_mdot
value at a given HR data pair using thecolored_line
routine below.
At what point does the star lose the most mass?
This model passes the HD limit at about \(log(T_{\rm{eff}})\lt4.2\). Mask the data to only the data below those temperatures and with extreme mass loss \(\dot{M}\gt-4 M_{\odot}\)/yr.
Then, estimate the average amount of time for this LBV outburst and the amount of material expelled over the duration of the burst.
After this outburst, what type of star (observationally - RSG/BSG/WR) does the model fallback to as it traverses the HR to higher effective temperature.
import warnings
import matplotlib.pyplot as plt
import numpy as np
from matplotlib.collections import LineCollection
def colored_line(x, y, c, ax, **lc_kwargs):
"""
Plot a line with a color specified along the line by a third value.
It does this by creating a collection of line segments. Each line segment is
made up of two straight lines each connecting the current (x, y) point to the
midpoints of the lines connecting the current point with its two neighbors.
This creates a smooth line with no gaps between the line segments.
Parameters
----------
x, y : array-like
The horizontal and vertical coordinates of the data points.
c : array-like
The color values, which should be the same size as x and y.
ax : Axes
Axis object on which to plot the colored line.
**lc_kwargs
Any additional arguments to pass to matplotlib.collections.LineCollection
constructor. This should not include the array keyword argument because
that is set to the color argument. If provided, it will be overridden.
Returns
-------
matplotlib.collections.LineCollection
The generated line collection representing the colored line.
"""
if "array" in lc_kwargs:
warnings.warn('The provided "array" keyword argument will be overridden')
# Default the capstyle to butt so that the line segments smoothly line up
default_kwargs = {"capstyle": "butt"}
default_kwargs.update(lc_kwargs)
# Compute the midpoints of the line segments. Include the first and last points
# twice so we don't need any special syntax later to handle them.
x = np.asarray(x)
y = np.asarray(y)
x_midpts = np.hstack((x[0], 0.5 * (x[1:] + x[:-1]), x[-1]))
y_midpts = np.hstack((y[0], 0.5 * (y[1:] + y[:-1]), y[-1]))
# Determine the start, middle, and end coordinate pair of each line segment.
# Use the reshape to add an extra dimension so each pair of points is in its
# own list. Then concatenate them to create:
# [
# [(x1_start, y1_start), (x1_mid, y1_mid), (x1_end, y1_end)],
# [(x2_start, y2_start), (x2_mid, y2_mid), (x2_end, y2_end)],
# ...
# ]
coord_start = np.column_stack((x_midpts[:-1], y_midpts[:-1]))[:, np.newaxis, :]
coord_mid = np.column_stack((x, y))[:, np.newaxis, :]
coord_end = np.column_stack((x_midpts[1:], y_midpts[1:]))[:, np.newaxis, :]
segments = np.concatenate((coord_start, coord_mid, coord_end), axis=1)
lc = LineCollection(segments, **default_kwargs)
lc.set_array(c) # set the colors of each segment
return ax.add_collection(lc)
## a results here
#cmap = 'magma'
#fig, ax = plt.subplots()
#ax.scatter(x, y, c=c, cmap=cmap)
#ax.invert_xaxis()
#lines = colored_line(x, y, c, ax, linewidth=1, cmap="plasma")
#fig.colorbar(lines) # add a color legend
#plt.show()
b. - WR subclasses#
Using a combination of the surface abundances of he4, c12, o16, n14 and hydrogen envelope mass fraction left (
envelope_fraction_left
- \(X_{H}\)) as a function of model number.Then, label the approximate model ranges over which the star pass through the various WR subtypes as described in page 178 of Pols.
Repeat this step as a function of age if there is time available.
Of the available data given, in which subclass does this model appear to spend the majority of its lifetime?
# b result here
c. - Internal structure of WR stars#
Plot a Kipp of the model as a function of age and identify and again work to identify the subclasses the model evolves through over time.
Hint: compare with Pols Figure 12.4
# c result here
## first kipp here
#import mesaPlot as mp
#m=mp.MESA()
#p=mp.plot()
#m.loadHistory('LOGS')
#p.plotKip3(m,xaxis='star_age',age_lookback=True,age_log=True)