Modelling the Hydrogen Emission Spectrum#
1.#
The electronic states of atomic hydrogen have energies
where \(n\) is the principal quantum number for each energy level, \(R_\mathrm{H}\) is the Rydberg constant, \(h\) is Planck’s constant, and \(c\) is the speed of light.
Write a function to calculate the energy of the \(n\)th electronic energy level of hydrogen, and calculate the energies for \(n\)=1, 2, 3, 4, 5.
Note
You can access a large number of physical constants using the constants
sub-module of scipy
.
Values for the Rydberg constant, Planck’s constant, and the speed of light can be imported using
from scipy.constants import Rydberg, h, c
2.#
The emission spectrum of atomic hydrogen is described by Rydberg’s formula, which relates the energy difference between atomic levels to the wavelength of absorbed or emitted photons:
(a) Write a function that takes two arguments, \(n_1\) and \(n_2\), and returns the corresponding emission wavelength.
The Lyman, Balmer, and Paschen series correspond to spectral lines for transitions with \(n_1\) = 1, \(n_1\) = 2, and \(n_1\) = 3, respectively.
(b) Use your function to calculate the wavelengths of the first lines in the Lyman, Balmer, and Paschen series.
(c) Next, use a for
loop to print the wavelenghts (in nanometers) of the first 10 lines of the Balmer series.
(d) Add one additional loop so that your code prints the wavelengths of the first 10 lines in the Lyman, Balmer, and Paschen series.
(e) Add some logic to your code so that, rather than printing each wavelength to the screen, the calculated wavelengths are stored in three corresponding lists called lyman
, balmer
, and paschen
, respectively.
(f) Plot your calculated wavelengths as vertical lines at their corresponding wavelengths using plt.vlines()
(docs)). Colour lines from the Lyman series pink, from the Balmer series blue, and from the Paschen series green. Give your plot suitable axes labels and a legend.
(g) Export your image to a file using plt.savefig('H_emission.pdf', bbox_inches='tight')
.
Note
To save a file to an image, you must call plt.savefig()
before plt.show()
. plt.show()
clears the most recent image, so if you call plt.savefig()
second, you will only create a blank image.