scipy.special.y0#

scipy.special.y0(x, out=None) = <ufunc 'y0'>#

Bessel function of the second kind of order 0.

Parameters:
xarray_like

Argument (float).

outndarray, optional

Optional output array for the function results

Returns:
Yscalar or ndarray

Value of the Bessel function of the second kind of order 0 at x.

See also

j0

Bessel function of the first kind of order 0

yv

Bessel function of the first kind

Notes

The domain is divided into the intervals [0, 5] and (5, infinity). In the first interval a rational approximation \(R(x)\) is employed to compute,

\[Y_0(x) = R(x) + \frac{2 \log(x) J_0(x)}{\pi},\]

where \(J_0\) is the Bessel function of the first kind of order 0.

In the second interval, the Hankel asymptotic expansion is employed with two rational functions of degree 6/6 and 7/7.

This function is a wrapper for the Cephes [1] routine y0.

Array API Standard Support

y0 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 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.

See Support for the array API standard for more information.

References

[1]

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

Examples

Calculate the function at one point:

>>> from scipy.special import y0
>>> y0(1.)
0.08825696421567697

Calculate at several points:

>>> import numpy as np
>>> y0(np.array([0.5, 2., 3.]))
array([-0.44451873,  0.51037567,  0.37685001])

Plot the function from 0 to 10.

>>> import matplotlib.pyplot as plt
>>> fig, ax = plt.subplots()
>>> x = np.linspace(0., 10., 1000)
>>> y = y0(x)
>>> ax.plot(x, y)
>>> plt.show()
../../_images/scipy-special-y0-1.png