1
$\begingroup$

I'm trying to use NMaxValue inside other statements (FindRoot and NMinimize). Those statements should bind variable names, but I'm getting weird warnings which seem to indicate that the variables aren't bound inside the constraints of the NMaxValue statement? Minimal example:

NMinimize[{NMaxValue[{f[x,y],1<x<y},x],1<y},y]

NMaxValue::bcons: The following constraints are not valid: {1<x,x<y}. Constraints should be equalities, inequalities, or domain specifications involving the variables.
NMaxValue::bcons: The following constraints are not valid: {1<x,x<y}. Constraints should be equalities, inequalities, or domain specifications involving the variables.
NMaxValue::bcons: The following constraints are not valid: {1<x,x<y}. Constraints should be equalities, inequalities, or domain specifications involving the variables.
General::stop: "Further output of NMaxValue::bcons will be suppressed during this calculation."

Why are these constraints not valid? y should be in-scope because it's defined by NMinimize, right? Is this a bug?

$\endgroup$
1
  • $\begingroup$ Might need to define the inner function as taking a parameter, y, and returning a value. That will avoid issues with symbolic preprocessing not knowing a parameter will, in function invocations, have a real value and thus cause the inner optimization to return a numeric value. $\endgroup$ – Daniel Lichtblau Jul 19 '13 at 20:43

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.