-
Notifications
You must be signed in to change notification settings - Fork 0
7. Cones
We call the set
-
$x+y \in K$ for every$x,y \in K$ holds -
$\lambda x \in K$ for every$\lambda \geq 0$ and$x \in K$
This notion is actually surprisingly versatile.
The most simple examples of convex cones are linear subspaces of
One such first order cone is visualized in the following figure:
The general
In three dimensions, the Second Order Cone (SOC) resembles an ice cream cone as can be seen in the following figure of a cone in three variables:
The
One concept that is particularly important to semidefinite programming is the convex cone of all symmetric positive semidefinite matrices (psd) defined as
Consider for example the matrix
which is positive semidefinite for values of
The set of semidefinite matrices is an open convex set, while the set of positive semi-definite is a closed convex set.
A symmetric matrix
We denote the set of all diagonally dominant matrices as
A symmetric matrix
We denote the set of all scaled diagonally dominant matrices as
Note
A relevant inclusion relationship between the cones of positive semidefinite matrices, diagonally dominant matrices, and scaled diagonally dominant matrices is
TODO
A multivariate polynomial
where
Equivalently, a polynomial
where
A polynomial
where
A polynomial
where
We can use the conic framework to rewrite several typical convex sets in terms of conic quadratic formulations. Here are some examples:
For a constraint
we can use the definition of the two-dimensional quadratic cone where
needs to hold. Consequently, the constraint on the absolute value can be rewritten as
In the standard definition of an
the right hand side of the inequality clearly provides the euclidian norm of
That makes it possible for us to rewrite the inequality
as
Consider Problem CQ01 from the Mosek Documentation:
which can be solved with CaΣoS using the High-level interface (sdpsol
).
We start off by defining
x = casadi.SX.sym('x',6);
sdp.x = x;
Now we can define the cost function with
sdp.f = x(4) + x(5) + x(6);
All constraints now need to be defined in a vector:
sdp.g = [
x(1) + x(2) + 2*x(3); % linear constraints come first
[x(4); x(1); x(2)]; % In quadratic cone
[x(5); x(6); x(3)]; % In rotated quadratic cone
]
where we need to define linear constraints first. Note that the right hand side of the linear constraint needs to be added using bounds:
lbg = 1;
ubg = 1;
The second row in sdp.g
stems from
This can be rewritten as a conic constraint
i.e. the
The third row describes the constraint
Since
Finally, we need to tell CaΣoS for each column of sdp.g
which cone should be used.
opts.Kc = struct('lin', 1, 'lor', 3, 'rot', 3);
Additionally, we need to define linear bounds to the decision variable
opts.Kx = struct('lin', 6);
lbx = [0;0;0;-inf;0;0];
ubx = inf(6, 1);
which now allows us to define the solver and obtain the solution
% solver
S = casos.sdpsol('S','mosek',sdp,opts)
% solution
sol = S('lbx',lbx,'ubx',ubx,'lbg',lbg,'ubg',ubg);
Complete code:
% example see
% https://docs.mosek.com/latest/toolbox/tutorial-cqo-shared.html
x = casadi.SX.sym('x',6);
sdp.x = x;
sdp.f = x(4) + x(5) +x (6);
sdp.g = [
x(1) + x(2) + 2*x(3);
[x(4); x(1);x(2)];
[x(5); x(6);x(3)];
];
% cones
opts.Kc = struct('lin', 1, 'lor', 3, 'rot', 3);
opts.Kx = struct('lin', 6);
% solver
S = casos.sdpsol('S','mosek',sdp,opts)
% bounds
lbx = [0;0;0;-inf;0;0];
ubx = inf(6, 1);
lbg = 1;
ubg = 1;
% solution
sol = S('lbx',lbx,'ubx',ubx,'lbg',lbg,'ubg',ubg);
- 1. Home
- 2. Polynomials
- 3. Polynomial Data Types (under construction)
- 4. Monomial Sparsity (under construction)
- 5. Polynomial Functions (under construction)
- 6. Matrix‐valued Polynomials (under construction)
- 7. Cones
- 8. Sum‐of‐squares Polynomials
- 9. Convex Optimization (under construction)
- 10. Sum‐of‐squares Optimization (under construction)
- 11. Practical SOS Guide