Student Support Forum: 'Slowdown of computation of multiple sums' topicStudent Support Forum > General > "Slowdown of computation of multiple sums"

 Next Comment > Help | Reply To Topic
 Author Comment/Response Vojta 11/26/12 4:04pm Hello, I am trying to compute summation of function over multiple variables. In particular I deal with terms like function[u_, t_] := Sum[D[1/t!*(e + Em*e^2)^m* RD[0, Sqrt[(l + 1)^2 - Z^2*a^2] - 1/2 (ro + 1) + n, Sqrt[(l + 1)^2 - Z^2*a^2] - 1/2 (ro + 1), Sqrt[1 - Z^2*a^2] - 1, l + 2*q, e/2]* RD[0, Sqrt[(l + 1)^2 - Z^2*a^2] - 1/2 (ro + 1) + n, Sqrt[(l + 1)^2 - Z^2*a^2] - 1/2 (ro + 1), Sqrt[1 - Z^2*a^2] - 1, l + 2*(p - q), e/2], {e, t}] /. e -> 0, {m, 0, t}, {l, 0, u}, {p, 0, u - l}, {q, 0, p}, {ro, -1, 1, 2}, {n, 1, 500}] where Em,Z,a is constant and RD is hypergeometric function RD[0, n_, l_, L_, p_, e_] := Hypergeometric2F1[1 + l - n, 3 + l + L + p, 2 + 2 l, ( 2 (1 + e))/((1/(1 + L) + (1 + e)/n) n)] Now, I would expect that for higher t the summation will take longer to compute because the function inside can be complicated due to t-th derivative. However, even for t=0 when no derivative occurs it takes much longer to compute than when I explicitly define the function being summed as RD[0, Sqrt[(l + 1)^2 - Z^2*a^2] - 1/2 (ro + 1) + n, Sqrt[(l + 1)^2 - Z^2*a^2] - 1/2 (ro + 1), Sqrt[1 - Z^2*a^2] - 1, l + 2*q, 0]* RD[0, Sqrt[(l + 1)^2 - Z^2*a^2] - 1/2 (ro + 1) + n, Sqrt[(l + 1)^2 - Z^2*a^2] - 1/2 (ro + 1), Sqrt[1 - Z^2*a^2] - 1, l + 2*(p - q), 0] which is just the function used earlier for particular choice of t=0. Why is the first approach so slow? URL: ,

 Subject (listing for 'Slowdown of computation of multiple sums') Author Date Posted Slowdown of computation of multiple sums Vojta 11/26/12 4:04pm Re: Slowdown of computation of multiple sums Bill Simpson 11/29/12 3:51pm Re: Re: Slowdown of computation of multiple sums Vojta 12/08/12 08:37am Re: Slowdown of computation of multiple sums Bill Simpson 12/08/12 8:01pm
 Next Comment > Help | Reply To Topic