Last data update: 2014.03.03

R: Hankel (H-Bessel) Function (of Complex Argument)
BesselHR Documentation

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.

Usage

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

Arguments

m

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

z

complex or numeric vector of valus 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, ...

Details

By default (when expon.scaled is false), the resulting sequence (of length nSeq) is

y[j]= H(m, nu+j-1, z),

computed for j=1,...,nSeq.

If expon.scaled is true, the sequence is

y[j]= exp(-mm*z* i)* H(m, nu+j-1, z),

where mm = 3-2*m (and i^2 = -1), for j=1,...,nSeq.

Value

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

Author(s)

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

References

see BesselI.

See Also

BesselI etc; the Airy function Airy.

Examples

##------------------ 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 ..

Results


R version 3.3.1 (2016-06-21) -- "Bug in Your Hair"
Copyright (C) 2016 The R Foundation for Statistical Computing
Platform: x86_64-pc-linux-gnu (64-bit)

R is free software and comes with ABSOLUTELY NO WARRANTY.
You are welcome to redistribute it under certain conditions.
Type 'license()' or 'licence()' for distribution details.

R is a collaborative project with many contributors.
Type 'contributors()' for more information and
'citation()' on how to cite R or R packages in publications.

Type 'demo()' for some demos, 'help()' for on-line help, or
'help.start()' for an HTML browser interface to help.
Type 'q()' to quit R.

> library(Bessel)
Loading required package: Rmpfr
Loading required package: gmp

Attaching package: 'gmp'

The following objects are masked from 'package:base':

    %*%, apply, crossprod, matrix, tcrossprod

C code of R package 'Rmpfr': GMP using 64 bits per limb


Attaching package: 'Rmpfr'

The following objects are masked from 'package:stats':

    dbinom, dnorm, dpois, pnorm

The following objects are masked from 'package:base':

    cbind, pmax, pmin, rbind

> png(filename="/home/ddbj/snapshot/RGM3/R_CC/result/Bessel/Hankel.Rd_%03d_medium.png", width=480, height=480)
> ### Name: BesselH
> ### Title: Hankel (H-Bessel) Function (of Complex Argument)
> ### Aliases: Hankel BesselH
> ### Keywords: math
> 
> ### ** Examples
> 
> ##------------------ 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 ..
> 
> 
> 
> 
> 
> dev.off()
null device 
          1 
>