CBKS
Evaluates a sequence of modified Bessel functions of the second kind with real order and complex arguments.
Required Arguments
XNU — Real argument which is the lowest order desired. (Input)
XNU must be greater than –1/2.
Z — Complex argument for which the sequence of Bessel functions is to be evaluated. (Input)
N — Number of elements in the sequence. (Input)
CBS — Vector of length N containing the values of the function through the series. (Output)
CBS(I) contains the value of the Bessel function of order XNU + I ‑ 1 at Z for I = 1 to N.
FORTRAN 90 Interface
Generic: CALL CBKS (XNU, Z, N, CBS)
Specific: The specific interface names are S_CBKS and D_CBKS.
FORTRAN 77 Interface
Single: CALL CBKS (XNU, Z, N, CBS)
Double: The double precision name is DCBKS.
Description
The Bessel function Kv(z) is defined to be
where the Bessel function
Jv(
z) is defined in
CBJS and
Yv(
z) is defined in
CBYS.
This code is based on the code BESSCC of Barnett (1981) and Thompson and Barnett (1987).
For moderate or large arguments, z, Temme’s (1975) algorithm is used to find Kv(z). This involves evaluating a continued fraction. If this evaluation fails to converge, the answer may not be accurate. For small z, a Neumann series is used to compute Kv(z). Upward recurrence of the Kv(z) is always stable.
Comments
1. Workspace may be explicitly provided, if desired, by use of C2KS/DC2KS. The reference is
CALL C2KS (XNU, Z, N, CBS, FK)
The additional argument is
FK — Complex work vector of length N.
2. Informational errors
Type | Code | Description |
---|
3 | 1 | One of the continued fractions failed. |
4 | 2 | Only the first several entries in CBS are valid. |
Example
In this example, K0.3+v −1(1.2 + 0.5i), v = 1, …, 4 is computed and printed.
USE UMACH_INT
USE CBKS_INT
IMPLICIT NONE
! Declare variables
INTEGER N
PARAMETER (N=4)
!
INTEGER K, NOUT
REAL XNU
COMPLEX CBS(N), Z
! Compute
XNU = 0.3
Z = (1.2, 0.5)
CALL CBKS (XNU, Z, N, CBS)
! Print the results
CALL UMACH (2, NOUT)
DO 10 K=1, N
WRITE (NOUT,99999) XNU+K-1, Z, CBS(K)
10 CONTINUE
99999 FORMAT (' K sub ', F6.3, ' ((', F6.3, ',', F6.3, &
')) = (', F9.3, ',', F9.3, ')')
END
Output
K sub 0.300 (( 1.200, 0.500)) = ( 0.246, -0.200)
K sub 1.300 (( 1.200, 0.500)) = ( 0.336, -0.362)
K sub 2.300 (( 1.200, 0.500)) = ( 0.587, -1.126)
K sub 3.300 (( 1.200, 0.500)) = ( 0.719, -4.839)