{ "cells": [ { "cell_type": "markdown", "metadata": { "collapsed": true }, "source": [ "## Finding maximum values\n", "\n", "This workbook calculates the black-body spectra of 'hot' objects, in this case a hot cup of tea and a person. \n", "\n", "To do this the code includes examples of how to find the maximum value of a numpy array, using np.amax(), and the array index that this corresponds to, using np.argmax().\n", "\n", "In the case of black-body radiation, we can use these two functions to find the wavelength at which the spectral intensity is a maximum, and the maximum intensity.\n", "\n", "The Planck equation describes a blackbody radiation curve. It is a historically important equation in quantum theory, because it was the first use of quantisation of energy. \n", "\n", "\$$\n", "I_{\\lambda, T} = \\frac{2hc^2}{\\lambda ^5 e^{\\frac{hc}{\\lambda k_B T}}-1}\n", "\$$\n", "\n", "This notebook uses a [function](http://blogs.bath.ac.uk/python/functions/) to calculate the intensity of the radiation at each wavelength.\n", "\n", "Other techniques used in this notebook are:\n", "- [scipy.constants](http://blogs.bath.ac.uk/python/working-with-physical-constants-and-units/) is used to import the physical constants $c$, $h$, and $k_\\mathrm{B}$.\n", "- matplotlib.pyplot is used to plot the calculated spectra.\n", "- numpy is used for handling the arrays used in the calculations.\n", "- np.argmax and np.amax are used to find the wavelength of the maximum value and the maximum intensity, respectively.\n", "\n", "Some other useful things to note...\n", "- You can enter greek letters into print statements by typing the LaTeX command and pressing tab at the end of the word, so \\mu+'tab' changes in your notebook to read $\\mu$.\n", "- You can change the colour of the lines on your plot. In my plot statements you can see the use of 'c-' and 'm-', which colours the lines cyan and magenta respectively.\n", "- Other colours include 'k-' for black, 'r-' for red, 'g-' for green, and 'b-' for blue. A [whole range of named colours](https://matplotlib.org/examples/color/named_colors.html) can be used in matplotlib, but these are most of the single letter colours.\n", "- In the final cell we use a more advanced Jupyter notebook technique, to create a Markdown object using code, and then display it. This allows us to combine the results from our calculation with the nice formatting available with LaTeX and Markdown. The details of how this works, and an introduction to formatted print, and using LaTeX in Markdown will all be topics covered in future notebooks." ] }, { "cell_type": "code", "execution_count": 2, "metadata": {}, "outputs": [ { "data": { "image/png": "iVBORw0KGgoA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Z0IPJaq5+HGvNKd3un9X0/Fz5cb92FAtfsZ+wtQlIhzsW4ujDHG9JkI\n1UfGGGPiZEnBGGNMH0sKxhhj+lhSMMYY08eSgjHGmD6WFIwxxvSxpGCMMaaPJQVj+hGRQ0Rkq4j8\nvyG2+7WIfCRRcRmTCJYUjOlHVd/G6fLh0iE2PRr4h/cRGZM4lhSMGVg9cHCslSKyAFivquEB1r0o\nIvPd+RIRWS0ile4IWneIyHoRuVtEThGR/3VH0Vri3akYEz9LCsYM7MdApojMjLH+TODJGOvm4PS1\nBU4fSW9HLb8Jp4vt+cD/xekP6ivAN8YgZmNGzZKCMf2IyJlADvA4sUsLpzNAUnCTSK2q9g5YcyhO\nh2YAm1X1bXfdOzjDKipO0qgcuzMwZuQsKRgTRURCOOMT/zPOl/XCAbbJBgpVdfsAu1jEB0kA4Iio\n551RyyNRzyM4g6oY4ztLCsbs71vAnaq6hRhJAfgYzngDAzkMCAGIyFzgXD6oPjIm6VlSMMblDmhy\nKs6YxRA7KQzWnrAICIjISuDbOAOjXBZjW2OSjo2nYMwwicibwFGq2j3AuveAxaranPjIjBk9q8c0\nZpjUGRj+Q9yhINUSgkllVlIwxhjTx9oUjDHG9LGkYIwxpo8lBWOMMX0sKRhjjOljScEYY0wfSwrG\nGGP6WFIwxhjT5/8DgdsOr9EIDQsAAAAASUVORK5CYII=\n", "text/plain": [ "" ] }, "metadata": {}, "output_type": "display_data" }, { "name": "stdout", "output_type": "stream", "text": [ "λ max = 7.983 μm\n", "I max = 25814151.3197 J m^2\n" ] } ], "source": [ "import matplotlib.pyplot as plt\n", "import numpy as np\n", "from scipy.constants import h #Planck's constant\n", "from scipy.constants import c #speed of light\n", "from scipy.constants import k #Boltzmann constant\n", "from IPython.display import Markdown as md\n", "#\n", "def planck(lambdanm, T):\n", " intensity = 2.0*h*c**2/ ( (lambdanm**5) * (np.exp(h*c/(lambdanm*k*T)) - 1.0) )\n", " return intensity\n", "#\n", "## wavelengths in increments from 100nm to 60 um in 1 nm increments\n", "wavelengths = np.arange(100e-9, 60e-6, 1e-9) \n", "#\n", "## intensity at 363K, 310K\n", "intensity363 = planck(wavelengths, 363.) #hotcupoftea\n", "#intensity310 = planck(wavelengths, 310.) #person\n", "\n", "#note the use of the multiplier on the wavelengths such that it willnow have units of μm\n", "plt.plot(wavelengths*1e6, intensity363, 'c-', label='363 K') #hotcupoftea - cyan\n", "#plt.plot(wavelengths*1e6, intensity310, 'm-', label='310') #person - magenta\n", "\n", "plt.title('Black body radiation curves')\n", "plt.legend() # Shows the legend\n", "plt.xlabel('$\\lambda$ / $\\mu$m')\n", "plt.ylabel('intensity')\n", "## show the plot\n", "plt.show()\n", "\n", "print (\"λ max =\", wavelengths[np.argmax(intensity363)]*1e6, \"μm\")#maximum wavelength of emission, np.argmax(intensity373,axis=0)] is pulling the maximum value from the intensity array and then matching it to the corresponding wavelength in put to the calculation\n", "#you can get the mu symbol by typing in the latex for it then pressing tab! so \\mu tab!\n", "print (\"I max = \", np.amax(intensity363), \"J m^2\")" ] }, { "cell_type": "code", "execution_count": 3, "metadata": {}, "outputs": [ { "data": { "text/markdown": [ "$\\lambda_\\mathrm{max}$ = 7.983 $\\mu$m" ], "text/plain": [ "" ] }, "metadata": {}, "output_type": "display_data" }, { "data": { "text/markdown": [ "$I_\\mathrm{max}$ = 2.581e+07 J m$^{-2}$." ], "text/plain": [ "" ] }, "metadata": {}, "output_type": "display_data" } ], "source": [ "from IPython.display import Markdown as md\n", "lambda_max = wavelengths[ np.argmax( intensity363 ) ] \n", "display( md(r\"$\\lambda_\\mathrm{{max}}$ = {:.3f} $\\mu$m\".format( lambda_max * 1e6 ) ) )\n", "display( md(r\"$I_\\mathrm{{max}}$ = {:.3e} J m$^{{-2}}$.\".format( np.max( intensity363 ) ) ) )" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [] } ], "metadata": { "kernelspec": { "display_name": "Python 3", "language": "python", "name": "python3" }, "language_info": { "codemirror_mode": { "name": "ipython", "version": 3 }, "file_extension": ".py", "mimetype": "text/x-python", "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", "version": "3.6.1" } }, "nbformat": 4, "nbformat_minor": 2 }