My propose is to get two approximate Hermite matrices S and V, which represent the covariance matrix of two variables.

The problem is as follows:

My code is as follows:

```
function [S,V,z]= solve_21(gamma,H)
P = 100;
[Nt,~,M] = size(H);
e = 0.1;
GammaE = 1;
alpha = log(e^(-1));
t1 = 1 + alpha + sqrt(2*alpha);
t2 = sqrt(2*alpha);
cvx_begin SDP quiet
variable neta
variable S_bar(Nt,Nt) hermitian semidefinite
variable V_bar(Nt,Nt) hermitian semidefinite
minimize( GammaE*t1*trace(S_bar) );
subject to
( neta + GammaE * (trace(V_bar) - t2 * norm(V_bar,'fro')) ) >= 1;
for m = 1:M
trace(S_bar * H(:,:,m)) >= gamma * ( trace(V_bar*H(:,:,m)) + neta);
end
trace(S_bar + V_bar) <= P*neta ;
S_bar >= 0;
V_bar >= 0;
neta >= 0;
cvx_end
S = S_bar / neta;
V = V_bar / neta;
z = GammaE * t1 * trace(S_bar);
```

In my settings, all the sigmas are 1, so sigma is omitted in the code. The code below are used togenerate additional parameters.

```
clear all;
M = 3;
Nt = 4;
H = [];
for m = 1:M
h(m,:) =1/sqrt(2*Nt)*( randn(1,Nt) + 1i* randn(1,Nt));
H(:,:,m) = h(m,:)'* h(m,:);
end
P = 10^(2);
e = 0.1;
sigma = 1;
sigma_e = 1;
GammaE = 1;
```

**I have a problem that the result doesn’t satisfy the constraint of the inequality.**

```
trace(S_bar * H(:,:,m)) - gamma * ( trace(V_bar*H(:,:,m)) + neta)
ans =
9.0576e-09 + 5.5511e-17i
```

**It can not satisfy the constrain of (21c)**.

I know the reason could be relevant to solver tolerance, so I changed the constrain condition,such as :" ( neta + GammaE * (trace(V_bar) - t2 * norm(V_bar,‘fro’)) ) >= 1.01;" and " trace(S_bar + V_bar) <= P*neta + 0.1;"

But it still can’t work, the result is even “NaN”.

I found there is a constrain error is because the result **z** should be smaller than gamma, But after the CVX calculation, z is 500+ when gamma is 70+.

I want to know that

- whether my code have something with it.
- how can I solve the solver tolerance problem.
- whether the question (22) is solvable.

Thank you !