Why is this problem failed? Optimal value (cvx_optval): NaN

Here are my code.

clc; clear all;
close all;

load(‘gamma0.mat’);

m(:,1)=m_0(:,1);
gam(:,1)=gam_0(:,1);
deltat(1)=tau;
r(:,1:3)=r_0(:,1:3);
v(:,1:3)=v_0(:,1:3);
a(:,1:3)=a_0(:,1:3);
T(:,1:3)=T_0(:,1:3);
kar(:,1:3)=kar_0(:,1:3);
KAR(:,1)=KAR_0(:,1);

%%
w_t=0.1;w_T=0.00001;
n_sc=10;

 
for k=1:N-1  
  fm(k,:)=-(alpha*0.5*(gam(k,1)+gam(k+1,1))+m_bp)*deltat(1);
  fr(k,:)=v(k,1:3)*deltat(1)+1/3*(a(k,1:3)+0.5*a(k+1,1:3))*(deltat(1)^2);
  fv(k,:)=0.5*(a(k,1:3)+a(k+1,1:3))*deltat(1); 
  difft_fm(k,:)=-alpha*0.5*(gam(k,1)+gam(k+1,1))-m_bp;
  diffg_fm(k,:)=-alpha*0.5*deltat(1);
  difft_fr(k,:)=v(k,1:3)+2/3*(a(k,1:3)+0.5*a(k+1,1:3))*deltat(1);
  diffv_fr(k,:)=deltat(1);
  difft_fv(k,:)=0.5*(a(k,1:3)+a(k+1,1:3));
end               

for i=2:n_sc

cvx_begin
cvx_precision low
variables m_i(N,1) gam_i(N,1) KAR_i(N,1) etaT_i(N,1) deltat_i etat_i ;
variables r_i(N,3) v_i(N,3) a_i(N,3) T_i(N,3) kar_i(N,3);

minimize(-w_mf*m_i(N)+w_kar*norm(KAR_i(:))+w_t*etat_i+w_T*norm(etaT_i(:)));%
subject to
    
    m_i(1)==m0;
    r_i(1,:)==r0;
    v_i(1,:)==v0;
    T_i(1,:)==gam0*n_hat0;
    gam_i(1)==gam0;
    r_i(N,:)==rf;
    v_i(N,:)==vf;
    T_i(N,:)==gam_i(N)*n_hatf;
    a_i(1,:)==1/m(1,i-1)*(T_i(1,:)-0.5*rho*sd*cd*norm(v(1,3*i-5:3*i-3))*v_i(1,:))+G;%
    (deltat_i-deltat(i-1)).^2<=etat_i;

for k=1:N-1
  
    m_i(k+1,:)==m_i(k,:)+fm(k,:)+difft_fm(k,:)*(deltat_i-deltat(i-1))+diffg_fm(k,:)*(gam_i(k)-gam(k,i-1)+gam_i(k+1)-gam(k+1,i-1));
    r_i(k+1,:)==r_i(k,:)+fr(k,:)+difft_fr(k,:)*(deltat_i-deltat(i-1))+diffv_fr(k,:)*(v_i(k,:)-v(k,3*i-5:3*i-3));
    v_i(k+1,:)==v_i(k,:)+fv(k,:)+difft_fv(k,:)*(deltat_i-deltat(i-1));
    a_i(k+1,:)==1/m(k+1,i-1)*(T_i(k+1,:)-0.5*rho*sd*cd*norm(v(k+1,3*i-5:3*i-3))*v_i(k+1,:))+kar_i(k+1,:)+G;%
    
     0<=deltat_i;%
    m_i(k)<=m0; %
    m_dry<=m_i(k);
    norm(r_i(k,:))*cos(2*pi*80/360)<=r_i(k,1);
    norm(T_i(k,:))<=gam_i(k);
    Tmin<=gam_i(k);
    gam_i(k)<=Tmax;
    gam_i(k)*cos(2*pi*15/360)<=T_i(k,1);
    Tmin_dot*deltat_i<=gam_i(k+1)-gam_i(k);
    gam_i(k+1)-gam_i(k)<=Tmax_dot*deltat_i;
    norm(kar_i(k,:))<=KAR_i(k);
    (T_i(k,:)-T(k,3*i-5:3*i-3))*(T_i(k,:)-T(k,3*i-5:3*i-3))'<=etaT_i(k);%
