0
$\begingroup$

This is the problem I am solving. enter image description here

I have defined my wanted equation as it is shown on the picture. Finding the first 0 (root) is not difficult with using FindRoot function. The problem that i am facing is following:

What is the simplest way to find, for instance, first 10 Roots using FindRoot function?

$\endgroup$
3
  • $\begingroup$ Can you give the numerical values used for the Plot and FindRoot? Many thanks in advance! $\endgroup$
    – bmf
    Commented Apr 27, 2022 at 19:00
  • 5
    $\begingroup$ Please post copy & paste-able code (InputForm) rather than images. Code should include all data (e.g., numeric values of parameters) needed to reproduce the problem. $\endgroup$
    – Bob Hanlon
    Commented Apr 27, 2022 at 19:10
  • 1
    $\begingroup$ You can get a pretty good approximation of the zeros by replacing $J_0(x)\to\sqrt{\frac{2}{\pi x}}\cos(x-\pi/4)$ and $Y_0(x)\to\sqrt{\frac{2}{\pi x}}\sin(x-\pi/4)$ and solving the resulting trigonometric equation analytically. Then, if needed, you can use these approximate zeros as starting points for numerical root finding. $\endgroup$
    – Roman
    Commented Apr 27, 2022 at 19:57

1 Answer 1

4
$\begingroup$
Clear["Global`*"]

equation[s1_] = C1/D1 BesselJ[0, s1 c] + D1/D1 BesselY[0, s1 c];

c = 1/300; C1 = 1; D1 = 1;

With Solve or NSolve or Reduce, include a constraint on the range of s1. Since you are plotting on the interval {0, 15000}, use the constraint 0 <= s1 <= 15000

(roots = Solve[{equation[s1] == 0, 0 <= s1 <= 15000}, s1, Reals]) // N

(* Solve::incs: Warning: Solve was unable to prove that the solution set found is complete.

{{s1 -> 69.0992}, {s1 -> 953.787}, {s1 -> 1890.83}, {s1 -> 2831.38}, {s1 -> 
   3772.88}, {s1 -> 4714.77}, {s1 -> 5656.85}, {s1 -> 6599.05}, {s1 -> 
   7541.31}, {s1 -> 8483.63}, {s1 -> 9425.97}, {s1 -> 10368.3}, {s1 -> 
   11310.7}, {s1 -> 12253.1}, {s1 -> 13195.5}, {s1 -> 14138.}} *)

With exact input, the roots are exact

equation[s1] /. roots // FullSimplify

(* {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0} *)

Or numerically,

equation[s1] /. N[roots, 20]

(* {0.*10^-20, 0.*10^-19, 0.*10^-18, 0.*10^-21, 0.*10^-21, 0.*10^-21, 0.*10^-21, 
 0.*10^-20, 0.*10^-20, 0.*10^-20, 0.*10^-20, 0.*10^-20, 0.*10^-20, 0.*10^-20, 
 0.*10^-20, 0.*10^-20} *)

Graphically,

Plot[equation[s1], {s1, 0, 15000}, Frame -> True,
 Epilog -> {Red, AbsolutePointSize[4],
   Point[{s1, 0} /. roots]}]

enter image description here

$\endgroup$
2
  • $\begingroup$ Thank you very much, it works, it just takes some time to calculate. $\endgroup$
    – U.Grammy
    Commented Apr 27, 2022 at 22:14
  • $\begingroup$ Solve was used to show how to get exact solutions. If exact solutions aren't needed, NSolve is faster. However, to ensure that you get all of the roots with NSolve, you need to use arbitrary-precision by specifying a WorkingPrecision. For example, NSolve[{equation[s1] == 0, 0 <= s1 <= 15000}, s1, Reals, WorkingPrecision -> 20] $\endgroup$
    – Bob Hanlon
    Commented Apr 27, 2022 at 22:26

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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