/ proof-of-concept / cymsim_old
Sign in
proof-of-concept / cymsim_old
docs: the rigid-body drift of a hard-struck free plate and its removal
Jeremy Magland <jmagland@flatironinstitute.org> committed commit 1883edf28fd4 parent d608f95 Browse files
2 changed files+3−1
README.mdmodified+1−1View file
@@ -100,7 +100,7 @@ The tests are physics checks rather than comparisons with the browser applicatio
100100
101101 ## Limitations
102102
103-The linear model has no pitch glide and no wash; a hard hit is only a loud one. The full model is the tool for that, and the two agree for a light hit. The von Karman equations hold for moderate rotations, and the Marguerre treatment of the profile for shallow shells, which strains at the bell of a real cymbal. The plate hangs freely: no stand, no thread, no air loading, and the radiation is that of a plate in a rigid baffle, which overstates the low-frequency level of a plate in free air. The full model carries the losses through a two-parameter fit to an average estimate, so its decay agrees with the modal one on average and not mode by mode. Grid dispersion lowers the high partials (by 3 percent near 1 kHz and 10 percent near 3 kHz for a millimeter of bronze at 8 mm), and the staircase edge places the low frequencies within a few percent. The residual stresses of hammering are absent. The dense eigensolver stores the full matrix, so a three-field system much beyond 10 000 unknowns (a curved 16 inch cymbal at 6 mm) becomes slow on the CPU; spectrum slicing, as the browser application does, would lift that limit.
103+The linear model has no pitch glide and no wash; a hard hit is only a loud one. The full model is the tool for that, and the two agree for a light hit. The von Karman equations hold for moderate rotations, and the Marguerre treatment of the profile for shallow shells, which strains at the bell of a real cymbal. The plate hangs freely: no stand, no thread, no air loading, and the radiation is that of a plate in a rigid baffle, which overstates the low-frequency level of a plate in free air. The full model carries the losses through a two-parameter fit to an average estimate, so its decay agrees with the modal one on average and not mode by mode. Grid dispersion lowers the high partials (by 3 percent near 1 kHz and 10 percent near 3 kHz for a millimeter of bronze at 8 mm), and the staircase edge places the low frequencies within a few percent. The residual stresses of hammering are absent. The von Karman strains are not invariant under a finite rotation and the equations conserve no angular momentum about the in-plane axes, so after a hard strike (a few joules) the free plate slowly tilts and spins in the model, and a tilt of a few degrees then acts as a shell with that slope and pumps energy into the in-plane grid modes, which comes back as an unphysical swell of the sound a second after the strike; the full model therefore projects the six rigid-body modes of the plate out of the state after every batch (`remove_rigid`, on by default). The dense eigensolver stores the full matrix, so a three-field system much beyond 10 000 unknowns (a curved 16 inch cymbal at 6 mm) becomes slow on the CPU; spectrum slicing, as the browser application does, would lift that limit.
104104
105105 ## Layout
106106
THEORY.mdmodified+2−0View file
@@ -106,6 +106,8 @@ The full model keeps the nonlinear strains of Section 1 and steps the semi-discr
106106
107107 **The kernel.** Here cymsim departs from the browser application's hand-written WGSL kernel. The step is a pure function of PyTorch tensors over the $(n_y, n_x)$ grid: the second differences and the cell quantities are slices and pads of the whole arrays, the membrane forces of the four Gauss points are accumulated per cell corner and scattered to the nodes by four padded additions, the stick is a handful of scalar tensor operations, and the transverse velocity at the sample instants is written into a ring buffer from which the retarded-time listener sum is formed once per batch of one movie frame. As written the step is some two hundred small tensor operations, and on the CPU or a GPU alike it would be bound by their dispatch; `torch.compile` fuses them into a few kernels, which makes the step about six times faster on the CPU (0.17 ms for the 16 inch crash, about 90 s per second of sound). On a GPU the fused step is still bound by the Python call and the kernel launches (about 0.1 ms), so the steps of one audio sample are captured into a CUDA graph on static buffers and replayed, one launch per sample; the step then costs about 7 microseconds on an RTX 6000 Ada, 3.9 s per second of sound for the 16 inch crash at 8 mm, and hardly more at four times the nodes. The same code runs on CUDA, on Apple's MPS and on the CPU.
108108
109+**Rigid-body modes.** The von Karman strains $u_x + \tfrac12 w_x^2$ are not invariant under a finite rotation, and the transverse force $\nabla\cdot(N\nabla w)$ has the net moment $-\int N w_x\,dA$ whose in-plane counterpart (the in-plane forces acting at the height $w$) the equations drop, so the model conserves no angular momentum about the in-plane axes. A light hit never shows it, but a strike of a few joules lets the free plate tilt and spin (0.2 rad two seconds after a 2.6 J mallet strike on a 20 inch 0.8 mm plate), and the tilted plate then behaves as a shell with that slope: energy flows into the in-plane grid modes and the sound swells again, on any grid, at any step and in either precision. cymsim projects the six mass-orthonormal rigid modes (transverse translation and two tilts, two in-plane translations and the rotation about the normal) out of the state after every batch; they carry no vibration and, for a free plate, no sound. The browser application, whose default strike is 0.1 J, does not do this.
110+
109111 ## 5. Validation
110112
111113 The test suite checks, on the CPU: that the linear stiffness of every configuration (uniform and tapered rectangles, a disc with a hole) has exactly the rigid modes in its null space; that the forces of the kernel are the exact gradient of the discrete energy at a strongly nonlinear state, flat and bowed, uniform and tapered; that the loss terms only remove energy; that the assembled $K$ equals the linearized force of the kernel to $10^{-6}$ on a bowed, tapered, holed plate; that the three eigensolvers agree and return mass-normalized shapes that satisfy the eigen equation; that the free square and disc frequencies converge to Gorman's and Leissa's values as stated in Section 2; that Zener's loss factor peaks at $\omega\tau = 1$ with the value $\Delta/2$, that the outline perimeter of a disc is within a few percent of $2\pi R$, that the average radiation efficiency has its textbook limits, that the radiation rate of a uniform piston at low frequency equals the closed form and the FFT convolution equals the direct double sum for every mode, that simply supported shapes reproduce Wallace's classical efficiencies to a few percent, and that the thermoelastic rate of a flat uniform plate is $\eta_{te}\omega/2$; that a single mode struck by the stick follows the closed-form damped sinusoid, that the radiation gain of a uniform piston equals the analytic Rayleigh sum, and that the attack and the tail of the synthesized signal join; that a single-precision step of the kernel from a smooth random state of a few thicknesses amplitude agrees with the double-precision step to single-precision rounding, that the energy is conserved without losses, and that the compiled step equals the uncompiled one; and that a light hit (0.05 m/s) on a small plate simulated both ways gives magnitude spectra below 6 kHz with a correlation above 0.98 and levels within 25 percent, the remaining difference coming from the fitted two-parameter loss against the per-mode decay times and the modal truncation.
↑↓ move↵openescclose