Take the 2-minute tour ×
Mathematica Stack Exchange is a question and answer site for users of Mathematica. It's 100% free, no registration required.

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[%]

?

share|improve this question

1 Answer 1

up vote 5 down vote accepted

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.

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

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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