# Nonlinear operators

Tags:

Updated:

Nonlinear functions and operators, such as abs, entropy or sort, are equipped with various properties which allows YALMIP to, e.g., analyze the optimization problem with respect to convexity, select a suitable way to model the problem, or supply gradients and jacobians to nonlinear solvers. If the problem is convex and suitably structured, YALMIP can sometimes use a graph representation, while a severly nonlinear or nonconvex problem might require the introduction of mixed-integer representations or a callback approach.

## Graph-based representations

Graph-based implementations model the operators by using additional variables and constraints, so called epi- and hypo-graphs. The benefit of this modeling strategy is that YALMIP can derive structured optimization models, such as a linear program or semidefinite, instead of treating the operators as general nonlinearities and use a nonlinear solver. Here, we say that the operator is conic representable if these reformulations are possible.

These graph representations are only possible if the expressions satisfy certain convexity or concavity conditions. Hence, YALMIP has to analyze the problem to ensure that the representation actually can be used.

Graph-based implementations are available for a large number of operators, such as the linear programming representable operators min, max and abs, the second-order cone representable sqrt, norm and geomean, semidefinite cone representable nuclear norm, or exponential cone representable such as entropy. Adding new operators is easy, and can be done almost entirely from template code.

## Mixed-integer representations

Mixed-integer representations are models that encode an exact representation of an operator by using integer and binary decision variables. The benefit of using such a representation is that the resulting nonconvex problem typically is a well structured problem, such as a mixed-integer linear program. Many of the conic representable operators that are implemented using linear programming graphs, are also available in a mixed integer representation. If YALMIP fails to propagate convexity, it will switch from graph-based modelling to mixed-integer modelling (unless the option ‘allownonconvex’ is set to 0). Mixed-integer models are available for, e.g., [min], max and abs, but also for purely combinatorial operators operators and conditions without any graph variants such as [or], [ne], iff, implies, nnz, sort and many more, and on a higher level, piecewise affine and quadratic functions in connection with MPT(/solver/mpt).