This should be an easy task, but I'm having a hard time getting it to work 
in Sympy. I want to substitute an undefined function with arbitrary 
arguments with a specific formula for example:

from sympy import *
var('a b c')
f= Function('f')
test= f(a+b)
lin= test.subs({f(c):2*(c)})print(lin)

I want this to print out

2*(a+b)

However, for that I have to use

lin= test.subs({f(a+b):2*(a+b)})

Do I have to define f as a class in order to do this substitution?

-- 
You received this message because you are subscribed to the Google Groups 
"sympy" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/sympy.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/sympy/d4de4d12-0462-477e-9b46-34f6d228cfaa%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to