clear; clc;
N = 5; M = 3; omega_delta = 0.1;H1=11e3;H2=20e3;H3=32e3;
alpha1 = pi/6; alpha2 = pi/4;omga=1;delta=2;
MN = MN; tan_diff = tan(alpha1) - tan(alpha2);
pb1=2.263206000000000e+04;
pb2=5.4749e3;
Tb=216;
Lb=1;
gmrt_con=1.5758e-4;
%
z_n_prev = ones(MN,1); %
max_iter = 50;
tan_diff=tan(alpha1) - tan(alpha2);
M_max=2max(H1,H2);
for iter = 1:max_iter
r_n_prev = 0.5 * z_n_prev * tan_diff;
cvx_begin quiet
variables z_n(MN) P_Rad(MN) P_Com(MN) p(MN) q(MN) r(MN) t(MN)
expressions r_n(MN) x_n(MN) y_n(MN) lb_expr(MN) %
expressions tilde_r_linear ph(NM) Tp(NM)
variable yy(NM) binary
tilde_r_linear = 0;
for k = 0:M-1
idx = kN + 1;
if idx <= MN
tilde_r_linear = tilde_r_linear + r_n_prev(idx)…
(0.5z_n(idx)tan_diff - r_n_prev(idx));
end
end
S_approx = 0.5omga * delta*(sum_square(r_n_prev) + 2*tilde_r_linear)*N;
maximize(S_approx)
subject to
z_n <= H2 + M_max*(1 - yy);
z_n >= H2 - M_max*yy;
for nn=1:MN
lb_expr(nn)=inv_pos(Tb + Lb(z_n(nn)-H2));
% exp_term = exp(gmrt_con * log(Tb * lb_expr)); % Logarithmic transformation
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
ph(nn) = yy(nn) * pb1 * (-gmrt_conexp(z_n(nn)-H1)) + …
(1 - yy(nn)) * pb2 pow_p(Tblb_expr(nn), gmrt_con);%(Tblb_expr(nn))^gmrt_con;%(Tblb_expr(nn)).^gmrt_con;%%(Tblb_expr.^gmrt_con);%exp_term;%
Tp(nn) = yy(nn) * Tb + (1 - yy(nn)) * (Tb + Lb(z_n(nn)-H2));
end
cvx_end
end
how to solve this error?
Illegal operation: pow_p( {convex}, {0.00015758} )