Shannon Capacity formula (Disciplined convex programming error)

Nonconvex
Jun 4, 2014
P

Trying to solve the following code but showing the error “Disciplined convex programming error:”
%% power, p1, p2, K, Ith x and y are known

cvx_begin gp
  variable P(6)
solve= x *sum(log(1 + P*y));       
maximize( solve )
  subject to
           sum(P)<= Power;     
            sum(P(1:3))<= p1;
            sum(P(4:6))<= p2;
           (sum(K*P))<= Ith;
 cvx_end

where is the problem and what is the solve??
thanks in advance

M

FAQ: Why doesn’t CVX accept my problem? [READ THIS FIRST]

M

Do read that, but also note that you’ve specified programming mode—but you’re not using that correctly, either. Here are the rules for geometric programs, which yours violates in the solve expression.

Z

Try this please

cvx_begin

cvx_expert true

variable P(6)

solve= x sum(log(1 + Py));

maximize( solve )

subject to

       sum(P)<= Power;  

        sum(P(1:3))<= p1;

        sum(P(4:6))<= p2;

       (sum(K*P))<= Ith;

cvx_end