Re: FindRoots?

• To: mathgroup at smc.vnet.net
• Subject: [mg112185] Re: FindRoots?
• From: Matthias Bode <lvsaba at hotmail.com>
• Date: Sat, 4 Sep 2010 03:58:57 -0400 (EDT)

```Hola Gianluca:

In[1]:== Reduce[2*x + Log[-((-1 + 2*x)/(-1 + 2*x^2))] ==== 0 &&
-2 < x < -Sqrt[2]^(-1), x, Reals]

Out[1]== x ==== Root[{Log[-((-1 + 2*#1)/(-1 + 2*#1^2))] + 2*#1 & ,
-0.86193624643066461859672257230652325788`20.308604836334762}]

In[2]:== 2*x + Log[-((-1 + 2*x)/(-1 + 2*x^2))] /.
x -> -0.86193624643066461859672257230652325788`20.308604836334762

Out[2]== 0``19.380562970987107

== 0. * 10^ -20

Whereas (see your original equation below),

Reduce[2 x + Log[-((-1 + 2 x)/(-1 + 2 x^2))] ====== ==
0 && -2 < x < -1/Sqrt[2], x, Reals]

Syntax::sntxf:"2x+Log[-((-1+2x)/(-1+2x^2))]======" cannot be followed by "=
==0&&-2<x<-1/Sqrt[2]".

Syntax::tsntxi:"==0&&-2<x<-1/Sqrt[2]" is incomplete; more input is needed.

Syntax::sntxi:Incomplete expression; more input is needed.

Best regards,

MATTHIAS BODE
COCHABAMBA/BOLIVIA

> Date: Fri, 3 Sep 2010 06:10:23 -0400
> From: gianluca.gorni at uniud.it
> Subject: [mg112177] Re: FindRoots?
> To: mathgroup at smc.vnet.net
>
>
> 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).
>
> 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.
>
> 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.
>
> Best regards,
> Gianluca Gorni
>
>
>
> On 01/set/2010, at 12.28, Andrzej Kozlowski wrote:
>
> >
> > On 30 Aug 2010, at 12:19, David Park wrote:
> >
> >> I don't know why Wolfram doesn't acquire the rights to this package an=
d
> >> incorporate it as part of regular Mathematica. Finding all the roots o=
f a
> >> real function on a 1-dimensional domain is the most common case of roo=
t
> >> finding, and it is the one thing regular Mathematica is very poor at. =
Ted's
> >> package is quite robust and returns all the roots in order.
> >
> >
> > Mathematica's Reduce can do this (in the case of complex analytic funct=
ions, which covers most important practical cases) since version 7. I have =
posted examples of this several times, but somehow nobody seems to notice a=
nd we keep reading strange remarks like the above. Well, I don't want it to=
sound like I am trying to diminish Ted's achievement, but quite frankly, f=
rom the mathematical point of view, the methods used in the RootSearch pack=
age are rather primitive, relatively to the current state of knowledge in t=
his field, of course. Not only does Reduce solve most transcendental equati=
ons much faster but it also does not require setting the values of any opti=
ons by hand, and, what I think is most important, the results thus obtained=
are provably correct, which is not the case with Ted's package. In fact, m=
uch more general methods of solving transcendental equations exist (in gene=
ral the functions need not be analytic and can involve systems of n-real eq=
uations in n-varia!
> b
> > l!
> > es with non-vanishing Jacobian). An example of such a method can be fou=
nd in one of my demonstrations on the demonstrations site (the algorithm ca=
n easily be converted to a practical method for real life probl ems.
> >
> > In view of this, how could there be any justification for the suggestio=
n that Wolfram incorporates what is actually an impressive but amateurish p=
ackage into what is supposed to be a sophisticated mathematical program?
> > Sometimes certain capabilities are missing from Mathematica simply beca=
use implementing "bleeding edge" algorithms in a way that is satisfactory f=
ora program that has the kind of aspirations that Mathematica obviously doe=
s takes time.
> >
> > These sort of "helpful suggesting", particularly when coming from non-e=
xp==
> erts, have no chance whatever of being accepted and even can produce the =
im==
> pression of an ulterior motive being involved.
> >
>

--_637439e7-ac01-4858-84ae-ee894c0a0aa9_
Content-Type: text/html; charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
X-Sun-Content-Length: 6413

<html>
<style><!--
.hmmessage P
{
margin:0px;
}
body.hmmessage
{
font-size: 10pt;
font-family:Tahoma
}
--></style>
<body class='hmmessage'>
Hola Gianluca:<br><br>In[1]:= Reduce[2*x + Log[-((-1 + 2*x)/(-1 + 2*x^2))=
] == 0 &amp;&amp; <br>&nbsp;&nbsp;&nbsp;&nbsp; -2 &lt; x =
&lt; -Sqrt[2]^(-1), x, Reals]<br><br>Out[1]= x == Root[{Log[-((=
-1 + 2*#1)/(-1 + 2*#1^2))] + 2*#1 &amp; , <br>&nbsp;&nbsp;&nbsp;&=
nbsp;&nbsp;&nbsp; -0.86193624643066461859672257230652325788`20.308604=
836334762}]<br><br>In[2]:= 2*x + Log[-((-1 + 2*x)/(-1 + 2*x^2))] /. <br>&=
nbsp;&nbsp; x -&gt; -0.86193624643066461859672257230652325788`20.3086=
04836334762<br><br>Out[2]= 0``19.380562970987107<br><br>= 0. * 10^ -20<=
br><br>Whereas (see your original equation below),<br><br>Reduce[2 x + Lo=
g[-((-1 + 2 x)/(-1 + 2 x^2))] === = <br>&nbsp;&nbsp; 0 &amp;&=
amp; -2 &lt; x &lt; -1/Sqrt[2], x, Reals]<br><br>Syntax::sntxf:"2=
x+Log[-((-1+2x)/(-1+2x^2))]===" cannot be followed by "=0&amp;&am=
p;-2&lt;x&lt;-1/Sqrt[2]".<br><br>Syntax::tsntxi:"=0&amp;&amp;-2=
&lt;x&lt;-1/Sqrt[2]" is incomplete; more input is needed.<br><br>Synt=
ax::sntxi:Incomplete expression; more input is needed.<br><br>Best regard=
s,<br><br><div><strong><em></em></strong><style>
</style><div><font face="Arial" size="2">MATTHIAS BODE<br>COCHABAMBA/BO=
LIVIA</font><br></div></div><br><br>&gt; Date: Fri, 3 Sep 2010 06:10:23=
-0400<br>&gt; From: gianluca.gorni at uniud.it<br>&gt; Subject: [mg112177=
] Re: FindRoots?<br>&gt; To: mathgroup at smc.vnet.net<br>&gt; <br>&gt; =
<br>&gt; In my opinion Reduce can replace RootSearch in some<br>&gt; ca=
ses but not in others.<br>&gt; <br>&gt; First of all, Reduce has bugs=
. Here is an analytic function<br>&gt; that clearly has a real root:<br>&=
gt; <br>&gt; Plot[2 x + Log[-((-1 + 2 x)/(-1 + 2 x^2))], {x, -2, =
-1/Sqrt[2]}]<br>&gt; <br>&gt; Still, Reduce does not see it (as of ve=
rsion 7.0.1):<br>&gt; <br>&gt; Reduce[2 x + Log[-((-1 + 2 x)/(-1 + 2 x^=
2))] ==== 0 &amp;&amp; -2 &lt;<br>&gt;    x &lt; -1/Sqrt[=
2], x, Reals]<br>&gt; False<br>&gt; <br>&gt; (I reported this exa=
mple to wolfram last year).<br>&gt; <br>&gt; Next, Reduce has problem=
s with inexact input, and with<br>&gt; InterpolatingFunction, so that=
it won't work with<br>&gt; the output of NDSolve:<br>&gt; <br>&gt; s=
ol == x /.<br>&gt;   First@NDSolve[{x'[t] ==== x[t] + 2, x[=
0] ==== -1}, x, {t, 0, 2}];<br>&gt; Reduce[sol[t] ==
=== 0 &amp;&amp; 0 &lt; t &lt; 2, t]<br>&gt; <br>&gt; o=
r, say, with functions obtained by interpolating between Locators.<br>&=
gt; RootSearch works fine in these cases.<br>&gt; <br>&gt; I have mad=
e some interactive panels where I can change the Locators<br>&gt; with th=
e mouse and I get in real time the roots of the interpolating<br>&gt; fun=
ction as big Points in the plot: I can do this with RootSearch,<br>&gt;=
but not with Reduce.<br>&gt; Unfortunately, I can't give these panels =
to other users, because<br>&gt; I can't assume that they have RootSearc=
h installed.<br>&gt; <br>&gt; I endorse the wish that the functionality=
of RootSearch were available<br>&gt; in the kernel.<br>&gt; <br>&gt;=
Best regards,<br>&gt; Gianluca Gorni<br>&gt; <br>&gt; <br>&gt; <=
br>&gt; On 01/set/2010, at 12.28, Andrzej Kozlowski wrote:<br>&gt; =
<br>&gt; &gt;<br>&gt; &gt; On 30 Aug 2010, at 12:19, David Park=
wrote:<br>&gt; &gt;<br>&gt; &gt;&gt; I don't know why Wolfram do=
esn't acquire the rights to this package and<br>&gt; &gt;&gt; incorpo=
rate it as part of regular Mathematica. Finding all the roots of a<br>&gt=
; &gt;&gt; real function on a 1-dimensional domain is the most common=
case of root<br>&gt; &gt;&gt; finding, and it is the one thing reg=
ular Mathematica is very poor at. Ted's<br>&gt; &gt;&gt; package is q=
uite robust and returns all the roots in order.<br>&gt; &gt;<br>&gt; =
&gt;<br>&gt; &gt; Mathematica's Reduce can do this (in the case of co=
mplex analytic functions, which covers most important practical cases) si=
nce version 7. I have posted examples of this several times, but somehow =
nobody seems to notice and we keep reading strange remarks like the above. =
Well, I don't want it to sound like I am trying to diminish Ted's achieve=
ment, but quite frankly, from the mathematical point of view, the met=
hods used in the RootSearch package are rather primitive, relatively to t=
he current state of knowledge in this field, of course. Not only does Red=
uce solve most transcendental equations much faster but it also does not re=
quire setting the values of any options by hand, and, what I think is m=
ost important, the results thus obtained are provably correct, which is=
not the case with Ted's package. In fact, much more general methods of s=
olving transcendental equations exist (in general the functions need not be=
analytic and can involve systems of n-real equations in n-varia!<br>&gt;=
b<br>&gt; &gt; l!<br>&gt; &gt; es with non-vanishing Jacobian). An=
example of such a method can be found in one of my demonstrations on the d=
emonstrations site (the algorithm can easily be converted to a practical me=
thod for real life probl ems.<br>&gt; &gt;<br>&gt; &gt; In view of =
this, how could there be any justification for the suggestion that Wolfra=
m incorporates what is actually an impressive but amateurish package into w=
hat is supposed to be a sophisticated mathematical program?<br>&gt; &gt=
; Sometimes certain capabilities are missing from Mathematica simply beca=
use implementing "bleeding edge" algorithms in a way that is satisfactory f=
ora program that has the kind of aspirations that Mathematica obviously doe=
s takes time.<br>&gt; &gt;<br>&gt; &gt; These sort of "helpful sugg=
esting", particularly when coming from non-exp=<br>&gt; erts, have =
no chance whatever of being accepted and even can produce the im=<br>&gt=
; pression of an ulterior motive being involved.<br>&gt; &gt;<br>&gt=
; <br> 		 	   		  </body>
</html>=

--_637439e7-ac01-4858-84ae-ee894c0a0aa9_--

```

• Prev by Date: Re: FindRoots?
• Next by Date: user-defined functions in KeyEventTranslations.tr
• Previous by thread: Re: FindRoots?
• Next by thread: Re: FindRoots?