Skip to content

Commit d608e51

Browse files
committed
add more docs and udpate compat
1 parent b6c5685 commit d608e51

File tree

4 files changed

+36
-10
lines changed

4 files changed

+36
-10
lines changed

Project.toml

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,8 @@ uuid = "0e736298-9ec6-45e8-9647-e4fc86a2fe38"
33
authors = ["Michael Helton <[email protected]> and contributors"]
44
version = "0.1.0"
55

6-
[deps]
7-
SpecialFunctions = "276daf66-3868-5448-9aa4-cd146d93841b"
8-
96
[compat]
10-
julia = "1.5"
7+
julia = "1.6"
118

129
[extras]
1310
Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40"

src/Bessels.jl

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
module Bessels
22

3-
using SpecialFunctions: loggamma
4-
53
export besselj0
64
export besselj1
75
export besselj

src/U_polynomials.jl

Lines changed: 20 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,19 @@
1-
besseljy_debye_cutoff(nu, x) = nu > 2.0 + 1.00035*x + Base.Math._approx_cbrt(Float64(302.681)*x) && x > 15
2-
# valid when x < v (uniform asymptotic expansions)
1+
# Debye asymptotic expansions
2+
# `besseljy_debye`, `hankel_debye`
3+
#
4+
# This file contains the debye asymptotic asymptotic expansions for large orders.
5+
# These routines can be used to calculate `besselj`, `bessely`, `besselk`, `besseli`
6+
# and the Hankel functions. These are uniform expansions for `besselk` and `besseli` for large orders.
7+
# The forms used for `besselj` and `bessely` as well as the Hankel functions follow the notation by Matviyenko [1]
8+
# but also see similar forms provided by NIST 10.19. All of these routines use a core routine for calculating
9+
# the U-polynomials (NIST 10.41.E9) where the coefficients are dependent on each function. The forms for the modified
10+
# Bessel functions `besselk` and `besseli` follow NIST 10.41 [3].
11+
#
12+
# [1] Matviyenko, Gregory. "On the evaluation of Bessel functions."
13+
# Applied and Computational Harmonic Analysis 1.1 (1993): 116-135.
14+
# [2] http://dlmf.nist.gov/10.41.E9
15+
# [3] https://dlmf.nist.gov/10.41
16+
317
"""
418
besseljy_debye(nu, x::T)
519
@@ -26,9 +40,9 @@ function besseljy_debye(v, x)
2640

2741
return coef_Jn * Uk_Jn, coef_Yn * Uk_Yn
2842
end
29-
hankel_debye_cutoff(nu, x) = nu < 0.2 + x + Base.Math._approx_cbrt(-411*x)
3043

31-
# valid when v < x (uniform asymptotic expansions)
44+
besseljy_debye_cutoff(nu, x) = nu > 2.0 + 1.00035*x + Base.Math._approx_cbrt(Float64(302.681)*x) && x > 15
45+
3246
"""
3347
hankel_debye(nu, x::T)
3448
@@ -54,6 +68,8 @@ function hankel_debye(v, x::T) where T
5468
return coef_Yn * Uk_Yn
5569
end
5670

71+
hankel_debye_cutoff(nu, x) = nu < 0.2 + x + Base.Math._approx_cbrt(-411*x)
72+
5773
function Uk_poly_Jn(p, v, p2, x::T) where T <: Float64
5874
if v > 5.0 + 1.00033*x + Base.Math._approx_cbrt(1427.61*x)
5975
return Uk_poly10(p, v, p2)

src/asymptotics.jl

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,13 @@
1+
# Asymptotics expansions for x > nu
2+
# `besseljy_large_argument`
3+
#
4+
# This file contains the asymptotic asymptotic expansions for large arguments
5+
# which is accurate in the fresnel regime |x| > nu following the derivations given by Heitman [1].
6+
# These routines can be used to calculate `besselj` and `bessely` using phase functions.
7+
#
8+
# [1] Heitman, Z., Bremer, J., Rokhlin, V., & Vioreanu, B. (2015). On the asymptotics of Bessel functions in the Fresnel regime.
9+
# Applied and Computational Harmonic Analysis, 39(2), 347-356.
10+
111
#besseljy_large_argument_min(::Type{Float32}) = 15.0f0
212
besseljy_large_argument_min(::Type{Float64}) = 20.0
313
besseljy_large_argument_min(::Type{T}) where T <: AbstractFloat = 40.0
@@ -6,7 +16,12 @@ besseljy_large_argument_min(::Type{T}) where T <: AbstractFloat = 40.0
616
besseljy_large_argument_cutoff(v, x::Float64) = (x > 1.65*v && x > besseljy_large_argument_min(Float64))
717
besseljy_large_argument_cutoff(v, x::T) where T = (x > 4*v && x > besseljy_large_argument_min(T))
818

19+
"""
20+
besseljy_large_argument(nu, x::T)
921
22+
Asymptotic expansions for large arguments valid when x > 1.6*nu and x > 20.0.
23+
Returns both (besselj(nu, x), bessely(nu, x)).
24+
"""
1025
function besseljy_large_argument(v, x::T) where T
1126
# gives both (besselj, bessely) for x > 1.6*v
1227
α, αp = _α_αp_asymptotic(v, x)

0 commit comments

Comments
 (0)