bundles / scipy latest / scipy / special / _spherical_bessel / spherical_kn
function
scipy.special._spherical_bessel:spherical_kn
Signature
def spherical_kn ( n , z , derivative = False ) Summary
Modified spherical Bessel function of the second kind or its derivative.
Extended Summary
Defined as [1],
where is the modified Bessel function of the second kind.
Parameters
n: int, array_likeOrder of the Bessel function (n >= 0).
z: complex or float, array_likeArgument of the Bessel function.
derivative: bool, optionalIf True, the value of the derivative (rather than the function itself) is returned.
Returns
kn: ndarray
Notes
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],
Examples
The modified spherical Bessel functions of the second kind :math:`k_n` accept both real and complex second argument. They can return a complex type:from scipy.special import spherical_kn
✓spherical_kn(0, 3+5j)
✗type(spherical_kn(0, 3+5j))
✓import numpy as np x = np.arange(1.0, 2.0, 0.01) np.allclose(spherical_kn(3, x, True), - 4/x * spherical_kn(3, x) - spherical_kn(2, x))✓
import matplotlib.pyplot as plt x = np.arange(0.0, 4.0, 0.01) fig, ax = plt.subplots()✓
ax.set_ylim(0.0, 5.0) ax.set_title(r'Modified spherical Bessel functions $k_n$') for n in np.arange(0, 4): ax.plot(x, spherical_kn(n, x), label=rf'$k_{n}$') plt.legend(loc='best')✗
plt.show()
✓
Aliases
-
scipy.special.spherical_kn