Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.soft-sys.math.mathematica > #11608 > unrolled thread

How can I use FindMaximum to get a result better than MachinePrecision?

Started byDavid Kirkby <drkirkby@gmail.com>
First post2012-09-04 09:49 +0000
Last post2012-09-05 07:09 +0000
Articles 3 — 3 participants

Back to article view | Back to comp.soft-sys.math.mathematica


Contents

  How can I use FindMaximum to get a result better than MachinePrecision? David Kirkby <drkirkby@gmail.com> - 2012-09-04 09:49 +0000
    Re: How can I use FindMaximum to get a result better than MachinePrecision? "danl@wolfram.com" <daniel.lichtblau0@gmail.com> - 2012-09-05 07:07 +0000
    Re: How can I use FindMaximum to get a result better than MachinePrecision? Ray Koopman <koopman@sfu.ca> - 2012-09-05 07:09 +0000

#11608 — How can I use FindMaximum to get a result better than MachinePrecision?

FromDavid Kirkby <drkirkby@gmail.com>
Date2012-09-04 09:49 +0000
SubjectHow can I use FindMaximum to get a result better than MachinePrecision?
Message-ID<k24irq$1k9$1@smc.vnet.net>
I've tried this:

In[2]:= FindMaximum[8 E^(-x) Sin[x] -1,{x,0,8}]

Out[2]= {1.57918, {x -> 0.785398}}


Then played around to try to get a more accurate result. 

In[9]:= FindMaximum[8 E^(-x) Sin[x] -1,{x,0,8},AccuracyGoal->20, PrecisionGoal->20]

Out[9]= {1.57918, {x -> 0.785398}}

In[10]:= Precision[%]


Also: 


In[7]:= N[FindMaximum[8 E^(-x) Sin[x] -1,{x,0,8},AccuracyGoal->200, PrecisionGoal->200],100]

Out[7]= {1.57918, {x -> 0.785398}}

In[8]:= Precision[%]

Out[8]= MachinePrecision


Any suggestions? 

[toc] | [next] | [standalone]


#11614

From"danl@wolfram.com" <daniel.lichtblau0@gmail.com>
Date2012-09-05 07:07 +0000
Message-ID<k26to1$5mg$1@smc.vnet.net>
In reply to#11608
On Tuesday, September 4, 2012 4:50:53 AM UTC-5, David Kirkby wrote:
> I've tried this:
> 
> In[2]:= FindMaximum[8 E^(-x) Sin[x] -1,{x,0,8}]
> 
> Out[2]= {1.57918, {x -> 0.785398}}
> 
> Then played around to try to get a more accurate result. 
> 
> In[9]:= FindMaximum[8 E^(-x) Sin[x] -1,{x,0,8},AccuracyGoal->20, PrecisionGoal->20]
> 
> Out[9]= {1.57918, {x -> 0.785398}}
> 
> In[10]:= Precision[%]
> 
> Also: 
> 
> In[7]:= N[FindMaximum[8 E^(-x) Sin[x] -1,{x,0,8},AccuracyGoal->200, PrecisionGoal->200],100]
> 
> Out[7]= {1.57918, {x -> 0.785398}}
> 
> In[8]:= Precision[%]
> 
> Out[8]= MachinePrecision
> 
> Any suggestions?

Raise WorkingPrecision.

FindMaximum[8 E^(-x) Sin[x] -1,{x,0,8},AccuracyGoal->20, PrecisionGoal->20, WorkingPrecision->30]

Out[2]= {1.57917553555867559401893547648, 
 
>    {x -> 0.785398163397448309705386001198}}

See Help > Documentation Center > PrecisionGoal > More Information > 5th bullet item.

related: Help > Documentation Center > FindMaximum > Options > AccuracyGoal & PrecisionGoal 2nd and 3rd examples.


Daniel Lichtblau
Wolfram Research

[toc] | [prev] | [next] | [standalone]


#11622

FromRay Koopman <koopman@sfu.ca>
Date2012-09-05 07:09 +0000
Message-ID<k26trj$5od$1@smc.vnet.net>
In reply to#11608
On Sep 4, 2:50 am, David Kirkby <drkir...@gmail.com> wrote:
> I've tried this:
>
> In[2]:= FindMaximum[8 E^(-x) Sin[x] -1,{x,0,8}]
>
> Out[2]= {1.57918, {x -> 0.785398}}
>
> Then played around to try to get a more accurate result.
>
> In[9]:= FindMaximum[8 E^(-x) Sin[x] -1,{x,0,8},
> AccuracyGoal->20, PrecisionGoal->20]
>
> Out[9]= {1.57918, {x -> 0.785398}}
>
> In[10]:= Precision[%]
>
> Also:
>
> In[7]:= N[FindMaximum[8 E^(-x) Sin[x] -1,{x,0,8},
> AccuracyGoal->200, PrecisionGoal->200],100]
>
> Out[7]= {1.57918, {x -> 0.785398}}
>
> In[8]:= Precision[%]
>
> Out[8]= MachinePrecision
>
> Any suggestions?

FindMaximum[8 E^(-x) Sin[x] -1,{x,0,8},
AccuracyGoal->30, PrecisionGoal->30, WorkingPrecision->40]

{1.579175535558675594018935476481035678702,
 {x -> 0.7853981633974483096234856042864548995134}}

[toc] | [prev] | [standalone]


Back to top | Article view | comp.soft-sys.math.mathematica


csiph-web