0
$\begingroup$

I have the following code to solve the equations, and wanted to plot them on unit circle on the complex plane, one by one. For example, this code gives me $6$ solutions, thus I would like to plot six circles, and on each, plot one of solutions as a unit vector on it.

sol = Solve[
  Sin[a - b] + Sin[a] == 0 && Sin[b - a] + Sin[b] == 0 && 
   Sin[-a] + Sin[-b] == 0, {a, b}]

enter image description here

Any idea? Thanks a lot.

$\endgroup$
3
  • $\begingroup$ It is not clear to me,what exactly you want. a and b are only defined up to a multiple of Pi. Therefore it makes sense to plot them on the unit cycle. That would give 2 points, one for a and one for b. However, what do you mean by "as a vector"? $\endgroup$ Feb 6, 2022 at 16:14
  • $\begingroup$ @DanielHuber For example, the first solution gives $a=2\pi c_1,b=-2\pi c_2$, therefore I need to plot two vectors on the unit circle: $(\cos(2\pi c_1),\sin(2\pi c_1)$ and $(\cos(-2\pi c_2),\sin(-2\pi c_2))$ $\endgroup$
    – M.K
    Feb 6, 2022 at 16:33
  • $\begingroup$ Since c is required to be an integer, both {Cos[2 Pi c], Sin[2 Pi c]} and {Cos[-2 Pi c], Sin[-2 Pi c]} are the point {1, 0} $\endgroup$
    – Bob Hanlon
    Feb 6, 2022 at 16:38

1 Answer 1

1
$\begingroup$
ContourPlot[{Sin[a - b] + Sin[a] == 0, Sin[b - a] + Sin[b] == 0, 
  Sin[-a] + Sin[-b] == 0}, {a, -10, 10}, {b, -10, 10}, 
 PlotPoints -> 50]

enter image description here

From above plot,we can find that all of {a,b} is the intersection of three contours,it means that only two independent equations in the original three equations. We can verified this by

Simplify[Sin[-a] + Sin[-b] == 0, 
 Sin[a - b] + Sin[a] == 0 && Sin[b - a] + Sin[b] == 0]

True

And we can plot all the points by MeshFunction.

ContourPlot[{Sin[a - b] + Sin[a] == 0} , {a, -10, 10}, {b, -10, 10}, 
 MeshFunctions -> {Function[{a, b}, Sin[a - b] + Sin[a]], 
   Function[{a, b}, Sin[b - a] + Sin[b]]}, Mesh -> {{0}}, 
 MeshStyle -> Directive[Opacity[1], Red], ContourStyle -> Opacity[.1],
  PlotPoints -> 50]

enter image description here

The same as

Graphics[{Red, Point[{a, b}]} /. 
  Table[Solve[
     Sin[a - b] + Sin[a] == 0 && Sin[b - a] + Sin[b] == 0 && 
      Sin[-a] + Sin[-b] == 0, {a, b}] /. {C[1] -> c1, 
     C[2] -> c2}, {c1, -2, 2}, {c2, -2, 2}], Axes -> True]

enter image description here

OP

For a or b,AngleVector[a] or AngleVector[b] have only four points.

Graphics[{Red, Point[AngleVector[a]], Point[AngleVector[b]]} /. 
  Table[Solve[
     Sin[a - b] + Sin[a] == 0 && Sin[b - a] + Sin[b] == 0 && 
      Sin[-a] + Sin[-b] == 0, {a, b}] /. {C[1] -> c1, 
     C[2] -> c2}, {c1, -10, 10}, {c2, -10, 10}], Axes -> True]
$\endgroup$
1
  • $\begingroup$ Thank you so much!! Could you explain why 'we can find that all of {a,b} is the intersection of three contours,it means that only two independent equations in the original three equations.' ? $\endgroup$
    – M.K
    Feb 7, 2022 at 11:16

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.