Yes, you should avoid using the names I, E, S, N, C, or O (uppercase only) for Symbols because they are predefined by SymPy. See http://docs.sympy.org/gotchas.html#id2
By the way, you can use the mnemonic COSINE to remember these. Aaron Meurer On Aug 6, 2009, at 1:02 PM, Gabriel wrote: > > Yes I was just coming to post. This is an error in sympy if you use > the variable name 'N' > > so do this: > > (1 + x).subs(dict(x=1, y=2, N=3)) > > which complains about N being a function, so I imagine the fix is to > import the N function in the subs namespace with an underscore... > maybe this is already fixed. I am using 0.6.4 > > Gabriel > > On Aug 6, 2:24 pm, Ondrej Certik <[email protected]> wrote: >> On Thu, Aug 6, 2009 at 12:09 PM, Gabriel<[email protected]> >> wrote: >> >>> I would like to do substitution for a set of symbols into an >>> expression where not all the symbols may be defined. >> >>> something like >> >>> (1 + x).subs(dict(x=1, y=2)) >> >>> which raises a cryptic error since y is not in the expression. (the >>> problem this is for is that I am making a jacobian then substituting >>> in the equilibrium values, but I don't want to check all n**2 >>> entries >>> to see which symbols have dropped out). >> >>> Any tips, pointers? >> >> Could you please post the full script? Your line works for me: >> >> In [1]: (1 + x).subs(dict(x=1, y=2)) >> Out[1]: 2 >> >> Ondrej > > --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "sympy" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/sympy?hl=en -~----------~----~----~----~------~----~------~--~---
