> As far as I understand from your previous comments, a way to extract the
> exponential functions from the expression is all you need. You don't
> really need to walk through the tree. Here is one way to do this:
>
> sage: t = exp(x+y)*(x-y)*(exp(y)+exp(z-y))
> sage: t
> (e^(-y + z) + e^y)*(x - y)*e^(x + y)
> sage: w = SR.wild()
> sage: t.find(exp(w))
> [e^(-y + z), e^(x + y), e^y]
>
> You can then change the expressions in the given array and substitute
> new values for them:

Did you define res in between?  Maybe this?  Just a guess.

sage: res = t.find(exp(w))

>
> sage: t.subs({res[1]: sin(res[1].operands()[0])})
> (e^(-y + z) + e^y)*(x - y)*sin(x + y)
>
> The .operands()[0] syntax is really cumbersome. We need a shortcut for
> this. I thought .op(0) worked for pynac expressions before we switched
> from the maxima backend.
>

-- 
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/sage-support
URL: http://www.sagemath.org

Reply via email to