# Speeding up the solution of a large set of nonlinear algebraic equations in sympy

I have a quite large algebraic equation system to solve, the system is so large, I can't post the example here, so I am posting it to pastebin.

The sympy.solve is taking ages: I started it this morning and it is still running on a single core. I have tried to use the optional arguments from the sympy documentation, like quick=True and warn=True, to speed things up and get warnings if the solver fails, but there was no warning given, and the solver is still dying.

Is there a way multiprocessing can be used or maybe mpi4py with the solve function in sympy. I have access to HPC resources, but I'm not sure how solve can be separated into different MPI processes.

Is there a way in sympy to get an idea if the system is solvable or if the solver is diverging? Something like runtime solver information, but without running in debug mode?

• Besides being nonlinear, what kind of equations do you have? – nicoguaro Jan 24 '19 at 16:24
• @nicoguaro: you can see what the equations are, I have posted the code in pastebin, the link is in the question. – tmaric Jan 24 '19 at 16:28
• Your equations seem to be rational functions, but I can't tell because they are too long. – nicoguaro Jan 24 '19 at 16:51
• A while ago I read this, which is a summary of some mathematical approaches to handling large polynomial systems: Solving Systems of Polynomial Equations by Bernd Sturmfels Some are theoretical, but quite a few are computational and practical, implemented in off-the-shelf software, so perhaps some techniques there might come in useful? Generally speaking, solving an arbitrary large polynomial system symbolically is intractable, and numerically it's merely very hard, so it has to have some special properties for you to make progress. – Kirill Jan 24 '19 at 17:01
• @nicoguaro I cleared the fractions (not an equivalence transformation) and tried to get rid of common subexpressions: gist.github.com/ikirill/06c1dc70b239cff1b47e70d2493d561b – Kirill Jan 24 '19 at 17:34