scipy.special.ellipeinc#

scipy.special.ellipeinc(phi, m, out=None) = <wrapped_ufunc 'ellipeinc'>#

Incomplete elliptic integral of the second kind.

This function is defined as

\[E(\phi, m) = \int_0^{\phi} [1 - m \sin(t)^2]^{1/2} dt\]
Parameters:
phiarray_like

amplitude of the elliptic integral.

marray_like

parameter of the elliptic integral.

outndarray, optional

Optional output array for the function values

Returns:
Escalar or ndarray

Value of the elliptic integral.

See also

ellipkm1

Complete elliptic integral of the first kind, near m = 1

ellipk

Complete elliptic integral of the first kind

ellipkinc

Incomplete elliptic integral of the first kind

ellipe

Complete elliptic integral of the second kind

elliprd

Symmetric elliptic integral of the second kind.

elliprf

Completely-symmetric elliptic integral of the first kind.

elliprg

Completely-symmetric elliptic integral of the second kind.

Notes

Wrapper for the Cephes [1] routine ellie.

Computation uses arithmetic-geometric mean algorithm.

The parameterization in terms of \(m\) follows that of section 17.2 in [2]. Other parameterizations in terms of the complementary parameter \(1 - m\), modular angle \(\sin^2(\alpha) = m\), or modulus \(k^2 = m\) are also used, so be careful that you choose the correct parameter.

The Legendre E incomplete integral can be related to combinations of Carlson’s symmetric integrals R_D, R_F, and R_G in multiple ways [3]. For example, with \(c = \csc^2\phi\),

\[E(\phi, m) = R_F(c-1, c-k^2, c) - \frac{1}{3} k^2 R_D(c-1, c-k^2, c) .\]
Array API Standard Support

ellipeinc has 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. out is 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. out is never supported for JAX because JAX arrays are immutable. ellipeinc does not currently support out for the PyTorch backend.

See Support for the array API standard for more information.

References

[1]

Cephes Mathematical Functions Library, http://www.netlib.org/cephes/

[2]

Milton Abramowitz and Irene A. Stegun, eds. Handbook of Mathematical Functions with Formulas, Graphs, and Mathematical Tables. New York: Dover, 1972.

[3]

NIST Digital Library of Mathematical Functions. http://dlmf.nist.gov/, Release 1.0.28 of 2020-09-15. See Sec. 19.25(i) https://dlmf.nist.gov/19.25#i

Examples

The elliptic integral of the second kind can be used to find the circumference of an ellipse with semi-major axis a and semi-minor axis b.

>>> import numpy as np
>>> from scipy.special import ellipeinc
>>> a, b = 3.5, 2.1
>>> e = np.sqrt(1.0 - b**2/a**2)  # eccentricity
>>> 4*a*ellipeinc(np.pi/2, e**2)
np.float64(17.86889920437869)