> sage: f = x*y
> sage: f(3,2)
> 6
> sage: f(3)
> 3*y
> sage: f(x,2)
> 2*x
> sage: f(x=3)
> 3*y
> sage: f(y=2)
> 2*x

>From what I saw, in the code f(x,2) is already supported, but it means
replace x with 2, so the above syntax would interfere with the current
implementation. Even f(3,2) is supported. It looks for 3 and replaces
it with 2. However, I support the syntax suggested above. It would
just require a change to the current syntax. If the variable names are
not passed in explicitly, it seems like it would be convenient to be
able to choose the ordering of the dependent variables. For example,
you might have the equation:

f = a*x + b*y

Suppose you want to treat a and b as parameters and x and y and the
fundamental function variables. In this case it would be convenient to
be able to do f(3,2) and have it know you want f(x=2,y=2) rather than f
(a=3,b=2). This would be possible if there were a way to define the
lexigraphical ordering (there must be some code for lexigraphical
ordering since groebner bases are included - I'm curious whether the
code would be useful here). In addition, if an implicit syntax is
included (where variable names are not passed in explicitly), it would
seem to be useful to have a function that printed out the order of
dependence (for reference). I know there is an 'atoms' function now
that returns the set of variables used in an expression. Maybe this
could be modified to include an 'ordered' argument that returns a list
of items in the lexigraphical order:

f.atoms(ordered=True)
Output > [x,y,a,b]

-Lance

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"sympy" group.
To post to this group, send email to sympy@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at http://groups.google.com/group/sympy?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to