I have a complicated 4-vector, whose elements are trigonometric complex functions. I want to create 3D plots of the real and imaginary parts of each element. Additionally, I would like to evaluate the real and imaginary parts, compile the results into a table, and export them to a CSV file.
However, I'm facing issues in specific regions:
For x1 <= 1 rad (below 50 degrees), the functions are not smooth
around P1/2, the functions become indeterminate
I am aware of a boundary condition: normEvec3[0, y1_] = 0
. I believe this condition could be useful in resolving the evaluation issues, but I am unsure how to effectively implement it in a way that benefits my solution.
As an example, below I show the plot of the real part of the first matrix element normEvec3[x1_, y1_]
. The definition of normEvec3[x1_, y1_]
is also provided.
Could you provide guidance on how to handle these problematic regions while plotting and exporting the data in Mathematica? Specifically, I'm looking for ways to manage the indeterminate behaviour and lack of smoothness in those regions.
The plot you see below was generated using the following script:
normEvec3[x1_,
y1_] = -Re[(23629 - 11900 Cos[3 x1] + 5036 Cos[4 x1] -
1684 Cos[5 x1] + 412 Cos[6 x1] -
304 Sqrt[2] Sqrt[
2154 - 2896 Cos[x1] + 1915 Cos[2 x1] - 888 Cos[3 x1] +
278 Cos[4 x1] - 56 Cos[5 x1] + 5 Cos[6 x1]] +
55 Sqrt[2] Cos[3 x1] Sqrt[
2154 - 2896 Cos[x1] + 1915 Cos[2 x1] - 888 Cos[3 x1] +
278 Cos[4 x1] - 56 Cos[5 x1] + 5 Cos[6 x1]] -
16 Sqrt[2] Cos[4 x1] Sqrt[
2154 - 2896 Cos[x1] + 1915 Cos[2 x1] - 888 Cos[3 x1] +
278 Cos[4 x1] - 56 Cos[5 x1] + 5 Cos[6 x1]] +
3 Sqrt[2] Cos[5 x1] Sqrt[
2154 - 2896 Cos[x1] + 1915 Cos[2 x1] - 888 Cos[3 x1] +
278 Cos[4 x1] - 56 Cos[5 x1] + 5 Cos[6 x1]] -
4 Cos[2 x1] (-6041 +
48 Sqrt[2] Sqrt[
2154 - 2896 Cos[x1] + 1915 Cos[2 x1] - 888 Cos[3 x1] +
278 Cos[4 x1] - 56 Cos[5 x1] + 5 Cos[6 x1]]) +
2 Cos[x1] (-15698 +
99 Sqrt[2] Sqrt[
2154 - 2896 Cos[x1] + 1915 Cos[2 x1] - 888 Cos[3 x1] +
278 Cos[4 x1] - 56 Cos[5 x1] + 5 Cos[6 x1]]) -
76 Cos[7 x1] +
7 Cos[8 x1])/(\[Sqrt](1 +
Abs[((23629 - 11900 Cos[3 x1] + 5036 Cos[4 x1] -
1684 Cos[5 x1] + 412 Cos[6 x1] -
304 Sqrt[2] Sqrt[
2154 - 2896 Cos[x1] + 1915 Cos[2 x1] -
888 Cos[3 x1] + 278 Cos[4 x1] - 56 Cos[5 x1] +
5 Cos[6 x1]] +
55 Sqrt[2] Cos[3 x1] Sqrt[
2154 - 2896 Cos[x1] + 1915 Cos[2 x1] -
888 Cos[3 x1] + 278 Cos[4 x1] - 56 Cos[5 x1] +
5 Cos[6 x1]] -
16 Sqrt[2] Cos[4 x1] Sqrt[
2154 - 2896 Cos[x1] + 1915 Cos[2 x1] -
888 Cos[3 x1] + 278 Cos[4 x1] - 56 Cos[5 x1] +
5 Cos[6 x1]] +
3 Sqrt[2] Cos[5 x1] Sqrt[
2154 - 2896 Cos[x1] + 1915 Cos[2 x1] -
888 Cos[3 x1] + 278 Cos[4 x1] - 56 Cos[5 x1] +
5 Cos[6 x1]] -
4 Cos[2 x1] (-6041 +
48 Sqrt[2] Sqrt[
2154 - 2896 Cos[x1] + 1915 Cos[2 x1] -
888 Cos[3 x1] + 278 Cos[4 x1] - 56 Cos[5 x1] +
5 Cos[6 x1]]) +
2 Cos[x1] (-15698 +
99 Sqrt[2] Sqrt[
2154 - 2896 Cos[x1] + 1915 Cos[2 x1] -
888 Cos[3 x1] + 278 Cos[4 x1] - 56 Cos[5 x1] +
5 Cos[6 x1]]) - 76 Cos[7 x1] +
7 Cos[8 x1]) (Cos[2 y1] + I Sin[2 y1]))/((-40 +
14 Cos[x1] - 8 Cos[2 x1] + 2 Cos[3 x1] +
Sqrt[2] Sqrt[
2154 - 2896 Cos[x1] + 1915 Cos[2 x1] -
888 Cos[3 x1] + 278 Cos[4 x1] - 56 Cos[5 x1] +
5 Cos[6 x1]]) (-180 + 148 Cos[x1] +
42 Cos[3 x1] - 12 Cos[4 x1] + 2 Cos[5 x1] +
3 Sqrt[2] Sqrt[
2154 - 2896 Cos[x1] + 1915 Cos[2 x1] -
888 Cos[3 x1] + 278 Cos[4 x1] - 56 Cos[5 x1] +
5 Cos[6 x1]] +
Cos[2 x1] (-128 +
Sqrt[2] Sqrt[
2154 - 2896 Cos[x1] + 1915 Cos[2 x1] -
888 Cos[3 x1] + 278 Cos[4 x1] - 56 Cos[5 x1] +
5 Cos[6 x1]])))]^2 +
1/16 Abs[((2158 - 864 Cos[3 x1] + 274 Cos[4 x1] -
64 Cos[5 x1] + 7 Cos[6 x1] -
28 Sqrt[2] Sqrt[
2154 - 2896 Cos[x1] + 1915 Cos[2 x1] -
888 Cos[3 x1] + 278 Cos[4 x1] - 56 Cos[5 x1] +
5 Cos[6 x1]] +
3 Sqrt[2] Cos[3 x1] Sqrt[
2154 - 2896 Cos[x1] + 1915 Cos[2 x1] -
888 Cos[3 x1] + 278 Cos[4 x1] - 56 Cos[5 x1] +
5 Cos[6 x1]] +
Cos[2 x1] (1913 -
12 Sqrt[2] Sqrt[
2154 - 2896 Cos[x1] + 1915 Cos[2 x1] -
888 Cos[3 x1] + 278 Cos[4 x1] - 56 Cos[5 x1] +
5 Cos[6 x1]]) +
7 Cos[x1] (-416 +
3 Sqrt[2] Sqrt[
2154 - 2896 Cos[x1] + 1915 Cos[2 x1] -
888 Cos[3 x1] + 278 Cos[4 x1] - 56 Cos[5 x1] +
5 Cos[6 x1]])) Tan[x1/2]^2)/((-2 +
Cos[x1]) (-180 + 148 Cos[x1] + 42 Cos[3 x1] -
12 Cos[4 x1] + 2 Cos[5 x1] +
3 Sqrt[2] Sqrt[
2154 - 2896 Cos[x1] + 1915 Cos[2 x1] -
888 Cos[3 x1] + 278 Cos[4 x1] - 56 Cos[5 x1] +
5 Cos[6 x1]] +
Cos[2 x1] (-128 +
Sqrt[2] Sqrt[
2154 - 2896 Cos[x1] + 1915 Cos[2 x1] -
888 Cos[3 x1] + 278 Cos[4 x1] - 56 Cos[5 x1] +
5 Cos[6 x1]])))]^2 +
Abs[((-56 + 42 Cos[x1] - 24 Cos[2 x1] + 6 Cos[3 x1] +
Sqrt[2] Sqrt[
2154 - 2896 Cos[x1] + 1915 Cos[2 x1] -
888 Cos[3 x1] + 278 Cos[4 x1] - 56 Cos[5 x1] +
5 Cos[6 x1]]) (Cos[2 y1] + I Sin[2 y1]) Tan[
x1/2]^2)/(-40 + 14 Cos[x1] - 8 Cos[2 x1] +
2 Cos[3 x1] +
Sqrt[2] Sqrt[
2154 - 2896 Cos[x1] + 1915 Cos[2 x1] -
888 Cos[3 x1] + 278 Cos[4 x1] - 56 Cos[5 x1] +
5 Cos[6 x1]])]^2) (-40 + 14 Cos[x1] - 8 Cos[2 x1] +
2 Cos[3 x1] +
Sqrt[2] Sqrt[
2154 - 2896 Cos[x1] + 1915 Cos[2 x1] - 888 Cos[3 x1] +
278 Cos[4 x1] - 56 Cos[5 x1] + 5 Cos[6 x1]]) (-180 +
148 Cos[x1] + 42 Cos[3 x1] - 12 Cos[4 x1] + 2 Cos[5 x1] +
3 Sqrt[2] Sqrt[
2154 - 2896 Cos[x1] + 1915 Cos[2 x1] - 888 Cos[3 x1] +
278 Cos[4 x1] - 56 Cos[5 x1] + 5 Cos[6 x1]] +
Cos[2 x1] (-128 +
Sqrt[2] Sqrt[
2154 - 2896 Cos[x1] + 1915 Cos[2 x1] - 888 Cos[3 x1] +
278 Cos[4 x1] - 56 Cos[5 x1] + 5 Cos[6 x1]])) (Cos[
y1] - I Sin[y1])^2)];
reVect31low =
Plot3D[If[x1 <= 5, 0, normEvec3[x1 Degree, y1 Degree]], {x1, 0,
88.0}, {y1, 0, 360}, ColorFunction -> Hue, ImageSize -> 500,
PlotRange -> {{0, 180}, {0, 360}, {-1.0, 1.0}}, PlotPoints -> 80];
reVect31high =
Plot3D[normEvec3[x1 Degree, y1 Degree], {x1, 91.0, 178}, {y1, 0,
360}, ColorFunction -> Hue, ImageSize -> 400,
PlotRange -> {{0, 180}, {0, 360}, {-1.0, 1.0}}, PlotPoints -> 80];
reVect31 = Show[reVect31low, reVect31high]
normEvec3
created? I think it should have been simplified during the process of creation. $\endgroup$