Dear Sir,

Would you please give the definition (mathematical expression) of coefficient of restitution in terms of the velocities of masses before and after collision?

Is the kinetic energy of the system consisting of the two masses conserved in an elastic collision?

I suppose you are stating that some of the kinetic energy gets transformed into heat and is lost from the system when the collision is inelastic. I want you to confirm this please.

[/quote]

For the above simulation:

The ratio of its rebound speed Vf to its collision speed Vi (coefficient of restitution) is kept as a constant value ,when its bounces off a hard, stationary surface that can't move.

The default value is 0.8 In this case, 36% of kinetic energy(before bouncing) is loss each time.