2
$\begingroup$

I am trying to plot eigenvalues of the matrix with different $W$. I can plot them separately but I want to merge them in a single plot with different colors. Is there any other type of plot other than Listlineplot?

The code is

x = Sqrt[M/2];
y = -Sqrt[M/2];
W = M/2 (A + τ) + B;
M = 2;

P = {{A x^2 + τ*y^2 - W, B}, {B, A y^2 + τ*x^2 - W}};
Q = {{-3*A* x^2 - τ*y^2 + W, -2 τ*x*y - B}, {-2 τ*x*y - B, -3* A* y^2 - τ*x^2 + W}};

T[A_, τ_] := P.Q

ListLinePlot@Flatten@Table[
     Eigenvalues[T[A,τ]]
     , {A, 0, 1, 0.3}
     , {B, 0, 1, 0.3}
     , {τ, 0, 1, 0.3}
 ]

Second plot is for

W = M/2 (A + τ) - B;

Third one for

W = A*M;

I also tried to Manipulateplot but the outcome is empty.

$\endgroup$

1 Answer 1

6
$\begingroup$
Module[
 {x, y, W, M, P, Q, T, wlist},
 x = Sqrt[M/2];
 y = -Sqrt[M/2];
 wlist = {M/2 (A + τ) + B, M/2 (A + τ) - B, A*M};
 M = 2;
 P = {{A x^2 + τ*y^2 - W, B}, {B, A y^2 + τ*x^2 - W}};
 Q = {{-3*A*x^2 - τ*y^2 + W, -2 τ*x*y - B}, {-2 τ*x*y -
      B, -3*A*y^2 - τ*x^2 + W}};
 T[A_, τ_] := P.Q;
 ListPlot[
  Table[
   Flatten@Table[
     Eigenvalues[T[A, τ]]
     , {A, 0, 1, 0.3}
     , {B, 0, 1, 0.3}
     , {τ, 0, 1, 0.3}
     ]
   , {W, wlist}
   ]
  , PlotStyle -> Array[Hue, 3, {0, 0.7}]
  , Joined -> True
  , PlotTheme -> "Scientific"
  , AspectRatio -> 1/2
  , ImageSize -> 600
  , PlotRange -> All
  , PlotLegends -> TraditionalForm /@ wlist
  ]
 ]

Mathematica graphics

$\endgroup$

Your Answer

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

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