Here are two simulations I wrote for my senior physics lab at Cornell. The first is a 1-D simulation of a wave packet hitting an infinite potential barrier
and the second is a quantum billiards simulation in 2 dimensions. It took almost 4 hours to get the data for the 2-D wave packet simulation, but in my opinion
it was well worth it. I think its beautiful watching the trapped particle oscillate through different modes, and it's one of my favorite simulatons I have
ever done. Both of these animations were created using the Crank-Nicholson method and written in Jupyter Notebooks. Make
sure you click the download button on all of these videos to get the code yourself and start playing around!
Conway's Game of Life is a zero player game where the result at any time step is determined
by the initial conditions and the dynamics of the game. This game simulates living systems
where each cell either lives, dies, or regrows based on the resources around it. In this simulation
we have the famous Gosper Glider that will go on indefintely. This code was written in Jupyter Notebooks
and the animation done with Matplotlib. In the future, I would like to make this code accept user input
so that someone could draw out an initial condition and then click play to evolve the system ad hoc.
The Boid algorithm simulates flocking behavior of birds or insects. The system exhibits cohesion
(birds try to stay near their neighbors), alignment (birds align their velocities towards the
average velocity of the birds around them), and dispersion (birds cannot get too close to each other). I was inspired by
the Coding Train's video on the algoritm, and took his 2D code and reworked it to function in 3D. In the future I would like to
take the point particle representations of these "Birds" and give them a head and body as well as non-zero volume.
In this demo, I wrote a script in Processing that visualizes some common and some less common but still
interesting sorting algorithms. A lot was learned in this process, particularly the difficulty of animating
recursive versus iterative algorithms. For those that are recursive, it turns out that one will need to implement
a multi-threaded approach in the animating code. My favorite algorithm here is the "Cocktail Shaker Sort". After watching
the video I think it is clear to see why it was given its name.
Another purely CS-based project and a logical follow-up to the Sorting Algorithms project, I decided
to animate some common searching algorithms in Processing. I think my favorite is the breadth first
search priority queue as the logic is relatively simple to understand and something one might think of
right off the bat when designing a searching algorithm from scratch. However, the most visually appealing
is Dijkstra's as we animate both the BFS stage and the final path of least resistance. The shuffle button was
a cool little feature of this project so that each shuffle created a new map. Like with Conway's Game of Life,
I would like to add user input into this project so that anyone could create their own custom maps.
The last project listed here animates the famous Lorenz Attractor. The set of Lorenz Equations are related to a model of the weather and they
are a chaotic system. This is what brought the butterfly effect into mainstream popular science. This set of equations represents a chaotic system. There are
a few different ways to define a chaotic system, but some common attributes are that they never diverge to infinity, they never revisit the same location,
and an initially small disturbance in starting conditions can lead to wildly different outcomes over just a few time steps.