Modifier and Type | Method and Description |
---|---|
static double[] |
I(double xnu,
double x,
int n)
Evaluates a sequence of modified Bessel functions of the first kind with
real order and real argument.
|
static double[] |
I(double x,
int n)
Evaluates a sequence of modified Bessel functions of the first kind with
integer order and real argument.
|
static double[] |
J(double xnu,
double x,
int n)
Evaluate a sequence of Bessel functions of the first kind with real order
and real positive argument.
|
static double[] |
J(double x,
int n)
Evaluates a sequence of Bessel functions of the first kind with integer
order and real argument.
|
static double[] |
K(double xnu,
double x,
int n)
Evaluates a sequence of modified Bessel functions of the third kind with
fractional order and real argument.
|
static double[] |
K(double x,
int n)
Evaluates a sequence of modified Bessel functions of the third kind with
integer order and real argument.
|
static double[] |
scaledK(double v,
double x,
int n)
Evaluate a sequence of exponentially scaled modified Bessel functions of
the third kind with fractional order and real argument.
|
static double[] |
Y(double xnu,
double x,
int n)
Evaluate a sequence of Bessel functions of the second kind with real
nonnegative order and real positive argument.
|
public static double[] K(double x, int n)
x
- a double
representing the argument for which the
sequence of Bessel functions is to be evaluatedn
- an int
which specifies the order of the last
element in the sequencedouble
array of length n+1 containing the values
of the function through the seriespublic static double[] K(double xnu, double x, int n)
$$K_\nu (x) = \frac{\pi}{2}e^{\nu \pi i/2} \left[ {i\,J_\nu (ix) - Y_\nu (ix)} \right] \,\,\,\, \rm{for} - \pi \lt \arg \,x \le \frac{\pi}{2}$$
Currently,xnu
(represented by \(\nu\) in
the above equation) is restricted to be less than one in absolute value.
A total of n values is stored in the result, K
.
K
\(\left[ {\rm{0}} \right] = K_v (x)\),
K
\(\left[ {\rm{1}} \right] = K_{v + 1} (x)
\), \(\ldots\), K
\(
\left[ {n - 1} \right] = K_{v + n - 1} (x)\).
This method is based on the work of Cody (1983).
xnu
- a double
representing the fractional order of the
function. xnu
must be less than one in absolute value.x
- a double
representing the argument for which the
sequence of Bessel functions is to be evaluated.n
- an int
representing the order of the last element
in the sequence. If order is the highest order desired, set
n
to int(order).double
array of length n+1 containing the values
of the function through the series. Bessel.K[I] contains the value of the
Bessel function of order I+v at x
for I=0 to n
.public static double[] scaledK(double v, double x, int n)
v
- a double
representing the fractional order of the
function. v
must be less than one in absolute value.x
- a double
representing the argument for which the
sequence of Bessel functions is to be evaluated.n
- an int
representing the order of the last element
in the sequence. If order is the highest order desired, set
n
to int(order).double
array of length n+1
containing
the values of the function through the series. If n
is
positive, Bessel.K[I]
contains
\(e^x\) times the value of the Bessel function of order
I+v
at x
for I=0 to n
. If
n
is negative, Bessel.K[I]
contains
\(e^x\) times the value of the Bessel function of order
v-I
at x
for I=0 to n
.public static double[] J(double x, int n)
$$J_n \left( x \right) = {1 \over \pi }\int_0^\pi {\,\cos \left( {x\,\sin \,\theta - n\,\theta } \right)\,} d\,\theta$$
The algorithm is based on a code due to Sookne (1973b) that uses backward recursion with strict error control.x
- a double
representing the argument for which the
sequence of Bessel functions is to be evaluatedn
- an int
which specifies the order of the last
element in the sequencedouble
array of length n+1
containing
the values of the function through the series. Bessel.J[i]
contains the value of the Bessel function of order i at x
for i=0 to n
.public static double[] J(double xnu, double x, int n)
$$J_\nu (x) = {{(x/2)^\nu } \over {\sqrt \pi \Gamma (\nu + 1/2)}}\int_0^\pi {\,\,\cos \left( {x\,\cos \,\theta } \right)\sin ^{2\nu } \theta \,\,d\,\theta }$$
This code is based on the work of Gautschi (1964) and Skovgaard (1975). It uses backward recursion.xnu
- a double
representing the lowest order desired.
xnu
must be at least zero and less than 1.x
- a double
representing the argument for which the
sequence of Bessel functions is to be evaluatedn
- an int
representing the order of the last element
in the sequence. If order is the highest order desired, set
n
to int
(order).double
array of length n+1
containing
the values of the function through the series. Bessel.J[I]
contains the value of the Bessel function of order I+v at x
for I=0 to n
.public static double[] I(double x, int n)
$$I_n \left( x \right) = {1 \over \pi }\int_0^\pi {\,e^{x\,\cos \,\theta}} \,\cos \left( {n\,\theta } \right)\,d\,\theta$$
The input x
must satisfy \({\rm{|x| }} \le {\rm{
log(b) }}\) where b is the largest representable floating-point
number. The algorithm is based on a code due to Sookne (1973b), which
uses backward recursion.
x
- a double
representing the argument of the Bessel
functions to be evaluatedn
- is the int
order of the last element in the
sequencedouble
array of length n+1
containing
the values of the function through the series. Bessel.I[i]
contains the value of the Bessel function of order i.public static double[] I(double xnu, double x, int n)
$$I_\nu (x) = {1 \over \pi }\int_0^\pi {e^{x\cos \theta } } \cos (\nu \theta )d\,\theta - {{\sin (\nu \pi )} \over \pi }\int_0^\infty {e^{ - x\cosh t - vt} } dt$$
Here, argument xnu
is represented by
\(\nu\) in the above equation.
The input x must be nonnegative and less than or equal to log(b) (b is
the largest representable number). The argument \(\nu
\) = xnu
must satisfy \({\rm{0 }} \le {\rm{
}}\nu {\rm{ }} \le {\rm{ 1}}\).
This function is based on a code due to Cody (1983), which uses backward recursion.
xnu
- a double
representing the lowest order desired.
xnu
must be at least zero and less than 1x
- a double
representing the argument of the Bessel
functions to be evaluatedn
- is the int
order of the last element in the
sequencedouble
array of length n+1
containing
the values of the function through the series. Bessel.I[i]
contains the value of the Bessel function of order i+xnu
.public static double[] Y(double xnu, double x, int n)
$$Y_\nu (x) = {1 \over \pi }\int_0^\pi {\cos (x\sin \theta - \nu \theta )d\,\theta }$$
$$\, - \frac{1}{\pi }\int_0^\infty {\,\left[ {e^{\nu t} + e^{ - \nu t} \,\cos \left( {\nu \pi } \right)} \right]} \,e^{ - x\,\sinh \,t} \,dt$$
The variable xnu
(represented by \(\nu
\) in the above equation) must satisfy \(0 \le \nu \lt
1\). If this condition is not met, then Y
is set to
NaN
. In addition, x
must be in \(
\left[ {x_m ,x_M } \right]\) where \(x_m = 6(16^{ - 32}
)\) and \(x_m = 16^9\). If \(x \lt
x_m\), then the largest representable number is returned; and if
\(x \lt x_M\), then zero is returned.
The algorithm is based on work of Cody and others, (see Cody et al. 1976; Cody 1969; NATS FUNPACK 1976). It uses a special series expansion for small arguments. For moderate arguments, an analytic continuation in the argument based on Taylor series with special rational minimax approximations providing starting values is employed. An asymptotic expansion is used for large arguments.
xnu
- a double
representing the lowest order desired.
xnu
must be at least zero and less than 1x
- a double
representing the argument for which the
sequence of Bessel functions is to be evaluatedn
- an int
such that n+1
elements will be
evaluated in the sequencedouble
array of length n+1
containing
the values of the function through the series. Bessel.K[I]
contains the value of the Bessel function of order I+v at x
for I=0 to n
.Copyright © 2020 Rogue Wave Software. All rights reserved.