MathGroup Archive 2006

[Date Index] [Thread Index] [Author Index]

Search the Archive

Re: Odd answer from Mathematica

  • To: mathgroup at smc.vnet.net
  • Subject: [mg63626] Re: [mg63609] Odd answer from Mathematica
  • From: Bob Hanlon <hanlonr at cox.net>
  • Date: Sun, 8 Jan 2006 03:32:47 -0500 (EST)
  • Reply-to: hanlonr at cox.net
  • Sender: owner-wri-mathgroup at wolfram.com

It is not a bug, each returned value is a root.  You did not program 
Mathematica to find the roots in order.  

(soln=Table[{i,FindRoot[BesselJ[0,x]==0,{x,i}]},{i,1,15,2}]);

Chop[BesselJ[0,x]/.soln[[All,2]],10^-15]

{0,0,0,0,0,0,0,0}

Use closer starting estimates

(soln=Table[{i,FindRoot[BesselJ[0,x]==0,{x,3i}]},{i,5}])

{{1, {x -> 2.404825557695773}}, {2, {x -> 5.520078110286309}}, {3, {x -> 
8.653727912911013}}, 
  {4, {x -> 11.791534439014281}}, {5, {x -> 14.930917708487787}}}

Or use the standard add-on package NumericalMath`BesselZeros`

Needs["NumericalMath`BesselZeros`"];

soln=Thread[{Range[5],BesselJZeros[0, 5]}]

{{1, 2.404825557695773}, {2, 5.5200781102863115}, {3, 
8.653727912911013}, {4, 11.791534439014281}, 
  {5, 14.930917708487787}}


Bob Hanlon

> 
> From: "Steeve Brechmann \(schumi\)" <steevebrechmann at yahoo.ca>
To: mathgroup at smc.vnet.net
> Subject: [mg63626] [mg63609] Odd answer from Mathematica
> 
> 
> Hi everyone, 
>    
>   I was trying to obtain the first five positive roots of the BesselJ[0,x], when 
something comes out...
>    
>   I type :
>    
>   Table[{i,FindRoot[BesselJ[0,x]==0,{x,i}]},{i,1,15,2}]//TableForm
>    
>   and Mathematica answer that for x=7, it obtains x->-52,6241 !
>    
>   Is this a bug ?
>    
>   Thanks for your help.
>    
>   Steeve Brechmann "Addict to Mathematica"
> 
> 
> 


  • Prev by Date: Re: Fourier Transform Bug
  • Next by Date: Re: Getting the small parts right or wrong. Order and Collect
  • Previous by thread: Re: Odd answer from Mathematica
  • Next by thread: Connecting to an existing Notebook from Java