end
     norm(kar_i(k+1,:))<=KAR_i(k+1);
     (T_i(k+1,:)-T(k+1,3*i-5:3*i-3))*(T_i(k+1,:)-T(k+1,3*i-5:3*i-3))'<=etaT_i(k+1);

 cvx_end

%%
deltat(i)=deltat_i;
etat(i)=etat_i;

m(:,i)=m_i(:,1);
gam(:,i)=gam_i(:,1);
KAR(:,i)=KAR_i(:,1);
etaT(:,i)=etaT_i(:,1);

r(:,3*i-2:3*i)=r_i(:,1:3);
v(:,3*i-2:3*i)=v_i(:,1:3);
a(:,3*i-2:3*i)=a_i(:,1:3);
T(:,3*i-2:3*i)=T_i(:,1:3);
kar(:,3*i-2:3*i)=kar_i(:,1:3);
%%
 for k=1:N-1  
  fm(k,:)=-(alpha*0.5*(gam_i(k,1)+gam_i(k+1,1))+m_bp)*deltat_i;%
  fr(k,:)=v_i(k,1:3)*deltat_i+1/3*(a_i(k,1:3)+0.5*a_i(k+1,1:3))*(deltat_i^2);%
  fv(k,:)=0.5*(a_i(k,1:3)+a_i(k+1,1:3))*deltat_i;%
  difft_fm(k,:)=-alpha*0.5*(gam_i(k,1)+gam_i(k+1,1))-m_bp;%
  diffg_fm(k,:)=-alpha*0.5*deltat_i;%
  difft_fr(k,:)=v_i(k,1:3)+2/3*(a_i(k,1:3)+0.5*a_i(k+1,1:3))*deltat_i;%
  diffv_fr(k,:)=deltat_i;%
  difft_fv(k,:)=0.5*(a_i(k,1:3)+a_i(k+1,1:3));%    
 end   

Calling SDPT3 4.0: 961 variables, 569 equality constraints

num. of constraints = 569
dim. of sdp var = 2, num. of sdp blk = 1
dim. of socp var = 583, num. of socp blk = 124
dim. of linear var = 362
dim. of free var = 13 *** convert ublk to lblk


SDPT3: Infeasible path-following algorithms


version predcorr gam expon scale_data
HKM 1 0.000 1 0
it pstep dstep pinfeas dinfeas gap prim-obj dual-obj cputime

