IPOPTReturnCode
Details and Options
- To use IPOPTReturnCode, you first need to load it using Needs["IPOPTLink`"].
- IPOPTReturnCode is used on an IPOPTData expression created by IPOPTMinimize.
- The following codes may be returned by the IPOPT solver, with short descriptions from the IPOPT documentation:
-
0 Optimal solution found 1 Solved to acceptable level 2 Converged to a point of local infeasibility. Problem may be infeasible 3 Search direction is becoming too small 4 Iterates diverging; problem might be unbounded 5 Stopping optimization at current point as requested by user 6 Feasible point for square problem found -1 Maximum number of iterations exceeded -2 Restoration failed -3 Error in step computation (regularization becomes too large?) -4 Maximum CPU time exceeded -10 Problem has too few degrees of freedom -11 Invalid problem definition -12 Invalid option -13 Invalid number detected -100 Unrecoverable exception -101 Unknown exception caught in Ipopt -102 Not enough memory -199 Internal IPOPT error: unknown SolverReturn value
Examples
Basic Examples (2)
Needs["IPOPTLink`"]Solve a minimization problem using IPOPTMinimize:
sol = IPOPTMinimize[-Log[a * E ^ (1 - a)], {a}, {1.}, {{0., 1.*^40}}]IPOPTReturnCode[sol]Needs["IPOPTLink`"]Solve a minimization problem where an overflow happens and $Failed is returned by default.
sol = IPOPTMinimize[-Log[a * E ^ (a - 1)], {a}, {1000.}, {{0., 1.*^40}}]Return a solution object so that we can extract the error code, and turn off the messages:
sol = IPOPTMinimize[-Log[a * E ^ (a - 1)], {a}, {1000.}, {{0., 1.*^40}}, "RuntimeOptions" -> {"RuntimeErrorHandler" -> "ReturnObject", "WarningMessages" -> False}]IPOPTReturnCode[sol]Related Guides
Text
Wolfram Research (2016), IPOPTReturnCode, Wolfram Language function, https://reference.wolfram.com/language/IPOPTLink/ref/IPOPTReturnCode.html.
CMS
Wolfram Language. 2016. "IPOPTReturnCode." Wolfram Language & System Documentation Center. Wolfram Research. https://reference.wolfram.com/language/IPOPTLink/ref/IPOPTReturnCode.html.
APA
Wolfram Language. (2016). IPOPTReturnCode. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/IPOPTLink/ref/IPOPTReturnCode.html
BibTeX
@misc{reference.wolfram_2026_ipoptreturncode, author="Wolfram Research", title="{IPOPTReturnCode}", year="2016", howpublished="\url{https://reference.wolfram.com/language/IPOPTLink/ref/IPOPTReturnCode.html}", note=[Accessed: 15-June-2026]}
BibLaTeX
@online{reference.wolfram_2026_ipoptreturncode, organization={Wolfram Research}, title={IPOPTReturnCode}, year={2016}, url={https://reference.wolfram.com/language/IPOPTLink/ref/IPOPTReturnCode.html}, note=[Accessed: 15-June-2026]}