/ concept-collection / acoustic-scattering-2d
Sign in
concept-collection / acoustic-scattering-2d
acoustic-scattering-2d / scenes / disk.m
28 lines · 1.4 KBBlameHistoryRaw
1% A single circular scatterer in a uniform background: the reference case.
2%
3% In two dimensions this is the classical "scattering by a circular cylinder"
4% problem — the 2D problem is the 3D one for fields that do not vary along z,
5% so a disk in the (x, y) plane is the cross-section of an infinite cylinder.
6% That is the object with an exact series solution in Bessel and Hankel
7% functions, which makes it the thing to look at first.
8%
9% Sound speed only, at constant density, so the impedance ratio across the
10% interface is just the speed ratio cin: cin much greater than 1 behaves
11% nearly rigid (sound-hard), cin much less than 1 nearly pressure-release
12% (sound-soft), and cin = 1 is no scatterer at all. `c0` is the speed of sound
13% in air (343 m/s), which the app supplies; `cin` is a plain ratio to it, so
14% the slider means the same thing whatever c0 is.
16% `R` and `absorb` are in the app's own units — metres and inverse seconds —
17% since they are lengths and rates, not ratios to anything.
19% The interface is smoothed over about a cell so that the discrete medium is
20% resolved by the grid. A jump between two neighbouring cells is not: it
21% scatters the grid's own staircase rather than a circle.
22function [c, sig] = medium(x, y, L, h, c0, cin, R, absorb)
23 r = sqrt(x.^2 + y.^2);
24 inside = 0.5 * (1 - tanh((r - R) / (1.5*h)));
26 c = c0 * (1 + (cin - 1) * inside);
27 sig = sponge(x, y, L, 0.2*L, 1700) + absorb * inside;
28end
moveopenescclose