u can look at this for ideas
http://www.phy.ntnu.edu.tw/ntnujava/index.php?topic=1455.0
Ejs Open Source Ideal Gas Model based on Kinetic Theory of Gas