ConstrainedMax::cmcons
ConstrainedMin::cmcons
ConstrainedMax::cmcons ConstrainedMin::cmcons
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.
- Off[message] switches off the message; On[message] switches it on. For example: Off[ConstrainedMax::cmcons].
Examples
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]}]? varThe 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]}]