BESSEL_JN_ZEROS
This function computes the first nt positive roots of J_n(x) for integer order n. The roots are returned in ascending order and exclude the root at x=0 for n>0.
These roots satisfy:
J_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_JN_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 J_n.
Example 1: First four roots for order zero
Inputs:
| n | nt |
|---|---|
| 0 | 4 |
Excel formula:
=BESSEL_JN_ZEROS(0, 4)
Expected output:
| Result | |||
|---|---|---|---|
| 2.40483 | 5.52008 | 8.65373 | 11.7915 |
Example 2: First three roots for order one
Inputs:
| n | nt |
|---|---|
| 1 | 3 |
Excel formula:
=BESSEL_JN_ZEROS(1, 3)
Expected output:
| Result | ||
|---|---|---|
| 3.83171 | 7.01559 | 10.1735 |
Example 3: First five roots for order two
Inputs:
| n | nt |
|---|---|
| 2 | 5 |
Excel formula:
=BESSEL_JN_ZEROS(2, 5)
Expected output:
| Result | ||||
|---|---|---|---|---|
| 5.13562 | 8.41724 | 11.6198 | 14.796 | 17.9598 |
Example 4: First two roots for order four
Inputs:
| n | nt |
|---|---|
| 4 | 2 |
Excel formula:
=BESSEL_JN_ZEROS(4, 2)
Expected output:
| Result | |
|---|---|
| 7.58834 | 11.0647 |
Python Code
from scipy.special import jn_zeros as scipy_jn_zeros
def bessel_jn_zeros(n, nt):
"""
Compute the first positive zeros of the integer-order Bessel function of the first kind.
See: https://docs.scipy.org/doc/scipy/reference/generated/scipy.special.jn_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 J_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_jn_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).