bess.zro: Calculates Spherical Bessel functions from 0 to nmax.

Description Usage Arguments Details Value Examples

Description

Calculates Spherical Bessel functions from 0 to nmax.

Usage

1

Arguments

nmax

The maximum order of j_n(x)

x

The argument of j_n(x)

code

If you prefer to use native R or C language. The algorithm is the same.

Details

bess.sph calculates the Spherical Bessel functions using downward recurrence, from j_nmax(x) to j_0(x). The system of equations is given by S_n(x)=n/x, r[n]=j_n/j_{n+1} and c_n=j_n'(x)/j_n(x). The system can be solved by means of the recurrence relations of the Spherical Bessel functions

r[n-1]+ 1/r[n]=S[2n+1]

nr[n-1]-(n+1)/r[n]=(2n+1)c[n]

that can be rewriten

r[n]=S[n+2]+c[n+1]

1/r[n]=S[n ]-c[n ].

The logarithmic derivatives obeys the relation,

(S[n+2]-c[n])(S[n]+C[n])=1.

The values can be calculated upward or downward.

Value

An array of Spherical Bessel functions and its derivatives from 0 to nmax at point x

Examples

1
2
3
4
5
6
7
8
x<-5
nmax<-50
a<-bess.sph(nmax,x,code="C")
b<-bess.sph(nmax,x,code="R")
d<-sqrt(pi/(2*x))*besselJ(x=x,nu=.5+(0:nmax))
plot(a$jn)
points(b$jn,col='red',pch=4)
points(d,col='blue',pch=3)

wendellopes/rvswf documentation built on May 4, 2019, 4:19 a.m.