[Date Index]
[Thread Index]
[Author Index]
Re: FindRoots?
*To*: mathgroup at smc.vnet.net
*Subject*: [mg112182] Re: FindRoots?
*From*: Andrzej Kozlowski <akozlowski at gmail.com>
*Date*: Sat, 4 Sep 2010 03:58:24 -0400 (EDT)
On 3 Sep 2010, at 12:10, Gianluca Gorni wrote:
>
> In my opinion Reduce can replace RootSearch in some
> cases but not in others.
>
> First of all, Reduce has bugs. Here is an analytic function
> that clearly has a real root:
>
> Plot[2 x + Log[-((-1 + 2 x)/(-1 + 2 x^2))], {x, -2, -1/Sqrt[2]}]
>
> Still, Reduce does not see it (as of version 7.0.1):
>
> Reduce[2 x + Log[-((-1 + 2 x)/(-1 + 2 x^2))] ======== 0 && -2 <
> x < -1/Sqrt[2], x, Reals]
> False
>
> (I reported this example to wolfram last year).
You seem to be using ====== instead of ==== which is a very basic error. In fact
Reduce[2*x + Log[-((-1 + 2*x)/(-1 + 2*x^2))] ==== 0 &&
-2 < x < -Sqrt[2]^(-1), x, Reals]
x ==== Root[{Log[-((2*#1 - 1)/(2*#1^2 - 1))] + 2*#1 & ,
-0.86193624643066461859672257230652325787900736031\
58816695213`20.308604836334766}]
In[4]:== $Version
Out[4]== "7.0 for Mac OS X x86 (64-bit) (February 19, 2009)"
>
> Next, Reduce has problems with inexact input, and with
> InterpolatingFunction, so that it won't work with
> the output of NDSolve:
>
> sol ==== x /.
> First@NDSolve[{x'[t] ======== x[t] + 2, x[0] ======== -1}, x, {t, 0, 2}];
> Reduce[sol[t] ======== 0 && 0 < t < 2, t]
>
> or, say, with functions obtained by interpolating between Locators.
> RootSearch works fine in these cases.
What are these ======== doing in your code? I don't think they could have been in it when you run it?
Reduce used exact methods so you have to rationalize the output or use equivalent approaches and it works fine in such cases. You are right that you can't use it with Interpolating functions since of course they are not analytic.
>
> I have made some interactive panels where I can change the Locators
> with the mouse and I get in real time the roots of the interpolating
> function as big Points in the plot: I can do this with RootSearch,
> but not with Reduce.
> Unfortunately, I can't give these panels to other users, because
> I can't assume that they have RootSearch installed.
>
> I endorse the wish that the functionality of RootSearch were available
> in the kernel.
I concede that you make a reasonable case for this sort of capability. However, computations of this kind with Interpolating functions are generally quite unreliable, since the conditions required by FindRoot to work are often not satisfied. I don't think this sort of hit or miss approach is appropriate for a mathematical solver. Perhaps this sort of capabilities should be available in a package designed specifically for dealing with interpolating functions (which I don't consider as "mathematical objects").
Best regards
Andrzej
Prev by Date:
**Re: syntax-aware selection in palette notebook**
Next by Date:
**Re: locating overlow/underflow**
Previous by thread:
**Re: FindRoots?**
Next by thread:
**Re: FindRoots?**
| |