1
$\begingroup$

I have tried the following to get the eigenvalues of several matrices of the type:

J := D[{i - l*r - ux*r*x - uy*r*y, -mx*x + ex*ux*r*x, -my*y + 
  ey*uy*r*y}, {{r, x, y}}] // StandardForm

Then with three possible solutions given by Solve

FullSimplify[J/. Solve[i - l*r - ux*r*x - uy*r*y == 0 && -mx*x + ex*ux*r*x == 
 0 && -my*y + ey*uy*r*y == 0, {r, x, y}]]
Eigenvalues[%[[1]]]

But it does not give me the eigenvalues, it just outputs:

Eigenvalues[{{-l, -((i ux)/l), -((i uy)/l)}, {0, -mx + (ex i ux)/l, 0}, {0, 0, -my + (ey i uy)/l}}]

Only the following code gives them:

FullSimplify[J/. Solve[i - l*r - ux*r*x - uy*r*y == 0 && -mx*x + ex*ux*r*x == 
 0 && -my*y + ey*uy*r*y == 0, {r, x, y}]]
%[[1]]
Eigenvalues[%]

Why? In other words, why is

Function[%[[1]]] 

different from

%[[1]]
Function[%]

?

$\endgroup$
6
$\begingroup$

StandardForm is a wrapper.

j = D[{i - l*r - ux*r*x - uy*r*y, -mx*x + ex*ux*r*x, -my*y + ey*uy*r*y}, {{r, x, y}}];

FullSimplify[j /. Solve[
    i - l*r - ux*r*x - uy*r*y == 0 && -mx*x + ex*ux*r*x == 
      0 && -my*y + ey*uy*r*y == 0, {r, x, y}]];

Eigenvalues[%[[1]]]

Mathematica graphics

ps. no need to use j:= just use j= and try not to use UPPERCASE for first letters.

$\endgroup$
  • $\begingroup$ Thanks, I did not know that SandardForm could have effects on the following calculations :/ $\endgroup$ – Ouistiti Aug 6 '13 at 12:59
  • 1
    $\begingroup$ @Ouistiti Yes; please read this for another example. $\endgroup$ – Mr.Wizard Aug 7 '13 at 8:32

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.