I tried to simulate a collision between two bodies with nograv options. I thought I would get an elastic collision result, but it seems that the collision is not perfectly elastic!
Code: Select all
//Gravity fun at TestTubeGames
_add(m: 1, col: 4, lcol: 4, pic: 1, x: -200, y: 0, vx: 5, t: 0,nograv);
_add(m: 1, col: 2, lcol: 2, pic: 1, x: 0, y: 0, t: 0,nograv);
In the above code, the left body was moving with 5 m/s, then it hits another similar body but in rest. If the collision is elastic, the moving body should stop completely, and the body in rest should move by 5 m/s after the collision. This does not happen. Instead, the right body went by 3.75 m/s, and the left body's speed decreased to 1.25 m/s. This means that the total kinetic energy has been decreased from 12.5 J to 7.8125 J.
Is there any option to make the collision elastic?
Thank you so much for your attention and participation.