Skip to main content
Bug info
Source Link
Michael E2
  • 244.7k
  • 18
  • 351
  • 774

Bug introduced in 11.0 or earlier and fixed in 14.0.0 or earlier

BesselJ[0,x] is a smooth quasiperiodic function. NSolve is able to find all roots in the given range 0<x<50:

erg = NSolve[{BesselJ[0, x], 0 < x < 50}, x, Reals]
Show[{Plot[BesselJ[0, x], {x, 0, 50}] , Graphics[Point[{x, 0} /. erg]]}]

enter image description here

But if I increase the range 0<x<100 NSolve misses many of the expected 32 roots.

erg = NSolve[{BesselJ[0, x], 0 < x < 100}, x, Reals]
Show[{Plot[BesselJ[0, x], {x, 0, 100}] ,Graphics[Point[{x, 0} /. erg]]}]

enter image description here

Any idea why NSolve fails? Is there some kind of critical argumentsize x in the definition of BesselJ[0,x]? Thanks!

BesselJ[0,x] is a smooth quasiperiodic function. NSolve is able to find all roots in the given range 0<x<50:

erg = NSolve[{BesselJ[0, x], 0 < x < 50}, x, Reals]
Show[{Plot[BesselJ[0, x], {x, 0, 50}] , Graphics[Point[{x, 0} /. erg]]}]

enter image description here

But if I increase the range 0<x<100 NSolve misses many of the expected 32 roots.

erg = NSolve[{BesselJ[0, x], 0 < x < 100}, x, Reals]
Show[{Plot[BesselJ[0, x], {x, 0, 100}] ,Graphics[Point[{x, 0} /. erg]]}]

enter image description here

Any idea why NSolve fails? Is there some kind of critical argumentsize x in the definition of BesselJ[0,x]? Thanks!

Bug introduced in 11.0 or earlier and fixed in 14.0.0 or earlier

BesselJ[0,x] is a smooth quasiperiodic function. NSolve is able to find all roots in the given range 0<x<50:

erg = NSolve[{BesselJ[0, x], 0 < x < 50}, x, Reals]
Show[{Plot[BesselJ[0, x], {x, 0, 50}] , Graphics[Point[{x, 0} /. erg]]}]

enter image description here

But if I increase the range 0<x<100 NSolve misses many of the expected 32 roots.

erg = NSolve[{BesselJ[0, x], 0 < x < 100}, x, Reals]
Show[{Plot[BesselJ[0, x], {x, 0, 100}] ,Graphics[Point[{x, 0} /. erg]]}]

enter image description here

Any idea why NSolve fails? Is there some kind of critical argumentsize x in the definition of BesselJ[0,x]? Thanks!

edited tags
Link
Goofy
  • 3.7k
  • 11
  • 17
Tweeted twitter.com/StackMma/status/1078712339371827200
deleted 246 characters in body; edited tags
Source Link
Ulrich Neumann
  • 56.8k
  • 2
  • 26
  • 60

Plotting BesselJ[0,x] is a smooth quasiperiodic function. NSolve is able to find all roots in the given range 0<x<50:

Plot[BesselJ[0,erg x],= NSolve[{x, 54BesselJ[0, 63}x],GridLines -> {BesselJZero[0,0 {< 18,x 19,< 2050}] // N , None}]

enter image description here

shows three roots, calculated by BesselJZero

Confirmation of the roots could be realized using FindRoot or NSolve.

FindRoot works well

FindRoot[BesselJ[0, x], {x, 55}](*{x\[Rule]55.7655}*)Reals]
FindRoot[BesselJ[0Show[{Plot[BesselJ[0, x], {x, 58}] (*{x\[Rule]58.90690, 50}*)
FindRoot[BesselJ[0,] x], Graphics[Point[{x, 610}] (*{x\[Rule]62/.048}*)

but NSolve surprisingly fails

NSolve[{BesselJ[0, x  ], 55 < x < 63erg]]}, x, Reals][[1]]]

and gives only one root instead of three!enter image description here

ChangingBut if I increase the intervall a little bitrange 0<x<100 NSolve misses many of the expected 32 roots.

erg = NSolve[{BesselJ[0, x  ]x], 55 - 100 < x < 63 - 10100}, x, Reals] 
(*{Show[{x ->Plot[BesselJ[0, 46.3412}x], {x, ->0, 49.4826100},] ,Graphics[Point[{x, ->0} 52/.6241} erg]]}*)]

NSolve gives the three results as expected.enter image description here

Any idea why NSolve fails in the first case? Is there some kind of critical argumentsize x in the definition of BesselJ[0,x]? Thanks!

Plotting BesselJ[0,x]

Plot[BesselJ[0, x], {x, 54, 63},GridLines -> {BesselJZero[0, { 18, 19, 20}] // N , None}]

enter image description here

shows three roots, calculated by BesselJZero

Confirmation of the roots could be realized using FindRoot or NSolve.

FindRoot works well

FindRoot[BesselJ[0, x], {x, 55}](*{x\[Rule]55.7655}*)
FindRoot[BesselJ[0, x], {x, 58}] (*{x\[Rule]58.9069 }*)
FindRoot[BesselJ[0, x], {x, 61}] (*{x\[Rule]62.048}*)

but NSolve surprisingly fails

NSolve[{BesselJ[0, x  ], 55 < x < 63}, x, Reals][[1]]

and gives only one root instead of three!

Changing the intervall a little bit

NSolve[{BesselJ[0, x  ], 55 - 10 < x < 63 - 10}, x, Reals] 
(*{{x -> 46.3412}, {x -> 49.4826}, {x -> 52.6241}}*)

NSolve gives the three results as expected.

Any idea why NSolve fails in the first case? Is there some kind of critical argumentsize x in the definition of BesselJ[0,x]? Thanks!

BesselJ[0,x] is a smooth quasiperiodic function. NSolve is able to find all roots in the given range 0<x<50:

erg = NSolve[{BesselJ[0, x], 0 < x < 50}, x, Reals]
Show[{Plot[BesselJ[0, x], {x, 0, 50}] , Graphics[Point[{x, 0} /. erg]]}]

enter image description here

But if I increase the range 0<x<100 NSolve misses many of the expected 32 roots.

erg = NSolve[{BesselJ[0, x], 0 < x < 100}, x, Reals]
Show[{Plot[BesselJ[0, x], {x, 0, 100}] ,Graphics[Point[{x, 0} /. erg]]}]

enter image description here

Any idea why NSolve fails? Is there some kind of critical argumentsize x in the definition of BesselJ[0,x]? Thanks!

added 87 characters in body
Source Link
Ulrich Neumann
  • 56.8k
  • 2
  • 26
  • 60
Loading
Source Link
Ulrich Neumann
  • 56.8k
  • 2
  • 26
  • 60
Loading