scipy optimize method
ipyopt also comes with a ipopt method for
`scipy.optimize.minimize`_:
result = scipy.optimize.minimize(
fun=...,
x0=...,
jac=...,
constraints=...,
method=ipyopt.optimize.ipopt,
...
)
Warning
The ipopt method differs in some points from the standard scipy
methods:
The argument
jacis mandatory (explicitly use `scipy.optimize.approx_fprime`_ if you want to numerically approximate it or see Automatic symbolic derivatives / code generation on how to auto differentiate symbolic expressions)hessis not the Hessian of the objective functionfbut the Hessian of the LagrangianL(x) = obj_factor * f(x) + lagrange * g(x), wheregis the constraint residuals.The argument
constraintsis mandatory. It is also not a list as in usual scipy optimize methods, but a singleConstraintinstance.
If you are looking for a solution whose API is closer to the usual scipy interface, have a look at cyipopt.