Take the 2-minute tour ×
Mathematica Stack Exchange is a question and answer site for users of Mathematica. It's 100% free, no registration required.

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?

share|improve this question
    
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. –  Daniel Lichtblau Jul 19 '13 at 20:43

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.