/ tutorials / wave-acoustics
Sign in
tutorials / wave-acoustics
wave-acoustics / src / chapters / ch04 / text.md
47 lines · 5.1 KBPreviewCodeBlameHistoryRaw
1In two dimensions a wave can travel in any direction, and a square grid does not look the same in every direction. This chapter moves the leapfrog scheme to a square membrane, where the exact solution is still a sum of known modes, and measures the two things that change: there is no longer a Courant number at which the scheme is exact, and its error depends on which way a wave is going.
3### The square membrane
5A unit square membrane clamped at its rim has the modes
7$$u_{mn}(x,y,t) = \sin(m\pi x)\sin(n\pi y)\cos(2\pi f_{mn} t), \qquad f_{mn} = \frac{c}{2}\sqrt{m^2 + n^2},$$
9for all $m, n \ge 1$. Unlike a string's, these frequencies are not multiples of the lowest. Relative to $f_{11}$ they are $1$, $1.581$ (twice, for $(1,2)$ and $(2,1)$), $2$, $2.236$ (twice), $2.550$ (twice), $2.915$ (twice), $3$ and so on, growing more densely packed as the frequency rises. A spectrum of that kind has no single pitch, which is why a drum sounds like a drum.
11<!--fig:modes-->
13The first lab strikes the drum: the membrane starts at rest and receives a Gaussian blow of velocity, 0.03 of its side wide, at one point, and it is heard at another. The fundamental is 150 Hz. The exact solution is the modal sum with every mode's coefficient known in closed form, and the driver evaluates it at the receiver, over about 2600 modes, for comparison. Striking at the centre, where every mode with an even index has a node, silences three quarters of the modes.
15### The scheme in two dimensions
17The scheme is Chapter 2's with the five-point Laplacian:
19$$u_{ij}^{n+1} = 2u_{ij}^n - u_{ij}^{n-1} + \lambda^2\big(u_{i+1,j}^n + u_{i-1,j}^n + u_{i,j+1}^n + u_{i,j-1}^n - 4u_{ij}^n\big).$$
21A Fourier mode with wave vector $(k_x, k_y)$ now satisfies
23$$\sin^2\!\left(\frac{\omega\Delta t}{2}\right) = \lambda^2\left[\sin^2\!\left(\frac{k_x h}{2}\right) + \sin^2\!\left(\frac{k_y h}{2}\right)\right].$$
25The right-hand side is largest for the checkerboard mode, $k_x h = k_y h = \pi$, where it is $2\lambda^2$, so the scheme is stable if and only if $\lambda \le 1/\sqrt{2}$. At that limit the dispersion relation is exact for waves travelling along a diagonal, but for no others, and below it for none at all. There is no magic time step.
27<!--lab:strike-->
29At $N = 48$ and $\lambda = 0.7$ the scheme runs at 14.5 kHz and the relative rms error of the recording is 0.59; at $N = 64$ it is 0.54, and at $N = 24$ it is 0.80. These are large numbers, and the spectrum shows why. The blow excites modes up to a few kilohertz, and on these grids those modes have only three or four points per wavelength, so they come out flat by hundreds of cents and the recording drifts out of phase with the exact one within a few periods. The lowest modes, which carry most of the energy and set the character of the sound, are close to right. Listening confirms both halves of this: the coarse drum is recognisably the same drum, with a duller and slightly different ring.
31### The error depends on direction
33Expanding the dispersion relation for long waves, as in Chapter 2, gives for a wave at angle $\theta$ to the $x$ axis
35$$\frac{\omega}{ck} = 1 - \frac{(kh)^2}{24}\left(\cos^4\theta + \sin^4\theta - \lambda^2\right) + O\big((kh)^4\big),$$
37so the pitch error at $P$ points per wavelength is about $-2847\,(\cos^4\theta + \sin^4\theta - \lambda^2)/P^2$ cents. Along an axis, $\cos^4\theta + \sin^4\theta = 1$ and the error is the one-dimensional one. Along a diagonal it is $1/2$, the error is smaller, and at $\lambda = 1/\sqrt{2}$ it vanishes. The grid is **anisotropic**: waves along its axes travel slowest.
39<!--fig:anisotropy-->
41For the modes of the square this is directly measurable, because the sine vectors $\sin(m\pi i/N)\sin(n\pi j/N)$ are exact eigenvectors of the five-point Laplacian: a single mode on the grid stays a single mode, and only its frequency is wrong. The next lab starts the grid in a sum of modes at three wavelengths and at directions from $4°$ to $86°$, projects the field onto each, and measures each frequency from its own recording.
43<!--lab:cents-->
45The measured errors agree with the dispersion relation to better than $10^{-6}$ cents. At about 16 points per wavelength the error along the axes is $-5.4$ cents at $\lambda = 1/\sqrt{2}$ and $-10.0$ at $\lambda = 0.3$, and along the diagonal it is $0$ and $-5.1$. At about 8 points per wavelength the axis error is $-23$ cents at the stability limit, and at about 4 it is $-101$. Running at the largest stable time step is again the most accurate choice as well as the cheapest. What it cannot change is the spread between directions, which for waves of the same length is, to leading order, $2847/(2P^2)$ cents whatever the Courant number.
47The conclusion for a drum is the same as for a string, with a worse constant. To hold every mode within 5 cents, the grid needs about 17 points per wavelength at the stability limit for waves along its axes, which in two dimensions means about $17^2 \approx 290$ nodes per square wavelength, and every halving of the error costs a factor $\sqrt{2}$ in each direction and in time, so $2^{3/2} \approx 2.8$ in work. Chapter 5 asks whether a more accurate stencil does better.
↑↓ move↵openescclose