Mathematica 9 is now available
Services & Resources / Wolfram Forums
-----
 /
MathGroup Archive
2004
*January
*February
*March
*April
*May
*June
*July
*August
*September
*October
*November
*December
*Archive Index
*Ask about this page
*Print this page
*Give us feedback
*Sign up for the Wolfram Insider

MathGroup Archive 2004

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

Search the Archive

Re: FindRoot s all

  • To: mathgroup at smc.vnet.net
  • Subject: [mg49422] Re: FindRoot s all
  • From: Bill Rowe <readnewsciv at earthlink.net>
  • Date: Mon, 19 Jul 2004 07:46:12 -0400 (EDT)
  • Sender: owner-wri-mathgroup at wolfram.com

On 7/18/04 at 8:09 AM, mathma18 at hotmail.com (Narasimham G.L.) wrote:

>y[u_,c_]=c^u-u^c-1 ; Plot[y[x,2],{x,-5,5}];
>FindRoot[y[x,2]==0,{x,-5,5}]; " Solution settles to a value outside
>the interval of roots of its derivative (humps and valleys),it may
>be the problem of Newton-Raphson diverging tangets.How to capture
>all roots [in this case {x -> 0, 1}] ? It should be valid for all
>c." 

You didn't say what version of Mathematica you were using.  I get

$Version

"5.0 for Mac OS X (June 10, 2003)"

y[u_, c_] = c^u - u^c - 1; 
FindRoot[y[x, 2] == 0, {x, -5, 5}]

{x -> 4.257461914447932}

with no error messages

To find other roots with FindRoot, simply choose different starting points, i.e.

FindRoot[y[x, 2] == 0, {x, 0.5}]

{x -> 1.0000000000000004}

There is a package written by Ted Ersek availble on the Wolfram web site that is very useful for this type of problem. With it, you can do

<< "Enhancements`RootSearch`"; 
RootSearch[y[x, 2] == 0, {x, -5, 5}]

{{x -> 0.}, {x -> 1.}, {x -> 4.257461914447932}}

and get all the roots at once.
--
To reply via email subtract one hundred and four


  • Prev by Date: Re: FindRoot s all
  • Next by Date: Re: Mathlink memory hog
  • Previous by thread: RE: FindRoot s all
  • Next by thread: Re: FindRoot s all