0

I have an equation and I want to solve it with FindRoot but is there any way to give a range to FindRoot instead of giving a point? this is my MMA code:

uvariable3 = 
u /. FindRoot[(1/(1/u^2 + 1/(v^2 - u^2)))*((
    BesselJ[m - 1, u] - BesselJ[m + 1, u])/(
    2*u*BesselJ[m, 
      u]) + (BesselK[m - 1, Sqrt[v^2 - u^2]] + 
       BesselK[m + 1, Sqrt[v^2 - u^2]])/(-2*Sqrt[v^2 - u^2]*
       BesselK[m, u]))*((BesselJ[m - 1, u] - BesselJ[m + 1, u])/(
    2*u*BesselJ[m, 
      u]) + ((n2/
       n1)^2*((BesselK[m - 1, Sqrt[v^2 - u^2]] + 
          BesselK[m + 1, Sqrt[v^2 - u^2]])/(-2*Sqrt[v^2 - u^2]*
          BesselK[m, u])))) - m^2/u^2 == 
   m^2*((n2/n1)^2*1/(v^2 - u^2)), {u, 1.5}]

and u is the only variable. I have the value for other variables.

sara
  • 1
  • 1

1 Answers1

1

From the documentation

FindRoot[lhs==rhs,{x, x_start,  x_min, x_max}] 

searches for a solution, stopping the search if x ever gets outside the range [x_min,x_max]

Have you tried this?

OldTomMorris
  • 607
  • 3
  • 10
  • I tried it but it gave me exactly the x_start as the root of my equation – sara Sep 10 '18 at 13:25
  • Are you sure your function has a root in the range provided? If not, you can try and implement a method to extend the range until a root is found or try a different algorithm. – OldTomMorris Sep 11 '18 at 09:28
  • yes I'm sure because I made the plot of f==g and there are some intersections – sara Sep 17 '18 at 07:39