Dear experts,
I am new with CVX and cannot understand the point:
Here is my original problem(about communication channel capacity):
I have to find the Best S(matrix) to maximize 𝑙𝑜𝑔|𝑰+𝑯𝑺𝑯^𝐻 |
subject to trace(GSG^𝐻)>=specific value (4.8933e-04W)
trace(S)<=1(transmit power W)
S>=0(semidefinite matrix)
(*G and H matrix are channels)

However, the result is Status: Unbounded
Optimal value (cvx_optval): +Inf
I feel very strange because I went to check this term trace(G_p3s_p3G_p3’) and found that this condition was not met(far less than the value I gave)
Ask the experts to help me,
Thanks!

You have not defined r, and p3*s_p3*H_p3' in the objective function is dimensionally inconsistent (non-conformal). Also, G_p3*s_p3*G_p3' in the constraint trace(G_p3*s_p3*G_p3') == 4.8933e-04 is dimensionally inconsistent (non-conformal)…

Try setting s_p3( outside of CVX to any 4 by 4 matrix. Then p3*s_p3*H_p3 and G_p3*s_p3*G_p3' need to be evaluable by MATLAB, i.e.,have conformal dimensions. If not, then toy CVX code will not work.

Thank you for your help, I set up r= min(nTx,nRx) and bandwidth = 1e7;
Here is my code:

clear % clear all variables in the workspace
close all % close all open figures
clc % clear command window
nRx = 4;
nTx = 4
r = min(nTx,nRx);
bandwidth = 1e7;
H_p3 = 1/sqrt(2)*sqrt(1e-4)*(randn(nRx,nTx)+1i*randn(nRx,nTx));
G_p3= (1/sqrt(2))*sqrt(1e-8)*(randn(nRx,nTx)+1i*randn(nRx,nTx));
s_p3 = randn(4);
cvx_begin
variable s_p3(4,4) semidefinite
maximize((log_det(eye(4)+H_p3*s_p3*H_p3'*1e10))*bandwidth )
subject to
trace(G_p3*s_p3*G_p3') == 4.8933e-04
trace(s_p3) <= 1%P
%s_p3>=0
cvx_end
cvx_optval

Sorry, I am currently running my code that G_p3s_p3G_p3 andtrace(G_p3s_p3G_p3’) is consistent,am I right?

I am new with CVX and cannot understand the point:

Then p3s_p3H_p3 and G_p3s_p3G_p3’ need to be evaluable by MATLAB

I don’t understand the meaning of this sentence, and how to do

Thank you so much!

(I don’t know why these line of code will be messed up,about multiply symbol
H_p3 = 1/sqrt(2)sqrt(1e-4)(randn(nRx,nTx)+1irandn(nRx,nTx));
G_p3= (1/sqrt(2))sqrt(1e-8)(randn(nRx,nTx)+1i*randn(nRx,nTx));
maximize((log_det(eye(4)+H_p3 s_p3 H_p3’ *1e10)) *bandwidth )
Please refer to my first code of G and H and maximize line)!

Your corrected code is accepted by CVX. But for all the random values I sued for H_p3 and G_p3, the problem was always (primal) infeasible.

Note that the statement s_p3 = randn(4);has no effect, because s_p3 is declared as a variable in CVX, and that supersedes (overwrites) whatever s_p3 consisted of before it was declared a variable in CVX.

Dear experts,
I probably understand what you mean.
But I am not sure how I want to change s_p3
variable s_p3 semidefinite
Is there a problem with this code?
My object is to find the best S(matrix) to maximize 𝑙𝑜𝑔|𝑰+𝑯𝑺𝑯^𝐻 |
subject to some constraints
Thank you so much

As I wrote,s_p3 is overwritten before it is used. So that code line does nothing. If you want to do something in this line of code, then you need to do something different that what you have done.

As for the infeasibility, there is no matrix which is simultaneously symmetric positive semidefinite and satisfies the tow trace constraints, at least for the random numbers I tried.

In order to assess feasibility, you can simplify things by eliminating the maximize statement. That way, CVX and the solver won;t have to deal with the complexities caused by logdet.

Dear experts,
I just want to set the s_p3 to a 4x4 matrix.
However, after I comment this line s_p3 = randn(4)
The status still Unbounded…
Can you give me some advise to run this code?

–edit
after I delete the maximize,here is the result

cvx: concave

Homogeneous problem detected; solution determined analytically.
Status: Solved
Optimal value (cvx_optval): +0

cvx_optval =

0

Next how can I try to find the maximum value?
Thank you so much

I don;t see how this code can result in Homogeneous problem detected; solution determined analytically. Perhaps the >= 4.8933e-4 could be satisfied within tolerance with s_p3 = zeros(4), if G_p3 is “small” enough, but I don;t think that would result in Homogeneous problem detected; solution determined analytically…

And there is more that you did than maximize. You changed the first trace constraint from == to >=.

Dear experts,
Yeh, I don’t get why this is Homogeneous problem…
I have tried the first trace constraint == and >=,but still not work
God, I don’t know how to maximize it…
Thank you very much

There is nothing to maximize unless your problem is feasible.You have now yet shown a reproducible problem which is feasible. You can not rely on randn in your code to provide a reproducible problem.

“Experts” on the forum can not reproduce your results unless we know which random numbers were used for H_p3 and G_p3 in the problem instance for which you are showing results.

Here is an example of how to post reproducible code for H_p3, even though originally using randn. Doing it this way ensures reproducibility, even though only 16 digits are displayed.

Alternatively, you could just display H_p3 in your “private” code, then post the code which reads it (back) in with the displayed digits, similarly to the above,

Dear experts,
Hello, I have been thinking about this for a long time, and asked my colleague to help me execute my program. The result was unexpected, the cvx program was executable. Have you ever encountered such a problem? Is it possible that I have installed fewer components?
Thank you so much

If you are getting different results than other installations, try removing all CVX directories (folders) from your MATLAB path, delete all CVX directories, then install a freshly downloaded copy of CVX 2.1.

Before you do that, what is the output from cvx_version ?

Hi, I am also solving a similar problem but I don’t know how to put the constraint, V(n,n) =0, where V is the optimization matrix of dimension 5. So I want each diagonal entry to be equal to unity.

diag(V) == 1
constrains all diagonal elements of V to 1.

If dimension n = 5, V(n,n) == 0 constrains only the 5,5 element of V to be 0. If you want the other diagonal elements to be 1, use diag(V(1:n-1,1:n-1)) == 1 instead of diag(V) == 1