CVX, Matlab and linear cone programming


Hi everyone,

I am new at CVX and I guess I have a very basic problem. However, its driving me crazy:

I am trying to solve a linear cone program in Matlab. I read through the basics and the users guide. However, I couldn’t find any advanced ->Matlab<- examples that helped me. So here are some basic questions:

  1. The advanced examples from the users guide (e.g. are all in Python code, am I right?
  2. How do I write a linear cone problem in CVX using Matlab? All Matlab code I could find looked like:
    variable …
    minimize …
    subject to …
    Is this really all I can/need to do? Reading the phyton examples it seems like there is so much more I can specify. I mean, how can I describe the cone? Do I need to write down both primal and dual problem in matlab or is the dual automatically constructed? How does cvx know that this is a linear cone problem? (In the Python code “conelp” is called explicitly.)

Basically: I understand the basic examples from the introduction, but I totally don’t get how to do the “advanced” stuff in Matlab?

(Mark L. Stone) #2

cvxopt is a different program than CVX. Ignore the cvxopt docuimentation if you want to use CVX.

You have provided the basic outline for CVX programs (there are some other optional things such as expressions). Just fill in the details for your problem per the CVX Users’ Guide and CVX examples, not cvxopt documentation.

Provide a primal or dual formulation, and CVX will handle it. If you have a semidefinite constraint, then specify it per the Users’ Guide ( == semidefinite(n) .or >= 0 if using sdp mode). Second order cone constraints can be entered in any way which follows CVX’s rules. CVX takes care of converting the problem into a standard form which the solvers can handle.

(Michael C. Grant) #3

Indeed, I’m afraid the “cvx” abbreviation is a bit overused, leading to the confusion. CVX has nothing whatsoever to do with the Python packages CVXOPT or CVXPY, except that their developers are colleagues :wink:


Uh, lol… That actually explains a lot! :smiley: Thanks!

I’ll give cvx a try then :slight_smile: