-
Notifications
You must be signed in to change notification settings - Fork 0
functions
The functions module provides a collection of mathematical utilities and special functions commonly used in fractional calculus, numerical methods, and applied analysis. These include the Pochhammer symbol, the Beta function, and the Mittag-Leffler function, each implemented to support both symbolic and numerical workflows. All functions are compatible with NumPy arrays and can be directly imported for use in custom workflows.
Import example:
from differintP.functions import poch, Beta, MittagLeffler
Returns the Pochhammer symbol
Definition:
Function Signature:
poch(a, n)Parameters:
-
a (
floatorcomplex): Base value. -
n (
floatorint): Nonnegative integer or real exponent.
Returns:
-
result (
floatorcomplex): The computed Pochhammer symbol.
Notes:
- Uses explicit product for integer
$n$ . - Falls back to the Gamma function for general real/complex arguments.
- Special handling for negative or non-integer values, as detailed in MathWorks documentation.
Computes the Euler Beta function for arbitrary (real or complex) inputs, based on the definition involving the Gamma function:
Definition:
Function Signature:
Beta(x, y)Parameters:
-
x, y (
int,float,np.ndarray, orcomplex): Arguments to the Beta function.
Returns:
- result: The computed Beta function value, matching the type/shape of the inputs.
Computes the (generalized) Mittag-Leffler function
Definition:
Function Signature:
MittagLeffler(a, b, x, num_terms=50, ignore_special_cases=False)Parameters:
-
a (
float): First parameter of the function. -
b (
float): Second parameter. -
x (
np.ndarrayorfloat): Values to evaluate at. -
num_terms (
int, optional): Number of series terms to use if no special case applies. Default is50. -
ignore_special_cases (
bool, optional): IfTrue, always uses the series expansion. Default isFalse.
Returns:
-
result (
np.ndarray): Computed values of the Mittag-Leffler function.
Notes:
- Special cases (e.g.,
E_{1,1}(x) = exp(x),E_{2,1}(x) = cosh(sqrt(x))) are handled automatically unless overridden. - For large
num_terms, computation may be slow.
import numpy as np
from differintP.functions import poch, Beta, MittagLeffler
# Pochhammer symbol
val = poch(2.5, 4) # returns (2.5)_4
# Beta function
B = Beta(1.5, 2.2)
# Mittag-Leffler function on an array
x = np.linspace(0, 2, 10)
ML = MittagLeffler(1.5, 1, x)- All functions are implemented with compatibility for real, complex, and vectorized (NumPy array) arguments.
- Additional special functions may be added in future versions; see the Changelog for updates.