3bd39d8Dome: hinge elements (sys.hinges, Bridson gradient, rest angle from sys.pos), bp_hinges, full 3D linear modes for curved nets, axial dashpots so bp_decay is exact for all modes, bp_decay takes and returns sys; dome exampleJeremy Magland 1function sys = bp_decay(sys, T60)
2% BP_DECAY Set the damping from chosen decay times.
3% sys = bp_decay(sys, T60) sets sys.friction and sys.dashpots, and adds a
4% damping column to sys.bends and sys.hinges if present, such that at
5% small amplitude each mode decays at the amplitude rate
0330c41Damping by decay times: bp_decay helper, per-mode decay-time plot, examples convertedJeremy Magland 6% sigma(f) = sigma0 + sigma1 * (2*pi*f)^2,
7% passing through the decay times in T60 = [f1 T1; f2 T2] (Hz, seconds to
8% fall by 60 dB). With a single row [f1 T1], every mode gets the same
9% decay time. T1 must be at least T2 when f1 < f2 (higher modes cannot
3bd39d8Dome: hinge elements (sys.hinges, Bridson gradient, rest angle from sys.pos), bp_hinges, full 3D linear modes for curved nets, axial dashpots so bp_decay is exact for all modes, bp_decay takes and returns sys; dome exampleJeremy Magland 10% ring longer under this law). Call it after the elements are set.
0330c41Damping by decay times: bp_decay helper, per-mode decay-time plot, examples convertedJeremy Magland 11%
3bd39d8Dome: hinge elements (sys.hinges, Bridson gradient, rest angle from sys.pos), bp_hinges, full 3D linear modes for curved nets, axial dashpots so bp_decay is exact for all modes, bp_decay takes and returns sys; dome exampleJeremy Magland 12% Each bead gets friction 2*sigma0*m; each spring a dashpot in parallel
13% with isotropic part 2*sigma1*g and axial part 2*sigma1*(keff - g), where
14% g is the spring's tension divided by its length at rest and keff its
15% stiffness there (a spring's stiffness at rest is (keff - g) d d' + g I);
16% each bending triplet the damping 2*sigma1*kb, and each hinge 2*sigma1*kh.
17% The damping matrix at rest is then 2*sigma0*M + 2*sigma1*K for all the
18% motion, so the modes stay uncoupled and the law holds exactly at small
19% amplitude, for flat and curved nets alike.
0330c41Damping by decay times: bp_decay helper, per-mode decay-time plot, examples convertedJeremy Magland 20%
3bd39d8Dome: hinge elements (sys.hinges, Bridson gradient, rest angle from sys.pos), bp_hinges, full 3D linear modes for curved nets, axial dashpots so bp_decay is exact for all modes, bp_decay takes and returns sys; dome exampleJeremy Magland 21% The law [sigma0 sigma1] is stored in sys.decayLaw (not used by the solver).
0330c41Damping by decay times: bp_decay helper, per-mode decay-time plot, examples convertedJeremy Magland 22s = log(1000) ./ T60(:, 2); % amplitude decay rates (1/s)
23w2 = (2 * pi * T60(:, 1)).^2;
24if size(T60, 1) == 1
25 sigma0 = s(1);
26 sigma1 = 0;
27elseif size(T60, 1) == 2
28 sigma1 = (s(2) - s(1)) / (w2(2) - w2(1));
29 sigma0 = s(1) - sigma1 * w2(1);
30else
31 error('bp_decay: T60 must be [f1 T1] or [f1 T1; f2 T2]');
32end
33if sigma1 < 0
34 error('bp_decay: the higher frequency must not ring longer than the lower one');
35end
36if sigma0 < 0
37 error('bp_decay: decay at the higher frequency is too fast for sigma0 + sigma1*w^2; raise its T60 or lower the other');
38end
3bd39d8Dome: hinge elements (sys.hinges, Bridson gradient, rest angle from sys.pos), bp_hinges, full 3D linear modes for curved nets, axial dashpots so bp_decay is exact for all modes, bp_decay takes and returns sys; dome exampleJeremy Magland 39pos = sys.pos;
40n = size(pos, 1);
41sys.friction = 2 * sigma0 * sys.mass(:) .* ones(n, 1);
42if isfield(sys, 'springs') && ~isempty(sys.springs)
43 S = sys.springs;
44 i = S(:, 1);
45 j = S(:, 2);
46 L = vecnorm(pos(i, :) - pos(j, :), 2, 2);
47 e = L - S(:, 4);
48 f = S(:, 3) .* e;
49 keff = S(:, 3);
50 if size(S, 2) > 4
51 f = f + S(:, 5) .* e.^3;
52 keff = keff + 3 * S(:, 5) .* e.^2;
53 end
54 g = f ./ L;
55 sys.dashpots = [i, j, 2 * sigma1 * g, 2 * sigma1 * (keff - g)];
74b1dcdFree edges: bending triplets (sys.bends) with damping, lattice triplets from bp_hexdisk/bp_chain, bp_decay for bending, bp_anchor soft supports, zero-mode warning; plate and bar examplesJeremy Magland 56else
3bd39d8Dome: hinge elements (sys.hinges, Bridson gradient, rest angle from sys.pos), bp_hinges, full 3D linear modes for curved nets, axial dashpots so bp_decay is exact for all modes, bp_decay takes and returns sys; dome exampleJeremy Magland 57 sys.dashpots = zeros(0, 4);
58end
59if isfield(sys, 'bends') && ~isempty(sys.bends)
60 sys.bends = [sys.bends(:, 1:4), 2 * sigma1 * sys.bends(:, 4)];
61end
62if isfield(sys, 'hinges') && ~isempty(sys.hinges)
63 sys.hinges = [sys.hinges(:, 1:5), 2 * sigma1 * sys.hinges(:, 5)];
74b1dcdFree edges: bending triplets (sys.bends) with damping, lattice triplets from bp_hexdisk/bp_chain, bp_decay for bending, bp_anchor soft supports, zero-mode warning; plate and bar examplesJeremy Magland 64end