Message Boards Message Boards

0
|
1523 Views
|
3 Replies
|
3 Total Likes
View groups...
Share
Share this post:

Terminating Solve[] operation when the first solution is found

Posted 1 year ago

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.

Is this possible? Thanks!

POSTED BY: Andrea Frasca
3 Replies

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.

Regards Roland

POSTED BY: Roland Franzius
Posted 1 year ago

Thanks a lot for these suggestions!

POSTED BY: Andrea Frasca

Difficult to make suggestions without a concrete example to try them on. Maybe FindInstance will do what you want?

POSTED BY: Daniel Lichtblau
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard

Group Abstract Group Abstract