OpenersNotesSection(Spacer1)Details

This message is generated when the indicated expression from the second argument in ConstrainedMin or ConstrainedMax is not an equation or inequality.

Equations can be entered using the notation lhs==rhs, and inequalities can be entered using lhs<rhs, lhs<=rhs, lhs>rhs, and lhs>=rhs.

The notation lhs=rhs is used for assignments rather than for equations. Evaluation of this input will attempt to assign a value to lhs.

(RefLink[Off, paclet:ref/Off])[message] switches off the message; (RefLink[On, paclet:ref/On])[message] switches it on. For example: (RefLink[Off, paclet:ref/Off])[ConstrainedMax::cmcons].

OpenersPrimaryExamplesSection(Spacer1)Examples  (1)

OpenersExampleSection0(Spacer1)Basic Examples  (1)

One of the elements in the second argument is not an equation or inequality:

ConstrainedMax[x+y, {x<5, y===1}, {x,y}]

This shows valid input to ConstrainedMax:

ConstrainedMax[x+y, {x<5, y==1}, {x,y}]

After this error, the right-hand side of the expression may have been assigned a value:

ConstrainedMax[var[1]+var[2], {var[1]<5, var[2]=1}, {var[1],var[2]}]

?var

The value assigned by mistake must be cleared before this input will behave as intended:

Clear[var]

ConstrainedMax[var[1]+var[2], {var[1]<5, var[2]==1}, {var[1],var[2]}]