{ "info": { "author": "Sebastian Mueller", "author_email": "info@geostat-framework.org", "bugtrack_url": null, "classifiers": [ "Development Status :: 5 - Production/Stable", "Intended Audience :: Developers", "Intended Audience :: End Users/Desktop", "Intended Audience :: Science/Research", "License :: OSI Approved :: MIT License", "Natural Language :: English", "Operating System :: Unix", "Programming Language :: Python", "Programming Language :: Python :: 2", "Programming Language :: Python :: 3", "Topic :: Scientific/Engineering", "Topic :: Utilities" ], "description": "# Welcome to pentapy\n\n[](https://doi.org/10.5281/zenodo.2587158)\n[](https://badge.fury.io/py/pentapy)\n[](https://travis-ci.org/GeoStat-Framework/pentapy)\n[](https://ci.appveyor.com/project/GeoStat-Framework/pentapy/branch/master)\n[](https://coveralls.io/github/GeoStat-Framework/pentapy?branch=master)\n[](https://geostat-framework.readthedocs.io/projects/pentapy/en/latest/?badge=latest)\n[](https://github.com/ambv/black)\n\n\n## Purpose\n\npentapy is a toolbox to deal with pentadiagonal matrices in Python.\n\nPentadiagonal linear equation systems arise in many areas of science and engineering:\ne.g. when solving differential equations, in interpolation problems, or in numerical schemes like finite difference.\n\n\n## Installation\n\nThe package can be installed via [pip][pip_link].\nOn Windows you can install [WinPython][winpy_link] to get Python and pip running.\n\n pip install pentapy\n\nThere are pre-built wheels for Linux, MacOS and Windows for most Python versions (2.7, 3.4-3.7).\n\nIf your system is not supported and you want to have the Cython routines of\npentapy installed, you have to provide a c-compiler and run:\n\n pip install numpy cython\n pip install pentapy\n\nTo get the scipy solvers running, you have to install scipy or you can use the\nfollowing extra argument:\n\n pip install pentapy[all]\n\nInstead of \"all\" you can also typ \"scipy\" or \"umfpack\" to get one of these specific packages.\n\n\n## References\n\nThe solver is based on the algorithms PTRANS-I and PTRANS-II\npresented by [Askar et al. 2015][ref_link].\n\n\n## Documentation and Examples\n\nYou can find the documentation under [geostat-framework.readthedocs.io][doc_link].\n\n### Solving a pentadiagonal linear equation system\n\nThis is an example of how to solve a LES with a pentadiagonal matrix.\n\n```python\nimport numpy as np\nimport pentapy as pp\n\nsize = 1000\n# create a flattened pentadiagonal matrix\nM_flat = (np.random.random((5, size)) - 0.5) * 1e-5\nV = np.random.random(size) * 1e5\n# solve the LES with M_flat as row-wise flattened matrix\nX = pp.solve(M_flat, V, is_flat=True)\n\n# create the corresponding matrix for checking\nM = pp.create_full(M_flat, col_wise=False)\n# calculate the error\nprint(np.max(np.abs(np.dot(M, X) - V)))\n```\n\nThis should give something like:\n```python\n4.257890395820141e-08\n```\n\n### Performance\n\nIn the following a couple of solvers for pentadiagonal systems are compared:\n\n* Solver 1: Standard linear algebra solver of Numpy [``np.linalg.solve``](https://www.numpy.org/devdocs/reference/generated/numpy.linalg.solve.html)\n* Solver 2: [``scipy.sparse.linalg.spsolve``](http://scipy.github.io/devdocs/generated/scipy.sparse.linalg.spsolve.html)\n* Solver 3: Scipy banded solver [``scipy.linalg.solve_banded``](scipy.github.io/devdocs/generated/scipy.linalg.solve_banded.html)\n* Solver 4: pentapy.solve with ``solver=1``\n* Solver 5: pentapy.solve with ``solver=2``\n\n
\n
\n