hello to all.
I’m trying to soleve {
}
with
We could find a lower bounding concave function for the first,and upper bounding convex for the second.
and this is my code
function [w_new,q_AN_new] = cvx_solver_w_Q_AN(P_AP,w,q_AN,u,f_B,f_E,b,q,H,Num_user,F_e,sigma_U,sigma_E)
M = size(w,1);
N = size(w,2);
result = 0;
cvx_begin
% ,x w,q_AN
variable x
variable w_new(M,N)
variable q_AN_new(M,1)
for k =1:1:Num_user
result = result + norm(w_new(:,k))^2;
end
result + norm(q_AN_new)^2 <= P_AP;
%%
%
for k =1:1:Num_user
sum_1 = 0; %
sum_2 = 0;
%
for i =1:1:Num_user
if i == k
continue;
else
sum_1 = sum_1 + norm(u’*H(:,:,k)*w_new(:,i))^2;
sum_2 = sum_2 + real(w(:,i)‘F_e’u(2u’F_ew_new(:,i)-u’F_ew(:,i)));
end
end
b_new(k, = sum_1 + norm(u’*H(:,:,k)q_AN_new)^2 + sigma_U;
q_new(k, = sum_2 + real(q_AN’F_e’u(2u’F_eq_AN_new-u’F_eq_AN))+sigma_E;
%
end
for k =1:1:Num_user
f_new_B(k, = f_B(k,
+ 2real(w(:,k)’*H(:,:,k)‘uu’*H(:,:,k)*w_new(:,k))/b(k,:)-…
(norm(u’*H(:,:,k)w(:,k))^2(b_new(k,:)+norm(u’*H(:,:,k)w_new(:,k))^2))/(b(k,(b(k,:)+norm(u’*H(:,:,k)*w(:,k))^2))-norm(u’*H(:,:,k)*w(:,k))^2/b(k,:);
f_new_E(k,:) = f_E(k,:) + inv_pos((1+norm(u'*F_e*w(:,k))^2/(q(k,:)))*(norm(u'*F_e*w_new(:,k))^2./(q_new(k,:)) - norm(u'*F_e*w(:,k))^2/(q(k,:))));
end
maximize x % target
subject to
for k = 1:1:Num_user
x <= f_new_B(k,:) - f_new_E(k,:);
end
cvx_end
result_old = cvx_optval;
end
the error is
Disciplined convex programming error:
Invalid operation: {positive convex} ./ {real affine}
cvx_solver_w_Q_AN (line 37)
f_new_E(k, = f_E(k,
+
inv_pos((1+norm(u’F_ew(:,k))^2/(q(k,:)))*(norm(u’F_ew_new(:,k))^2./(q_new(k,:))
- norm(u’F_ew(:,k))^2/(q(k,:))));