4
$\begingroup$

these eigenvalues should be separated when sorted in the correct way but it is not the case when passing to Plot3D

Plot3D[Evaluate[Sort[Eigenvalues[{{2 Sin[\[Pi]/6-y],-1,-E^(3 I x)},{-1,2 Sin[\[Pi]/6+y],-1},{-E^(-3 I x),-1,-2 Cos[y]}}]]],{x,-\[Pi]/3,\[Pi]/3},{y,-\[Pi],\[Pi]},BoxRatios->{1,1,1},Mesh->None,PlotRange->{-4,4},PlotTheme->"Detailed",PlotLegends->False,ClippingStyle->Automatic]

enter image description here

I tried

dat3D = ParallelTable[
   Flatten@{x, y, 
     Sort[Eigenvalues[
       N@{{2 Sin[\[Pi]/6 - y], -1, -E^(3 I x)}, {-1, 
          2 Sin[\[Pi]/6 + y], -1}, {-E^(-3 I x), -1, -2 Cos[
            y]}}]]}, {x, -\[Pi]/3, \[Pi]/
     3, \[Pi]/(60.)}, {y, -\[Pi], \[Pi], \[Pi]/(20.)}];
ListPlot3D[{Flatten[dat3D, 1]}, BoxRatios -> {1, 1, 1}, 
 PlotRange -> {-4, 4}, PlotTheme -> "Detailed", PlotLegends -> False] 

but does not give the correct results

enter image description here

$\endgroup$
1
  • 2
    $\begingroup$ This looks like a bug of "Evaluate" to me. Please report it to "support@wolfram.com" $\endgroup$ Jan 9 at 11:15
5
$\begingroup$

Removing Evaluate command does give me separated eigenvalues.Is this correct?

Plot3D[Sort[Eigenvalues[{{2*Sin[Pi/6 - y], -1, -E^(3*I*x)}, {-1, 
      2*Sin[Pi/6 + y], -1}, 
    {-E^(-3*I*x), -1, -2*Cos[y]}}]], {x, -Pi/3, Pi/3}, {y, -Pi, Pi}, 
     BoxRatios -> {1, 1, 1}, Mesh -> None, 
    PlotRange -> {-4, 4}, PlotTheme -> "Detailed", PlotLegends -> 
   False, ClippingStyle -> Automatic]

enter image description here

Also,attempting your approach of sorting individual points gave me this

   Graphics3D[Point[Sort[Flatten[Table[({#1[[1]], #1[[2]], #1[[3]][[n]]} & ) /@ 
       Flatten[Table[{x, y, Eigenvalues[N[{{2*Sin[Pi/6 - y], -1, - 
   E^(3*I*x)}, {-1, 2*Sin[Pi/6 + y], -1}, 
   {-E^(-3*I*x), -1, -2*Cos[y]}}]]}, {x, -Pi/3, Pi/3, Pi/60.}, 
   {y, -Pi, Pi, Pi/20.}], 1], {n, 1, 3}], 1]]]

enter image description here

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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