On Tue, 22 Sep 2009 18:47:50 -0700 (PDT)
The_Fool <masterfu...@gmail.com> wrote:

> 
> I managed to create the symbolic polygamma function as psi(order,x).
> Psi is limited in what it can do, though.  I can get it to grab
> special values from Maxima's or GiNaC's table, but I still cannot get
> it to approximate any value of any integer order.  It can be
> differentiated, but not integrated.  It seems that this is a
> limitation of Maxima and GiNaC, not Sage.

You're right, looking at the functions py_psi() and py_psi2() in
sage/symbolic/pynac.pyx (I'm not giving line numbers since my file is
heavily patched.), I see that they just raise NotImplementedError.

You could have a go at implementing these functions using the psi
function from mpmath:

http://mpmath.googlecode.com/svn/tags/0.13/doc/build/functions/gamma.html#mpmath.functions.psi

There is an example of how to call mpmath in the function py_li of
sage/symbolic/pynac.pyx.


If you post your code I can give some more pointers on how to use the
pynac library better. For now, if you derived you class from
sage.symbolic.function.PrimitiveFunction, I suggest not using the approx
option, and using the __call__ = SFunction.__call__ line to bypass the
__call__ method implemented in that class. This was done by the arctan2
function in sage/functions/trig.py which I gave as an example.


I will not have internet access for a few days starting tomorrow. I'll
try to catch up with e-mails once I'm back.


Thanks.

Cheers,
Burcin

--~--~---------~--~----~------------~-------~--~----~
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
URLs: http://www.sagemath.org
-~----------~----~----~----~------~----~------~--~---

Reply via email to