Hi,
Thanks for providing this software.
Does the computation of parametric sensitivities of NLP solutions work with IPOPT?
I have been following the sample code provided in the "nlp_sensitivities.py" file from the example pack.
Ideally I would like to use IPOPT for both the calls to
sol = solver(x0=w0, lbx=lbw, ubx=ubw, lbg=lbg, ubg=ubg, p=0)
and to
hsolver = solver.factory('h', solver.name_in(), ['sym:hess:f:p:p'])
hsol = hsolver(x0=sol['x'], lam_x0=sol['lam_x'], lam_g0=sol['lam_g'],
lbx=lbw, ubx=ubw, lbg=lbg, ubg=ubg, p=0)
However, it would be already good to be able to solve the original problem (the first call) using IPOPT.
Replacing 'sqpmethod' by IPOPT for both calls converge, but it seems an error occurs when the results are returned:
428 sens_solver = solver.factory('h', solver.name_in(), ['jac:x:p'])
--> 429 dxsol_dx0 = sens_solver(res["x"],arg["p"],arg["lbx"],arg["ubx"],arg["lbg"],arg["ubg"],res["lam_x"],res["lam_g"])
~\AppData\Local\Programs\Python\Python37\lib\site-packages\casadi\casadi.py in __call__(self, *args, **kwargs)
13304 if len(args)>0:
13305 # Ordered inputs -> return tuple
> 13306 ret = self.call(args)
13307 if len(ret)==0:
13308 return None
~\AppData\Local\Programs\Python\Python37\lib\site-packages\casadi\casadi.py in call(self, *args)
12184
12185 """
> 12186 return _casadi.Function_call(self, *args)
12187
12188
RuntimeError: .../casadi/core/function_internal.hpp:1219: Evaluation failed
When following the recipe exactly, it sometimes works, but on larger problems the same behavior occurs, depending seemingly on the initial values given.
Any pointers how to improve the chances of successfully generating the sensitivities?
Regards