The total momentum of the involved bodies is conserved, regardless whether the collision is elastic or inelastic. The movement of the common center of gravity (indicated by a yellow dot) is not influenced by the collision process.
You can choose the simulation of an elastic or an inelastic collision by using the appropriate radio button on the top right. The "Reset" button brings the wagons to their initial positions; the animation is started by a mouse click on the "Start" button. If you select the option "Slow motion", the movement will be ten times slower.
You can write the values of mass and initial velocity into the textfields. Positive (negative) values of velocity mean a motion to the right (left) side. Extreme inputs are automatically changed.
Dependent on the selected radio button (on the bottom right), the applet will illustrate the velocities, the momenta or the kinetic energies of the wagons.