Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
samreid committed Dec 18, 2018
2 parents 0d386ec + 6f24995 commit 6510bcc
Showing 1 changed file with 7 additions and 10 deletions.
17 changes: 7 additions & 10 deletions doc/implementation-notes.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ The first 3 screens show a 2D lattice and time-based wave propagation, while the
pattern from a slit with a given 2d shape, which is instantly updated.

The query string `?log` can be used to output the selected frequency and wavelenth, for debugging.
Other sim-specific query parameters are described in wave-interference/js/common/WaveInterferenceQueryParameters.js
Other sim-specific query parameters are described in [WaveInterferenceQueryParameters](https://github.com/phetsims/wave-interference/blob/master/js/common/WaveInterferenceQueryParameters.js).

There are no dynamically created/destroyed user interface components or model elements in the simulation, so the
simulation doesn't require dispose calls.
Expand All @@ -20,7 +20,7 @@ simulation doesn't require dispose calls.

The first three screens are mainly implemented in js/common.

WavesScreenModel is the main model for these screens. Each `WavesScreenModel` contains 3 `Scene` instances, one for
`WavesScreenModel` is the main model for these screens. Each `WavesScreenModel` contains 3 `Scene` instances, one for
each of water, sound and light. Most settings (such as whether the waves are turned on or off) are independent for each
`Scene`, and each `Scene` has its own physical model and `Lattice`. The tools which appear in the toolbox are shared
across Scenes.
Expand All @@ -36,7 +36,7 @@ described in http://www.mtnmath.com/whatth/node47.html and known as a finite dif
```
f(x,y,t+1) = c*c(f(x+1,y,t) + f(x-1,y,t) + f(x,y-1,t) + f(x,y+1,t) - 4*f(x,y,t)) - f(x,y,t-1) + 2*f(x,y,t)
```
The description for the wave speed c is given in Lattice.js.
The description for the wave speed `c` is given in Lattice.js.

The lattice extends beyond the visible region, and damping is applied near the boundaries to minimize the effects of
reflection and artifacts around the edges.
Expand All @@ -46,7 +46,7 @@ wave speed) for each scene. Run the simulation with `?dev` to get corresponding
and sim play/pause feature to record one cycle. To measure the wave speed, let the light propagate to the edge of the
boundary, then use the measuring tape to measure distance and divide by the elapsed time on the stopwatch.

The time constants have been tuned in WavesScreenModel.js so that the observed Wavelength and Oscillation Time are
The time constants have been tuned in `WavesScreenModel` so that the observed Wavelength and Oscillation Time are
correct.

The following values can also be reported by running with`?log`.
Expand All @@ -72,17 +72,14 @@ is a reasonable wave speed for a wave pool, even though it doesn't match wave sp
| Red (VisibleColor min) | 384.35 | 780.00 |
| Violet (VisibleColor max) | 788.93 | 380.00 |

For green light, measuring the distance traveled by a wavefront and dividing by time gives 2807.3E-9/9.75E-15 = 287928205 m/s,
which is about 4% off of the true speed of light. Measuring the colored wavefront for green, I see a deviation of < 1%.
Since the distance and wave propagation speeds are independent of frequency, measurements for different colors will
give the same speed of light. See also WavesScreenModel usage of `timeScaleFactor` for how the model is calibrated.
For green light, measuring the distance traveled by a wavefront and dividing by time gives 2807.3E-9/9.75E-15 = 287928205 m/s, which is about 4% off of the true speed of light. Measuring the colored wavefront for green, I see a deviation of < 1%. Since the distance and wave propagation speeds are independent of frequency, measurements for different colors will
give the same speed of light. See also `WavesScreenModel` usage of `timeScaleFactor` for how the model is calibrated.

### Slits Screen
Here is a schematic for the two-slit dimensions:
![schematic for the two-slit dimensions](images/slitDimensions.jpg?raw=true "Two-Slit Dimensions")

By using `?dev`, you can show the IdealInterferenceOverlay, which depicts d sin(θ) = mλ (theoretical maxima) and d sin(θ) = (m+1/2)λ (theoretical minima).
See https://github.com/phetsims/wave-interference/issues/74
By using `?dev`, you can show the IdealInterferenceOverlay, which depicts `d sin(θ) = mλ` (theoretical maxima) and `d sin(θ) = (m+1/2)λ` (theoretical minima). See https://github.com/phetsims/wave-interference/issues/74

## The Final Screen: Diffraction
In the fourth screen, we use a Fast Fourier Transform (FFT) in order to compute the diffraction pattern, see
Expand Down

0 comments on commit 6510bcc

Please sign in to comment.