Symbolic Sum of Gamma Function with Negative Integer Values

2 vues (au cours des 30 derniers jours)
Thomas
Thomas le 7 Jan 2013
I'm trying to define a number of functions with multiple indices, one of which is used to sum factorial terms that may contain negative values. So I replaced the factorial with the gamma function, but now cannot evaluate the resulting sum due to the singularity. These terms should be zero in my functions, here is a simplified example:
syms q k
fun(q) = gamma(-2*q)
fun2(k) = symsum(k/fun(q),q,0,2)
I need this to produce a function so I can then numerically integrate it. Thanks in advance for your help.
  2 commentaires
Walter Roberson
Walter Roberson le 7 Jan 2013
To check: when you have a factorial of a negative value, you wish the result to be 0? If so that would not be standard for factorial.
Thomas
Thomas le 7 Jan 2013
The factorial was in the denominator; the function (or rather that term in the sum) should be zero. When I evaluate the gamma function at negative integers I get infinity, which is correct, but I cannot then sum those terms to get a usable function. Here is the real code:
m = 1;
S_n1q(q) = (2/pi)^0.5/((-2)^q*factorial(q)*gamma(n-2*q-m+1)*zi^(n+m));
S_n_min1_1q(q) = (2/pi)^0.5/((-2)^q*factorial(q)*gamma(n-2*q-m)*zi^(n+m-1));
S_n_plus1_1q(q) = (2/pi)^0.5/((-2)^q*factorial(q)*gamma(n-2*q-m+2)*zi^(n+m+1));
m = 1;
j = 0;
l = 0;
B_n100(k) = symsum(S_n1q(q)*(k*abs(zi))^(n-q+l-0.5)*besselk(n-q-j-0.5,k*abs(zi)),q,0,(n-rem(n,2))/2);
B_n_min1_100(k) = symsum(S_n_min1_1q(q)*(k*abs(zi))^(n-q+l-1.5)*besselk(n-q-j-1.5,k*abs(zi)),q,0,(n-1-rem(n-1,2))/2);
B_n_plus1_100(k) = symsum(S_n_plus1_1q(q)*(k*abs(zi))^(n-q+l+0.5)*besselk(n-q-j+0.5,k*abs(zi)),q,0,(n+1-rem(n+1,2))/2);
I have a bunch of these functions for different values of n, m, j and l, with n=1:36 and I need to integrate them numerically from 0 to Infinity.

Connectez-vous pour commenter.

Réponses (0)

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by