0|0.000|0.000|7.2e+01|1.1e+01|2.0e+13| 4.242669e+11 0.000000e+00| 0:0:00| spchol 2 2
1|0.624|0.793|2.9e+01|2.3e+00|5.4e+12| 1.630238e+11 2.395756e+11| 0:0:01| spchol
linsysolve: Schur complement matrix not positive definite
switch to LU factor. splu 12 ^ 3
2|0.438|0.375|1.6e+01|1.4e+00|3.8e+12| 9.299836e+10 -8.225259e+10| 0:0:01| splu 16 ^19
3|0.444|0.323|9.1e+00|9.7e-01|2.6e+12| 5.279545e+10 -7.805540e+09| 0:0:01| splu 11 ^12
4|0.281|0.107|6.5e+00|8.7e-01|2.2e+12| 3.863987e+10 -1.538032e+10| 0:0:01| splu 30 ^30
5|0.451|0.164|3.6e+00|7.3e-01|1.6e+12| 2.236989e+10 -2.782289e+10| 0:0:01| splu 13 30
6|0.545|0.184|1.6e+00|5.9e-01|1.1e+12| 1.278220e+10 -3.963782e+10| 0:0:02| splu 13 ^16
7|0.395|0.240|9.9e-01|4.5e-01|8.3e+11| 8.788366e+09 -4.724970e+10| 0:0:02| splu 11 ^25
8|0.615|0.135|3.8e-01|3.9e-01|5.3e+11| 5.049415e+09 -4.803999e+10| 0:0:02| splu 15 ^10
9|0.652|0.332|1.3e-01|2.6e-01|3.4e+11| 3.071175e+09 -3.810893e+10| 0:0:02| splu 15 ^22
10|0.638|0.183|4.8e-02|2.1e-01|2.8e+11| 2.770365e+09 -3.446629e+10| 0:0:02| splu 30 30
11|0.820|0.697|8.6e-03|6.4e-02|8.7e+10| 1.380808e+09 -1.474642e+10| 0:0:02| splu 30 ^24
12|0.758|0.352|2.1e-03|4.2e-02|5.7e+10| 1.030729e+09 -1.055073e+10| 0:0:02| splu 30 30
13|0.621|0.702|7.9e-04|1.2e-02|1.7e+10| 6.492244e+08 -2.217756e+09| 0:0:02| splu 19 30
14|0.501|0.832|3.9e-04|2.1e-03|3.5e+09| 3.591611e+08 -3.676312e+08| 0:0:02| splu 14 30
15|0.779|0.814|8.7e-05|4.2e-04|1.2e+09| 1.468642e+08 -3.432020e+08| 0:0:02| splu 17 30
16|0.837|0.783|1.4e-05|1.0e-04|4.0e+08| 5.265053e+07 -1.575533e+08| 0:0:02| splu 11 30
17|0.656|0.546|4.3e-06|4.7e-05|2.2e+08| 2.517001e+07 -9.243113e+07| 0:0:03| splu 30 ^18
18|0.835|0.439|8.5e-07|2.7e-05|1.2e+08| 7.364936e+06 -5.369169e+07| 0:0:03| splu 30 30
19|0.974|0.968|8.9e-08|9.8e-07|4.0e+06| 2.673829e+05 -1.460727e+06| 0:0:03| splu 21 30
20|0.985|0.912|6.5e-08|9.3e-08|2.5e+05|-8.385020e+03 -3.334937e+04| 0:0:03| splu 30 30
21|0.988|0.866|1.5e-09|1.3e-08|3.3e+04|-1.374729e+04 -1.370150e+04| 0:0:03| splu 30 30
22|0.974|0.975|3.3e-02|3.6e-10|1.1e+03|-1.381661e+04 -1.370150e+04| 0:0:03| splu 11 1
23|0.377|0.033|2.0e-02|3.9e-10|1.1e+03|-1.383251e+04 -1.366454e+04| 0:0:03| splu 11 ^10
24|1.000|0.502|1.5e-10|2.2e-10|6.0e+02|-1.386323e+04 -1.359432e+04| 0:0:03| splu 14 30
stop: primal infeas has deteriorated too much, 1.1e+15
25|0.124|0.000|1.5e-10|2.2e-10|6.0e+02|-1.386323e+04 -1.359432e+04| 0:0:03|

number of iterations = 25
primal objective value = -1.38632312e+04
dual objective value = -1.35943176e+04
gap := trace(XZ) = 5.98e+02
relative gap = 2.18e-02
actual relative gap = -9.79e-03
rel. primal infeas (scaled problem) = 1.47e-10
rel. dual " " " = 2.23e-10
rel. primal infeas (unscaled problem) = 0.00e+00
rel. dual " " " = 0.00e+00
norm(X), norm(y), norm(Z) = 1.8e+07, 3.5e+08, 7.4e+06
norm(A), norm(b), norm© = 5.5e+05, 1.5e+06, 5.0e+05
Total CPU time (secs) = 3.38
CPU time per iteration = 0.14
termination code = -7
DIMACS: 9.1e-10 0.0e+00 2.2e-10 0.0e+00 -9.8e-03 2.2e-02


Status: Failed
Optimal value (cvx_optval): NaN

Perhaps the scaling of the input data is bad.

Thank you, Mark. The input data is calculated as follows. It contains all the status of a reference trajectory.

clc; clear all;
close all;

%%
Pamb=100e3;%
A =0.5;%
Isp=300;%
g=9.807;%
rho=1;%
sd=10;%
cd=1;%
N=31; %
tf=15;%
tau=tf/(N-1);%

%%
alpha=1/(Ispg);%
m_bp=Pamb
A*alpha;%
G=[-g,0,0];
Tmin=100e3; Tmax=250e3;%
Tmin_dot=-100e3;Tmax_dot=100e3;%

