/ proof-of-concept / bead-percussion
Sign in
proof-of-concept / bead-percussion
bead-percussion / matlab / examples / string.m
33 lines · 1.1 KBBlameHistoryRaw
1% A beaded string, pinned at both ends and struck near one end. Small and
2% fast to run. Its transverse modes are
3% f_k = (1/pi) sqrt(f0/(m a)) sin(k pi / (2(N+1))),
4% nearly harmonic for k << N. A hard strike stretches the string, raising
5% the tension and with it the pitch while the amplitude is large; the
6% string can also swing in y as well as z.
8N = 120; % free beads
9L = 0.65; % length (m)
10mu = 2e-3; % mass per length (kg/m)
11T = 60; % tension (N)
12strain = 0.01; % spring stretch at rest
14[pos, E] = bp_chain(N + 2, L);
15a = L / (N + 1);
16k = T / (strain * a);
18sys.pos = pos;
19sys.mass = mu * a;
20sys.pinned = [1, N + 2];
21sys.springs = bp_springs(pos, E, k, T);
22[sys.friction, sys.dashpots] = bp_decay(pos, sys.mass, sys.springs, [200 7; 2000 3]); % T60 (s)
24hit.t = 0;
25hit.beads = bp_near(pos, [0.12 0 0], 0.01);
26hit.force = [0 0.2 1] * 0.8; % N per bead; slightly off-axis
27hit.duration = 1.5e-3;
28sys.hits = hit;
30sys.listen = struct('beads', N, 'dir', [0 0 1]);
31sys.duration = 2.5;
33fprintf('fundamental (small amplitude): %.1f Hz\n', sqrt(T / mu) / (2 * L));
↑↓ move↵openescclose