I have the following function
K[theta_, phi_] := Module[{c1, c2, c3, Phi, PhiPr, x, y},
{c1, c2, c3} =
1 - 3 Sin[theta]^2 Cos[phi - 2 Pi (# - 1)/3]^2 & /@ {1, 2, 3};
Phi = Sqrt[((c2 + c3)^2 - c1^2)/(4 c2 c3)];
PhiPr = ((c3 - c2)/c1) Phi;
If[0 <= Phi^2 <= 1,
{x, y} /.
Solve[Sin[Sqrt[3] x/2] == Phi &&
Sin[3 y/2] ==
PhiPr && (c2 + c3) Cos[Sqrt[3] x/2] == -c1 Cos[3 y/2] && -Pi <=
x <= Pi && -Pi <= y <= Pi, {x, y}]
, Null]
]
Sometimes it behaves itself and returns me either a Null (as desired) or an actual number. However sometimes it is a naughty function and returns something strange. For example if I compute K[0.1,0]
it returns me {x$17889, y$17889}
.
What is this output? I don't understand. Many thanks
Module
works and is explained in the "Details" section of its documentation page. $\endgroup$ – Michael E2 Jan 2 '15 at 19:40