Re: A quick question
- To: mathgroup at smc.vnet.net
- Subject: [mg7871] Re: A quick question
- From: sergio at scisun.sci.ccny.cuny.edu (Sergio Rojas)
- Date: Thu, 17 Jul 1997 15:35:35 -0400
- Organization: City College Of New York - Science
- Sender: owner-wri-mathgroup at wolfram.com
Another alternative is: x = x /. FindMinimum[x^2,{x,-5}][[2]] Rojas E-mail: sergio at scisun.sci.ccny.cuny.edu Tony NICOLAS (Tony.Nicolas at insa-rouen.fr) wrote: : In article <5pv1q6$ig1 at smc.vnet.net>, Chen-Ying Huang : <huang3 at fas.harvard.edu> wrote: : > Hi there: : > I am a grad student and I am using Mathematica to solve an : > international trade model. My question is that since I need to do some : > nonlinear optimization, so I used the command "FindMinimum". The problem : > is that Mathematica reported it without assigning the value to the : > variable. For example, say if I want to FindMinimum of the function : > f=x^2, then the result I get is {0,{x->0}. But that is not enough for me : > since I want the value 0 to be restored in x, that is I want to have 0 : > assigned to the variable x after I run the command "FindMinimum" because : > I need to use this value of x to do more calculations. Since I need to : > repeat this in a loop, I cannot do it manually. Is there someone who can : > help me with this? I really appreciate any help and please give me : > answers as soon as possible. I really need to do this, otherwise my : > advisor will think that I am just shirking. : > Thank you, whoever you are! : > Chen-Ying Huang : > e-mail: chuang at kuznets.fas.harvard.edu : Evrey object in Mathematica is a list. So if you want give the value of x, : you must write: : : an example : a=FindMinimum[x^2,{x,-5}] : x=a[[2,1]][[2]] : Tony