Closed samreid closed 5 years ago
@samreid I will write a more detailed explanation later, but I think what we are going to need to do is set up actual dimensions in the model...get things correct for the airy disk, and base everything off that. It looks like in my initial dive into things, that our assumptions are a bit off, but I will put some numbers and such down in this issue (probably later today).
The short story is that we are seeing numerical artifacts when we exist the far-field condition, and that the dimensions we are labeling our aperture need to be scaled up quite a bit for more "typical" dimensions of such an experiment. We will want to re-calibrate everything to work nicely within the far-field range. Below is going to be some documentation for those conditions.
Alright, let's begin with the governing physics for the airy disk and the conditions we need to meet. Let's also choose some basic dimensions for our setup.
For the FFT to be valid we need to be "in the far field"
The condition for the far field is d>2*D^2/λ
where:
d = the distance from aperture to screen
D = aperture diameter
λ = wavelength
The airy disk is the fourier transform of the aperture in the far field. The conditions for minima are given by sinθ = mλ/D
where:
m = a number derived from zero's of the J bessel function divided by 2*π
(1.22 for first minima)
D = aperture diameter
λ = wavelength
To calibrate we should choose some reasonable dimensions of our setup Distance from aperture to screen = 1 m Size of screen (fairly typical) = 10 cm x 10 cm Wavelength for calibration = 500 nm Apertures in the 10's to 100's of microns range (see MIT video below for an example)
I asked @samreid to make a change so that on my screen the diffraction screen is approximately 500px x 500 px
Setting up the conditions above in a situation with some reasonably round numbers and a clear first minima we see that currently we have something like: wavelength = 500 nm chosen aperture in sim = 370 nm displacement of first minima on screen = 60 pixels corresponds to 1.2 cm (50 pixels per cm) corresponding aperture size for calibration = 50 microns (5e-5 m)
Given the conditions stipulated for the far-field, we should start to see numerical artifact when we exceed an aperture diameter of about 500 microns (for 500 nm wavelength).
Converting what we saw above, things should start to look a little whacky at around 3700 nm aperture in the current sim scaling, and we see some numerical artifacts just creeping in, since we are crossing the boundary to where the Fourier transform no longer applies:
by 4000 nm we see the airy disk pattern breaking down
So to stay in the far field (for our range of wavelengths and assuming the dimensions above)
For 380 nm wavelength, we should keep the aperture below 435 microns (3220 nm currently in sim) For 780 nm wavelength, we should keep the aperture below 625 microns (4625 nm currently in sim)
@samreid we should discuss, but my current recommendations for the sim would be:
For the circular aperture, make the current 3000 nm size in the sim be labelled 400 microns, and make that the largest value of the slider, Make the current 370 nm size in the sim be labeled 50 microns and have that be the lowest value on the slider. (So basically reduce the slider range from 370 nm to 3000 nm, and then relabel it as 50 microns to 400 microns, or 0.050 mm to 0.400 mm)
Keep that aperture size range for all other patterns, using there approximate diameter (so for the grid, the largest diagonal distance being about 3000 nm in the current sim)
The "scale factor" should basically just correspond directly proportionally to the wavelength. So if you half the wavelength the first minima should appear half the distance on the screen (we should be able to check calibration this way).
Notes from discussion with @ariel-phet:
400 / 3000 * 1E-3
use microns vs mm in the controls?
@samreid @ariel-phet I think it makes sense to keep the aperture controls in nm, so students can more easily compare to the wavelength.
Relabel the 1000nm |<-->| would be 133.84 microns. That is an odd number, so shrink it to 100 microns = 0.1mm indicate the dimensions on the fft result, it will be 10x10 cm^2. Show a 1cm |<---->| indicator
For the scale bars, we might want to keep those in the same units instead of mixing microns and cm. I don't think nm is the right choice, but perhaps mm would work well here?
indicate the distance between the aperture and the screen?
I'm not sure that showing the precise distance in the sim adds any pedagogical value. However, the Teacher Tips could certainly indicate that the distance is large (on the order of a meter), or even provide the precise value.
@arouinfar I think mm could be fine for scales on both the aperture and screen views
However, I think using nm for the aperture dimensions is problematic unless you want to use scientific notation (500 microns is 500000 nm), perhaps putting everything besides the wavelength in mm makes sense? If the scale on the aperture view is mm, isn't it natural to have the control in mm?
More notes that may come in handy:
// relabel values for new ranges. Relabel 3000 nm as 400 microns.
// Relabel 370 nm size as labeled 50 micron
// Relabel the 1000nm |<-->| as .....
console.log(Util.linear(370,3000,50,400,1000)); // 133.8403041825095 microns, convert to 100 microns = 0.1mm
If the scale on the aperture view is mm, isn't it natural to have the control in mm?
It seems we are deciding between:
// A
50 μm ----- 400 μm
// B
0.05 mm ----- 0.40 mm
On the one hand, μm is somewhat an obscure measurement. On the other hand, showing ranges in the 0.05-0.4 range is somewhat unwieldy.
Our new coding convention is to code the units directly in the model, so this is not something that can be easily factored out and it will save us the most time to decide on this in advance. It sounds like @arouinfar and @ariel-phet are leaning toward "mm" so I'll start there, but please stop me if you think there's a good chance we'll switch to something else.
UPDATE: I'll follow a mixed approach of coding values like 50E-3. This will clearly mark all the places where we are opting in to mm. If we decide to go with μm
I can simply delete all the E-3
. If we decide to go with mm
then I can multiply them out. So it's not too important to decide between them right away.
I've completed an initial pass of the checklist in https://github.com/phetsims/wave-interference/issues/370#issuecomment-484262232. Next steps:
constrainValue
values if desired@ariel-phet can you please look into it, and let me know what else remains to be done for this issue?
@samreid I checked on master, and everything looks pretty spot on (getting the correct values for minima for a range of aperture sizes and wavelengths, within measurement error).
The one change I would make is cut off the low end of the aperture size at 0.04 mm for square and circle.
The units question should probably have @kathy-phet involved and we can answer at a design meeting.
@samreid I am assuming you have not yet changed the scaling of the pictorial view of the aperture?
The one change I would make is cut off the low end of the aperture size at 0.04 mm for square and circle.
Changed in the preceding commit.
@ariel-phet and I discussed the pictoral view of the aperture over slack, and I committed to show the aperture rectangle at 1/2 size and the aperture pattern at 1/4 size. Ready for review.
@samreid I think this all looks good, To me this screen is getting now to the final "pixel polish" stage.
Marking for design meeting, so we can decide on units, and look over with the team.
@ariel-phet can you please help us complete this issue soon?
Everything is consistently in mm for the aperture dimensions. Closing.
In order to show how the diffraction pattern changes for a fixed aperture size and a varying wavelength, we scale the input to the 2D FFT based on the wavelength. After experimentation, I settled on this rule for scaling:
For example, at the default wavelength, the scaleFactor is 1, and at a wavelength of 380nm, the scaleFactor is 1.38 and at a wavelength of 780, the scaleFactor is 0.21.
@arouinfar and @ariel-phet can you please review this behavior and let me know your thoughts? If you want to change it, please let me know different coefficients for the rule above or a different function to compute
scaleFactor
.