m0=15000; m_dry=10000;%
r0=[500,500,0]; v0=[-50,0,50]; %
n_hat0=[1,0,0];gam0=175e3;%
rf=[0,0,0]; vf=[0,0,0];n_hatf=[1,0,0]; %
w_mf=1;w_kar=5e5;
u(1)=m0;
s(1)=norm(v0);
for i=1:N
u(i)= m0-(m0-m_dry)(i-1)/(N-1);%
s(i)= norm(v0)
(1-(i-1)/(N-1));%
end

cvx_begin
%%
cvx_precision high
variables m_0(N,1) gam_0(N,1) KAR_0(N,1);%
variables r_0(N,3) v_0(N,3) a_0(N,3) T_0(N,3) kar_0(N,3);%

%%

minimize(-w_mfm_0(N)+w_karnorm(KAR_0));

%%
subject to
m_0(1)==m0;
gam_0(1)==gam0;
r_0(1,:)==r0;
v_0(1,:)==v0;
T_0(1,:)==gam0n_hat0;
r_0(N,:)==rf;
v_0(N,:)==vf;
T_0(N,:)==gam_0(N)n_hatf;
kar_0(1,:)==[0,0,0];
a_0(1,:)==1/u(1)
(T_0(1,:)-0.5
rhosdcd*s(1)*v_0(1,:))+G;%

for k =1:N-1   %
    m_0(k+1)==m_0(k)-(alpha*0.5*(gam_0(k)+gam_0(k+1))+m_bp)*tau;%     
    r_0(k+1,:)==r_0(k,:)+v_0(k,:)*tau+1/3*(a_0(k,:)+0.5*a_0(k+1,:))*(tau^2);%
    v_0(k+1,:)==v_0(k,:)+0.5*(a_0(k,:)+a_0(k+1,:))*tau;
    a_0(k+1,:)==1/u(k+1)*(T_0(k+1,:)-0.5*rho*sd*cd*s(k)*v_0(k+1,:))+kar_0(k+1,:)+G;
      
    
    m_dry<=m_0(k);
    norm(r_0(k,:))*cos(2*pi*80/360)<=r_0(k,1);
    norm(T_0(k,:))<=gam_0(k);
    Tmin<=gam_0(k);
    gam_0(k)<=Tmax;
    gam_0(k)*cos(2*pi*15/360)<=T_0(k,1);
    Tmin_dot*tau<=gam_0(k+1)-gam_0(k);
    gam_0(k+1)-gam_0(k)<=Tmax_dot*tau;
    norm(kar_0(k,:))<=KAR_0(k);
end

cvx_end
save(‘gamma0’);

There are some rather large input values. That may contribute to solver difficulties. To to change units to improve the scaling. You can also try a different solver.

I’ll try now. Thank you very much.

It works after I change the units, the first iteration can be solved. But I meet a new question in the next iteration.

Calling SDPT3 4.0: 900 variables, 508 equality constraints

num. of constraints = 508
dim. of sdp var = 2, num. of sdp blk = 1
dim. of socp var = 583, num. of socp blk = 124
dim. of linear var = 302
dim. of free var = 12 *** convert ublk to lblk


SDPT3: Infeasible path-following algorithms


version predcorr gam expon scale_data
HKM 1 0.000 1 0
it pstep dstep pinfeas dinfeas gap prim-obj dual-obj cputime

