yalmip / YALMIP

MATLAB toolbox for optimization modeling
https://yalmip.github.io/
Other
464 stars 134 forks source link

Mosek stall error #1200

Closed Moradielham closed 1 year ago

Moradielham commented 1 year ago

Dear professor Excuse me, What problems can cause the following error? msk_res_trm_stall() And results are near optimal, feasible and stable

Moradielham commented 1 year ago

How can I solve the problem in this code? thank you for your guidance

johanlofberg commented 1 year ago

Solves without issues here

Interior-point solution summary
  Problem status  : PRIMAL_AND_DUAL_FEASIBLE
  Solution status : OPTIMAL
  Primal.  obj: -2.0414896190e+03   nrm: 3e+05    Viol.  con: 8e-02    var: 9e-10    barvar: 0e+00  
  Dual.    obj: -2.0414892875e+03   nrm: 2e+06    Viol.  con: 0e+00    var: 5e-13    barvar: 7e-06  
johanlofberg commented 1 year ago

And there is no function in recent YALMIP called checkset. It is called check. It is also a bad idea to simply check if a residual is positive, as most solvers work with infeasible models and thus easily can return marginally infeasible solutions, also for problems that are feasible. If you want to do that, you have to add margins in the model, and the explicitly check the solution you have obtained (not using check, as check then will look at the model with the added margins, which once again can be marginally infeasible)

Moradielham commented 1 year ago

thanks for your reply

  1. Did you change the code or does it depend on the version(mosek or yalmip)? I have a near optimal solution with a stall error. If I put this controller in simulink it doesn't give an acceptable response. If I change the version will the problem be solved?
  2. In general, what factors lead to stall error ?
  3. Is my controllers bug related to stability?
  4. What code would you suggest to check stability, without changing the margins manualy?
johanlofberg commented 1 year ago

no changes, mosek 9.2

to check feasibility you evaluate the things you want to hold. if you used P>=0.1*I instead of P>=0 as a margin for P guaranteeing P being positive definite, you check the eigenvalues of P afterwards etc.