/ concept-collection / acoustic-scattering-2d
Sign in
concept-collection / acoustic-scattering-2d
acoustic-scattering-2d / scenes / slit.m
21 lines · 1.0 KBBlameHistoryRaw
1% A hard screen with two apertures: Young's two-slit experiment, in sound.
2%
3% The screen is a vertical slab of thickness `thick` at x = 0, with two gaps
4% of width `gap` centred at y = +-sep/2 — all in metres. Its sound speed is
5% `cwall`, a ratio to the background `c0`; well above 1 it is nearly rigid, so
6% almost everything that does not go through a slit comes back.
7%
8% Drive it with the plane-wave source (the `point source` parameter at 0) and
9% the two apertures become two sources radiating into the right half-plane.
10% Where their paths differ by a whole wavelength they add; by half a
11% wavelength they cancel. The fringe spacing is set by sep/wavelength, so
12% raising the frequency packs the lobes closer together.
13function [c, sig] = medium(x, y, L, h, c0, cwall, gap, sep, thick)
14 s = 1.5*h;
15 inslab = 0.5 * (1 - tanh((abs(x) - thick/2) / s));
16 inslit = 0.5 * (1 - tanh((abs(abs(y) - sep/2) - gap/2) / s));
17 wall = inslab .* (1 - inslit);
19 c = c0 * (1 + (cwall - 1) * wall);
20 sig = sponge(x, y, L, 0.2*L, 1700);
21end
moveopenescclose