0
$\begingroup$

I'm trying to solve an equation of the following form but I can't find what I'm doing wrong.

I also tried NSolve instead of Solve but no results again.

L = 26;
h = 0.01;
\[Rho] = 0.1;
x[f_] = h Sqrt[f^2 - L^2*\[Pi]^2];
y[f_] = h Sqrt[Abs[L^2 *\[Pi]^2 - \[Rho]*f^2]];
NSolve[-1/x[\[Omega]]*BesselJ[1, x[\[Omega]]]/
    BesselJ[0, x[\[Omega]]] - 
   1/y[\[Omega]]*BesselK[1, y[\[Omega]]]/BesselK[0, y[\[Omega]]] == 
  0, \[Omega]]
$\endgroup$
  • 1
    $\begingroup$ Please, always post copyable code. Try NSolve and FindRoot for numerical solutions. $\endgroup$ – Henrik Schumacher Apr 16 '18 at 19:20
  • 2
    $\begingroup$ Multiplication is signified by either * or a space not x. $\endgroup$ – Bob Hanlon Apr 16 '18 at 19:37
  • $\begingroup$ @HenrikSchumacher I thought maybe the colors of characters would matter. I'll add code too. $\endgroup$ – Alireza Apr 16 '18 at 19:43
  • $\begingroup$ @BobHanlon Tried it. Still no change. $\endgroup$ – Alireza Apr 16 '18 at 19:46
4
$\begingroup$
L = 26;
h = 1/100;
ρ = 1/10;
x[f_] = h Sqrt[f^2 - L^2*π^2];

EDIT: Thanks to comment by Akku14, changed definition of y[f] to make the use of NSolve more robust

(* y[f_]=h Sqrt[Abs[L^2*π^2-ρ*f^2]]; *)

y[f_] = h ((L^2*π^2 - ρ*f^2)^2)^(1/4);


expr[ω_] = -1/x[ω]*
    BesselJ[1, x[ω]]/BesselJ[0, x[ω]] - 
   1/y[ω]*BesselK[1, y[ω]]/BesselK[0, y[ω]];

Specify a range of interest

sol = NSolve[{expr[ω] == 0, -1000 < ω < 1000}, ω, Reals]

(* {{ω -> -894.145}, {ω -> -579.459}, {ω -> -255.326}, {ω -> 255.326}, 
    {ω -> 579.459}, {ω -> 894.145}} *)

Plot[expr[ω], {ω, -1000, 1000}, 
 Epilog -> {Red, AbsolutePointSize[4], 
   Point[{ω, expr[ω]} /. sol]}]

enter image description here

EDIT: expr is an even function of ω

expr[-ω] == expr[ω] // ComplexExpand

(* True *)
$\endgroup$
  • $\begingroup$ Beaten just for seconds :)) (+1) ... $\endgroup$ – José Antonio Díaz Navas Apr 16 '18 at 20:05
  • $\begingroup$ Works great. But when I set L=92 the output line is the same as the NSolve and no roots are displayed. But the plot has roots. Why? $\endgroup$ – Alireza Apr 16 '18 at 20:25
  • 1
    $\begingroup$ Maybe your function is complex in some range. Try to find the roots of Abs[expr[\[omega]_]] $\endgroup$ – José Antonio Díaz Navas Apr 16 '18 at 20:31
  • 2
    $\begingroup$ Use y[f_] = h Sqrt[Sqrt[(L^2*\[Pi]^2 - \[Rho]*f^2)^2]]; and it workes very well. The Abs makes problems to NSolve . $\endgroup$ – Akku14 Apr 16 '18 at 20:33
  • $\begingroup$ @Akku14 The thing to keep in mind is that there are powerful techniques for finding roots of analytic functions over bounded domain. Abs[z] is not analytic. $\endgroup$ – Michael E2 Apr 16 '18 at 22:51
2
$\begingroup$

You can use FindInstance and bound the range for $\omega$.

Firstly, we can see that your function has many roots:

enter image description here

So within the range plotted:

N@FindInstance[Numerator@
 Together[-1/x[\[Omega]]*
    BesselJ[1, x[\[Omega]]]/BesselJ[0, x[\[Omega]]] - 
   1/y[\[Omega]]*
    BesselK[1, y[\[Omega]]]/BesselK[0, y[\[Omega]]]] == 0 && 
0 <= \[Omega] <= 1000, \[Omega], 5]

we got the warning:

FindInstance was unable to prove that the solution set found is complete.

However, the zeros are given within plot range accordingly:

{{\[Omega] -> 255.326}, {\[Omega] -> 579.459}, {\[Omega] -> 894.145}}
$\endgroup$

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.