[Date Index]
[Thread Index]
[Author Index]
Re: Problem with Mathematica driving me nuts
*To*: mathgroup at smc.vnet.net
*Subject*: [mg46804] Re: [mg46791] Problem with Mathematica driving me nuts
*From*: Daniel Lichtblau <danl at wolfram.com>
*Date*: Tue, 9 Mar 2004 04:30:47 -0500 (EST)
*References*: <200403080910.EAA10442@smc.vnet.net>
*Sender*: owner-wri-mathgroup at wolfram.com
benwoodward.com wrote:
> FindRoot[x^2 == 4x - 4, {x, 1}]
>
> Out[4]=
> {x -> 1.99902}
>
> In[15]:=
> FindRoot[x^2 - 4*x + 4, {x, 3}]
>
> Out[15]=
> {x -> 2.00098}
>
> When the root is clearly two.
> Is Mathematica using Newton's Method like a Ti-92?
> Even if so, why wont it give a more accurate answer?
> I've tried N[%,30] but it doesn't do anything.
> I'm new to Mathematica coming over from a Ti-92, so everything is
> frustrating right now.
> Thanks.
>
I assume you are using a version 4.something, as version 5 appears to do
better (i.e. it gives x->2.). The code below was run in version 4.2.
In[9]:= FindRoot[x^2 == 4x - 4, {x, 1}, AccuracyGoal->14,
MaxIterations->200]
Out[9]= {x -> 2.}
InputForm will reveal that it is really only correct to 7 or so places,
which is appropriate because you are at a double root (so accuracy will
be roughly twice that, as requested).
Note that the Automatic setting for AccuracyGoal will try to attain 6
decimal places in version 4. We see below that this was in fact
accomplished.
In[13]:= rt = FindRoot[x^2 - 4*x + 4, {x, 3}]
Out[13]= {x -> 2.00098}
In[14]:= Log[10, x^2 - 4*x + 4 /. rt]
Out[14]= -6.0206
The other example gives a similar result.
Daniel Lichtblau
Wolfram Research
Prev by Date:
**RE: Problem with Mathematica driving me nuts**
Next by Date:
**Re: simple bug about Sum/Product function?**
Previous by thread:
**Re: Problem with Mathematica driving me nuts**
Next by thread:
**Re: Problem with Mathematica driving me nuts**
| |