Module bessel

Module bessel 

Source
Expand description

Bessel functions and radial jets with analytic argument derivatives.

Cylindrical and spherical Bessel functions of every kind (bessel), regular and singular radial jets (spherical_radial, cylindrical_radial), and their broadcasting residual. They use AMOS (the complex_bessel crate), small-argument power series, and a qualified positive-real outgoing Hankel recurrence.

Upstream: treams.special.jv, yv, hankel1, hankel2, spherical_jn and spherical_yn (scipy’s functions), and jv_d, yv_d, hankel1_d, hankel2_d, spherical_hankel1, spherical_hankel2 and their _d derivatives (_bessel.pyx).

Structs§

BesselResidual
What bessel_array saves for its pullback: the orders, the arguments and the function. Only the arguments get gradients.
RadialJet
A radial function and its first two argument derivatives: a second-order jet in one complex variable, unlike the crate’s first-order jets numerics::Jet in several.

Enums§

Bessel
Cylindrical Bessel solution, also used at half order for spherical functions.
Radial
Radial kind of multipole waves: regular or singular.

Constants§

PARALLEL 🔒
Elementwise Bessel evaluations and pullbacks run in parallel from this many elements.
SERIES_TERMS 🔒
Terms of the small-argument power series of spherical_radial and cylindrical_radial. Below |z| = SERIES_RADIUS (0.5) each term is at most 1/(16 q^2) of its predecessor, so the last one is below 1e-40 of the first.

Functions§

amos_error 🔒
bessel
Bessel value or one of its first two complex-argument derivatives.
bessel_array
Evaluate elementwise Bessel functions, broadcasting either scalar input.
bessel_raw 🔒
One AMOS evaluation of a cylindrical function, or of a spherical one at order + 1/2.
checked 🔒
jet, or an overflow error where one of its parts is not finite. Near zero the prefactor sqrt(pi / 2z) and the derivatives’ powers of 1/z overflow where AMOS does not, as for h_0 below |z| = 1e-103.
cylindrical_radial
Integer-order cylindrical J (regular) or outgoing H1 (singular), with its first two derivatives.
even_series 🔒
The even power series sum_q t_q with t_0 = leading z^power and t_q = factor(q) z^2 t_(q-1), differentiated term by term: every term reuses its predecessor’s powers.
hankel_below 🔒
Outgoing cylindrical functions [H_(m-1)(z), H_m(z)] from one AMOS sequence, with H_-1 = -H_1: the derivative u^m H_(m-1)(u) of u^m H_m(u) without the cancelling product rule.
jet_from_next_order 🔒
Derivatives of a spherical function from the next order, f' = (l/z) f - f_(l+1), and the spherical Bessel equation.
pair 🔒
The two values of a two-term sequence.
radial_jet 🔒
A spherical or cylindrical radial function of integer order at a jet argument: without derivatives a single value-only Bessel evaluation, otherwise the value and first derivative from spherical_radial or cylindrical_radial.
sequence 🔒
Cylindrical functions of orders start, start + 1, ... from one AMOS recurrence.
spherical_hankels 🔒
Spherical Hankel functions h_p(z) of the first kind for p = first..=last at a nonzero argument. Real positive arguments use the elementary outgoing seed and upward recurrence (DLMF 10.49.6, 10.51.1). Unlike regular J, H contains the dominant irregular solution, so this direction is stable below the turning point too. The bounded domain keeps every intermediate finite and agrees with AMOS to the existing 1e-13 sequence tolerance; other arguments retain one AMOS sequence.
spherical_pair 🔒
Spherical functions of orders order and order + 1. Hankel functions share one AMOS sequence, which agrees with single evaluations to 2e-14 relative. J and Y sequences differ from single evaluations by up to 1e-12, so these stay single.
spherical_prefactor 🔒
sqrt(pi / 2z), which turns cylindrical functions of order l + 1/2 into spherical functions of order l.
spherical_radial
Evaluate a spherical radial function and its first two derivatives: j_l for regular and h1_l for singular waves.
spherical_radial_sequence 🔒
spherical_radial jets of every degree 0..=order at one argument. Regular jets share power-series terms or single AMOS J evaluations. Singular jets share one spherical_hankels sequence, using its positive-real recurrence where qualified and AMOS elsewhere. Against 30-digit values at |Im z| <= 5, the AMOS sequence stays within 2e-13 relative up to order 80 (two-term sequences: 8e-14); below Im z = 0 it loses up to a digit to two-term sequences, still within 1e-13 of each jet’s size up to order 40.