{ "info": { "author": "Tristan Snowsill", "author_email": "tristan.snowsill@googlemail.com", "bugtrack_url": null, "classifiers": [], "description": "\ufeff========================\n Monte Carlo integrator\n========================\n\nThis package provides a Monte Carlo integrator which can be used to evaluate\nmulti-dimensional integrals. The results are numerical approximations which are\ndependent on the use of random number generation.\n\nExample 1\n=========\n\nIn this example we compute :math:`\\int_0^1 x^2 dx`::\n\n import mcint\n import random\n \n def integrand(x): # Describe the function being integrated\n return (x**2)\n \n def sampler(): # Describe how Monte Carlo samples are taken\n while True:\n yield random.random()\n \n result, error = mcint.integrate(integrand, sampler(), measure=1.0, n=100)\n \n print \"The integral of x**2 between 0 and 1 is approximately\", result\n\nThe second argument to the integrate() function should be an iterable\nexpression, in this case it is a generator. We could do away with this sampler\nusing the following::\n\n result, error = mcint.integrate(integrand, iter(random.random, -1), measure=1.0, n=100)\n\nThis creates an iterable object from the random.random() function which will\ncontinuously call random.random() until it returns -1 (which it will never do as\nit returns values between 0.0 and 1.0.\n\nExample 2\n=========\n\nIn this example we compute :math:`\\int_0^1 \\int_0^\\sqrt{1-y^2} x^2+y^2 dx dy`::\n\n import mcint\n import random\n import math\n \n def integrand(x):\n return (x[0]**2 + x[1]**2)\n \n def sampler():\n while True:\n y = random.random()\n x = random.random()\n if x**2+y**2 <= 1:\n yield (x,y)\n \n result, error = mcint.integrate(integrand, sampler(), measure=math.pi/4)", "description_content_type": null, "docs_url": null, "download_url": "UNKNOWN", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "http://pypi.python.org/pypi/mcint/", "keywords": null, "license": "Creative Commons Attribution-Noncommercial-Share Alike license", "maintainer": null, "maintainer_email": null, "name": "mcint", "package_url": "https://pypi.org/project/mcint/", "platform": "UNKNOWN", "project_url": "https://pypi.org/project/mcint/", "project_urls": { "Download": "UNKNOWN", "Homepage": "http://pypi.python.org/pypi/mcint/" }, "release_url": "https://pypi.org/project/mcint/0.1dev5/", "requires_dist": null, "requires_python": null, "summary": "A simple tool to perform numerical integration using Monte Carlo techniques.", "version": "0.1dev5" }, "last_serial": 794582, "releases": { "0.1dev1": [ { "comment_text": "", "digests": { "md5": "d36a3e3ef6565bdbabaf512e1afe6557", "sha256": "9745ead2bb29e5a27f29f67feaaffe9766ff8483102419cab9d9144dbc210b1d" }, "downloads": -1, "filename": "mcint-0.1dev1.zip", "has_sig": false, "md5_digest": "d36a3e3ef6565bdbabaf512e1afe6557", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 2730, "upload_time": "2011-12-27T02:23:05", "url": "https://files.pythonhosted.org/packages/24/2b/9d85f38af1126f50d42e0441850d1cb7b5ca9777356b4b81173ed3441113/mcint-0.1dev1.zip" } ], "0.1dev2": [ { "comment_text": "", "digests": { "md5": "8885a295786b94c8cad2b169f2d0ce99", "sha256": "72d1f97cca1f414ece29be7a274103d42ea651ea9f0787067bcacffe6081652b" }, "downloads": -1, "filename": "mcint-0.1dev2.zip", "has_sig": false, "md5_digest": "8885a295786b94c8cad2b169f2d0ce99", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 2760, "upload_time": "2011-12-27T02:34:31", "url": "https://files.pythonhosted.org/packages/3d/3e/b506b2bc665f7f29f5b88c47d85a51edd9a2a27daa6029b15ceb20c415b8/mcint-0.1dev2.zip" } ], "0.1dev3": [ { "comment_text": "", "digests": { "md5": "1836129362172c6ab7fcc5be5c0d9506", "sha256": "881609b90772ab1b520bd2a2df7db5a260508075bdd0def3550e7eb7b1c7148e" }, "downloads": -1, "filename": "mcint-0.1dev3.zip", "has_sig": false, "md5_digest": "1836129362172c6ab7fcc5be5c0d9506", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 2863, "upload_time": "2011-12-29T15:42:33", "url": "https://files.pythonhosted.org/packages/1e/e5/58128029843be2b8f5b8e0d814e77e8eb3fb06cceae8451b7dc86173b588/mcint-0.1dev3.zip" } ], "0.1dev4": [ { "comment_text": "", "digests": { "md5": "73afa9719c9d89e58ab6a805012e5ac1", "sha256": "455d9aaaaa258e03f996e73d74bfe9d0eac7715c89e71ac34381bd63f82c602f" }, "downloads": -1, "filename": "mcint-0.1dev4.zip", "has_sig": false, "md5_digest": "73afa9719c9d89e58ab6a805012e5ac1", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 2889, "upload_time": "2011-12-29T15:45:41", "url": "https://files.pythonhosted.org/packages/c0/8c/f94667d00b31e7d565c3a018a2c6cbb6e791b04b4a92edf0ee6f83904493/mcint-0.1dev4.zip" } ], "0.1dev5": [ { "comment_text": "", "digests": { "md5": "2f8d65a42f38e3640b61f074e280982a", "sha256": "7d199285b32ae774f7e7eb6109aa25eec5bde42194ec67d1169324f9a80762d6" }, "downloads": -1, "filename": "mcint-0.1dev5.zip", "has_sig": false, "md5_digest": "2f8d65a42f38e3640b61f074e280982a", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 3318, "upload_time": "2011-12-29T15:56:22", "url": "https://files.pythonhosted.org/packages/84/ce/29cc66a162c508a81de591c3033bb0d30ee111cd0fefc054d4bb263cfe42/mcint-0.1dev5.zip" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "2f8d65a42f38e3640b61f074e280982a", "sha256": "7d199285b32ae774f7e7eb6109aa25eec5bde42194ec67d1169324f9a80762d6" }, "downloads": -1, "filename": "mcint-0.1dev5.zip", "has_sig": false, "md5_digest": "2f8d65a42f38e3640b61f074e280982a", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 3318, "upload_time": "2011-12-29T15:56:22", "url": "https://files.pythonhosted.org/packages/84/ce/29cc66a162c508a81de591c3033bb0d30ee111cd0fefc054d4bb263cfe42/mcint-0.1dev5.zip" } ] }