0|0.000|0.000|8.8e+01|1.1e+01|5.9e+10| 1.198677e+09 0.000000e+00| 0:0:00| spchol 2 2
1|0.853|0.835|1.3e+01|1.8e+00|1.1e+10| 1.972168e+08 3.974352e+08| 0:0:01| spchol 3 3
2|0.465|0.333|6.9e+00|1.2e+00|7.2e+09| 1.131467e+08 1.854109e+08| 0:0:01| spchol 3 3
3|0.507|0.664|3.4e+00|4.1e-01|4.0e+09| 9.472115e+07 -1.425755e+08| 0:0:01| spchol 5 3
4|0.670|0.562|1.1e+00|1.8e-01|1.7e+09| 7.224410e+07 -1.760075e+08| 0:0:01| spchol 3 3
5|0.802|0.255|2.2e-01|1.3e-01|7.6e+08| 4.528388e+07 -1.628968e+08| 0:0:02| spchol 5 5
6|0.955|0.925|1.0e-02|1.0e-02|6.5e+07| 3.439853e+06 -2.714204e+07| 0:0:02| spchol 29 8
7|0.980|0.957|2.0e-04|4.5e-04|3.5e+06| 1.111171e+05 -1.743923e+06| 0:0:02| spchol 2 2
8|0.988|0.988|2.3e-06|5.9e-06|6.3e+04| 1.321792e+04 -2.490530e+04| 0:0:02| spchol 2 2
9|0.989|0.970|2.5e-08|3.0e-07|2.6e+03|-3.010289e+03 -4.581831e+03| 0:0:02| spchol 2 1
10|0.955|0.463|1.1e-08|1.9e-07|9.8e+02|-3.885097e+03 -4.418985e+03| 0:0:02| spchol 1 1
11|0.915|0.929|2.4e-09|3.4e-08|1.5e+02|-4.001082e+03 -4.095979e+03| 0:0:02| spchol 1 1
12|0.803|0.770|8.9e-10|1.6e-08|5.7e+01|-4.029470e+03 -4.065651e+03| 0:0:02| spchol 2 1
13|0.861|0.636|4.1e-10|9.4e-09|2.9e+01|-4.039288e+03 -4.057524e+03| 0:0:02| spchol 2 1
14|1.000|0.591|3.1e-10|5.5e-09|1.5e+01|-4.043664e+03 -4.052726e+03| 0:0:02| spchol 2 1
15|1.000|0.447|1.6e-10|3.7e-09|8.5e+00|-4.045403e+03 -4.050270e+03| 0:0:02| spchol 2 1
16|1.000|0.593|2.7e-11|1.9e-09|4.0e+00|-4.045998e+03 -4.048201e+03| 0:0:03| spchol 3 1
17|1.000|0.436|6.6e-11|1.2e-09|2.3e+00|-4.046318e+03 -4.047485e+03| 0:0:03| spchol 4 2
18|1.000|0.507|5.7e-12|6.9e-10|1.3e+00|-4.046405e+03 -4.047016e+03| 0:0:03| spchol 8 2
19|0.901|0.377|1.4e-11|4.6e-10|8.0e-01|-4.046456e+03 -4.046834e+03| 0:0:03| spchol 10 3
20|0.994|0.499|2.4e-10|2.3e-10|4.3e-01|-4.046484e+03 -4.046700e+03| 0:0:03| spchol 6 3
21|0.940|0.342|1.9e-11|1.6e-10|2.9e-01|-4.046498e+03 -4.046646e+03| 0:0:03| spchol 6 2
22|1.000|0.514|1.8e-10|8.0e-11|1.6e-01|-4.046505e+03 -4.046587e+03| 0:0:03| spchol 6 3
23|0.935|0.362|3.5e-11|5.7e-11|1.1e-01|-4.046509e+03 -4.046563e+03| 0:0:03| spchol 7 3
24|1.000|0.540|1.9e-12|3.2e-11|5.8e-02|-4.046512e+03 -4.046540e+03| 0:0:03| spchol 6 3
25|0.930|0.425|1.3e-11|7.2e-11|3.6e-02|-4.046513e+03 -4.046530e+03| 0:0:03| spchol 17 5
26|1.000|0.908|9.1e-11|1.4e-10|6.4e-03|-4.046514e+03 -4.046517e+03| 0:0:03|
stop: max(relative gap, infeasibilities) < 1.35e-06

number of iterations = 26
primal objective value = -4.04651368e+03
dual objective value = -4.04651741e+03
gap := trace(XZ) = 6.44e-03
relative gap = 7.96e-07
actual relative gap = 4.62e-07
rel. primal infeas (scaled problem) = 9.13e-11
rel. dual " " " = 1.38e-10
rel. primal infeas (unscaled problem) = 0.00e+00
rel. dual " " " = 0.00e+00
norm(X), norm(y), norm(Z) = 5.8e+03, 6.2e+05, 1.0e+06
norm(A), norm(b), norm© = 6.1e+02, 2.0e+03, 5.0e+05
Total CPU time (secs) = 3.48
CPU time per iteration = 0.13
termination code = 0
DIMACS: 3.6e-10 0.0e+00 1.4e-10 0.0e+00 4.6e-07 8.0e-07


Status: Solved
Optimal value (cvx_optval): -14025.3

Calling SDPT3 4.0: 891 variables, 499 equality constraints

num. of constraints = 499
dim. of sdp var = 2, num. of sdp blk = 1
dim. of socp var = 583, num. of socp blk = 124
dim. of linear var = 302
dim. of free var = 3 *** convert ublk to lblk


SDPT3: Infeasible path-following algorithms


version predcorr gam expon scale_data
HKM 1 0.000 1 0
it pstep dstep pinfeas dinfeas gap prim-obj dual-obj cputime

0|0.000|0.000|9.0e+01|1.1e+01|5.9e+10| 1.198677e+09 0.000000e+00| 0:0:00| chol 2 2
1|0.853|0.830|1.3e+01|1.9e+00|1.1e+10| 1.973010e+08 4.195316e+08| 0:0:00| chol
warning: symqmr failed: 0.3
switch to LU factor. lu 23 9
2|0.463|0.330|7.1e+00|1.3e+00|7.4e+09| 1.139475e+08 1.033089e+12| 0:0:01| lu 15 30
3|0.281|0.140|4.8e+00|1.1e+00|6.4e+09| 9.742562e+07 -1.093926e+15| 0:0:01| lu 11 ^ 6
4|0.206|0.457|3.9e+00|5.9e-01|4.9e+09| 8.479296e+07 4.162216e+14| 0:0:01| lu 18 ^ 2
5|0.227|0.037|3.2e+00|5.7e-01|4.3e+09| 7.201615e+07 8.060362e+14| 0:0:01| lu 30 ^19
6|0.460|0.087|1.9e+00|5.2e-01|3.5e+09| 5.520987e+07 1.131825e+15| 0:0:01| lu 12 30
7|0.734|0.608|6.5e-01|2.0e-01|1.4e+09| 3.241025e+07 6.216765e+14| 0:0:01| lu 30 ^29
8|0.065|0.429|6.1e-01|1.2e-01|1.2e+09| 3.225109e+07 -2.172194e+14| 0:0:01| lu 30 ^14
9|0.272|0.235|4.4e-01|8.9e-02|9.1e+08| 3.167535e+07 -3.027374e+14| 0:0:02| lu 12 ^30
10|0.580|0.096|2.6e-01|8.0e-02|6.9e+08| 2.759204e+07 -3.088615e+14| 0:0:02| lu 16 ^16
11|0.211|0.159|4.1e-01|6.7e-02|5.6e+08| 2.447285e+07 -7.160947e+13| 0:0:02| lu 13 ^ 2
12|0.078|0.020|3.7e-01|6.6e-02|6.0e+08| 2.467467e+07 -6.644534e+13| 0:0:02| lu 30 ^16
13|0.112|0.036|4.4e-01|6.4e-02|6.3e+08| 2.534561e+07 -7.726766e+13| 0:0:02| lu 18 ^13
14|0.312|0.032|2.2e-01|6.2e-02|5.7e+08| 2.500949e+07 -1.010807e+14| 0:0:02| lu 22 30
15|0.000|0.000|2.2e-01|6.2e-02|5.8e+08| 2.501113e+07 -1.014609e+14| 0:0:03| lu 18 30
16|0.001|0.002|2.2e-01|6.1e-02|6.5e+08| 2.502084e+07 -1.059026e+14| 0:0:03| lu 18 30
17|0.009|0.022|2.2e-01|6.0e-02|6.1e+08| 2.513063e+07 -1.314018e+14| 0:0:03| lu 12 ^ 9
18|0.005|0.006|4.2e-01|6.0e-02|6.0e+08| 2.515437e+07 1.500114e+14| 0:0:03| lu 11 ^22
19|0.080|0.174|9.0e-01|4.9e-02|5.4e+08| 2.488939e+07 1.068346e+15| 0:0:03| lu 11 30
20|0.016|0.054|9.0e-01|4.7e-02|5.2e+08| 2.490768e+07 1.592379e+15| 0:0:04| lu 11 ^30
21|0.005|0.002|8.8e-01|4.7e-02|5.2e+08| 2.486601e+07 1.569167e+15| 0:0:04|
stop: progress is too slow
prim_inf,dual_inf,relgap = 8.79e-01, 4.66e-02, 3.33e-07
sqlp stop: primal problem is suspected of being infeasible

