ASKSAGE: Sage Q&A Forum - Latest question feedhttp://ask.sagemath.org/questions/Q&A Forum for SageenCopyright Sage, 2010. Some rights reserved under creative commons license.Sun, 31 Jan 2016 12:06:21 -0600numerical value of hypergeometric functionhttp://ask.sagemath.org/question/32397/numerical-value-of-hypergeometric-function/I want to compute the value of hypergeometric 2F1
like this
a=1/3; b=2/3; c=5/6; x=27/32
print n(hypergeometric([2,1],[a,b,c],x)
Sagemath answered 16.9608452387059. But this should be 8/5=1.60000000.
All the other numerical values are also unreliable.
I hope this will be fixed in the next version.
cxrjddSun, 31 Jan 2016 02:31:56 -0600http://ask.sagemath.org/question/32397/numerical values of hypergeometric function fails?http://ask.sagemath.org/question/32403/numerical-values-of-hypergeometric-function-fails/I want to compute the value of hypergeometric 2F1 like this.
a=1/3; b=2/3; c=5/6; x=27/32
print n(hypergeometric([2,1],[a,b,c],x))
Sage math answered 16.9608452387059.
But this should be 8.0/5=1.6000000.
cxrjddSun, 31 Jan 2016 12:06:21 -0600http://ask.sagemath.org/question/32403/Problem with hypergeometrichttp://ask.sagemath.org/question/27230/problem-with-hypergeometric/ A = lambda z: exp(I*pi*z)*hypergeometric([-z,1/2],[2],4).simplify_hypergeometric()
print A(1/2)
-1/2*sqrt(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
Peter LuschnyMon, 29 Jun 2015 07:14:57 -0500http://ask.sagemath.org/question/27230/A simple hypergeometric function fails.http://ask.sagemath.org/question/24677/a-simple-hypergeometric-function-fails/There is a nice method to compute the Narayana polynomials.
With Maple we can write
P := n -> simplify(hypergeom([-n,-n+1], [2], 1/x));
seq(expand(x^k*P(k)), k=0..5);
and get the answer
1, x, x^2+x, x^3+3*x^2+x, x^4+6*x^3+6*x^2+x, x^5+10*x^4+20*x^3+10*x^2+x.
Trying the same with Sage
P = lambda n: simplify(hypergeometric([-n,-n+1],[2], 1/x))
[expand(x^k*P(k)) for k in (0..5)]
gives the answer
[1, x, ..., x^n*hypergeometric((-n, -n-1),(2),1/x)]
This is really disappointing. Is there a workaround?
Peter LuschnyWed, 29 Oct 2014 10:43:29 -0500http://ask.sagemath.org/question/24677/A hypergeometric serieshttp://ask.sagemath.org/question/24257/a-hypergeometric-series/Mathematica's
Table[2 HypergeometricPFQ[{-n+1,2-n},{2},-1],{n,0,46}]
as well as Maple's
seq(round(evalf(2*hypergeom([-n+1,2-n],[2],-1),100)),n=0..46);
lead to
1, 2, 2, 0, -2, 0, 4, 0, -10, ... https://oeis.org/A182122
How can I compute this sequence with Sage?
A182122 = lambda n: 2*hypergeometric([-n+1,2-n],[2],-1)
[A182122(n).n(100) for n in (0..46)]
Unfortunately this was not successful.
*Addition:*
This is not an isolated problem. I give a second example:
Motzkin sums http://oeis.org/A005043
A005043 = lambda n: (-1)^n*hypergeometric([-n,1/2],[2],4)
[Integer(A005043(n).n(100)) for n in (0..29)]
In this case there is this 'workaround':
A005043 = lambda n: (-1)^n*jacobi_P(n,1,-n-3/2,-7)/(n+1)
[Integer(A005043(n).n(100)) for n in (0..29)]
And Maxima gets it right too:
maxima_calculus('makelist((-1)^n*hypergeometric([-n,1/2],[2],4),n,0,29)')
Peter LuschnyTue, 23 Sep 2014 07:39:52 -0500http://ask.sagemath.org/question/24257/Why does Sage offer unusable SciPy?http://ask.sagemath.org/question/24163/why-does-sage-offer-unusable-scipy/ In the docs of special functions [1] there is a warning:
"SciPy’s versions are poorly documented and seem less
accurate than the Maxima and PARI versions."
Less accurate? Where does Sage draw the border to unusable code?
I certainly do not expect such incorrect results produced with Sage:
A000262 = lambda n: (-1)^(n-1)*hypergeometric_U(1-n, 2, -1, "scipy")
[round(A000262(n).n(100)) for n in (0..19)]
[1, 1, 3, 13, 73, 501, 4051, 37633, 394353, 4596553, 58941091,
824073141, 12470162233, 202976401213, 3535017524400, 65573803186900,
1290434218670000, 26846616451200000, 588633468315000064,
13564373693600000000]
Peter
[1] http://www.sagemath.org/doc/reference/functions/sage/functions/special.html
[2] https://oeis.org/A000262
Peter LuschnyWed, 17 Sep 2014 06:32:32 -0500http://ask.sagemath.org/question/24163/integration ends up with hypergeometric function can not be done by sagehttp://ask.sagemath.org/question/10617/integration-ends-up-with-hypergeometric-function-can-not-be-done-by-sage/we know the integration of
1/(a^b+1)
with respect to a is going to get
2F1(1,1/a,1+1/a,-a^x)
where 2f1 is hypogeometric function. However, once we to that in sage, it is not possible to get results
sage: integrate(1/(x^b+1),x)
integrate(1/(x^b + 1), x)
hope this can be fixed up latter or have some alternative way to work around.
chenmingWed, 16 Oct 2013 13:57:57 -0500http://ask.sagemath.org/question/10617/hypergeometric function 2F1 with in Sagehttp://ask.sagemath.org/question/9689/hypergeometric-function-2f1-with-in-sage/Hello all I've recently began using sage as an alternative to Mathematica, how ever I have not found the sage equivalent to the hypergeometric 2F1 equation. I have looked through the documentation and have found the hypergeometric_U which is used for the 1F1 equation yet this equation is not useful to me. Is there a 2F1 function already implemented within Sage?TKGunterMon, 07 Jan 2013 06:38:25 -0600http://ask.sagemath.org/question/9689/How can one use maxima kummer confluent functions in sagehttp://ask.sagemath.org/question/8727/how-can-one-use-maxima-kummer-confluent-functions-in-sage/Hi, here is my piece of code
var('x,m')
assume(m, 'integer')
y = function('y', x)
desolve(diff(y,x,2) + 2*x*diff(y,x) - 4*m*y, y,contrib_ode=true,ivar=x)
which yields
[y(x) == k1*kummer_m(-m, 1/2, -x^2) + k2*kummer_u(-m, 1/2, -x^2)]
Internet(Wikipedia) sais that the solutions to this differential equation are the Kummer functions or Confluent_hypergeometric_functions. I now want to know how I can use these functions in sage since they must be defined in maxima.
Thanks in advancegod.oneMon, 20 Feb 2012 22:20:27 -0600http://ask.sagemath.org/question/8727/