Return

For this week's assignment, we had to create a model of Maxwell's demon. Maxwell's Demon is a thought experiment posed by James Clerk Maxwell in which the second law of thermodynamics is violated. You begin with chaos: balls of different speeds separated in a box by a dividing line. The demon opens a door in the divider in order to allow some balls to go through. Specifically, the demon allows fast balls to go right-to-left, while slow balls are allowed to go left-to-right. In so doing, you get order from chaos. My python coding is poor-at-best. I found a tutorial on how to do animation using Matplotlib, which included a bouncing ball animation. Modifying that code, I expanded the box, created the barrier, and set up the rules for when the balls bounce back and when the door opens.
Python code is here.