Cannot perform the operation: {mixed real affine/complex affine} ./ {real affine}

cvx_begin
    variable W(M,M,K) complex hermitian;
    variable wk;
    variables t(K) u(K);
    variable beta0;                             
    expressions xi lambda tau;

    %-------C12-------------     
    xi=1;                         %ξPower amplifier efficiency
    lambda>0;
    tau>=lambda*Pc;
    tau<=lambda*(Pmax+Pc);    %τ
    %-------C1:W,1-K sum---------
    Wkk=0;
    for kk=1:K 
            Wkk=Wkk+W(:,:,kk);
    end
    %------W:k+1-K sum-------  
    Wi=0;
    i=1;
    for k=1:K
        if i<=K
            Wi=Wi+W(:,:,i);
        end
        Wk=W(:,:,k);
    end
    dk1=sqrt((deltaH^2)*chi2inv(0.5,2*M*N))*(1/2);   %1*1
    dk2=sqrt((deltaH^2)*chi2inv(0.5,2*M*N))^(1/2);    
    Qk1=kron((Wk/gamma_tar-Wi)',THETA0);      %(M*N+M)*(M*N+M)
    Qk2=kron((Wk/beta0-Wi)',THETA0);

up there is part of my code, every time I run this would be stuck at Qk2 and display this:Disciplined convex programming error:
** Cannot perform the operation: {mixed real**
** affine/complex affine} ./ {real affine}**
but Qk1 is fine, I don’t know how to deal with it.

1 Like

I don’t know why Qk1 is not also producing an error message. Apparently, because of `

disp((Wk/gamma_tar-Wi)')
cvx zero expression (scalar)

But I don’t understand why that is happening.

Anyhow, have you proven your optimization problem is convex?

Thanks for your patient reply. After I asked this question I checked my code, and found that I defined beta0 in Qk2 as a variable. Actually, it not really a optimization variable but a variable that need iteration method to find out. And I solved it.