diff options
author | Paweł Redman <pawel.redman@gmail.com> | 2020-02-16 11:14:09 +0100 |
---|---|---|
committer | Paweł Redman <pawel.redman@gmail.com> | 2020-02-16 11:18:55 +0100 |
commit | 87eb67408f9230315494a8cf66fe264196a04ad0 (patch) | |
tree | 63ee9d8b92b7cffaa38d83b4222ffd1e391eb75b /src/planck.py |
Diffstat (limited to 'src/planck.py')
-rw-r--r-- | src/planck.py | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/src/planck.py b/src/planck.py new file mode 100644 index 0000000..711a973 --- /dev/null +++ b/src/planck.py @@ -0,0 +1,22 @@ +import matplotlib.pyplot as plt +import numpy as np +from shared import * + +plot_setup(width=0.5) + +h = 6.62607015e-34 +c = 299792458 +k_B = 1.380649e-23 + +wvl = 1e-9 * np.linspace(10, 2000, 200) + +for T in [3000, 4000, 5000]: + L = 2 * h * c ** 2 / (wvl ** 5 * (np.exp(h * c / (wvl * k_B * T)) - 1)) + plt.plot(1e+6 * wvl, 1e-12 * L, label="$T$ = %d K" % T) + +plt.xlim(0, 2) +plt.xlabel("$\\lambda~[\\mu\\mathrm{m}]$") +plt.ylabel("$L_\\lambda~\\left[\\frac{\\mathrm{kW}}{\\mathrm{sr}\\cdot\\mathrm{m}^2\\cdot\\mathrm{nm}}\\right]$") +plt.legend() +plot_grid() +plot_export() |