MathGroup Archive 2006

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

Search the Archive

Re: Odd answer from Mathematica

  • To: mathgroup at smc.vnet.net
  • Subject: [mg63636] Re: [mg63609] Odd answer from Mathematica
  • From: Murray Eisenberg <murray at math.umass.edu>
  • Date: Sun, 8 Jan 2006 03:33:00 -0500 (EST)
  • Organization: Mathematics & Statistics, Univ. of Mass./Amherst
  • References: <200601070729.CAA06934@smc.vnet.net>
  • Reply-to: murray at math.umass.edu
  • Sender: owner-wri-mathgroup at wolfram.com

Why do you think the result for i = 7 is a "bug"?? It's perfectly 
reasonable!  It's giving you one of the negative roots.

According to the documentation in section A.9.4 of the Mathematica Book 
(the section "Some Notes on Internal Implementation" in the appendix 
"Mathematica Reference Guide"):

   FindRoot uses a damped Newton's method, the secant method and
   Brent's method.

Look at the graph of BesselJ[0, x] for x from 0 to 10, say.  You'll see 
that it has a local maximum somwhere near 7 -- in fact, as Mathematica 
can calculate for you as a root of -BesselJ[1, x] -- at approximately 
7.01559.

Then if you try to use Newton's method alone, the tangent line to the 
graph at x = 7 has a small positive slope and hence intersects the 
x-axis at a negative value, namely, around -57.  Additional interations 
of Newton's method (or refinements, etc.), just cause the iterates to 
converge to one of the negative roots of BesselJ[0, x], namely, the 
result you obtained.

The moral is, of course, that a "bad" initial approximation can lead to 
a different root than one is seeking.


Steeve Brechmann (schumi) wrote:
> 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"
> 
> 
> 

-- 
Murray Eisenberg                     murray at math.umass.edu
Mathematics & Statistics Dept.
Lederle Graduate Research Tower      phone 413 549-1020 (H)
University of Massachusetts                413 545-2859 (W)
710 North Pleasant Street            fax   413 545-1801
Amherst, MA 01003-9305


  • Prev by Date: Re: Getting the small parts right or wrong. Order and Collect
  • Next by Date: Re: Re: Can anybody help?
  • Previous by thread: Odd answer from Mathematica
  • Next by thread: Re: Odd answer from Mathematica