1

SO I have this code:

{evalueb1,evectorsb1} = Eigensystem[Coefficientsp1];
 evalueb1 = 1/(evalueb1*2\[Pi]);

 For[i=1,i<(2TruncationOrder+1),i++,If[Abs[Im[evalueb1[[i]]]]                                            
 <10^-14,evalueb1[[i]]=Re[evalueb1[[i]]],evalueb1[[i]]=evalueb1[[i]]]];

 \[Rho]plus1 = Sort[Select[evalueb1,Im[#]>0\[Or](Im[#]==0\[And]Re[#]>0)&],Im[#2]>Im[#1]&];
 \[Rho]minus1 = Sort[Select[evalueb1,Im[#]<0\[Or](Im[#]==0\[And]Re[#]<0)&],Im[#2]Im[#1]&];

What I did was sort the eigenvalues based on the sign of the complex part. How can I make it so that I can find the correct eigenvector associated with the sorted eigenvalues?

yankeefan11
  • 391
  • 3
  • 8

0 Answers0