[Numpy-discussion] NaN (Not a Number) occurs in calculation of complex number for Bessel functions

2012-12-21 Thread Happyman
DEAR PYTHON USERS DO MATHEMATICAL FUNCTIONS HAVE LIMITATION IN PYTHON in comparison with other programming languages I have two mathematical functions: from scipy.special import sph_jn,  sph_jnyn 1)  sph_jn (n, z) --- n is float, z is complex number for example:  a,b=sph_jn ( 2.0 ,

Re: [Numpy-discussion] NaN (Not a Number) occurs in calculation of complex number for Bessel functions

2012-12-21 Thread Pauli Virtanen
Happyman bahtiyor_zohidov at mail.ru writes: [clip] IF I GIVE ( it is necessary value for my program ): a , b = sph_jn ( 536 , 2513.2741228718346 + 201.0619298974676j ) The implementation of the spherical Bessel functions is through this Fortran code:

Re: [Numpy-discussion] NaN (Not a Number) occurs in calculation of complex number for Bessel functions

2012-12-21 Thread Happyman
Thanks Pauli But I have already very shortly built  for bessel function, but the code you gave me is in Fortran.. I also used f2py but I could not manage to read fortran codes..that is why I have asked in Python what is wrong?? Пятница, 21 декабря 2012, 12:46 UTC от Pauli Virtanen

Re: [Numpy-discussion] NaN (Not a Number) occurs in calculation of complex number for Bessel functions

2012-12-21 Thread Pauli Virtanen
Happyman bahtiyor_zohidov at mail.ru writes: Thanks Pauli But I have already very shortly built  for bessel  function, but the code you gave me is in Fortran.. I also used f2py but I could not manage to read fortran codes..that is why I have asked in Python what is wrong?? That Fortran code is

Re: [Numpy-discussion] NaN (Not a Number) occurs in calculation of complex number for Bessel functions

2012-12-21 Thread Happyman
I have everything in C or Fortran...According to my friends recommendations I started learning Python for my research... Do you mean the functions which gave Nan result has not been developed properly yet in Python, Don't you For about 1.5 months I have been facing the same problem for

Re: [Numpy-discussion] NaN (Not a Number) occurs in calculation of complex number for Bessel functions

2012-12-21 Thread Dag Sverre Seljebotn
On 12/21/2012 02:30 PM, Happyman wrote: I have everything in C or Fortran...According to my friends recommendations I started learning Python for my research... Do you mean the functions which gave Nan result has not been developed properly yet in Python, Don't you The way most of NumPy

Re: [Numpy-discussion] NaN (Not a Number) occurs in calculation of complex number for Bessel functions

2012-12-21 Thread Pauli Virtanen
Dag Sverre Seljebotn d.s.seljebotn at astro.uio.no writes: [clip] Do you have an implemention of the Bessel functions that work as you wish in C or Fortran? If so, that could be wrapped and called from Python. For spherical Bessel functions it's possible to also use the relation to Bessel

Re: [Numpy-discussion] NaN (Not a Number) occurs in calculation of complex number for Bessel functions

2012-12-21 Thread Lev Givon
Received from Pauli Virtanen on Fri, Dec 21, 2012 at 08:59:02AM EST: Dag Sverre Seljebotn d.s.seljebotn at astro.uio.no writes: [clip] Do you have an implemention of the Bessel functions that work as you wish in C or Fortran? If so, that could be wrapped and called from Python. For

Re: [Numpy-discussion] NaN (Not a Number) occurs in calculation of complex number for Bessel functions

2012-12-21 Thread Happyman
I think you advised about the code which is the same appearance. == Problem is not here Sir I will give you exactly what I was talking about. I have ready codes already(It would be kind of you if you checked the

Re: [Numpy-discussion] NaN (Not a Number) occurs in calculation of complex number for Bessel functions

2012-12-21 Thread Pauli Virtanen
Hi, Your code tries to to evaluate z = 1263309.3633394379 + 101064.74910119522j jv(536, z) # - (inf+inf*j) In reality, this number is not infinite, but jv(536, z) == -2.3955170861527422e+43888 + 9.6910119847300024e+43887 These numbers (~ 10^43888) are too large for the

Re: [Numpy-discussion] NaN (Not a Number) occurs in calculation of complex number for Bessel functions

2012-12-21 Thread Happyman
Thanks But I could find for Win64 bit windows Second question: Did you mean that I have to put lens limits of those number???   Пятница, 21 декабря 2012, 15:45 UTC от Pauli Virtanen p...@iki.fi: Hi, Your code tries to to evaluate z = 1263309.3633394379 + 101064.74910119522j