/ tutorials / wave-acoustics
Sign in
tutorials / wave-acoustics
wave-acoustics / src / chapters / ch06 / text.md
41 lines · 6.1 KBPreviewCodeBlameHistoryRaw
1A real drum is round, and a square grid cannot follow a circle. This chapter first listens to what a round membrane sounds like, with its exact modes, and then measures what happens to its pitch when it is put on a grid whose nodes do not lie on its rim. In the previous two chapters the error came from the interior stencil alone. Here the boundary contributes an error of its own, and on a coarse grid it is the larger of the two.
3### The modes of a disk
5The modes of a unit disk clamped at its rim are
7$$u_{mk}(r,\theta,t) = J_m(j_{mk}\, r)\cos(m\theta)\cos(2\pi f_{mk} t), \qquad f_{mk} = \frac{c\, j_{mk}}{2\pi},$$
9where $J_m$ is the Bessel function of order $m$ and $j_{mk}$ its $k$th positive zero, and for $m \ge 1$ there is a second mode with $\sin(m\theta)$ at the same frequency. The index $m$ counts nodal diameters and $k$ counts nodal circles, the rim included. The zeros are not in any simple ratio to one another: relative to the fundamental $j_{01} = 2.4048$, the next modes lie at $1.593$, $2.136$, $2.295$, $2.653$, $2.917$ and so on. The shared library's `wv_bjzeros` finds them by bracketing sign changes of `besselj` and polishing with Newton's method, to within a unit or two in the last place.
11<!--lab:hear-->
13Struck at the centre, the drum sounds only its circularly symmetric modes, $m = 0$, since $J_m(0) = 0$ for every other $m$; their ratios $1$, $2.295$, $3.598$, $4.903, \dots$ are far from any harmonic series, and the result is a dull thud. Struck away from the centre, all the modes join in and the sound becomes brighter and more clangorous. Neither is a musical note. Real timpani do sound a pitch, because the air in the kettle loads the membrane and moves the modes with one nodal circle, $(1,1)$, $(2,1)$, $(3,1)$ and $(4,1)$, close to the ratios $2 : 3 : 4 : 5$, so that the ear hears a missing fundamental below them (Fletcher and Rossing 1998). The ideal membrane here has no kettle.
15### A disk on a square grid
17Cover the square $[-1,1]^2$ with a grid of spacing $h = 2/N$, make every node strictly inside the unit circle an unknown and every other node zero, and use the five-point Laplacian at every unknown. This is the **staircase** approximation: at an unknown whose neighbour lies outside, the stencil acts as if the rim passed through that neighbour. The drum the grid sees has a jagged edge, which is displaced from the true rim by up to one grid spacing, and by an amount that varies irregularly around the circle and from one grid to the next.
19A better treatment keeps the true rim. Where the rim crosses a grid line at a fraction $\theta$ of the way to an outside neighbour, the second difference is taken over the two unequal intervals $h$ and $\theta h$, with $u = 0$ at the crossing:
21$$u_{xx} \approx \frac{2}{h^2}\left[\frac{u_W}{1 + \theta} - \frac{u_P}{\theta}\right].$$
23This is the **Shortley–Weller** stencil (Shortley and Weller 1938). It is only first-order consistent at the boundary nodes, but for Dirichlet problems it gives second-order accurate solutions, and in practice second-order accurate frequencies. It has a cost that the staircase does not: a node very close to the rim has a coefficient $2/\theta$ that can be arbitrarily large, and an explicit time step must be small enough for the largest eigenvalue of the whole stencil.
25<!--fig:rim-->
27The editable script builds the stencil for either treatment; the driver finds its largest eigenvalue by power iteration, runs leapfrog at 0.95 times the largest stable Courant number (never more than the interior's $1/\sqrt{2}$), starts the grid in the exact mode, and measures the frequency of the projection of the field onto that mode. The test modes are $(0,1)$ and $(1,1)$.
29<!--lab:grid-->
31The staircase is poor. Its worst pitch error falls from 54 cents at $N = 16$ to 17 at $N = 64$, which is a fitted order of about 0.8, and it does not fall steadily: from $N = 24$ to $N = 32$ it rises. The errors are all negative, because the staircase drum includes every node inside the circle and puts its effective rim beyond the last of them, so it is slightly too large and sounds slightly flat. How much too large depends on exactly how the circle cuts the grid, which is why the convergence is erratic. Extrapolating at first order, 5 cents would need a grid of about 220 intervals.
33The Shortley–Weller rim is better by a factor of between 7 and 25 on every grid. Its worst error is 7.4 cents at $N = 16$ and 0.69 at $N = 64$, a fitted order of 1.7, and it falls below 5 cents by $N = 24$. The irregularity has not gone, though, and the second plot shows where it went: into the time step. The largest stable Courant number now depends on how close the nearest node comes to the rim, and varies from 0.26 to 0.62 over these grids, against the staircase's 0.67 on every grid. At $N = 64$ it costs a factor of 2.6 in steps.
35The work-precision plot makes the comparison that matters. The Shortley–Weller rim on the coarsest grid, $N = 16$, is more accurate than the staircase on the finest, $N = 64$, for about a fortieth of the time. Over the range measured, a small time step is a far cheaper price than a jagged rim.
37We note two limitations. The time-step penalty is unpredictable: a grid on which one node lands at a thousandth of a spacing from the rim would need a time step thirty times smaller. The usual remedies are to merge such nodes with their neighbours, or to use one of the embedded-boundary schemes designed to avoid the restriction (Kreiss, Petersson and Yström 2002 is one); neither is implemented here. And the measured order of 1.7 is an average over irregular behaviour, not a guarantee; on a different family of grids the numbers would differ in detail.
39### What this chapter establishes
41On a domain the grid does not fit, the boundary treatment can matter more than the interior stencil. A staircase rim costs an order of accuracy and makes the error unpredictable from one grid to the next; a cut-cell stencil such as Shortley–Weller's recovers second order, at a price paid in time step rather than in accuracy. Chapter 5's fourth-order interior stencils would gain nothing on this drum without a boundary treatment of matching order, which is a harder problem and is not attempted here.
↑↓ move↵openescclose