New answers tagged

0

When you are first defining Kin[n1_,n2_] you are not specifying anything about n1 or n2. For simpler cases MMA returns ConditionalExpression. However, as much I have seen, for complicated evaluation MMA goes with an approximation which is more widely applicable (in your case n1,n2>1). To bypass this, you can always put Assumptions with your evaluation. ...


1

I am not sure whether the symbolic calculation is correct, but I would suggest that you don't pre-calculate the value of the sum; rather, let the sum be calculated when the values of $n_1$ and $n_2$ are on hand by using SetDelayed in your definition of K1: Clear[Kin] Kin[n1_, n2_] := Sum[(-1)^(m1 + m2 + 1) * Binomial[n1 + 1, m1 + 2] * Binomial[n2 + 1, m2 ...


5

sumF = Sum[f[k] Boole[#], {k, -Infinity, Infinity}] &; sumF[m <= 100 - k^2 <= n] sumF[0 <= 100 - k^2 <= 50] f[-10] + f[-9] + f[-8] + f[8] + f[9] + f[10] sumF[0 <= 100 - k^2 <= 50] /. f -> (#^2 &) 490 Sum[i^2 Boole[0 <= m - i^2 <= n], {i, -Infinity, Infinity}]


5

Well, basically your code is designed with a less efficient algorithm. Bear in mind that Mathematica generally treats a matrix the "same" as a number, so don't spend time on computation conducted at the number level. Then we can convert your code to be running at the matrix level, where the speed is much increased. len = 20; data = RandomReal[{1, 10}, ...


3

Simplify your functions when they are defined. G[n_, Q_, eta_] = (-1)^(n + 1)*(4 Q - 2 n + 1)! (n - 1)! (1 - eta^2)^(2 Q - n) eta^2 JacobiP[n - 1, 2, 4 Q + 1 - 2 n, 1 - 2 eta^2]/(4 Q - n)! // FullSimplify; Gnp12[n_, Q_, eta_] = (-1)^ n (4 Q - 1 - 2 n)!/((4 Q - n - 1)! (4 Q + 1 - n)!) eta^2 (n + 2)!* Sum[Binomial[n, m]*(4 Q + 1 - n ...


6

One can reformulate slightly nmx = 3 1/π^2 Sum[1/(n^2 + m^2) Cos[n x] Cos[m x], {n, 1, nmx}, {m, 1, mmx}] Interestingly, when x=$\pi$ the sum with infinite limits can be computed 1/π^2 Sum[1/(n^2 + m^2) Cos[n π] Cos[m π], {n, 1, ∞}, {m, 1, ∞}] (*1/12 1/π^2 (π^2 - π Log[8])*)


10

For large enough bounds, NSum is used. Compare timings: NSum[(-1)^(n + 1)/n, {n, 1, 100000}] // AbsoluteTiming {0.004744, 0.693142 - 1.3494*10^-16 I} N[Sum[(-1)^(n + 1)/n, {n, 1, 100000}]] // AbsoluteTiming {1.84727, 0.693142}



Top 50 recent answers are included