Description

A Matlab Implementation of an Algorithm for Computing Integrals of Products of Bessel Functions

All materials on our website are shared by users. If you have any questions about copyright issues, please report us to resolve them. We are always happy to assist you.

Related Documents

Share

Transcript

A Matlab Implementation of an Algorithm forComputing Integrals of Products of Bessel Functions
Joris Van Deun and Ronald Cools
Dept. of Computer Science, K.U. Leuven, B-3001 Leuven, Belgium
{
joris.vandeun, ronald.cools
}
@cs.kuleuven.be
Abstract.
We present a Matlab program that computes inﬁnite range integrals of an arbitrary product of Bessel functions of the ﬁrst kind. The algorithm uses anintegral representation of the upper incomplete Gamma function to integrate thetail of the integrand. This paper describes the algorithm and then focuses on someimplementation aspects of the Matlab program. Finally we mention a generalisa-tion that incorporates the Laplace transform of a product of Bessel functions.
1 Introduction
Integrals of products of Bessel functions arise in a wide variety of problems fromphysics and engineering. Many of the integrals that occur in the literature contain onlyone or two Bessel functions, e.g. in computing the ﬁlter loss coefﬁcient in optical ﬁbretechnology [11], surface displacement in dynamic pavement testing [16], antenna the-ory[17], gravitationalﬁelds of astrophysicaldiscs [5], crackproblemsin elasticity [22],particle motion in an unbounded rotating ﬂuid [6,21], theoretical electromagnetics [8]or distortions of nearly circular lipid domains [20]. Techniques to compute this type of integrals are discussed in [2,14,22]. Analytic expressions for some special cases can befound in [19,26].The more general case of a product of an arbitrary number of Bessel functions isfar more difﬁcult to handle and there are less analytic results known. For three or fourfactors we refer to [15,19,26]. The last reference also contains examples of integralswith an arbitrary number of factors. The numerical computation of these integrals hasnot gainedmuchattention, eventhoughthey occur in several applications,rangingfromFeynmandiagramsin nuclearphysics [10] to quantumﬁeld theory[7], speech enhance-ment [13] and scattering theory [9].In [25] we presented an algorithm to compute integrals of the form
I
(
a
,
ν
,m
) =
∞
0
x
mk
i
=1
J
ν
i
(
a
i
x
)
dx
(1)where the coefﬁcients
a
i
∈
R
+0
(we use
a
to denote the vector which contains thesecoefﬁcients), the orders
ν
i
∈
R
, the power
m
∈
R
and
ki
=1
ν
i
+
m >
−
1
. This lastcondition assures that a possible singularity in zero is integrable. However, if some of the
ν
i
are negativeintegers, this condition may not be satisﬁed, even thoughthe integralexists. This follows from formula 9.1.5 in [1] which reads as follows,
J
−
n
(
x
) = (
−
1)
n
J
n
(
x
)
.
A. Iglesias and N. Takayama (Eds.): ICMS2006, LNCS 4151, pp. 284–295, 2006.c
Springer-Verlag Berlin Heidelberg 2006
A Matlab Implementation of an Algorithm 285
This case is detected by the program and the formula is used to transform negativeinteger orders to positive integer orders.The case of negative coefﬁcients
a
i
can always be reduced to the case of positivecoefﬁcients using [1, p. 360]
J
ν
(
−
z
) =
e
νπ
i
J
ν
(
z
)
,
where
i
is the imaginaryunit,
i
2
=
−
1
. We leave it to the user to do this transformation,so that the output of our program is always a real number.Our algorithm has been implemented in the Matlab program
besselint
, whichalso works under Octave. For more information about the different versions of Mat-lab and Octave we tested, we refer to the section about backward compatibility. Wealso mention that our program solves one of the additional problems arising from Tre-fethen’s 100-Digit Challenge [23]. Problem 8 in Appendix D of the book [4] concernsthe evaluation of the integral
∞
0
xJ
0
(
x
√
2)
J
0
(
x
√
3)
J
0
(
x
√
5)
J
0
(
x
√
7)
J
0
(
x
√
11)
dx,
(2)which is just a special case of the more general formula (1).In the next section we describe how the algorithm works. In the rest of the paperwe then discuss some implementation issues particularly related to the fact that theprogram is meant to be used under Matlab or Octave and we mention some possibleimprovements and generalisations.
2 Description of the Algorithm
We provide a brief overview of the algorithm. For more details we refer the reader to[25].The main difﬁculties in computing (1) come from the irregular oscillatory behaviourand possible slow decay of the integrand. We cannot just truncate the integral at a ﬁnitevalue and assume that the remaining contribution is negligible; the inﬁnite part needsspecial treatment. This is illustrated in Figures 1 and 2, which show the integrand of formula (2).The approach we take is to split the integral at a breakpoint
x
0
and approximate theﬁnite and inﬁnite part separately.The determinationof this breakpointwill be discussedbelow.For theﬁnite part,the interval
[0
,x
0
]
is dividedintoa numberofsubintervalsroughlyproportionalto the number of zeros in the integrand.Each subinterval is then integratednumericallyusing a Gauss-Legendrequadraturerule. The weights and nodes have beenhard-codedintotheprogramtospeedupperformance.Inmostcasesweneeda 15–pointrule to reach full precision, followed by a 19–point rule to obtain the error estimate.From formula 9.1.7 in [1] it follows that the integrand
f
(
x
)
satisﬁes
f
(
x
) =
x
p
∞
i
=0
α
i
x
i
, x
→
0
,
286 J. Van Deun and R. Cools
0 0
.
5 1 1
.
5
2
−
0
.
0500
.
050
.
10
.
150
.
2
Fig.1.
Plot of the integrand of formula (2) near
x
= 0
(the exact values of
α
i
are not relevant), where
p
=
ki
=1
ν
i
+
m
. If
p
is not a positiveinteger, there is an algebraic singularity in 0 which we can remove by extrapolating inthe sense of Richardson. This has also been incorporated in the program.For the inﬁnite part we use the asymptotic expansion of
J
ν
(
x
)
as given in [26, p.199]. Taking
n
+ 1
terms in each expansion leads to an approximation of the form
x
mk
i
=1
J
ν
i
(
a
i
x
)
∼
2
ℜ
x
m
j
e
i
η
j
x
F
n,j
(
ν
,
a
x
)
where
ℜ
denotes the real part,
η
j
=
a
1
±
a
2
±···±
a
k
and the sum is over all possiblecombinations. The functions
F
n,j
consist of polynomials of degree
k
(2
n
+ 1)
in
1
/x
times
x
−
k/
2
. Integrating this approximation, we have to compute
∞
x
0
e
i
η
i
x
x
m
−
k/
2
−
j
dx, i
= 1
,
2
,...,
2
k
−
1
, j
= 0
,
1
,...,k
(2
n
+ 1)
.
(3)which we can do analytically, using the upper incomplete Gamma function. This func-tion is deﬁned as [1, p. 260]
Γ
(
a,x
) =
∞
x
t
a
−
1
e
−
t
dt,
and can be extended to arbitrary complex
a
and
x
by analytic continuation. This waywe may write
∞
x
0
e
i
η
i
x
x
m
−
k/
2
−
j
dx
=
i
η
i
m
−
k/
2
−
j
+1
Γ
(
m
−
k/
2
−
j
+ 1
,
−
i
η
i
x
0
)
.
(4)The accuracy of the approximation for the inﬁnite part depends on the breakpoint
x
0
and on the order of the asymptotic expansion
n
, and we can estimate this accuracy
A Matlab Implementation of an Algorithm 287
0 5 10 15 20
−
0
.
003
−
0
.
002
−
0
.
00100
.
0010
.
002
Fig.2.
Plot of the tail of the integrand of formula (2)
(as a function of
x
0
and
n
) based on a ﬁrst order error analysis. It then turns out thatfor a ﬁxed accuracy there are always inﬁnitely many
(
x
0
,n
)
-pairs we can choose from.We therefore introduced a cost function
χ
(
x
0
,n
)
which describes the computationaleffort of the algorithm in terms of the number of function evaluations of the Bessel andincomplete Gamma functions,
χ
(
x
0
,n
) = 2
k
nt
GJ
+
x
0
πN
2
k
j
=1
a
j
.
The parameter
N
is the average length of the vector argument in a call to the Besselfunction. This will be explained in the next section. The (machine-dependent)constant
t
GJ
is the relative efﬁciency of computing the incomplete Gamma function comparedto computing the Bessel function. We look at this constant in more detail in the nextsection. The parameters
x
0
and
n
are now chosen such that they minimise
χ
(
x
0
,n
)
under the constraint that the (estimated) error does not exceed a required threshold. Itis up to the user to specify the absolute or relative error tolerance.
3 Determining the Parameter
t
GJ
When introducing the cost function
χ
(
x
0
,n
)
, we assumed that the computational ef-fort is dominated by the evaluations of the Bessel and incomplete Gamma function. Inour program, we use Matlab’s
besselj
function, based on Amos’ srcinal Fortrancode [3], to compute the Bessel functions. For the incomplete Gamma function we use
igamma
, a Fortran-to-Matlab conversion of the program from [12], which computes acontinuedfractionapproximationby forwardrecurrence.To test the assumptionthatthecost is dominated by these two functions, we run
besselint
on a set of 21 exampleswhich are thought to be representative (in the sense that they do not use extremelylargevalues for the parameters or the number of factors in the integrand). The values of
a
,

Search

Similar documents

Related Search

An Implementation of Expert System For RegistStudy, Design and Implementation of a QuadcopA new set of methods for humiliate and hurt TStrategy for the Implementation of e-ProcuremDevelopment and Implementation of a Fuzzy LogPLC Implementation of PID Controllers for InAssociation For Computing MachineryA storical Survey of East Wollega OromoMarriage as a Sociological Means of Cultural Modernist Idea of a Single Style of the Epoch

We Need Your Support

Thank you for visiting our website and your interest in our free products and services. We are nonprofit website to share and download documents. To the running of this website, we need your help to support us.

Thanks to everyone for your continued support.

No, Thanks