hide long namesshow long names
hide short namesshow short names
Integer type:  int32  int64  nag_int  show int32  show int32  show int64  show int64  show nag_int  show nag_int

PDF version (NAG web site, 64-bit version, 64-bit version)
Chapter Contents
Chapter Introduction
NAG Toolbox

NAG Toolbox: nag_specfun_bessel_zeros (s17al)

 Contents

    1  Purpose
    2  Syntax
    7  Accuracy
    9  Example

Purpose

nag_specfun_bessel_zeros (s17al) determines the leading n zeros of one of the Bessel functions Jαx, Yαx, Jαx or Yαx for real x and non-negative α.

Syntax

[x, ifail] = s17al(a, n, mode, 'rel', rel)
[x, ifail] = nag_specfun_bessel_zeros(a, n, mode, 'rel', rel)

Description

nag_specfun_bessel_zeros (s17al) attempts to find the leading N zeros of one of the Bessel functions Jαx, Yαx, Jαx or Yαx, where x is real. When α is real, these functions each have an infinite number of real zeros, all of which are simple with the possible exception of x=0. If α0, the nth positive zero is denoted by jα,n,jα,n,yα,n and yα,n, respectively, for n=1,2,,N, except that x=0 is counted as the first zero of Jαx when α=0. Since J0x=-J1x, it therefore follows that j0,1=0 and j0,n=-j1,n-1 for n=2,3,,N-1. Further details can be found in Section 9.5 of Abramowitz and Stegun (1972).
nag_specfun_bessel_zeros (s17al) is based on Algol 60 procedures given by Temme (1979). Initial approximations to the zeros are computed from asymptotic expansions. These are then improved by higher-order Newton iteration making use of the differential equation for the Bessel functions.

References

Abramowitz M and Stegun I A (1972) Handbook of Mathematical Functions (3rd Edition) Dover Publications
Temme N M (1976) On the numerical evaluation of the ordinary Bessel function of the second kind J. Comput. Phys. 21 343–350
Temme N M (1979) An algorithm with Algol 60 program for the computation of the zeros of ordinary Bessel functions and those of their derivatives J. Comput. Phys. 32 270–279

Parameters

Compulsory Input Parameters

1:     a – double scalar
The order α of the function.
Constraint: 0.0a100000.0.
2:     n int64int32nag_int scalar
The number N of zeros required.
Constraint: n1.
3:     mode int64int32nag_int scalar
Specifies the form of the function whose zeros are required.
mode=1
The zeros of Jαx are required.
mode=2
The zeros of Yαx are required;
mode=3
The zeros of Jαx are required;
mode=4
The zeros of Yαx are required.
Constraint: 1mode4.

Optional Input Parameters

1:     rel – double scalar
Suggested value: the square root of the machine precision.
Default: machine precision
The relative accuracy to which the zeros are required.
Constraint: rel>0.0.

Output Parameters

1:     xn – double array
The N required zeros of the function specified by mode.
2:     ifail int64int32nag_int scalar
ifail=0 unless the function detects an error (see Error Indicators and Warnings).

Error Indicators and Warnings

Errors or warnings detected by the function:
   ifail=1
On entry,a<0.0,
ora>100000.0,
orn0,
ormode<1,
ormode>4,
orrel0.0.
   ifail=-99
An unexpected error has been triggered by this routine. Please contact NAG.
   ifail=-399
Your licence key may have expired or may not have been installed correctly.
   ifail=-999
Dynamic memory allocation failed.

Accuracy

If the value of rel is set to 10-d, then the required zeros should have approximately d correct significant digits.

Further Comments

None.

Example

This example determines the leading five positive zeros of the Bessel function J0x.
function s17al_example


fprintf('s17al example results\n\n');

a = 0;
n = int64(5);
mode = int64(1);

[result, ifail] = s17al(a, n, mode);

fprintf('Leading %2d zeros of J_0(x)\n',n);
fprintf('%12.4f\n',result);


s17al example results

Leading  5 zeros of J_0(x)
      2.4048
      5.5201
      8.6537
     11.7915
     14.9309

PDF version (NAG web site, 64-bit version, 64-bit version)
Chapter Contents
Chapter Introduction
NAG Toolbox

© The Numerical Algorithms Group Ltd, Oxford, UK. 2009–2015