Both are special methods defined of subclasses of Function. eval is a
classmethod that tells what explicit values should be evaluated. If
eval is undefined, or returns None, the function will remain
unevaluated. For instance, with
class MyFunc(Function):
@classmethod
def eval(cls, arg):
if arg == 0:
return 0
then MyFunc(0) will return 0, but any other argument, like MyFunc(1),
will remain unevaluated. eval also tells Function how many arguments
the function takes.
fdiff is the derivative of *just* the function, without using the
chain rule. According to a comment in the code for
Function._eval_derivative, f(x).diff(s) -> x.diff(s) * f.fdiff(1)(s).
In fact, if you read the code for that method you should completely
understand how fdiff works. I believe the argindex argument handles
the case when the function has multiple arguments (like atan2).
Aaron Meurer
> --
> You received this message because you are subscribed to the Google Groups
> "sympy" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to
sympy+un...@googlegroups.com.
> To post to this group, send email to
sy...@googlegroups.com.
> Visit this group at
http://groups.google.com/group/sympy.
> To view this discussion on the web visit
>
https://groups.google.com/d/msgid/sympy/95df166a-d742-4544-a098-5551c109f5ec%40googlegroups.com.
> For more options, visit
https://groups.google.com/d/optout.