Hello,CVX community,
I’m trying to solve the problem with cvx in the following:
cvx_begin
variables r
variables e
expression r0
expression F(q)
expression F1(q+1)
expression temp(q)
minimize e
for n1=1:1:N
for n2=1:1:N
F(q,:)=exp(j*kc*(R*r0*cos(thetak)*cos(phi_m-thetak))/rk+(xn(:,n1)-xn(:,n2))*cos(thetak)+((xn(:,n1))^2-(xn(:,n2))^2)*(sin(thetak))^2/2/rk;
F1(q+1,:)=1+j*kc*r*(xn(:,n1)-xn(:,n2))*cos(thetak)*cos(phi_m-thetak)/rk;
temp(q,:)=temp(q,:)+F(q,:)*F1(q+1,:);
end
end
subject to
abs(temp(q,:))<=e;
0<(r0+r)<1
abs(r)<=r_max;
cvx_end
But the first expression in the loop,” F(q,:)”,got this error” Disciplined convex programming error:Illegal operation: exp( {affine} ).”
How can I fix it? Any help from your guys would be appreciated.