Make sure to have a cloned copy of your own repository on your computer (or nimoy if you are using nimoy for Jupyter). Create a directory Labs/Lab2.
From the command line git clone the class repository. If you have already done this, git pull to update the repository. There is a directory Labs/Lab2/ with a file Lab2.ipynb, which is the template for this exercise.
Copy this template to your own repository directory Labs/Lab2
2 Schechter Function
The galaxy luminosity function in the nearby universe is well described by a Schechter Function:
Φ(M)dM = (0.4 ln10) φ∗ 100.4(M∗−M)(α+1)e−100.4(M∗−M) dM (1) With the following parameters from Smith+2009 for Field Galaxies in SDSS at z∼0.1 in
the Kband:
1. φ∗ =1.66 ×10−2 h3 Mpc−3
2. α = -0.81
3. M∗ = M∗k= -23.19 – 5log(h)
h = the Hubble constant in units of 100 km/s/Mpc . At z=0 this is 0.7. But we are going to ignore it here. Units will then be in ”comoving” coordinates.
2.1 Question 1
Utilizing the defined function in the template file, plot the Schechter Function using the above parameter values over a magnitude range of -17 to -26. Try to reproduce the black solid line in Figure 2.1, from Smith+2009
Plotting tips:
1. import matplotlib.pyplot as plt – this lets you use plotting functions.
2. np.arange(0,10,0.1) will return an array from 0 to 10 spaced in intervals of 0.1 3. plt.semilogy lets you plot the y axis as log.
1
Figure 1: Luminosity Function from Smith+2009, UKIDSS + SDSS KBand
2.2 Question 2
Galaxies in the Virgo Cluster have different parameters, like α=-1.35 (Ferrarese+2016 ApJ 824) Overplot the Schechter Function with this new value of α. Try a smaller value of α = −0.6. How does the function change? What does this mean?
2.3 Question 3
Build a function to compute the Schechter Function in terms of luminosity.
Use ‘quad‘ to determine the fraction of the luminosity that lies above L* in the following
three cases: α=-0.7 (default), α=-0.6, α=1.85. Schechter Function:
3
n∗ = 0.008 h3 Mpc−3 L⋆ = 1.4 × 1010L⊙
The IMF
n∗ L α
Φ(L) = L L e−L/L∗ (2)
∗∗
Create a function called Salpeter that defines the Salpeter IMF:
ξ(M) = ξ0(M/M⊙)−α (3)
α = 2.35 The function should take as input an array of stellar masses, M. You will need to determine the normalization, ξ0, by integrating this equation over mass from 0.1 to 120 M⊙
2
and setting the value to 1. The function should then return ξ(M), which will now represent the fractional number of stars.
• from scipy.integrate import quad
• quad(lambda x: fxn(x),xmin,xmax)
• quad returns an array with 2 values. you want the first value.
3.1 Question 1
Integrate your normalized function to compute the fraction of stars with stellar masses greater than the sun and less than 120 M⊙. ** Double Check: if you integrate your function from 0.1 to 120 you should return 1.0
3.2 Question 2
How might you modify the above to return the fraction of mass in stars more massive than the Sun?
4 Last Step
Git push your Lab1.ipynb file to your repo. Recall steps: 1. git add filename
2. git commit -m ”COMMENTS”
3. git push
3







