phetsims / wave-interference

"Wave Interference" is an educational simulation in HTML5, by PhET Interactive Simulations.
MIT License
19 stars 5 forks source link

Is the output pattern off by 90 degrees? #10

Closed samreid closed 7 years ago

samreid commented 7 years ago

We need to identify ground truth. Central max looks right but qualitative behavior was confusing.

veillette commented 7 years ago

The diffraction pattern on wave interference does not have the correct behavior.

For instance, for the rectangular slit, increasing the width of the slit (which is on the horizontal axis), should narrow the diffraction profile along the x -axis. By Narrowing the profile, I mean that the zero of the Fourier transform, should get closer to one another. Similarly, increasing the height of the slit for a rectangular slit, should only change the diffraction profile along the y axis. It should narrow the diffraction profile solely along the y direction.

It does look as if your diffraction profile output is off by 90 degrees.

veillette commented 7 years ago

Here is a link which shows the expected behavior for different apertures. http://demonstrations.wolfram.com/2DFourierTransforms/

samreid commented 7 years ago

@ariel-phet asked me to reassign this to him to look into the expected patterns and to discuss with a contact at JILA.

veillette commented 7 years ago

In line 366, where the color of the diffraction pattern is assigned, are the indices l and k in reversed order? Assigning to @samreid.

veillette commented 7 years ago

I'm referring to the DiffractionScreenView.js file

samreid commented 7 years ago

Thanks @veillette, I switched the indices and that seems to have corrected it. @ariel-phet, can you please review and verify on phettest?

Also @veillette I bet the author of https://github.com/turbomaze/JS-Fourier-Image-Analysis/blob/master/js/main.js would appreciate the correction, would you like to submit a GitHub issue to that repo?

veillette commented 7 years ago

We can track the GitHub issue at https://github.com/turbomaze/JS-Fourier-Image-Analysis/issues/2

veillette commented 7 years ago

The issue was fixed upstream by https://github.com/turbomaze/JS-Fourier-Image-Analysis/issues/2#event-1337516518.

Assigning back to @samreid to see if he needs to pull the corrected library.

samreid commented 7 years ago

I adopted the proposed solution from https://github.com/turbomaze/JS-Fourier-Image-Analysis/issues/2 and it works great, thanks @veillette and @turbomaze and @waldyrious

Leaving assigned to @ariel-phet to review the behavior on phettest.

samreid commented 7 years ago

For review, here is the original behavior which was reported to be buggy in the top 2 comments of this thread: https://phet-dev.colorado.edu/html/wave-interference/1.0.0-dev.4/wave-interference_en.html

And here is the behavior after we've rotated it by 90 degrees: https://www.colorado.edu/physics/phet/dev/html/wave-interference/1.0.0-dev.5/wave-interference_en.html

ariel-phet commented 7 years ago

Comparing to the demo link @veillette provided dev.5 seems correct. Closing