scipy.special.hankel1#
- scipy.special.hankel1(v, z, out=None) = <ufunc 'hankel1'>#
Hankel function of the first kind
- Parameters:
- varray_like
Order (float).
- zarray_like
Argument (float or complex).
- outndarray, optional
Optional output array for the function values
- Returns:
- scalar or ndarray
Values of the Hankel function of the first kind.
See also
hankel1e
This function with leading exponential behavior stripped off.
Notes
A wrapper for the AMOS [1] routine zbesh, which carries out the computation using the relation,
\[H^{(1)}_v(z) = \frac{2}{\imath\pi} \exp(-\imath \pi v/2) K_v(z \exp(-\imath\pi/2))\]where \(K_v\) is the modified Bessel function of the second kind. For negative orders, the relation
\[H^{(1)}_{-v}(z) = H^{(1)}_v(z) \exp(\imath\pi v)\]is used.
References
[1]Donald E. Amos, “AMOS, A Portable Package for Bessel Functions of a Complex Argument and Nonnegative Order”, http://netlib.org/amos/
Examples
For the inhomogenous Helmholtz equation in \(\mathbb{R}^2\) subject to radiation boundary conditions, the Green’s function is given by
\[G(\mathbf{x}, \mathbf{x}^\prime) = \frac{1}{4i} H^{(1)}_0(k|\mathbf{x} - \mathbf{x^\prime}|)\]where \(k\) is the wavenumber and \(H^{(1)}_0\) is the Hankel function of the first kind and of order zero. In the following example, we will solve the Helmholtz equation with two Dirac sources.
>>> import numpy as np >>> import matplotlib.pyplot as plt >>> from scipy.special import hankel1 >>> k = 10 # Wavenumber >>> sources = [0.5, -0.5] # Location of two point sources >>> x, y = np.linspace(-3, 3, 300), np.linspace(-3, 3, 300) >>> Z = np.add.outer(1j*y, x) >>> U = np.zeros_like(Z) >>> for sz in sources: ... r = np.abs(Z - sz) ... U += (1j/4)*hankel1(0, k*r)
Finally, we will plot the real part of the solution.
>>> fig, ax = plt.subplots() >>> ax.pcolormesh(np.real(Z), np.imag(Z), np.real(U)) >>> plt.show()