The user base for CVX has grown to such an extent that full email-based support is no longer feasible for our free version of CVX. Therefore, we have created several avenues for obtaining support.
For help on how to use CVX, this users’ guide is your first line of support. Please make sure that you have attempted to find an answer to your question here before you pursue other avenues. We have placed this document online and made it searchable in order to help you find the answers to the questions you may have.
With a package like CVX that encapsulates such mathematical complexity, it can sometimes be unclear if a problem with a model is due to model formulation or a bug in CVX. See What is a bug? below to help you discern the difference, and to determine the most appropriate channel for support.
If your answers cannot be found here, consider posting your question to the CVX Forum. This is a community forum that allows our users to submit questions and to answer other people’s questions. The forum uses the open-source Askbot system, and its format should be familiar to anyone who participates in OR-Exchange, Stack Overflow, or any one of the Stack Exchange family of sites.
We highly encourage our expert users who enjoy helping others to participate in this forum. We hope that it will not only serve as a resource for diagnosing problems and issues, but a clearinghouse for advanced usage tips and tricks.
If you believe you have found a bug in CVX or in one of the underlying solvers, then we encourage you to submit a bug report—either by email to to cvx@cvxr.com or through our web-based support portal. Please include the following in your bug report so we can fully reproduce the problem:
The easiest way to supply items 3-5 is to type cvx_version at the command prompt and copy its output into your email message.
Please note that we do not own all of Matlab’s toolboxes. We cannot debug a model that employs functions from a toolbox we do not own.
Certain issues are unambiguously bugs, and you should feel free to report them immediately. In particular, CVX often attempts to catch unexpected errors in key places—including cvx_setup, cvx_end, etc. It will report those errors and instruct you to report them to us. If your model produces a MATLAB error that CVX did not itself generate, and you cannot readily tie it to a syntax error in your model, please report that as well.
That said, because disciplined convex programming is a new concept for many, we often receive support requests for problems with their models that are not, in fact, bugs. A particularly common class of support requests are reports of models being rejected due to Disciplined convex programming error messages. For instance, the following code
variable x(10)
norm(x) == 1
will produce this error in CVX:
Error using cvxprob/newcnstr (line 181)
Disciplined convex programming error:
Invalid constraint: {convex} == {real constant}
Disciplined convex programming errors indicate that the model fails to adhere to the rules in the DCP ruleset. In nearly all cases, this is not a bug, and should not be reported as such. Rather, the underlying issue falls into one of two categories:
The model is not convex (mixed-integer or otherwise). A model with the nonlinear equation above would fall squarely in this category. CVX simply cannot solve such problems. In some cases, it is possible to transform a problem that is non-convex into one that is convex (for example, geometric programs). This has not been the case for any problem submitted by our users—so far.
The model is convex, but it is still written in a manner that violates the rules. For instance, given the same vector x above, the constraint
sqrt( sum( square( x ) ) ) <= 1
is convex, but it violates the ruleset—so it is rejected. However, the mathematically equivalent form
norm( x ) <= 1
is acceptable. If your error is of this type, you will need to find a way to express your problem in a DCP-compliant manner. We have attempted to supply all of the commonly used functions that the underlying solvers can support; so if you cannot easily rewrite your problem using the functions supplied, it may not be possible. If you think this is a possibility, you may wish to see if the wizards on the CVX Forum have suggestions for you.
In rare cases, users have discovered that certain models were rejected with Disciplined convex programming error messages even though they satisfied the DCP ruleset. We have not received a bug report of this type in quite a long time, however, so we suspect our users have helped us iron out these issues.
No developer likes to tell their customers that their software may not work for them. Alas, we have no choice. The fact is that we cannot guarantee that CVX will be able to solve your problem, even if it is formulated properly, even if it avoids the use of integer or binary variables, even if it is of reasonable size, even if it avoids the use of our experimental exponential cone support.
We blame the solvers—but we must come to their defense, too. Even the best and most mature solvers will struggle with a particular problem that seems straightforward. Another solver may have no difficulty with that one, but fail to find an accurate solution on another. While sometimes these challenges are due to bugs in the solver’s implementation, quite often it is simply due to limits imposed by the nature of finite numerical precision computation. And different problems push those limits to different degrees. So the fact is that no solver is perfect, but no solver can be.
When we consider mixed-integer problems, the situation is even worse. Solvers must perform what is effectively an exhaustive search among the integer variables to determine the correct solution. Yes, there are some intelligent and innovative ways to speed up that search, and the performance of mixed-integer solvers has improved dramatically over the years. But there will always be models for which the exhaustive search will simply take too long.
None of this is much comfort if it is your model the solver is struggling with. Here are some practical tips if you encounter this problem:
Paid CVX Professional users will receive support through a trouble-ticket support system, so that they can have confidence that their issues are being addressed promptly. This infrastructure is still under development; we will update this section and the Web site with more information once it has been completed.