spherical_kn
- scipy.special.spherical_kn(n, z, derivative=False)
Modified spherical Bessel function of the second kind or its derivative.
Defined as [1],
Modified spherical Bessel function of the second kind or its derivative.
Defined as [1],
where is the modified Bessel function of the second kind.
Order of the Bessel function (n >= 0).
Argument of the Bessel function.
If True, the value of the derivative (rather than the function itself) is returned.
Value or derivative of modified spherical Bessel function of the second kind.
The function is computed using its definitional relation to the modified cylindrical Bessel function of the second kind.
The derivative is computed using the relations [2],
Milton Abramowitz and Irene A. Stegun, eds. Handbook of Mathematical Functions with Formulas, Graphs, and Mathematical Tables. New York: Dover, 1972.
The modified spherical Bessel functions of the second kind accept both real and complex second argument. They can return a complex type:
>>> from scipy.special import spherical_kn
>>> spherical_kn(0, 3+5j)
(0.012985785614001561+0.003354691603137546j)
>>> type(spherical_kn(0, 3+5j))
<class 'numpy.complex128'>
We can verify the relation for the derivative from the Notes for in the interval :
>>> import numpy as np
>>> x = np.arange(1.0, 2.0, 0.01)
>>> np.allclose(spherical_kn(3, x, True),
... -
The first few with real argument:
>>> import matplotlib.pyplot as plt
>>> x = np.arange(0.0, 4.0, 0.01)
>>> fig, ax = plt.subplots()
>>> ax.set_ylim(0.0