MathGroup Archive 2006

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

Search the Archive

RE: using FindRoot to find multiple answers in a domain?

  • To: mathgroup at smc.vnet.net
  • Subject: [mg69108] RE: [mg69059] using FindRoot to find multiple answers in a domain?
  • From: "David Park" <djmp at earthlink.net>
  • Date: Wed, 30 Aug 2006 06:33:18 -0400 (EDT)
  • Sender: owner-wri-mathgroup at wolfram.com

Akil,

Download and install the Ted Ersek RootSearch package from MathSource.
Although it works only on 1D cases, in those cases it is much better and
more convenient than FindRoot.

Needs["Ersek`RootSearch`"]

RootSearch[Cos[antwoord] == Sin[antwoord], {antwoord, 0,  10Pi}]

{{antwoord -> 0.785398}, {antwoord -> 3.92699}, {antwoord ->
      7.06858}, {antwoord -> 10.2102}, {antwoord -> 13.3518}, {antwoord ->
      16.4934}, {antwoord -> 19.635}, {antwoord -> 22.7765}, {antwoord ->
      25.9181}, {antwoord -> 29.0597}}

David Park
djmp at earthlink.net
http://home.earthlink.net/~djmp/

From: akil [mailto:akomur at wanadoo.nl]
To: mathgroup at smc.vnet.net


I want to find all answers that exist in a certain domain, but FindRoot
gives only the first answer it finds (Using other methods like Solve,Reduce
etc takes too long, so Im stuck with using FindRoot). I give the problem I
have by example, the functions I use are really complex, but by solving the
problem for the example, I could solve t for the complex part.

Example:

Finding all intersections of Cos[x] and Sin[x] in the domain [0,10Pi]

Doing:
FindRoot[Cos[antwoord] == Sin[antwoord], {antwoord, 0, 0, 10Pi}]

FindRoot[Cos[antwoord] == Sin[antwoord], {antwoord, %, %, 10Pi}]

does not work the second FindRoot gives the exact same answer back. So using
this in a loop to find all intersections does not work.

Doing FindRoot[Cos[antwoord] == Sin[antwoord], {antwoord, %+0.01, %+0.01,
10Pi}] instead, also does not work.

Any way to find all intersections in a specified domain?

Akil




  • Prev by Date: Re: one-dimensional and two-dimensional convolution
  • Next by Date: Re: generalized foldlist problem
  • Previous by thread: Re: using FindRoot to find multiple answers in a domain?
  • Next by thread: Re: using FindRoot to find multiple answers in a domain?