MathGroup Archive 2007

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

Search the Archive

Re: minimum of a function


Sven Krueger wrote:
> Hi
> 
> I also have a question concerning a mathematica problem:
> 
> I search the minimum of a function
> fmin := FindMinimum[f[x], {x, 0}]
> Evaluate[fmin]
> 
> I get out for example
> {2.4, {x -> 0.2}}
> 
> Is it possible to use the result x=0.2 afterwards?
> I would like to fix x after getting out the value of x at different
> results of fmin.
> 
> Thank you for your help
> 
> Sven Krüger
> 
> 

In[1]:=
sol = {2.4, {x -> 0.2}}

Out[1]=
{2.4, {x -> 0.2}}

The solution for x is returned as a transformation rule. You can use the 
replacement operator /. to apply the rule. See [1] for detailed information.

In[2]:=
x /. sol[[2]]

Out[2]=
0.2

In[3]:=
xmin = x /. sol[[2]]

Out[3]=
0.2

Regards,
Jean-Marc

[1] _The Mathematica Book_, "1.4.2 Values for Symbols", 
http://documents.wolfram.com/mathematica/book/section-1.4.2


  • Prev by Date: Re: Spurious Line
  • Next by Date: Re: Mathematica help
  • Previous by thread: Re: minimum of a function
  • Next by thread: Re: minimum of a function