Skip to main content

A Python package for radioactive decay calculations that supports 1252 radionuclides, including full decay chains and branching.

Project description

radioactivedecay

PyPI PyPI - Python Version

radioactivedecay is a Python package for performing radioactive decay calculations. It supports 1252 radionuclides, including full decay chains and branching.

Installation

radioactivedecay requires Python 3.6+, NumPy and SciPy.

The easiest way to install radioactivedecay is via the Python Package index using pip:

$ pip install radioactivedecay

Usage

Example 1

radioactivedecay is based around inventories of radionuclides. These are created as follows:

>>> import radioactivedecay as rd
>>> tritium_initial = rd.Inventory({'H-3': 10.0})
>>> tritium_initial.contents
{'H-3': 10.0}

Here an inventory of 10 Bq of H-3 (tritium) was initialized by supplying a dictionary to Inventory(). Radionuclides can be specified in three equivalent ways:

  • e.g. 'Rn-222', 'Rn222' or '222Rn',
  • or 'Ir-192n', 'Ir192n' or '192nIr' (for second metastable state of Ir-192).

Calculate the radioactive decay of an inventory by:

>>> tritium_decayed = tritium_initial.decay(12.32, 'y')
>>> tritium_decayed.contents
{'H-3': 5.0}

In this example the 10 Bq of H-3 was decayed for one half-life (12.32y), yielding 5 Bq of H-3. Note the decay() function takes two arguments: the decay time and its units, e.g. 's', 'm', 'h', 'd' or 'y'.

Example 2

Inventories can contain more than one radionuclide. In this example we create an inventory that initially contains Tc-99m and I-123. The decay of this inventory demonstrates the ingrowth of radioactive progeny via decay chains. For a decay period of 20 hours:

>>> mix = rd.Inventory({'Tc-99m': 2.3, 'I-123': 5.8})
>>> mix.decay(20.0, 'h').contents
{'I-123': 2.040459244534774,
 'Tc-99': 6.729939210983381e-09,
 'Tc-99m': 0.22950748010063513,
 'Te-123': 9.4851587443927e-18,
 'Te-123m': 7.721174031572363e-07}

Tc-99 is the progeny of Tc-99m, and Te-123 and Te-123m are progeny of I-123.

Example 3

radioactivedecay includes a Radionuclide class. It can be used to fetch the half-lives of radionuclides:

>>> rd.Radionuclide('Rn-222').halflife('d')
3.8235
>>> rd.Radionuclide('C-14').halflife('y')
5700.0

The half-lives of Rn-222 and C-14 are 3.8235 days and 5700 years, respectively.

How it works

radioactivedecay uses decay data from ICRP Publication 107 (2008). https://journals.sagepub.com/doi/pdf/10.1177/ANIB_38_3

It calculates an analytical solution to the decay chain differential equations using matrix algebra. Refer to the following paper for more details on the method: M Amaku, PR Pascholati & VR Vanin, Comp. Phys. Comm. 181, 21-23 (2010) https://doi.org/10.1088/0952-4746/26/3/N02

It calls NumPy and SciPy for the matrix operations.

There is a GitHub repository with Jupyter Notebooks for creating the ICRP 107 radioactivedecay input files, code/validation tests etc.

Limitations

At present radioactivedecay has the following limitations:

  • It does not model neutronics, so it cannot calculate radioactivity from induced radioactivity or nuclear fission.
  • It cannot model external sources of radioactivity input to (or removal from) an inventory over time.
  • Care is needed when decaying backwards in time, i.e. supplying a negative argument to decay(), as this can result in numerical instabilities and nonsensical results.

There are some limitations associated with the ICRP 107 dataset:

  • ICRP 107 does not contain branching fraction data for radionuclides produced from spontaneous fission decays. Thus decayed inventories calculated using this dataset do not contain the radioactivity from spontaneous fission.
  • Data in ICRP 107 is quoted with up to 5 significant figures of precision. Round-off errors and their propagation through calculations means any results will not be more precise than this.
  • Uncertainties are not quoted for the radioactive decay data in ICRP 107. Uncertainties will vary substantially between radionuclides (typically depending on how well they have been studied to date) and will be more significant for decay calculation results than the above point on stated precision in many cases.
  • There appear to be a few instances where minor decay pathways have been missed in ICRP 107. Examples include the decays At-219-> Rn-219 (β ~3%), Es-250 -> Bk-246 (α ~1.5%), and U-228 -> Pa-228 (ε ~2.5%). For further details see the analysis of the ICRP 107 dataset in the notebooks repository.

Acknowledgements

Special thanks to assistance from

  • Center for Computational Science & e-Systems, Japan Atomic Energy Agency
  • Kenny McKee

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

radioactivedecay-0.0.5.tar.gz (100.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

radioactivedecay-0.0.5-py3-none-any.whl (97.2 kB view details)

Uploaded Python 3

File details

Details for the file radioactivedecay-0.0.5.tar.gz.

File metadata

  • Download URL: radioactivedecay-0.0.5.tar.gz
  • Upload date:
  • Size: 100.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/47.2.0 requests-toolbelt/0.9.1 tqdm/4.46.0 CPython/3.6.9

File hashes

Hashes for radioactivedecay-0.0.5.tar.gz
Algorithm Hash digest
SHA256 c67f90376b7a94a66fc47dc2714928c2aafc7aec2ce85c0c5b91959498ea7753
MD5 c09c00cc78deb7d0e971d332d2b3fa81
BLAKE2b-256 b4e8a8247b32a9172692e6825bec0e6cf1fb640adfc08ff28b5a47ae32236402

See more details on using hashes here.

File details

Details for the file radioactivedecay-0.0.5-py3-none-any.whl.

File metadata

  • Download URL: radioactivedecay-0.0.5-py3-none-any.whl
  • Upload date:
  • Size: 97.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/47.2.0 requests-toolbelt/0.9.1 tqdm/4.46.0 CPython/3.6.9

File hashes

Hashes for radioactivedecay-0.0.5-py3-none-any.whl
Algorithm Hash digest
SHA256 ce2134f954f2143df69bbd07cb3ddad895b630e4c814e8e3de7da0e5b3a534ea
MD5 6ea2f085092e263c55cf846fc71db88c
BLAKE2b-256 f5c94c8de444cb468b2f793132b6dd5b736cd93ee491f80ca2f14c6cb21b320f

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page