Evaluates a sequence of Bessel functions of the first kind with integer order and real or complex arguments.
X — Argument for
which the sequence of Bessel functions is to be evaluated. (Input)
The absolute value of real arguments must be less than
104.
The absolute value of complex arguments must be less than
104.
N — Number of
elements in the sequence. (Input)
It must be a positive
integer.
BS — Vector of
length N
containing the values of the function through the series. (Output)
BS(I) contains the value
of the Bessel function of order I − 1 at x for
I = 1 to N.
Generic: CALL BSJNS (X, N, BS)
Specific: The specific interface names are S_BSJNS, D_BSJNS, C_BSJNS, and Z_BSJNS.
Single: CALL BSJNS (X, N, BS)
Double: The double precision name is DBSJNS.
Complex: The complex name is CBJNS.
Double Complex: The double complex name is DCBJNS.
The complex Bessel function Jn(z) is defined to be
This code is based on the work of Sookne (1973a) and Olver and Sookne (1972). It uses backward recursion with strict error control.
In this example, Jn(10.0), n = 0, …, 9 is computed and printed.
USE BSJNS_INT
USE UMACH_INT
IMPLICIT NONE
! Declare variables
INTEGER N
PARAMETER (N=10)
!
INTEGER K, NOUT
REAL BS(N), X
! Compute
X = 10.0
CALL BSJNS (X, N, BS)
! Print the results
CALL UMACH (2, NOUT)
DO 10 K=1, N
WRITE (NOUT,99999) K-1, X, BS(K)
10 CONTINUE
99999 FORMAT (' J sub ', I2, ' (', F6.3, ') = ', F6.3)
END
J sub 0 (10.000) = -0.246
J sub 1 (10.000) = 0.043
J sub 2 (10.000) = 0.255
J sub 3 (10.000) = 0.058
J sub 4 (10.000) = -0.220
J sub 5 (10.000) = -0.234
J sub 6 (10.000) = -0.014
J sub 7 (10.000) = 0.217
J sub 8 (10.000) = 0.318
J sub 9 (10.000) = 0.292
In this example, Jn(10 + 10i), n = 0, …, 10 is computed and printed.
USE BSJNS_INT
USE UMACH_INT
IMPLICIT NONE
! Declare variables
INTEGER N
PARAMETER (N=11)
!
INTEGER K, NOUT
COMPLEX CBS(N), Z
! Compute
Z = (10.0, 10.0)
CALL BSJNS (Z, N, CBS)
! Print the results
CALL UMACH (2, NOUT)
DO 10 K=1, N
WRITE (NOUT,99999) K-1, Z, CBS(K)
10 CONTINUE
99999 FORMAT (' J sub ', I2, ' ((', F6.3, ',', F6.3, &
')) = (', F9.3, ',', F9.3, ')')
END
J sub 0 ((10.000,10.000)) = (-2314.975, 411.563)
J sub 1 ((10.000,10.000)) = ( -460.681,-2246.627)
J sub 2 ((10.000,10.000)) = ( 2044.245, -590.157)
J sub 3 ((10.000,10.000)) = ( 751.498, 1719.746)
J sub 4 ((10.000,10.000)) = (-1302.871, 880.632)
J sub 5 ((10.000,10.000)) = ( -920.394, -846.345)
J sub 6 ((10.000,10.000)) = ( 419.501, -843.607)
J sub 7 ((10.000,10.000)) = ( 665.930, 88.480)
J sub 8 ((10.000,10.000)) = ( 108.586, 439.392)
J sub 9 ((10.000,10.000)) = ( -227.548, 176.165)
J sub 10 ((10.000,10.000)) = ( -154.831, -76.050)
PHONE: 713.784.3131 FAX:713.781.9260 |