I was working on a calculus tutorial/primer on Sage yesterday
(http://sagenb.org/home/pub/791/). I realized how annoyed I get with
always having to specify the solution_dict parameter to solve in order
to substitute values back into another expression. Almost every time I
use solve, I immediately substitute the values back into some other
expression. Having to write solution_dict=True all the time is (a) hard
to remember and (b) inconvenient. Part of the reason for (a) is that I
think "solution_dict" is a long and not very obvious name (I think I
wrote the solution_dict patch, so it's my fault! Sorry for the bad name!).
Somewhere, a while ago, I remember there being a consensus (with small
voter turnout) that solution_dict should default to True (I can't find
the thread on this, though). That is effectively what Mathematica does,
for example. Mathematica returns a list of rules, which print as {x->3,
y->4}, and which are very easy and natural to substitute back into other
expressions.
I wonder if we could either:
(a) make solution_dict default to True (and maybe transition to some
sort of better-named keyword argument?)
* this may break lots of code, so maybe ought to be put off until 5.0.
(b) make .subs() and maybe the __call__ method of a symbolic expression
take the output of solve as-is and try to do something intelligent
(i.e., see if the lhs of each equation is a single variable, and
substitute in the right side)
What do you think?
Thanks,
Jason
--~--~---------~--~----~------------~-------~--~----~
To post to this group, send an email to [email protected]
To unsubscribe from this group, send an email to
[email protected]
For more options, visit this group at http://groups.google.com/group/sage-devel
URLs: http://www.sagemath.org
-~----------~----~----~----~------~----~------~--~---