I need to do summation of this function with Mathematica.
For[t=0,t<500,t++;Sum[-Q*Log[Q],{k,-Infinity,Infinity},{n,-Infinity,Infinity}]]
Q= Q1+Q2+Q3
where
Q1= 1/(Sqrt[(0.2+ 0.2 k)^2] Sqrt[
k^2]) ((0.0220725+ 0.0220725 k) Sqrt[k^2]
Erf[Sqrt[(0.2+ 0.2 k)^2]] -
0.110363 Sqrt[(0.2+ 0.2 k)^2]
k Erf[0.2 Sqrt[k^2]]) (0.886227 Erf[0.8 E^(-0.0004 t) - 0.2 n] +
0.886227 Erf[0.2- 0.8 E^(-0.0004 t) + 0.2 n])
Q2=1/(Sqrt[(0.2+ 0.2 k)^2] Sqrt[
k^2]) ((0.0220725+ 0.0220725 k) Sqrt[k^2]
Erf[Sqrt[(0.2+ 0.2 k)^2]] -
0.110363 Sqrt[(0.2+ 0.2 k)^2]
k Erf[0.2 Sqrt[k^2]]) (-0.886227 Erf[
0.8 E^(-0.0004 t) + 0.2 n] +
0.886227 Erf[0.2+ 0.8 E^(-0.0004 t) + 0.2 n])
Q3=(Erf[0.2+ 0.2 n] -
1. Erf[0.2 n]) (0.0271938 Erf[(0.2+
0. I) - (0.\[VeryThinSpace]+ 0.8 I) Sqrt[
E^(-0.0004 t)] + (0.2+ 0. I) k] +
0.0271938 Erf[(0.2+
0. I) + (0.+ 0.8 I) Sqrt[
E^(-0.0004 t)] + (0.2+
0. I) k] - (0.+ 0.0271938 I) Erfi[
0.8 Sqrt[
E^(-0.0004 t)] - (0.+
0.2 I) k] + (0.+ 0.0271938 I) Erfi[
0.8 Sqrt[E^(-0.0004 t)] + (0.+ 0.2 I) k])
The problem is because Q
cannot be defined at certain k,Sum cannot be done.
(For example, when I try to sum Sum[-Q*Log[Q],{n,-55,55},{k,-55,55}]
at t=0, the error message is "Power::infy: "Infinite expression 1/Sqrt[0] encountered", "indet: Indeterminate expression 0.ComplexInfinity encountered."
Is there a way that i can sum except the points where -Q*Log[Q] cannot be defined?
Thanks.