The problem is given as follows
Since the problem is convex with respect to power \ro_i and p_i .
I solve the problem for n = 1.
I use the cvx toolbox for solving it.
The code is given as follows:
clc
clear all
close all
xs = 0; ys = 50;
xe = 100; ye = -50;
x_source = 0; y_source = 0;
xy(1,1) = 2;
xy(2,1) = 48;
x_destination = 100; y_destination = 0;
H = 20;
V = 4;
a = 3;
B = 0;
delta = 2e-13;
gama = 10^(10/10);
gama0 = 10^(80/10);
N = 50;
Ps = 10;
step_beta = .001;
n_x = 1;
d_sr(n_x) = sqrt((xy(1,n_x)-x_source)^2 + (xy(2,n_x)-y_source)^2 + H^2);
d_rd(n_x) = sqrt((x_destination - xy(1,n_x))^2 + (y_destination - xy(1,n_x))^2 + H^2);
d_sd(n_x) = sqrt((x_destination - x_source)^2 + (y_destination - y_source)^2 );
cvx_begin
% cvx_solver sedumi
variables x y
% minimize ( -.5* log10(1 + Psgama +…
% (Ps * gama0.^2 * y * x /((x+a)(d_sr(n_x) * d_sr(n_x)).^2))…
% /(1+Ps * gama0 * x /((x+a)d_sr(n_x).^2) + y * gama0 /d_rd(n_x).^2) ) )
% subject to
% y <= B+(1+Psgama0/d_sr(n_x).^2)delta(1-x);
% 0<= x <=1;
% y>=0;
minimize ( -.5* (-rel_entr(1,(1 + Psgama +…
(Ps * gama0.^2 * y * x /((x+a)(d_sr(n_x) * d_sr(n_x)).^2))…
/(1+Ps * gama0 * x /((x+a)d_sr(n_x).^2) + y * gama0 /d_rd(n_x).^2) ) )))
subject to
y <= B+(1+Psgama0/d_sr(n_x).^2)delta(1-x);
0<= x <=1;
y>=0;
cvx_end
this Error is apear:
Error using .* (line 262)
Disciplined convex programming
error:
Invalid quadratic form(s): not a
square.
Error in * (line 36)
z = feval( oper, x, y );
Error in Untitled (line 36)
(Ps * gama0.^2 * y * x
/((x+a)*(d_sr(n_x) *
d_sr(n_x)).^2))…