This is my formula:
But I have to divide v into vx in the horizontal direction and vy in the vertical direction. The error always in convex. Please help me solve this problem!
Code:
H=0:100:200;
cvx_begin
variable vx_opt3(1,length(H))
variable vy_opt3(1,length(H))
v=pow_pos(vx_opt3(1,zz),2)+pow_pos(vy_opt3(1,zz),2);
for l=1:L % 2
for k=1:K %12 组
for wn=1:WN %2
for n=1:N % 2
pkn=sum(p_opt3((k-1)*N+1:(k-1)*N+n,zz));
for nv=n+1:N
pknv=sum(p_opt3((k-1)*N+(n+1):(k-1)*N+nv,zz));
end
end
tempRate3v((l-1)*K*WN+(k-1)*WN+wn)=log(alpha*(H(zz)^2+re33((l-1)*K*WN+(k-1)*WN+wn))+pknv)/log(2);
f3v((l-1)*K*WN+(k-1)*WN+wn)=sum(tempRate3v(1:(l-1)*K*WN+(k-1)*WN+wn));
end
end
end
v=pow_pos(vx_opt3(1,zz),2)+pow_pos(vy_opt3(1,zz),2);
g3=2*(c1*pow_pos(norm(v),3)+c2*inv_pos(v))+f3v(48);
Error: