giaf / hpmpc

Library for High-Performance implementation of solvers for MPC.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Duality gaps exploding for certain instances?

ggleizer opened this issue · comments

Hi,

I may be misinterpreting the results. I was trying an instance of the default test case, setting Nx = 60, Nu = 6, N = 30 and leaving N2 = 5. When I look at the residuals, the mu variables seem to be increasing at every iteration. Is this ok or indeed there is something wrong going on? You can see the residuals below. Thanks!

sigma		alpha1		mu1		alpha2		mu2

7.849190e-01	6.961859e-02	1.844895e+00	5.601648e-02	2.167802e+00	
5.654612e-01	1.328394e-01	1.792615e+00	7.866040e-02	2.448698e+00	
7.682224e-01	6.339107e-02	2.242664e+00	6.038227e-02	2.839373e+00	
9.618473e-01	7.576270e-03	2.802794e+00	8.554261e-04	3.054789e+00	
8.715104e-01	8.241846e-03	2.917911e+00	4.634073e-04	3.792977e+00	
5.271292e-01	8.627719e-03	3.063980e+00	1.663392e-04	5.331655e+00	
6.978703e-01	4.545693e-03	4.729192e+00	7.829801e-05	7.515975e+00	
4.825211e-01	5.315192e-03	5.895094e+00	6.635004e-05	1.122146e+01	
6.592392e-01	3.674644e-03	9.766310e+00	4.045442e-05	1.546057e+01	
6.947633e-01	3.259677e-03	1.369318e+01	5.506575e-05	2.434838e+01	
7.485869e-01	2.771082e-03	2.210806e+01	4.360596e-05	3.668885e+01	
6.411685e-01	3.296154e-03	3.163672e+01	3.427805e-05	5.226426e+01	
5.932249e-01	3.485857e-03	4.391483e+01	4.934937e-05	8.540819e+01	
6.090260e-01	3.336631e-03	7.239548e+01	9.450187e-05	1.927688e+02	
2.657179e-01	5.005872e-03	1.239301e+02	5.524357e-05	3.421472e+02	
5.583801e-01	3.468656e-03	2.817450e+02	4.982150e-05	5.871007e+02	
2.626648e-01	4.920257e-03	3.759932e+02	8.956585e-05	1.352799e+03	
1.642487e-01	5.447489e-03	7.408564e+02	9.418711e-05	3.258711e+03	
3.346302e-01	4.413347e-03	2.262391e+03	1.007219e-04	8.297329e+03	
4.126821e-01	3.976474e-03	6.177463e+03	1.094285e-04	2.260963e+04	
6.120308e-01	3.004893e-03	1.919631e+04	1.097758e-04	6.290721e+04	
5.671838e-01	3.164283e-03	5.207249e+04	1.038749e-04	1.722915e+05	
6.477912e-02	5.839482e-03	6.919514e+04	5.194832e-05	3.275165e+05	
2.198542e-02	6.360731e-03	9.175112e+04	9.923402e-05	8.958630e+05	
9.810750e-02	5.423588e-03	4.131829e+05	8.291455e-05	2.234202e+06	
8.580352e-01	1.610499e-03	2.123037e+06	7.553621e-06	2.548766e+06	
9.752381e-01	6.425942e-04	2.527552e+06	7.491724e-06	2.905491e+06	
1.237583e-01	5.159832e-03	1.447919e+06	1.194430e-04	9.302579e+06	
3.412657e-02	5.891526e-03	3.017409e+06	1.167184e-04	3.001309e+07	
4.055767e-01	3.582832e-03	2.221613e+07	1.866320e-05	4.121939e+07	
9.342653e-01	1.032096e-03	4.029567e+07	1.739464e-05	5.564849e+07	
7.689753e-01	2.013766e-03	5.098286e+07	4.525524e-05	1.063938e+08	
5.883531e-01	2.790436e-03	8.915158e+07	6.726142e-05	2.520852e+08	
9.854898e-01	4.593099e-04	2.508600e+08	1.392541e-05	3.255729e+08	
1.873928e-04	6.682632e-03	1.863085e+07	9.644201e-05	9.777064e+08	
5.363688e-02	5.349607e-03	3.687197e+08	1.171189e-04	3.417786e+09	
6.040128e-02	5.190790e-03	1.340994e+09	2.208503e-04	1.981372e+10	
8.513496e-01	1.456549e-03	1.877884e+10	5.093455e-06	2.223956e+10	
7.850259e-01	1.777361e-03	2.051576e+10	2.240263e-05	3.420313e+10	
4.364960e-01	3.141172e-03	2.594533e+10	1.669035e-05	4.802335e+10	
9.904976e-01	3.418189e-04	4.787075e+10	1.544826e-05	6.608615e+10	
4.038175e-03	5.848694e-03	1.052379e+10	7.940779e-05	1.932000e+11	
1.293530e-01	4.422954e-03	9.770858e+10	1.022425e-04	6.821841e+11	
2.372257e-01	3.816985e-03	4.223010e+11	6.917454e-05	1.896100e+12	
1.534078e-02	5.307973e-03	4.711331e+11	2.507819e-05	3.156616e+12	
9.936808e-01	2.631017e-04	3.149953e+12	7.378018e-07	3.219132e+12	
1.658967e-02	5.261728e-03	8.210155e+11	4.419749e-05	7.011674e+12	
1.451622e-02	5.261789e-03	1.710434e+12	7.077501e-05	2.037746e+13	
2.658239e-01	3.567448e-03	1.310232e+13	1.449700e-05	2.860312e+13	
1.199203e-02	5.238178e-03	6.547028e+12	1.817339e-05	4.314054e+13	

 Average solution time over 100 runs: 1.98e-01 seconds (IPM)

Hey!

the test problem gets infeasible for these size. If you set b=0, then it will converge (I use b!=0 to make sure that the solver works also in this case, for sizes such that the problem is feasible).

Hey, thanks for pointing that out!

I noticed there is no return condition for "unfeasible" -- is this by design? To me it could stop earlier instead of going all the way up to 1e+inf

Unfortunately in interior point methods there is no easy way to detect an infeasible problem (as it is e.g. possible in active set methods): they diverge, or the step size alpha gets very small.

Hmm, I didn't know that, thanks for explaining!