opti.solve() stuck/ maximum iterations exceeded

1,409 views
Skip to first unread message

Alessandro Maria Laspina

unread,
Aug 13, 2021, 1:41:57 PM8/13/21
to CasADi
Hello Joris, 

I have rewritten my system completely as an inline function of x and u from the previous question in Using tabulated data for nonlinear MPC using MATLAB (google.com). Previously, I had mentioned that the solver was throwing a NaN, but for some reason now it gets stuck at opti.solve() for several minutes only to return this error:

Error using casadi.Opti/solve (line 253)
Error in Opti::solve [OptiNode] at
.../casadi/core/optistack.cpp:159:
.../casadi/core/optistack_internal.cpp:999: Assertion
"return_success(accept_limit)" failed:
Solver failed. You may use opti.debug.value to
investigate the latest values of variables.
return_status is 'Maximum_Iterations_Exceeded'

The following formulation uses no parameters- I wrote the entire system using symbolics in another script then copied and pasted the result after I replaced the names of each variable with its corresponding place in the x or u array, where x are the state variables and u are the control variables. 

I can tell that the maximum number of iterations exceeded- is this on Casadi's side or ipopt? And if so, what is causing this issue and how can I obtain the outputs of each iteration step given by ipopt?

Thanks, 
Alessandro Laspina. 
nlp.zip

siddhartha ganguly

unread,
Aug 23, 2021, 12:54:29 PM8/23/21
to CasADi
Yeah, I'm facing the same problem solving a trajectory optimization problem as well. After reaching the limit of 3000 iteration MATLAB shows, maximum iterations reached. How to increase that count on max iter? 

John Biscanti

unread,
Aug 23, 2021, 4:35:07 PM8/23/21
to CasADi
If you check out my code on the previous post it should help you.
Reply all
Reply to author
Forward
0 new messages