Re: Annoying Maximize behaviour
- To: mathgroup at smc.vnet.net
- Subject: [mg64056] Re: Annoying Maximize behaviour
- From: albert <awnl at arcor.de>
- Date: Sun, 29 Jan 2006 23:10:11 -0500 (EST)
- References: <drf6fs$egp$1@smc.vnet.net>
- Sender: owner-wri-mathgroup at wolfram.com
Hi, > In[1]:= > {$Version, $ReleaseNumber} > > > Out[1]= > {5.1 for Mac OS X (October 25, 2004),0} > > In[2]:= > Maximize[Exp[-x^2]Sin[x],x] > > > Out[2]= > Maximize[Exp[-x^2]Sin[x],x] > > wouldn't the following output be friendlier? > > Maximize::choke: No analytic solution found, resorting to numerical > methods. Out[2]= > {0.396653, {x -> 0.653271}} > I think Andrzej gave you a good reason why the current behaviour is favourable in most circumstances. Here is anotherone: see how easy it is to define a function which behaves as you suggested and try to write one which behaves like Maximize when all you have is a black box that behaves as you suggested... maximize::num = "no symbolic solution found, trying numerics"; maximize[args___] := Maximize[args] /. Maxmize :> (Message[maximize::num]; NMaximize) hth albert