scipy 1.8.0 Pypi GitHub Homepage
Other Docs
NotesParametersReturnsBackRef
spherical_yn(n, z, derivative=False)

Defined as ,

$$y_n(z) = \sqrt{\frac{\pi}{2z}} Y_{n + 1/2}(z),$$

where $Y_n$ is the Bessel function of the second kind.

Notes

For real arguments, the function is computed using the ascending recurrence . For complex arguments, the definitional relation to the cylindrical Bessel function of the second kind is used.

The derivative is computed using the relations ,

$$y_n' = y_{n-1} - \frac{n + 1}{z} y_n. y_0' = -y_1$$
versionadded

Parameters

n : int, array_like

Order of the Bessel function (n >= 0).

z : complex or float, array_like

Argument of the Bessel function.

derivative : bool, optional

If True, the value of the derivative (rather than the function itself) is returned.

Returns

yn : ndarray

Spherical Bessel function of the second kind or its derivative.

Examples

The spherical Bessel functions of the second kind $y_n$ accept both real and complex second argument. They can return a complex type:

>>> from scipy.special import spherical_yn
... spherical_yn(0, 3+5j) (8.022343088587197-9.880052589376795j)
>>> type(spherical_yn(0, 3+5j))
<class 'numpy.complex128'>

We can verify the relation for the derivative from the Notes for $n=3$ in the interval $[1, 2]$ :

>>> from scipy.special import spherical_yn
... x = np.arange(1.0, 2.0, 0.01)
... np.allclose(spherical_yn(3, x, True),
...  spherical_yn(2, x) - 4/x * spherical_yn(3, x)) True

The first few $y_n$ with real argument:

>>> import matplotlib.pyplot as plt
... from scipy.special import spherical_yn
... x = np.arange(0.0, 10.0, 0.01)
... fig, ax = plt.subplots()
... ax.set_ylim(-2.0, 1.0)
... ax.set_title(r'Spherical Bessel functions $y_n$')
... for n in np.arange(0, 4):
...  ax.plot(x, spherical_yn(n, x), label=rf'$y_{n}$')
... plt.legend(loc='best')
... plt.show()
See :

Back References

The following pages refer to to this document either explicitly or contain code examples using this.

scipy.special._spherical_bessel.spherical_yn

Local connectivity graph

Hover to see nodes names; edges to Self not shown, Caped at 50 nodes.

Using a canvas is more power efficient and can get hundred of nodes ; but does not allow hyperlinks; , arrows or text (beyond on hover)

SVG is more flexible but power hungry; and does not scale well to 50 + nodes.

All aboves nodes referred to, (or are referred from) current nodes; Edges from Self to other have been omitted (or all nodes would be connected to the central node "self" which is not useful). Nodes are colored by the library they belong to, and scaled with the number of references pointing them


GitHub : /scipy/special/_spherical_bessel.py#94
type: <class 'function'>
Commit: