1. Introduction
The Bessel equation and its modified form play an important role for modeling common problems in science and engineering. These equations appear in different contexts spanning areas like electrodynamics [
1,
2], plasma-physics [
3,
4,
5], heat transfer [
6,
7,
8], chemical engineering [
9], fluid mechanics [
10,
11], and others [
12,
13]. Bessel functions with integer order appear in systems with cylindrical symmetry, and those with half integer order in spherical symmetries. The first kind solution of the modified Bessel equation is called
, and it corresponds to a power series which is used to obtain the solution of a variety of problems. However, the numerical calculation for large and intermediate values of
x requires a large number of terms of the series to get good accuracy, which has impulsed a range of different techniques for computing the modified Bessel functions properly in a reasonable time frame. In general, these techniques pursue two kinds of goals. A first group focuses on formulating a simple approximation of the modified Bessel function with a low number of fitting parameters. They can be used in correlations originated from the Bessel equation or from more complex equations where the Bessel equation is involved. These approximations allow a simple and direct computation of the solution, without using the modified Bessel function itself. An example of this kind of technique is the model proposed in [
14], where the modified Bessel function is approximated by a finite sum of exponential functions, which considers eight fitting parameters established for different intervals of the domain. A more extensive analytic approximation for the specific case of
has also been published in [
15]. The method to obtain this approximation was based on the so-called multi-point quasi-rational approximation technique (MPQA) [
16]. That approximation is valid for any positive value of
x, and its maximum relative error was about one percent, considering just five parameters for the entire domain.
On the other hand, there is a second group of approximation techniques focused exclusively on the accuracy of the fitting function, which implies a larger number of fitting parameters, truncated series, or algorithms based on conditional loops. In this case, the Bessel approximation can be coded in a programming language to be used in computers as a function that can be easily called by a user. An important initial attempt to achieve a high level of accuracy was made by polynomial approximations in [
17], and it was coded in different programming languages [
18]. Here, eight or ten fitting parameters are used in an expression for
, depending on the argument interval. The fitting function resembles the power series and the asymptotic expansion of the modified Bessel function, for low and large values of the argument, respectively. A simple method in this group considers to compute the power series and the asymptotic expansion of the modified Bessel function directly, defining a criterion for limiting the scope of each series and the number of terms to be used. This was proposed in [
19], where a code written in FORTRAN language is presented for computing
. A remarkable fast technique to compute the modified Bessel function with a high level of precision is presented in [
20]. This technique is based on an algorithm that evaluates the ratio of the
st term to the
kth term of the power series of
in a loop. The iterative code is very simple and short, and surprisingly faster than some well-established software like MATHEMATICA and MAPLE in several orders of magnitude for large arguments, which was verified in the same work by running time experiments made in a common laptop.
In the present work, a simple and very precise analytic approximation for
has been determined using only six fitting parameters. The methodology corresponds to the MPQA as in [
15], but the structure of the new approach differs substantively from the previous one. Now, the new structure is built in such a way that includes more information from the asymptotic expansion of
. Specifically, a sum of two hyperbolic functions (combined with rational ones) was introduced. The direct effect of this change on the new approach was the capture of the two first leading terms of the asymptotic expansion, producing a strong increment in accuracy for intermediate values of the
x variable. The new approximation is valid for any real value of
x, positive or negative.
The theoretical treatment of this study, including the equations to determine the fitting parameters of the analytic approximation of
, will be presented in
Section 2. The results and discussion will be performed in
Section 3. An analysis to determine the convergence of the new approximation to the exact function has also been included at the end of
Section 3. Finally,
Section 4 will be devoted to the conclusions of this work.
3. Results and Discussion
The criterion for determining
is by comparing the maximum relative error of the fitting function for different
values. In this sense, two kinds of error definitions were established: (1) an error in a point
x given the
value
, and (2) a global error
evaluated on an interval
of the
x variable. This last error is given by the maximum error
in the interval
. The expressions for the error (1) and (2) are:
Figure 2 shows the error
in the interval
as a function of
. In
Figure 2a, four local minimum points of the
function can be localized.
Figure 2b zooms in the zone where the absolute minimum value of the error is located. This absolute minimum value called
corresponds to
, and it occurs for
. Note that, when
, the value of the parameter
q corresponds to
, which satisfied the non-singular point constraint. Then, the optimal values of each parameter of the fitting function can be determined, and they are the ones shown in
Table 1.
Using the values from
Table 1, the analytic fitting function is expressed as:
Figure 3a shows the relative error of the fitting function
(Equation (
19)). The maximum error, which also corresponds to
, is
or
. This maximum error is reached for
, and it is more than one order of magnitude lower than previous research, where the error reaches a value of 1 percent [
15]. Additionally, in
Figure 3b, the analytic approximation function
is shown in comparison with the actual modified Bessel function, across the zone where the error reaches its maximum value of
. Note the strong similarity between both functions.
It is interesting to point out that the relative error of the approximation decreases with x, which shows the convergence between the approximation and the real function for large values of x. This is a consequence of the convergence between the asymptotic behaviors of the two functions. On the other side, there is also a convergence in the values near zero. The points with the higher errors will be always for intermediate x values.
It is important to note that the approximation here obtained is an odd function of
x, and therefore is good for positive as well as negative values of
x. To clarify more this matter, it is useful to compare the present approximation with that in Ref. [
17], where two approximations have been determined, one valid for
x in the interval
and the second one for positive
. The total number of parameters to be determined there are 16, six for the first interval and ten for the second one. Now, in the present work, only one approximation has been determined valid for every value of
x, positive or negative, using only six parameters. In our analysis, relative errors are analyzed instead of absolute ones because, in most of applications, the function
appears as a factor, and, for these cases, the relative error is the simplest option to be evaluated.
The approximations by finite sum of exponential functions are also important in [
14]. The characteristics of these approximations are that each one is limited to an interval. Using four intervals, they obtain fitting functions for all positive values of
x. However, the maximum relative error corresponds to 0.002 at x = 0, which is larger by a factor of five than the one here presented with only one function, and also valid for any positive and negative value of
x.
As it has been mentioned before, there are two different goals when an approximation of the modified Bessel function is built: simplicity or extreme accuracy. Our goal was to produce a simple expression suitable for using in correlations or rapid computations with a calculator, but, at the same time, providing an excellent level of accuracy. Methods based on loops or finite series achieve in general more accuracy, but they need to be coded, and they also have a computational cost intrinsic, which is negligible for our new approximation function. The relative error in a loop routine can be of order
, but the running time in a common two core laptop can fluctuate from a fraction of second to several minutes to compute
for large values of
x, depending on the routine method [
20].
To study the convergence of the present approximation
with respect to the exact function, the following analysis has been performed. First, the asymptotic behavior of
is analyzed. After that, we look for the differences with the asymptotic expansion of
. Finally, the relative error
for large values of
x is determined, showing the actual convergence of
for large values of
x.
It is clear from this result that the relative error for large values of
x will be
, lower than the maximum relative error here found of
. In the present approximation, all the parameters are given with four decimals since that is enough to keep the largest relative error as low as
. The calculation we have done shows that, if the parameters are given with more digits, then the relative error for large
x can be decreased, but the maximum relative error will be the same. In case that, for any reason, a researcher needs higher approximation for large values of
x, the parameters given in
Table 1 should be improved to obtain an error of
or even of
.
4. Conclusions
A simple and accurate analytic approximation for the first kind modified Bessel function
has been determined in the present work. This approximation is much better than in a previous version [
15], since the relative error is more than one order of magnitude lower than the previous one, decreasing from
to
, and also lower (by a factor of five) than other method of the same category based on exponential functions. This substantial improvement is rooted in the new structure of the fitting function, which captures two terms of the asymptotic series of
, instead of just one as in the previous approximation version. The structural change in the new fitting function consists of the incorporation of the sum of two hyperbolic functions weighted through rational functions, which can be extended to capture more terms of the asymptotic expansion of
. An important point is that the new improvement can be applied to all Bessel functions, opening the door to new studies and perspectives. The approximation here presented is valid not only for any positive values of
x, but also for negative ones. It can also be differentiated and integrated as the real
, since only one fitting function is good for all the values of the argument. Furthermore, the relative error of the new approximation is about
which will be right for most of the applications. In addition, the calculation can be performed with a simple pocket calculator. Finally, one last analysis has also been performed showing the convergence of
to
for large values of
x. It is clear that the relative error decreases for large values of
x, and the maximum relative error is always for intermediate values of the variable
x.