Inspiration

Currently in our second year of undergraduate physics (except Kidane) , we are learning new concepts that are fundamental to modern physics. Currently, we have been learning about the particle/wavelike properties of electromagnetic waves. The McGill Physics hackathon has given us the opportunity to cement our understanding of these concepts. This is why we chose to simulate the double-slit experiment.

What it does

Our simulation allows the user to interactively visualize the double slit experiment real time. The user has the option to change parameters such as the wavelength of the propagation, the length of the slits, the distance between the slits, brightness factor, and number of visualizers. Uses the Huygens-Fresnel Model for the propagation of light

How we built it

The program used Python, and the game engine module Ursina. Other modules used within our project were NumPy, math, and SciPy for some of the calculations. The Ursina engine allowed us to simulate the scenarios in 3D. The game engine allowed for easy creation of a GUI. Within the GUI, the user was allowed to edit a list of parameters. These parameters would then be stored and used for realtime calculations for the propagation. The propagation was then projected on to several planes parallel to the slits.

Challenges we ran into

Connecting the backend of the simulation to the UI was one of the main problems ran into while creating the simulation. Making sure that the parameters were properly updated, along with affecting the simulation correctly was a large issue. Some of the parameters would simply be "added" to the simulation instead of restarting it. The parameters would also act differently than if the same parameters were introduced before the restart of the simulation. Trying to add proper units to the code introduced a lot of bugs, this was eventually fixed, but it took a lot of time to fix.

Accomplishments that we're proud of

Since we are all second year undergrad students, as well as this being most of our members first hackathon, we are quite proud of simply creating a program that functions correctly. From not knowing what to actually design, to pushing a program that works roughly as intended, this hackathon has been quite satisfying. As a group, we all worked very well as a team, and worked together to create the best design possible.

What we learned

Learning how to optimize the code to optimize speed was crucial our simulation. One big thing was organizing our code so that each member could pick up on where other members left off. Making sure everyone was on the same page was paramount to success and making sure time was spent wisely. Learning how to simulate propagated waves was difficult, however we think our method of visualizing wave propagation was effective.

What's next for Double Slit Simulation

Drawing our own occluders would be a fun addition to the program. We were very close to implementing this, and it would be slightly simple in the future. We didn't have enough time to implement it and make sure all the bugs were flushed out. More optimizations were likely possible, such as using shaders to increase the processing speed.

Built With

Share this project:

Updates