On Wed, 06 Dec 2006 23:20:56 -0800, Robert Bradshaw
<[EMAIL PROTECTED]> wrote:
> First, let me say that I like this proposal.
> On Dec 6, 2006, at 5:03 PM, William Stein wrote:
>> Sage calculus
>> f = alg expr
>>
>> f.subs(var, val, ...)
>> f.subs(dict)
>> f.subs(list of pairs)
>> implement recursively, with base case functions of 1 var and vars and
>> constants being clear.
>
> I would vote for f.subs(var=val, ...) as well.
>
>> f.function(*args) - returns a callable version of f, which otherwise
>> works in same way. Output is result of subs.
>> this just another formal function, but with a call method.
>> Also, function((vars...),expr) makes an evaluatable function.
>
> The motivation for not providing a call function to begin with is
> that the arguments have not been specified yet? I still think f(x,y)
> = sin(x)*cos(x+y+3) is the most "natural" syntax, but alas it
> requires the preprocessor.
If we wanted, we could always add that later on top of what I proposed.
It would just be:
f = (sin(x)*cos(x+y+3)).function(x,y)
or
dummy = sin(x*) * cos(x+y+3)
f = dummy.function(x,y)
Either might be doable with the preprocessor, though I shudder...
Also, with my proposal one could also already type
f = function( (x,y), sin(x)*cos(x+y+3) )
which is nice since in Mathematica one types "f = Function[ {x,y},
Sin[x]*Cos[x+y+3] ]".
Here this would be implemented via:
def function( vars, expr):
return expr.function(*vars)
>> f.derivative(var) - we completely implement.
>
> Even if we implement this (which should be relatively easy), should
> we pass the results to maxima to try and simplify it? On that note,
> should we have a f.simplify(), etc. method?
Yes. Indeed, we should definitely have
f.simplify(numerous options) -- feed exp that defines f to maxima (or
maple or mathematica),
run various simplify commands, then parse the result.
Note that Maxima has dozens (?) of variants of simply and expand commands
with all
kinds of funny names, which is confusing, and which I hope to remedy with
SAGE.
William
--~--~---------~--~----~------------~-------~--~----~
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at http://groups.google.com/group/sage-devel
URLs: http://sage.scipy.org/sage/ and http://modular.math.washington.edu/sage/
-~----------~----~----~----~------~----~------~--~---