
Developed by Christopher Orban - Published June 7, 2017
DOI: 10.1119/PICUP.Exercise.WaveInterference
This exercise illustrates wave interference in 2D by adding two sine-waves together. The result looks very much like the interference pattern that can be created with ripples in a pond.
This exercise will use a programming language called p5.js that is very similar to C and C++ programming. (Note: If you are familiar with C or C++ the main difference you will see is that there is no main() function and instead the draw() function serves this role.) Importantly, this exercise can be completed using any computer or chromebook without downloading any software!
This exercise is designed for an algebra-based physics class at the college or high school level. It may also be useful for calculus-based physics for non-majors (e.g. engineering & science majors). However, it does use a taylor expansion, so perhaps it is more of an introductory calculus based exercise This exercise is part of a series of exercises developed by Prof. Chris Orban.
There are pre-and-post assessment questions associated with this exercise (not available here) that are being used in an educational research study. If interested to collaborate on that study please e-mail Prof. Chris Orban (orban@physics.osu.edu). The first paper from this study is available at this link, the second paper which discusses the electromagnetism exercises is available at this link
Subject Area | Waves & Optics |
---|---|
Level | First Year |
Available Implementation | Javascript |
Learning Objectives |
|
Time to Complete | 60 min |
These exercises are not tied to a specific programming language. Example implementations are provided under the Code tab, but the Exercises can be implemented in whatever platform you wish to use (e.g., Excel, Python, MATLAB, etc.).
This programming lab is designed to illustrate the idea of wave interference. This happens because of the principle of “superposition”. For sound waves, this 20 dollar word just means that if there are two speakers in a large room or open space, the amplitude of the sound waves at a particular point in that room are the sum of the waves of the two speakers.
Step 1. Open up the code in an editor
Make sure to set your speaker volume low before you press play!!!
Click here to open up the code in an editor
Press the play button (red triangle) in the top left to run the code.
If for some reason you can’t open it up in the editor you can also try out the interactive at this link
Here is a version without the red line that runs faster (useful for chromebooks)
Step 2. Explore the Interference
Step 2a. Move the little microphone to find the constructive and destructive interference
Move the little microphone around and listen to the amplitude of the tone. When you put the little microphone in a place where there is destructive interference there should be almost no sound. When you put it at a point of constructive interference, the tone should be much louder.
Step 2b. Move the speakers around
Move the speakers around by clicking and dragging the speakers to a new location on the x axis. How does it change the interference pattern?
Step 3. Look at this diagram:
Later, in Step 5 you will need to write down r1 and r2 as a function of d, x, and y.
Step 4. Think about the math involved
If there was just Speaker #1 the instantaneous amplitude S1 at (x,y) would be this:
S1=A1sin(k1r1−ω1t)where r1 is the distance between speaker #1 and the point (x,y).
Likewise, the instantaneous amplitude at (x,y) from only speaker #2 would be this:
S2=A2sin(k2r2−ω2t)where r2 is the distance between speaker #2 and the point (x,y).
If you have both speakers then the amplitude at a particular point in the room would be this:
S1+S2=A1sin(k1r1−ω1t)+A2sin(k2r2−ω2t)The following trig identity is very useful:
sina+sinb=2cos(a−b2)sin(a+b2)Assume A1=A2=A, ω1=ω2=ω, k1=k2=k, and use this expression to prove that the following is true:
S1+S2=2Acos(k(r1−r2)2)sin(k(r1+r2)−2ωt2)and constructive/destructive interference depends on whether the cosine term works out to be equal to zero or one.
Step 5. Look at the diagram again and figure out r1 and r2
Look at the diagram from Step 3 again. How would you write r1 and r2 in terms of x, y and d?
Step 6. Consider Destructive Interference
Use the previous equation to explain why the following is the correct equation for destructive interference:
|r1−r2|=nλ2
Why is destructive interference only achieved if n=1,3,5,7…?
Step 7. Approximate!
The previous expression turns out to be difficult to work with:
|r1−r2|=nλ2
√(x+d)2+y2−√(x−d)2+y2=nλ2
We’d really like to be able to solve for y, but there’s no simple way of doing this. If you try to square both sides, for example, this doesn’t help much to isolate y and x.
When you’re stuck like this, sometimes the best you can do is approximate. Notice the following trick if |b/a|≪1,
√a+b=a√1+ba≈a(1+12ba)Use this trick to prove that the lines of destructive interference follow this formula:
y=±4dnλxStep 8. Plot up the lines of destructive interference!
Modify the code to plot up the lines in the programming activity. Show that the lines for n=1 match up well with the interference fringes. The result should look like this:
Step 9. Move the speakers around!
Move the speakers around by clicking and dragging the speakers to a new location on the x axis. Bring the speakers closer and further apart. Do your lines still match up with the interference pattern?
Step 9. (Extra Credit:) Consider n = 3, 5, 7…
Plot the lines of destructive interference for n = 3, 5, 7… and compare to the simulated wave pattern. These lines will not compare as well to the simulation as it does for n = 1. Why does n > 1 compare less well to the lines of destructive interference in the simulation? Do you have any ideas for improving the locations of the lines? How could we make the approximation better?
How to get full credit on this programming lab
1. Describe in words what happens when you change the separation between the speakers (Step 2b)
Click and drag the speakers closer and further apart. Describe with words what happens to the interference pattern.
2. Use the trig identify to produce the interference formula (Step 4)
Assume A1=A2, ω1=ω2 and derive the equation below for the addition of two sine waves
S1+S2=2A1cos(k(r1−r2)2)sin(k(r1+r2)−2ω2t2)2. Write r1 and r2 in terms of x, y and d (Step 5)
This is the primary task of Step 5.
3. Explain why destructive interference only occurs for n = 1,3,5,7… (Step 6)
This is the primary task of step 6. Why would n=2,4,6… not give destructive interference?
4. Derive y=±4dnλx from approximating the equation for destructive interference (Step 7)
This will take a couple of steps. Write these steps out on a sheet of paper, take a picture with your phone, and submit it to the assignment dropbox on canvas.
5. Submit your code with the plotted lines (Step 8)
Modify your code until it looks like the video shown in Step 8.
(Optional) 6. Comment on n = 3, 5, 7…
For extra credit, modify your program to show the lines of destructive interference for n = 3, 5, 7… Explain why these lines don’t compare very well to the destructive interference in the wave pattern whereas the n = 1 result does. Comment on how you would perhaps improve upon the solution y=±4dnλx. To be clear, there is more than one way that this solution could be improved upon.
Download Options
Share a Variation
Credits and Licensing
Christopher Orban, "Wave Interference (with sound!)," Published in the PICUP Collection, June 2017, https://doi.org/10.1119/PICUP.Exercise.WaveInterference.
DOI: 10.1119/PICUP.Exercise.WaveInterference
The instructor materials are ©2017 Christopher Orban.
The exercises are released under a Creative Commons Attribution-NonCommercial-ShareAlike 4.0 license
