The Ejs Hard Disk Gas model displays a two-dimensional gas made out of hard disks. Particles are initialized with a speed v=1 in a random direction and move with constant velocity until a collision occurs. You can modify this simulation if you have Ejs installed by right-clicking within the plot and selecting "Open Ejs Model" from the pop-up menu item.
Ejs Hard Disk Gas model was created using the Easy Java Simulations (Ejs) modeling tool. It is distributed as a ready-to-run (compiled) Java archive. Double clicking the ejs_newton_HardDiskGas.jar file will run the program if Java is installed. Ejs is a part of the Open Source Physics Project and is designed to make it easier to access, modify, and generate computer models. Additional Ejs models for Newtonian mechanics are available. They can be found by searching ComPADRE for Open Source Physics, OSP, or Ejs.
Please note that this resource requires
at least version 1.5 of Java (JRE).
i love Ejs Hard Disk Gas Model. i get to learn alot from modifying the codes.
I can't say i know exactly what each line of code is doing but i am presented a way to make sense of the computational physics by changing a bit of the codes and observe what happens.
my remixed work here http://www.phy.ntnu.edu.tw/ntnujava/index.php?topic=1455.0 will run your collision detection codes!
I also notice it is too difficult to run 400 molecules smoothly due to the calculation of the event for 400*400 collisions possible. Will lower it to 50 molecules!
Thanks Prof Wolfgang! going to rate this 5 stars! :)
W. Christian, Computer Program EJS HARD DISK GAS MODEL, Version 1.0 (2008), WWW Document, (https://www.compadre.org/Repository/document/ServeFile.cfm?ID=7573&DocID=593).
W. Christian, Computer Program EJS HARD DISK GAS MODEL, Version 1.0 (2008), <https://www.compadre.org/Repository/document/ServeFile.cfm?ID=7573&DocID=593>.
Christian, W. (2008). Ejs Hard Disk Gas Model (Version 1.0) [Computer software]. Retrieved December 5, 2024, from https://www.compadre.org/Repository/document/ServeFile.cfm?ID=7573&DocID=593
Christian, Wolfgang. "Ejs Hard Disk Gas Model." Version 1.0. https://www.compadre.org/Repository/document/ServeFile.cfm?ID=7573&DocID=593 (accessed 5 December 2024).
%A Wolfgang Christian %T Ejs Hard Disk Gas Model %D July 1, 2008 %U https://www.compadre.org/Repository/document/ServeFile.cfm?ID=7573&DocID=593 %O 1.0 %O application/java
%0 Computer Program %A Christian, Wolfgang %D July 1, 2008 %T Ejs Hard Disk Gas Model %7 1.0 %8 July 1, 2008 %U https://www.compadre.org/Repository/document/ServeFile.cfm?ID=7573&DocID=593
Disclaimer: ComPADRE offers citation styles as a guide only. We cannot offer interpretations about citations as this is an automated procedure. Please refer to the style manuals in the Citation Source Information area for clarifications.
made changes to the model so that i can learn more about it and the changes are:
1. made n selectable by defining nmax and insert as the n maximum limit 2. made v0 selectable by changing the codes 3. made arrows array to be drawn to understand where the particles are heading 4. made text array to allow eye balling what each particle is doing 5 change some minor values to make cellSize selectable as well. 6 added e coefficient of restitution but the codes does not work well when e = 0 probably due to the collision detection codes, goes to a deep loop when too much particles are near each other.