torch.special.modified_bessel_k1
function modified_bessel_k1<S extends Shape>(input: Tensor<S, 'float32'>, _options?: SpecialUnaryOptions<S>): Tensor<S, 'float32'>Computes the modified Bessel function of the second kind of order 1, K₁(x).
K₁(x) is the order-1 solution to the modified Bessel equation, complementary to I₁(x). Like K₀, K₁ exponentially decays as x→∞, making it suitable for radiation and potential problems in unbounded domains. K₁ appears in applications where dipole-like behavior or first-order angular dependence is needed (e.g., azimuthal fields in cylindrical problems). K₁ vanishes at the origin like J₁, but with exponential decay instead of oscillation. Essential for:
- Electromagnetic fields: dipole radiation in cylindrical coordinates
- Heat conduction: first-order multipole solutions in unbounded cylinders
- Quantum mechanics: propagators in dimensional reduction scenarios
- Image processing: directional filtering and anisotropic diffusion
- Signal processing: specialized filter kernels with exponential fall-off
- Waveguide theory: waveguide excitation and coupling problems
Key Properties:
- K₁(0) = ∞ (similar singularity to Y₁)
- Exponentially decaying: K₁(x) ~ √(π/(2x)) exp(-x) for large x
- K₁(x) > 0 for all x > 0 (always positive, like K₀)
- Derivative connection: K₀'(x) = -K₁(x), similar to J and Y
- General modified Bessel solution: y = C₁I₁(x) + C₂K₁(x)
- Recurrence: Kₙ₋₁ - Kₙ₊₁ = (2n/x)Kₙ (similar structure to other Bessel)
- Order 1: Like K₀ but with first-order behavior (l=1 equivalent)
- Exponential decay: K₁(x) ~ exp(-x)/√x for large x
- Positive function: K₁(x) 0 for all x 0
- Zero at origin: K₁(0) = ∞ (unbounded like Y₁)
- Derivative: K₀'(x) = -K₁(x) (fundamental recurrence)
- Recurrence: Kₙ₋₁ - Kₙ₊₁ = (2n/x)Kₙ (differs slightly from J/Y)
- Wronskian: I₁K₁' - I₁'K₁ = -1/x (fundamental relation)
- Domain x 0 only: Undefined for x ≤ 0, singular at x=0
- Singularity at origin: K₁(0) = ∞
- Numerical underflow: For large x, K₁(x) underflows rapidly
- Large x: Use scaled_modified_bessel_k1 for numerical stability
Parameters
inputTensor<S, 'float32'>- Input tensor with positive real values x 0 (undefined at x=0)
_optionsSpecialUnaryOptions<S>optional
Returns
Tensor<S, 'float32'>– Tensor with K₁(x) values (exponentially decaying from ∞)Examples
// Exponential decay with K₁ behavior: vanishes at origin like J₁
const x = torch.tensor([0.1, 0.5, 1, 2, 5]);
const k1 = torch.special.modified_bessel_k1(x); // [10.894, 1.656, 0.601, 0.139, 0.0041]
// K₁(0.1)→very large, K₁(5)→nearly zero// Dipole radiation field from cylindrical source
const theta = torch.linspace(0, 2 * Math.PI, 100); // Angular position
const r = torch.linspace(0.1, 10, 100); // Radial distance
const k1_r = torch.special.modified_bessel_k1(r);
// Dipole field ~ K₁(r) * cos(θ) in azimuthal components// Derivative relationship: K₁ and K₀
const x = torch.linspace(0.1, 5, 100);
const k0 = torch.special.modified_bessel_k0(x);
const k1 = torch.special.modified_bessel_k1(x);
// Verify: K₀'(x) = -K₁(x) (recurrence relation)// General modified Bessel solution: linear combination of I₁ and K₁
const x_vals = torch.linspace(0.1, 8, 100);
const i1_vals = torch.special.modified_bessel_i1(x_vals);
const k1_vals = torch.special.modified_bessel_k1(x_vals);
// Solution: y = C₁*I₁ + C₂*K₁ for general problem
// Boundary conditions determine C₁, C₂See Also
- PyTorch torch.special.modified_bessel_k1()
- torch.special.modified_bessel_i1 - First kind order 1 (exponentially growing)
- torch.special.modified_bessel_k0 - Order 0 (related by recurrence)
- torch.special.scaled_modified_bessel_k1 - Scaled K₁ for stability
- torch.special.bessel_y1 - Regular second kind (oscillates vs decays)