number of iterations = 21
residual of primal infeasibility
certificate (y,Z) = -4.73e-09
reldist to infeas. <= 9.22e-11
Total CPU time (secs) = 3.99
CPU time per iteration = 0.19
termination code = 1
DIMACS: 8.5e-01 0.0e+00 6.1e-02 0.0e+00 1.0e+00 6.2e-06

Unsafeguarded (no line search or trust region) Successive Convex Approximation is rather unreliable and can be unstable. If you have a non-convex problem, you may be better off using a non-convex solver, available, for instance, under YALMIP.

Thank you, Mark. Actually, I have added an additive relaxation term, kar(i). But it seems that it didn’t work in the 2nd iteration.

Please read the advice in my previous advice

Okay, I’ll try a new tool. Thank you so much.

Hi,
I have a problem with the code below where f_max = 10^9, RNOMA7 is 10^7, a =10^-28, and eta_max, p_max, and T_max are 1.

cvx_solver mosek
cvx_begin
variable t_e7 nonnegative
variable t_u7 nonnegative
variable f_u7(1, 2*K) nonnegative
maximize ( sum(f_u7 * T_max(m)./C) + sum(RNOMAI7)t_u7)
subject to
P_in7 * t_u7 + a * pow_pos(f_u7, 3) * T_max(m) <= eta_max(q) * P_max(l) * H_e7 t_e7;
t_u7 == T_max(m) - t_e7;
(f_u7 - f_max
ones(1, 2
K)) <= 0;
cvx_end

The output of cvx is

MOSEK Version 10.1.25 (Build date: 2024-2-14 13:03:04)
Copyright (c) MOSEK ApS, Denmark WWW: mosek.com
Platform: MACOSX/aarch64

MOSEK warning 54 (MSK_RES_WRN_LARGE_CON_FX): The equality constraint ‘’ (8) is fixed to numerically large value -1e+09.
Problem
Name :
Objective sense : minimize
Type : CONIC (conic optimization problem)
Constraints : 9
Affine conic cons. : 0
Disjunctive cons. : 0
Cones : 1
Scalar variables : 35
Matrix variables : 0
Integer variables : 0

Optimizer started.
Presolve started.
Eliminator - tries : 0 time : 0.00
Lin. dep. - tries : 0 time : 0.00
Lin. dep. - primal attempts : 0 successes : 0
Lin. dep. - dual attempts : 0 successes : 0
Lin. dep. - primal deps. : 0 dual deps. : 0
Presolve terminated. Time: 0.00
Optimizer terminated. Time: 0.00

Interior-point solution summary
Problem status : DUAL_INFEASIBLE
Solution status : DUAL_INFEASIBLE_CER
Primal. obj: -5.1411807471e-02 nrm: 1e+00 Viol. con: 0e+00 var: 0e+00 cones: 0e+00
Optimizer summary
Optimizer - time: 0.00
Interior-point - iterations : 0 time: 0.00
Basis identification - time: 0.00
Primal - iterations : 0 time: 0.00
Dual - iterations : 0 time: 0.00
Clean primal - iterations : 0 time: 0.00
Clean dual - iterations : 0 time: 0.00
Simplex - time: 0.00
Primal simplex - iterations : 0 time: 0.00
Dual simplex - iterations : 0 time: 0.00
Mixed integer - relaxations: 0 time: 0.00


Status: Infeasible
Optimal value (cvx_optval): -Inf
Could you please help me in this regard.

Thanks

You need to fix the problem scaling (choice if units) so that all non-zero input data is within a small number of orders of magnitude of 1. Mosek issued a warning about 1e9. I don’t know what “The equality constraint ‘’ (8) is fixed to numerically large value -1e+09.” means, but probably nothing good.

if after fixing the scaling, the problem is still reported as infeasible, follow the advice in Debugging infeasible models - YALMIP, all but section 1 of which also applies to CVX.

It seems you have not taken to heart the advice from a previous post of mine in response to you: MOSEK returns NaN although the optimization problem is solved - #15 by Mark_L_Stone So my help yo you is yo advise you to follow that advice for this and all your future problems.