0
$\begingroup$

So in the If[evecs==Re[evecs], I want to then change the colour in PlotStyle of the ParametricPlot3Ds (say, green if eval<0, orange if eval==0 and red if eval>0). As you can see, I've already tried to add another If statement but it doesn't quite appear to be doing exactly what I want.

Manipulate[{evals, evecs} = 
Eigensystem[({{-\[Sigma], \[Sigma], 
  0}, {r - X[[3]], -1, -X[[1]]}, {X[[2]], X[[1]], -\[Beta]}})];
GraphicsColumn[{Show[
If[evecs == Re[evecs], 
 ParametricPlot3D[
  Evaluate[ConstantArray[X, 3] + t*evecs], {t, -2, 2}, 
  PlotStyle -> {{If[evals < 0, Green, Red]}}], {}], 
Graphics3D[{PointSize[0.025], Red, Point[X]}], 
ImageSize -> {275, 275}]}], 
Row[{Spacer[60], 
Dynamic[Style[
 Text@TraditionalForm[
   HoldForm[({{x}, {y}, {z}})' == 
     Dynamic[Round[({{-\[Sigma], \[Sigma], 
           0}, {r - X[[3]], -1, -X[[1]]}, {X[[2]], 
           X[[1]], -\[Beta]}}), 0.01]] ({{x}, {y}, {z}})]], 
Medium]]}], Delimiter, {{r, 1, Style["r", Medium]}, 0, 40, .1, 
Appearance -> "Labeled", 
TrackingFunction -> ((r = #; updateFN[]) &)}, {{\[Beta], 8/3, 
Style["\[Beta]", Medium]}, 0, 20, .01, Appearance -> "Labeled", 
TrackingFunction -> ((\[Beta] = #; updateFN[]) &)}, {{\[Sigma], 10, 
Style["\[Sigma]", Medium]}, 0, 50, 5, Appearance -> "Labeled", 
TrackingFunction -> ((\[Sigma] = #; 
  updateFN[]) &)}, Delimiter, {{X, {0, 0, 0}}, 0, 1, 
ControlType -> None}, {{X0, 1, 
"Fixed Point:"}, {1 -> "\!\(\*SubscriptBox[\(C\), \(0\)]\)", 
2 -> "\!\(\*SubscriptBox[\(C\), \(+\)]\)", 
3 -> "\!\(\*SubscriptBox[\(C\), \(-\)]\)"}, RadioButtonBar, 
TrackingFunction -> ((X0 = #; updateFN[]) &)}, Delimiter, {evecs, 
ControlType -> None}, {evals, 
ControlType -> None}, {{updateFN, updateFN}, 
ControlType -> None}, Delimiter, ControlPlacement -> Left, 
AutorunSequencing -> {1, 2, 3, 5}, 
Initialization :> (updateFN[] := (X = {{0, 0, 
     0}, {Sqrt[\[Beta]*(r - 1)], Sqrt[\[Beta]*(r - 1)], 
     r - 1}, {-Sqrt[\[Beta]*(r - 1)], -Sqrt[\[Beta]*(r - 1)], 
     r - 1}}~Part~X0; {evals, evecs} = 
  Eigensystem[({{-\[Sigma], \[Sigma], 
      0}, {r - X[[3]], -1, -X[[1]]}, {X[[2]], 
      X[[1]], -\[Beta]}})];);
updateFN[])]

Thank you in advance for your help!

$\endgroup$
3
  • $\begingroup$ Isn't evals a list of numbers? If so, evals < 0 won't work. $\endgroup$
    – Michael E2
    Commented Jan 9, 2018 at 20:44
  • $\begingroup$ @MichaelE2 but it will plot 3 different lines. I want the corresponding eigenvalues (so the eigenvalues with the same index) to control the colour of the PlotStyle. I do recognise that what I've done is incorrect. I'm interested in how it should be instead. $\endgroup$
    – Jelmes
    Commented Jan 9, 2018 at 20:47
  • $\begingroup$ I see. I misunderstood what you were after. Something like Sign[evals] /. {-1 -> Green, 0 -> Orange, 1 -> Red}, maybe? $\endgroup$
    – Michael E2
    Commented Jan 9, 2018 at 21:04

1 Answer 1

3
$\begingroup$

So, the answer is

PlotStyle -> Table[Which[evals[[i]] < 0, Green, evals[[i]] == 0, Orange, 
 evals[[i]] > 0, Red], {i, 3}]]
$\endgroup$

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.