3

I'm using the scipy library to find the zeros of the Bessel functions. It seems to work for lower order Bessel functions

> jn_zeros(200,6)
array([ 211.02916651,  219.51409634,  226.60754246,  232.9865383 ,
        238.90771104,  244.50236452])

> jn_zeros(280,6)
array([ 292.29850981,  301.70904157,  309.54484363,  316.56844265,
        323.06949569,  329.1964952 ])

But, after a cut-off, it hangs

> jn_zeros(281,6)

The above line never returns. Is this an expected behaviour from scipy?

rprospero
  • 913
  • 11
  • 26
  • 1
    On my computer, I got the following result with no problem. scipy.special.jn_zeros(281,6) Out[35]: array([ 293.31275828, 302.73370949, 310.57788724, 317.60877336, 324.1163936 , 330.24943211]) I'm using Windows 7, Scipy 0.15 with Python 2.7. What is your python setting? – pyan Apr 02 '15 at 15:42
  • 1
    It hangs for me, too, with both scipy 0.15.1 and a fresh build of the master branch from github (version `'0.16.0.dev0+4585b0f'`). I'm on a Mac, using python 2.7.9. @user640078, could you file a bug report at https://github.com/scipy/scipy/issues ? – Warren Weckesser Apr 02 '15 at 19:30
  • 1
    Nevermind, I just filed the issue: https://github.com/scipy/scipy/issues/4690 – Warren Weckesser Apr 02 '15 at 20:16
  • @pyan I have confirmed your results on windows box. The machine where I was having the initial problem was running Linux. I can give the exact versions when the machine powers back up on Tuesday. Since Warren is seeing the same issues on Mac, but it works on Windows, I'm guessing that it's probably a bug and not an expected behaviour? – rprospero Apr 04 '15 at 12:14
  • 2
    @user640078: It is definitely a bug. I added some more details to the bug report on github. Because it involves floating point calculations in an iterative algorithm (Newton's method), it is not surprising that the behavior is platform-dependent. – Warren Weckesser Apr 05 '15 at 16:09

0 Answers0