.. DO NOT EDIT. .. THIS FILE WAS AUTOMATICALLY GENERATED BY SPHINX-GALLERY. .. TO MAKE CHANGES, EDIT THE SOURCE PYTHON FILE: .. "api/gallery/volcanology/plot_08_libby_radiocarbon.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_volcanology_plot_08_libby_radiocarbon.py: Libby's radiocarbon dating (1949) ================================= Willard Libby reasoned that cosmic rays keep the atmosphere's carbon-14 in a steady state, that living things share it, and that it decays once they die. Arnold and Libby tested the idea on wood and grain of known historical age and found their "curve of knowns". Conventional ages still use Libby's 5568-year half-life; the better value of 5730 years makes true ages about 3% older. .. GENERATED FROM PYTHON SOURCE LINES 11-32 .. image-sg:: /api/gallery/volcanology/images/sphx_glr_plot_08_libby_radiocarbon_001.png :alt: Radiocarbon decays after death :srcset: /api/gallery/volcanology/images/sphx_glr_plot_08_libby_radiocarbon_001.png :class: sphx-glr-single-img .. code-block:: Python import matplotlib.pyplot as plt import numpy as np from earthsciencekit.units import convert from earthsciencekit.volcanology import decay_constant, parent_fraction, radiocarbon_age known = convert(np.array([1100, 2300, 3000, 3750, 4600]), "year", "s") # synthetic samples of known age fraction = parent_fraction(decay_constant(convert(5568, "year", "s")), known) assert np.allclose(radiocarbon_age(fraction), known, rtol=1e-4) cambridge = parent_fraction(decay_constant(convert(5730, "year", "s")), known) assert np.allclose(radiocarbon_age(cambridge) / known, 5568 / 5730, rtol=1e-4) age = convert(np.linspace(0, 40000, 400), "year", "s") fig, ax = plt.subplots() ax.plot(convert(age, "s", "year"), parent_fraction(decay_constant(convert(5568, "year", "s")), age), label="Libby half-life 5568 years") ax.plot(convert(known, "s", "year"), fraction, "ko", label="samples of known age") ax.set(xlabel="age [years]", ylabel="14C activity / modern", title="Radiocarbon decays after death") ax.legend() plt.show() .. rst-class:: sphx-glr-timing **Total running time of the script:** (0 minutes 0.087 seconds) .. _sphx_glr_download_api_gallery_volcanology_plot_08_libby_radiocarbon.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/volcanology/plot_08_libby_radiocarbon.ipynb :alt: Launch JupyterLite :width: 150 px .. container:: sphx-glr-download sphx-glr-download-jupyter :download:`Download Jupyter notebook: plot_08_libby_radiocarbon.ipynb ` .. container:: sphx-glr-download sphx-glr-download-python :download:`Download Python source code: plot_08_libby_radiocarbon.py ` .. container:: sphx-glr-download sphx-glr-download-zip :download:`Download zipped: plot_08_libby_radiocarbon.zip ` .. only:: html .. rst-class:: sphx-glr-signature `Gallery generated by Sphinx-Gallery `_