4

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, {θ, ϕ, ψ}]
Öskå
  • 8,587
  • 4
  • 30
  • 49
Max Jasper
  • 153
  • 5
  • If you get rid of the double angles first, it works fine. Try eq = TrigExpand @ {... – wxffles Sep 03 '14 at 00:37
  • Very nice n simple. Thanks a lot. – Max Jasper Sep 03 '14 at 00:52
  • 2
    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. – Artes Sep 03 '14 at 01:37
  • @wxffles Why not post an answer? – Mr.Wizard Sep 03 '14 at 02:45
  • @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! – wxffles Sep 03 '14 at 03:28
  • @Artes I propose that you post your answer as well. I think that it is of value, if one can solve the same problem using different approaches. Then in a more complex problem, in which one of these approaches will fail, the other may work. – Alexei Boulbitch Sep 03 '14 at 07:54

1 Answers1

12

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

wxffles
  • 14,246
  • 1
  • 43
  • 75