Better Root Finder [message #53400] |
Sat, 14 April 2007 21:55  |
Max Watson
Messages: 1 Registered: April 2007
|
Junior Member |
|
|
IDL's fx_root seems very limited; when I want to find the root of say
x^3 - 8 with the initial guess vector [-1,-100,100], IDL returns a
complex number: ( -1.00000, 1.73205). Is there a way that
fx_root can be easily modified so that it can find the right answer
with a bad initial guess?
|
|
|
Re: Better Root Finder [message #53531 is a reply to message #53400] |
Mon, 16 April 2007 08:15  |
James Kuyper
Messages: 425 Registered: March 2000
|
Senior Member |
|
|
Max Watson wrote:
> IDL's fx_root seems very limited; when I want to find the root of say
> x^3 - 8 with the initial guess vector [-1,-100,100], IDL returns a
> complex number: ( -1.00000, 1.73205). Is there a way that
> fx_root can be easily modified so that it can find the right answer
> with a bad initial guess?
As has already been pointed out, that is "a" right answer, just not
the one that you wanted. When there are multiple roots, it's logically
impossible for a root finding technique to guarantee that it will give
you the one you want, unless you give it sufficient information to
determine which of those roots IS the one you want . An initial guess
that is sufficiently close to the desired solution is one approach;
methods that are restricted to finding real roots would be another
approach, if the root you want it the only real one.
|
|
|