scipy.special.elliprd#
- scipy.special.elliprd(x, y, z, out=None) = <wrapped_ufunc 'elliprd'>#
Symmetric elliptic integral of the second kind.
The function RD is defined as [1]
\[R_{\mathrm{D}}(x, y, z) = \frac{3}{2} \int_0^{+\infty} [(t + x) (t + y)]^{-1/2} (t + z)^{-3/2} dt\]- Parameters:
- x, y, zarray_like
Real or complex input parameters. x or y can be any number in the complex plane cut along the negative real axis, but at most one of them can be zero, while z must be non-zero.
- outndarray, optional
Optional output array for the function values
- Returns:
- Rscalar or ndarray
Value of the integral. If all of x, y, and z are real, the return value is real. Otherwise, the return value is complex.
See also
Notes
RD is a degenerate case of the elliptic integral RJ:
elliprd(x, y, z) == elliprj(x, y, z, z).The code implements Carlson’s algorithm based on the duplication theorems and series expansion up to the 7th order. [2]
Added in version 1.8.0.
Array API Standard Support
elliprdhas support for Python Array API Standard compatible backends in addition to NumPy. The following combinations of backend and device (or other capability) are supported.Library
CPU
GPU
NumPy
✅
n/a
CuPy
n/a
⛔
PyTorch
✅
⛔
JAX
✅
⛔
Dask
✅
n/a
For the NumPy backend, this function supports all NumPy ufunc keyword arguments. Other backends may support
out, but typically none of the other ufunc kwargs.outis typically supported for CuPy and PyTorch, but not currently in cases where SciPy relies on a generic Array API implementation or, for PyTorch on CPU, falls back to the NumPy backend.outis never supported for JAX because JAX arrays are immutable.elliprddoes not currently supportoutfor the PyTorch backend.See Support for the array API standard for more information.
References
[1]B. C. Carlson, ed., Chapter 19 in “Digital Library of Mathematical Functions,” NIST, US Dept. of Commerce. https://dlmf.nist.gov/19.16.E5
[2]B. C. Carlson, “Numerical computation of real or complex elliptic integrals,” Numer. Algorithm, vol. 10, no. 1, pp. 13-26, 1995. DOI:10.1007/BF02198293. https://arxiv.org/abs/math/9409227
Examples
Basic homogeneity property:
>>> import numpy as np >>> from scipy.special import elliprd
>>> x = 1.2 + 3.4j >>> y = 5. >>> z = 6. >>> scale = 0.3 + 0.4j >>> elliprd(scale*x, scale*y, scale*z) (-0.03703043835680379-0.24500934665683802j)
>>> elliprd(x, y, z)*np.power(scale, -1.5) (-0.0370304383568038-0.24500934665683805j)
All three arguments coincide:
>>> x = 1.2 + 3.4j >>> elliprd(x, x, x) (-0.03986825876151896-0.14051741840449586j)
>>> np.power(x, -1.5) (-0.03986825876151894-0.14051741840449583j)
The so-called “second lemniscate constant”:
>>> elliprd(0, 2, 1)/3 0.5990701173677961
>>> from scipy.special import gamma >>> gamma(0.75)**2/np.sqrt(2*np.pi) 0.5990701173677959