Hi,
isn't this just a hypergeometric function?
E.g.
def jacobi(n, alpha, beta, z):
return rf(alpha, n)/factorial(n) * hyper([-n, 1 + alpha + beta +
n], [1 + alpha], (1-z)/2)
In [4]: jacobi(5, alpha, beta, z)
Out[4]:
┌─ ⎛-5, α + β + 6 │ z 1⎞
α⋅(α + 1)⋅(α + 2)⋅(α + 3)⋅(α + 4)⋅ ├─ ⎜ │ - ─ + ─⎟
2╵ 1 ⎝ α + 1 │ 2 2⎠
────────────────────────────────────────────────────────────────
120
In [21]: collect(expand(hyperexpand(jacobi(2, S(1)/4, 3, z))), z)
Out[21]:
2
725⋅z 275⋅z 5
────── - ───── + ────
1152 576 1152
Is this what you are looking for?
Best,
Tom
On 12.04.2013 22:27, Freddie Witherden wrote:
Hi all,
I recently had a need for Jacobi polynomials with the property that
int(P(i, a, b, x)*P(j, a, b, x)*(1-x)^a*(1+b)^b, (x, -1, 1) = delta_ij
as I could not find these in SymPy I've come up with the following:
def norm_jacobi(n, a, b, x):
G, F = sy.gamma, sy.factorial
N2 = sy.S(2)**(a + b + 1)/(2*n + a + b + 1)\
* (G(n + a + 1)*G(n + b + 1))/(F(n)*G(n + a + b + 1))
return sy.jacobi(n, a, b, x) / sy.sqrt(N2)
with the key element being the normalization factor. Would it be
possible to get this upstream (it is a pain to code up!), for example as
a norm=True kwarg?
Regards, Freddie.
--
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?hl=en-US.
For more options, visit https://groups.google.com/groups/opt_out.