Status failed but still got the result

cvx_begin
cvx_precision best
% cvx_solver sedumi
variable fu(N,1)
variable Lo(N,M)
variable f(N,M)
expression p(N,M)
expression E_local(N,M)

minimize UAV_energy
subject to
Lo(N,:slight_smile: == 0;
fu(1) == 0 ;
p(N,:)== 0;

for i=1:M
for j=1:N
f(j,i) >=0;
fu(j)>=0;
Lo(j,i)>=0;
% 0.01>=p(j,i)>=0;
end
end

disp(‘f’);
disp(f);
disp(‘fu’);
disp(fu);
disp(‘Lo’);
disp(Lo);
disp(‘p’);
disp§;

It sounds like you are saying that CVX reported Status failed, and all but one constraint is satisfied. Well, if one constraint is not satisfied (within tolerance), then the solution is not feasible. But remember that CVX said the optimization failed. So what exactly are you asking?

Successive approximation method to be employed.
For improved efficiency, SDPT3 is solving the dual problem.
SDPT3 will be called several times to refine the solution.
Original size: 97 variables, 40 equality constraints
4 exponentials add 32 variables, 20 equality constraints

Cones | Errors |
Mov/Act | Centering Exp cone Poly cone | Status
--------±--------------------------------±--------
0/ 0 | 0.000e+00 0.000e+00 0.000e+00 | Failed
0/ 0 | 0.000e+00 0.000e+00 0.000e+00 | Failed
0/ 0 | 0.000e+00 0.000e+00 0.000e+00 | Failed

Status: Failed
Optimal value (cvx_optval): NaN

f
1.0e+06 *

3.1029    3.1029
3.1029    3.1029
3.1029    3.1029

fu
1.0e+06 *

     0
3.1611
3.1962

Lo
119.7487 119.7487
7.3985 7.3986
0 0

p
1.0e-09 *

0.5188    0.5207
0.0321    0.0321
     0         0

This is the result of the operation, that is, the value of the optimization variable can still be obtained after the failure, and it is satisfied to substitute them into the constraint.

Thanks for your reply, I don’t know why this happens, is it because the value is too small?

Even if the result is feasible, it may not be optimal, or even close to optimal.

have you tried using CVXQUAD, as described in one of your previous threads? I haven’t look too closely at your program, but if your only exponential cone function is log, replace
log(expression)
with
-rel_entr(1,expression)
in order for CVXQUAD (if installed with its exponential.m replacement) to be invoked with Pade approximant instead of CVX’s successive approximation method. And if you have Mosek, specify that as the solver ti improve the chances of successful solution.

Hello,stone .
I did not use the log function, I used 2^x this exponential function

Rewrite it using exponential(1) construct or rel_entr per mcg’d answer in Solve optimization problems of exp function . Note that 2^x equals exp(x*log(2).

1 Like

Hello ,Stone
I follow your advice
change p(n,k) = mid_bb*(power(2,mid_aa)-1); into this form
p(n,k) = mid_bb*(exp(mid_aa*log(2))-1);

but it doesn’t work

Now you need to rewrite that per mcg’s answer in the link I provided.