2013-02-02 133 views
2

为了简化这个问题,我们抱歉。我想在Python中实现一个公式。在这个等式中,K_0是零阶修正的贝塞尔函数。零阶Bessel函数Python

在Python中实现K_0的最佳方式是什么?

+0

有你看着http://docs.scipy.org/doc/scipy /reference/special.html – grep

回答

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 
+0

'scipy.special.kn(0,1)'在这个等式中表现得很好。谢谢。 – 8765674