Maxima's solve sometimes produces answers (assuming they can be found) as lists of equations, e.g. [x=a,y=b].
The syntax for substitution has several versions. subst(3,x,x+y) ---> y+3. subst(x=3,x,x+y) subst([x=3,y=4],x+y) --> 7 Solve can also produce systems of solutions, e.g. sols: [[x=a,y=b], [x=c,y=d]] in which case subst(sols[1],x+y) ---> a+b There are also cases in which solve cannot find a closed form, in which case it might return something like x=sin(x) where x appears on lhs and rhs. It would generally be a bad idea to use a "solution" like this if you wanted x to disappear. If Sage just uses Maxima, you might want to know about these options. If Sage is re-inventing this kind of facility, you might find this worth either emulating or explicitly rejecting for something else. RJF On Feb 19, 2:43 pm, Harald Schilly <harald.schi...@gmail.com> wrote: > On Feb 19, 10:18 pm, Mike Hansen <mhan...@gmail.com> wrote: > > > I'd do something like this: > > yes, thanks. it's just not very intuitive because you have to know the > solution_dict parameter in advance. i don't know, but it would be > interesting if a syntax like f(sol[0]) could be implemented - or does > it have too many side effects... > > h --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---