{ "info": { "author": "Bj\u00f6rn Dahlgren", "author_email": "bjodah@DELETEMEgmail.com", "bugtrack_url": null, "classifiers": [ "Development Status :: 4 - Beta", "License :: OSI Approved :: BSD License", "Operating System :: OS Independent", "Topic :: Scientific/Engineering", "Topic :: Scientific/Engineering :: Mathematics" ], "description": "batemaneq\n=========\n\n.. image:: http://hera.physchem.kth.se:9090/api/badges/bjodah/batemaneq/status.svg\n :target: http://hera.physchem.kth.se:9090/bjodah/batemaneq\n :alt: Build status\n.. image:: https://img.shields.io/pypi/v/batemaneq.svg\n :target: https://pypi.python.org/pypi/batemaneq\n :alt: PyPI version\n.. image:: https://img.shields.io/badge/python-2.7,3.4,3.5-blue.svg\n :target: https://www.python.org/\n :alt: Python version\n.. image:: https://img.shields.io/pypi/l/batemaneq.svg\n :target: https://github.com/bjodah/batemaneq/blob/master/LICENSE\n :alt: License\n.. image:: http://hera.physchem.kth.se/~batemaneq/branches/master/htmlcov/coverage.svg\n :target: http://hera.physchem.kth.se/~batemaneq/branches/master/htmlcov\n :alt: coverage\n\n\n``batemaneq`` provides a `C++ implementation `_ of the `Bateman equation `_,\nand a `Python `_ bidning thereof.\n\nDocumentation\n-------------\nAutogenerated API documentation is found here: ``_\n(and dev docs are here: ``_).\n\nInstallation\n------------\nSimplest way to install batemaneq and is to use `pip` (requires a C++11 compliant compiler to be installed for the C++ version):\n\n::\n\n $ pip install batemaneq\n\nor using the `conda package manager `_:\n\n::\n\n $ conda install -c bjodah batemaneq pytest\n $ python -m pytest --pyargs batemaneq\n\n\nExamples\n--------\nSee `examples/ `_, and rendered jupyter notebooks here:\n``_\n\n\nThe Thorium series\n^^^^^^^^^^^^^^^^^^\nHalf-lives shorter than 1h excluded from the `decay chain `_:\n\nIn Python:\n\n.. code:: python\n\n >>> from batemaneq import bateman_parent\n >>> from math import log as ln\n >>> d = 1./365 # Th-232 Ra-228 Ac-228 Th-228\n >>> h = d/24 # Ra-224 Pb-212 Bi-212 (Pb-208)\n >>> Thalf = [1.405e10, 5.75, 6.25*h, 1.9116, 3.6319*d, 10.64*h, 60.55/60*h]\n >>> bateman_parent([ln(2)/x for x in Thalf], 100) # 100 years\n [0.99999999506656811, 4.0925028658312447e-10, 5.0780510011876959e-14, 1.3605575316895603e-10, 7.0820811723290359e-13, 8.6448488319470398e-14, 8.1993357876381666e-15]\n\nIn C++:\n\n.. code:: C++\n\n #include \n #include \n #include \n #include \n #include \"bateman.hpp\"\n\n using vec_t = std::vector;\n double exp_cb(double arg){\n return std::exp(arg);\n }\n\n int main(){\n double one = 1;\n double d = one/365;\n double h = d/24;\n double ln2 = std::log(2);\n vec_t lmbd {{ ln2/1.405e10, ln2/5.75, ln2/(6.25*h),\n ln2/1.9116, ln2/(3.6319*d), ln2/(10.64*h), ln2/(60.55/60*h) }};\n auto p = bateman::bateman_parent(lmbd, 100.0, exp_cb);\n std::cout << std::setprecision(17); // all significant digits\n for (auto v : p)\n std::cout << v << \" \";\n std::cout << std::endl;\n return 0;\n }\n\n::\n\n $ g++ -std=c++11 double.cpp -I../include\n $ ./a.out\n 0.99999999506656811 4.0925028658312447e-10 5.0780510011876959e-14 1.3605575316895603e-10 7.0820811723290359e-13 8.6448488319470398e-14 8.1993357876381666e-15\n\nIn C++ using ``boost::multiprecision::cpp_dec_float_50``:\n\n.. code:: C++\n\n #include \n #include \n #include \n #include \n #include \"bateman.hpp\"\n\n using Real_t = boost::multiprecision::cpp_dec_float_50;\n using vec_t = std::vector;\n Real_t exp_cb(Real_t arg){\n return boost::multiprecision::exp(arg);\n }\n\n int main(){\n Real_t one = 1;\n Real_t d = one/365;\n Real_t h = d/24;\n Real_t ln2 = boost::multiprecision::log(2*one);\n vec_t lmbd {{ ln2/1.405e10, ln2/5.75, ln2/(6.25*h),\n ln2/1.9116, ln2/(3.6319*d), ln2/(10.64*h), ln2/(60.55/60*h) }};\n auto p = bateman::bateman_parent(lmbd, static_cast(100), exp_cb);\n std::cout << std::setprecision(30); // show 30 of our 50 digits\n for (auto v : p)\n std::cout << v << \" \";\n std::cout << std::endl;\n return 0;\n }\n\n\n::\n\n $ g++ -std=c++11 multi.cpp -I../include\n $ ./a.out\n 0.999999995066568122063002778128 4.09250286583124398565537707859e-10 5.07805100118769662240802082504e-14 1.3605575316895606205575997585e-10 7.08208117232903695657287769184e-13 8.6448488319470425326824303941e-14 8.19933578763816849146541981927e-15\n\nWe see that the concentration of the final nuclide only varies in the 15th decimal place (we had no catastropic cancelation in this example).\n\nLicense\n=======\nThe source code is Open Source and is released under the very permissive\n\"simplified (2-clause) BSD license\". See ``LICENSE.txt`` for further details.\n\nContributors are welcome to suggest improvements at https://github.com/bjodah/batemaneq\n\nAuthor\n======\nBj\u00f6rn I. Dahlgren, contact:\n\n- gmail address: bjodah\n- kth.se address: bda", "description_content_type": null, "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/bjodah/batemaneq", "keywords": "", "license": "BSD", "maintainer": "", "maintainer_email": "", "name": "batemaneq", "package_url": "https://pypi.org/project/batemaneq/", "platform": "", "project_url": "https://pypi.org/project/batemaneq/", "project_urls": { "Homepage": "https://github.com/bjodah/batemaneq" }, "release_url": "https://pypi.org/project/batemaneq/0.2.0/", "requires_dist": null, "requires_python": "", "summary": "batemaneq provides a Python package for evaluating the Bateman equation", "version": "0.2.0" }, "last_serial": 3151821, "releases": { "0.1.0": [ { "comment_text": "", "digests": { "md5": "428f7e11bd52c0b07e1e9f14ec8ffd3d", "sha256": "e7b2acd481666ec530481b767974e0c2f6c7789158c6a12a08dd1545193dc9ce" }, "downloads": -1, "filename": "batemaneq-0.1.0.tar.gz", "has_sig": false, "md5_digest": "428f7e11bd52c0b07e1e9f14ec8ffd3d", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 47322, "upload_time": "2016-02-04T17:02:25", "url": "https://files.pythonhosted.org/packages/fa/53/b01cc0a7a39493369b06ac5179f9516e874c32da141a6e433032c8ea495c/batemaneq-0.1.0.tar.gz" } ], "0.2.0": [ { "comment_text": "", "digests": { "md5": "7ee8ff5c02d1198231475ac0cc931690", "sha256": "90941cd026793d27eefc756c10135a0800f29fe7feb2e5700f68200f09b80651" }, "downloads": -1, "filename": "batemaneq-0.2.0.tar.gz", "has_sig": false, "md5_digest": "7ee8ff5c02d1198231475ac0cc931690", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 58314, "upload_time": "2017-09-05T23:49:19", "url": "https://files.pythonhosted.org/packages/1c/a9/39470bf895909ed5b0c83a8a70b0d0063ef430ae39ab5c42dcdc24b9fc19/batemaneq-0.2.0.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "7ee8ff5c02d1198231475ac0cc931690", "sha256": "90941cd026793d27eefc756c10135a0800f29fe7feb2e5700f68200f09b80651" }, "downloads": -1, "filename": "batemaneq-0.2.0.tar.gz", "has_sig": false, "md5_digest": "7ee8ff5c02d1198231475ac0cc931690", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 58314, "upload_time": "2017-09-05T23:49:19", "url": "https://files.pythonhosted.org/packages/1c/a9/39470bf895909ed5b0c83a8a70b0d0063ef430ae39ab5c42dcdc24b9fc19/batemaneq-0.2.0.tar.gz" } ] }