Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

Tab-completion was my friend for this:

sage: var("y")
y
sage: sols = solve([x+y == 3, 2*x+2*y == 6],x,y); sols
[[x == -r1 + 3, y == r1]]
sage: sols = solve([x+y == 3, 2*x+2*y == 6],x,y); sols
[[x == -r2 + 3, y == r2]]
sage: maxima_calculus.reset()
[multiplicities,%rnum,lispdisp,%rnum_list]
sage: sols = solve([x+y == 3, 2*x+2*y == 6],x,y); sols
[[x == -r1 + 3, y == r1]]

Note that you may get different things in the reset depending on how many computations you've done already. I suppose one could even go into the depths of the lisp interface and reset just %rnum and %rnumlist but I didn't want to do that.

Unfortunately, I don't think there is any more elegant way to do what you want - the solutions are lists by design. In some sense this is a feature, not a bug... though one it would be nice to do more easily. Maybe map is your friend here, though I doubt it would be fewer characters to type.