On 12/23/10 2:19 AM, KvS wrote:
On Dec 23, 6:42 pm, Jason Grout<jason-s...@creativetrax.com>  wrote:
On 12/23/10 1:02 AM, KvS wrote:

In addition to the previous post, if I change the contents of the
first cell to

f=BetaLP1.getkthMomentAt(1,1)
g=symbolic_expression(str(f(x))).function(x)
print g(0)

it does yield 1 as well. Any hints?

Can you post the code for BetaLP1.getkthMomentAt(1,1) so we can try it?

Thanks,

Jason

plus: thanks in advance, of course!



Yes, something does seem weird. When I modify your getkthMomentAt function to:

    def getkthMomentAt(self,k,t):
        charFunc=self.getCharacteristicExponent()
        i=sqrt(-1)
        f=(exp(-t*charFunc(-i*x))).function(x)
        for _ in range(k):
            f=f.derivative()
        return f

then I get the following odd sequence of results:

sage: mygammaexpr=f.operands()[0].operands()[0].operands()[1].operands()[0]
sage: mygammaexpr
gamma(-x - 1/2)
sage: mygammaexpr(x=0)
Traceback (most recent call last):
...
ValueError: argument must be >= -1
sage: mygammaexpr
gamma(-x - 1/2)
sage: gamma(-x-1/2) - mygammaexpr
0
sage: mygammaexpr(x=0)
-2*sqrt(pi)

Definitely weird. Apparently subtracting mygammaexpr from gamma(-x-1/2) makes mygammaexpr suddenly realize that it's okay to evaluate it at x=0.

Jason

--
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

Reply via email to