"""An experiment the library makes easy: how the taper of a crash changes its low modes and their decay. The preset is edited before evaluation.""" import numpy as np import cymsim from cymsim.presets import mm, ramp inch = 0.0254 R = 8 * inch print(f"{'edge [mm]':>10} {'f0 [Hz]':>8} {'f10 [Hz]':>9} {'modes<16k':>10} {'T60 f0 [s]':>11} {'T60 5k [s]':>11}") for edge in (0.5, 0.7, 0.9, 1.2): d = cymsim.presets.crash_16() d.name = f"crash, {edge} mm edge" d.thickness = lambda x, y, r, t, e=edge: 1.2 * mm + (e * mm - 1.2 * mm) * ramp(40 * mm, R, r) modes = cymsim.compute_modes(d.evaluate(0.010), fmax=16000) near5k = np.argmin(np.abs(modes.freqs - 5000)) 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}")