[Scipy-tickets] [SciPy] #852: special.jn_zeros numerical errors for large s

SciPy scipy-tickets@scipy....
Sun Jan 18 12:40:11 CST 2009


#852: special.jn_zeros numerical errors for large s
---------------------------+------------------------------------------------
 Reporter:  pv             |       Owner:  somebody       
     Type:  defect         |      Status:  new            
 Priority:  normal         |   Milestone:  0.8.0          
Component:  scipy.special  |     Version:  devel          
 Severity:  normal         |    Keywords:  jn_zeros bessel
---------------------------+------------------------------------------------
 As commented by Greg Werner in #683:

 `jn_zeros(n,smax)[s]` is inaccurate for large `s ~> 270`:
 {{{
 >>> import scipy.special as sc
 >>> z = sc.jn_zeros(0, 300)
 >>> z[280-1]/878.86068707124422606 - 1
 2.9284683789043697e-07
 >>> z[300-1]/941.69253065317954064 - 1
 0.012473035348793182
 }}}

 It gets worse if also `n` is large:
 {{{
 >>> z = sc.jn_zeros(101, 300)
 >>> z[230-1]/874.59312633989088719 - 1
 3.6436395012273692e-08
 >>> z[260-1]/969.41304672379998960 - 1
 0.029696818901492561
 }}}

 Also, `jn_zeros(n,s)` raises an exception for `n >= 102`:
 {{{
 >>> z = sc.jn_zeros(102, 10)
 jyzo:n=102
 ------------------------------------------------------------
 Traceback (most recent call last):
   File "<ipython console>", line 1, in <module>
   File "dist/linux/lib/python2.5/site-packages/scipy/special/basic.py",
 line 89, in jn_zeros
   File "dist/linux/lib/python2.5/site-packages/scipy/special/basic.py",
 line 84, in jnyn_zeros
 error: (abs(n)<=101) failed for 1st argument n
 }}}

-- 
Ticket URL: <http://scipy.org/scipy/scipy/ticket/852>
SciPy <http://www.scipy.org/>
SciPy is open-source software for mathematics, science, and engineering.


More information about the Scipy-tickets mailing list