Hi guys, Is there a way to terminate a Solve[] call when the first solution is found?
Asking this because sometimes I ask Mathematica to solve a system of equation with a LOT of variables, and “never” terminates because it will require days or it’ll run out of RAM.
But I’m not interested in all the solutions, just that a solution EXISTS, I’m interested in knowing simply if the system is solvable.
Hi Andrea,
f you have a simple equation to solve for one variable, its difficult to stop the process.
If its a system of equations with a set of variables, Sort[] the equation list for the Count [] of the variables and try a Reduce[] on the subset of equations for a single variable and Replace[] the Rest[] of the equation list by possible solutions found for single variables.
Such an algorithm is in some sense implemented in Groebner basis on the list of expr, in the set expr==0. It is an abstract schema like eliminating variables step by step in high school algebra.
The list of equivalent expressions to be set to zero can be used to make a run through a tree of Solve and Replace until for thr first time the complete list evaluates to zeros.