# coneprog: Infeasibilities are satisfied in last step from iterative display but exitflag is still -2 (NoFeasiblePointFound)

3 views (last 30 days)

Show older comments

I am trying to solve a trajectory optimization problem with coneprog under the problem-based approach and am having convergence issues. The last iteration of the iterative display appears to show that the problem is feasibly solved:

Iter Fval Primal Infeas Dual Infeas Duality Gap Time

1 0.000000e+00 2.989297e-01 2.661135e-01 2.396722e-03 0.01

2 1.671582e+00 1.371375e-01 1.220827e-01 1.099524e-03 0.02

3 3.247714e+00 4.683911e-02 4.169716e-02 3.755409e-04 0.02

4 5.466823e+00 2.962828e-02 2.637572e-02 2.375500e-04 0.02

5 6.748515e+00 1.679716e-02 1.495319e-02 1.346743e-04 0.02

6 3.367365e+00 1.788542e-03 1.592198e-03 1.433995e-05 0.03

7 5.484853e+00 4.005449e-06 3.565735e-06 3.211443e-08 0.03

8 5.484859e+00 6.005173e-09 5.346126e-09 4.817329e-11 0.04

9 5.484864e+00 1.200136e-11 1.091778e-11 1.141043e-13 0.04

However, I am still getting a -2 exit flag and the message:

Problem is infeasible.

Is there anyway to extract anymore information about why this solution is infeasible? The functions where the solver operations occur are .p files so I can't find what's going wrong on the inside. Also, when a solution is returned infeasible all output fields are empty except the error message. I am using optimality and constraint tolerances of 1e-8 for reference, but even when I drop them down to 1e-1 just for the sake of trying to get a feasible solution returned it still does not work. Does this mean maybe that the solution converges but upper/lower bounds are violated? Any advice would be much appreciated.

##### 15 Comments

Torsten
on 4 Aug 2022

### Accepted Answer

Alan Weiss
on 10 Jul 2022

I think that you have a misunderstanding about what the iterative display shows. For example, consider the documentation example about trajectory optimization Discretized Optimal Trajectory, Problem-Based. If you insert iterative display in an infeasible problem there, you get the following display:

p0 = [0 0 0];

pF = [5 10 3];

myprob = setupproblem(1);

opts = optimoptions("coneprog",Display="iter");

[solm,fvalm,eflagm,outputm] = solve(myprob,Options=opts);

function trajectoryprob = setupproblem(T,air)

if nargin == 1

air = false;

end

N = 50;

g = [0 0 -9.81];

p0 = [0 0 0];

pF = [5 10 3];

Amax = 25;

t = T/N;

p = optimvar("p",N,3);

v = optimvar("v",N,3);

a = optimvar("a",N-1,3,"LowerBound",-Amax,"UpperBound",Amax);

trajectoryprob = optimproblem;

s = optimvar("s",N-1,"LowerBound",0,"UpperBound",3*Amax);

trajectoryprob.Objective = sum(s)*t;

scons = optimconstr(N-1);

for i = 1:(N-1)

scons(i) = norm(a(i,:)) <= s(i);

end

acons = optimconstr(N-1);

for i = 1:(N-1)

acons(i) = norm(a(i,:)) <= Amax;

end

vcons = optimconstr(N+1,3);

vcons(1,:) = v(1,:) == [0 0 0];

if air

vcons(2:N,:) = v(2:N,:) == v(1:(N-1),:)*exp(-t) + t*(a(1:(N-1),:) + repmat(g,N-1,1));

else

vcons(2:N,:) = v(2:N,:) == v(1:(N-1),:) + t*(a(1:(N-1),:) + repmat(g,N-1,1));

end

vcons(N+1,:) = v(N,:) == [0 0 0];

pcons = optimconstr(N+1,3);

pcons(1,:) = p(1,:) == p0;

if air

pcons(2:N,:) = p(2:N,:) == p(1:(N-1),:) + t*(1+exp(-t))/2*v(1:(N-1),:) + t^2/2*(a(1:(N-1),:) + repmat(g,N-1,1));

else

pcons(2:N,:) = p(2:N,:) == p(1:(N-1),:) + t*v(1:(N-1),:) + t^2/2*(a(1:(N-1),:) + repmat(g,N-1,1));

end

pcons((N+1),:) = p(N,:) == pF;

trajectoryprob.Constraints.acons = acons;

trajectoryprob.Constraints.scons = scons;

trajectoryprob.Constraints.vcons = vcons;

trajectoryprob.Constraints.pcons = pcons;

end

The iterative display looks a lot like yours. This problem is definitely infeasible, it is not a question of twiddling some options to make it feasible. I know that this problem is infeasible because setupproblem(1) specifies too small a time for the problem to be solved with the given limits on applied acceleration (see the example for details). Perhaps something like that is going on with your example.

Alan Weiss

MATLAB mathematical toolbox documentation

### More Answers (0)

### See Also

### Categories

### Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!