Learn R Programming

Bessel (version 0.6-1)

BesselH: Hankel (H-Bessel) Function (of Complex Argument)

Description

Compute the Hankel functions \(H(1,*)\) and \(H(2,*)\), also called ‘H-Bessel’ function (of the third kind), of complex arguments. They are defined as $$ H(1,\nu, z) := H_{\nu}^{(1)}(z) = J_{\nu}(z) + i Y_{\nu}(z),$$ $$ H(2,\nu, z) := H_{\nu}^{(2)}(z) = J_{\nu}(z) - i Y_{\nu}(z),$$ where \(J_{\nu}(z)\) and \(Y_{\nu}(z)\) are the Bessel functions of the first and second kind, see BesselJ, etc.

Usage

BesselH(m, z, nu, expon.scaled = FALSE, nSeq = 1, verbose = 0)

Value

a complex or numeric vector (or matrix if nSeq > 1) of the same length and mode as z.

Arguments

m

integer, either 1 or 2, indicating the kind of Hankel function.

z

complex or numeric vector of values different from 0.

nu

numeric, must currently be non-negative.

expon.scaled

logical indicating if the result should be scaled by an exponential factor (typically to avoid under- or over-flow).

nSeq

positive integer; if \(> 1\), computes the result for a whole sequence of nu values of length nSeq, see ‘Details’ below.

verbose

integer defaulting to 0, indicating the level of verbosity notably from C code.

Author

Donald E. Amos, Sandia National Laboratories, wrote the original fortran code. Martin Maechler did the R interface.

Details

By default (when expon.scaled is false), the resulting sequence (of length nSeq) is for \(m = 1,2\), $$y_j = H(m, \nu+j-1, z),$$ computed for \(j=1,\dots,nSeq\).

If expon.scaled is true, the sequence is for \(m = 1,2\) $$y_j = \exp(-\tilde{m} z i) \cdot H(m, \nu+j-1, z),$$ where \(\tilde{m} = 3-2m\) (and \(i^2 = -1\)), for \(j=1,\dots,nSeq\).

References

see BesselI.

See Also

BesselI etc; the Airy function Airy.

Examples

Run this code
##------------------ H(1, *) ----------------
nus <- c(1,2,5,10)
for(i in seq_along(nus))
   curve(BesselH(1, x, nu=nus[i]), -10, 10, add= i > 1, col=i, n=1000)
legend("topleft", paste("nu = ", format(nus)), col = seq_along(nus), lty=1)

## nu = 10 looks a bit  "special" ...   hmm...
curve(BesselH(1, x, nu=10), -.3, .3, col=4,
      ylim = c(-10,10), n=1000)

##------------------ H(2, *) ----------------
for(i in seq_along(nus))
   curve(BesselH(2, x, nu=nus[i]), -10, 10, add= i > 1, col=i, n=1000)
legend("bottomright", paste("nu = ", format(nus)), col = seq_along(nus), lty=1)
## the same nu = 10 behavior ..

Run the code above in your browser using DataLab