My aim is to optimize R. However, when i want to limit R>0, there’re some wrong, which is

**Disciplined convex programming error:**

** Invalid constraint: {complex affine} <= {constant}**

I don’t know how to solve this problem. My code is as follows.

clc;clear;clear all;

% M0 = 20; %hole free 20 N1+N2+N2*(N1-1)

N = 100;

theta = -60:15:60;

K = length(theta);

%NESTED ARRAY

N1 = 4;

N2 = 4;

M0 = N2*(N1+1);

S_nested(1,1:N1) = 1:1:N1;

S_nested(1,N1+1:N1+N2) = N1+1:N1+1:N2*(N1+1); %N1+N2

S_nested = S_nested-1;

M = length(S_nested);

A = exp(1i*pi*S_nested.‘*sin(theta*pi/180)); %sqrt(1/M)

I = eye(M0);

S = I(S_nested+1,:); %R = S*R0*S.’

%S = I(S_nested+(M0+1)/2,:);

snr = 20;

s = randn(K,N);

x = A*s;
y = awgn(x,snr,‘measured’);
R_real = 1/N*(y

*y’);*

z = (mysign(real(y))+1imysign(imag(y)))./sqrt(2); %sqrt(0.5)

z = (mysign(real(y))+1i

*real(y)+1i*sqrt(0.5)*imag(y)

L = zeros(M0,M,M);

for i = 1:M0

for m = 1:M

for n= 1:M

if S_nested(m)-S_nested(n) == i-1 %hole-free

L(i,m,n) = 1;

end

end

end

end

cvx_solver sdpt3

cvx_begin

cvx_precision low

variable u(M0,1) complex

variable Y(M,N) complex

variable X(M,M) complex hermitian

variable Ww(M,M) complex hermitian

variable T(M,M) complex hermitian

variable FAI(M,M) complex hermitian

R = u(1)*reshape(L(1,:,:),M,M);

for i = 2:M0

R = R+u(i)*reshape(L(i,:,:),M,M)+u(i)‘*reshape(L(i,:,:),M,M).’;
end
minimize trace(X)+trace(Ww)
subject to
R == semidefinite(M);
[X,eye(M);eye(M),Ww] == semidefinite(2*M);

real(z(:)).

*real(Y(:)) >= 0;*

imag(z(:)).

[eye(M),FAI;FAI,R] == semidefinite(2M);

imag(z(:)).

*imag(Y(:)) >= 0;*

[T,FAI;FAI,X] == semidefinite(2M);[T,FAI;FAI,X] == semidefinite(2

[eye(M),FAI;FAI,R] == semidefinite(2

[eye(N),Y’;Y,T] == semidefinite(M+N);

cvx_end

obj1 = trace(X)+trace(Ww);

[E1,D1] = eig([T,FAI;FAI,X]);

[~,S1] = sort(diag(D1));

V = E1(:,S1(1:M));

[E2,D2] = eig([eye(M),FAI;FAI,R]);

[~,S2] = sort(diag(D2));

F = E2(:,S2(1:M));

[E3,D3] = eig([eye(N),Y’;Y,T]);

[~,S3] = sort(diag(D3));

G = E3(:,S3(1:M));

epsilon1 = 5e-5;

epsilon2 = 1e-7;

w = 10;

e1 = 1 ;

err = 1;

t = 1.5;

while (e1 >= epsilon1) || (err >= epsilon2)

% for k = 1:3

cvx_solver sdpt3

cvx_begin

cvx_precision low

variable u(M0,1) complex

variable Y(M,N) complex

variable X(M,M) complex hermitian

variable Ww(M,M) complex hermitian

variable T(M,M) complex hermitian

variable FAI(M,M) complex hermitian

variable e2

R = u(1)*reshape(L(1,:,:),M,M);
for i = 2:M0
R = R+u(i)*eye(M)-V’

*reshape(L(i,:,:),M,M)+u(i)'*M); real(z(:)).

*reshape(L(i,:,:),M,M).’; end minimize trace(X)+trace(Ww)+w*e2 subject to R > 0; [X,eye(M);eye(M),Ww] == semidefinite(2*real(Y(:)) >= 0; imag(z(:)).*M); [eye(N),Y’;Y,T] == semidefinite(M+N); e2

*imag(Y(:)) >= 0; [T,FAI;FAI,X] == semidefinite(2*M); [eye(M),FAI;FAI,R] == semidefinite(2*[T,FAI;FAI,X]*[eye(M),FAI;FAI,R]

*V == semidefinite(M);*

e2eye(M)-F’e2

*F == semidefinite(M);*

e2eye(M)-G’*[eye(N),Y’;Y,T]*G == semidefinite(M);

e2

e2 < e1;

cvx_end

obj2 = trace(X)+trace(Ww);

e1 = e2;

```
[E1,D1] = eig([T,FAI;FAI,X]);
[~,S1] = sort(diag(D1));
V = E1(:,S1(1:M));
[E2,D2] = eig([eye(M),FAI;FAI,R]);
[~,S2] = sort(diag(D2));
F = E2(:,S2(1:M));
[E3,D3] = eig([eye(N),Y';Y,T]);
[~,S3] = sort(diag(D3));
G = E3(:,S3(1:M));
err = abs(obj1-obj2);
obj1 = obj2;
w = t*w;
```

end