k0e#
- scipy.special.k0e(x,out=None)#
Exponentially scaled modified Bessel function K of order 0
Defined as:
k0e(x)=exp(x)*k0(x).
- Parameters:
- xarray_like
Argument (float)
- outndarray, optional
Optional output array for the function values
- Returns:
- Kscalar or ndarray
Value of the exponentially scaled modified Bessel function K of order0 atx.
See also
Notes
The range is partitioned into the two intervals [0, 2] and (2, infinity).Chebyshev polynomial expansions are employed in each interval.
This function is a wrapper for the Cephes[1] routine
k0e.k0eisuseful for large arguments: for these,k0easily underflows.Array API Standard Support
k0ehas experimental support for Python Array API Standard compatiblebackends in addition to NumPy. Please consider testing these featuresby setting an environment variableSCIPY_ARRAY_API=1and providingCuPy, PyTorch, JAX, or Dask arrays as array arguments. The followingcombinations of backend and device (or other capability) are supported.Library
CPU
GPU
NumPy
✅
n/a
CuPy
n/a
✅
PyTorch
✅
✅
JAX
⚠️ no JIT
⛔
Dask
✅
n/a
SeeSupport for the array API standard for more information.
References
[1]Cephes Mathematical Functions Library,http://www.netlib.org/cephes/
Examples
In the following example
k0returns 0 whereask0estill returns auseful finite number:>>>fromscipy.specialimportk0,k0e>>>k0(1000.),k0e(1000)(0., 0.03962832160075422)
Calculate the function at several points by providing a NumPy array orlist forx:
>>>importnumpyasnp>>>k0e(np.array([0.5,2.,3.]))array([1.52410939, 0.84156822, 0.6977616 ])
Plot the function from 0 to 10.
>>>importmatplotlib.pyplotasplt>>>fig,ax=plt.subplots()>>>x=np.linspace(0.,10.,1000)>>>y=k0e(x)>>>ax.plot(x,y)>>>plt.show()
