Skip to main content
introduced SameTest; added figure
Source Link
bbgodfrey
  • 63.1k
  • 18
  • 94
  • 169

It is enormously faster to use

x = f /. {M -> 2, λ -> 100} // Simplify; FindRoot[Im[x], {ω, 5}] 

Then, given the space of roots for Im[x]

DeleteCases[Union[Table[ω /. FindRoot[Im[x], {ω, i}], {i, 50}], SameTest -> (Abs[#1 - #2] < 10^-8 &)], z_ /; z < 0 || z > 50, Infinity] 

finds all positive roots less than 50, and a few more

(* {1.42102, 4.90807, 7.62768, 11.2423, 14.0252, 17.1884, 20.6867, 23.5686, 26.4905, 29.8494, 33.2229, 36.4292, 39.4662, 42.4597, 45.5127, 48.6259,} 61.2229*) 

These results are consistent with a Plot of x.

Plot[{Re[x], 252.896Im[x]}, *){ω, 0, 50}] 

enter image description here

It is enormously faster to use

x = f /. {M -> 2, λ -> 100} // Simplify; FindRoot[Im[x], {ω, 5}] 

Then, given the space of roots for Im[x]

DeleteCases[Union[Table[ω /. FindRoot[Im[x], {ω, i}], {i, 50}], SameTest -> (Abs[#1 - #2] < 10^-8 &)], z_ /; z < 0, Infinity] 

finds all positive roots less than 50, and a few more

(* {1.42102, 4.90807, 7.62768, 11.2423, 14.0252, 17.1884, 20.6867, 23.5686, 26.4905, 29.8494, 33.2229, 36.4292, 39.4662, 42.4597, 45.5127, 48.6259, 61.2229, 252.896} *) 

It is enormously faster to use

x = f /. {M -> 2, λ -> 100} // Simplify; FindRoot[Im[x], {ω, 5}] 

Then, given the space of roots for Im[x]

DeleteCases[Union[Table[ω /. FindRoot[Im[x], {ω, i}], {i, 50}], SameTest -> (Abs[#1 - #2] < 10^-8 &)], z_ /; z < 0 || z > 50, Infinity] 

finds all positive roots less than 50

(* {1.42102, 4.90807, 7.62768, 11.2423, 14.0252, 17.1884, 20.6867, 23.5686, 26.4905, 29.8494, 33.2229, 36.4292, 39.4662, 42.4597, 45.5127, 48.6259} *) 

These results are consistent with a Plot of x.

Plot[{Re[x], Im[x]}, {ω, 0, 50}] 

enter image description here

introduced SameTest
Source Link
bbgodfrey
  • 63.1k
  • 18
  • 94
  • 169

It is enormously faster to use

x = f /. {M -> 2, λ -> 100} // Simplify; FindRoot[Im[x], {ω, 5}] 

Then, given the space of roots for Im[x]

DeleteCases[Union[Table[N[Round[ωDeleteCases[Union[Table[ω /. FindRoot[Im[x], {ω, i}], 10^-8]], {i, 50}]]],   SameTest -> (Abs[#1 - #2] < 10^-8 &)], z_ /; z < 0, Infinity] 

finds all positive roots less than 50, and a few more

(* {1.42102, 4.90807, 7.62768, 11.2423, 14.0252, 17.1884, 20.6867, 23.5686, 26.4905, 29.8494, 33.2229, 36.4292, 39.4662, 42.4597, 45.5127, 48.6259, 61.2229, 252.896} *) 

It is enormously faster to use

x = f /. {M -> 2, λ -> 100} // Simplify; FindRoot[Im[x], {ω, 5}] 

Then, given the space of roots for Im[x]

DeleteCases[Union[Table[N[Round[ω /. FindRoot[Im[x], {ω, i}], 10^-8]], {i, 50}]], z_ /; z < 0, Infinity] 

finds all positive roots less than 50, and a few more

(* {1.42102, 4.90807, 7.62768, 11.2423, 14.0252, 17.1884, 20.6867, 23.5686, 26.4905, 29.8494, 33.2229, 36.4292, 39.4662, 42.4597, 45.5127, 48.6259, 61.2229, 252.896} *) 

It is enormously faster to use

x = f /. {M -> 2, λ -> 100} // Simplify; FindRoot[Im[x], {ω, 5}] 

Then, given the space of roots for Im[x]

DeleteCases[Union[Table[ω /. FindRoot[Im[x], {ω, i}], {i, 50}],   SameTest -> (Abs[#1 - #2] < 10^-8 &)], z_ /; z < 0, Infinity] 

finds all positive roots less than 50, and a few more

(* {1.42102, 4.90807, 7.62768, 11.2423, 14.0252, 17.1884, 20.6867, 23.5686, 26.4905, 29.8494, 33.2229, 36.4292, 39.4662, 42.4597, 45.5127, 48.6259, 61.2229, 252.896} *) 
Source Link
bbgodfrey
  • 63.1k
  • 18
  • 94
  • 169

It is enormously faster to use

x = f /. {M -> 2, λ -> 100} // Simplify; FindRoot[Im[x], {ω, 5}] 

Then, given the space of roots for Im[x]

DeleteCases[Union[Table[N[Round[ω /. FindRoot[Im[x], {ω, i}], 10^-8]], {i, 50}]], z_ /; z < 0, Infinity] 

finds all positive roots less than 50, and a few more

(* {1.42102, 4.90807, 7.62768, 11.2423, 14.0252, 17.1884, 20.6867, 23.5686, 26.4905, 29.8494, 33.2229, 36.4292, 39.4662, 42.4597, 45.5127, 48.6259, 61.2229, 252.896} *)