File Exchange

image thumbnail

2d gas simulation interactive

version (26 KB) by Maxim Vedenyov
It is possible to move balls with mouse. Clicked ball will get velocity of pointer.


Updated 13 Jun 2009

View License

It is part of the project:
2d gas simulation interactive. Program starts with window of parameters: box sizes masses velocities etc. Then simulation starts. It is possible to move balls with mouse clicking the ball. Clicked ball will get velocity of pointer. Also other controls: accelerate, random velocities etc. It is possible to return to window of parameters. Simulation window is elastic and it is possible to stretch it to fill all screen size. See move of it here:

Unzip and run rum_me.m in Matlab.

Thanks to Kotkin G. and Cherkasskiy V. for initial not intaractive simple code.

Cite As

Maxim Vedenyov (2021). 2d gas simulation interactive (, MATLAB Central File Exchange. Retrieved .

Comments and Ratings (6)

Nikolay Dvornikov

Neyugn Yuh

thanks a lot

Zong Hua Chen


Aldo Tamariz B

You are the one.....

Gustavo Morales

Goog work. I've been working in a 2D/3D vectorized version of "billiards", with balls having 2 collisions at the same time and falling (or not) by gravity, but your interactive simulation is better. The only advantage could have my version is that can run with hundreds of particles and not appreciably slowing down

Jackson Shen

MATLAB Release Compatibility
Created with R2008a
Compatible with any release
Platform Compatibility
Windows macOS Linux

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!