Re: Using a Result from NMinimize

*To*: mathgroup at smc.vnet.net*Subject*: [mg49376] Re: Using a Result from NMinimize*From*: "Curt Fischer" <crf3 at po.cwru.edu>*Date*: Sat, 17 Jul 2004 06:38:39 -0400 (EDT)*References*: <cd8atu$ok5$1@smc.vnet.net>*Sender*: owner-wri-mathgroup at wolfram.com

Gregory Lypny wrote: > Hello Everyone, > > When I use NMinimize, it gives the result as the minimum value of the > function and the value of the argument that gets us there, for > example, > > {0.0817747, {rp -> 0.0920851}}. > > How can I access the second element, that is, the value of the > argument, so that I can use in other computations. In other words, I > want get at 0.0920851 and strip away the rp ->. NMinimum returns a list, where the first element is the minimum, and the second element is a replacement rule for the argument at which the minimum occurs. You want to invoke the replacement rule, which is the second part of the list. Here's how to do it In[1]:= minimum=NMinimize[4x^2 - 16x + Exp[Sin[x]],x] Out[1]= {-13.6011,{x\[Rule]2.15944}} In[2]:= x/.minimum[[2]] Out[2]= 2.15944 -- Curt Fischer