fortran-bessels
Fast, accurate Bessel functions in pure modern Fortran
Loading...
Searching...
No Matches
Hankel Functions

The Hankel functions (Bessel functions of the third kind) are the complex combinations

\[ H^{(1)}_\nu(x) = J_\nu(x) + i\,Y_\nu(x), \qquad H^{(2)}_\nu(x) = J_\nu(x) - i\,Y_\nu(x), \]

which behave like outgoing and incoming cylindrical waves, \( H^{(1,2)}_\nu(x) \sim \sqrt{2/(\pi x)}\, \exp\!\left[\pm i\left(x - \nu\pi/2 - \pi/4\right)\right] \) as \( x \to \infty \). For real \( x \) and real \( \nu \) they are complex conjugates, \( H^{(2)}_\nu(x) = \overline{H^{(1)}_\nu(x)} \).

Function shape

Real and imaginary parts of the first-kind Hankel function

Domain and special values

Quantity Value
besselh(nu, k, x) \( H^{(k)}_\nu(x) \), returns complex(BK), with k ∈ {1, 2}
hankelh1(nu, x) \( H^{(1)}_\nu(x) \) = besselh(nu, 1, x)
hankelh2(nu, x) \( H^{(2)}_\nu(x) \) = besselh(nu, 2, x)
\( x \le 0 \) NaN + NaN·i (built on \( Y_\nu \), undefined there)

Usage

use bessels, only: besselh, hankelh1, hankelh2, bk
complex(BK) :: h
h = hankelh1(0.0_bk, 5.0_bk) ! H^(1)_0(5)
print *, h, hankelh2(0.0_bk, 5.0_bk) ! conjugate for real argument
print *, besselh(1.0_bk, 2, 5.0_bk) ! h^(2)_1(5)
Definition bessels.f90:17
elemental complex(bk) function, public hankelh1(nu, x)
Definition bessels.f90:360
elemental complex(bk) function, public besselh(nu, k, x)
Definition bessels.f90:313
elemental complex(bk) function, public hankelh2(nu, x)
Definition bessels.f90:366
Warning
besselh, hankelh1, and hankelh2 are validated for integer order \( \nu \) only. They are evaluated by composing \( J_\nu + iY_\nu \), so they inherit the non-integer- \( \nu \) bugs of Bessel Functions of the Second Kind: Y. Non-integer \( \nu \) will return incorrect values; see roadmap item 07.

Implementation

besselh composes the Bessel Functions of the First Kind: J and Bessel Functions of the Second Kind: Y kernels directly. The fast large- \( x \) hankel_debye path is currently bypassed pending the non-integer- \( \nu \) fix, so accuracy follows that of \( J_\nu \) and \( Y_\nu \) for integer orders.

See also
Bessel Functions of the First Kind: J
Bessel Functions of the Second Kind: Y
fortran-bessels