Services & Resources / Wolfram Forums / MathGroup Archive
-----

MathGroup Archive 2010

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

Search the Archive

FindMinimum inside another FindMinimum

  • To: mathgroup at smc.vnet.net
  • Subject: [mg111676] FindMinimum inside another FindMinimum
  • From: Xaq Pitkow <zsp2101 at columbia.edu>
  • Date: Tue, 10 Aug 2010 03:54:22 -0400 (EDT)

Hello MathGroup,

I'm trying to minimize a function (F[b,J]-1)^2, where the argument b 
will itself be determined by another minimization:

	F[b_,J_] := b^2 - b*J + J^2
	B[J_] := Last[ FindArgMin[ F[b,J] , {b,1.} ] ]

When I try the outer minimization, I run into trouble:

	FindMinimum[ b = B[J]; (F[b, J] - 1)^2, {J, -1.}]

gives the error

	FindArgMin::nrnum : The function value 1.-1.J+J^2 is not a real 
number at {b}={1.}.

In this case I know the right answer, but my real problem is much more 
complicated. Here I've isolated the technical Mathematica problem. I'm 
guessing that there's some trick to telling the inner minimization how 
to localize the variable J. Any suggestions?
Many thanks!
xaq pitkow, center for theoretical neuroscience


  • Prev by Date: Equation solving question
  • Next by Date: Re: Suggestions
  • Previous by thread: Re: Equation solving question
  • Next by thread: Clearing RAM Memory during evaluation