% A beaded string, pinned at both ends and struck near one end. Small and % fast to run. Its transverse modes are % f_k = (1/pi) sqrt(f0/(m a)) sin(k pi / (2(N+1))), % nearly harmonic for k << N. A hard strike stretches the string, raising % the tension and with it the pitch while the amplitude is large; the % string can also swing in y as well as z. N = 120; % free beads L = 0.65; % length (m) mu = 2e-3; % mass per length (kg/m) T = 60; % tension (N) strain = 0.01; % spring stretch at rest [pos, E] = bp_chain(N + 2, L); a = L / (N + 1); k = T / (strain * a); sys.pos = pos; sys.mass = mu * a; sys.pinned = [1, N + 2]; sys.springs = bp_springs(pos, E, k, T); sys.dashpots = [E, 2e-4 * ones(size(E, 1), 1)]; sys.friction = 2e-5; hit.t = 0; hit.beads = bp_near(pos, [0.12 0 0], 0.01); hit.force = [0 0.2 1] * 0.8; % N per bead; slightly off-axis hit.duration = 1.5e-3; sys.hits = hit; sys.listen = struct('beads', N, 'dir', [0 0 1]); sys.duration = 2.5; fprintf('fundamental (small amplitude): %.1f Hz\n', sqrt(T / mu) / (2 * L));