norm(M,inf) <= power/Nt;

Nt = 9;
Nr = 9;
K = 4;
L = 20;
power = 10^(0/10);
fc = 10;
B = 10;
Tp = 2;
rou = 0.3;
H = (randn(Nt,K)+j*randn(Nt,K))/sqrt(2);
N_pbits = 2*K*L;
msg_bits = randi([0,1],1,N_pbits);
QPSK_table = [1+j -1+j 1-j -1-j]/sqrt(2);
for ii=1:length(msg_bits)/2
    temp=2*msg_bits(ii*2-1)+msg_bits(ii*2);
    QPSK_symbols(ii)=QPSK_table(temp+1);
end
Y = reshape(QPSK_symbols,[K,L]);%产生星座符号矩阵
X0 = chirp_generator( Nt,fc,Tp,B );
p1 = sqrt(rou);%根号rou 
p2 = sqrt(1-rou);
at = [1;exp(-j*pi/2);exp(-j*pi);exp(-j*pi*3/2);exp(-j*pi*2);exp(-j*pi*5/2);exp(-j*pi*3);exp(-j*pi*7/2);exp(-j*pi*4)]';
ar = [0,-j*pi*at(2)*sqrt(3)/2,-j*pi*at(3)*sqrt(3),-j*pi*at(4)*3/2*sqrt(3),-j*pi*at(5)*2*sqrt(3),-j*pi*at(6)*5/2*sqrt(3),-j*pi*at(7)*3*sqrt(3),-j*pi*at(8)*7/2*sqrt(3),-j*pi*at(9)*4*sqrt(3)].';
s = j*sqrt((1-rou)*1/3);
aj = ar*at;
B = [p1*H,s*aj].';%eye函数表示对角元素为1,其余全为零的N*N矩阵;.'表示一般转置
C = [p1*sqrt(power)*Y;zeros(Nr,L)];%根号power*Y=S的转置,X_arbi等于参考波形X0的转置
A1 = diag([ones(1,Nt*L),1]);
A3 = zeros(Nt*L+1,Nt*L+1);
A3(Nt*L+1,Nt*L+1)=1;
temp1 = kron(eye(L),B);
F = [temp1'*temp1,-temp1'*vec(C);-vec(C)'*temp1,vec(C)'*vec(C)];  
cvx_begin sdp 
    variable M(Nt*L+1,Nt*L+1) hermitian
    minimize(real(trace(F*M)));
    subject to
        trace(A1*M) == L*power+1;
        norm(M,inf) <= power/Nt;
    M == hermitian_semidefinite(Nt*L+1);
cvx_end
[V,D] = eig(M);
[value,num] = max(diag(D));
x = sqrt(value)*V(:,num);
X = reshape(x(1:Nt*L),Nt,L);

I want to know in the cvx constraints norm(M,inf) <= power/Nt; ,I think this constraint is convex. but it doesn’t work.

What exactly do you mean by “it doesn’t work”? What is the problem?

norm(M,inf) <= power/Nt; this constraint in the cvx is ok?


I don’t know how to deal with it

if you don’t know what I say .you can run it .it is a completed code

I don’t have chirp_generator, so can’t reproduce this.

The constraint norm(M,inf) <= power/Nt; is convex and accepted by CVX.

As for the error you encountered, it looks like either a bug or a screwed up installation or MATLAB session.

Things you can try.:
Try a different solver.
Try a new MATLAB session.
Reinstall CVX (make sure it is CVX 2.2).

Nt = 9;
Nr = 9;
K = 4;
L = 20;
power = 10^(0/10);
fc = 10;
B = 10;
Tp = 2;
rou = 0.3;
H = (randn(Nt,K)+j*randn(Nt,K))/sqrt(2);
N_pbits = 2*K*L;
msg_bits = randi([0,1],1,N_pbits);
QPSK_table = [1+j -1+j 1-j -1-j]/sqrt(2);
for ii=1:length(msg_bits)/2
    temp=2*msg_bits(ii*2-1)+msg_bits(ii*2);
    QPSK_symbols(ii)=QPSK_table(temp+1);
end
Y = reshape(QPSK_symbols,[K,L]);%产生星座符号矩阵
u = B/Tp;
fs = B;
sp_num = fs*Tp;
t = linspace(0,Tp,sp_num);
for ii = 1:Nt
     X0(ii,:) = exp(j*2*pi*10*ii*fc*(t-1)).*exp(j*pi*u*(t-1).^2);
