The BESELY function returns the Y Bessel function of order N for the argument X. The BESELY function is adapted from "SPECFUN - A Portable FORTRAN Package of Special Functions and Test Drivers", W. J. Cody, Algorithm 715, ACM Transactions on Mathematical Software, Vol 19, No. 1, March 1993.
Result = BESELY(X, N [, /DOUBLE] [, ITER=variable])
If both arguments are scalars, the function returns a scalar. If both arguments are arrays, the function matches up the corresponding elements of X and N, returning an array with the same dimensions as the smallest array. If one argument is a scalar and the other argument is an array, the function uses the scalar value with each element of the array, and returns an array with the same dimensions as the smallest input array.
If X is double-precision, the result is double-precision, otherwise the result is single-precision.
| Note |
A scalar or array specifying the values for which the Bessel function is required. Values for X must be in the range 0 to 108.
A scalar or array specifying the order of the Bessel function to calculate. Values for N should be greater than or equal to 0, and can be either integers or real numbers.
Set this keyword equal to one to return a double-precision result, or to zero to return a single-precision result. The computations will always be done using double precision. The default is to return a single-precision result if both inputs are single precision, and to return a double-precision result in all other cases.
Set this keyword equal to a named variable that will contain the number of iterations performed. If the routine converged, the stored value will be equal to the order N. If X or N are arrays, ITER will contain a scalar representing the maximum number of iterations.
| Note |
The following example plots the J and Y Bessel functions for orders 0, 1, and 2:
X = FINDGEN(100)/10 ;Plot J and Y Bessel Functions: PLOT, X, BESELJ(X, 0), TITLE = 'J and Y Bessel Functions' OPLOT, X, BESELJ(X, 1) OPLOT, X, BESELJ(X, 2) OPLOT, X, BESELY(X, 0), LINESTYLE=2 OPLOT, X, BESELY(X, 1), LINESTYLE=2 OPLOT, X, BESELY(X, 2), LINESTYLE=2 ;Annotate plot: xcoords = [1, 1.66, 3, .7, 1.7, 2.65] ycoords = [.8, .62,.52, -.42, -.42, -.42] labels = ['!8J!X!D0','!8J!X!D1','!8J!X!D2','!8Y!X!D0', '!8Y!X!D1','!8Y!X!D2'] XYOUTS, xcoords, ycoords, labels, /DATA
This results in the following plot:
For an example calculating the accuracy of the Bessel function, see "Example 2" for the BESELJ routine.
Introduced: Original
DOUBLE and ITER keywords: 5.6