Juju3[expr_] :=
(Solve[expr[[1]] == 0, expr[[2]] == 0, expr[[3]] == 0, {r, x, y}];
a = %[[1]];
b = %%[[2]];
c = %%%[[3]];
Which[a[[2, 2]] == 0 || a[[3, 2]] == 0, Speak["MOO"],a[[2, 2]] != 0 && a[[3, 2]] != 0, Speak["PEACE AND LOVE"]]
j = D[expr, {{r, x, y}}];
j
FullSimplify[j /.Solve[expr[[1]] == 0, expr[[2]] == 0,expr[[3]] == 0, {r, x, y}]] ;
FullSimplify[Eigenvalues[%[[1]]]]
FullSimplify[Eigenvalues[%%[[2]]]]
FullSimplify[Eigenvalues[%%%[[3]]]])
Then I tried:
Juju3[{i - l*r - ux*r*x - uy*r*y, -mx*x + ex*ux*r*x, -my*y + ey*uy*r*y}]
,and it did not work whereas when I just use my code without creating a function it works very well. I am reading about building functions with Mathematica right now but I still want to post this because I do not know what I am doing wrong. Everything? Maybe! Because I am a noob ^^ But I am reading tutorials so please do not get angry :)
Specifically I have been told by a user that one should put semicolon for things that one do not want the output of, and also that one should put parentheses when having a function with multiple lines, so I did do that here.
PS: I shortened the function because I use b and c also in the same way as a but no need for it here I guess.
%
is an alias forOut
,%n
an alias forOut[n]
,%%
an alias forOut[-2]
, etc. Note, this is different from the prior computation result, which in the OPs case is the result ofSolve
. – rcollyer Aug 6 at 18:51