Problem in solving an equation with bessel functions

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]]
• Please, always post copyable code. Try NSolve and FindRoot for numerical solutions. – Henrik Schumacher Apr 16 '18 at 19:20
• Multiplication is signified by either * or a space not x. – Bob Hanlon Apr 16 '18 at 19:37
• @HenrikSchumacher I thought maybe the colors of characters would matter. I'll add code too. – Alireza Apr 16 '18 at 19:43
• @BobHanlon Tried it. Still no change. – Alireza Apr 16 '18 at 19:46

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,
Point[{ω, expr[ω]} /. sol]}] EDIT: expr is an even function of ω

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

(* True *)
• Beaten just for seconds :)) (+1) ... – José Antonio Díaz Navas Apr 16 '18 at 20:05
• 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? – Alireza Apr 16 '18 at 20:25
• Maybe your function is complex in some range. Try to find the roots of Abs[expr[\[omega]_]] – José Antonio Díaz Navas Apr 16 '18 at 20:31
• 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 . – Akku14 Apr 16 '18 at 20:33
• @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. – Michael E2 Apr 16 '18 at 22:51

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

Firstly, we can see that your function has many roots: 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}}