5
$\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$
6
  • 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$ Commented Nov 23, 2015 at 23:12
  • 1
    $\begingroup$ Can you try GroebnerBasis[{equations}, x1, {x2, x3, x4}]? $\endgroup$ Commented Nov 23, 2015 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$ Commented Nov 23, 2015 at 23:23
  • 1
    $\begingroup$ Then, can you answer your own question? $\endgroup$ Commented Nov 24, 2015 at 2:09
  • $\begingroup$ Well, now I can (thank you), but surely you (J.M.) deserve the points/credit/whatever. $\endgroup$ Commented Nov 24, 2015 at 9:33

1 Answer 1

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
  • 1
    $\begingroup$ You might get a speed boost with GroebnerBasis[{equations}, x1, {x2, x3, x4}, MonomialOrder->EliminationOrder]. $\endgroup$ Commented Nov 27, 2015 at 16:30

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.