bess.ric: Calculates Ricatti-Bessel functions from 0 to nmax.

Description Usage Arguments Details Value Examples

Description

Calculates Ricatti-Bessel functions from 0 to nmax.

Usage

1
bess.ric(nmax, x, code = "C")

Arguments

nmax

The maximum order of R_n(x)

x

The argument of R_n(x)

code

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

Details

bess.ric calculates the Ricatti-Bessel functions using downward recurrence, from R_nmax(x) to R_0(x). The system of equations is given by S_n(x)=n/x, r[n]=R_n/R_{n+1} and C_n=R_n'(x)/R_n(x). The system can be solved by means of the recurrence relations of the Ricatti-Bessel functions

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

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

that can be rewriten

r[n]=S[n+1]+C[n+1]

1/r[n]=S[n+1]-C[n ].

The logarithmic derivatives obeys the relation,

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

The values can be calculated upward or downward.

Value

An array of Ricatti-Bessel functions and its derivatives. from 0 to nmax at point x

Examples

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

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