That's it! Thank you very much.

I tried expr.atoms() but did not look at the docstring.

Thanks again.

Bastian.


On 07/21/2011 05:16 PM, Tom Bachmann wrote:
expr.atoms(sin, cos) might be what you want.

Help on method atoms in module sympy.core.basic:

atoms(self, *types) unbound sympy.core.expr.Expr method
Returns the atoms that form the current object.

By default, only objects that are truly atomic and can't
be divided into smaller pieces are returned: symbols, numbers,
and number symbols like I and pi. It is possible to request
atoms of any type, however, as demonstrated below.

[...]


In [17]: e = a + b + c*sin(x) + d*cos(x+y) + a*sin(z)**2*cos(2*z)

In [18]: e.atoms(sin, cos)
Out[18]: set(sin(x), sin(z), cos(2⋅z), cos(x + y))


--
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.

Reply via email to