[SciPy-user] Possible bug in bessel special function h2vp

Julian Swartz swartzjp at gmail.com
Mon Oct 3 08:13:12 CDT 2005


I've encountered what appears to be a bug in the function h2vp, which
calculates the nth order derivative of a hankel function of the second kind.
Here is an example with a second derivative being requested. The function
returns two different values on successive calls. Any subsequent calls will
yield the same result as the second call shown below. This problem is also
evident in function h1vp, calculating the derivatives of a hankel function
of the first kind.

>>> from scipy import *
>>> from scipy.special import *
>>> n = 1.0
>>> x = 2*0.3*pi
>>> h2vp(n, x, 2)
>>> h2vp(n, x, 2)

Even more interesting is that given that the hankel function of the second
kind is defined as:

H (x) = J (x) - jY (x)
n n n

Where J and Y are the standard cylindrical bessel functions of the first and
second kind. One would therefore expect that the second derivative of the
Hankel function should be the sum of the second derivatives of the ordinary
bessel functions. Using the scipy functions jvp and yvp,

>>> jvp(n, x, 2)
>>> yvp(n, x, 2)

Which is quite different to either of the results above.

Any ideas on what the problem could be. (or am I just missing something?)

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.scipy.net/pipermail/scipy-user/attachments/20051003/b6c0c05f/attachment.htm

More information about the SciPy-user mailing list