Here is my code.
ap_except0(1,1)=a_ij0(2,1)*p_k0(1,2)+a_ij0(3,1)*p_k0(1,3);
ap_except0(1,2)=a_ij0(1,2)*p_k0(1,1)+a_ij0(3,2)*p_k0(1,3);
ap_except0(1,3)=a_ij0(1,3)*p_k0(1,1)+a_ij0(2,3)*p_k0(1,2);
g_exp0=log2(Cg_k.ap_except0+noise);
fe_exp0=log2(Cg_e(ap_except0+p_k0)+noise);
cvx_solver mosek
cvx_begin
variable p_k(1,3)
expressions g_exp_ub(1,3) fe_exp_ub(1,3) f_exp(1,3) ge_exp(1,3)
g_exp_ub(1,1)=g_exp0(1,1)+...
Cg_k(1,1)*(a_ij0(2,1)*(p_k(1,2)-p_k0(1,2))+a_ij0(3,1)*(p_k(1,3)-p_k0(1,3)))*log2(exp(1))/...
(Cg_k(1,1)*ap_except0(1,1)+noise);
g_exp_ub(1,2)=g_exp0(1,2)+...
Cg_k(1,2)*(a_ij0(1,2)*(p_k(1,1)-p_k0(1,1))+a_ij0(3,2)*(p_k(1,3)-p_k0(1,3)))*log2(exp(1))/...
(Cg_k(1,2)*ap_except0(1,2)+noise);
g_exp_ub(1,3)=g_exp0(1,3)+...
Cg_k(1,3)*(a_ij0(1,3)*(p_k(1,1)-p_k0(1,1))+a_ij0(2,3)*(p_k(1,2)-p_k0(1,2)))*log2(exp(1))/...
(Cg_k(1,3)*ap_except0(1,3)+noise);
sum_ap(1,1)=p_k(1,1)+a_ij0(2,1)*p_k(1,2)+a_ij0(3,1)*p_k(1,3);
sum_ap(1,2)=a_ij0(1,2)*p_k(1,1)+p_k(1,2)+a_ij0(3,2)*p_k(1,3);
sum_ap(1,3)=a_ij0(1,3)*p_k(1,1)+a_ij0(2,3)*p_k(1,2)+p_k(1,3);
sub_ap(1,1)=p_k(1,1)-p_k0(1,1)+a_ij0(2,1)*(p_k(1,2)-p_k0(1,2))+a_ij0(3,1)*(p_k(1,3)-p_k0(1,3));
sub_ap(1,2)=a_ij0(1,2)*(p_k(1,1)-p_k0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ij0(2,3)*p_k(1,2))+noise);
result=0;
for k=1:K
result=result+g_exp_ub(1,k)-f_exp(1,k)-ge_exp(1,k)+fe_exp_ub(1,k);
end
minimize result
subject to
p_k >= 0;
sum(p_k) <= P_max;
cvx_end
My problem is that CVX thinks my objective function is concave.
But from the optimization problem in the graph, the objective function is convex.