SciPy

scipy.special.kv

scipy.special.kv(v, z) = <ufunc 'kv'>

Modified Bessel function of the second kind of real order v

Returns the modified Bessel function of the second kind for real order v at complex z.

These are also sometimes called functions of the third kind, Basset functions, or Macdonald functions.

Parameters:

v : array_like of float

Order of Bessel functions

z : array_like of complex

Argument at which to evaluate the Bessel functions

Returns:

out : ndarray

The results. Note that input must be of complex type to get complex output, e.g. kv(3, -2+0j) instead of kv(3, -2).

See also

kvp
Derivative of this function

Examples

Plot the function of several orders for real input:

>>> from scipy.special import kv
>>> import matplotlib.pyplot as plt
>>> x = np.linspace(0, 5, 1000)
>>> for N in np.linspace(0, 6, 5):
...     plt.plot(x, kv(N, x), label='$K_{{{}}}(x)$'.format(N))
>>> plt.ylim(0, 10)
>>> plt.legend()
>>> plt.title(r'Modified Bessel function of the second kind $K_\nu(x)$')
>>> plt.show()

(Source code)

../_images/scipy-special-kv-1_00_00.png

Calculate for a single value at multiple orders:

>>> kv([4, 4.5, 5], 1+2j)
array([ 0.1992+2.3892j,  2.3493+3.6j   ,  7.2827+3.8104j])

Previous topic

scipy.special.kn

Next topic

scipy.special.kve