I have a set of three moderately simple simultaneous equations that I'd like to simplify and eliminate a set of variables for (this is a simple example of a more general class of problem - but I'd like to get the simple example working before starting on the bigger ones). Asking Mathematica to Eliminate
two of the three variables I'd like to remove and then simplifying the result gets me to the answer fairly quickly: however asking Mathematica to Eliminate
all three of the variables at once hangs. Are there any tricks I can use to help Eliminate
with this task, or generalisations of it?
My example has three matrices (adjoint representation of so(3) for the interested)
b1 = {{0, 0, 0}, {0, 0, 1}, {0, -1, 0}};
b2 = {{0, 0, -1}, {0, 0, 0}, {1, 0, 0}};
b3 = {{0, 1, 0}, {-1, 0, 0}, {0, 0, 0}};
and then the equations are
{xt1, xt2, xt3} == {x1, x2, x3}.MatrixExp[t1 b1].MatrixExp[t2 b2].MatrixExp[t3 b3]
where I would like to eliminate the t1
, t2
, and t3
variables.
Running this to eliminate t1
and t2
gives
Timing@Simplify@Eliminate[{xt1, xt2, xt3} == {x1, x2, x3}.MatrixExp[t1 b1].MatrixExp[t2 b2].MatrixExp[t3 b3], {t1, t2}]
{40.375, x1^2 + x2^2 + x3^2 == xt1^2 + xt2^2 + xt3^2}
which is the correct answer. However,
Timing@Eliminate[{xt1, xt2, xt3} == {x1, x2, x3}.MatrixExp[t1 b1].MatrixExp[t2 b2].MatrixExp[t3 b3], {t1, t2, t3}]
runs forever (at least four hours on my laptop). How can I make Eliminate
s life easier, or are there other tools I could try to solve this system of equations? (Extra information if helpful: the functional form of the reduced solution(s) to members of this class of equations will always have the same functional form in the xt
variables and the x
variables, although the actual functional form is unknown - I'm not sure if this can be leveraged within Mathematica to help?)
Eliminate[{x1, x2, x3} == {x2 + t2 + t3, x3 + t1 + t2 + 2 t3, x1 + t1 + t3}, {t1, t2, t3}]
. Your comment does suggest the OP should perhaps be content with the first attempt, checking afterwards that the third variable happened to get eliminated. That's not completely reliable either, I suspect. $\endgroup$