Collision modelling represents an active field of research in musical acoustics. Common examples of collisions include the hammer-string interaction in the piano, the interaction of strings with fretboards and fingers, the membrane-wire interaction in the snare drum, reed-beating effects in wind instruments, and others. At the modelling level, many current approaches make use of conservative potentials in the form of power-laws, and discretisations proposed for such models rely in all cases on iterative root-finding routines. Here, a method based on energy quadratisation of the nonlinear collision potential is proposed. It is shown that there exists a suitable discretisation of such a model that may be resolved in a single iteration, while guaranteeing stability via energy conservation. Applications to the case of lumped as well as fully distributed systems will be given, using both finite-difference and modal methods.

Collisions play a key role in the operation of many musical instruments. The most obvious examples are the hammer-string1 and mallet-membane interactions,2 but there are many others: fret/string interactions in instruments such as the guitar;3,4 reed-beating effects in wind instruments;5,6 the sitar7 and tanpura;8 and wire/membrane collisions in the snare drum.9 Some collisions may be modelled as lumped, and considered to act only over a very small portion of a system (e.g., a piano hammer). Others are distributed in spatial extent such as the wire-membrane interaction. Furthermore, some of these collisions involve obstacles that are conveniently modelled as rigid (e.g., a fretboard), while in others, the effects of deformation are critical. The collision force is strongly nonlinear and cannot be approximated through linearisation.

At the numerical level, various approaches are available. Unilaterally-constrained dynamics may be used to model the collision of a vibrating object, such as a string, against a rigid, immovable obstacle;7,10,11 non-smooth dynamical representations have also been employed for the same purpose.12,13 In contrast, when the colliding objects are deformable, a common approach is to model the interaction via a suitable potential function: under perfectly elastic conditions, the collision energy is exchanged while remaining conserved overall.14 The potential function depends on the amount of deformation of the colliding objects, often in power-law fashion.15 Such models may then be extended to include losses that may take place during the collision.16 The possibility of modelling a collision via energy methods is particularly attractive from a numerical design perspective since this passivity property can be used as a condition on stability.17 Thus, such potential-based methods have been extended to cases involving rigid obstacles, though the interpenetration is now interpreted as a penalty.8,17 At the numerical level, energy conservation may be achieved via schemes involving the solution of a system of nonlinear equations. Though the existence and uniqueness of the underlying solutions have been proven,8,17 the resulting numerical schemes can only be approached via iterative root-finding routines such as e.g., Newton-Raphson. Furthermore, for collisions taking place in systems of finite spatial extent, approaches based on modal decompositions are impaired due to the implicit character of the update equations,18 and efficient solutions are only available in the case of linear barrier force.19 

In this work, a method is presented such that the resulting numerical schemes maintain a notion of passivity, via energy conservation, while avoiding iterative methods; there is at most the solution of one linear system per update. On top of the reduction in computational cost, in this case, existence and uniqueness of solutions follow in an obvious manner. Such schemes are based on the quadratisation of the collision potential energy, through the introduction of an auxiliary function treated as a new additional state variable. Quadratisation strategies allowing for explicit numerical updates appeared first in the context of Port-Hamiltonian systems,20,21 for invertible potentials. The introduction of an additional state variable was proposed within the context of the Invariant Energy Quadratisation22,23 method. In this work, the case of a non-invertible potential is considered. For distributed collisions, the proposed schemes generalise naturally to the case of modal-based discretisations, yielding an efficient update.

The article is organised as follows: Sec. II introduces the proposed schemes for the simple case of the mass-barrier collision. In this section, the proposed scheme is compared against benchmark schemes borrowed from the literature.8,17 Section III presents the case of the hammer-string interaction using a finite difference discretisation on the spatial operators. Section IV extends the previous example to a fully distributed barrier and by making use of both finite difference and modal schemes. Finally, Secs. V and VI present applications of the proposed schemes for the cases of the snare drum and the tromba marina.

In this section, the case of a point mass colliding against a rigid barrier is presented. This section also introduces the temporal difference operators that will be used throughout the text.

The mass-barrier collision, though not a musical system per se, serves as an introductory test case, from which the properties of the numerical schemes and their main operational principles can be understood. The motion is expressed through an ordinary differential equation (ODE) of the following form:

(1)

Here, M represents the mass of the particle, K is the stiffness coefficient of the linear restoring force, and u=u(t) is the displacement measured from the rest position, and dependent on time t0. η represents the distance between the mass and a barrier, located at z. Time differentiation is here indicated with dots, and the gradient is taken with respect to η, as suggested by the gradient subscript. Here, linear stiffness has been separated out from the general potential, as it may often be advantageous to approach discretisation through such a splitting. Equation (1) must be complemented by two initial conditions u(0)=u0,u̇(0)=v0. From these, one has η0=u0z. Finally, ϕ=ϕ(η) is a nonlinear potential, that for collisions takes the form

(2)

where Kη is a stiffness parameter, and where α1.

Using the chain rule, when the barrier height z is constant, and assuming η0,u̇0, one may write Eq. (1) as

(3)

Upon multiplication of Eq. (3) by u̇, one arrives at

(4)

and thus energy remains constant,

Furthermore, boundedness of the solution follows, since ϕ(u)0. Under this condition, from Eq. (4),

(5)

and thus u and u̇ are bounded in terms of the initial energy H0. As will be seen shortly, an iterative, conservative scheme may be derived as a discretisation of Eq. (3).

Following Ref. 8, the same motion may be described using Hamilton's equations,

(6)

The system in Eq. (6) conserves the energy H=T+V. Here, T=p2/2M is the kinetic energy, V=Ku2/2+ϕ(u) is the potential energy, and p is the momentum of the particle. This system may also be discretised directly, as will be seen shortly.

Non-iterative time discretisations follow from a change of variables applied to the potential function in Eq. (1). Consider a quadratisation of the potential function ϕ, as

(7)

One may substitute such form in the expression for the energy [Eq. (4)], obtaining

(8)

Notice that, under the condition of non-negativity of ϕ, one may always perform such a substitution. This form of the energy includes quadratic terms only. Performing time differentiation of Eq. (8), one obtains the following equation of motion:

(9)

