3
$\begingroup$

I am using Mathematica 9. I have done one mathematica code to find the roots of a transcendental equation. The code is given below:

A = BesselJ[1, x]/BesselJ[0, x];
A1 = A*x;
nclm = 1.4271;
ncom = 1.4446;
lamda = 1.55;
a1 = 52.5;
V1 = 2*Pi*a1/lamda;
V = V1*Sqrt[ncom^2 - nclm^2];
w = Sqrt[V^2 - x^2];
B = BesselK[1, w]/BesselK[0, w];
B1 = B*w;
Plot[{A1, B1}, {x, 0, 50}]
Reduce[A1 - B1 == 0 && 0 < x < 50]

After simulate this code, I am getting the all outputs, but the Reduce function is not showing all the roots, Reduce function shows 13 number of roots, but the equation has 15 number of roots as seen from the intersection points of the plot.

enter image description here

As the equation has two more roots after x = 39.0978, but these two roots are not showing.

Is there any way to show that roots?

$\endgroup$
6
$\begingroup$

Use exact numbers (see Rationalize)

A = BesselJ[1, x]/BesselJ[0, x];
A1 = A*x;
nclm = 1.4271 // Rationalize[#, 0] &;
ncom = 1.4446 // Rationalize[#, 0] &;
lamda = 1.55 // Rationalize[#, 0] &;
a1 = 52.5 // Rationalize[#, 0] &;
V1 = 2*Pi*a1/lamda;
V = V1*Sqrt[ncom^2 - nclm^2];
w = Sqrt[V^2 - x^2];
B = BesselK[1, w]/BesselK[0, w];
B1 = B*w;

roots = {Reduce[A1 - B1 == 0 && 0 < x < 50] // N // ToRules}

enter image description here

(*  {{x -> 2.35543}, {x -> 5.40651}, {x -> 8.47513}, {x -> 11.5471}, 
     {x -> 14.6195}, {x -> 17.6912}, {x -> 20.7614}, {x -> 23.8295}, 
     {x -> 26.8946}, {x -> 29.9557}, {x -> 33.0116}, {x -> 36.0601}, 
     {x -> 39.0978}, {x -> 42.1179}, {x -> 45.1024}}  *)

Length[roots]

(*  15  *)

Plot[{A1, B1}, {x, 0, 50},
 Epilog -> {Green, AbsolutePointSize[6],
   Point[{x, A1} /. roots]}]

enter image description here

$\endgroup$
3
$\begingroup$

It is enough to increase WorkingPrecision:

Reduce[A1 - B1 == 0 && 0 < x < 50, WorkingPrecision -> 30]
x == 2.35543 || x == 5.40651 || x == 8.47513 || x == 11.5471 ||  x == 14.6195 || x == 17.6912 || x == 20.7614 || x == 23.8295 ||  x == 26.8946 || x == 29.9557 || x == 33.0116 || x == 36.0601 ||  x == 39.0978 || x == 42.1179 || x == 45.1024
$\endgroup$
  • $\begingroup$ Decreasing it works, too: Reduce[A1 - B1 == 0 && 0 < x < 50, WorkingPrecision -> 1] gives the same output as the higher WorkingPrecision. $\endgroup$ – Michael E2 Oct 23 '16 at 20:11

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.