torch.special.scaled_modified_bessel_k1
function scaled_modified_bessel_k1<S extends Shape>(input: Tensor<S, 'float32'>, _options?: SpecialUnaryOptions<S>): Tensor<S, 'float32'>Computes the exponentially scaled modified Bessel function of the second kind of order 1.
Returns exp(x) * K₁(x), the exponentially scaled order-1 variant complementary to scaled_modified_bessel_k0. Like K₁(x), this exhibits dipole-like (first-order) angular behavior in cylindrical and spherical problems. The unscaled form K₁(x) decays exponentially as exp(-x), causing severe underflow for x > 50. The scaled variant maintains numerical stability across all positive arguments, essential for:
- Electromagnetic fields: dipole radiation from cylindrical sources at large distances (no underflow)
- Heat conduction: first-order multipole heat sources in unbounded cylinders
- Quantum mechanics: propagator computations with first-order angular momentum
- Signal processing: directional filter kernels and waveguides with exponential far-field decay
- Waveguide theory: mode coupling at large propagation distances
- Radiation problems: azimuthal components maintaining precision at far-field
Order 1 Behavior: Unlike K₀ which is even and symmetric, K₁ exhibits first-order dipole behavior: K₁(0) = ∞ (singularity like Y₁ and J₁), and the scaled form inherits this. Derivative relation K₀'(x) = -K₁(x) connects the two orders. Use this when the problem has first-order dependence.
- First-order: K₁ exhibits dipole behavior, use instead of K₀ for n=1 solutions
- Prevents underflow: Like scaled_k0, removes exponential decay exp(-x)
- Asymptotic: For large x, scaled_k1(x) → √(π/(2x)), same as K₀ scaled
- Derivative relation: d/dx[x*K₀(x)] = -x*K₁(x) (recurrence connection)
- Positive: exp(x)*K₁(x) 0 for all x 0 (K₁ always positive)
- Dipole symmetry: Arises in problems with first-order angular/radial dependence
- Input domain x 0: Undefined for x ≤ 0, singular at x=0
- Singularity: exp(x)*K₁(x) → ∞ as x→0⁺ (like unscaled K₁)
- Not the same as K₁: Returns scaled value exp(x)*K₁(x), not K₁ directly
- Different from K₀: Order 1 behavior (dipole) vs order 0 (monopole)
Parameters
inputTensor<S, 'float32'>- Input tensor with positive real values x 0. For x ≤ 0, results are undefined
_optionsSpecialUnaryOptions<S>optional
Returns
Tensor<S, 'float32'>– Tensor with scaled K₁(x) = exp(x)*K₁(x) values (bounded, dipole decay)Examples
// Numerical stability: scaled form prevents underflow
const x = torch.tensor([0.5, 2, 10, 50, 100]);
const k1_direct = torch.special.modified_bessel_k1(x);
// Result: [1.656, 0.139, ~0, 0, 0] - underflow for large x
const k1_scaled = torch.special.scaled_modified_bessel_k1(x);
// Result: [2.738, 1.039, 0.125, 0.089, 0.063] - bounded across all values// Asymptotic behavior: same power-law decay as K₀ scaled
const largeX = torch.linspace(10, 100, 100);
const scaledK1 = torch.special.scaled_modified_bessel_k1(largeX);
const scaledK0 = torch.special.scaled_modified_bessel_k0(largeX);
// For large x, both approach √(π/(2x)), K₁ = K₀ asymptotically// Dipole radiation field: electromagnetic dipole in cylindrical coordinates
const r = torch.linspace(0.1, 100, 200); // Radial distance from dipole
const k1_scaled = torch.special.scaled_modified_bessel_k1(r);
// Azimuthal field component: H_φ ~ K₁(r) * sin(φ)
// Maintains precision even at r=100 where unscaled K₁ underflows// Derivative relationship: K₀' = -K₁ (verified numerically)
const x = torch.linspace(0.1, 10, 100);
const k0 = torch.special.modified_bessel_k0(x);
const k1 = torch.special.modified_bessel_k1(x);
// Numerically: k0'(x) ≈ -k1(x) via finite differences// Waveguide coupling: far-field mode coupling strength
const frequencies = torch.linspace(1, 1000, 200);
const couplingStrength = torch.special.scaled_modified_bessel_k1(frequencies);
// Coupling decays as 1/√f asymptotically, maintained precisely by scaled form// Heat source with dipole moment: first-order multipole expansion
const distances = torch.tensor([0.5, 5, 50, 500]);
const dipole_field = torch.special.scaled_modified_bessel_k1(distances);
// Temperature perturbation ~ K₁(r) at far-field, stable even for r=500See Also
- PyTorch torch.special.scaled_modified_bessel_k1()
- torch.special.modified_bessel_k1 - Unscaled form (prone to underflow)
- torch.special.scaled_modified_bessel_k0 - Scaled K₀ (order 0 variant)
- torch.special.modified_bessel_i1 - First kind order 1 (exponentially growing)
- torch.special.modified_bessel_k0 - Standard K₀ (related by recurrence)