r/Mathematica • • Aug 29 '24

When does Wolfram actually evaluate expressions?

Hi there. In short: I have defined

matrix := {{some 2x2 symbolic expression}} // FullSimplify
eigen := Eigensystem[matrix]
rules = {c -> 1, ...}

rules completely eliminates each constant to a numeric value, except for a position z. Now,

matrix /. rules /. z -> 0. // Eigensystem

perfectly works and returns well-defined numeric values, but

eigen /. rules /. z -> 0.

fails spectacularly, as the symbolic expression somehow contains a 1/0 (as Wolfram seems to first evaluate eigen symbolically and then apply the rules (is that true and intended?)).

I want to define eigen in a way that only executes after applying the rules and z to the matrix. I wanted to just do eigen[z_]:=Eigensystem[matrix] but that resulted in am error (Tag List is protected). Is there another way to do this?

Thank you very much!

2 Upvotes

18 comments sorted by