为这个问题的简单性道歉。
我想在Python中实现一个等式。在该等式中,K_0是零阶修正的贝塞尔函数。
在Python中实现K_0的最佳方法是什么?
答案 0 :(得分:5)
无需实施;它包括在内。请参阅scipy.special模块的文档,特别是优化的常用模块here:
>>> import scipy.special
>>> print scipy.special.k0.__doc__
k0(x[, out])
y=k0(x) returns the modified Bessel function of the second kind (sometimes called the third kind) of
order 0 at x.
>>> scipy.special.k0(1)
0.42102443824070823
或更一般地说:
>>> print scipy.special.kn.__doc__
kn(x1, x2[, out])
y=kn(n,x) returns the modified Bessel function of the second kind (sometimes called the third kind) for
integer order n at x.
>>> scipy.special.kn(0, 1)
0.42102443824070834