# New person seeking help：Only scalar quadratic forms can be specified in CVX

Hello dears,
If someone has an idea about how to handle this.

``````cvx_begin
cvx_precision low
variable W(N, K) complex
.....(Some code is omitted here)
R_sum =0;
for k = 1:K
temp1(k) =real( 2*alpha*sqrt(1+tau_ini(k))*omega_ini(k)*h_H(k,:)*W(:, k));
temp2(k) = abs(omega_ini(k))^2*abs(alpha)^2*real(temp2_0);
temp3(k) = abs(omega_ini(k))^2*alpha*(1-alpha)*real( h_H(k,:)*diag(diag(W*W'))*h_H(k,:)');
R_sum =  R_sum + temp1(k) - temp2(k)  - temp3(k)  ;
end
.....(Some code is omitted here)
``````

Only scalar quadratic forms can be specified in CVX ：This error appears in temp3(k).
I guess it’s probably because W*W’ is not convex that’s causing this problem. But how do I write it without making mistakes?
thanks

Have you proven this is a convex optimization model? I don’t know for sure that it isn’t because I don’t know how `temp3 is used in the model.

Thanks for your kind reply, more details are as follows,
formula(This is my objective, I want to maxmize it):

code:

``````variable W(N, K) complex
for k = 1:K
f_H(k,:) = H_IU_H(k,:)*Theta_ini*G;
h_H(k,:) =  H_BU_H(k,:)+f_H(k,:);
end
temp2_0 = 0;
for k = 1:K
temp2_0_0 (k) = square_pos(norm(h_H(k,:)*W(:,k)));
temp2_0 = temp2_0 + temp2_0_0 (k);
end
R_sum =0;
for k = 1:K
temp1(k) =real( 2*alpha*sqrt(1+tau_ini(k))*omega_ini(k)*h_H(k,:)*W(:, k));
temp2(k) = abs(omega_ini(k))^2*abs(alpha)^2*real(temp2_0);
temp3(k) = abs(omega_ini(k))^2*alpha*(1-alpha)*real( h_H(k,:)*diag(diag(W*W'))*h_H(k,:)');
R_sum =  R_sum + temp1(k) - temp2(k)  - temp3(k)  ;
end
``````

Maybe I need to reformulate temp3 to make CVX accept him.

Have you proven that objective function is concave?

Yes, I think that objective function is concave. (temp2_0_0 (k) use square_pos to make it correct, I think temp3(k) may be similar?)

“Thinking” in the form expressed here does not constitute an adequate proof. Please re-read the link.

Thank you very much, Mark, I will re-read the link.