How to solve sigma summation from 1 to infinity I was reading this paper and I came across this algorithm:

on page 2, which I'd like to compute on a computer (programatically), but I don't know how you'd go about evaluating a summation to infinity.
 A: Generally, you can't do such a summation exactly without finding a closed form for it. What you can do, on the other hand, is just sum a lot of terms, since that should give a reasonable approximation for the actual value. Note that the summand can be estimated in absolute value by
$$\frac{2hL^2}{\pi^2 d(L - d)} \frac{1}{k^2}$$
The sequence of partial sums
$$\sum_{k = 1}^N \frac{1}{k^2}$$ converges fairly quickly, and a rigorous analysis can tell you how many terms you'd need until the error is less than whatever your acceptable tolerance is.
A: I see that this is the solution to a wave equation. It is also the final answer. There is no closed formula for this that I know of, and that is typical of PDEs. The way you program it is by summing as much of it as you can with computational cost in mind. Fix/vary L, k, d, h, and run across time. The more terms you use, the better your approximation will be at various points $(x,t)$. In the past I wrote alot of Mathematica visual simulations for solutions to PDEs just like these.
As T. Bongers says, this thing converges really fast. If I were writing a live visual simulator I might start by just looking at the first 25 terms, then consider the cost/benefit of adding more terms.
