3688ceacymsim: Python port of cymbalsim with a modal linear model and a PyTorch von Karman modelJeremy Magland 1"""An experiment the library makes easy: how the taper of a crash changes its
2low modes and their decay. The preset is edited before evaluation."""
4import numpy as np
6import cymsim
7from cymsim.presets import mm, ramp
9inch = 0.0254
10R = 8 * inch
11print(f"{'edge [mm]':>10} {'f0 [Hz]':>8} {'f10 [Hz]':>9} {'modes<16k':>10} {'T60 f0 [s]':>11} {'T60 5k [s]':>11}")
12for edge in (0.5, 0.7, 0.9, 1.2):
13 d = cymsim.presets.crash_16()
14 d.name = f"crash, {edge} mm edge"
15 d.thickness = lambda x, y, r, t, e=edge: 1.2 * mm + (e * mm - 1.2 * mm) * ramp(40 * mm, R, r)
16 modes = cymsim.compute_modes(d.evaluate(0.010), fmax=16000)
17 near5k = np.argmin(np.abs(modes.freqs - 5000))
18 print(f"{edge:10.1f} {modes.freqs[0]:8.1f} {modes.freqs[10]:9.1f} {modes.count:10d} {modes.t60[0]:11.1f} {modes.t60[near5k]:11.2f}")