rand('state', 0);
n = 15;
m = 10;
P = rand(m,n);
P = P./repmat(sum(P),m,1);
c = sum(P.*log2(P))';
cvx_begin
variable x(n)
y = P*x;
maximize (c'*x + sum(entr(y))/log(2))
x >= 0;
sum(x) == 1;
cvx_end
C = cvx_optval;
display(['The channel capacity is: ' num2str(C) ' bits.'])
Successive approximation method to be employed.
sedumi will be called several times to refine the solution.
Original size: 45 variables, 21 equality constraints
10 exponentials add 80 variables, 50 equality constraints
-----------------------------------------------------------------
Cones | Errors |
Mov/Act | Centering Exp cone Poly cone | Status
--------+---------------------------------+---------
10/ 10 | 2.713e+00 4.909e-01 7.095e-08 | Solved
10/ 10 | 4.540e-02 1.465e-04 8.655e-08 | Solved
10/ 10 | 3.971e-03 1.151e-06 8.905e-08 | Solved
0/ 10 | 2.034e-04 8.980e-08 8.895e-08 | Solved
-----------------------------------------------------------------
Status: Solved
Optimal value (cvx_optval): +0.296291
The channel capacity is: 0.29629 bits.