5
$\begingroup$

I have a matrix , for instance, like this :

matrix[a_ ] := {{0, a}, {-a, 1}};
Eigenvalues[matrix[a]]

and this give the eigenvalues that depends on a

{1/2 (1 - Sqrt[1 - 4 a^2]), 1/2 (1 + Sqrt[1 - 4 a^2])}

If I plot this eigenvalues,

Plot[Eigenvalues[mat[a, b, q]], {a, -1 , 2}]

this just give me the real value. I would like to have the real part of the complex number too. How can I get the real part of the complex eigenvalue?

$\endgroup$
  • $\begingroup$ Welcome to Mma.SE. Start by taking the tour now and learning about asking and what's on-topic. Always edit if improvable, show due diligence, give brief context, include minimal working example of your code and data in formatted form. By doing all this you help us to help you and likely you will inspire great answers. The site depends on participation, as you receive give back: vote and answer questions, keep the site useful, be kind, correct mistakes and share what you have learned. $\endgroup$ – rhermans Sep 7 '18 at 19:59
6
$\begingroup$

You can use ReIm or Re or Im:

mat[a_] := {{0, a}, {-a, 1}};
Plot[Evaluate[ReIm @ Eigenvalues[mat[a]]], {a, -1, 2}, PlotLegends->"Expressions"]

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.