Conic quadratic program

100 views
Skip to first unread message

wang lingyi

unread,
Sep 7, 2022, 8:03:22 AM9/7/22
to mosek
Hi,

I am using Mosek in Matlab to solve a conic quadratic program. And the problem description is attached as below. Before, I use the function " quadprog " in Mosek to solve the linearly constrained quadratic program. Now, I need to solve a conic quadratic program. However, when I am searching for the possible function that I should use, I found it is not as convenient and simple as quadprog. This is the link that I found  6.3 Conic Quadratic Optimization — MOSEK Optimization Toolbox for MATLAB 10.0.20  . And the code example in this link is not the same as my problem since the objective function above is linear in optimization variables. 

My question is, is there any tutorial ( including simple example code) which can be directly used in solving my problem attached below  in Matlab  ?
Problem.JPG

Erling D. Andersen

unread,
Sep 7, 2022, 8:13:11 AM9/7/22
to mosek
Maybe you should use something like Cvx if you do not want to spend time on learning how to use Mosek.

If you want to use Mosek, then do:

Step 1: Figure out to write the problem on the form on the top of


You may want to read the Mosek modeling cookbook if you do not know how to do that.

Step 2: Setup the problem on the right form required 

   mosekopt

That should be easy if you have done step 1.

wang lingyi

unread,
Sep 7, 2022, 9:00:23 AM9/7/22
to mosek
But the objective function of the example code in the above link is linear, the objective function of my problem is not linear. Can this link solve my problem?

Michal Adamaszek

unread,
Sep 7, 2022, 9:03:41 AM9/7/22
to mosek
minimize f(x)

is the same as

minimize z
subject to z>=f(x)

where z is a new variable. So any objective can be made linear. An example of this situation, somewhat similar to yours, is in https://docs.mosek.com/latest/toolbox/case-studies-regression.html#doc-case-studies-regression

wang lingyi

unread,
Sep 7, 2022, 9:08:20 AM9/7/22
to mosek
And what is the terminology of my optimization problem? I searched for the SOCP (second order cone program), however, the objective function of SOCP is linear. Apparently, the objective function of my optimization problem is not linear.

在2022年9月7日星期三 UTC+8 20:13:11<e.d.an...@mosek.com> 写道:

Michal Adamaszek

unread,
Sep 7, 2022, 9:11:19 AM9/7/22
to mosek
Yes, it can be reformulated as SOCP using the techniques from https://docs.mosek.com/modeling-cookbook/index.html

Erling D. Andersen

unread,
Sep 8, 2022, 3:04:51 AM9/8/22
to mosek
Here is a tiny bit of help.

For instance

sqrt(1^2+||x||^2) <= t

is identical

||[1;x]|| <=t

so you have to define F and f so that

F [t;x] + f =[t;1;x]

and then you say 

    F [t;x] + f in quadratic cone   (*)

Finally, you replace

   sqrt(1^2+||x||^2)

by

   t

in the objective while including (*) in your problem.

Yes, this requires some work and if you want to avoid that then use of Cvx.
 







Reply all
Reply to author
Forward
0 new messages