Dear all,

I have learned to substitute variables into equations
using .subs(locals()) or .subs(globals()). However, if variables are
defined in a nested way, this has to be done again and again. Is there
a command to substitute all variables into each other? Here is an
example:

sage: var ('a b c')
(a, b, c)
sage: f = x^a
sage: a = b^2
sage: b = 1/c
sage: c = 3
sage: f.subs(globals())
x^b^2
sage: f.subs(globals()).subs(globals())
x^(1/c^2)
sage: f.subs(globals()).subs(globals()).subs(globals())
x^(1/9)


It should be easy to write a function repeating the .subs(globals())
command until f does not change any more, but before I do this, I
thought I'd better ask if something like this already exists.

Thanks for your help!

Regards,
Stan

--~--~---------~--~----~------------~-------~--~----~
To post to this group, send email to sage-support@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/sage-support
URLs: http://www.sagemath.org
-~----------~----~----~----~------~----~------~--~---

Reply via email to