# Error using cvx/times: Invalid quadratic form(s): not a square

(Maîtrise en télécommunications) #1

Hello,

I am trying to solve this problem with CVX tool but I have one error that I can’t resolve.
My Matlab code is:

cvx_begin
variable alph
variable bet(M,1)
expression bett(M,M)
Bett = diag(bet);
variable u(M,1)
expression U(M,M)
%U = u*u’;
for i =1:M
for j=1:M
U(i,j) = conj(u(i))u(j);
end
end
expression ppp(M,1)
for i=1:M
ppp(i) = u(i)conj(u(i));
end
vv = sum(ppp);
minimize( alph
rho
mean(N) - sum(bet.*p.*g.*conj(g).l.conj(l)) )
subject to
alph
M
tho^2>=vv;
alph>=0;
u>=0;

BB = G + Bett - Ps*(alph*(hchc’) + U + uhc’ + hcu’);
for i=1:M
B = zeros(M,M);
B(i,i)=sqrt(N(i))/abs(g(i));
BB = BB + rho
B*(alphhchc’ + U + uhc’ + hcu’)*B;
end
BB >= 0;
bet > 0;
cvx_end

The error that keeps showing is:

Error using cvx/times (line 262)
Disciplined convex programming error:
Invalid quadratic form(s): not a square.

Error in cvx/mtimes (line 36)
z = feval( oper, x, y );

Error in robust (line 68)
U(i,j) = (u(i))*u(j);

I tried to define U element by element but it’s not working. Can you please help me figure this out I am out of solutions.

Thank you.

(Mark L. Stone) #2

`u(i)*u(j)` is an indefinite form. You can think of this as being `x*y` when both x and y are CVX (optimization) variables.

Is your problem convex? If so, how have you proven it? Why isn't CVX accepting my model? READ THIS FIRST!

(Maîtrise en télécommunications) #3

I am trying to implement an algorithm of an article that is not mine. But in the article, they say that the problem is convex. Plus, when I put U in as a comment, the rest of the algorithm works. I just needed the matrix U = u*u’ to be used in 1 of the constraints.

(Maîtrise en télécommunications) #4

If not, do you know a function that can produce u from U such as U = u*u’ ? and is it possible to use it with CVX? Thank you

(Mark L. Stone) #5

`u'*u` is fine, `u*u'` is not fine.

Does the article provide a proof of convexity? If the problem is convex, it may or may not be representable by CVX. Although I know nothing about this paper, I will say that not all claims in all papers are correct.

If it is convex, perhaps there is some rearrangement (reformulation) get it into a form which can be accepted by CVX.

(Maîtrise en télécommunications) #6

Can I send you the article so you can help me figure out the problem if you have time?

(Mark L. Stone) #7

I think it is incumbent on you to read the article and figure it out.