Particles

Hi there
As a science teacher, I am keen to make an animation that shows the orderly arrangement of the particles in a solid moving by vibrating only, the random jostling of the particles close together in a liquid and the chaotic random movement of particles in a gas.
The particles to be enclosed in a container and to bounce off the walls of that container (gas only). The script would be of immense help. Thanks a lot.