Formally, Eqs. (1) and (9) are entirely equivalent. They yield the same solution u(t), as well as the same bounds on the growth of such solution and its time derivative. Notice that bounds of Eq. (5) hold in this case too. Looking towards discrete time implementation (see Sec. II C 3), it is useful to rewrite Eq. (9) as

(10)

Quadratisation strategies appeared in various other contexts, such as e.g., Port-Hamiltonian systems,20,21 and fluid dynamics,23 and they form the core of the Invariant Energy Quadratisation method,22,23 which is similar to the method proposed here, in that an extra auxiliary state variable is defined.

The finite difference method is employed for the simulation of the nonlinear equations. Thus, the continuous function u(t) is approximated at the time nk by the time series un, where n0, and where k is the time step (and 1/k is the sample rate.) The basic operators in discrete time are the identity and shift operators, defined as

(11)

From these, one may define the time difference operators, all approximating the first time derivative, as

(12a)
(12b)
(12c)

An approximation to the second time derivative is constructed from the above as

(13)

Averaging operators are also used throughout the text and are

(14a)
(14b)

Analogous definitions of the difference and averaging operators hold for time series defined at interleaved time instants n1/2. Finally, an identity used throughout the text is given here as

(15)

The finite difference formalism introduced in the previous section is now used to construct three conservative schemes. The first scheme is taken from Chatziioannou and van Walstijn.8 This is a method making use of a discretisation of Hamilton's equations given in first order form, and will be labelled IT-1. The second scheme is taken from Bilbao et al.,17 discretising directly Eq. (1), and labelled IT-2. Finally, the proposed scheme follows from a discretisation of the quadratised Eq. (8), and will be labelled N-IT.

1. Iterative scheme IT-1

Following Chatziioannou and van Walstijn,8 one may discretise Hamilton's Eq. (6) as

(16)
(16a)
(16b)
Here, un1/2 and pn1/2 are known from the previous time step. Using then Eq. (15) on the right-hand side of Eq. (16a), and using Eq. (16b), one may arrive at a nonlinear algebraic equation to be solved at each time step, in the form F(s)=0, where s=un+1/2un1/2 and where

(17)

a=un1/2,b=kpn1/2/M,c=k2/2M. Energy conservation arises naturally from Eq. (16), as

where

(18)

Notice that this discrete energy is non-negative by definition, reflecting the implicit nature of the discretisation of the linear part of Eq. (16). Existence and uniqueness of the solution may be shown for Eq. (16), and the resulting update Eq. (17) may be approached via a suitable root-finding algorithm, such as Newton-Raphson.8 

2. Iterative scheme IT-2

A suitable discretisation of Eq. (3) is given in Bilbao et al.17 as

(19)

where

At each time step, the update may be written as a nonlinear function in the unknown s=un+1un1,

(20)

where here a=un1,b=2M(δtun)/kKun,c=k2/M. One then solves G(s)=0 using a nonlinear root finder such as e.g., Newton-Raphson.

This scheme conserves a discrete energy. To see this, it is enough to multiply Eq. (19) by δt·u, to get

where the discrete energy has the form

(21)

The discrete energy is not necessarily non-negative. One may easily show that a condition for non-negativity of the total energy is obtained for24 

(22)

This serves as a necessary and sufficient condition for stability for the scheme in Eq. (19) and is independent of the state u and of the particular form of the nonlinear function ϕ, provided it is non-negative. Under such a condition, a discrete counterpart to the bounds [Eq. (5)] may be derived as

(23)

Existence and uniqueness may be proven for this scheme as well.17 

3. Non-iterative scheme N-IT

Turning now to Eq. (9), and the form given in Eq. (10), a particular discretisation is given by the following system:

(24)
(24a)
(24b)
A distinctive feature of this scheme is that now ψ is treated as an independent time series. In practice, ψ is calculated at interleaved time instants, i.e., ψ=ψn1/2 and is not an implicit function of un. Both u and ψ must be updated at each time step.

With this in mind, the scheme in Eq. (24) has a completely explicit form. Furthermore, inserting Eq. (24b) into Eq. (24a) and multiplying by δt·u leads to a discrete energy balance,

The discrete Hamiltonian has the form

(25)

It is immediate to verify that the nonlinear potential energy is non-negative, and thus the stability condition, Eq. (22), and bounds, Eq. (23), hold in this case too.

One important aspect pertains to the choice of the explicit gradient gn. Previous preliminary works employed the following form:

However, it was observed that some spurious oscillations are obtained under such choice.27–29 A better approximation, employed in the remainder of this work, is given by

where κ = 1 if ψn1/20, and κ=1 otherwise. Once gn is computed, one must also check that gnηn1<4ψn1/2. If this condition is violated, then gn is set to zero. This procedure ensures that the collision force is directed outwardly. Furthermore, η=uz is the update of the system in the absence of the collision potential, i.e.,

The particular form for Eq. (27b) can be derived by considering an implicit realisation for g, as

In the event of no collision at n+1/2, then gimp reduces to Eq. (27b), since ψn+1/2=0, and since un+1 would be obtained as the solution of the system for zero collision force, as per Eq. (3). Notice as well that g in Eq. (27) is given entirely from previous values of the time series u, ψ, making the scheme fully explicit.

The existence and uniqueness of the numerical solution, regardless of the particular form of gn, follow immediately, as the system is solved by simple division.

As a first experiment, consider Fig. 1. In the figure, the three schemes are compared against each other for a barrier of increasing stiffness. It can be appreciated that the schemes return consistent solutions: as the barrier stiffness is increased, the interpenetration becomes smaller. The numerical energy is conserved to the order of machine accuracy for all the three schemes. Notice as well that, as the stiffness of the barrier is increased, more iterations of the Newton-Rapshon algorithm are needed for the iterative schemes, while the computational cost of N-IT remains fixed. This is an important aspect in view of any real-time implementation requiring a precise allocation of computing resources. In fact, while it is possible to estimate the upper bound on the number of iterations required for Newton-Raphson,25 the iterative routine may be affected by poor convergence, or instability in certain cases,25,26 if, for instance, the initial guess is not carefully estimated, or the if value of the barrier stiffness is too large.

FIG. 1.

