Re: Points sampled by FindMinimum
- To: mathgroup at smc.vnet.net
- Subject: [mg71128] Re: Points sampled by FindMinimum
- From: Jean-Marc Gulliet <jeanmarc.gulliet at gmail.com>
- Date: Thu, 9 Nov 2006 03:37:31 -0500 (EST)
- Organization: The Open University, Milton Keynes, UK
- References: <eisfsu$mrp$1@smc.vnet.net>
Andrew Moylan wrote: > Hi all, > > Please consider the following code, which asks FindMinimum to minimise > a simple parabolic function while tracking at which which points > FindMinimum evaluates the function: > > func[x_?NumericQ] := (Print[x]; 1 + (x - 1)^2) > FindMinimum[func[x], {x, 0.1}] The option *StepMonitor* is better suited to this purpose In[1]:= func[(x_)?NumericQ] := 1 + (x - 1)^2 FindMinimum[func[x], {x, 0.1}, StepMonitor :> {Print[x]}] From In[1]:= 0.6 From In[1]:= 1. From In[1]:= 1. Out[2]= {1.,{x\[Rule]1.}} Regards, Jean-Marc