# The optval of maximize problem appears descending when i solve the optimal problem iteratively

Q_f=opt_v_ini.Q; % data update
v_f=opt_v_ini.v;
B_f=opt_v_ini.B;
H_f=sla_v_ini.H;
F_f=sla_v_ini.F;
l=frac_obj;

for m=1:U
for n=1:N+1
b(m,n)=(B_T/B_f(m))log(1+1/(H_f(n)F_f(m,n)));
c(m,n)=B_T
power(B_f(m)
(1+H_f(n)*F_f(m,n)),-1);
v_no_f(n)=power(norm(Q_f(:,n)-Q_U(:,m)),2);
end
end

%% optimization
cvx_begin
%cvx_quiet true
cvx_solver sdpt3;
variable Q(3,N+1)
variable a(3,N+1)
variable v(3,N+1) nonnegative
variable B(U,1) nonnegative
variable W(1,N+1)
variable H(1,N+1)
variable F(U,N+1)
variable D(N+1,K)

expression r_U(U,N+1);
for m=1:U
for n=1:N+1
r_RU(m,n)=2b(m,n)+c(m,n)(2-H(n)/H_f(n)-F(m,n)/F_f(m,n))-B(m)*b(m,n)*power(B_f(m),-1);%the signal receiption of the mth user
end
end

expression E_up(N);
for n=1:N+1
E_up(n)=a_1pow_pos(norm(v(:,n)),3)+a_2pow_p(W(n),-1)+(a_2/g^2)*quad_over_lin(a(:,n),W(n));% the power consumption of UAV
end

maximize sum(sum(r_RU))-l*(sum(E_up))
%% constrain
subject to

% the constraint of bandwith
% for m=1:U
% B(m)<=1e-6;
% end
sum(pow_p(B(:),-1))<=1;

%constraint of mobility
for n=1:N+1
Q(3,n)==h;
end
for n=1:N+1
norm(v(:,n))<=vmax; %velocity constraint
norm(a(:,n))<=amax; %acceleration constraint
v_no_f(n)+2v_f(:,n)’(v(:,n)-v_f(:,n))>=pow_p(W(n),2);
v_no_f(n)+2v_f(:,n)’(v(:,n)-v_f(:,n))>=vmin;
end
Q(:,1)-[-550,100,100]’ == 0;
[550,100,100]’-Q(:,N+1) == 0;
v(:,N+1) == v(:,1);
for n=1:N
Q(:,n+1)-Q(:,n) == dv(:,n)+dd*a(:,n)/2;
v(:,n+1)==v(:,n)+a(:,n)*d/2;
end

%constraint of H
for n=1:N+1
sum_square(Q(:,n)-Q_B(:))<=H(n)*K_3;
end

%constraint of F
for m=1:U
for n=1:N+1
end
end

% constraint of d
for n=1:N+1
for k=1:K
D(n,k)>=sum_square(Q(:,n)-Q_J(:,k));
end
end

cvx_end
cvx_status

before, i solve the failed status bad numerical value brings with mark’s help.But i get in trouble again.the above is my subprogram which is used for solving convex problem .there is a iteration algorithm contains subprogram ,update the variable outside the subprogram.because of the non-convex of original problem,the iteration algorithm introduces slack variables and SCA method to approximate original problem.however , the optval of maximize problem descends when performs some iteration cycles.So what can i do to acends the optval iteratively .

If you do SCA, you’re on your own. There is essentially no guarantee about anything. if you want to reliably solve a non-convex problem, use a high quality non-convex solver, for instance under YALMIP.

actually , the algorithm convergence to a local optimization provably.It could be something wrong with my code ,not numerical value but my write or something ignored