Use "solution converged to an infeasible point" as an input

1 Ansicht (letzte 30 Tage)
Maria Sanz
Maria Sanz am 20 Sep. 2019
Bearbeitet: Stephan am 20 Sep. 2019
i am using fmincon to optimize f:
[X,f]=fmincon(@(X) obj_function(X,P,Pd,intervalotiempo),X0,A,B,Aeq,Beq,LB,UB,nonlin);
I would like to use the output of this operation in a way that if the solution converged to an infeasible point the program stops. How could I make this possible?

Akzeptierte Antwort

Stephan
Stephan am 20 Sep. 2019
Bearbeitet: Stephan am 20 Sep. 2019
Use the output exitflag to find out if there was no feasible point:
[x,fval,exitflag,output] = fmincon(@(X) obj_function(X,P,Pd,intervalotiempo),X0,A,B,Aeq,Beq,LB,UB,nonlin);
If the exitflag = -2 then there was no feasible point found.

Weitere Antworten (0)

Kategorien

Mehr zu Nonlinear Optimization finden Sie in Help Center und File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by