0% found this document useful (0 votes)
221 views5 pages

Bessel Function Zeroes

This document describes code written to find the nth zero of the derivative of the Bessel function Jm. It begins by defining a function to graph Jm and its derivative J'm. Special cases are then examined, such as m=2, 5, and small values of m, to determine the appropriate initial guesses for the root-finding algorithm. The algorithm uses FindRoot with bracketing values to locate zeros. Some modifications are needed for n=1 and small m. Test cases demonstrate the code works for a range of m and n values.

Uploaded by

putin208
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
221 views5 pages

Bessel Function Zeroes

This document describes code written to find the nth zero of the derivative of the Bessel function Jm. It begins by defining a function to graph Jm and its derivative J'm. Special cases are then examined, such as m=2, 5, and small values of m, to determine the appropriate initial guesses for the root-finding algorithm. The algorithm uses FindRoot with bracketing values to locate zeros. Some modifications are needed for n=1 and small m. Test cases demonstrate the code works for a range of m and n values.

Uploaded by

putin208
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 5

ME201/MTH281/ME400/CHE400

Zeros of Bessel Function Derivatives


We write code here to find the nth zero of the derivative of the Bessel function Jm . Here n is a positive integer,
and m is any non-negative real number. The basis of the code will be the Mathematica routines FindRoot and
BesselJZero. BesselJZero[m,n] returns the nth positive zero of Jm . Before writing the code, we look at various special
cases to collect ideas about the implementation of the general case. We start by defining a function which will graph
both J and J' for any m.
In[42]:=

bessgraph@m_D := Module@8f, g, z<, f@z_D = BesselJ@m, zD; g@z_D = D@f@zD, zD;


Print@Plot@8f@zD, g@zD<, 8z, 0, 10<, AxesLabel 8"z", "J, J'"<,
PlotStyle 8Dashed, Thick<, PlotLabel Row@8"Jm HdashedL and J'm HsolidL
for m = ", m<DDDD

We set the image size for plots to 250.


In[43]:=

SetOptions@Plot, ImageSize 250D;

We try this for J2 .


In[44]:=

bessgraph@2D
Jm HdashedL and J'm HsolidL
for m = 2
J, J'
0.4

0.2

10

-0.2

Our first calculation will be to find the second zero of J '2 . From the graph, we see that each zero of the derivative is
bracketed by two zeros of the function. We will use those values as initial guesses in FindRoot. More specifically, the
second zero of the derivative is bracketed by the first and second positive zeros of the function. Let's get those values
which we will call "left" and "right."
In[45]:=
Out[45]=
In[46]:=
Out[46]=

left = N@BesselJZero@2, 1DD


5.13562
right = N@BesselJZero@2, 2DD
8.41724

