.. DO NOT EDIT. .. THIS FILE WAS AUTOMATICALLY GENERATED BY SPHINX-GALLERY. .. TO MAKE CHANGES, EDIT THE SOURCE PYTHON FILE: .. "api/gallery/climate/plot_03_stefan_t4_law.py" .. LINE NUMBERS ARE GIVEN BELOW. .. only:: html .. note:: :class: sphx-glr-download-link-note :ref:`Go to the end ` to download the full example code or to run this example in your browser via JupyterLite. .. rst-class:: sphx-glr-example-title .. _sphx_glr_api_gallery_climate_plot_03_stefan_t4_law.py: Stefan's fourth-power law (1879) ================================ Josef Stefan noticed that John Tyndall's measurements of a glowing platinum wire fit a simple law. The wire radiated 11.7 times more at 1200 °C than at 525 °C, and the ratio of the absolute temperatures to the fourth power is 11.6. Boltzmann derived the law from thermodynamics in 1884. It gives the outgoing longwave radiation of every planet. .. GENERATED FROM PYTHON SOURCE LINES 11-33 .. image-sg:: /api/gallery/climate/images/sphx_glr_plot_03_stefan_t4_law_001.png :alt: Emission grows as the fourth power of temperature :srcset: /api/gallery/climate/images/sphx_glr_plot_03_stefan_t4_law_001.png :class: sphx-glr-single-img .. code-block:: Python import matplotlib.pyplot as plt import numpy as np from earthsciencekit.climate import outgoing_longwave from earthsciencekit.units import convert cool, hot = convert(np.array([525.0, 1200.0]), "degC", "K") ratio = outgoing_longwave(hot, 1) / outgoing_longwave(cool, 1) assert np.isclose(ratio, 11.6, atol=0.05) temperature = np.geomspace(150, 2000, 200) flux = outgoing_longwave(temperature, 1) np.testing.assert_allclose(np.gradient(np.log(flux), np.log(temperature)), 4) fig, ax = plt.subplots() ax.loglog(temperature, flux, label="blackbody, slope 4") ax.loglog([cool, hot], outgoing_longwave(np.array([cool, hot]), 1), "o", label=f"Tyndall's wire, ratio {ratio:.1f}") ax.loglog(255, outgoing_longwave(255, 1), "s", label="Earth's emission") ax.set(xlabel="temperature [K]", ylabel="emitted flux [W/m²]", title="Emission grows as the fourth power of temperature") ax.legend() plt.show() .. rst-class:: sphx-glr-timing **Total running time of the script:** (0 minutes 0.189 seconds) .. _sphx_glr_download_api_gallery_climate_plot_03_stefan_t4_law.py: .. only:: html .. container:: sphx-glr-footer sphx-glr-footer-example .. container:: lite-badge .. image:: images/jupyterlite_badge_logo.svg :target: ../../../lite/lab/index.html?path=api/gallery/climate/plot_03_stefan_t4_law.ipynb :alt: Launch JupyterLite :width: 150 px .. container:: sphx-glr-download sphx-glr-download-jupyter :download:`Download Jupyter notebook: plot_03_stefan_t4_law.ipynb ` .. container:: sphx-glr-download sphx-glr-download-python :download:`Download Python source code: plot_03_stefan_t4_law.py ` .. container:: sphx-glr-download sphx-glr-download-zip :download:`Download zipped: plot_03_stefan_t4_law.zip ` .. only:: html .. rst-class:: sphx-glr-signature `Gallery generated by Sphinx-Gallery `_