end
p1 = sqrt(rou);%根号rou 
p2 = sqrt(1-rou);
at = [1;exp(-j*pi/2);exp(-j*pi);exp(-j*pi*3/2);exp(-j*pi*2);exp(-j*pi*5/2);exp(-j*pi*3);exp(-j*pi*7/2);exp(-j*pi*4)]';
ar = [0,-j*pi*at(2)*sqrt(3)/2,-j*pi*at(3)*sqrt(3),-j*pi*at(4)*3/2*sqrt(3),-j*pi*at(5)*2*sqrt(3),-j*pi*at(6)*5/2*sqrt(3),-j*pi*at(7)*3*sqrt(3),-j*pi*at(8)*7/2*sqrt(3),-j*pi*at(9)*4*sqrt(3)].';
s = j*sqrt((1-rou)*1/3);
aj = ar*at;
B = [p1*H,s*aj].';%eye函数表示对角元素为1,其余全为零的N*N矩阵;.'表示一般转置
C = [p1*sqrt(power)*Y;zeros(Nr,L)];%根号power*Y=S的转置,X_arbi等于参考波形X0的转置
A1 = diag([ones(1,Nt*L),1]);
A3 = zeros(Nt*L+1,Nt*L+1);
A3(Nt*L+1,Nt*L+1)=1;
temp1 = kron(eye(L),B);
F = [temp1'*temp1,-temp1'*vec(C);-vec(C)'*temp1,vec(C)'*vec(C)];  
cvx_begin sdp 
cvx_solver mosek
    variable M(Nt*L+1,Nt*L+1) hermitian
    
    minimize(real(trace(F*M)));
    subject to
        norm(M,inf) <= power/Nt;
        trace(A1*M) == L*power+1;
        %trace(A3*M) <= power/Nt; 
    M == hermitian_semidefinite(Nt*L+1);
cvx_end
[V,D] = eig(M);
[value,num] = max(diag(D));
x = sqrt(value)*V(:,num);
X = reshape(x(1:Nt*L),Nt,L);

that is all my code,this time you can run it again.I can’t find any question .but it can’t work.

It made it through Mosek iteration 3 before my computer crashed from overheating.

Calling Mosek 10.0.20: 131045 variables, 65523 equality constraints
------------------------------------------------------------

MOSEK Version 10.0.25 (Build date: 2022-10-6 10:58:19)
Copyright (c) MOSEK ApS, Denmark WWW: mosek.com
Platform: Windows/64-X86

Problem
  Name                   :                 
  Objective sense        : minimize        
  Type                   : CONIC (conic optimization problem)
  Constraints            : 65523           
  Affine conic cons.     : 0               
  Disjunctive cons.      : 0               
  Cones                  : 32761           
  Scalar variables       : 98284           
  Matrix variables       : 1               
  Integer variables      : 0               

Optimizer started.
Presolve started.
Linear dependency checker started.
Linear dependency checker terminated.
Eliminator started.
Freed constraints in eliminator : 0
Eliminator terminated.
Eliminator started.
Freed constraints in eliminator : 0
Eliminator terminated.
Eliminator - tries                  : 2                 time                   : 0.00            
Lin. dep.  - tries                  : 1                 time                   : 0.05            
Lin. dep.  - number                 : 0               
Presolve terminated. Time: 0.31    
GP based matrix reordering started.
GP based matrix reordering terminated.
Problem
  Name                   :                 
  Objective sense        : minimize        
  Type                   : CONIC (conic optimization problem)
  Constraints            : 65523           
  Affine conic cons.     : 0               
  Disjunctive cons.      : 0               
  Cones                  : 32761           
  Scalar variables       : 98284           
  Matrix variables       : 1               
  Integer variables      : 0               

