Bessel functions
Bessels.besselj
— Functionbesselj(ν::Real, x::Real)
besselj(ν::AbstractRange, x::Real)
Returns the Bessel function, $J_ν(x)$, of the first kind and order ν
.
Routine supports single and double precision (e.g., Float32
or Float64
) real arguments.
For ν
isa AbstractRange
, returns a vector of type float(x)
using recurrence to compute $J_ν(x)$ at many orders as long as the conditions ν[1] >= 0
and step(ν) == 1
are met. Consider the in-place version besselj!
to avoid allocation.
Examples
julia> besselj(2, 1.5)
0.2320876721442147
julia> besselj(3.2, 2.5)
0.17888479721039752
julia> besselj(1:3, 2.5)
3-element Vector{Float64}:
0.4970941024642743
0.44605905843961735
0.2166003910391135
External links: DLMF, Wikipedia
See also: besselj!
, besselj0(x)
, besselj1(x)
Bessels.besselj!
— FunctionBessels.besselj!(out::DenseVector{T}, ν::AbstractRange, x::T)
Computes the Bessel function, $j_ν(x)$, of the first kind at many orders ν
in-place using recurrence. The conditions ν[1] >= 0
and step(ν) == 1
must be met.
Examples
julia> nu = 1:3; x = 1.5; out = zeros(typeof(x), length(nu));
julia> Bessels.besselj!(out, nu, x)
3-element Vector{Float64}:
0.5579365079100995
0.2320876721442147
0.06096395114113963
See also: besselj(ν, x)
Bessels.besselj0
— Functionbesselj0(x::T) where T <: Union{Float32, Float64, ComplexF32, ComplexF64}
Bessel function of the first kind of order zero, $J_0(x)$.
See also: besselj1(x)
, besselj(nu,x)
)
Bessels.besselj1
— Functionbesselj1(x::T) where T <: Union{Float32, Float64, ComplexF32, ComplexF64}
Bessel function of the first kind of order one, $J_1(x)$.
See also: besselj0(x)
, besselj(nu,x)
)
Bessels.bessely
— Functionbessely(ν::Real, x::Real)
bessely(ν::AbstractRange, x::Real)
Returns the Bessel function, $Y_ν(x)$, of the second kind and order ν
.
Routine supports single and double precision (e.g., Float32
or Float64
) real arguments.
For ν
isa AbstractRange
, returns a vector of type float(x)
using recurrence to compute $Y_ν(x)$ at many orders as long as the conditions ν[1] >= 0
and step(ν) == 1
are met. Consider the in-place version besselj!
to avoid allocation.
Examples
julia> bessely(2, 1.5)
-0.9321937597629739
julia> bessely(3.2, 2.5)
-0.8425784476035085
julia> bessely(1:3, 2.5)
3-element Vector{Float64}:
0.1459181379667858
-0.38133584924180347
-0.7560554967536713
External links: DLMF, Wikipedia
See also: bessely!
, bessely0(x)
, bessely1(x)
Bessels.bessely!
— FunctionBessels.bessely!(out::DenseVector{T}, ν::AbstractRange, x::T)
Computes the Bessel function, $Y_ν(x)$, of the second kind at many orders ν
in-place using recurrence. The conditions ν[1] >= 0
and step(ν) == 1
must be met.
Examples
julia> nu = 1:3; x = 1.5; out = zeros(typeof(x), length(nu));
julia> Bessels.bessely!(out, nu, x)
3-element Vector{Float64}:
-0.41230862697391135
-0.9321937597629739
-2.0735413990606855
See also: bessely(ν, x)
Bessels.bessely0
— Functionbessely0(x::T) where T <: Union{Float32, Float64}
Bessel function of the second kind of order zero, $Y_0(x)$.
See also: bessely1(x)
, bessely(nu,x)
)
Bessels.bessely1
— Functionbessely1(x::T) where T <: Union{Float32, Float64}
Bessel function of the second kind of order one, $Y_1(x)$.
See also: bessely0(x)
, bessely(nu,x)
)
Bessels.besseljy
— FunctionBessels.besseljy(ν, x::T) where T <: Float64
Returns the Bessel function of the first $J_{ν}(x)$ and second $Y_{ν}(x)$ kind for order ν.
This method may be faster than calling besselj(ν, x)
and bessely(ν, x)
separately depending on argument range. Results may be slightly different than calling individual functions in some domains due to using different algorithms.
Examples
julia> jn, yn = Bessels.besseljy(1.8, 1.2)
(0.2086667754797278, -1.0931173556626879)
See also: besselh
, besselj(nu,x)
), bessely(nu,x)
)
Modified Bessel functions
Bessels.besseli
— Functionbesseli(ν::Real, x::Real)
besseli(ν::AbstractRange, x::Real)
Returns the modified Bessel function, $I_ν(x)$, of the first kind and order ν
.
Routine supports single and double precision (e.g., Float32
or Float64
) real arguments.
For ν
isa AbstractRange
, returns a vector of type float(x)
using recurrence to compute $I_ν(x)$ at many orders as long as the conditions ν[1] >= 0
and step(ν) == 1
are met. Consider the in-place version besseli!
to avoid allocation.
Examples
julia> besseli(2, 1.5)
0.3378346183356807
julia> besseli(3.2, 2.5)
0.3772632469352918
julia> besseli(1:3, 2.5)
3-element Vector{Float64}:
2.5167162452886984
1.2764661478191641
0.47437040877803555
External links: DLMF, Wikipedia
See also: besseli!
, besseli0(x)
, besseli1(x)
, besselix(nu,x)
)
Bessels.besseli!
— FunctionBessels.besseli!(out::DenseVector{T}, ν::AbstractRange, x::T)
Computes the modified Bessel function, $I_ν(x)$, of the first kind at many orders ν
in-place using recurrence. The conditions ν[1] >= 0
and step(ν) == 1
must be met.
Examples
julia> nu = 1:3; x = 1.5; out = zeros(typeof(x), length(nu));
julia> Bessels.besseli!(out, nu, x)
3-element Vector{Float64}:
0.9816664285779074
0.3378346183356807
0.0807741130160923
See also: besseli(ν, x)
Bessels.besseli0
— Functionbesseli0(x::T) where T <: Union{Float32, Float64, ComplexF32, ComplexF64}
Modified Bessel function of the first kind of order zero, $I_0(x)$.
See also: besseli0x(x)
, besseli1(x)
, besseli(nu,x)
)
Bessels.besseli0x
— Functionbesseli0x(x::T) where T <: Union{Float32, Float64}
Scaled modified Bessel function of the first kind of order zero, $I_0(x)*e^{-x}$.
See also: besseli0(x)
, besseli1x(x)
, besseli(nu,x)
)
Bessels.besseli1
— Functionbesseli1(x::T) where T <: Union{Float32, Float64, ComplexF32, ComplexF64}
Modified Bessel function of the first kind of order one, $I_1(x)$.
See also: besseli0(x)
, besseli1x(x)
, besseli(nu,x)
)
Bessels.besseli1x
— Functionbesseli1x(x::T) where T <: Union{Float32, Float64}
Scaled modified Bessel function of the first kind of order one, $I_1(x)*e^{-x}$.
See also: besseli1(x)
, besseli(nu,x)
)
Bessels.besselix
— Functionbesselix(nu, x::T) where T <: Union{Float32, Float64}
Scaled modified Bessel function of the first kind of order nu, $I_{nu}(x)*e^{-x}$. Nu must be real.
Bessels.besselk
— Functionbesselk(ν::Real, x::Real)
besselk(ν::AbstractRange, x::Real)
Returns the modified Bessel function, $K_ν(x)$, of the second kind and order ν
.
Routine supports single and double precision (e.g., Float32
or Float64
) real arguments.
For ν
isa AbstractRange
, returns a vector of type float(x)
using recurrence to compute $K_ν(x)$ at many orders as long as the conditions ν[1] >= 0
and step(ν) == 1
are met. Consider the in-place version besselk!
to avoid allocation.
Examples
julia> besselk(2, 1.5)
0.5836559632566508
julia> besselk(3.2, 2.5)
0.3244950563641161
julia> besselk(1:3, 2.5)
3-element Vector{Float64}:
0.07389081634774707
0.12146020627856384
0.26822714639344925
External links: DLMF, Wikipedia
See also: besselk!
, besselk0(x)
, besselk1(x)
, besselkx(nu,x)
)
Bessels.besselk!
— FunctionBessels.besselk!(out::DenseVector{T}, ν::AbstractRange, x::T)
Computes the modified Bessel function, $K_ν(x)$, of the second kind at many orders ν
in-place using recurrence. The conditions ν[1] >= 0
and step(ν) == 1
must be met.
Examples
julia> nu = 1:3; x = 1.5; out = zeros(typeof(x), length(nu));
julia> Bessels.besselk!(out, nu, x)
3-element Vector{Float64}:
0.2773878004568438
0.5836559632566508
1.8338037024745792
See also: besselk(ν, x)
Bessels.besselk0
— Functionbesselk0(x::T) where T <: Union{Float32, Float64}
Modified Bessel function of the second kind of order zero, $K_0(x)$.
See also: besselk0x(x)
, besselk1(x)
, besselk(nu,x)
)
Bessels.besselk0x
— Functionbesselk0x(x::T) where T <: Union{Float32, Float64}
Scaled modified Bessel function of the second kind of order zero, $K_0(x)*e^{x}$.
See also: besselk0(x)
, besselk1x(x)
, besselk(nu,x)
)
Bessels.besselk1
— Functionbesselk1(x::T) where T <: Union{Float32, Float64}
Modified Bessel function of the second kind of order one, $K_1(x)$.
See also: besselk0(x)
, besselk1x(x)
, besselk(nu,x)
)
Bessels.besselk1x
— Functionbesselk1x(x::T) where T <: Union{Float32, Float64}
Scaled modified Bessel function of the second kind of order one, $K_1(x)*e^{x}$.
See also: besselk1(x)
, besselk(nu,x)
)
Bessels.besselkx
— Functionbesselkx(x::T) where T <: Union{Float32, Float64}
Scaled modified Bessel function of the second kind of order nu, $K_{nu}(x)*e^{x}$.
Hankel functions
Bessels.besselh
— Functionbesselh(nu, [k=1,] x)
Returns the Bessel function of the third kind of order nu
(the Hankel function).
k
must be 1 or 2, selecting hankelh1
or hankelh2
, respectively.
Examples
julia> besselh(1.2, 1, 9.2)
0.2513215427211038 + 0.08073652619125624im
See also: Bessels.besseljy
, besselj(nu,x)
), bessely(nu,x)
)
Bessels.hankelh1
— Functionhankelh1(nu, x)
Bessel function of the third kind of order nu
, $H^{(1)}_\nu(x)$.
Bessels.hankelh2
— Functionhankelh2(nu, x)
Bessel function of the third kind of order nu
, $H^{(2)}_\nu(x)$.
Spherical Bessel functions
Bessels.sphericalbesselj
— Functionsphericalbesselj(ν, x)
Spherical bessel function of the first kind of order ν
, $j_ν(x)$. This is the non-singular solution to the radial part of the Helmholz equation in spherical coordinates.
where $J_{\nu}$ is the Bessel function of the first kind. Routine supports single and double precision (e.g., Float32
, Float64
) for real arguments.
Examples
julia> sphericalbesselj(1, 1.2)
0.34528456985779027
julia> sphericalbesselj(1.5, 1.2)
0.18231344932382995
External links: DLMF, Wikipedia
See also: besselj
, sphericalbessely
Bessels.sphericalbessely
— Functionsphericalbessely(ν, x)
Spherical bessel function of the second kind of order ν
, $y_ν(x)$. This is the non-singular solution to the radial part of the Helmholz equation in spherical coordinates. Sometimes known as a spherical Neumann function.
where $Y_{\nu}$ is the Bessel function of the second kind. Routine supports single and double precision (e.g., Float32
, Float64
) for real arguments.
Examples
julia> sphericalbessely(1, 1.2)
-1.028336567803712
julia> sphericalbessely(1.5, 1.2)
-1.4453716277410136
External links: DLMF, Wikipedia
See also: bessely
, sphericalbesselj
Bessels.sphericalbesseli
— FunctionBessels.sphericalbesseli(ν, x)
Returns the modified spherical bessel function of the first kind of order ν
, $i_ν(x)$.
where $I_{\nu}$ is the modified Bessel function of the first kind. Routine supports single and double precision (e.g., Float32
, Float64
) for real arguments.
Examples
julia> Bessels.sphericalbesseli(1, 1.2)
0.4606425870674146
julia> Bessels.sphericalbesseli(1.5, 1.2)
0.23179256391926525
External links: DLMF, Wikipedia
See also: besseli
, Bessels.sphericalbesselk
Bessels.sphericalbesselk
— FunctionBessels.sphericalbesselk(ν, x)
Returns the modified spherical bessel function of the second kind of order ν
, $k_ν(x)$.
where $K_{\nu}$ is the modified Bessel function of the second kind. Routine supports single and double precision (e.g., Float32
, Float64
) for real arguments.
Examples
julia> Bessels.sphericalbesselk(1, 1.2)
0.46015782375475334
julia> Bessels.sphericalbesselk(1.5, 1.2)
0.7595606983594666
External links: DLMF, Wikipedia
See also: besselk
, Bessels.sphericalbesseli
Airy functions
Bessels.airyai
— Functionairyai(z)
Returns the Airy function of the first kind, $\operatorname{Ai}(z)$, which is the solution to the Airy differential equation $f''(z) - z f(z) = 0$.
Routine supports single and double precision (e.g., Float32
, Float64
, ComplexF64
) for real and complex arguments.
Examples
julia> airyai(1.2)
0.10612576226331255
julia> airyai(1.2 + 1.4im)
-0.03254458873613304 - 0.14708163733976673im
External links: DLMF, Wikipedia
See also: airyaiprime
, airybi
Bessels.airyaiprime
— Functionairyaiprime(z)
Returns the derivative of the Airy function of the first kind, $\operatorname{Ai}'(z)$. Routine supports single and double precision (e.g., Float32
, Float64
, ComplexF64
) for real and complex arguments.
Examples
julia> airyaiprime(1.2)
-0.13278537855722622
julia> airyaiprime(1.2 + 1.4im)
-0.02884977394212135 + 0.21117856532576215im
Bessels.airybi
— Functionairybi(z)
Returns the Airy function of the second kind, $\operatorname{Bi}(z)$, which is the second solution to the Airy differential equation $f''(z) - z f(z) = 0$. Routine supports single and double precision (e.g., Float32
, Float64
, ComplexF64
) for real and complex arguments.
Examples
julia> airybi(1.2)
1.4211336756103483
julia> airybi(1.2 + 1.4im)
0.3150484065220768 + 0.7138432162853446im
External links: DLMF, Wikipedia
See also: airybiprime
, airyai
Bessels.airybiprime
— Functionairybiprime(z)
Returns the derivative of the Airy function of the second kind, $\operatorname{Bi}'(z)$. Routine supports single and double precision (e.g., Float32
, Float64
, ComplexF64
) for real and complex arguments.
Examples
julia> airybiprime(1.2)
1.221231398704895
julia> airybiprime(1.2 + 1.4im)
-0.5250248310153249 + 0.9612736841097036im
Gamma functions
Bessels.gamma
— Functiongamma(x::T) where T <: Union{Float16, Float32, Float64}
Returns the gamma function, $Γ(x)$, for real x
.