Functions available in the objective and constraints
Assuming appropriate convexity rules, these functions may be used in the objective and in the constraints. Here are some examples of available functions, assuming previously defined symbols and appropriate dimensions:
Functions available as affine objective terms only
These functions can only be used as affine terms in the objective.
Quadratic forms and squared variables may only appear in the objective. This is necessary so the problem can be transformed to a QP. While their arguments can involve other expressions (subject to valid convexity rules), they can only appear as affine terms. Quadratic forms quad(x, Q), say, must have the parameter marked as either psd (for a convex expression) or nsd (concave). You may also use the form quad(x), which is equal to , and equivalent to sum(square(x)).