% A minimal chaotic system: two beads on a short string, pinned at both % ends, free to move in 3D (6 degrees of freedom). Struck hard and % off-axis, the motion is chaotic: turn on "perturbed twin" to run it again % with the strike changed by one part in 1e9 and watch the two runs % separate exponentially until they are unrelated. Scale the strike down % (try 0.025) and the motion is regular: the separation grows only slowly. % % Transverse modes at small amplitude: sqrt(f0/(m*a))/(2*pi) * [1, sqrt(3)] % = 159 and 276 Hz. a = 0.01; % bead spacing (m) m = 1e-4; % bead mass (kg) f0 = 1; % string tension (N) strain = 0.05; % spring stretch at rest [pos, E] = bp_chain(4, 3 * a); sys.pos = pos; sys.mass = m; sys.pinned = [1 4]; sys.springs = bp_springs(pos, E, f0 / (strain * a), f0); % every mode falls 60 dB in 2.5 s sys = bp_decay(sys, [200 2.5]); s = 1; % strike strength; try 0.025 for regular motion hit.beads = 2; hit.velocity = s * [12 6 40]; % m/s, off-axis sys.hits = hit; sys.listen = struct('beads', 3, 'dir', [0 0 1]); sys.duration = 3; sys.dt = 1 / (48000 * 8); % the automatic step is set at rest; the hard strike % needs a finer one to keep energy drift small