Basics: The sdpvar and set objectThe most important command in YALMIP is sdpvar. This command is used to the define decision variables. To define a matrix (or scalar) P with height n and width m, we write
A square matrix is symmetric by default. To obtain a fully parameterized square matrix, a third argument is needed.
The third argument can be used to obtain a number of pre-defined types of variables, such as Toeplitz, Hankel, symmetric and skew-symmetric matrices. See the help text on sdpvar for details. The sdpvar objects are manipulated in MATLAB as any other variable and (almost) all standard functions are overloaded. Hence, the following commands are valid
To define constraints, the command set is used (with set meaning set as in convex set, non-convex set, set of integers etc, not as in set/get). The meaning of a constraint is context-dependent. If left-hand side and right-hand side are Hermitian, the constraint is interpreted in terms of positive definiteness, otherwise element-wise. Hence, declaring a symmetric matrix and a positive definiteness constraint is done with
while a symmetric matrix with positive elements is defined with, e.g.,
According to the rules above, a non-square matrix with positive elements can be defined using the > operator immediately
A list of several constraints is defined by just adding set objects.
Of course, the involved expressions can be arbitrary sdpvar objects, and equality constraints (==) can be defined, as well as constraints using <.
In fact, non-strict operators =< and >= may also be used (by default, there
is no difference, but by using the option
Finally, a convenient way to definine several constraint is to use double-sided constraints.
|