Implementation of the Pade-partial fraction approximation for inverting the Laplace transform of the first passage time distribution.
Project description
Pade-Partial Fraction Approximation
This package is an implementation of the Pade-partial fraction approximation for the inversion of the Laplace transform as proposed in Computation of the Distribution of the Absorption Time of the Drifted Diffusion with Stochastic Resetting and Mixed Boundary Conditions by Turin, Magalang, Aguilar, Colombani, Sanchez-Taltavull, and Gatto[^1]
Installation
Install the package from PyPI:
pip install ppf_approx
Usage
The main function of this package is the ppf function, with the following syntax:
ppf(m_ord, n_ord, v, D, x0, r, tval, correction = True)
Here is a description of each argument:
m_ord: Integer. Numerator order of the Pade approximation.n_ord: Integer. Denominator order of the Pade approximation.v: Float. Drift constant.D: Float. Diffusion constant. Must be positive.x0: Float. Initial position. Must be from $0 \leq x_0 < 1$r: Float. Resetting constant. Must be non-negative.tval: Array. Range of time values at which the PPF will be performed. Single values are accepted.correction: Boolean, optional. Determines whether the PPF will perform the correction steps or not. The default is True.
The function can be used to generate whole distributions $t \in [0, \infty]$, segments $t \in [t_1, t_2]$, or single values of time $t$. The outputs will always be in arrays. This is an example of the usage of the ppf function:
import numpy as np
import ppf_approx
v = -0.01
D = 0.0001
x0 = 0.8
r = (1/3)*(1/365)
tvals = np.linspace(0,200, 10)
app_fptvals = ppf(2, 3, v, D, x0, r, tvals)
Sample output:
>>> app_fptvals
array([0., 0., 0.01115898, 0.01866108, 0.01345554, 0.00637309, 0.00200653, 0.00027748, 0., 0.])
Auxiliary Functions
This package also contains auxiliary functions which are expressions for the bounded and biased Brownian motion with stochastic resetting that were derived in the reference[^1]:
lt_fptdcomputes for the Laplace-transformed FPT distribution.mfptcomputes for the analytical mean FPT from the Laplace-transformed FPT distribution.
[^1]: Turin, R., Magalang, J., Aguilar, J., Colombani, L., Sanchez-Taltavull, D., & Gatto, R. (2024). Computation of the distribution of the absorption time of the drifted diffusion with stochastic resetting and mixed boundary conditions (arXiv:2311.03939). arXiv. https://doi.org/10.48550/arXiv.2311.03939
Written with StackEdit.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file ppf_approx-0.1.0.tar.gz.
File metadata
- Download URL: ppf_approx-0.1.0.tar.gz
- Upload date:
- Size: 4.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/5.1.0 CPython/3.12.4
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
c93192b3671606ed0e34e734eec27978ae5618d61b88b7c4b6544ef5741c0311
|
|
| MD5 |
abcffefda060cf4494008f493fbe1b9d
|
|
| BLAKE2b-256 |
49dc6efc223646ab71c55a0ba0a1e24fe366dedd1399dea55ca782d946ae485f
|
File details
Details for the file ppf_approx-0.1.0-py3-none-any.whl.
File metadata
- Download URL: ppf_approx-0.1.0-py3-none-any.whl
- Upload date:
- Size: 6.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/5.1.0 CPython/3.12.4
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
3d218c0c66da4a2feb18c0ae8e7cd12d983b31d95ca458ac63336a1882ad561b
|
|
| MD5 |
bd0f35ef1eeecfde22d9e10223ff4708
|
|
| BLAKE2b-256 |
ee7fc3a15acb1caaa6481be8a653c637fc5cce3a669b2ba351a3b5774ac90fe1
|