Error using widelen (line 63)
Assertion failed: tR >= 0
Error in wregion (line 150)
[t,wr,w] = widelen(xc,zc,y0c, dx,dz,dy0,0, maxt,pars,K);
Error in sedumi (line 467)
wregion(L,Lden,Lsd,…
Error in cvx_run_solver (line 50)
[ varargout{1:nargout} ] = sfunc( inputs{:} );
Error in cvx_sedumi>solve (line 245)
[ xx, yy, info ] = cvx_run_solver( @sedumi, At, b, c, K, pars, ‘xx’, ‘yy’, ‘info’, settings, 5 );
Error in cvxprob/solve (line 253)
[ x, status, tprec, iters2, y, z ] = shim.solve( [ At, Anew2 ], [ b ; bnew ], c, cones, true, prec, solv.settings, eargs{:} );
Error in cvx_end (line 88)
solve( prob );
Error in power_cvx_QoS (line 80)
cvx_end
Error in joint_power_beam_ee_opt_QoS (line 202)
[P_rand] = power_cvx_QoS(K,P,R_min,P_BS,P_UE,P_RIS,Gamma_t,sigma_sqr_t,sigma_sqr,rho_UE,rho_BS,P_rand,h_theta,g_theta,h_s_i,v,w_k_initial,w_0_initial,y,z);
power_cvx_QoS function is:
% Function related to Uplink transmit power allocation
function [P_rand_updated] = power_cvx_QoS(K,P,R_min,P_BS,P_UE,P_RIS,Gamma_t,sigma_sqr_t,sigma_sqr,…
rho_UE,rho_BS,P_rand,h_theta,g_theta,h_s_i,v,w_k,w_0,y,z)
% Modern optimization solver
%cvx_solver mosek
cvx_solver SeDuMi
%cvx_solver Gurobi
%cvx_solver SDPT3
% cvx_solver_settings('write', 'dump.ptf')
cvx_begin quiet
variable P_opt(K) nonnegative
% Compute final modified objective function for power subproblem (eq.17)
[obj_power] = objective_power(K,w_k,h_theta,P_opt,g_theta,h_s_i,v,sigma_sqr_t,sigma_sqr,rho_UE,rho_BS,P_BS,P_UE,P_RIS,y,z);
obj = obj_power;
maximize real(obj)
subject to
% constraints
% Modified target sensing constraint (C_1) of problem P3 in (eq.19)
temp = 0;
for k = 1:K
temp = temp + ( norm( w_0'*h_theta(:,k) )^2 )*(P_opt(k));
end
Gamma_t*( temp + norm(w_0'*h_s_i*v)^2 + sigma_sqr*( norm(w_0')^2 ) )...
<= sigma_sqr_t*(norm(w_0'*g_theta*v)^2);
% Individual Rate constraint (QoS) (eq.18)
for k=1:K
a2 = (norm(w_k(:,k)'*h_theta(:,k))^2)*P_opt(k);
b2=zeros(1,1);
for mm=1:K
if mm~=k
b2 = b2 + (norm(w_k(:,k)'*h_theta(:,mm))^2)*P_opt(mm);
%b1(:,k) = b;
end
end
c2(k) = norm(w_k(:,k)'*g_theta*v)^2;
d2(k) = norm(w_k(:,k)'*h_s_i*v)^2;
e2(k) = norm(w_k(:,k)')^2 ;
(2^(R_min)-1)*( b2 + c2(k)*sigma_sqr_t + d2(k) + e2(k)*sigma_sqr)<= a2 ;
end
% Individual Power Constraint C3 in (eq.19)
for k = 1:K
P_opt(k) <= P;
P_opt(k) >=0;
end
cvx_end
% cvx_status
if strcmp(cvx_status,'Solved') || strcmp(cvx_status, 'Inaccurate/Solved') %|| strcmp(cvx_status,'Failed')
P_rand_updated = max(P_opt,1e-6);
%P_rand_updated = P_opt;
else
% default value if not optimized
P_rand_updated = P_rand;
end
end
Error occurs at cvx_end in the above function and I am giving minimum power as 1e-6 as power values sometimes assigning with negative values!