Ask Your Question
1

Problem with hypergeometric

asked 2015-06-29 14:14:57 +0100

Peter Luschny gravatar image
A = lambda z: exp(I*pi*z)*hypergeometric([-z,1/2],[2],4).simplify_hypergeometric()
print A(1/2)

-1/2sqrt(3)assoc_legendre_p(1/2, -1, -5/3)

print (-1/2*sqrt(3)*assoc_legendre_p(1/2, -1, -5/3)).n()

name 'assoc_legendre_p' is not defined

print A(1/2).n()

TypeError: cannot evaluate symbolic expression numerically

Question: Which option do I have except to switch over to Maple?

A := z -> exp(I*Pi*z)*hypergeom([-z,1/2],[2],4):
evalf(A(1/2)); -0.3697166872 + 0.4838437556 I
edit retag flag offensive close merge delete

Comments

http://trac.sagemath.org/ticket/16813 is already in the works for some time.

rws gravatar imagerws ( 2015-06-29 14:46:10 +0100 )edit

Thanks Ralf! Indeed I have another option: To try a different formula. I will report -- stay tuned!

Peter Luschny gravatar imagePeter Luschny ( 2015-06-29 14:51:15 +0100 )edit

1 Answer

Sort by ยป oldest newest most voted
2

answered 2015-06-29 14:58:42 +0100

rws gravatar image

updated 2015-06-29 15:02:37 +0100

The link from Maxima's assoc_legendre_p to Sage's gen_legendre_P will be done by ticket #16813 (among many other things). Until then you must do manually

sage: assoc_legendre_p = gen_legendre_P
sage: print (-1/2*sqrt(3)*assoc_legendre_p(1/2, -1, -5/3)).n()
...
TypeError: no conversion of this rational to integer

which however shows that Maxima itself cannot handle the function with non-integer index. Using the branch in the ticket gives

sage: assoc_legendre_p = gen_legendre_P
sage: print (-1/2*sqrt(3)*assoc_legendre_p(1/2, -1, -5/3)).n()
-0.483843755630126 + 0.369716687246133*I
edit flag offensive delete link more

Comments

Well, this is only about the assoc_legendre_p problem which is secondary to my hypergeometric problem. If Sage would have answered with (1/3I)(3EllipticK(2)+5EllipticE(2))/Pi I would also be happy.

Peter Luschny gravatar imagePeter Luschny ( 2015-06-29 15:43:35 +0100 )edit

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

1 follower

Stats

Asked: 2015-06-29 14:14:57 +0100

Seen: 312 times

Last updated: Jun 29 '15