Optimizer  - threads                : 8               
Optimizer  - solved problem         : the primal      
Optimizer  - Constraints            : 65523
Optimizer  - Cones                  : 32761
Optimizer  - Scalar variables       : 98103             conic                  : 98102           
Optimizer  - Semi-definite variables: 1                 scalarized             : 65703           
Factor     - setup time             : 562.37            dense det. time        : 164.33          
Factor     - ML order time          : 29.78             GP order time          : 285.53          
Factor     - nonzeros before factor : 5.37e+08          after factor           : 5.41e+08        
Factor     - dense dim.             : 0                 flops                  : 1.18e+13        
ITE PFEAS    DFEAS    GFEAS    PRSTATUS   POBJ              DOBJ              MU       TIME  
0   1.8e+02  1.7e+03  1.0e+00  0.00e+00   0.000000000e+00   0.000000000e+00   1.0e+00  563.02
1   1.8e+02  1.7e+03  9.8e-01  -1.00e+00  -2.020061019e+01  -2.016870715e+01  9.7e-01  735.64
2   1.2e-01  1.1e+00  2.5e-02  -1.00e+00  -6.241548515e+04  -6.092298588e+04  6.4e-04  905.02
3   3.0e-02  2.9e-01  2.6e-03  1.57e+00   -1.264478427e+04  -1.240647635e+04  1.7e-04  1072.26

so what’s the real reason?

I have no idea what your error message means. Do the Chinese message provide any information? Does the error trace pertain to Mosek? Did the Mosek solver produce any output?

The problem was being solved on my machine. But the problem was very taxing for my machine and it overheated. perhaps @Michal_Adamaszek can run it on a better machine and see what happens.

I am not going to re-run it because I already lost some important work, and don’t want to do that again.

for the constraints norm(M,inf) <= power/Nt; I can only use the main diagonal element is ok.I want to ask the norm(diag(M),inf)<= power/Nt; is convex?

Yes. norm of an affine function <= constant is convex.

    Nt = 9;
    Nr = 9;
    K = 4;
    L = 20;
    power = 10^(0/10);
    fc = 10;
    B = 10;
    Tp = 2;
    rou = 0.3;
    H = (randn(Nt,K)+j*randn(Nt,K))/sqrt(2);
    N_pbits = 2*K*L;
    msg_bits = randi([0,1],1,N_pbits);
    QPSK_table = [1+j -1+j 1-j -1-j]/sqrt(2);
    for ii=1:length(msg_bits)/2
        temp=2*msg_bits(ii*2-1)+msg_bits(ii*2);
        QPSK_symbols(ii)=QPSK_table(temp+1);
    end
    Y = reshape(QPSK_symbols,[K,L]);%产生星座符号矩阵
    u = B/Tp;
    fs = B;
    sp_num = fs*Tp;
    t = linspace(0,Tp,sp_num);
    for ii = 1:Nt
         X0(ii,:) = exp(j*2*pi*10*ii*fc*(t-1)).*exp(j*pi*u*(t-1).^2);
    end
    p1 = sqrt(rou);%根号rou 
    p2 = sqrt(1-rou);
    at = [1;exp(-j*pi/2);exp(-j*pi);exp(-j*pi*3/2);exp(-j*pi*2);exp(-j*pi*5/2);exp(-j*pi*3);exp(-j*pi*7/2);exp(-j*pi*4)]';
    ar = [0,-j*pi*at(2)*sqrt(3)/2,-j*pi*at(3)*sqrt(3),-j*pi*at(4)*3/2*sqrt(3),-j*pi*at(5)*2*sqrt(3),-j*pi*at(6)*5/2*sqrt(3),-j*pi*at(7)*3*sqrt(3),-j*pi*at(8)*7/2*sqrt(3),-j*pi*at(9)*4*sqrt(3)].';
    s = j*sqrt((1-rou)*1/3);
    aj = ar*at;
    B = [p1*H,s*aj].';%eye函数表示对角元素为1,其余全为零的N*N矩阵;.'表示一般转置
    C = [p1*sqrt(power)*Y;zeros(Nr,L)];%根号power*Y=S的转置,X_arbi等于参考波形X0的转置
    A1 = diag([ones(1,Nt*L),1]);
    A3 = zeros(Nt*L+1,Nt*L+1);
    A3(Nt*L+1,Nt*L+1)=1;
    temp1 = kron(eye(L),B);
    F = [temp1'*temp1,-temp1'*vec(C);-vec(C)'*temp1,vec(C)'*vec(C)];  
    cvx_begin sdp 
    cvx_solver mosek
        variable M(Nt*L+1,Nt*L+1) hermitian
        minimize(real(trace(F*M)));
        subject to
            norm(diag(M),inf) <= power/Nt;
            trace(A1*M) == L*power+1;
            %trace(A3*M) <= power/Nt; 
        M == hermitian_semidefinite(Nt*L+1);
    cvx_end
    [V,D] = eig(M);
    [value,num] = max(diag(D));
    x = sqrt(value)*V(:,num);
    X = reshape(x(1:Nt*L),Nt,L);

