What good libraries are there for solving a system of non-linear equations in C++?

hoffer picture hoffer · Nov 20, 2010 · Viewed 12.6k times · Source

In a C++ application I'm coding, I need to solve a system of non-linear equations (N equations, N unknowns).

The systems I'm solving will be rather small (up to 10 equations/unknowns), so performance is not going to be a real issue. I've searched the web a bit for a non-linear solver library, and I couldn't get to something which looks easy to use (got to NOX and C/C++ Minpack, but both seem to be an overkill for my need).

Any thoughts and ideas of easy-to-use libraries for this purpose?

Answer

duffymo picture duffymo · Nov 20, 2010

One thing should be clear: non-linear equation solution isn't easy. It's not the same as solving linear equations. You aren't always guaranteed to get a solution. And your choice of initial condition and incrementation strategy can have a profound effect on the solution you do get.

With that said, I can't recommend a particular library, but you should be on the lookout for a linear algebra package that includes Newton-Raphson iteration in its menu of choices.