If for instance I have a problem of this sort:

\[ScriptCapitalR]1 = Interval[{0, 1}];
gigi[a_, b_, c_, d_, e_, f_] := With[{go = 2},
  dfe=a + b^2 + b + d^2 + e + f^2;
  a + dfe+go

FindMinimum[{gigi[a, b, c, d, e, f], a \[Element] \[ScriptCapitalR]1}, 
 {a, b, c, d, e, f}, 
 StepMonitor :> Print["Step to x = ", a]

Why doesn't it accept that "a" must belong to the region defined as an interval?


closed as off-topic by MarcoB, m_goldberg, corey979, Young, Feyre Feb 11 '17 at 21:25

This question appears to be off-topic. The users who voted to close gave this specific reason:

  • "This question arises due to a simple mistake such as a trivial syntax error, incorrect capitalization, spelling mistake, or other typographical error and is unlikely to help any future visitors, or else it is easily found in the documentation." – MarcoB, m_goldberg, corey979, Young, Feyre
If this question can be reworded to fit the rules in the help center, please edit the question.

  • $\begingroup$ A few things are unclear to me in your code: 1) is dfe supposed to be the product of d,f and e? Or is it a single variable, in which case is it defined elsewhere in your code? FindMinimum is a numerical function, so it can't deal with symbols with undefined value. 2) What is go supposed to do in your definition of gigi? Perhaps you could clean up your code to show only what is relevant to your current problem, I.e. a minimal working example. $\endgroup$ – MarcoB May 7 '16 at 14:40
  • $\begingroup$ Ok, I'll clean it up quick. $\endgroup$ – Mirko Aveta May 7 '16 at 14:51
  • $\begingroup$ Anyhow this is just an example. I had to write it down as I can't post my real problem because it is uselessly too complicated. $\endgroup$ – Mirko Aveta May 7 '16 at 14:59
  • 1
    $\begingroup$ Mirko, I think the long and short of it is that FindMinimum only appears to work with constraints expressed as equations or inequalities (KKT conditions); for instance, in your simplified case 0 <= a <= 1 works fine. $\endgroup$ – MarcoB May 7 '16 at 22:37
  • $\begingroup$ Does NMinimize work only with Karush Kun Tacker conditions too? $\endgroup$ – Mirko Aveta May 8 '16 at 8:40