In IRC I had a question and I don't know how to do it ...

If you have a solution of an equation, how to apply the result to a
function?

sage: var('x y')
(x, y)
sage:  solve([x+y==6, x-y==4], x, y)
[[x == 5, y == 1]]
sage: f = 2*x+y

The best I came up is

sage: f.subs(dict([ (s.lhs() , s.rhs()) for s in sol[0]]))
11

My proposal is, that Sage does this automatically, e.g. just

sage: f(sol[0])
11

Other ideas? Is this already possible?

Harald
--~--~---------~--~----~------------~-------~--~----~
To post to this group, send email to sage-devel@googlegroups.com
To unsubscribe from this group, send email to 
sage-devel-unsubscr...@googlegroups.com
For more options, visit this group at http://groups.google.com/group/sage-devel
URLs: http://www.sagemath.org
-~----------~----~----~----~------~----~------~--~---

Reply via email to