CVX: Matlab Software for Disciplined Convex Programming

Version 1.21 (April 2011, Build 808)
by Michael Grant and Stephen Boyd

Introduction

CVX is a Matlab-based modeling system for convex optimization. CVX turns Matlab into a modeling language, allowing constraints and objectives to be specified using standard Matlab expression syntax. For example, the following code segment randomly generates a constrained norm minimization problem, and solves it:

m = 20; n = 10; p = 4;
A = randn(m,n); b = randn(m,1);
C = randn(p,n); d = randn(p,1);
cvx_begin
    variable x(n)
    minimize( norm( A * x - b, 2 ) )
    subject to
        C * x == d;
        norm( x, Inf ) <= 0.4;
cvx_end

In its default mode, CVX supports a particular approach to convex optimization that we call disciplined convex programming. Under this approach, convex functions and sets are built up from a small set of rules from convex analysis, starting from a base library of convex functions and sets. Constraints and objectives that are expressed using these rules are automatically transformed to a canonical form and solved. For more information on disciplined convex programming, see these resources; for the basics of convex analysis and convex optimization, see the book Convex Optimization.

CVX also supports geometric programming (GP) through the use of a special GP mode. Geometric programs are not convex, but can be made so by applying a certain transformation. In this mode, CVX allows GPs to be constructed in their native, nonconvex form, transforms them automatically to a solvable convex form, and translates the numerical results back to the original problem.

More information about CVX can be found in the CVX Users’ Guide (pdf, 348KB).

The CVX package includes a growing library of examples to help get you started, including examples from the book Convex Optimization and from a variety of applications. You can browse through this library now — without having to download and install CVX — by clicking here.

CVX was designed designed by Michael Grant and Stephen Boyd, with input from Yinyu Ye. The original version was developed and hosted at Stanford University. Since Michael's departure from Stanford, the software has undergone significant revision and improvement, and is now hosted at CVX Research, Michael's professional web site.

Latest news

Welcome to the new CVX home page!

As you can see, the CVX web site has a new address and a different look. The layout of the site is roughly the same, though, so you shouldn't get lost. The redirection from the old Stanford site should persist indefinitely.

SDPT3 no longer supported for older versions of MATLAB

The author of SDPT3 has discontinued support for MATLAB 7.2 and earlier, so we must do so as well. SeDuMi still works with these older platforms, but if you need to use SDPT3, you must upgrade to MATLAB 7.3 or later.

Matlab R12.1 (6.1) support discontinued

As previously announced, we are discontinuing support for Matlab 6.1. We received no feedback indicating this would be an issue for users; but if it is, please let us know, and we can suggest alternatives. CVX still works with Matlab version R13 (6.5.2).

Fuller support for 64-bit platforms

CVX version 1.2 now supports 64-bit versions of Matlab on Windows, Linux, and Macintosh platforms; precompiled MEX files are supplied for each of these platforms. Previously, only SDPT3 was supported on 64-bit platforms; now SeDuMi is as well. However, due to the evolution of Matlab's MEX API, Matlab version 7.3 or later is required for 64-bit platforms; and SeDuMi requires version 7.5 or later. (Earlier versions of Matlab are still supported for 32-bit platforms.)

Support for the exponential family of functions

CVX version 1.2 now supports problems involving exponentials, logarithms, and entropy functions! A novel successive approximation approach has been developed to facilitate this improvement. Please see the user's guide for more details.