but I replace the constraints norm(M,inf) <= power/Nt; with norm(diag(M),inf) <= power/Nt;the solution becomes infeasible.can you run it and help me find the reason?Thank you very much!

Calling Mosek 9.1.9: 33305 variables, 363 equality constraints
------------------------------------------------------------

MOSEK Version 9.1.9 (Build date: 2019-11-21 11:34:40)
Copyright (c) MOSEK ApS, Denmark. WWW: mosek.com
Platform: Windows/64-X86

Problem
  Name                   :                 
  Objective sense        : min             
  Type                   : CONIC (conic optimization problem)
  Constraints            : 363             
  Cones                  : 181             
  Scalar variables       : 544             
  Matrix variables       : 1               
  Integer variables      : 0               

Optimizer started.
Presolve started.
Eliminator - tries                  : 0                 time                   : 0.00            
Lin. dep.  - tries                  : 0                 time                   : 0.00            
Lin. dep.  - number                 : 0               
Presolve terminated. Time: 0.01    
Optimizer terminated. Time: 0.06    


Interior-point solution summary
  Problem status  : PRIMAL_INFEASIBLE
  Solution status : PRIMAL_INFEASIBLE_CER
  Dual.    obj: 8.8888888889e-01    nrm: 2e+02    Viol.  con: 0e+00    var: 0e+00    barvar: 0e+00    cones: 0e+00  
Optimizer summary
  Optimizer                 -                        time: 0.06    
    Interior-point          - iterations : 0         time: 0.06    
      Basis identification  -                        time: 0.00    
        Primal              - iterations : 0         time: 0.00    
        Dual                - iterations : 0         time: 0.00    
        Clean primal        - iterations : 0         time: 0.00    
        Clean dual          - iterations : 0         time: 0.00    
    Simplex                 -                        time: 0.00    
      Primal simplex        - iterations : 0         time: 0.00    
      Dual simplex          - iterations : 0         time: 0.00    
    Mixed integer           - relaxations: 0         time: 0.00    

------------------------------------------------------------
Status: Infeasible
Optimal value (cvx_optval): +Inf

I don’t understand this. it should be the case that norm(N,inf) >= norm(diag(M),inf). Therefore, for the same input data,norm(diag(M),inf) <= power/Nt should be a looser constraint than norm(M,inf) <= power/Nt So the former shouldn’t be infeasible while the latter is feasible. On the other hand, my machine crashed before Mosek completed when solving the norm(M,inf) <= power/Nt version, so I am not sure Mosek might not have eventually concluded that was infeasible even though I thought it was headed toward a feasible and perhaps optimal solution.

1 Like

You can run the code I adjust.your machine will don’t crash.but the result is infeasible.I want to know why

I solved your small problem (the one with diag(M)) by modifying the objective to

minimize(norm(diag(M),inf));

and removing the corresponding constraint for this norm. Then I see the minimum is found around 0.116… In the original code power/Nt is 0.111… so your constraint is too tight.

(Please try not to use random data, makes reproducible testing harder).

Now, regarding the big problem (with norm(M)). By adding all entries of M to the norm you suddenly have 30k cones instead of 180 and the semidefinite variable appears in 30k constraints instead of 180. Now the memory complexity (and indirectly also time complexity) of the semidefinite algorithm is (roughly) proportional to the square of that number, that is around 1G. So you should expect it to use a lot of RAM. I have gone through 5 iterations now and it looks around 20GB are enough. (Set MSK_IPAR_INTPNT_ORDER_METHOD to MSK_ORDER_METHOD_APPMINLOC to avoid a very long ordering phase after presolve).

I hope when it terminates the answer will be infeasible because of @Mark_L_Stone’s argument. (On the small problem Mosek finds the reason in presolve and on the big one somehow fails to notice it, but then I presume you are more interested in the case when the problem will be feasible, anyway).

1 Like

And just to close it off, it is infeasible too as expected

9   8.7e-18  1.6e-14  8.5e-11  -1.00e+00  4.726712726e-15   1.673836234e-03   6.9e-22  1372.67
Optimizer terminated. Time: 1372.85 


Interior-point solution summary
  Problem status  : PRIMAL_INFEASIBLE
  Solution status : PRIMAL_INFEASIBLE_CER
  Dual.    obj: 1.6738362340e-03    nrm: 2e+02    Viol.  con: 0e+00    var: 2e-14    barvar: 3e-16    cones: 0e+00  
1 Like