Pak(n) = 0;
for i = 1:200
maximize( sum(log(1+an(n)-an(n)*bn(n)*inv_pos(bn(n)+Pa(n)))-((cn(n)dn(n))/((Pak(n)+dn(n))(dn(n)+(cn(n)+1)Pak(n))))Pa(n)) )
0<= Pa(n) <= 4Paveba;%Pafeng = 4Paveba
sum(Pa(n))/N <= 0.03;%Paba = lamdaPave/N < Pafeng
if Pa(n) == Pak(n)
Pak(n) = Pa(n);
You have not provided a reproducible problem. Have you you looked carefully at the solver and CVX output and solution from each CVX invocation? That should be the first thing you do.
Testing for exact equality to terminate your iteration is likely not a very good thing to do.
I’m sorry. I was just a little tired and made a mistake. The problem has been solved.Thank you very much for your reply