2019 / Course Final Project

Design Overview

For my final project in Physics Simulations, I developed a simulator with an interface that allows the user to visualize various solutions to the wave equation. This educational tool allows physics students to explore the effects of various initial conditions to understand the behavior of wave propagation as well as how to mathematically model physical phenomena. The graphical user interface (GUI) is ideal for classroom demonstrations. The entire program is written in Python and solves both the one and second dimensional cases of the wave equation. The code for the project is available here, and the video below shows the simulator in action.

Background

In this course, I learned how to numerically solve differential equations in Python using fourth order methods with common applications in physics. I worked alone for my final project, and I chose to build a wave equation solver as an educational tool. The wave equation relates the acceleration of particles with their displacement in one or more dimensions. The 2D wave equation concerns particles moving in the X and Y directions. Solutions to the wave equation demonstrate the motion of mechanical and electromagnetic waves. In order to solve the equation, two initial conditions and four boundary conditions need to be specified. These have physical significance for the type of wave they describe. The code for this project allows people to explore the effects of various initial conditions to visualize the resulting wave propagation behavior as well as how to mathematically model physical phenomena.

2D wave equation.

Method and Results

For this project, I built two simulators for both the 1D and 2D cases of the wave equation. For the 1D case, a string of unit length is considered with fixed ends. For the 2D case, a square of unit area is considered with fixed edges. I chose three initial conditions for each case to produce some classic behaviors: pulse/ripple, standing wave, and split wave propagation. I used the forward-time centered-space difference method to compute the solutions to the wave equation since it is straightforward and not computationally expensive. I also made a simple GUI that lets the user select a button to show the resulting physical behavior. The gallery below shows a video of the simulator GUI as well as stills of the resulting physical behavior.