Bessel Function Zeroes

100 views
Skip to first unread message

Jaasiel Ornelas

unread,
Jul 1, 2010, 5:45:34 PM7/1/10
to sage-support
Hi!

I'm working on modeling drums with bessel functions. However, I need
to calculate the zeroes of the bessel functions. Is there any way to
do that?

Thank you very much.

Pat LeSmithe

unread,
Jul 1, 2010, 7:02:28 PM7/1/10
to sage-s...@googlegroups.com
On 7/1/2010 4:45 PM, Jaasiel Ornelas wrote:
> I'm working on modeling drums with bessel functions. However, I need
> to calculate the zeroes of the bessel functions. Is there any way to
> do that?

I'm not sure if this is the best way, but you could try, e.g.,

sage: import scipy.special
sage: [x for x in dir(scipy.special) if 'zero' in x]
['ai_zeros', 'bei_zeros', 'beip_zeros', 'ber_zeros', 'berp_zeros',
'bi_zeros', 'erf_zeros', 'flatnonzero', 'fresnel_zeros',
'fresnelc_zeros', 'fresnels_zeros', 'jn_zeros', 'jnjnp_zeros',
'jnp_zeros', 'jnyn_zeros', 'kei_zeros', 'keip_zeros', 'kelvin_zeros',
'ker_zeros', 'kerp_zeros', 'nonzero', 'trim_zeros', 'y0_zeros',
'y1_zeros', 'y1p_zeros', 'yn_zeros', 'ynp_zeros', 'zeros', 'zeros_like']
sage: scipy.special.jn_zeros?
sage: scipy.special.jn_zeros(int(0), int(3)).tolist()
[2.4048255576957724, 5.5200781102863106, 8.6537279129110125]

List of scipy.special functions:

http://www.scipy.org/SciPyPackages/Special

Possibly naive questions:

* Are there analogous arbitrary-precision routines in or wrapped by Sage?
* Is it possible to call these GSL functions easily from Sage:

http://www.gnu.org/software/gsl/manual/html_node/Zeros-of-Regular-Bessel-Functions.html

?

Jason Grout

unread,
Jul 4, 2010, 2:25:02 AM7/4/10
to sage-s...@googlegroups.com
On 7/1/10 4:02 PM, Pat LeSmithe wrote:
> On 7/1/2010 4:45 PM, Jaasiel Ornelas wrote:
>> I'm working on modeling drums with bessel functions. However, I need
>> to calculate the zeroes of the bessel functions. Is there any way to
>> do that?
>
> I'm not sure if this is the best way, but you could try, e.g.,
>
> sage: import scipy.special
> sage: [x for x in dir(scipy.special) if 'zero' in x]
> ['ai_zeros', 'bei_zeros', 'beip_zeros', 'ber_zeros', 'berp_zeros',
> 'bi_zeros', 'erf_zeros', 'flatnonzero', 'fresnel_zeros',
> 'fresnelc_zeros', 'fresnels_zeros', 'jn_zeros', 'jnjnp_zeros',
> 'jnp_zeros', 'jnyn_zeros', 'kei_zeros', 'keip_zeros', 'kelvin_zeros',
> 'ker_zeros', 'kerp_zeros', 'nonzero', 'trim_zeros', 'y0_zeros',
> 'y1_zeros', 'y1p_zeros', 'yn_zeros', 'ynp_zeros', 'zeros', 'zeros_like']
> sage: scipy.special.jn_zeros?
> sage: scipy.special.jn_zeros(int(0), int(3)).tolist()
> [2.4048255576957724, 5.5200781102863106, 8.6537279129110125]
>
> List of scipy.special functions:
>
> http://www.scipy.org/SciPyPackages/Special
>
> Possibly naive questions:
>
> * Are there analogous arbitrary-precision routines in or wrapped by Sage?


You could also use mpmath to calculate the roots:

http://mpmath.googlecode.com/svn/tags/0.15/doc/build/functions/bessel.html?highlight=bessel


(specifically, see the example "Roots of Bessel functions are often used:")

Jason


Dr. David Kirkby

unread,
Jul 4, 2010, 4:40:52 AM7/4/10
to sage-s...@googlegroups.com
On 07/ 4/10 07:25 AM, Jason Grout wrote:
> You could also use mpmath to calculate the roots:
>
> http://mpmath.googlecode.com/svn/tags/0.15/doc/build/functions/bessel.html?highlight=bessel
>
>
> (specifically, see the example "Roots of Bessel functions are often used:")
>
> Jason

It would be good if how to find these was more obvious. Roots of Bessel
functions are pretty common to want to find (at least in fields of engineering
I've worked in). It's not obvious that one would use the Sage interface to
mpmath to compute these.

MMA has these as BesselJZero[] and BesselYZero[]

http://reference.wolfram.com/mathematica/ref/BesselJZero.html
http://reference.wolfram.com/mathematica/ref/BesselYZero.html

If nobody beats me to it, when the OpenSolaris and 64-bit SPARC ports are
finished and I can concentrate on other aspects of Sage, I'll look into making
these more easily available.

Dave

Fredrik Johansson

unread,
Jul 10, 2010, 7:23:20 PM7/10/10
to sage-support
On Jul 2, 1:02 am, Pat LeSmithe <qed...@gmail.com> wrote:

> Possibly naive questions:
>
>   * Are there analogous arbitrary-precision routines in or wrapped by Sage?

Arbitrary-precision computation of Bessel function zeros will be
provided in the next version of mpmath. See
http://fredrik-j.blogspot.com/2010/07/sage-days-23-and-bessel-function-zeros.html

I'll make sure Sage gets an interface for Bessel function zeros. If it
doesn't happen during Sage Days 24 (which will focus on special
functions in Sage), I'll write one soon after SD24.

Fredrik
Reply all
Reply to author
Forward
0 new messages