On Tuesday, February 24, 2015 at 3:15:03 PM UTC-7, Aaron Meurer wrote:
>
> The problem is that assumptions on Function don't do anything
> (https://github.com/sympy/sympy/issues/6494). If you want to create a
> Function with assumptions, you'll need to subclass Function
> explicitly, like
>
> class f(Function):
> is_real = True
>
Thanks for pointing out the real issue! I tried to implement your
suggestion, but I'm not a particularly skillful python programmer, so my
first attempt at subclassing Function in the way you described didn't
work...
Here's the code:
#!/usr/bin/env python
> from sympy import *
> class real_function(Function):
> is_real=True
> X = Symbol('X', real=True)
> f = real_function('f')(X)
> g = real_function('g')(X)
> print diff (abs(f-g), X)
And the error message:
Traceback (most recent call last):
> File "testcase.py", line 10, in <module>
> f = real_function('f')(X)
> TypeError: 'real_function' object is not callable
which I don't understand how to fix.
--
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 [email protected].
To post to this group, send email to [email protected].
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/2952c170-688e-4c2d-a61a-3063e7866c0e%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.