Those values are consistent with what we see from the crossings of the dashed line in the graph. We now use those
numbers as initial guesses in a FindRoot search for the second zero of J '2 . Because we are using two initial guesses,
FindRoot will use the secant method. (It uses Newton's method for one initial guess.)
In[47]:=
Out[47]=

ans = FindRoot@D@BesselJ@2, zD, zD 0, 8z, left, right<D


8z 6.70613<

This looks consistent with the graph. We check our result.

derbesszer.nb

In[48]:=

Out[48]=

D@BesselJ@2, zD, zD . ans


5.27356 10-16

Close enough to zero.


For most values of m and n the algorithm we have used for this particular case works well. However the
special case n = 1 (first root) sometimes requires some modifications in the initial guesses. Let's look at a plot for m =
5.
In[49]:=

bessgraph@5D
Jm HdashedL and J'm HsolidL
for m = 5
J, J'
0.3
0.2
0.1
2

10

-0.1
-0.2

According to our basic algorithm, the left and right guesses are
In[50]:=
Out[50]=
In[51]:=
Out[51]=
In[52]:=
Out[52]=

left = 0.0
0.
right = N@BesselJZero@5, 1DD
8.77148
ans = FindRoot@D@BesselJ@5, zD, zD 0, 8z, left, right<D
8z 0.<

Unfortunately our routine has converged to the unwanted zero at z = 0. The problem is that the function J5 has a 5th
order zero at z = 0. We can see that in the extreme flatness of the curve near the origin. We need to avoid this region
in our numerical work, so we choose a left endpoint further to the right. A generic choice which works is
In[53]:=
Out[53]=

left = 0.5 * right


4.38574

It is clear from the picture that the zero of J5 ' is between left and right. We try this choice.
In[54]:=
Out[54]=

ans = FindRoot@D@BesselJ@5, zD, zD 0, 8z, left, right<D


8z 6.41562<

Now we have the zero we want. Thus for n = 1, we will modify our routine to use these values of left and right.
Other problems occur if m is small. Let's try to find the first zero for m = 0.1.
In[55]:=
Out[55]=
In[56]:=
Out[56]=
In[57]:=

Out[57]=

right = [email protected], 1D
2.55745
left = 0.5 * right
1.27873
ans = FindRoot@D@[email protected], zD, zD 0, 8z, left, right<D
9z - 7.1731 + 4.00336 10-9 =

We see two problems here. First we have picked up a numerical artifact -- a small complex part. This is easily fixed
by including a Re command in our final code. The more serious problem is that we have found a root that we don't
want. Let's graph the function to see what is going on.

derbesszer.nb

We see two problems here. First we have picked up a numerical artifact -- a small complex part. This is easily fixed
by including a Re command in our final code. The more serious problem is that we have found a root that we don't
want. Let's graph the function to see what is going on.
In[58]:=

[email protected]
Jm HdashedL and J'm HsolidL
for m = 0.1
J, J'
1.0

0.5

10

-0.5

We see that there is a positive zero of the derivative very near the origin. In this case, the zero was not included
between left and right, and the root-finding routine wandered off. For small z, we may approximate Jm HzL by the first
two terms in the series expansion:
In[59]:=

Out[59]=

Series@BesselJ@m, zD, 8z, 0, 2<D


zm

2-m
Gamma@1 + mD

2-2-m z2
H1 + mL Gamma@1 + mD

+ O@zD3

We convert this to a normal expression without the error estimate:


In[60]:=

Out[60]=

approx = Normal@%D
zm

2-m
Gamma@1 + mD

2-2-m z2
H1 + mL Gamma@1 + mD

We use this approximation to find the location of the first zero of the derivative. First we clean it up a bit. We may
multiply or divide by any non-zero constant without changing the location of the zero of the derivative.
In[61]:=
Out[61]=
In[62]:=

Out[62]=

approx1 = SimplifyAH1 + mL Gamma@1 + mD * 2H2+mL * approxE


zm I4 + 4 m - z2 M
Simplify@Solve@D@approx1, zD 0, zD, m > 0D

::z 2

m H1 + mL
2+m

>>

We see that for small m, the first zero of the derivative of Jm is approximately
bracket endpoint to the left of this, so we choose it to be
In[63]:=
Out[63]=
In[64]:=
Out[64]=
In[65]:=
Out[65]=

m . Let's see if that works.

right = [email protected], 1D
2.55745
left = [email protected]
0.316228
ans = FindRoot@D@[email protected], zD, zD 0, 8z, left, right<D
8z 0.46351<

Our approximate value was

2 m . We want to choose our left

derbesszer.nb

In[66]:=

Out[66]=

m H1 + mL

2+m

. m 0.1

0.457738

We have almost all of our special cases handled now. The last special case is m = 0. We see from the above
results that the first positive zero of J 'm goes to zero as m goes to zero. Thus the first zero of the derivative of J0
should be identified as 0. In this way all of the zeros will depend continuously on m. A second reason for including
this value is that in Fourier-Bessel expansions, there is a non-trivial mode associated with it (analogous to the constant
term in a Fourier cosine series).
Now we are ready to write our general routine based on FindRoot and BesselJZero. For values of n other than
1, we use the two bracketing zeros of Jm in our FindRoot calculation. For n = 1, we implement all of the special cases
we have just discussed. We take m = 0.5 as the boundary between regular and small values of m. We call our function
BesselJPrimeZero[m,n], and it returns the nth zero of the derivative of Jm .
In[67]:=

BesselJPrimeZero@m_, n_D := ModuleB8left, right, z<,


right = N@BesselJZero@m, nDD; WhichBHn > 1L, Hleft = N@BesselJZero@m, n - 1DD;
Re@z . Flatten@FindRoot@D@BesselJ@m, zD, zD 0, 8z, left, right<DDDL,
Hn == 1L, JIfBHm == 0L, H0.0L, JIfBHm < 0.5L, Jleft =

m N, Hleft = 0.5 * rightLF;

Re@z . Flatten@FindRoot@D@BesselJ@m, zD, zD 0, 8z, left, right<DDDNFNFF

We run some test cases.


In[68]:=

Table@BesselJPrimeZero@0, iD, 8i, 1, 5<D

Out[68]=

80., 3.83171, 7.01559, 10.1735, 13.3237<

In[69]:=

Table@BesselJPrimeZero@1, iD, 8i, 1, 5<D

Out[69]=
In[70]:=
Out[70]=
In[71]:=
Out[71]=
In[72]:=
Out[72]=

81.84118, 5.33144, 8.53632, 11.706, 14.8636<


Table@BesselJPrimeZero@2, iD, 8i, 1, 5<D
83.05424, 6.70613, 9.96947, 13.1704, 16.3475<
Table@BesselJPrimeZero@3, iD, 8i, 1, 5<D
84.20119, 8.01524, 11.3459, 14.5858, 17.7887<
Table@BesselJPrimeZero@4, iD, 8i, 1, 5<D
85.31755, 9.2824, 12.6819, 15.9641, 19.196<

These all agree with tabulated values (Handbook of Mathematical Functions, Abramowitz and Stegun, p. 411,
National Bureau of Standards, 3rd printing, 1965). We try this for a few non-integer values of order.
In[73]:=
Out[73]=

[email protected], 1D
1.16556

We can check this because J12 can be expressed in terms of elementary functions.
In[74]:=

BesselJ@1 2, xD
2
p

Sin@xD

Out[74]=

derbesszer.nb

In[75]:=

D@BesselJ@1 2, xD, xD
2
p

Cos@xD
-

Out[75]=

Sin@xD
2 p x32

So the zero is the root of tan(x) = 2 x.


In[76]:=
Out[76]=

FindRoot@Tan@xD 2 x, 8x, 1.16<D


8x 1.16556<

It checks. Now we try a smaller order.


In[77]:=
Out[77]=
In[78]:=
Out[78]=

[email protected], 1D
0.46351
D@[email protected], zD, zD . z %
0.

For small order, the first zero of the derivative is approximately equal to the square root of twice the order. We have
used this in constructing the left bracket in our root routine. Without this modification, FindRoot wanders off to
another root for n = 1 and small order. With the bracket chosen in this way, the routine works for very small order.
In[79]:=
Out[79]=
In[80]:=
Out[80]=
In[81]:=
Out[81]=
In[82]:=

Out[82]=

[email protected], 1D
0.14195
D@[email protected], zD, zD . z %
0.
[email protected], 1D
0.0447381
D@[email protected], zD, zD . z %
6.93889 10-18

You might also like