MathGroup Archive 2007

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

Search the Archive

Re: Debug of FindRoot

  • To: mathgroup at smc.vnet.net
  • Subject: [mg78906] Re: [mg78871] Debug of FindRoot
  • From: DrMajorBob <drmajorbob at bigfoot.com>
  • Date: Thu, 12 Jul 2007 05:23:41 -0400 (EDT)
  • References: <13498482.1184172901724.JavaMail.root@m35>
  • Reply-to: drmajorbob at bigfoot.com

Where the derivative is large, you need a better starting point...  
especially when there are discontinuities. For some of your starting  
points, FindRoot did a secant step that took it into the wrong region, so  
naturally, it found the wrong root.

Bi = 0.5;
saved = {};
xvalues[{x_, y_}] := AppendTo[saved, x]
ClickPane[
  Plot[{BesselJ[0, z]/BesselJ[1, z], z/Bi}, {z, 0.001, 12}], xvalues]

Click near the intersections (careful to stay on the correct side of the 
nearest discontinuity), then

saved

{0.925933, 4.02841, 7.15494, 10.2815}

FindRoot[BesselJ[0, z]/BesselJ[1, z] == z/Bi, {z, #}] & /@ saved

{{z -> 0.940771}, {z -> 3.95937}, {z -> 7.08638}, {z -> 10.2225}}

Bobby

On Wed, 11 Jul 2007 05:20:24 -0500, Miguel <misvrne at gmail.com> wrote:

> To resolve one of the heat equations it is necesary to calculate the
> solution of z for BesselJ[0,z]/BesselJ[1,z]==z/Bi, where Bi is the
> Biot number (equal to 0.5, for example).
>
> 1.- Plot[{BesselJ[0,z]/BesselJ[1,z],z/Bi},{z,0.001,12}].
>
>> From this plot I deduce the ranges, more or less, {1,4,7,10}.
>
> 2.- FindRoot[BesselJ[0,z]/BesselJ[1,z]==z/Bi,{z,#}]&/@{1,4,7,10}
> {{z->0.940771},{z->3.95937},{z->0.940771},{z->3.95937}}
>
> I dont understand the reason. With others differents intervals it
> works fine.
>
>
>



-- 
DrMajorBob at bigfoot.com


  • Prev by Date: Re: Deriving parametric plot of a branch cut
  • Next by Date: integration of piecewise convex bivariate function with 6 parameters
  • Previous by thread: Re: Debug of FindRoot
  • Next by thread: Re: Debug of FindRoot