Bessel                 package:base                 R Documentation

_B_e_s_s_e_l _F_u_n_c_t_i_o_n_s

_D_e_s_c_r_i_p_t_i_o_n:

     Bessel Functions of integer and fractional order, of first and
     second kind, J(nu) and Y(nu), and Modified Bessel functions (of
     first and third kind), I(nu) and K(nu). 

     `gammaCody' is the (Gamma) function as from the Specfun package
     and originally used in the Bessel code.

_U_s_a_g_e:

     besselI(x, nu, expon.scaled = FALSE)
     besselK(x, nu, expon.scaled = FALSE)
     besselJ(x, nu)
     besselY(x, nu)
     gammaCody(x)

_A_r_g_u_m_e_n_t_s:

       x: numeric, >= 0.

      nu: numeric; >= 0 unless in `besselK' which is symmetric in `nu'.
           The order of the corresponding Bessel function.

expon.scaled: logical; if `TRUE', the results are exponentially scaled
          in order to avoid overflow (I(nu)) or underflow (K(nu)),
          respectively.

_D_e_t_a_i_l_s:

     The underlying C code stems from Netlib (<URL:
     http://www.netlib.org/specfun/r[ijky]besl>).

     If `expon.scaled = TRUE', exp(-x) I(x;nu), or exp(x) K(x;nu) are
     returned.

     `gammaCody' may be somewhat faster but less precise and/or robust
     than R's standard `gamma'.  It is here for experimental purpose
     mainly, and may be defunct very soon.

_V_a_l_u_e:

     Numeric vector of the same length of `x' with the (scaled, if
     `expon.scale=TRUE') values of the corresponding Bessel function.

_R_e_f_e_r_e_n_c_e_s:

     Abramowitz, M. and Stegun, I. A. (1972) Handbook of Mathematical
     Functions. Dover, New York; Chapter 9: Bessel Functions of Integer
     Order.

_S_e_e _A_l_s_o:

     Other special mathematical functions, as the `gamma', Gamma(x),
     and `beta', B(x).

_E_x_a_m_p_l_e_s:

     nus <- c(0:5,10,20)

     x <- seq(0,4, len= 501)
     plot(x,x, ylim = c(0,6), ylab="",type='n', main = "Bessel Functions  I_nu(x)")
     for(nu in nus) lines(x,besselI(x,nu=nu), col = nu+2)
     legend(0,6, leg=paste("nu=",nus), col = nus+2, lwd=1)

     x <- seq(0,40,len=801); yl <- c(-.8,.8)
     plot(x,x, ylim = yl, ylab="",type='n', main = "Bessel Functions  J_nu(x)")
     for(nu in nus) lines(x,besselJ(x,nu=nu), col = nu+2)
     legend(32,-.18, leg=paste("nu=",nus), col = nus+2, lwd=1)

     x0 <- 2^(-20:10)
     plot(x0,x0^-8, log='xy', ylab="",type='n',
          main = "Bessel Functions  J_nu(x)  near 0\n log - log  scale")
     for(nu in sort(c(nus,nus+.5))) lines(x0,besselJ(x0,nu=nu), col = nu+2)
     legend(3,1e50, leg=paste("nu=", paste(nus,nus+.5, sep=",")), col=nus+2, lwd=1)

     plot(x0,x0^-8, log='xy', ylab="",type='n',
          main = "Bessel Functions  K_nu(x)  near 0\n log - log  scale")
     for(nu in sort(c(nus,nus+.5))) lines(x0,besselK(x0,nu=nu), col = nu+2)
     legend(3,1e50, leg=paste("nu=", paste(nus,nus+.5, sep=",")), col=nus+2, lwd=1)

     x <- x[x > 0]
     plot(x,x, ylim=c(1e-18,1e11),log="y", ylab="",type='n',
          main = "Bessel Functions  K_nu(x)")
     for(nu in nus) lines(x,besselK(x,nu=nu), col = nu+2)
     legend(0,1e-5, leg=paste("nu=",nus), col = nus+2, lwd=1)

     ## Check the Scaling :
     for(nu in nus)
        print(all(abs(1- besselK(x,nu)*exp( x) / besselK(x,nu,expo=TRUE)) < 2e-15))
     for(nu in nus)
        print(all(abs(1- besselI(x,nu)*exp(-x) / besselI(x,nu,expo=TRUE)) < 1e-15))

     yl <- c(-1.6, .6)
     plot(x,x, ylim = yl, ylab="",type='n', main = "Bessel Functions  Y_nu(x)")
     for(nu in nus){xx <- x[x > .6*nu]; lines(xx,besselY(xx,nu=nu), col = nu+2)}
     legend(25,-.5, leg=paste("nu=",nus), col = nus+2, lwd=1)

