ma...@mendelu.cz wrote:
On 26 bře, 09:43, Jose Guzman <n...@neurohost.org> wrote:

Inhttp://wiki.sagemath.org/days13/projects/sagenewbie
Hi Robert, thanks a lot for your comments. Actually I was not working the 
differential calculus (I collaborate with some basic ploting, limits 
calculation and basic algebra). However, I took a look to the notebook:


I tried the differential calculus and have some remarks:

1) I got several times a warning:
__main__:3: DeprecationWarning: Substitution using function-call
syntax
and unnamed arguments is deprecated and will be removed from a future
release of Sage; you can use named arguments instead, like EXPR(x=...,
y=...)
sage: f = x**2 + 3*x -1
sage: f(2)
warning...

This is a warning comming in the last versions of Sage. This is because now it is recommended that you describe explicitly the independent variable, like this:

sage: f(x) = x**2 + 3*x -1
sage: f(2)
sage: 9

Then, simply substitute f by f(x) in every function declaration

3) The last computation gives RuntimeError: power::eval(): division by
zero
You are right, I think it does not make much sense to look for the continuity of the function f(x)=1/x, since 1/0 is undefined. I would suggest to catch the exception when the function f(x) is not defined in x first, just before calculate the limit of the function . Something with this:

def continous(f,a):
""" test if a the function f is continous in value a
Returns True if continuous, False otherwise"""
   try:
       f(a)
   except:
       return False

if limit(f, x=a)==f(a):
   return True
else:
   return False

Best!

Jose


--
To post to this group, send email to sage-support@googlegroups.com
To unsubscribe from this group, send email to 
sage-support+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/sage-support
URL: http://www.sagemath.org

To unsubscribe, reply using "remove me" as the subject.

Reply via email to