Macdonald p. 1/1 Computing the Macdonald function for complex orders Walter Gautschi wxg@cs.purdue.edu Purdue University
Macdonald p. 2/1 Integral representation K ν (x) = complex order ν = α + iβ e x cosh t cosh νt dt, x > Re K α+iβ (x) = Im K α+iβ (x) = e x cosh t cosh αt cos βt dt, e x cosh t sinh αt sin βt dt. it suffices to consider α 1; assume β 1
Macdonald p. 2/1 Integral representation K ν (x) = complex order ν = α + iβ e x cosh t cosh νt dt, x > Re K α+iβ (x) = Im K α+iβ (x) = e x cosh t cosh αt cos βt dt, e x cosh t sinh αt sin βt dt. it suffices to consider α 1; assume β 1 K iβ and K 1/2+iβ are the kernels in the ordinary and modified Kontorovich Lebedev integral transform
Macdonald p. 3/1 Gauss quadrature weight function w(u) = exp( e u ), u < recurrence coefficients for orthogonal polynomials computed by a multiple-component discretization method based on [, ] = [,.75] [.75, 1.5] [1.5, 3] [3, ] global mc mp iq idelta irout DM uv AB N=1; eps=.5e-12; mc=4; mp=; iq=; idelta=2; Mmax=9; AB=[[.75];[.75 1.5];[1.5 3];[3 Inf]]; [ab,mcap,kount]=mcdis(n,eps,@quadgp,mmax);
Macdonald p. 3/1 Gauss quadrature weight function w(u) = exp( e u ), u < recurrence coefficients for orthogonal polynomials computed by a multiple-component discretization method based on [, ] = [,.75] [.75, 1.5] [1.5, 3] [3, ] global mc mp iq idelta irout DM uv AB N=1; eps=.5e-12; mc=4; mp=; iq=; idelta=2; Mmax=9; AB=[[.75];[.75 1.5];[1.5 3];[3 Inf]]; [ab,mcap,kount]=mcdis(n,eps,@quadgp,mmax); n-point Gauss formula for n N load -ascii ab; xw=gauss(n,ab);
Macdonald p. 4/1 The function K ν (x) for x 1 change of variables e x cosh t = e 1 2 xet e 1 2 xe t = e 1 2 x e 1 2 x(et 1) e 1 2 xe t new variable 1 2 x(et 1) = e u 1, u < transformed formulae Re K α+iβ (x) = 1 2 (2/x)α e 1 1 2 x Im K α+iβ (x) = 1 2 (2/x)α e 1 1 2 x e eu f(u; α, β, x)du, e eu g(u; α, β, x)du,
Macdonald p. 4/1 The function K ν (x) for x 1 change of variables e x cosh t = e 1 2 xet e 1 2 xe t = e 1 2 x e 1 2 x(et 1) e 1 2 xe t new variable 1 2 x(et 1) = e u 1, u < transformed formulae Re K α+iβ (x) = 1 2 (2/x)α e 1 1 2 x Im K α+iβ (x) = 1 2 (2/x)α e 1 1 2 x e eu f(u; α, β, x)du, e eu g(u; α, β, x)du, for 9-digit accuracy, Gauss quadrature with n = 3 suffices difficulty: for much smaller x, steep boundary layer phenomena develop in f(u; α, β, x), g(u; α, β, x)
Macdonald p. 5/1 The function K ν (x) for x < 1 K ν (x) = ( c + c ) e x cosh t cosh νt dt c >
Macdonald p. 5/1 The function K ν (x) for x < 1 K ν (x) = ( c + c ) e x cosh t cosh νt dt c > second integral c e x cosh t cosh νt = e x cosh(τ+c) cosh ν(τ + c)dτ change of variables with ξ := xe c e x cosh(τ+c) = e 1 2 ξ e 1 2 ξ(eτ 1) e 1 2 ξe 2c e τ
Macdonald p. 5/1 The function K ν (x) for x < 1 K ν (x) = ( c + c ) e x cosh t cosh νt dt c > second integral c e x cosh t cosh νt = e x cosh(τ+c) cosh ν(τ + c)dτ change of variables with ξ := xe c e x cosh(τ+c) = e 1 2 ξ e 1 2 ξ(eτ 1) e 1 2 ξe 2c e τ looks very much like before with ξ replacing x. Since x = 1 was OK before, ξ = 1 should be OK now. This determines c = ln(1/x).
Macdonald p. 6/1 transformed formulae Re K α+iβ (x) = c Im K α+iβ (x) = c 1 + 1 2 (2/x)α e 1 2 1 + 1 2 (2/x)α e 1 2 e x cosh(τc) cosh(αcτ) cos(βcτ)dτ e eu ϕ(u; α, β, x)du, e x cosh(τc) sinh(αcτ) sin(βcτ)dτ e eu ψ(u; α, β, x)du, n 1 -point Gauss-Legendre resp. n 2 -point Gauss for.1 x 1 and 9-digit accuracy, n 1 = 3 and n 2 = 3 suffice
Macdonald p. 7/1 The function K ν (x) for x.1 K ν (x) = π/2 sin νπ (I ν(x) I ν (x)), ν N
Macdonald p. 7/1 The function K ν (x) for x.1 K ν (x) = π/2 sin νπ (I ν(x) I ν (x)), ν N combine power series expansions for I ±ν with reflection formula for the gamma function Γ(ν)Γ(1 ν) = three-term approximation π sin νπ ( K ν (x) 1 x ν 2 2) Γ(ν) [1 + x2 4(1 ν) + x 4 ( ] + 1 x ν 2 2) Γ( ν) [1 + x2 4(1+ν) + x 4 32(1+ν)(2+ν) 32(1 ν)(2 ν) ]
Macdonald p. 8/1 The function K α+iβ for β > 1 computationally difficult and complex alternative symbolic computation
Macdonald p. 8/1 The function K α+iβ for β > 1 computationally difficult and complex alternative symbolic computation Matlab K=mfun( BesselK,a+b*i,x) Example >> K=mfun( BesselK,15*i,2) K = 3.6974975761981e-11
Macdonald p. 9/1 Plots of K iβ β = 1/2 β = 1 2.6 1.5.4 1.2.5.2.4.5.6 1.2.4.6.8.1.12.14.16.18.2.8.5 1 1.5 β = 2 β = 5.1 6 x 1 4.8.6 4.4 2.2.2 2.4.6 4.8.5 1 1.5 2 2.5 3 3.5 4 4.5 5 6 1 2 3 4 5 6 7 8 9 1
Macdonald p. 1/1 Plots of K 1/2+iβ Re K 1/2+iβ β = 1/2 Im K 1/2+iβ 5 9 8 7 5 6 5 1 4 15 3 2 2 1 25.2.4.6.8.1.12.14.16.18.2.2.4.6.8.1.12.14.16.18.2 Re K 1/2+iβ β = 1 Im K 1/2+iβ.5 1.5 1.5.5.5 1 1 1.5 1.5 2 2 2.5 3 2.5.5 1 1.5 3.5.5 1 1.5
Macdonald p. 11/1 Plots of K 1/2+iβ (cont ) Re K 1/2+iβ β = 2 Im K 1/2+iβ.6.5.4.4.3.2.2.1.2.1.4.2.3.6.4.8.5 1 1.5 2 2.5 3 3.5 4 4.5 5.5.5 1 1.5 2 2.5 3 3.5 4 4.5 5 Re K 1/2+iβ β = 5 Im K 1/2+iβ 3 x 1 3 4 x 1 3 2 2 1 2 1 4 2 6 3 1 2 3 4 5 6 7 8 9 1 8 1 2 3 4 5 6 7 8 9 1
Macdonald p. 12/1 Behavior at infinity and zero of K iβ K iβ (x) π 2x e x, x
Macdonald p. 12/1 Behavior at infinity and zero of K iβ π K iβ (x) 2x e x, x K iβ (x) where π β sinh βπ k(x, β), x k(x, β) = sin(β ln(2/x) + arg Γ(1 + iβ))
Macdonald p. 12/1 Behavior at infinity and zero of K iβ π K iβ (x) 2x e x, x note K iβ (x) where π β sinh βπ k(x, β), x k(x, β) = sin(β ln(2/x) + arg Γ(1 + iβ)) γ := arg Γ(1 + iβ) = Im [ln Γ(1 + iβ)]
Macdonald p. 13/1 Computing the Kontorovich-Lebedev transform F (β) = K iβ (x)f(x)dx, β >
Macdonald p. 13/1 Computing the Kontorovich-Lebedev transform F (β) = for evaluation F (β) = ( 2 K iβ (x)f(x)dx, β > + 2 ) K iβ (x)f(x)dx
Macdonald p. 13/1 Computing the Kontorovich-Lebedev transform F (β) = for evaluation F (β) = ( 2 Gauss Laguerre on K iβ (x)f(x)dx, β > + 2 ) K iβ (x)f(x)dx 2 K iβ (x)f(x)dx = [e t K iβ (2 + t)f(2 + t)]e t dt
Macdonald p. 14/1 computing the KL transform (cont ) special treatment of 2 K iβ(x)f(x)dx = 2 f(x)dx + π β sinh βπ [K iβ(x) 2 π β sinh βπ k(x, β)] f(x) sin(β ln(2/x) + γ)dx
Macdonald p. 14/1 computing the KL transform (cont ) special treatment of 2 K iβ(x)f(x)dx = 2 f(x)dx + π β sinh βπ [K iβ(x) 2 π β sinh βπ k(x, β)] f(x) sin(β ln(2/x) + γ)dx Gauss Legendre on first, and Gauss Laguerre on second integral, 2 f(x) sin(β ln(2/x) + γ)dx = 2 f(2e t ) sin(βt + γ)e t dt
Macdonald p. 15/1 Special Gaussian quadrature where 1 f(2t) sin(β ln(1/t) + γ)dt = 1 f(2t)w β(t)dt 1 f(2t)dt w β (t) = 1 + sin(β ln(1/t) + γ) on [, 1]
Macdonald p. 15/1 Special Gaussian quadrature where 1 f(2t) sin(β ln(1/t) + γ)dt = 1 f(2t)w β(t)dt 1 f(2t)dt w β (t) = 1 + sin(β ln(1/t) + γ) on [, 1] moments of w β m k = 1 tk w β (t)dt = 1 k+1 + 1 (k+1) 2 +β ((k + 1) sin γ + β cos γ), 2 k =, 1, 2,...
Macdonald p. 15/1 Special Gaussian quadrature where 1 f(2t) sin(β ln(1/t) + γ)dt = 1 f(2t)w β(t)dt 1 f(2t)dt w β (t) = 1 + sin(β ln(1/t) + γ) on [, 1] moments of w β m k = 1 tk w β (t)dt = 1 k+1 + 1 (k+1) 2 +β ((k + 1) sin γ + β cos γ), 2 k =, 1, 2,... symb/vpa-chebyshev algorithm = orthogonal polynomials = Gauss formula