# Black body energy as a sum of photon oscillator energies

Tags: physics, gnuplot, software

This is a graph I made for contributing to Wikipedia. It shows the energy of a black body as the sum of energies from oscillators with 1 photon, 2 photons, 3 photons, etc.

This is a graph I made for contributing to Wikipedia. There was originally a raster graphics image in the PNG format. But, it needed to be recreated using vector graphics in the SVG format. I couldn't find the source for the original image. So, I redid it from scratch. You can find the gnuplot script on the bottom of this page for any future modifications. Apart from gnuplot, you will need pdflatex from TeX Live to produce the PDF and pdf2svg to convert it to SVG.

The graph shows the energy of a black body as the cumulative sum of energies from oscillators with 1 photon, 2 photons, 3 photons, etc. represented by dot-dashed lines.

The probability of an oscillator having $$n$$ photons is given by $P(n) = e^{\frac{nh\nu}{kT}} (1 - e^{-\frac{h\nu}{kT}})$

The energy contribution of an oscillator with $$n$$ photons is given by $E_n = nh\nu P(n) = nh\nu e^{-\frac{nh\nu}{kT}} (1 - e^{-\frac{h\nu}{kT}})$

The average black body energy is the sum of contributions from all oscillators. $E = \sum_{n=1}^{\infty} nh\nu P(n) = \frac{h\nu}{e^{\frac{h\nu}{kT}} - 1}$

Please refer to https://disciplinas.stoa.usp.br/pluginfile.php/48089/course/section/16461/qsp_chapter10-plank.pdf for a much more complete treatment of the derivation.