# What can I do about the Disciplined convex programming error?

(Jie Sun) #1

I’m trying to solve a problem. The following is my code:
cvx_begin
variable w nonnegative;
variable x(n,1) complex;
minimize( norm(x,1) );
subject to
W_matrix(1:m,1:m) = w;
W_matrix(num1, = 1;
W_matrix = diag(diag(W_matrix));
norm(W_matrix*(y-A*x),2) <= u;
cvx_end
where w and x are variables, W_matrix is a diagonal matrix with 1 or w of the diagonal elements, y is a given vector with positive values, m and n is a given positive constant, num1 is a given positive array, A is a given matrix and u is a given positive value.

But it pop up this error massage:
Error using cvx/mtimes (line 126)
Disciplined convex programming error:
Only scalar quadratic forms can be specified in CVX
Error in test1w (line 71)
norm(W_matrix*(y-A*x),2) <= u;

(Mark L. Stone) #2

This is non-convex, because it involves the product of optimization variables. If W_matrix were not a CVX variable or expression, it would be a convex constraint which would be accepted by CVX.

(Jie Sun) #3

Thank you so much. If I want to solve this problem, what should I do or which toolbox could I use? Could you please give me some guidance?

(Mark L. Stone) #4

I don’t understand what your W_matrix really is - you seem to form it in an unusual manner. If you need to optimize over W_matrix, then you need a non-convex solver. If you are content with fixing a candidate W_matrix, you can numerically assign W_matrix in MATLAB, then solve for x using CVX.

(Jie Sun) #5

Actually W_matrix is a diagonal weighted matrix. I will try your method. Thank you so much.