I'm trying to calculate the total distance travelled by an object with a known initial velocity and a damping factor that is applied to the velocity at each timestep. The iterative solution is easy:
// timestep and damping are constant
// v is velocity
// d is total distance
while (Math.abs(v) > 0.001) {
d += timestep * v;
v *= damping;
}