one error,ask for help


(Paggy) #1

cvx_begin
variables g aphPtotal
variable S(theta_len) complex
minimize g;
subject to
Zk = r-B*S;
norm(Zk) <= g;
Sumvector’*S <= aphPtotal;
for i=1:theta_len
S(i,:)>=0;
end
cvx_end

Error using cvxprob/newcnstr (line 192)
Disciplined convex programming error:
Invalid constraint: {complex affine} <= {real affine}

Error in <= (line 21)
b = newcnstr( evalin( ‘caller’, ‘cvx_problem’, ‘[]’ ), x, y, ‘<=’ );

Error in l2_SVD (line 60)
Sumvector’*S <= aphPtotal;


(Mark L. Stone) #2

Per http://cvxr.com/cvx/doc/dcp.html#constraints

nequality constraints, on the other hand, must be real.

S is declared complex, so Sumvector’*S is complex, which therefore can’'t be in an inequality constraint… Hence the error. I don’t know how the code should be changed because I don’t know what your model is supposed to be.

If the program made it to S(i,:) >= 0;the same error message would be generated. Note that instead of using a for loop, you could more simply write this without a for loop as S >= 0 . But that would also generate the same error message.