4
$\begingroup$

I am trying to use Mathematica to Eliminate 3 following variable from 4 equations. Any clue or link to similar solved problem is highly appreciated:

eq = {
  Cos[θ] + Cos[ϕ] + Cos[ψ] == a,
  Sin[θ] + Sin[ϕ] + Sin[ψ] == b,
  Cos[2 θ] + Cos[2 ϕ] + Cos[2 ψ] == c,
  Sin[2 θ] + Sin[2 ϕ] + Sin[2 ψ] == d};
Eliminate[eq, {θ, ϕ, ψ}]
$\endgroup$
6
  • $\begingroup$ If you get rid of the double angles first, it works fine. Try eq = TrigExpand @ {... $\endgroup$
    – wxffles
    Sep 3, 2014 at 0:37
  • $\begingroup$ Very nice n simple. Thanks a lot. $\endgroup$
    – Max Jasper
    Sep 3, 2014 at 0:52
  • 2
    $\begingroup$ Solve can eliminate variables too, e.g. Solve[eq, {a, b, c, d}, {θ, ϕ, ψ}, InverseFunctions -> True] it is even smarter than Eliminate (read carefully this answer). This can be helpful as well. $\endgroup$
    – Artes
    Sep 3, 2014 at 1:37
  • $\begingroup$ @wxffles Why not post an answer? $\endgroup$
    – Mr.Wizard
    Sep 3, 2014 at 2:45
  • $\begingroup$ @Mr.Wizard Because I'm lazy and I already have more internet points than I can spend. But I found something interesting about the answer. Behold! $\endgroup$
    – wxffles
    Sep 3, 2014 at 3:28

1 Answer 1

12
$\begingroup$

Removing the double angles (e.g. $\cos(2 \theta) = \cos^2(\theta) - \sin^2(\theta)$) with TrigExpand allows the elimination to be performed:

eq = TrigExpand @ {
  Cos[θ] + Cos[ϕ] + Cos[ψ] == a,
  Sin[θ] + Sin[ϕ] + Sin[ψ] == b,
  Cos[2 θ] + Cos[2 ϕ] + Cos[2 ψ] == c,
  Sin[2 θ] + Sin[2 ϕ] + Sin[2 ψ] == d};
Eliminate[eq, {θ, ϕ, ψ}]

$a^4+2 a^2 \left(b^2-c-2\right)+\left(b^2+c\right)^2+d^2=4 b (a d+b)$

Let us plot this implicit surface:

ListAnimate @ Table[ContourPlot3D[
  a^4 + 2 a^2 (-2 + b^2 - c) + (b^2 + c)^2 + d^2 == 4 b (b + a d),
  {a, -5, 5}, {b, -5, 5}, {c, -5, 5}], {d, -5, 5, 0.2}]

pipepass

$\endgroup$
1
  • $\begingroup$ Simply amazing. Thanks for enlightening clues and animation. $\endgroup$
    – Max Jasper
    Sep 3, 2014 at 6:44

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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