On Sep 4, 12:30 pm, Maurizio <[email protected]> wrote:
> I beg your pardon for asking silly questions... would you please
> explain which is the reason for having different variables with the
> same name... and even more, with different domains?
In an interactive session this would probably be a bad idea. However,
in an automated procedure one may have to come up with a temporary
variable. For instance
def derivative(f,x):
delta=temporary_symbolic_variable
return limit( (f(x+delta)-f(x))/delta, delta=0 )
I've been intentionally vague in how to obtain the
temporary_symbolic_variable, but it is pretty clear that that variable
should be independent of any other assumptions you have made. One way
to do that is to allow it to be a distinct variable with the name
"delta", regardless of other deltas in the system.
It is also in step with sage's policy of allowing distinct objects to
have the same print name, to whatever confusion that may lead:
sage: R.<x>=GF(3)[]
sage: S.<x>=GF(5)[]
sage: R.0
x
sage: S.0
x
sage: R.0 == S.0
False
incidentally
sage: f=function('f',x)
sage: var('delta')
sage: ((f(x+delta)-f(x))/delta).limit( delta=0)
doesn't execute particularly gracefully.
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---