4
$\begingroup$

I have four order-2 polynomial equations in four unknowns. Call the unknowns x1,x2,x3,x4. I want only x1, and am not at all interested in the values of x2,x3,x4.

Obviously Solve[{…,…,…,…}, {x1,x2,x3,x4}] should give the answer and more. But takes a long time of CPU whirring: indeed, it hasn’t finished. Is there a way to tell Solve (or another function) that x2,x3,x4 are not to appear in the solution for x1, but that there is no need to solve for them? If so, please, how?

Indeed, I would much rather that Solve return the coefficients of the polynomial for x1, rather than returning the solution to that (perhaps high-order) polynomial. Can Solve also be instructed to do that?

Thank you.

$\endgroup$
  • 1
    $\begingroup$ Does using Eliminate help speed up the computation? I have the following in mind: Solve[Eliminate[{…,…,…,…}, {x2,x3,x4}],x1]. Perhaps you could give us a working example? $\endgroup$ – QuantumDot Nov 23 '15 at 23:12
  • 1
    $\begingroup$ Can you try GroebnerBasis[{equations}, x1, {x2, x3, x4}]? $\endgroup$ – J. M. will be back soon Nov 23 '15 at 23:17
  • $\begingroup$ Both answers excellent, the GroebnerBasis being slightly superior as it returns the polynomial rather than requiring solution of a remaining equation. Both shorten the run-time to instantaneous. $\endgroup$ – jdaw1 Nov 23 '15 at 23:23
  • 1
    $\begingroup$ Then, can you answer your own question? $\endgroup$ – J. M. will be back soon Nov 24 '15 at 2:09
  • $\begingroup$ Well, now I can (thank you), but surely you (J.M.) deserve the points/credit/whatever. $\endgroup$ – jdaw1 Nov 24 '15 at 9:33
4
$\begingroup$

As J.M. posted in a comment, GroebnerBasis[{equations}, x1, {x2, x3, x4}] does exactly what was asked.

But a commendation also goes to QuantumDot’s suggestion of Solve[Eliminate[{…,…,…,…}, {x2,x3,x4}],x1].

Both reduced the run-time to seemingly instantaneous.

$\endgroup$
  • 1
    $\begingroup$ You might get a speed boost with GroebnerBasis[{equations}, x1, {x2, x3, x4}, MonomialOrder->EliminationOrder]. $\endgroup$ – Daniel Lichtblau Nov 27 '15 at 16:30

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.