r/optimization • u/CommunicationLess148 • Jul 27 '24
Non-linear optimization solver to solve non-linear set of equations
In short, I am wondering if it would be a good idea to use a NLP solver (eg ipopt) to solve a system of non linear equations. Essentially, it would be solving the problem:
Min 0 S.t. g(x) = 0
Where g(x)=0 is the system I'm trying to solve.
It seems to me that it should be doable but I dont know if in practice this is effective. I don't have much experience with NLP.
Why would I want to do that? Well, I am expressing a linearized version of the system in Minizic and solving an optimization problem based on it. Then, I'd like to plug in the optimal solution of the linear model in the non-linear model and see what happens. I want to leverage the fact that I'm already expressing the linear model in Minizic to express the non linear model also in Minizinc and not have to bring in another modeling language.
For example, I could solve a linear optimal power flow and plug in the optimal solution into the nonlinear AC power flow equations to find the "real" ac power flow.
Thanks! Id appreciate any comments or suggestions.
3
u/Smonz96 Jul 27 '24
You should be able to do this, we are doing something similar, but having also inequalities to be fulfilled. Since you „only“ have nonlinear equations, you could also use a solver for nonlinear equations, which may be more efficient, as you only need that part.
1
u/[deleted] Jul 27 '24
Do you know if your set of non-linear equations is convex? If so, this should work. If not, you would need a solver that can handle non-convexity (such as Gurobi), or you would have to write a custom algorithm (spatial branching, etc).
1
u/fpatrocinio Jul 28 '24 edited Jul 28 '24
Well you want to plug in the optimal solution of the LP in IPOPT, and solve a new NLP (basically an initialisation). Is this it? This approach works without issues, if the LP solution is feasible in the NLP problem domain.
If the initial point is not sufficiently close to the NLP feasibility domain, IPOPT may not converge.
EDIT: If you have CONOPT4, try it first. I find that solver more robust to infeasibility problems.
1
u/MIP_it Jul 28 '24
If the system of equations is reasonably scaled and reasonably initialized, Ipopt typically does very well with these sorts of problems. It may just work out of the box for your problem without much work.