Maxwell's Demon


For this assignment, I used three.js. I have never used three.js before, so there was a bit of a learning curve. I initially started out by writing functions that would describe the trajectory of the particles after collisions with boundaries and with each other. But, I realized that when I had a lot of particles at once, the motion was similar to that of erratic random walks by each particle. So I went with a random walk for all particles.

Plot number of particles per bin: I divided the boxes into strips and counted how many particles are in each strip and that's the plot shown below. After some time you will notice that the plot has distinct red particles on one half and green on the other.

Adjusting the speed of the particles and number of particles -> Change the parameters in code


CodePen for Editing (Scroll down for visualization)

See the Pen Maxwell's Demon by Raghava Manvitha Reddy Ponnapati (@alienrobotfromthefuture) on CodePen.