# How can I solve this {real-affine} / {real-affine} problem

my problem is as following figure, and my whole code is also shown in the 2-nd figure, thanks for your helping

clc;
clear;
close all
% Variable h
R_min = 2; % Min Data rates (Gbps) %
La2g = 2e18;

I = 8; % Number of Users
Ns = 5; % Number of Sub-bands

R = 1; % 标准化传输距离
Gt = 1e5; % 发射天线增益 这个的设置和噪声有关系，设置不当可能导致SINR 出现<1的情况，这会使得速率出现负数
Gr = 1e2; % 接收天线增益

% Bs = 4 * 1e9; % 带宽
Bs = 1; % 带宽
sigma = 10^(-11.4); % 噪声方差

P_max = 400;

h_km = 0.001:0.001:3; % UAV 飞行高度变量(只是为了方便计算kf，实际在这应当是常量)
h_m = h_km * 1000; % m

c = physconst(‘LightSpeed’); % Speed of light
[T_C, P_pa, Wd] = atm_para(h_km); % 计算大气参数

freq = [188 193 198 203 208] * 1e9; % Frequency of sub-bands (with guard band)

loss_gas = zeros(1, length(h_m));
for i = 1:length(freq)
for j = 1:length(h_m)
loss_gas(i,j) = gaspl(R, freq(i), T_C(j), P_pa(j), Wd(j));
end
end
kf = loss_gas / (10 * R * log10(exp(1))); % 反推k(f)参数
kf_const = zeros(1, Ns);
for i = 1:length(freq)
kf_const(i) = mean(kf(i, :));
end

% Set users coordinates
r1 = [ 100, 100, 0];
r2 = [ 250, 150, 0];
r3 = [ 400, 80, 0];
r4 = [ 600, 200, 0];
r5 = [ 70, 400, 0];
r6 = [ 100, 600, 0];
r7 = [ 900, 800, 0];
r8 = [1000, 300, 0];
r_user = [r1;r2;r3;r4;r5;r6;r7;r8];

h_t = 100; % Taylor
r_uav_t = [0, 0 ,h_t];
d_t = zeros(1, I);
for i = 1:I
d_t(i) = norm(r_uav_t - r_user(i,:), 2);
end
Interference = zeros(I, Ns);
for j = 1: size(P, 2)
for i = 1: size(P, 1)
if(P(i,j) ~= 0)
Index = find(P(:,j) < P(i,j));
if(isempty(Index))
Interference(i,j) = 0;
else
Interference(i,j) = sum(P(Index,j), 1);
end
else
Interference(i,j) = 0;
end
end
end
P_modi = Gt * Gr * P;
cvx_begin
variables h_uav aux(1, I)
expressions SINR(I,Ns)
expressions H_ij d_i(1, I) H_Taylor(I, Ns)

``````x = 0; y = 0; z = h_uav;    %   The 3-D coordinate of the UAV
r_uav = [x, y, z];
%   Distance between the UAV and each User
for i = 1:I
d_i(i) = norm(r_uav - r_user(i,:), 2);
end

for i = 1:1:I
for j = 1:1:Ns
H_Taylor(i,j) = c ^ 2 / (4 * pi * freq(j)) ^ 2 * exp(-kf_const(j) * d_t(i)) / pow_pos(d_t(i), 2) - exp(-kf_const(j)) * (kf_const(j) * d_t(i) + 2)/power(d_t(i), 3) * (d_i(i) - d_t(i));
end
end

maximize sum(sum(log((Interference .* H_Taylor + sigma + P_modi.* H_Taylor )./ (Interference .* H_Taylor + sigma))));
``````

cvx_end