       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:=
minimum=NMinimize[4x^2  - 16x + Exp[Sin[x]],x]

Out=
{-13.6011,{x\[Rule]2.15944}}

In:=
x/.minimum[]

Out=
2.15944

--
Curt Fischer

```

• Prev by Date: newbie alert: FindRoot
• Next by Date: AW: Using a Result from NMinimize
• Previous by thread: Re: Using a Result from NMinimize
• Next by thread: RE: Using a Result from NMinimize