2
$\begingroup$

I have a matrix:

J = {{0, -λ (1 + φ)/τ}, {-(1 + φ)/τ, δ}};

And I compute the Eigenvalues and Eigenvectors as follows:

e = Eigenvalues[J]
v = Eigenvectors[J]

Then I want to check that everything makes sense but this expression returns False. What am I doing wrong?

J.v[[1]] === e[[1]]*v[[1]]
$\endgroup$
4
  • 2
    $\begingroup$ Try {e, v} = Eigensystem[J] to make sure they are matched. $\endgroup$
    – Roman
    May 27, 2022 at 12:12
  • 5
    $\begingroup$ === is for structural equality, == is for mathematical equality. Use the latter. Next time please post copyable code instead of (or in addition to) the image. $\endgroup$
    – Szabolcs
    May 27, 2022 at 12:42
  • 1
    $\begingroup$ Please post your Mathematica code instead of picture. $\endgroup$
    – cvgmt
    May 27, 2022 at 12:56
  • 1
    $\begingroup$ Try Simplify[J . v[[1]]] === Simplify[e[[1]]*v[[1]]] or ApplySides[Simplify, J . v[[1]] == e[[1]]*v[[1]]]. $\endgroup$ May 27, 2022 at 12:58

1 Answer 1

4
$\begingroup$
J = {{0, -λ (1 + φ)/τ}, {-(1 + φ)/τ, δ}};

{e, v} = Eigensystem[J];

J . v[[1]] == e[[1]] v[[1]] // FullSimplify
(*    True    *)

J . v[[2]] == e[[2]] v[[2]] // FullSimplify
(*    True    *)
$\endgroup$
2
  • $\begingroup$ Thanks. This does it. $\endgroup$
    – NC520
    May 27, 2022 at 12:55
  • 3
    $\begingroup$ The point of this answer, @Nicolo, is that if you need both eigenvalues and eigenvectors, you should just use Eigensystem[] at the outset instead of computing them separately. $\endgroup$ May 27, 2022 at 12:55

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