casadi / casadi

CasADi is a symbolic framework for numeric optimization implementing automatic differentiation in forward and reverse modes on sparse matrix-valued computational graphs. It supports self-contained C-code generation and interfaces state-of-the-art codes such as SUNDIALS, IPOPT etc. It can be used from C++, Python or Matlab/Octave.
http://casadi.org
GNU Lesser General Public License v3.0
1.58k stars 357 forks source link

Trying to use MA27 #3651

Closed neverorfrog closed 1 month ago

neverorfrog commented 1 month ago

Hi, I am trying to use the opti stack to solve nmpc, using ipopt. Specifically, i want to use the linear solver ma27. I have installed the hsl libraries trying both thirdparty hsl and this and connected casadi to hsl through the code below, but ipopt is still using Mumps, without generating any error message.

opti = ca.Opti()    
p_opts = {'ipopt.print_level': 5, 'print_time': False, 'expand': False}
s_opts = {"linear_solver": "ma27",'hsllib': '/usr/local/lib/libcoinhsl.so'}
opti.solver("ipopt", p_opts, s_opts)

Besides, the value in the field does not matter, I could write anything there, but opti keeps ignoring it and using Mumps. I am using casadi 3.6.5 on PopOS 22.04. Thank you in advance!

neverorfrog commented 1 month ago

I managed to use MA27 this way:

opti = ca.Opti()
p_opts = {'ipopt.print_level': 5, 'print_time': False, 'expand': False, 'ipopt.linear_solver': 'ma27', 'ipopt.hsllib': '/usr/local/lib/libcoinhsl.so'}
opti.solver("ipopt", p_opts)