SQPMethode provides 'Error_on_fail', while opts.error_on_fail = false

706 views
Skip to first unread message

Mischa Huisman

unread,
Nov 22, 2021, 1:34:13 PM11/22/21
to CasADi
Hello,

I'm working on Lap time optimization, with dynamics that evolve w.r.t. space instead of time. I implemented my problem via 'IPOPT', but to improve the computation efficiency I try to compile my code to MEX, and therefor I try to switch to SQPmethod. 

However, when I try to solve my optimization problem it provides the error provided below. I have the opts.error_on_fail = false; option already implemented, but the error does not disappear. Any suggestions? In the attachments my code, which is programmed in MatLab R2021a. 

-------------------------------------------
This is casadi::QRQP
Number of variables:                            1210
Number of constraints:                          1017
Number of nonzeros in H:                       10000
Number of nonzeros in A:                       10517
Number of nonzeros in KKT:                     32261
Number of nonzeros in QR(V):                   28090
Number of nonzeros in QR(R):                   54181
-------------------------------------------
This is casadi::Sqpmethod.
Using exact Hessian
Number of variables:                            1210
Number of constraints:                          1017
Number of nonzeros in constraint Jacobian:     10517
Number of nonzeros in Lagrangian Hessian:      10000

iter      objective    inf_pr    inf_du     ||d||  lg(rg) ls
   0  1.360635e-001 1.50e+002 9.61e-004 0.00e+000       -  0
 Iter  Sing        fk      |pr|   con      |du|   var     min_R   con  last_tau  Note
    0     1         0  1.5e+002  2218   0.00096  1086  2.9e-018  1209         0  
Error using casadi.Function/call (line 942)
Error in Function::operator() for 'solver' [Sqpmethod] at .../casadi/core/function.cpp:1368:
Error in Function::operator() for 'qpsol' [Qrqp] at .../casadi/core/function.cpp:1368:
.../casadi/core/conic.cpp:525: conic process failed. Set 'error_on_fail' option to false to ignore this error.

Error in casadi.Function/paren (line 1770)
        res = self.call(varargin);

Error in casadi.Function/subsref (line 1751)
        [varargout{1:nargout}]= paren(self, s.subs{:});

Error in MPC_V4_0 (line 126)
   [ufsol, xfsol] = full(MPC([x;x_n]));
_______________________________________________________________________________________
MPC-Compiled.zip

Marc-Simon Schäfer

unread,
Nov 24, 2021, 11:33:53 AM11/24/21
to CasADi
Hi,
it seems that you just disabled the error_on_fail for the SQPmethod. Try it also for your QP-solver:
opts.qpsol_options.error_on_fail = false;

Bye

Tong Zhao

unread,
Oct 10, 2022, 5:29:09 PM10/10/22
to CasADi
In your attached file, you missed this file 'Eul_V2_11_Ds=72_N=500_PolicyOff_R=0.mat', therefore I cannot run it.
Reply all
Reply to author
Forward
0 new messages