Mass-barrier collision. In this experiment, M = 10 g, K=3.95×103 N/m (giving a linear eigenfrequency of 100 Hz). The mass is initialised with amplitude u0=0.01 m and velocity v0=1.5 m/s. The nonlinear exponent is α=1.3, and the barrier stiffness for each column in the figure is given on top. The barrier height is z = 0. The sample rate is fs=44.1 kHz. For all figures, the solid black line corresponds to N-IT, the dashed gray line to the IT-2, and the dashed black line to IT-1. The four rows, from top to bottom, give the displacement, the energy error ϵ=hn1/2/h1/21, the number of iterations for the Newton-Rapshon, for the two iterative schemes, with a tolerance threshold τ=1014, and the collision force for N-IT, computed as gμt+ψ. matlab sample code is available at the companion webpage (Ref. 32).

FIG. 1.

Mass-barrier collision. In this experiment, M = 10 g, K=3.95×103 N/m (giving a linear eigenfrequency of 100 Hz). The mass is initialised with amplitude u0=0.01 m and velocity v0=1.5 m/s. The nonlinear exponent is α=1.3, and the barrier stiffness for each column in the figure is given on top. The barrier height is z = 0. The sample rate is fs=44.1 kHz. For all figures, the solid black line corresponds to N-IT, the dashed gray line to the IT-2, and the dashed black line to IT-1. The four rows, from top to bottom, give the displacement, the energy error ϵ=hn1/2/h1/21, the number of iterations for the Newton-Rapshon, for the two iterative schemes, with a tolerance threshold τ=1014, and the collision force for N-IT, computed as gμt+ψ. matlab sample code is available at the companion webpage (Ref. 32).

Close modal

The experiment in Fig. 2 reports the convergence of the numerical schemes, computed against a reference analytic solution for a barrier with linear restoring force. Second-order accuracy is maintaned for lower stiffness values. However, for values of Kη such that Kη/Mk>1, the schemes become first-order accurate, as proven by Taylor-expanding the schemes about tn = kn.

FIG. 2.

