BESSEL_YN_ZEROS
This function computes the first nt positive roots of Y_n(x) for integer order n. The roots are returned in ascending order.
These roots satisfy:
Y_n(x_k) = 0, \quad x_k > 0, \quad k=1,2,\dots,nt
The result is returned as a single-row 2D array for Excel range compatibility.
Excel Usage
=BESSEL_YN_ZEROS(n, nt)
n(int, required): Nonnegative integer order of the Bessel function (dimensionless).nt(int, required): Number of positive roots to return (count).
Returns (list[list]): Single-row array containing the first nt positive roots of Y_n.
Example 1: First four roots for order zero
Inputs:
| n | nt |
|---|---|
| 0 | 4 |
Excel formula:
=BESSEL_YN_ZEROS(0, 4)
Expected output:
| Result | |||
|---|---|---|---|
| 0.893577 | 3.95768 | 7.08605 | 10.2223 |
Example 2: First three roots for order one
Inputs:
| n | nt |
|---|---|
| 1 | 3 |
Excel formula:
=BESSEL_YN_ZEROS(1, 3)
Expected output:
| Result | ||
|---|---|---|
| 2.19714 | 5.42968 | 8.59601 |
Example 3: First five roots for order two
Inputs:
| n | nt |
|---|---|
| 2 | 5 |
Excel formula:
=BESSEL_YN_ZEROS(2, 5)
Expected output:
| Result | ||||
|---|---|---|---|---|
| 3.38424 | 6.79381 | 10.0235 | 13.21 | 16.379 |
Example 4: First two roots for order four
Inputs:
| n | nt |
|---|---|
| 4 | 2 |
Excel formula:
=BESSEL_YN_ZEROS(4, 2)
Expected output:
| Result | |
|---|---|
| 5.64515 | 9.36162 |
Python Code
from scipy.special import yn_zeros as scipy_yn_zeros
def bessel_yn_zeros(n, nt):
"""
Compute the first positive zeros of the integer-order Bessel function of the second kind.
See: https://docs.scipy.org/doc/scipy/reference/generated/scipy.special.yn_zeros.html
This example function is provided as-is without any representation of accuracy.
Args:
n (int): Nonnegative integer order of the Bessel function (dimensionless).
nt (int): Number of positive roots to return (count).
Returns:
list[list]: Single-row array containing the first nt positive roots of Y_n.
"""
try:
n = int(n)
nt = int(nt)
if n < 0:
return "Error: n must be greater than or equal to 0"
if nt <= 0:
return "Error: nt must be greater than 0"
roots = scipy_yn_zeros(n, nt)
return [[float(x) for x in roots.tolist()]]
except Exception as e:
return f"Error: {str(e)}"Online Calculator
Nonnegative integer order of the Bessel function (dimensionless).
Number of positive roots to return (count).