# An error occurred during the CVX run

I want to implement the following problem in CVX

where

I wrote the following code in CVX

cvx_begin
cvx_solver mosek
variables utrj Xm(1,N) Ym(1,N);
%+++++++++++++++++
hx_fea=ones(K,1)*Xm_fea-Xk’*ones(1,N);
hy_fea=ones(K,1)*Ym_fea-Yk’*ones(1,N);
hx=ones(K,1)*Xm-Xk’*ones(1,N);
hy=ones(K,1)*Ym-Yk’ones(1,N);
q_fea=hx_fea.^2+hy_fea.^2;
q=hx.^2+hy.^2;
g1=Pmax
beta0_dB.*square(inv_pos(H^2.ones(K,N)+q));
g2=Pmax
beta0_dB.*inv_pos(H^2.*ones(K,N)+q);
A_l=(g1.*log2(e)).*inv_pos(g2+sigma2_dBm.ones(K,N));
B_l=log2(g2+sigma2_dBm.ones(K,N));
R_l=-A_l.
(q_fea-q)+B_l;
%+++++++++++++++++
maximize(utrj)
subject to
%-----C1
1/N.sum(A.(Rl-log2(sigma2_dBm)),2)>=utrj;%K
1(summarize the elements of each line)
%-----C2
for n=1:N-1
(Xm(1,n+1)-Xm(1,n))^2+(Ym(1,n+1)-Ym(1,n))^2<=Smax^2;
end
%-----C3
Xm(1,1)=Xm(1,N);
%-----C3
Ym(1,1)=Ym(1,N);
cvx_end

However, the following problems occur after the operation

``````错误使用 [cvx/pow_cvx](matlab:matlab.internal.language.introspective.errorDocCallback('cvx/pow_cvx', 'D:\cvx-w64\cvx\functions\@cvx\pow_cvx.m', 144)) ([line 144](matlab: opentoline('D:\cvx-w64\cvx\functions\@cvx\pow_cvx.m',144,0)))
Disciplined convex programming error:
Illegal operation: pow_p( {convex}, {-1} )

y = pow_cvx( x, -1, 'pow_p' );
``````

I don’t know how to solve this problem, I think there is an error at the reciprocal of the variable, I hope someone can help me, thank you very, very much!