Convergence plots. The error for the three schemes is computed as En=u(tn)un, where u(tn) is the analytic solution at time tn=kn, assumed to be after collision. For the case of a free particle colliding against a linear barrier (α = 1, K = 0, z = 0), u(tn)=(tn+u0/v0πM/Kη)v0, where the mass is assumed to collide from below, and where v0>0,u0<0. For all panels figures, N-IT is solid black line, IT-1 is dashed black, and IT-2 is dashed gray. Dashed lines with slopes 1 and 2 are also given. The mass is M = 10 g. The barrier stiffness Kη is given in each panel. The numerical initial conditions are given as u0=v0k[floor(u0/(v0k)+0.5],u1=v0k+u0.

FIG. 2.

Convergence plots. The error for the three schemes is computed as En=u(tn)un, where u(tn) is the analytic solution at time tn=kn, assumed to be after collision. For the case of a free particle colliding against a linear barrier (α = 1, K = 0, z = 0), u(tn)=(tn+u0/v0πM/Kη)v0, where the mass is assumed to collide from below, and where v0>0,u0<0. For all panels figures, N-IT is solid black line, IT-1 is dashed black, and IT-2 is dashed gray. Dashed lines with slopes 1 and 2 are also given. The mass is M = 10 g. The barrier stiffness Kη is given in each panel. The numerical initial conditions are given as u0=v0k[floor(u0/(v0k)+0.5],u1=v0k+u0.

Close modal

As a first example of a collision typical of musical instruments, the hammer-string collision is investigated here. The interpenetration in this case may be interpreted as the compression experienced by the hammer felt during contact with the string. Many works have employed the power law [Eq. (2)] as a model for this case, though not all include a conservative discretisation of the resulting dynamics.1,30,31

In a basic configuration, the system may be described by the following coupled differential equations:

(28)
(28a)
(28b)
Here, u(x, t) is the displacement of the string, U is the displacement of the hammer, and η(t)=U(t)u(xc,t) is the hammer felt compression. Partial derivatives with respect to t and x are written as t and x, respectively. ρ is the string's linear density, T0 the applied tension, and M is the mass of the hammer. xc is the hammer's strike location along the string, and the spatial extent of the hammer contact is modelled by a simple Dirac delta distribution δ(xxc). The function ϕ is the same as Eq. (2).

The string is assumed initially at rest, and is fixed at the two ends, i.e., u(0,t)=u(L,t)=0t, where it was assumed that x[0,L], with L being the string's length. The hammer has initial displacement U0 and initial velocity V0.

The system in Eq. (28) is probably insufficient as a musical model as such. It is lacking several important features such as stiffness33 and losses,34 and perhaps a nonlinearity inherent to the string's geometrical stretching (see, e.g., Bilbao,35 as well as Morse and Ingard,36 Chap. 14), though all such features may be added into the model without substantial changes to the template schemes presented here. For the purpose of illustration, they are therefore neglected at this stage, and one may refer to the case study on the tromba marina given in Sec. VI for a working example of a complete system.

The system in Eq. (28) is conservative, with energy given by

(29)

where the L2 norm notation is used, see, e.g., Ref. 17.

Quadratisation of the energy may be performed in the same fashion as Eq. (8), yielding

(30)

where again ψ2=2ϕ. The associated equations of motion read

(31)
(31a)
(31b)

Discrete realisations of both Eqs. (28) and (31) are given here in terms of appropriate finite difference schemes. The temporal finite difference operators and notation are as given in Sec. II B. Here, because of the distributed character of the string, it is convenient to introduce a matrix-vector formalism for the spatial difference operators. Thus, the string is divided into N subintervals by means of N + 1 grid points including the end points. Each subinterval is of length h, the grid spacing. The displacement u(x, t) is approximated by the grid function umn, where n is the time step, and m is the grid index.

In a vector notation, one may then denote the grid function as unN1, where the dimensionality reflects the fact that, under fixed end conditions, the end points need not be stored or updated. Spatial difference operators may then be realised as matrices. The first difference operator is given as

(32)

Thus, D is a N×(N1) rectangular matrix. From this, the second difference operator is constructed simply as

(33)

yielding a square (N1)×(N1) matrix.

The impact spatial distribution may as well be given as a vector. Hence δ(xxc)rN1. Denoting mh=floor(xc/h),ν=xc/hmh, one may set rmh=(1ν)/h,rmh+1=ν/h, thus effectively employing linear interpolation.24 

Two finite difference schemes are given here for the solutions of Eqs. (28) and (31).

1. Iterative scheme IT-2

A discretisation of Eq. (28) follows immediately from this formalism as17 

(34)
(34a)
(34b)
(34c)
Here, the discrete energy is

which is clearly a discrete counterpart of Eq. (29). While the nonlinear potential energy is non-negative, the linear part of the discrete energy is non-negative only under the following Courant–Friedrichs–Lewy (CFL) condition:24,37

(35)

Non-negativity of the energy overall allows to derive a bound on the growth of the norms of the grid functions, thus effectively ensuring stability.

In order to solve Eq. (34), one first computes the update of the interpenetration η, by multiplying Eq. (34a) by hr and subtracting Eq. (34b), thus effectively projecting the dynamics onto the collision point. This results in an implicit scalar equation of the same form as Eq. (20), i.e., G(s)=0, where here s=ηn+1ηn1,a=ηn1,b=2ηn2ηn1T0k2h/ρrD(2)un,c=k2h/ρrr+k2/M. Existence and uniqueness of this nonlinear algebraic equation are proven using the same arguments as before.8,17 Once the interpenetration is known, one may update Eqs. (34a) and (34b) explicitly.

2. Non-iterative scheme N-IT

The system in Eq. (31) may be approximated by the following scheme:

(36)
(36a)
(36b)
(36c)
(36d)
Here, at each time step, one must solve for the string displacement u, the hammer displacement U, as well as the auxiliary function ψ. The explicit gradient gn can be taken to have the same form as Eq. (27). This scheme has an associated discrete energy of the form

thus effectively discretising Eq. (30). The same arguments on stability as IT-2 apply here, i.e., the nonlinear energy is clearly non-negative, and for stability, the CFL condition in Eq. (35) is a necessary and sufficient condition.

A solution to Eq. (36) may be found by using the identity from Eq. (15) in both Eqs. (36a) and (36b), and then expressing the time difference of ψ using Eq. (36c), so as to effectively reduce the two equations to a linear system. The system is written as

(37)

where b1=2unun1+(T0k2/ρ)D(2)un,b2=2UnUn1, and a=(g2/4)ηn1+gψn1/2. This linear system may be solved block-wise. Notice in particular that the matrix yields itself to a fast inversion since it is a rank-1 perturbation of the identity matrix.38 However, efficient inversion techniques of the system in Eq. (37) will not be explored in this article.

Once Eq. (37) is solved, one may compute ηn+1via Eq. (36d) and then update ψ via Eq. (36c).

As a first illustrative example, consider Fig. 3: here, the snapshots of IT-2 and N-IT are plotted. The hammer here has a high enough stiffness to serve as a test case.

FIG. 3.

(Color online) Snapshots of the hammer-string collision, at times indicated. In this experiment, M = 10 g, α=1.3,Kη=1012. The hammer is initialised with initial displacement U0=1 mm and velocity V0=0.5 m/s. The string has ρ=6.3 g/m, tension T0=100 N, length L = 0.7 m. In the plots, the solution of the iterative scheme IT-2 is shifted up by 1 mm, for clarity. matlab sample code is available at the companion webpage (Ref. 32).

FIG. 3.

(Color online) Snapshots of the hammer-string collision, at times indicated. In this experiment, M = 10 g, α=1.3,Kη=1012. The hammer is initialised with initial displacement U0=1 mm and velocity V0=0.5 m/s. The string has ρ=6.3 g/m, tension T0=100 N, length L = 0.7 m. In the plots, the solution of the iterative scheme IT-2 is shifted up by 1 mm, for clarity. matlab sample code is available at the companion webpage (Ref. 32).

Close modal

The same dynamics may be represented in terms of time series at one output point, rather than as snaphsots. This is done in Fig. 4. It is seen that, for lower values of the hammer stiffness, the solutions of the two schemes are perfectly superimposed. As the stiffness is increased, some small differences are noticed, though the two schemes converge to the same solution in the limit of high sample rate. Energy is again conserved to the order of machine accuracy during collision.

FIG. 4.

Hammer-String collision: String's output displacement. Output is recorded as μtumon, where mo is the output grid point. For all panels, the solid black line is the output of N-IT; the gray dashed line is the output of IT-2. Output is recorded on the string at xo=0.68L. The hammer has mass M = 10 g, and α=1.3. (a): Kη=107, fs = 44 100 Hz. (b): Kη=1010, fs = 44 100 Hz. (c): Kη=1012, fs = 44 100 Hz. (d): Kη=1012,fs=5×44100 Hz. (e) Energy error for panel (a), where ϵ=hn1/2/h1/21.

FIG. 4.

Hammer-String collision: String's output displacement. Output is recorded as μtumon, where mo is the output grid point. For all panels, the solid black line is the output of N-IT; the gray dashed line is the output of IT-2. Output is recorded on the string at xo=0.68L. The hammer has mass M = 10 g, and α=1.3. (a): Kη=107, fs = 44 100 Hz. (b): Kη=1010, fs = 44 100 Hz. (c): Kη=1012, fs = 44 100 Hz. (d): Kη=1012,fs=5×44100 Hz. (e) Energy error for panel (a), where ϵ=hn1/2/h1/21.

Close modal

When collisions are distributed (i.e., taking place across a spatially extended portion of a system), it may be convenient to think of a density collision potential. Here, collisions of the string against an immovable, distributed obstacle are considered. One then has z=z(x), and η(x,t)=z(x)u(x,t). The equation of motion for the string may then be written as

(38)

where now ϕ has dimension of J/m (i.e., it is a potential density.) The associated energy now reads

(39)

which is a distributed generalisation of Eq. (29). This form of the energy lends itself naturally to quadratisation. Using again ψ2=2ϕ, one gets

(40)

with an associated equation of motion,

(41)

In this section, two applications of the non-iterative scheme are presented: one making use of a time-space finite difference scheme, and one making use of a modal projection for the spatial part. Iterative conservative finite difference schemes for the string in contact with a distributed barrier have been employed,17 based on the model Eq. (38), and extended to the case of frets in a full model of guitar strings.4 Modal schemes in the context of collision dynamics have been successfully presented in other works: an implicit modal update was used in Ref. 13, where the collision force is resolved at each time step by employing a spatial grid, thus effectively employing a finite difference formulation; the special case α = 1 was given in Ref. 19. Here, it is shown that N-IT yields an efficient modal resolution that may be applied directly for all values of the barrier exponent α.

1. Non-iterative finite difference scheme N-IT(FD)

This scheme is a generalisation of Eq. (36). In order to account for a potential density, one may think of the barrier as being composed of Nb discrete points. For a continuous barrier (such as the backboard of a fretless instrument), one may assume that the barrier points are located at the string's grid points, in which case Nb=N1. For other kinds of barrier, one may need to specify points in between the string's grid points (e.g., for fretted instruments). In either case, one may approximate ψ(x,t) by a vector ψn1/2Nb. The density distribution can be thought of as an (N1)×Nb sparse matrix R. In practice,

(42)

where riN1 is the interpolated sparse density vector of the ith barrier point. It is convenient, formally, to introduce a diagonal matrix containing all the explicit gradients gin,i[1,Nb]. Hence, G=diag(gin). Then, define T=RG.

With this notation, a finite difference scheme discretising Eq. (41) is

(43a)
(43b)
(43c)

The discrete energy in this case is

which clearly discretises Eq. (40).

Proceeding in a similar manner as before, one may express this system as

(44)

where a=(h/4)Tun1+ψn1/2,b=2unun1+T0k2/ρD(2)un. The update matrix in Eq. (44) is a rank-Nb perturbation of the identity matrix, though it is typically a perturbation of much smaller rank, equal to the number of points colliding at the time step n for which gi0 (in general, just a fraction of the total points.) Efficient inversion strategies such as the Woodbury identity39 may be employed here. Note that, when the barrier points are collocated at the grid locations, the update matrix is in fact diagonal, and the scheme is fully explicit. Once un+1 is known, one may update ψ using Eq. (43b). Note that, when the barrier points are collocated at the finite difference grid locations, the update matrix is in fact diagonal, and the scheme is fully explicit.

2. Non-iterative modal scheme N-IT(Modal)

A suitable modal expansion for the string's displacement under fixed conditions is given by

(45)

where m[1,Nm] and Nm is the total number of modes. In order to account for an appropriate density of barrier points, the vector d contains the spatial distributions, such as, e.g., delta functions. Thus,

(46)

where Nb as before is the total number of barrier points. Thus, d is of length Nb. Then, modal projection is performed by means of the L2 inner product denoted here for two square integrable functions f, g as

(47)

Thus, the projected modal equations for Eq. (41) become

Owing to modal orthogonality, the matrix X,X is the identity matrix times the norm of the modes, which in this case is the same for all the modes, i.e., ||Xm||2=L/2m. Similarly, X,(X)=L/2Λ2, where Λ is a diagonal matrix with diagonal elements Λm,m=mπ/L. The matrix X,d=R is a Nm×Nb a dense matrix containing the projections of all the modes at each barrier point, columnwise. As before, define T=RG. Using a finite difference approximation on the time operators, one gets the following modal system:

(48a)
(48b)
(48c)

with modal discrete energy given by

Inspection of the energy yields a stability condition, which in this case reads

(49)

The modal update is

(50)

where here a=(1/4)Tqn1+ψn1/2,b=2qnqn1(k2T0/ρ)Λ2qn. Hence, the modal update has the same form as Eq. (44), except now the matrix T is dense.

Snapshots of the numerical outcome of the schemes are presented in Figs. 5 and 6. In both cases, the modal scheme and the finite difference scheme return consistent solutions, even after a large number of collisions. Notice that, although the barrier parameters are selected so to simulate a hard collision, the schemes are perfectly stable and compute the solution solving one single linear system per update.

FIG. 5.

Snapshots of string-backboard collision. The string parameters are the same as Fig. 3. The barrier is described by z(x)=0.02x20.001x0.0001, and has Kη\neth=1012,α=1.2. Both N-IT(FD) and N-IT(Modal) are initialised in the first mode of vibration, for zero initial velocity, with peak modal amplitude 3 mm. N-IT(FD) is solid black line, N-IT(Modal) is gray dashed line. Output is averaged as μtun.

FIG. 5.

Snapshots of string-backboard collision. The string parameters are the same as Fig. 3. The barrier is described by z(x)=0.02x20.001x0.0001, and has Kη\neth=1012,α=1.2. Both N-IT(FD) and N-IT(Modal) are initialised in the first mode of vibration, for zero initial velocity, with peak modal amplitude 3 mm. N-IT(FD) is solid black line, N-IT(Modal) is gray dashed line. Output is averaged as μtun.

Close modal
FIG. 6.

Snapshots of string-frets collision. The parameters for the string and barrier are the same as Fig. 5, but the barrier is now a fretted backboard with twelve frets spaced by one semitone each.

FIG. 6.

Snapshots of string-frets collision. The parameters for the string and barrier are the same as Fig. 5, but the barrier is now a fretted backboard with twelve frets spaced by one semitone each.

Close modal

In Fig. 5, a bent obstacle similar to the bridge of instruments such as the tanpura is obtained as a quadratic function of x. In Fig. 6, frets are placed at intermediate string grid points using linear interpolation.

Power-law contact forces may be applied to the case of collisions between moving distributed objects, see, e.g., Ref. 40. An interesting case is represented by the wire-membrane interaction in the snare drum. In this instrument, a set of wires collide against the snare membrane. The system is activated after the batter membrane, at the opposite end of the drum, is set into motion by the player. This produces a vibration of the air cavity which in turn sets the snare membrane into vibration. Computationally, this is a complex system since various subsystems of different wave speeds are coupled in a nonlinear manner. A full model of this system was first offered by Bilbao,9 where the wire-membrane collisions are modelled in a semi-conservative manner. Bilbao et al.17 subsequently used the iterative model to obtain conservation of the discrete energy to machine accuracy. Here, as a test case, only the wire-membrane interaction is shown, using a non-iterative finite difference scheme.

In this basic configuration, the wire-membrane system may be described by two coupled partial differential equations,

(51)
(51a)
(51b)
(51c)
Here, w=w(x,y,t) is the displacement of the membrane, u=u(χ,t) is the displacement of the wire, and ξ(x,y) is the operator projecting the linear domain of the wire onto the membrane. The symbol Δ indicates the Laplacian. The inner product definition is here extended to the two-dimensional domain occupied by the membrane. The index m here stands for membrane, denoting the surface density and the tension per unit length in Eq. (51a). The index s is used for string to denote the linear density and the tension in Eq. (51b).

Implementation details for the system in Eq. (51) are not given here. In terms of the membrane, one may use a 2D cartesian grid over which the differential operators are discretised. This leads to a staircase representation of the circular boundary, but it has overall numerous beneficial effects in terms of numerical dispersion and ease of implementation compared to, e.g., a polar difference grid, see, e.g., Bilbao24 (Chap. 11). The collision force may be resolved once a suitable interpolation is implemented, to switch between the membrane and string grids. This can be done with a suitable 2D linear interpolator, as the one given by Bilbao24 (Chap. 10). A non-iterative scheme for the collision force can then be implemented easily from the templates given above.

As an illustration, consider Fig. 7. Here, the wire is initialised in its first mode of vibration and released. The collision with the membrane induces a set of waves propagating in the membrane. The system can be updated at each time step by solving one single sparse linear system, as a perturbation of rank lower than the wire's grid points.

FIG. 7.

(Color online) Snapshots of the wire-membrane collision. The wire has ρs=1 g/m, tension Ts = 10 N, length L = 0.2 m. The wire ends are located at (x0,y0)=[0.3R,L/2],(xL,yL)=[0.3R,L/2] with respect to the centre of the membrane. The membrane has a radius R = 0.15 m, a tension Tm = 2000 N/m, and a density ρm=0.2 kg/m2. The wire is hanging from a rest position 0.4 mm above the membrane. The wire is initialised in its first mode with a peak amplitude of 1 mm with respect to its rest position. Animations are available on the companion webpage (Ref. 32).

FIG. 7.

(Color online) Snapshots of the wire-membrane collision. The wire has ρs=1 g/m, tension Ts = 10 N, length L = 0.2 m. The wire ends are located at (x0,y0)=[0.3R,L/2],(xL,yL)=[0.3R,L/2] with respect to the centre of the membrane. The membrane has a radius R = 0.15 m, a tension Tm = 2000 N/m, and a density ρm=0.2 kg/m2. The wire is hanging from a rest position 0.4 mm above the membrane. The wire is initialised in its first mode with a peak amplitude of 1 mm with respect to its rest position. Animations are available on the companion webpage (Ref. 32).

Close modal

The Tromba Marina is a medieval bowed monochord instrument that produces a trumpet-like sound when played (hence the name tromba, meaning trumpet in Italian) (see Fig. 8). This characteristic sound arises from the fact that the string rests on a loose shoe-shaped bridge that collides with the instrument body as the string vibrates (see Fig. 9). This makes it a suitable test case for the method proposed here.

FIG. 8.

(Color online) The tromba marina owned by Nationalmuseet in Copenhagen, Denmark.

FIG. 8.

(Color online) The tromba marina owned by Nationalmuseet in Copenhagen, Denmark.

Close modal
FIG. 9.

(Color online) The tromba marina's shoe-shaped bridge. The right side is pressed against the body while the left side is free to rattle.

FIG. 9.

(Color online) The tromba marina's shoe-shaped bridge. The right side is pressed against the body while the left side is free to rattle.

Close modal

A working simulation of this instrument where the interactions between different components were based on Eq. (3) was previously published by the same authors.29 Below, the details of the simulation using Eq. (27) are shown.

The complete instrument is subdivided into three components: the bowed string, the bridge, and the body. These are modelled as a stiff string, mass, and plate, respectively, all with loss terms.

Consider a damped stiff string of length L, described by displacement u=u(χ,t), with χ[0,L]. Assume a linear differential operator of the form

(52)

with linear density ρs, cross-sectional area A=πr2, radius r, tension Ts, Young's modulus E, area moment of inertia I=πr4/4, and loss coefficients σs1 and σs1. The equation of motion for the bowed string can then be given as

(53)

Here, Dirac delta function δ locates the bowing force at externally supplied bowing position χb=χb(t), and Fb=Fb(t) is the externally supplied bowing force. Finally, Φ is the dimensionless friction characteristic described in Ref. 29, with relative velocity (between the bow and the string at the bowing location) vrel=tu(χb,t)vb, and externally supplied bowing force vb=vb(t).

Similar to Eq. (1), the bridge is modelled as a simple point-like mass. Its displacement is w=w(t) and its differential operator is

(54)

with mass M, stiffness K, and loss coefficient σm.

The body is here modelled as a 2D plate whose flexural displacement is z=z(x,y,t), where (x,y)[0,Lx]×[0,Ly] and where Lx and Ly are the side lengths. Thus,

(55)

with surface density ρp, stiffness coefficient D, and loss coefficients σp0 and σp1.

1. Interactions

Interactions between the components are modelled using N-IT in two different configurations.

The interaction between the bridge and the body is modelled using Eq. (2), such that

(56)

is the difference between the state of the body at input location (xi, yi) and the bridge. The input spatial distribution is here assumed to be a 2D Dirac's delta δ(xxi,yyi).

The interaction between the string and the bridge is using a two-sided version of Eq. (2), allowing the collision potential to act as a connection, and is modelled as28 

(57)

depending on the difference between the state of the bridge and the string at contact location ζ(t)=w(t)u(χm,t). Here, Kζ is a constant, and β1.

The effects of the interactions can be added to the respective components to yield the complete system

(58)
(58a)
(58b)
(58c)

For most implementation details such as a discrete form of the equations in Eq. (58) and parameter values, one may refer to previous work.29 The improvements will be discussed here.

The main improvement is the use of Eq. (27) as a discrete form of Eq. (2). The change to this new form of gn, as noted above, solves the problem of spurious oscillations experienced at values of α and β larger than 1. These are now changed to be 1.3 and the interactions between components are now nonlinear.

The full system has been implemented in real time using C++ and the JUCE framework.41 A video showcasing the implementation can be found via.42 Snapshots of the bowed system can be seen in Fig. 10. As the string is bowed, it causes the bridge to collide with the body.

FIG. 10.

Snapshots of the bowed tromba marina simulation. A string of length L = 1.90 m is bowed at χb=1/3L m (denoted by the arrow in the leftmost snapshot) with vb=0.2 m/s and Fb = 1 N (high force for visualisation). A negative string displacement is visualised as going to the right. The terminations are shown in black at the string ends. The bridge is placed at χm=1.65 m and is shown as a white ball. The body has side lengths Lx=0.18 m and Ly=1.35 m and is shown as a rectangle where a darker colour indicates negative displacement. Note that the body is oversampled for visibility. The bridge-collision location (xi,yi)=(0.135,1.08) is shown as a white ×.

FIG. 10.

Snapshots of the bowed tromba marina simulation. A string of length L = 1.90 m is bowed at χb=1/3L m (denoted by the arrow in the leftmost snapshot) with vb=0.2 m/s and Fb = 1 N (high force for visualisation). A negative string displacement is visualised as going to the right. The terminations are shown in black at the string ends. The bridge is placed at χm=1.65 m and is shown as a white ball. The body has side lengths Lx=0.18 m and Ly=1.35 m and is shown as a rectangle where a darker colour indicates negative displacement. Note that the body is oversampled for visibility. The bridge-collision location (xi,yi)=(0.135,1.08) is shown as a white ×.

Close modal

In this work, the problem of simulating collisions commonly encountered in musical instruments was investigated. An energy framework was borrowed from previous works, so that the collisions are elastic, allowing for nonlinear energy exchanges between the colliding bodies, although an extension including nonlinear collision losses can be implemented easily from these templates. Thus, in the lossless case, motion preserves the energy. By quadratising the nonlinear collision potential, discrete-time difference schemes were obtained that may be resolved by a single matrix inverse at each time step, thus avoiding iterative root finding algorithms as presented in previous works. A number of comparative studies were offered, to assess the convergence and stability properties of the proposed schemes against the benchmark schemes of previous literature, displaying comparable behaviour. Pointwise as well as extended collisions can be simulated in the current framework, taking into account rigid obstacles as well as deformable, moving bodies. Spatial finite difference schemes as well as modal schemes are possible in this framework. Finally, the simulation of the tromba marina, including stiffness, losses, and a bowing mechanism, was offered, where the current collision framework serves as a model for the rattling bridge connecting the string to the plate.

The first author wishes to acknowledge the Royal Society of London and the Leverhulme Trust, who have supported this research with a Newton International Fellowship and an Early Career Fellowship. Dr. Vasileios Chatziioannou is kindly acknowledged for a fruitful debate around the properties of the numerical schemes presented here. The anonymous reviewers are also thanked for their suggestions.

1.
A.
Chaigne
and
A.
Askenfelt
, “
Numerical simulations of piano strings. I. A physical model for a struck string using finite difference methods
,”
J. Acoust. Soc. Am.
95
(
2
),
1112
1118
(
1994
).
2.
L.
Rhaouti
,
A.
Chaigne
, and
P.
Joly
, “
Time-domain modeling and numerical simulation of a kettledrum
,”
J. Acoust. Soc. Am.
105
(
6
),
3545
3562
(
1999
).
3.
G.
Evangelista
, “
Physical model of the string fret interaction
,” in
Proceedings of the International Conference on Digital Audio Effects
, Paris, France (September 19–23,
2011
), pp.
345
351
.
4.
S.
Bilbao
and
A.
Torin
, “
Numerical modeling and sound synthesis for articulated string/fretboard interactions
,”
J. Audio Eng. Soc.
63
(
5
),
336
347
(
2015
).
5.
V.
Chatziioannou
and
A.
Hofmann
, “
Physics-based analysis of articulatory player actions in single-reed woodwind instruments
,”
Acta Acust. united Ac.
101
,
292
299
(
2015
).
6.
F.
Avanzini
and
M.
van Walstijn
, “
Modeling the mechanical response of the reed-mouthpiece-lip system of a clarinet. Part I. A one-dimensional distributed model
,”
Acta Acust. united Ac
90
(
3
),
537
547
(
2004
).
7.
J. K. R.
Burridge
and
C.
Morshedi
, “
The sitar string, a vibrating string with a one-sided inelastic constraint
,”
SIAM J. Appl. Math.
42
(
6
),
1231
1251
(
1982
).
8.
V.
Chatziioannou
and
M.
van Walstijn
, “
Energy conserving schemes for the simulation of musical instrument contact dynamics
,”
J. Sound Vib.
339
,
262
279
(
2015
).
9.
S.
Bilbao
, “
Time domain simulation of the snare drum
,”
J. Acoust. Soc. Am.
131
(
1
),
914
925
(
2012
).
10.
D.
Kartofelev
,
A.
Stulov
,
H.-M.
Lehtonen
, and, and
V.
Välimäki
, “
Modeling a vibrating string terminated against a bridge with arbitrary geometry
,” in
Proceedings of the Stockholm Musical Acoustics Conference
, Stockholm, Sweden (July 30–August 2,
2013
), pp.
626
632
.
11.
V.
Debut
and
J.
Antunes
, “
Physical synthesis of six-string guitar plucks using the Udwadia-Kalaba modal formulation
,”
J. Acoust. Soc. Am.
148
(
2
),
575
587
(
2020
).
12.
R.
Fetecau
,
J.
Marsden
,
M.
Ortiz
, and
M.
West
, “
Nonsmooth Lagrangian mechanics and variational collision integrators
,”
SIAM J. Appl. Dyn. Sys
2
(
3
),
249
276
(
2003
).
13.
C.
Issanchou
,
V.
Acary
,
F.
Pérignon
,
C.
Touzé
, and
J.-L.
Le Carrou
, “
Nonsmooth contact dynamics for the numerical simulation of collisions in musical string instruments
,”
J. Acoust. Soc. Am.
143
(
5
),
3195
(
2018
).
14.
S.
Papetti
,
F.
Avanzini
, and
D.
Rocchesso
, “
Numerical methods for a nonlinear impact model: A comparative study with closed-form corrections
,”
IEEE Trans. Audio Speech Lang. Process.
19
(
7
),
29
33
(
2011
).
15.
G.
Horvay
and
A.
Veluswami
, “
Hertzian impact of two elastic spheres in the presence of surface damping
,”
Acta Mech.
35-35
,
285
290
(
1980
).
16.
K.
Hunt
and
F. R. E.
Crossley
, “
Coefficient of restitution interpreted as damping in vibroimpact
,”
J. Appl. Mech.
42
,
440
445
(
1975
).
17.
S.
Bilbao
,
A.
Torin
, and
V.
Chatziioannou
, “
Numerical modeling of collisions in musical instruments
,”
Acta Acust. united Ac.
101
,
155
173
(
2015
).
18.
C.
Issanchou
,
J.-L. L.
Carrou
,
C.
Touzé
,
B.
Fabre
, and
O.
Doaré
, “
String/frets contacts in the electric bass sound: Simulations and experiments
,”
Appl. Acoust.
129
,
217
228
(
2018
).
19.
M.
van Walstijn
,
J.
Bridges
, and, and
S.
Mehes
, “
A real-time synthesis oriented tanpura model
,” in
Proceedings of the International Conference On Digital Audio Effects (DAFx 2016)
, Brno, Czech Republic (September 5–9,
2016
). pp.
175
182
.
20.
N.
Lopes
,
T.
Hélie
, and, and
A.
Falaize
, “
Explicit second-order accurate method for the passive guaranteed simulation of port-hamiltonian systems
,” in
Proceedings of the 5th IFAC 2015
, Lyon, France (September 15–17,
2015
), pp.
223
228
.
21.
A.
Falaize
,
Modélisation, Simulation, Génération de Code et Correction de Systèmes Multi-Physiques Audios: Approche par Réseau de Composants et Formulation Hamiltonienne À Ports (Modelling, Simulation, Code Generation and Multi-Physics Audio System Correction: Component Network Approach and Hamiltonian Formulation)
(
Université Pierre et Marie Curie
,
Paris, France
,
2016
).
22.
C.
Jiang
,
W.
Cai
, and
Y.
Wang
, “
A linearly implicit and local energy-preserving scheme for the sine-gordon equation based on the invariant energy quadratization approach
,”
J. Sci. Comput.
80
,
1629
1655
(
2019
).
23.
X.
Yang
, “
Linear and unconditionally energy stable schemes for the binary fluid-surfactant phase field model
,”
Comput. Methods Appl. Mech. Eng.
318
,
1005
1029
(
2017
).
24.
S.
Bilbao
,
Numerical Sound Synthesis: Finite Difference Schemes and Simulation in Musical Acoustics
(
Wiley
,
Chichester, UK
,
2009
).
25.
V.
Chatziioannou
,
S.
Schmutzhard
, and, and
S.
Bilbao
, “
On iterative solutions for numerical collision models
,” in
Proceedings of the 20th Conference on Digital Audio Eff (DAFx-17)
, Edinburgh, UK (September 5–9,
2017
).
26.
M.
van Walstijn
and
J.
Bridges
, “
Simulation of distributed contact in string instruments: A modal expansion approach
,” in
Proceedings of the 24th European Signal Processing Conference (EUSIPCO)
, Budapest, Hungary (August 28–September 2,
2016
).
27.
M.
Ducceschi
and
S.
Bilbao
, “
Non-iterative solvers for nonlinear problems: The case of collisions
,” in
Proceedings of the 22nd Conference on Digital Audio Effects (DAFx-19)
, Birmingham, UK (September 2–6,
2019
), pp.
17
24
.
28.
S.
Bilbao
,
M.
Ducceschi
, and, and
C. J.
Webb
, “
Large-scale real-time modular physical modeling sound synthesis
,” in
Proceedings of the 22nd Conference on Digital Audio Effects (DAFx-19)
, Birmingham, UK (September 2–6,
2019
), pp.
128
135
.
29.
S.
Willemsen
,
S.
Serafin
,
S.
Bilbao
, and
M.
Ducceschi
, “
Real-time implementation of the tromba marina
,” in
Proceedings of the 17th SMC
, Málaga, Spain (May 28–31,
2020
), pp.
161
168
.
30.
J.
Chabassier
,
A.
Chaigne
, and
P.
Joly
, “
Modeling and simulation of a grand piano
,”
J. Acoust. Soc. Am.
134
(
1
),
648
665
(
2013
).
31.
B.
Bank
and
L.
Sujbert
, “
Generation of longitudinal vibrations in piano strings: From physics to sound synthesis
,”
J. Acoust. Soc. Am.
117
(
4
),
2268
2278
(
2005
).
32.
M.
Ducceschi
, “
Companion webpage
,” https://mdphys.org/collisions.html (Last viewed April 2021).
33.
M.
Ducceschi
and
S.
Bilbao
, “
Linear stiff string vibrations in musical acoustics: Assessment and comparison of models
,”
J. Acoust. Soc. Am.
140
(
4
),
2445
2454
(
2016
).
34.
C.
Desvages
,
S.
Bilbao
, and, and
M.
Ducceschi
, “
Realistic frequency-dependent damping for time domain modelling of linear string vibration
,” in
Proceedings of the International Conference on Acoustics (ICA 2016)
, Buenos Aires, Argentina (September 5–9,
2016
).
35.
S.
Bilbao
, “
Conservative numerical methods for nonlinear strings
,”
J. Acoust. Soc. Am.
118
(
5
),
3316
3327
(
2005
).
36.
P.
Morse
and
U.
Ingard
,
Theoretical Acoustics
(
Princeton University Press
,
Princeton, New Jersey
,
1968
), pp.
1
927
.
37.
R.
Courant
,
K.
Friedrichs
, and
H.
Lewy
, “
On the partial differential equations of mathematical physics
,”
Math. Ann.
100
,
32
74
(
1928
) (in German).
38.
J.
Sherman
and
W. J.
Morrison
, “
Adjustment of an inverse matrix corresponding to a change in one element of a given matrix
,”
Ann. Math. Stat.
21
,
124
127
(
1950
).
39.
W. W.
Hager
, “
Updating the inverse of a matrix
,”
SIAM Rev.
31
(
2
),
221
239
(
1989
).
40.
G. O.
Paiva
,
F.
Ablitzer
,
F.
Gautier
, and
J. M.
Campos dos Santos
, “
Collisions in double string plucked instruments: Physical modelling and sound synthesis of the viola Caipira
,”
J. Sound Vib.
443
,
178
197
(
2019
).
41.
J.
Roli
, “
Juce
,” juce.com (Last viewed December 2020).
42.
S.
Willemsen
, “
Real-time implementation of the tromba marina using non-iterative collisions
,” https://www.youtube.com/watch?v=tuIbO9LfUDA (Last viewed December 2020).