/ proof-of-concept / bead-percussion
Sign in
proof-of-concept / bead-percussion
bead-percussion / matlab / examples / bar.m
41 lines · 1.6 KBCodeBlameHistory
2% (like cords) at the nodes of its lowest mode, 0.224 of the length from
3% each end. Its stiffness comes from bending triplets, so its overtones are
4% not harmonic: for an ideal free bar they sit at 2.76 and 5.40 times the
5% fundamental. The soft supports add low "bouncing" modes of the whole bar
6% below the fundamental. (Pinning the support beads instead holds them
7% rigidly, which moves the overtones a long way.)
8%
9% The bending stiffness is set from the target pitch: an ideal free bar
10% has f1 = 22.37/(2*pi*L^2) * sqrt(EI/rhoA), and the triplets give
11% EI = kb*a^3 and rhoA = m/a.
13N = 41; % beads
14L = 0.2; % length (m)
15rhoA = 0.2; % mass per length (kg/m), e.g. 25 x 3 mm aluminium
16f1 = 880; % target fundamental (Hz)
17thick = 0.15; % kb/k: bending relative to stretching stiffness
19[pos, E, trip] = bp_chain(N, L);
20a = L / (N - 1);
21m = rhoA * a;
22kb = m / a^4 * (2*pi*f1 * L^2 / 22.37)^2;
24sys.springs = bp_springs(pos, E, kb / thick, 0);
25supports = [bp_near(pos, [0.224*L 0 0], 0), bp_near(pos, [0.776*L 0 0], 0)];
26[pos, cords, anchors] = bp_anchor(pos, supports, 500, 0.015); % 500 N/m each
27sys.pos = pos;
28sys.mass = m;
29sys.pinned = anchors;
30sys.springs = [sys.springs; cords];
31sys.bends = [trip, kb * ones(size(trip, 1), 1)];
34hit.t = 0;
35hit.beads = bp_near(pos, [L/2 0 0], 0);
36hit.force = [0 0 -40]; % N
37hit.duration = 5e-4;
38sys.hits = hit;
40sys.listen = struct('beads', N - 2, 'dir', [0 0 1]);
41sys.duration = 2.5;
↑↓ move↵openescclose