# Computing Jacobians and Hessians directly for IPOPT optimizer

I've got a complicated expression for my constraint function $$g(x)$$, too complicated to let Mathematica compute the derivatives symbolically. By forcing only numeric inputs, IPOPT does (it appears) an approximation of the derivatives. But I can come up with a direct, simple expression for those derivatives in a callable function. Is there a simple not-documented option to provide my own callable function? I know there is using IPOPT directly.

• This sounds like you are referring to automatic differentiation, which has been the topic of a few posts mathematica.stackexchange.com/questions/1873/… mathematica.stackexchange.com/questions/85682/… and AceGEN is mentioned in theses threads wolfram.com/products/applications/acegen Oct 27 '21 at 15:24
• Not quite, since I have an approximation to the Hessian (for example) that I want to use, that is simpler than what I would get from auto diff. But I will follow the link, thanks! Oct 27 '21 at 15:31
• Aha, I see. If you are using FindMinimum does have a "Gradient" option that should allow you to specify your function, and "Method"->"InteriorPoint" appears to use IPOPTLink Oct 27 '21 at 15:45
• Thanks...I'd also want to be able to specify (from the IPOPT docs) the Jacobian of the constraints and the Hessian of the Lagrangian function. Sounds like there is no mechanism. Oct 29 '21 at 18:11