Learning Scientific Programming with Python (2nd edition)
P7.4.5: The Planck function
Question P7.4.5
Write a program to plot the Planck function, $B(\lambda)$, for the spectral radiance of a Black body at temperature $T$ as a function of wavelength, $\lambda$ for the Sun ($T = 5778\;\mathrm{K}$): $$ B(\lambda) = \frac{ 2hc^2 }{ \lambda^5 } \frac{ 1 }{ \exp\left( hc / \lambda k_\mathrm{B}T \right) - 1} $$ Use a NumPy array to store values of $B(\lambda)$ from 100 to 5000 nm, but set the wavelength range to decrease from 4000 nm to 0.