MathGroup Archive 2008

[Date Index] [Thread Index] [Author Index]

Search the Archive

Re: Plot vs NMaximize

  • To: mathgroup at smc.vnet.net
  • Subject: [mg94262] Re: [mg94221] Plot vs NMaximize
  • From: DrMajorBob <btreat1 at austin.rr.com>
  • Date: Tue, 9 Dec 2008 06:59:15 -0500 (EST)
  • References: <200812081122.GAA15842@smc.vnet.net>
  • Reply-to: drmajorbob at longhorns.com

I sent a RootSearch link, where the following would be more appropriate:

http://library.wolfram.com/infocenter/MathSource/6725/

Other searches at MathSource might get you closer to what you want.

Bobby

On Mon, 08 Dec 2008 08:56:48 -0600, Nikolaus Rath <Nikolaus at rath.org>  
wrote:

> DrMajorBob <btreat1 at austin.rr.com> writes:
>> Here's an example of using Plot to help FindMaximum:
>>
>> pts =.;
>> f = Sin[2 x] Cos[3 x];
>> p1 = Plot[f, {x, 0, 2 Pi}];
>> xpts = First@Cases[p1, Line[pts : _] :> pts, Infinity];
>> p2 = ListPlot[xpts];
>> Show[p1, p2]
>>
>> (graphic omitted)
>>
>> max = SortBy[xpts, Last][[-1, 1]]
>> FindMaximum[f, {x, max}]
>>
>> 5.31784
>>
>> {0.907858, {x -> 5.31789}}
>>
>> Plot got very close to the max in that interval, and FindMaximum uses
>> the  result as an advanced start.
>
> Interesting. I thought about the same thing, but I didn't expect that
> it can be coded so easily.
>
>> FindMaximum doesn't do it this way automatically, because it
>> wouldn't always be best. You can never be certain, in fact, that
>> Plot finds the global maximum.
>
> Yes. But the same is true for NMaximize, so I do not understand why
> the two functions use different methods when they (as I see it) give
> the same result, only once as a graphic and once as a number.
>
> Do you have an example where it would not be sensible to have
> NMaximize find the same maximum that Plot shows?
>
>
>
> Best,
>
>    -Nikolaus
>



-- 
DrMajorBob at longhorns.com


  • Prev by Date: Re: Plot vs NMaximize
  • Next by Date: Re: A 3D Plot Query
  • Previous by thread: Re: Plot vs NMaximize
  • Next by thread: Re: Plot vs NMaximize