fn

bessel_j0

Tensor
bessel_j0(x: Tensor)
source

Bessel function of the first kind, order 0.

Computes J0(x)J_0(x), the regular-at-origin solution of Bessel's equation x2y+xy+x2y=0x^2 y'' + x y' + x^2 y = 0 for order 0. Appears throughout wave propagation, optical diffraction (the Airy disk profile), and vibration of circular membranes.

Parameters

xTensor
Input tensor; any floating-point dtype.

Returns

Tensor

J0(x)J_0(x) element-wise, same shape and dtype as x.

Notes

Series representation:

J0(x)=k=0(1)k(k!)2(x2)2k.J_0(x) = \sum_{k=0}^\infty \frac{(-1)^k}{(k!)^2} \left(\frac{x}{2}\right)^{2k}.

The implementation uses the Abramowitz & Stegun §9.4 two-branch polynomial fit: a power series in (x/3)2(x/3)^2 for x3|x| \le 3 and an asymptotic 2/(πx)cos(xπ/4)f(3/x)\sqrt{2/(\pi x)} \cos(x - \pi/4) \cdot f(3/|x|) form for x>3|x| > 3. Accuracy is 107\approx 10^{-7} on the real line. J_0 is even, J0(0)=1J_0(0) = 1, and the function decays as 2/(πx)\sqrt{2/(\pi x)} for large x.

Examples

>>> import lucid
>>> from lucid.special import bessel_j0
>>> bessel_j0(lucid.tensor([0.0, 1.0, 2.4048, 5.0]))
Tensor([1.0000, 0.7652, 0.0000, -0.1776])