# Returning the best possible value found when the search direction is becoming too small (IPOPT via Pyomo)

I'm using Pyomo to solve an optimization problem and I'm using as a solver IPOPT. Now I'm getting an error from IPOPT.

EXIT: Search Direction is becoming Too Small.

according to the docs, this means:

Search Direction is becoming Too Small.

This indicates that IPOPT is calculating very small step sizes and making very little progress. This could happen if the problem has been solved to the best numerical accuracy possible given the current scaling.

Question: I interpret this as that IPOPT has a value calculated, but is returning an error because it isn't 'satisfied'? I find it weird that they don't return a 'best possible value'. Why is this and can we make IPOPT return that best possible value (so that when the search direction is becoming too small, return the best found value at that point)?

edit I came across this document which seems useful for solving my case. https://coin-or.github.io/Ipopt/OPTIONS.html.

Imagine a function $$f(x) = 0.5 (\varepsilon*x)^2$$ where $$\varepsilon$$ is the floating point epsilon. The gradient as you approach 0 becomes vanishingly small so you Ipopt with the current settings might not feel confident that can do another step but knows from the KKT conditions that it has reached a point which satisfies 2nd order optimality conditions.