BesselK
Usage Message: BesselK[n, z] gives the modified Bessel function of the second kind K(n, z). Attributes[BesselK] = {Listable, NumericFunction, Protected} Related Symbols BesselI
, BesselJ
, BesselY
Notes: The definition of BesselK that is used in Mathematica is based on the definitions used in "Handbook of Mathematical
Functions" by Milton Abramowitz and Irene A. Stegun. Numerical values of BesselK[n, z] are computed using series expansions,
asymptotic expansions, identities involving BesselI
, and other algorithms, depending on the values of n and z. Forward recursion is used for half-integer values of
n. Here is a definition for a function NBesselK[n, z] which illustrates a simple series expansion that can be used to
compute numerical values of BesselK[n, z] for integer values of n. The algorithm used by NBesselK will not
necessarily be as fast or as reliable as the algorithm used by BesselK, but the results should be comparable for broad ranges of n and
z. The series is summed using NSum .
NBesselK[v_Integer?Negative, z_] := BesselK[-v, z]
NBesselK[v_Integer, z_] :=
Module[{prec = Precision[z], result},
result = NSum[((z^2)^v/z^v PolyGamma[k+1] +
z^v PolyGamma[k+1+v]) *
(1/4 z^2)^k/(k! (v+k)!),
{k, 0, Infinity},
VerifyConvergence -> False,
Method -> SequenceLimit,
WorkingPrecision -> prec];
N[1/2 (z/2)^(-v) Sum[(v-k-1)!/k! (-1/4 z^2)^k,
{k, 0, v-1}] +
(-1)^v (Log[2]-Log[z]) BesselI[v, z] +
(-1)^v 1/2 (1/2)^(v) result, prec]
] /; Less[Precision[z], Infinity]
After entering this definition for NBesselK you should see behavior such as the following, which can be compared with the corresponding behavior of BesselK.
In[3]:= NBesselK[1, 2.3 + 4.1 I]
Out[3]= -0.001213065659000589 + 0.06043416090398957 I
In[4]:= BesselK[1, 2.3 + 4.1 I]
Out[4]= -0.00121307 + 0.0604342 I
Additional Online Documentation:
Mathematica 3.0
http://documents.wolfram.com/v3/RefGuide/BesselK.html
Mathematica 4.0
http://documents.wolfram.com/v4/RefGuide/BesselK.html
Questions or comments? Send email to support@wolfram.com.
| |