Skip to main content

GWR Algorithm Numerical Laplace Inversion

Project description

Gaver-Wynn-Rho Algorithm

This is a Python reproduction of the Mathematica package that provides the GWR function, NumericalLaplaceInversion.m.

https://library.wolfram.com/infocenter/MathSource/4738/

This package provides only one function: gwr. The function calculates the value of the inverse of a Laplace transform at a specified time value, Sequence of time values, or numpy array of time values.

The Laplace transform should be provided as a function that uses the mpmath library for a scalar value of the Laplace parameter. The math library and numpy functions do not support multiprecision math and will return invalid results if they are used.

Simple Example

>>> import math
>>> from petbox.gwr import gwr
>>> from mpmath import mp

>>> def lap_ln_fn(s: float):
...     # log function
...     return -mp.log(s) / s - 0.577216 / s

>>> gwr(lap_log_fn, time=5.0, M=32)
    mpf('1.6094375773356333')

>>> math.log(5.0)
1.6094379124341003

See the notebooks in test\ for other use examples.

The method is described in: Valkó, P.P., and Abate J. 2002. Comparison of Sequence Accelerators for the Gaver Method of Numerical Laplace Transform Inversion. Computers and Mathematics with Application 48 (3): 629–636. https://doi.org/10.1016/j.camwa.2002.10.017.

More information on multi-precision inversion can be found in: Valkó, P.P.and Vajda, S. 2002. Inversion of Noise-Free Laplace Transforms: Towards a Standardized Set of Test Problems. Inverse Problems in Engineering 10 (5): 467-483. https://doi.org/10.1080/10682760290004294.

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

gwr-inversion-1.0.0.tar.gz (3.1 kB view details)

Uploaded Source

Built Distribution

gwr_inversion-1.0.0-py3-none-any.whl (3.1 kB view details)

Uploaded Python 3

File details

Details for the file gwr-inversion-1.0.0.tar.gz.

File metadata

  • Download URL: gwr-inversion-1.0.0.tar.gz
  • Upload date:
  • Size: 3.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/2.0.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/49.2.0 requests-toolbelt/0.9.1 tqdm/4.48.0 CPython/3.7.6

File hashes

Hashes for gwr-inversion-1.0.0.tar.gz
Algorithm Hash digest
SHA256 a9d255fdb2be8dd6415532f658425f29f4dcf3dca0f508c3c35dcc8d680b20a6
MD5 7b02c9b18f6d882ae3c4145e3053b3c2
BLAKE2b-256 5a981574497278dd4af7d81704d320ee9573fecb26a3915910af8ad8092228d6

See more details on using hashes here.

File details

Details for the file gwr_inversion-1.0.0-py3-none-any.whl.

File metadata

  • Download URL: gwr_inversion-1.0.0-py3-none-any.whl
  • Upload date:
  • Size: 3.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/2.0.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/49.2.0 requests-toolbelt/0.9.1 tqdm/4.48.0 CPython/3.7.6

File hashes

Hashes for gwr_inversion-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 9ea68f0d6e97d5b124fd4f65257bdd3c0ba3b4cd9d1ba1319b3a31b51aa691ad
MD5 bf0d75279c7acf65174186f4d56c9ad4
BLAKE2b-256 9acff3b56dfec168e1b10cfcb326229a225e4af189258f7f6bffcb7ef23fb581

See more details on using hashes here.

Supported by

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