Bilbao Ao

download Bilbao Ao

of 9

Transcript of Bilbao Ao

  • 8/9/2019 Bilbao Ao

    1/20

    ACTA  ACUSTICA UNITED WITH  ACUSTICAVol. 98 (2012)

    Numerical Modeling of Collisions in Musical

    Instruments

    S. Bilbao1), A. Torin1), V. Chatziioannou2)1) Acoustics and Audio Group, King’s Buildings, University of Edinburgh, Edinburgh, United King-

    dom.

    [email protected]) Institute of Music Acoustics, University of Music and Performing Arts, Vienna, Austria

    Summary

    Collisions play an important role in many aspects of the physics of musical instruments. The striking

    action of a hammer or mallet in keyboard and percussion instruments is perhaps the most important

    example, but others include reed-beating effects in wind instruments, the string/neck interaction in

    fretted instruments such as the guitar as well as in the sitar and the wire/membrane interaction in

    the snare drum. From a simulation perspective, whether the eventual goal is the validation of musicalinstrument models or sound synthesis, such highly nonlinear problems pose various difficulties, not

    the least of which is the risk of numerical instability. In this article, a novel finite difference time

    domain simulation framework for such collision problems is developed, where numerical stability

    follows from strict numerical energy conservation or dissipation, and where a power law formulation

    for collisions is employed, as a potential function within a passive formulation. The power law serves

    both as a model of deformable collision, and as a mathematical penalty under perfectly rigid, non-

    deformable collision. Various numerical examples, illustrating the unifying features of such methods

    across a wide variety of systems in musical acoustics are presented, including numerical stability and

    energy conservation/dissipation, bounds on spurious penetration in the case of rigid collisions, as well

    as various aspects of musical instrument physics.

    PACS no. 43.75.Zz

    1. Introduction

    Various mechanisms of sound production in musicalinstruments rely on collisions; the obvious examplesare the interaction of a striking object, such as a ham-mer with a string, or a drum stick or mallet with a per-cussive instrument, but more subtle examples includereed-beating effects in wind instruments, string/neckinteractions along the fretboard of a guitar, and alsoin the sitar and tambura, and most dramatically, the

    wire/membrane interaction in a snare drum. In allcases, the collision interaction is necessarily stronglynonlinear, and simulation design becomes a challeng-ing problem.

    Such collisions may be grouped into two types. Inthe first, one of the two objects involved in the col-lision is modelled as lumped—i.e., it is characterizedby a single position/velocity pair. Such is the case formost models of the hammer-string [1, 2], mallet-bar[3] and mallet-membrane interactions [4], even if thecolliding object occupies a finite interaction region.

    Received 27 October 2012,accepted 6 December 2012.

    The perceptual effects of such a nonlinear interactionare major, particularly with regard to the spectralcontent of the resulting sound. In the second, bothobjects must be considered to be fully distributed,and the region of contact will vary in a non-trivialmanner. Examples include the snare drum [5], sitar[6] and string fret interactions [7] mentioned above.

    Collision modeling is a branch of the large area of contact mechanics with applications across a varietyof disciplines, and especially robotics [8] and computer

    graphics [9]—see Wriggers et al. [10] for a recent re-view. In musical acoustics and applications in soundsynthesis, various techniques have been employed, in-cluding digital waveguides [11, 7], modal methods [6]and time stepping methods in the lumped setting[12, 13, 14], in modeling lumped/distributed collisions[15, 16, 2, 17], the interaction of a distributed objectwith a rigid barrier [11, 18, 19], and in the collisionof deformable objects for synthesis applications [20].Finite element methods are often used to model col-lisions of complex deformable bodies in mainstreamapplications [21]; in the present case of musical acous-

    tics and sound synthesis, where geometries are oftensimple, finite difference time domain methods [22] are

     © S. Hirzel Verlag ·  EAA   1

  • 8/9/2019 Bilbao Ao

    2/20

    ACTA  ACUSTICA UNITED WITH  ACUSTICA   Bilbao, Torin, Chatziioannou: Numerical Modeling of CollisionsVol. 98 (2012)

    an efficient alternative, and will be employed here.Such methods serve as an alternative to other tech-niques which can in some instances be more efficient(such as, e.g., digital waveguides [23] or modal meth-ods [24]) because they generalize more easily to han-dle distributed interactions, as in the present case of collisions.

    In the setting of musical acoustics, previous workon particular cases of collisions using finite differencemethods, such as, for example, the snare membraneinteraction [5] and the reed/lay interaction [17] hasgenerally made use of ad hoc techniques—that is tosay, there is not any attempt at proving numerical sta-bility under such strongly nonlinear conditions. As inthe case of other types of inherent distributed nonlin-earities in musical instruments (as, e.g., in strings [25]or curved shells [26]), an approach based on energyprinciples [27] is of great utility; energetic methodsare widely used in elastodynamics, whether in a vari-

    ational setting [28] or when strict energy conservationor dissipation is enforced [29]. The general aim of thispaper, then, is to incorporate the nonlinear collisionmechanism into the energy conservation framework,and use such a formulation in order to arrive at suffi-cient stability conditions for such methods, and showits application to a wide variety of systems, spanningthe range of musical instruments. The mechanism bywhich this is accomplished is through the introductionof a potential energy term corresponding to the col-lision interaction; such a mechanism has indeed beenproposed, in the case of a lumped collision in the semi-discrete case by Rhaouti et al. in [4] and in the fully

    discrete case by Chabassier in [15] and Chabassier etal. [16]. The case of distributed collisions, however,which forms a large part of the present article, has notbeen treated previously within an energy-conservingframework to the knowledge of these authors.

    If the collision is accompanied by some deformationof the colliding object (as for, e.g., the piano ham-mer), then the additional potential has the interpre-tation of energy stored in the deformed object. In thecase of rigid collisions, however, the potential must beinterpreted as a   penalty —such a potential results ina strong opposing force, penalizing penetration, but

    some limited interpenetration of the colliding bod-ies is permitted. Such penalty methods [30] can beviewed in contrast with methods based on hard non-penetrative constraints [31]. As long as contact veloc-ities are low (which is generally the case in musicalacoustics applications), the latter approach is justifi-able. Indeed, a second benefit of such an energy-basedformulation, beyond proving stability, is a means of determining bounds on such spurious penetration—aswill be seen, the amount of penetration can be madeas small as desired (and particular, small enough tobe negligible in applications in acoustics). Numerical

    existence and uniqueness results in the simple caseof a lumped collision with a rigid barrier have been

    presented recently [14] and will be extended to fullydistributed systems here. The issue of existence anduniqueness for the underlying systems in the presenceof collision mechanisms is a difficult one—it has beenapproached, in the case of lumped collisions with arigid barrier and with a vibrating string, by Joly andRhaouti [32], and is out of the scope of this work.

    In Section 2, the collision of a mass with a rigid bar-rier is used as a test case in the construction of stableenergy conserving methods, accompanied by an ex-tension to the case of a lossy collision. Collisions of a lumped object with a distributed system are con-sidered next. To this end, some background materialon discrete representations of distributed systems ispresented in Section 3. The case of the hammer stringinteraction is treated first in Section 4, followed byreed beating effects, in a simple model of a wind in-strument in Section 5. A fully distributed collision isconsidered next, in the case of a string in contact with

    a rigid barrier in Section 6. In 2D, the simplest sys-tem of interest is the mallet/membrane interaction,described in Section 7. Finally, the case of a wire incontact with a membrane, modeling the snare inter-action is described in Section 8. As a nontrivial ex-ample, in this last section, a complete 3D model of asnare drum, including the cavity, membranes, acous-tic field and snares is outlined. As the schemes pre-sented here all require the solution of nonlinear equa-tions, some existence/uniqueness results are providedin Appendix A, along with some comments on the useof iterative methods.

    2. Prelude: Collision of a Mass with aRigid Barrier

    A starting point in many numerical studies of colli-sions [10, 13, 14] is the case of a lumped deformableobject approaching a rigid barrier from below, under anonlinear interaction force. The system may be writ-ten as

    M  d2u

    dt2  = −f , f  =  dΦ

    du  =

     dΦ

    dt /

    du

    dt  .   (1)

    Here, u  =  u(t) is the position of the object at time t ∈R+, and M  is its mass. For this second order equation,

    two initial conditions, namely u(0) and  du/dt(0) mustbe supplied. f  = f (t)  is the interaction force, writtenhere in terms of a potential  Φ(u) ≥ 0. For collisions,with a barrier at   u   = 0,   f   is zero for   u ≤   0; whenu >   0, a deformable object undergoes compression,and a rigid object can be viewed as penetrating thebarrier. A power law is a useful general choice of thepotential:

    Φ = ΦK,α  =   K [u]α+1+

    α + 1  ≥ 0   →   f  = K [u]α+   .   (2)

    2

  • 8/9/2019 Bilbao Ao

    3/20

    Bilbao, Torin, Chatziioannou: Numerical Modeling of Collisions   ACTA  ACUSTICA UNITED WITH ACUSTICAVol. 98 (2012)

    It depends on a stiffness parameter   K  ≥   0   and anexponent α > 1; in this article, the notation [·]+   indi-cates the positive part of, i.e.,  [u]+ =

      12

     (u + |u|).Such power law nonlinearities are common in mod-

    els of collisions in many settings, including not justthe present case of the lumped collision, but also inmodels of the hammer string interaction [2], where  α

    and K  are empirically determined (though for simplersystems, such as the contact of two spheres, Hertzianmodels allow a direct calculation [33]). Such modelsmay be viewed as permitting a certain deformation of the colliding object when in contact with the barrier.If the colliding object is perfectly rigid, then such amodel is obviously unphysical, in that some penetra-tion is permitted—in this case, the potential  Φ  maybe interpreted as a penalty, and   u >   0   is itself thepenetration; in numerical treatments,  α  = 1   is oftenchosen [30]. Most of what follows here does not dependon a particular choice of the potential—but existenceand uniqueness in implementation do depend on theform of  Φ, and the power law has various advantageswhich will be highlighted.

    2.1. Energy Balance

    The collision model presented above is energy con-serving [13]. Multiplying (1) by  du/dt  leads to

    M  du

    dt

    d2u

    dt2  = −du

    dt f  = −du

    dt

    du  = −dΦ

    dt  ,   (3)

    and thus to the energy balance, in terms of total en-ergy H:

    dHdt

      = 0   ,   H(t) =   M 2

    dudt

    2+ Φ  .   (4)

    Thus H(t), corresponding to the total energy of theobject at time  t, is conserved and non-negative:

    H(t) = H (0) ≥ 0  .   (5)Note that the procedure above, involving multiplica-tion by the velocity, leads to a construction of theenergy conservation law, and can be viewed as the re-verse of the procedure employed in the derivation of equations of motion from expressions for the energy

    using Hamilton’s equations [34].For the particular choice of the power law potentialfunction   Φ = ΦK,α   from (2), the conservation lawimplies bounds on both   u(t)   and   du/dt  at any timet, in terms of the initial energy H(0). These may bearrived at by noting that, as the individual terms of H   in (4) are both non-negative, both are boundedindividually by H(0), leading to:du

    dt

    ≤ 

    2H(0)M 

      , u(t) ≤

    (α + 1) H(0)K 

    1α+1

    .   (6)

    The first bound holds for any non-negative potential

    Φ, and the second employs monotonicity of the powerlaw ΦK,α   in  u ≥ 0.

    2.2. Time Series and Difference Operators

    Moving to a discrete time simulation setting, let u =un represent an approximation to  u(t)  at  t =  nk , forinteger n, and for a given time step  k.

    Unit shifts  et+  and  et−  are defined as

    et+un = un+1 et−u

    n = un−1 .   (7)

    Forward, backward and centered difference approxi-mations to a first time derivative may thus be definedas

    δ t+ =  et+ − 1

    k  δ t− =

     1 − et−k

      δ t·  = et+ − et−

    2k  ,(8)

    and an approximation to a second time derivative as

    δ tt =  et+ − 2 + et−

    k2  .   (9)

    Various averaging operators may be defined as

    µt+ = et+ + 1

    2  µt−=

     1 + et−2

      µt·= et+ + et−

    2  . (10)

    2.3. Finite Difference Scheme

    An approximation to (1), at time step  n  is then

    M δ ttun = −f n ,   (11a)

    where δ tt is a second difference operator, as defined in(9), and where  f n is a time series defined by

    f n

    =

      δ t−Φn+12

    δ t·un   ,   Φn+ 1

    2 = µt+Φ (un

    )   (11b)

    in terms of a discrete potential   Φn+12 , itself defined

    in terms of the potential   Φ   of the model problem.Note here that the definition of  f n here mirrors thatof the continuous time case, from (1); simpler, fullyexplicit forms are available, but can lead to stabilityproblems—see the end of Section 4.4 for an exampleof numerical instability, in the case of a hammer incontact with a string. The backwards and centereddifference operators δ t− and δ t·  employed in (11b) aredefined in (8), and the averaging operator  µt+   is de-

    fined in (10). The time series  Φn+1

    2 is interleaved withrespect to the time series  un itself; thus scheme (11)is centered about time step n  and, if stable, is secondorder accurate [22] (note in particular the application

    of the backward difference operator to   Φn+12 , which

    centers the approximation about time step  n).Multiplying (11a) by   δ t·u

    n, and employing (11b)gives

    M δ t·unδ ttu

    n = −δ t·unf n = −δ t−Φn+12 .   (12)

    Employing the identity

    δ t·unδ ttu

    n = 12

    δ t− (δ t+un)2 (13)

    3

  • 8/9/2019 Bilbao Ao

    4/20

  • 8/9/2019 Bilbao Ao

    5/20

    Bilbao, Torin, Chatziioannou: Numerical Modeling of Collisions   ACTA  ACUSTICA UNITED WITH ACUSTICAVol. 98 (2012)

    0 1 2 3 4 5 6 7−20

    −10

    0

    10

    t  (ms)

         u

         (   m   m     )

     

    α = 1.5α = 2α = 2.5

    0 50 100 150 200 250 300

    −2

    0

    2

    x 10−15

    time step  n

           ǫ

    Figure 1. Top: trajectory of a mass  M   = 10   g, collidingwith a rigid barrier, under different values of the exponentα, as indicated. Here the mass has initial velocity 10 m/s,and  K   = 108. Scheme (11) is used, with a sample rateof 44.1 kHz. Bottom: normalized energy variation   ǫn =hn+

    12 − h1/2

    /h1/2, when  α  = 2.5.

    As a further example, the behaviour of the samesystem, under the lossy collision model given in Sec-tion 2.4 is plotted in Figure 2, under difference choicesof the loss parameter  β . Energy is monotonically de-creasing, illustrating a complex non-exponential losscharacteristic during the collision itself.

    0 1 2 3 4 5 6 7−10

    −5

    0

    5

    t  (ms)

         u

         (   m   m     )

     

    β  = 0β  = 0.5β  = 1

    0 50 100 150 200 250 3000

    0.5

    time step  n

         E   n   e   r   g   y     (     J     )

    Figure 2. Top: trajectory of a mass colliding with a rigidbarrier, under different values of the loss coefficient  β , asindicated, with α  = 2.3. All other conditions are as in the

    caption to Figure 1. Bottom: energy  hn+12 , when  β  = 1.

    In the case of a completely rigid collision, some spu-rious penetration (here  u >  0) is inevitable. Consid-ering again the system under the choice of parame-ters given in Figure 1. Using values of  K  = 1016 andα = 1.2, approximating such a rigid collision, the pen-etration is under 8×10−8 m, which is negligible in anyacoustics application.

    3. Background: Distributed Systemsand Grid Functions

    In this section, some background material on systemsand grid functions suitable for use in finite difference

    time domain schemes in 1D and 2D is presented, witha focus on energy techniques.

    3.1. Continuous Inner Products and Norms

    Consider real-valued functions  α(x, t)  and  β (x, t)  de-fined over a  d-dimensional domain, with  x ∈ D ⊂ Rd,and for time   t

     ∈  R

    +. Particular domains of interest

    in the present setting are, for a given length  L, a 1Dinterval DL  and the 2D square domain DL,L, definedas

    DL = {x ∈ R|0 ≤ x ≤ L}   ,  DL,L  = DL × DL ,(26)where × indicates a Cartesian product. The L2 spatialinner product and norm are defined as

    α, β D  = D

    αβdx   ,   αD  = 

    α, αD ≥ 0 ,  (27)

    where dx is a  d-dimensional differential element.For such an inner product, it is true that

    ddt

    12α2D = α, ∂ tαD ,   (28)

    where  ∂ t   and  d/dt  represent partial and total differ-entiation with respect to  t, respectively.

    Integration by parts (or Green’s first identity) maybe written as

    α, ∆β D  = −∇α, ∇β D + ∂ D

    αn · ∇βdσ  (29)

    where   ∆   is the Laplacian operator in   d   dimensions,∇ is the  d-dimensional gradient, and where ∂ D  is theboundary of the domain D, with outward normal  n.

    3.2. Discrete Domains and Grid Functions

    An  N  + 1  point discrete 1D spatial domain  dN   cor-responding to the line segment DL   may be definedas

    dN  = {l ∈ Z, 0 ≤ l ≤ N }   (30)for some integer   N   such that the grid spacing   h   =L/N . In a finite difference setting, other domainswhich differ from dN  through the removal of endpointsare also of interest:

    dN  = dN  − {N }   , dN   = dN  − {0, N } .   (31)

    A 1D grid function   unl  , defined over   l ∈   d, for some1D domain d, and for integer  n  represents an approx-imation to  u(x, t) at t  =  nk  and  x  =  lh.

    Similarly, a 2D discrete domain  dN,N  correspondingto the square region DL,L  may be written as

    dN,N   = dN  × dN  ,   (32)and truncated domains follow as

    dN,N   = dN  × dN    , dN,N   = dN  × dN  .   (33)A 2D grid function  unl,m, defined over   (l, m) ∈  d, forsome 2D domain   d, and for integer   n   represents an

    approximation to   u(x,y,t)   at   t   =   nk,   x   =   lh   andy  =  mh.

    5

  • 8/9/2019 Bilbao Ao

    6/20

  • 8/9/2019 Bilbao Ao

    7/20

  • 8/9/2019 Bilbao Ao

    8/20

    ACTA  ACUSTICA UNITED WITH  ACUSTICA   Bilbao, Torin, Chatziioannou: Numerical Modeling of CollisionsVol. 98 (2012)

    the grid function   gl   is chosen normalized such thatN l=0 hgl  = 1.

    The operator  ls  is an approximation to Ls:

    ls =  T sδ xx−E sI sδ xxxx−2σs,0ρsδ t·+2σs,1ρsδ t−δ xx(59)

    and the force f  may be written in terms of a discretepotential Φn+

    12 as

    f n =  δ t−Φ

    n+12

    δ t·ηn  , ηn = unh − g, undN  ,   (60)

    where  Φn+12 = µt+Φ(η

    n), and where ·, ·dN    is a dis-crete 1D inner product, as defined in (42).

    Scheme (58) accompanied by (60), as in the case of 

    the lumped collision, requires the solution of a scalarnonlinear equation of the form (17), in   r   =   ηn+1 −ηn−1, where

    m   =  k2

      g2dN 

    ρs (1 + σs,0k) +

      1

      a =  ηn−1 (61)

    b   = −2(unh − un−1h   ) +  k2

    1 + σs,0kg, ν ndN  ,   (62)

    where

    ν nl   =

    2k

    δ t−+ T s

    ρsδ xx− E sI s

    ρsδ xxxx+2σs,1δ t−δ xx

    unl   ,(63)

    which again possesses a unique solution. Notice in par-ticular that, given values of   u   and   uh   through timestep n,  a  and  b  may be computed explicitly, and thusonly a single scalar nonlinear equation must be solvedin order to solve for r; once r  is known, f n may be cal-culated, and the scheme (58) may be advanced to timestep n + 1. Such methods are similar in terms of com-putational expense to other methods which have beenproposed in the context of nonlinear acoustic simula-

    tion (such as, e.g.„ the K method [40], which also re-quire the solution of a nonlinear algebraic equation),but now with an energy-based stability condition.

    4.3. Numerical Energy and Stability Condi-tion

    An energy balance for scheme (58) follows from an in-ner product with  δ t·u, and using summation by partsidentities (46), as

    δ t−hn+1

    2 = −qns − bns,0 + bns,N  ,   (64)

    where  hn+12 , the total numerical energy is defined as

    h =  hs + hh, and

    hn+ 1

    2s   =

      ρs2 δ t+un2dN  +

     T s2 δ x+un, δ x+un+1dN    (65a)

    +E sI s

    2  δ xxun, δ xxun+1d

    N −  σs,1kρs

    2  δ t+δ x+un2dN 

    hn+12

    h   =   M 2  (δ t+uh)2 + Φn+12 (65b)

    qns   = 2ρs

    σs,0δ t·un2dN  + σs,1δ t·δ x+un2dN 

      (65c)

    bns,0   =   T sδ t·un0δ x−u

    n0 − E sI sδ t·un0δ x−δ xxun0   (65d)

    +E sI sδ t·δ x+un0 δ xxu

    n0  + 2σs,1ρsδ t·u

    n0 δ t−δ x−u

    n0

    bns,N   =   T sδ t·unN δ x+u

    nN  − E sI sδ t·unN δ x+δ xxunN    (65e)

    +E sI sδ t·δ x−unN δ xxu

    nN  + 2σs,1ρsδ t·u

    nN δ t−δ x+u

    nN  .

    Here, under (for example) discrete clamped bound-ary conditions

    un

    0  = δ x

    +un

    0  = 0 , un

    N  = δ x−u

    n

    N   = 0 ,   (66)

    then the system is numerically dissipative because(65d) and (65e) vanish. For numerical stability, allthat remains is to find a condition under which theenergy function is non-negative—notice that  h

    n+ 12

    s   isof indeterminate sign. To this end, using the inequal-ities (45) and (47), it may be bounded as

    hn+ 1

    2s   ≥

    ρs2 − T sk

    2

    h2  − 4E sI sk

    2

    h4  − 2σs,1ρsk

    h2

    δ t+un2dN  .(67)

    For a given time step   k, this term is non-negativeunder the condition  h

    ≥hmin, where

    h2min  = T sk2

    2ρs+

    kσs,12

      +k

    2

     T sk

    ρs+4σs,1

    2+

    16E sI sρs

    ,(68)

    which serves as a stability condition for the completescheme—it is equivalent to the condition arrived atthrough frequency domain (von Neumann) analysis[22] for the string alone, though now under nonlin-ear conditions, and reduces to the familiar CourantFriedrichs Lewy condition [41] in the case of an ideallossless string.

    4.4. SimulationsAs a simple illustration of this scheme, the case of a C4piano string subject to a piano hammer striking actionis considered here, with parameters as drawn fromthe article by Chaigne and Askenfelt [37]. In Figure3, the force history of such a strike is plotted, underhammer velocities corresponding to piano, mezzoforteand forte strikes, illustrating the main features of ageneral decrease in contact time with increasing strikevelocity, and the appearance of secondary humps inthe force history, due to the reflection of waves fromthe string termination.

    More interesting, in the present context, are moredelicate features due to hammer width, which can be

    8

  • 8/9/2019 Bilbao Ao

    9/20

  • 8/9/2019 Bilbao Ao

    10/20

  • 8/9/2019 Bilbao Ao

    11/20

    Bilbao, Torin, Chatziioannou: Numerical Modeling of Collisions   ACTA  ACUSTICA UNITED WITH ACUSTICAVol. 98 (2012)

    5.2. Finite Difference Scheme

    For a grid function   Ψnl   defined over   l ∈  dN , a finitedifference approximation to (70) may be written as

    ρS̄ lc2

      δ ttΨnl   = lwΨ

    nl   ,  lw  =  ρδ x− (µx+Sδ x+ · )  ,   (84)

    where  S l   is derived from the continuous bore profileS (x), through sampling at locations  x  =   lh, and us-ing the averaging operation as defined in (37), andwhere  S̄ l  = µxxS l. Pressure and velocity pairs at themouthpiece and bell may be defined as

     pnin   =   ρδ t·Ψn0   u

    nin  = −µx−S 0δ x−Ψn0   (85a)

     pnb   =   ρδ t·ΨnN    u

    nb   = −µx+S N δ x+ΨnN  ,   (85b)

    where the operations in the + and − directions for thevelocity terms indicate approximations to derivativesnormal to the endpoints [17]. The assumption of  pb =0   is enforced by setting  ΨnN  = 0.

    The reed system (72) is approximated as

    M rδ ttzn+2M rσrδ t·z

    n+M rω2rµt·z

    n = f n−S r pn∆(86)in terms of time series  zn,  pn∆, and f 

    n, defined by

    f n =  δ t−Φ

    n+12

    δ t·η  ,   Φn+

    12 = µt+Φ (η

    n)  ,   (87)

    where  ηn = −zn − H . Equations (74) to (76) remainas written, for time series pnin, u

    nm and  p

    nm, which is as-

    sumed sampled from a given mouth pressure function pm(t). Equation (77) may be approximated as

    unr   = S r′δ t·zn .   (88)

    In contrast with the case of the hammer string in-teraction, due to the presence of two distinct non-linearities, namely the Bernoulli effect and collision,there is now a pair of nonlinear equations to be solvedsimultaneously. To this end, note that when evaluatedat   l   = 0, the scheme (84) leads to an instantaneousrelationship between  pnin  and  u

    nin:

     pnin  =  cn0  + c1u

    nin ,   (89)

    where  c1  >  0   is a constant, and  cn

    0  can be computedfrom values of  Ψ  through time step  n.Using this relation, in conjunction with (86), (87),

    (88), as well as (74), (75) and (76), when viewed asrelations among time series, one arrives at the pair of equations:

    G(rn) − gpn∆ = 0   , rn − R( pn∆) = 0 ,   (90)with   rn =   ηn+1 − ηn−1, for a constant   g >   0, andwhere

    G(rn) =   rn + bn +  m

    rn (Φ(rn + an) − Φ(an))   (91a)

    R( pn∆) = −vn0 −v1 pn∆−v2[−ηn]+ 

    | pn∆|sign( pn∆) ,(91b)

    where here, the constants m, v1 and  v2 are all positive,and the values bn, an and vn0  can be computed directlygiven known values of the state through time step  n.As previously, under a choice of penalty potential suchas  Φ = ΦK,α, this pair of equations admits a uniquesolution, as shown in Appendix A. At time step   n,once rn and  pn∆  are determined, z

    n+1 and Ψn+10   , may

    be calculated directly, along with the remaining valuesof  Ψnl .

    An energy balance follows as in the continuous caseas

    δ t−hn+1

    2 = −qnr − qnm + pnmunin ,   (92)

    where  hn+12 = h

    n+ 12

    r   + hn+ 1

    2w   and where

    hn+ 1

    2w   =

      1

    2ρc2 ̄

    Sδ t+Ψ2dN    (93a)

    2µx+Sδ x+Ψ, et+δ x+ΨdN 

    hn+ 12r   =   M r2

      (δ t+zn)2 +  M rω2r

    2  µt+ (zn)2 + Φn+

    12(93b)

    qnr   = 2M rσr (δ t·zn)

    2qnm= w[−ηn]+

     2

    ρ| pn∆|

    32 .(93c)

    Only   hn+ 1

    2w   is of indeterminate sign—as in the case

    of the hammer/string interaction, however, it may beshown to be non-negative (see Section 9.1.5 of [17])under the condition

    h ≥ ck ,   (94)which is again the Courant Friedrichs Lewy condition,

    now generalized to the case of Webster’s equation—notice in particular that it is independent of the boreprofile S , and is thus convenient to use in practice.

    5.3. Simulations

    As a simple test of this algorithm, consider a clarinet-like bore profile, as illustrated in the top panel of Fig-ure 7. In this case, the reed parameters are chosen asS r  = 1.46×10−4 m2, M r  = 3.37×10−6 kg, σr  = 1500s−1,  ωr  = 23250  s−1, and where the equilibrium dis-tance  H  of the reed from the lay is  4 × 10−4 m andthe reed channel width is  w  = 0.01 m. Parameters for

    the acoustic field are chosen as   ρ   = 1.2   kg/m3 andc   = 340   m/s. For the penalty potential, a choice of Φ = ΦK,α   is used, with  α = 1.3  and  K  = 1013. Bothnon-beating, and beating behaviour are shown; underthe beating conditions, and at a sample rate of 88.2kHz (this higher sample rate is used here for plot reso-lution), the maximum penetration of the reed into thebarrier over the duration of the simulation is 1.5×10−8m. As a check on the use of such a penalty potentialfor a rigid collision, plots of reed displacement underdifferent choices of the penalty potential are shown inFigure 8. Rather complex multiple bounce patterns

    are evident, the character of which is retained regard-less of the choice of the exponent in the potential.

    11

  • 8/9/2019 Bilbao Ao

    12/20

    ACTA  ACUSTICA UNITED WITH  ACUSTICA   Bilbao, Torin, Chatziioannou: Numerical Modeling of CollisionsVol. 98 (2012)

    0 100 200 300 400 500 600

    −50

    0

    50

    x (mm)

         b   o   r   e   r   a     d     i   u   s     (   m   m     )

    335 340 345 350 355 360 365

    −0.4

    −0.2

    0

         y

         (   m   m     )

    t  (ms)

    335 340 345 350 355 360 365

    −0.4

    −0.2

    0

         y

         (   m   m     )

    t  (ms)

    Figure 7. Top: clarinet-like bore profile. Middle: steady-state oscillation of the reed position   y, under a mouthpressure of   pm   = 2000   Pa, for which the reed oscillateswithout beating against the lay (illustrated as a grey re-gion at   y   =   −0.4   mm). Bottom: reed position under ahigher pressure of  pm  = 2500   Pa, illustrating beating ef-fects. The sample rate is 88.2 kHz.

    337 338 339 340 341 342

    −0.4

    −0.38

    α = 1.3

         y

         (   m   m

         )

    t  (ms)

    337 338 339 340 341 342

    −0.4

    −0.38

    α = 1.8

         y

         (   m   m     )

    t  (ms)

    337 338 339 340 341 342−1

    0

    1x 10

    −3

         d     i      ff   e   r   e   n   c   e     (   m   m

         )

    t  (ms)

    Figure 8. Detail of the collision interaction of the reed un-der beating conditions, using a penalty potential  ΦK,α, forK  = 1013 and for two different values of the exponent α, asindicated, at top and middle. Bottom: difference betweenthe two simulation results, in mm.

    6. The String in Contact with a Dis-tributed Rigid Barrier

    In the previous examples, the colliding object, thoughoccupying a finite region, is best considered aslumped—the nonlinear interaction force is a scalarfunction of time alone. In some settings, the inter-

    action force must also be modeled as distributed. Asimple example is the case of the string in contact witha rigid barrier. Though it is possible to perform a geo-metric analysis for the ideal string, defined by the 1Dwave equation, in contact with a barrier of specifiedshape [49, 50], for more realistic systems, time step-ping methods (including not just the FD schemes de-scribed here, but also methods such as digital waveg-uides [19]) are probably a necessity.

    Consider a stiff and lossy string, defined again overx ∈ DL, and for t ∈ R+, and in contact with a barrierbelow, located at height b(x). A model of this system

    isρs∂ ttu = Lsu + F ,   (95)

    where string parameters and operator Ls are as for thesystem described in Section 4, and where F  representsthe interaction force/unit length with the barrier. Asbefore, two initial conditions for  u  must be supplied,namely u(x, 0) and  ∂ tu(x, 0). If the barrier is assumedto be perfectly rigid, F  may be written in terms of apenalty potential density  Φ(η) as

    F  = ∂ tΦ/∂ tη , η =  b − u .   (96)

    A choice of   Φ  of the form of a one-sided power lawsuch as Φ = ΦK,α   is a convenient choice.

    Through an inner product with ∂ tu, an energy bal-ance

    dHdt

      = −Qs + B sL0

    ,  H = Hs + Hb   (97)

    results, where Hs, Qs  and B s  are as given in the caseof the hammer string interaction in (57), and wherethe interaction energy Hb  is given by

    Hb =  DL

    Φdx ≥ 0 ,   (98)

    and the system is thus strictly dissipative.

    6.1. Finite Difference Scheme

    A finite difference scheme, again defined over  l ∈ dN ,follows for this system as

    ρsδ ttunl   = lsu

    nl   + F nl   ,   (99)

    where the difference operator  ls   is as defined in (59),and where the force density F nl   is defined as

    F nl   = δ t−Φn+1

    2

    lδ t·ηnl

    ,  Φn+1

    2

    l   = µt+Φ(ηnl  ) , ηnl   = bl−unl   .(100)

    12

  • 8/9/2019 Bilbao Ao

    13/20

    Bilbao, Torin, Chatziioannou: Numerical Modeling of Collisions   ACTA  ACUSTICA UNITED WITH ACUSTICAVol. 98 (2012)

    The scheme satisfies an energy balance of the form

    δ t−hn+1

    2 = −qns − bns,0 + bns,N  ,   (101)

    where   hn+12 =   h

    n+ 12

    s   + hn+ 1

    2

    b   with   qns ,   b

    ns,0   and   b

    ns,N 

    are as in the hammer string interaction in (65), andwhere

    hn+ 12b   = Φn+

    12 , 1dN  ≥ 0 ,   (102)

    where “1" indicates a grid function consisting of ones.Under lossless boundary conditions, the scheme is

    stable under the same condition as previously, namely(68).

    The scheme (101) now requires the solution of non-linear equations along the length of the string. If rl  = η

    n+1l   − ηn−1l   , then one must solve a set of equa-

    tions of the form of (17), i.e.  Gl  = 0, l ∈ dN , where

    Gl  =  rl + m

    rl

    (Φ(rl + al)

    −Φ(al)) + bl ,   (103)

    with

    m =  k2

    ρs (1+σs,0k) , al= et−η

    nl   , bl=

      k

    1+ σs,0kν nl   , (104)

    where   ν nl   is as defined in (63). In this case, exis-tence and uniqueness follow immediately from thescalar case, as the nonlinear equations to be solvedare uncoupled—which is not the case in more com-plex scenarios where two distributed objects are incontact. See Section 8.

    In this case, where the string and barrier are as-

    sumed perfectly rigid, the penalty formulation allowssome spurious penetration. This may be bounded, nu-merically, by noting that, because the barrier poten-

    tial  hb  satisfies  0 ≤ hn+12

    b   ≤ hn+12 when the scheme is

    stable (i.e., under condition (68)), the penetration ηnlmay be bounded, at all times, by

    ηnl  ≤

    2 (α + 1) h1/2

    Kh

    1α+1

    .   (105)

    Thus the penetration is bounded in terms of the initialenergy, and, furthermore, can be made as small as

    desired through the choice of  K   (within reason—seecomments in the Conclusion). In practice, this boundis in fact very conservative—see the comments at theend of Section 6.2.

    6.2. Simulations

    The collision of a string with a rigid barrier gives riseto a wide variety of complex phenomena. As a simpleexample, consider a string vibrating against a rigidbarrier of parabolic shape, as illustrated in Figure 9.(The parabolic shape has been used in previous stud-ies of string collision [49, 19] as a rough approximation

    to a bridge termination in various instruments such asthe sitar or tambura; an exaggerated profile has been

    chosen, for illustration). In this case, the string is ini-tialized using a triangular distribution. The potentialΦK,α   is employed here, with  K  = 1013 and  α  = 1.3.

    Plots of the time evolution of the string are shownin Figure 9. Notice in particular the intermittent con-tact/recontact phenomena in evidence over the col-lision region, signaling that analysis or synthesis ap-

    proaches based on a model of such a colliding string interms of a moving end point may pose some difficul-ties, due to the non-contiguity of the freely vibratingportions of the string [49, 11].

    0 0.2 0.4 0.6−10

    0

    10

    x (m)

         u

         (   m   m     )

    t =0ms

    0 0.2 0.4 0.6−10

    0

    10

    x (m)

         u

         (   m   m     )

    t =0.5ms

    0 0.2 0.4 0.6−10

    0

    10

    x (m)

         u

         (   m   m     )

    t =1ms

    0 0.2 0.4 0.6−10

    0

    10

    x (m)

         u

         (   m   m     )

    t =1.5ms

    0 0.2 0.4 0.6−10

    0

    10

    x (m)

         u

         (   m   m     )

    t =2ms

    0 0.2 0.4 0.6−10

    0

    10

    x (m)

         u

         (   m   m     )

    t =2.5ms

    0 0.2 0.4 0.6−10

    0

    10

    x (m)

         u

         (   m   m     )

    t =3ms

    0 0.2 0.4 0.6−10

    0

    10

    x (m)

         u

         (   m   m     )

    t =3.5ms

    Figure 9. Snapshots of the time evolution of a vibratingstring in partial contact with a barrier of parabolic shape(in grey). The string is considered to be non-stiff, of lengthL = 0.62  m, with  ρs  = 6.3  g/m,  T s  = 670  N,  σs,0 = 0  andσ1,0   = 5 × 10

    −4, and is initialized in a triangular shapecorresponding roughly to a plucked excitation. The samplerate is 88.2 kHz, so that fine features of the interaction maybe observed.

    One perceptual effect of termination against such asmooth obstacle is an effective change in pitch withamplitude. This is illustrated in Figure 10, showingoutput spectra under triangular initial conditions of different amplitudes. As amplitude is increased, thespectral peaks migrate towards the higher frequen-cies, reflecting an effective shortening of the vibratingportion of the string, accompanied by a broadeningof the peaks due to the nonlinear interaction. Underlossy conditions, one may expect pitch glide phenom-ena to occur.

    Interesting from a numerical perspective, given theuse of a penalty based approach to rigid collision as

    13

  • 8/9/2019 Bilbao Ao

    14/20

    ACTA  ACUSTICA UNITED WITH  ACUSTICA   Bilbao, Torin, Chatziioannou: Numerical Modeling of CollisionsVol. 98 (2012)

    0 200 400 600 800 1000 1200−80

    −60

    −40

    −20

    0

    20

    40

    f   (Hz)

        |

         ˆ     u     o

        |

         (     d     B     )

     

    umax = 0.1 mmumax = 1 mmumax = 10 mm

    Figure 10. Spectrum of string response, for the string col-lision as in Figure 9, under lossless conditions, and undera triangular excitation of amplitude as indicated.

    employed here are questions of the amount of pene-tration, and also of convergence to an exact solutionacross a range of different choices of the penalty po-tential itself. See Figure 11, showing the preservationof fine features of the string profile, after undergoing acollision with the barrier for different values of  α; the

    difference between the two simulations is also shown,which is small, and has an oscillatory character (as isto be expected) concentrated near the barrier interac-tion region. For  α = 1.3, and under these conditions,the maximum penetration of the string into the obsta-cle can be bounded, from (105), by  ηnl  ≤ 2.6×10−5 m.In fact, this bound is rather conservative—for the sim-ulation results shown in Figure 9, the maximum pen-etration over all grid locations, and over the length of the simulation is under 3 microns. It should be notedthat it is not claimed here that the existence of an ex-act solution to the model problem has been proved—rather, it is illustrated that differences among solu-

    tions become small, independently of the parameterswhich define the collision, for sufficiently large valuesof the stiffness  K  when a rigid barrier is considered.

    0 0.1 0.2 0.3 0.4 0.5 0.6

    −2

    −1

    0

    1

    x (m)

         u

         (   m   m     )

    α =1.3

    0 0.1 0.2 0.3 0.4 0.5 0.6−0.05

    0

    0.05

    x (m)     d     i      ff   e   r   e   n   c   e     (   m   m     )

    0 0.1 0.2 0.3 0.4 0.5 0.6

    −2

    −1

    0

    1

    x (m)

         u

         (   m   m     )

    α =1.5

    Figure 11. String profile, for the string collision as in Fig-ure 9, after 2.5 ms, under a penalty potential  ΦK,α   withK   = 1013, and for two different values of  α   as indicated,as well as the difference between the two simulations.

    7. The Mallet-Membrane Interaction

    The interaction of a mallet with a membrane is a gen-eralization to 2D of the hammer string interaction de-scribed in Section 4, and may be written as

    ρm∂ ttw = Lmw − gf , M   d2whdt2

      = f .   (106)

    Here, w  =  w(x,y,t)   is the transverse displacement of a square membrane, defined for coordinates   (x, y) ∈DL,L, and for   t ∈   R+.   ρm   is membrane density, inkg/m2, and  g  =  g(x, y)  represents the region of con-tact between the mallet and the membrane, again nor-malized such that

     DL,L

    gdxdy = 1. wh  represents the

    vertical position of the mallet, of mass  M . The oper-ator Lm, incorporating effects of tension and simplefrequency-independent loss, is defined as

    Lm =  T m∆ − 2σm,0ρm∂ t ,   (107)where here, ∆  is the Laplacian operator, defined by

    ∆ =   ∂ 2∂x2

     +   ∂ 2∂y2

     ,   (108)

    and where   T m   is the membrane tension/unit lengthand  σm,0   is a loss parameter. The operator in (107)may easily be extended, as in the case of the string,to include effects of stiffness and frequency-dependentloss; these terms will be neglected here for the sake of brevity. Boundary conditions are assumed to be of fixed type:

    w = 0 over   ∂ DL,L ,   (109)where ∂ DL,L  is the boundary of  DL,L. As in previouscases, the system (106) must be complemented by twoinitial conditions each for w and wh, namely w(x,y, 0),∂ tw(x,y, 0),  wh(0) and dwh/dt(0).

    The mallet force f  acting from above is defined as:

    f  =  dΦ

    dη  , η = g, wDL,L − wh ,   (110)

    where ·, ·DL,L  represents a 2D inner product over thedomain DL,L, and where  Φ ≥  0   is again a one-sidedpotential function, sometimes chosen [4] as a powerlaw nonlinearity of the form  ΦK,α.

    The expression for conserved energy is directly gen-eralized from that of the hammer string system, as:

    dHdt

      =−Qm + ∂ DL,L

    B m   ,   H=Hm + Hh .   (111)

    Here,

    Hm   =   ρm2 ∂ tw2DL,L +

     T m2 ∇w2DL,L (112a)

    Hh   =   M 2

    dwh

    dt

    2+ Φ   (112b)

    Qm   = 2σm,0ρm∂ tw2DL,L   (112c)B m   =   T m∂ twn · ∇w ,   (112d)

    where  n  represents a vector normal to the boundary.

    Under lossless boundary conditions (such as the fixedcondition given in (109)), the system is dissipative.

    14

  • 8/9/2019 Bilbao Ao

    15/20

    Bilbao, Torin, Chatziioannou: Numerical Modeling of Collisions   ACTA  ACUSTICA UNITED WITH ACUSTICAVol. 98 (2012)

    7.1. Finite Difference Scheme

    The scheme, which is a direct extension of that of thehammer/string system, can be presented briefly here:

    ρmδ ttwnl,m  =  lmw

    nl,m − gl,mf n M δ ttwnh  = f n ,  (113)

    where wnl,m, wnh  and f 

    n are approximations to w  (nowdefined over the 2D discrete domain   dN,N ),   wh   and

    f , respectively, and where   lm  is an approximation toLm:lm =  T mδ ∆ − 2σm,0ρmδ t·   (114)

    and the force f  may be written in terms of a discretepotential Φn+

    12 as

    f n =  δ t−Φn+

    12

    δ t·ηn  , ηn = g, wndN,N −wnh ,(115)

    where Φn+12 = µt+Φ(ηn).

    As previously, updating scheme (113) requires thesolution of a nonlinear equation of the form (17),where

    m   =  k2

      g2dN,N ρm (1 + σm,0k)

     +  1

      a =  et−η

    n (116)

    b   = 2kδ t−wnh−

      2k

    1+ σm,0kg,

    δ t−+ kT m2ρm

    δ ∆

    wndN,N  .

    The energy balance is now, after taking an innerproduct over dN,N   with  δ t·w, and using (48),

    δ t−hn+1

    2 = −qnm +

    (ζ x,ζ y)∈∂dN,N 

    bnm,ζ x,ζ y ,   (117)

    where ∂ dN,N  indicates the set of grid points lying on

    the boundary of  dN,N .  hn+12 , the total numerical en-

    ergy is defined as  h  =  hm + hh, where

    hn+1

    2m   =

     ρm2 δ t+wn2dN,N  +   (118a)

    T m2

    δ x+wn, δ x+wn+1dN,N  + δ y+wn, δ y+wn+1dN,N hn+1

    2

    h   = M 

    2  (δ t+wh)

    2 + Φn+12 (118b)

    qnm = 2σm,0ρmδ t·wn2dN,N  (118c)bnm,ζ x,ζ y = T mδ t·w

    nζ x,ζ yδ b+w

    nζ x,ζ y .   (118d)

    Here, the notation  δ b+  indicates a spatial first differ-ence operation in the direction normal to the bound-

    ary. At corner points in the domain  dN,N , it is to beapplied in both directions and summed. Under thecondition that   wnl,m   is zero at the boundary, corre-sponding to a fixed termination (109), the system isagain dissipative.

    A stability condition for scheme (113) follows againfrom the non-negativity of  hm. Using bounds (45) and(49) leads to the condition

    h ≥ hmin  = k 

    2T mρm

    ,   (119)

    which is the same as the bound obtained using fre-

    quency domain techniques for the membrane schemein isolation.

    7.2. Simulations

    In this section, the results of a simulation for a squaremembrane are shown, corresponding roughly to a typ-ical drum configuration. Force histories are shown inFigure 12 at top, illustrating again the decrease incontact duration with mallet velocity, and at middleand bottom, the energy partition between the mal-let and membrane, as well as the normalized energyvariation are shown. The variation in the energy iscompounded by the number of degrees of freedom of the system, which is considerably larger than in theprevious cases.

    0 2 4 6 8 10 120

    50

    100

    150

    t (ms)

           f

         (     N     )

     

    mallet velocity 1 m/s

    mallet velocity 5 m/s

    mallet velocity 10 m/s

    0 2 4 6 8 10 120

    1

    2

    3

    t (ms)

         E   n   e   r   g   y     (     J     )

     

    membrane energy mallet energy

    0 2 4 6 8 10 12

    −2

    0

    2

    x 10−14

    t (ms)

         E   n   e   r   g   y   v   a   r     i   a    t     i   o   n

    Figure 12. Top: Force experienced by a mallet, of mass0.028 kg, and with stiffness parameters K  = 1.6×108 andα  = 2.54, striking a membrane under different velocities,as indicated. The membrane, of dimensions 0.6×   0.6 m,with  ρm  = 0.26  kg/m

    2 and  T m  =  3325 N/m, is struck ata location 0.1 m from a corner. Middle: Energy partition.Bottom: normalized energy variation. The sample rate is22.05 kHz.

    8. Fully Distributed InteractionThe methods described in the previous sections canalso be applied to more complex scenarios involvingdistributed coupling between multiple dynamic ob- jects. In this section, the collision of an ideal stringwith a membrane is described, with an eye towardsfull simulation of the snare drum, which will be brieflyoutlined.

    8.1. The String/Membrane Collision

    Consider the system of an interacting string and mem-

    brane, defined over the regions   λ ∈ DLs   and   x   =(x, y) ∈ DLm,Lm , and with transverse displacements

    15

  • 8/9/2019 Bilbao Ao

    16/20

    ACTA  ACUSTICA UNITED WITH  ACUSTICA   Bilbao, Torin, Chatziioannou: Numerical Modeling of CollisionsVol. 98 (2012)

    u   =  u(λ, t)   and   w   =   w(x, t), for   t ∈   R+. The equa-tions of motion are:

    ρm∂ ttw = Lmw + g, FDLs ρs∂ ttu = Lsu −F .(120)

    The operators Lm   and Ls   have been introduced in(107) and (51), respectively. As previously, two ini-

    tial conditions must be supplied for each of  u  and  w,namely   w(x,y, 0),   ∂ tw(x,y, 0),   u(λ, 0)   and   ∂ tu(λ, 0).The collision force density F   is again a distributedfunction F    =   F (λ), and the contribution of  F   tothe membrane equation must be integrated along thedomain of interaction with the string with a suitabledistribution function. The simplest possible choice isprobably  g  =  δ (x− π(λ)), where  π   : DLs → DLm,Lmis the projection from each point of the string to thecorresponding point on the membrane and  δ   is a 2DDirac delta function. As before, F  may be related to apotential Φ = Φ(η(λ)), which depends on the distanceη  between the string and membrane over the regionof interaction:

    F  =   ∂ tΦ∂ tη

      , η =  u − g, wDLm,Lm

    .   (121)

    Once again, one can derive an expression for energywhich is conserved in the lossless case.

    8.2. Finite Difference Scheme

    A finite difference approximation for (120) and (121)can be written as follows:

    ρmδ ttwn

    l,m =  lmwn

    l,m + (ismF n

    )l,m   (122a)ρsδ ttu

    nl   = lsu

    nl − F nl   (122b)

    in terms of grid functions   unl  , defined over  dN s , andwnl,m  over dN m,N m , where F nl   , may be written as

    F nl   = δ t−Φ

    n+ 12

    l

    δ t·ηnl, ηnl   = u

    nl − (imswn)l .   (123)

    Here, integrals have been expressed as linear opera-tors:

    g, · dN s = ism,   g, · dN m,N m = ims .   (124)Ultimately, the finite difference scheme can be up-

    dated by solving a non-linear equation in the vectorr:

    G(r) =  r + Mω + b =  0 ,   (125)

    with the elements of  r  and  ω  given by

    rl  = ηn+1l   − ηn−1l   , ωl  =

     Φ(rl + al) − Φ(al)rl

    .   (126)

    As before,  al   =  et−ηn

    l   and b

     depend only on knownvalues of  w  and  u. In contrast with the previous cases,

    values of the solution  r  are now coupled by the pres-ence of a square matrix  M defined as:

    M =

      k2

    ρs(1+ σs,0k) 1 +

      k2

    ρm(1+ σm,0k) ImsIsm

     ,(127)

    where  1   represents the identity matrix.   Ism   and   Imsare the matrix forms of the operators   i

    sm  and   i

    ms,

    respectively, and are required to be the transposes of one another for energy conservation reasons (see Sec-tion 5.2.4 of [17]). Therefore,  M   is positive definite,which guarantees existence and uniqueness of the so-lution (see Appendix A). ) The size of  M is the sameas the number of points in the snare involved in thecollisions with the membrane. For example, a string of 25 cm with a typical grid spacing of 5 mm requires 51points. In a snare drum simulation (see below), thisnumber must be multiplied by the total number of snares (generally 10-20).

    8.3. Boundary conditions

    Boundary conditions for the membrane have been dis-cussed in Section 7. For the string, one possibility isto use fixed termination at both ends. In real snaredrums, however, the snares are held in contact withthe membrane by two bridges attached to the rim of the drumhead. In a numerical simulation, this com-plex termination can be modelled, as a first crudeapproximation, by attaching the strings directly tothe membrane. In this case, additional force terms re-solved at the boundaries of the string must be addedto the equation for the membrane:

    ρmδ ttwnl,m   =   lmw

    nl,m + g

    (0)l,mf 

    (0) + g(Ls)l,m   f 

    (Ls) (128)

    + (ismF n)l,m   ,

    where   g(0) and   g(Ls) are suitable distribution func-tions (e.g., 2D Dirac delta functions) for   λ   = 0, Ls.Energy analysis can be applied to find stable bound-ary conditions at λ  = 0 (and similarly at  λ  =  Ls):

    u0   =

    g(0), wdN m,N m

    (129)

    f (0) = (T s δ λ− − E sI sδ λ−δ λλ + 2σs,1ρsδ t−δ λ−)u0 .

    The first condition is that displacements are equal atthe snare endpoint and the point on the membrane towhich is connected, and the second that the force ex-erted on the membrane is equal and opposite to thatexerted on the end of the snare. Under these condi-tions, the scheme as a whole is dissipative, and stableunder the separate conditions (68) and (119). The ex-pression for matrix  M in (127) is slightly altered, butremains positive definite.

    8.4. Case Study: The Snare Drum

    In this section, an application to the simulation of the snare drum is briefly outlined. The snare drum

    16

  • 8/9/2019 Bilbao Ao

    17/20

    Bilbao, Torin, Chatziioannou: Numerical Modeling of Collisions   ACTA  ACUSTICA UNITED WITH ACUSTICAVol. 98 (2012)

    is double-headed, with the distinguishing feature of aset of snares (metal wires) in contact with the lowermembrane, which gives this instrument its character-istic rattling sound.

    Finite difference time domain simulation of thesnare drum has been presented previously [5]; in thatcase, however, the collision of the snares with themembrane was treated using ad hoc methods, andno stability condition was available. Here, again, thepenalty potential formalism described in the previoussections is extended to handle this more complex case,including the interaction between the mallet and theupper membrane, leading to a provably stable algo-rithm.

    A simple model of the snare drum consists of twocircular membranes with fixed boundary conditions,coupled by a rigid cavity and immersed in a box of air, with a set of snares in contact with the lowermembrane (see Figure 13). The system can be ex-cited through a mallet acting on the upper membrane.Absorbing conditions are applied at the walls of theenclosure, ideally simulating an anechoic space.

    The approach described above may be applied tothe mallet-membrane interaction and to the snarescolliding against the membrane, in order to obtain afully energy conserving model. Figure 14 shows somesnapshots of the time evolution of the system, subjectto an initial strike on the upper membrane. The delayin the excitation caused by the air inside the cav-ity on the lower membrane is apparent. The snaresare launched by the contact with the lower mem-brane; though the movement is at first coherent, it israpidly randomized through multiple collisions. Fig-ure 15 shows the contributions to total energy of thevarious components, with normalized energy varia-tions on the order of machine accuracy.

    Figure 13. Diagram of snare drum geometry, illustratingthe various components. A finite enclosure with absorbingconditions at the walls surrounds the system.

    Figure 14. Snapshots of the evolution of the snare drumsystem at times as indicated. Displacements have beenscaled for illustration purposes. The sample rate is 48 kHz.

    0 10

    10−4

    10−3

    10−2

    10−1

    100

    t   (ms)

         E   n   e   r   g

       y     (     J     )

    0 10−4

    0

    4x 10

    −14

    t   (ms)

         E   n   e   r   g   y   v   a   r     i   a    t     i   o   n

    Figure 15. Top: energy partition among the various com-ponents of the snare drum (solid line: upper membrane,bold dashed: mallet, dotted: lower membrane, dashed:air, dot-dashed: snares). Bottom: normalized energy vari-ations.

    9. Concluding Remarks

    This article has explored basic features of time do-

    main numerical simulation of collision interactionsin musical instruments, with a focus on an energy-

    17

  • 8/9/2019 Bilbao Ao

    18/20

    ACTA  ACUSTICA UNITED WITH  ACUSTICA   Bilbao, Torin, Chatziioannou: Numerical Modeling of CollisionsVol. 98 (2012)

    conserving (and more generally passive) formulations,within which the collision mechanism may be includedthrough an added potential; such a formulation al-lows for the stable simulation of a wide range of col-lision interactions in musical instruments. It is hopedthat such techniques will aid in the investigation of finer features in musical instrument acoustics. From a

    sound synthesis perspective, one issue which has notbeen touched upon here is aliasing—always present innonlinear models, but somewhat alleviated by physi-cal damping.

    When the colliding objects are assumed to be rigid,the potential has the interpretation of a penalty. Ashas been shown at various instances, a penalty for-mulation of rigid collisions does lead to spurious pen-etration, but generally this is very small by the stan-dard of acoustics applications—furthermore, there issome degree of control over the amount of penetra-tion, which may be conveniently bounded, provided

    a numerical energetic framework is available. Undercontinuously forced conditions (as in, e.g., the case of the lip/reed mechanism), however, a bound is not im-mediately available; though a bound on penetrationat a given instant can surely be written in terms of the total power supplied up until that instant, a tightbound is not immediately apparent, and it would beof interest to find such a bound. Another aspect wor-thy of further study is the particular choice of sucha penalty; a power law has been used here, for sim-plicity, but many others are available, perhaps withsuperior properties in terms of the reduction of spu-rious penetration.

    The formulations presented here require the solu-tion of nonlinear equations in the main update. If the colliding object is lumped, as in the case of thehammer/string, mallet/membrane and reed interac-tions then a single equation to be solved results. Forfully distributed collisions between two deformableobjects, the solution to a system of coupled equa-tions is required. In all cases examined here, however,the system to be solved possesses a unique solution—see Appendix A. The Newton Raphson method hasbeen employed here in order to solve such nonlin-ear equations. One aspect of such iterative methods

    which has not been addressed here is convergence,even though a unique solution exists. The NewtonRaphson method employed here has in all cases led toconvergence (easily observed by energy conservationto machine accuracy), but as yet its convergence re-mains unproven for the systems examined here. Somepartial results, however, are available—see AppendixA. Newton Raphson, however, is but one method of solution—many others are available [51]. Useful also,here, would be bounds on the number of required it-erations. This is particularly important in the case of rigid collision—though penetration bounds have been

    repeatedly shown here, these depend on the collisionstiffness   K —and indeed, there is a link between in-

    creased stiffness and and increase in the number of required iterations, though it is not fully clear atpresent.

    Though the energy-conserving framework presentedhere has been applied to the case of finite differencetime domain methods, one might suspect that it ap-plies more generally in different formulations which ul-

    timately reduce to time stepping methods (includingtime domain finite element methods, spectral meth-ods, as well as modal techniques), though over moregeneral basis functions. Various references are avail-able [52, 53] giving an overview of such families of numerical techniques. Another interesting choice inthe interest of efficiency, particularly for synthesisapplications, might involve digital waveguides [23]—interesting recent work by Kartofelev et al. [19], deal-ing with the string/barrier problem indicates at leasta partial affirmative answer in the case of an idealnon-stiff string. Such choices will form the basis of future investigations.

    Finally, it should be stated clearly that such energy-conserving formulations do come at a cost—namelythe use of an iterative solver; though relatively mi-nor in the case of lumped collisions, where there isa single nonlinear equation to be solved (or two, inthe case of the beating reed), in the distributed case,and for rigid collisions, the expense incurred is large—leading to perhaps a 10-20 fold increase in the opera-tion count, if a rigid collision interaction is the domi-nant cost. Simpler, fully explicit ad hoc methods areavailable, and can perform very well, again particu-larly in the case of lumped collisions. In the case of 

    fully distributed collisions, however, it appears to bethe case that the greater the complexity of the system,the greater the risk of instability using such methods,with the snare drum presented here as an extremeexample. For such systems, the observation of an en-ergy balance would appear to be at least one way of arriving at well-behaved designs.

    A. Nonlinear Equations: Exis-tence/Uniqueness and Conver-gence

    The solution of the nonlinear equation  G(r) = 0, forG(r)  as defined in (17), as well as several variants,plays a key role in all of the algorithms described here.It is thus worth outlining here some properties of suchequations, especially with regard to the existence anduniqueness of solutions, as well as the convergence of the Newton Raphson method.

    It has recently been shown [14] that the equationG(r) = 0, for G(r) as defined in (17) has a unique solu-tion in r. The essence of the proof is that for a differen-tiable and convex potential  Φ,  G′(r)   is non-negative,and bounded away from zero, and thus  G(r) = 0  pos-

    sesses a unique solution. In particular,  G′

    (r) ≥ 1. Thepower law potential ΦK,α  is convex and differentiable,

    18

  • 8/9/2019 Bilbao Ao

    19/20

    Bilbao, Torin, Chatziioannou: Numerical Modeling of Collisions   ACTA  ACUSTICA UNITED WITH ACUSTICAVol. 98 (2012)

    and thus the numerical methods here that rely on thesolution of such an equation, namely the collisions de-scribed in Sections 2, 4, 6 and 7, admit a unique up-date.

    The Newton Raphson method can be shown tobe globally convergent, independent of the startingpoint  r∗, if  G(r)   is itself convex [54]. Indeed, ∀α ≥ 2,G′′

    (r) =  mr3 P (r) where P (r) = r

    2

    Φ′′

    (r + a)−2rΦ′

    (r +a)+2Φ(r +a)−2Φ(a). Now, P ′(r) = r2Φ′′′(r +a) ≥ 0,since   ΦK,α   is convex, hence  P (r)   is a monotonicallyincreasing function passing through the origin, whichresults in   G′′(r) ≥   0   (which also holds in the limitr →   0). When   1   < α <   2,   Φ′′′ ceases to exist forcertain values of  r  and  a. In this case only local con-vergence can be guaranteed, subject to a good initialguess r∗, which is ensured in practice by choosing theprevious value of  r.

    The case of the beating reed requires the solutionof a pair of nonlinear equations, as given in (90), withthe functions  G  and  R  as defined in (91). First, notethat R   is one-to-one, thus possessing an inverse  R−1,so system (90) may be condensed to

    J (rn) = G(rn) − gR−1(rn) = 0 .   (130)Note that  R′ is negative, and bounded between −v1and  −∞. and thus   (R−1)′ is also negative, andbounded between 0 and −1/v1. Because   g >  0, andG′ ≥   1,   J ′ ≥   1, and the system possesses a uniquesolution. It is not, however, convex, and a simple con-clusion regarding the convergence of Newton Raphsonis not easily arrived at.

    Finally, consider the vector system of non-linear equations arising in the case of dis-tributed/distributed interaction in (125). BecauseM >  0, the system to be solved is equivalent to

    Ĝ(r) =  M−1r+ ω + M−1b =  0 .   (131)

    The system possesses a unique solution if the Jacobianof  Ĝ   is positive definite. The Jacobian is  M−1 +  Ω,where   Ω   is a diagonal matrix, the diagonal entriesof which are the derivatives of the components of   ωwhich are individually non-negative, and is thus pos-itive semi-definite. Thus the Jacobian is positive def-

    inite.

    Acknowledgment

    This work was supported by the European ResearchCouncil, under grant number StG-2011-279068-NESS.

    References

    [1] X. Boutillon: Model for piano hammers: Experimen-tal determination and digital simulation. J. Acoust.Soc. Am.  83 (1988) 746–754.

    [2] A. Chaigne, A. Askenfelt: Numerical simulations of struck strings. I. A physical model for a struck string

    using finite difference methods. J. Acoust. Soc. Am.95 (1994) 1112–1118.

    [3] A. Chaigne, V. Doutaut: Numerical simulations of xylophones. I. Time domain modeling of vibratingbars. J. Acoust. Soc. Am.  101  (1997) 539–557.

    [4] L. Rhaouti, A. Chaigne, P. Joly: Time-domain mod-eling and numerical simulation of a kettledrum. J.Acoust. Soc. Am.  105 (1999) 3545–3562.

    [5] S. Bilbao: Time domain simulation of the snare drum.J. Acoust. Soc. Am.  131 (2012) 914–925.

    [6] C. Vyasarayani, S. Birkett, J. McPhee: Modelingthe dynamics of a vibrating string with a finitedistributed unilateral constraint: Application to thesitar. J. Acoust. Soc. Am.  125 (2010) 3673–3682.

    [7] G. Evangelista: Physical model of the string fret inter-action. Proc. Int. Conf. Digital Audio Effects, Paris,France, Sept. 2011, 345–351.

    [8] D. Marhefka, D. Orin: A compliant contact modelwith nonlinear damping for simulation of robotic sys-tems. IEEE Trans. Systems, Man and Cybernetics—Part A: Systems and Humans  29  (1999) 566–572.

    [9] D. Baraff: Fast contact force computation for non-penetrating rigid bodies. Computer Graphics Proc.,

    Orlando, Florida, July 1994, 23–34.[10] P. Wriggers, T. Laursen: Computational contact me-

    chanics. Springer-Verlag Vienna, 2008, 1–255.

    [11] A. Krishnaswamy, J. O. Smith III: Methods for sim-ulating string collisions with rigid spatial obstacles.IEEE Workshop on Appl. of Siqnal Processing to Au-dio and Acoust., New Paltz, New York, October 2003,233–236.

    [12] F. Avanzini, D. Rocchesso: Modeling collision sounds:Nonlinear contact force. Proc. Int. Conf. on DigitalAudio Effects, Limerick, Ireland, December 2001, 61–66.

    [13] S. Papetti, F. Avanzini, D. Rocchesso: Numericalmethods for a nonlinear impact model: A compara-

    tive study with closed-form corrections. IEEE Trans.on Audio Speech and Language Processing  19  (2011)29–33.

    [14] V. Chatziioannou, M. van Walstijn: An energy con-serving finite difference scheme for simulation of colli-sions. Proc. Stockholm Musical Acoust. Conf., Stock-holm, Sweden, 2013.

    [15] J. Chabassier: Modeling and numerical simulation of the piano through physical modeling. Dissertation.Ecole Polytechnique, Paris, France, 2012.

    [16] J. Chabassier, A. Chaigne, P. Joly: Modeling and sim-ulation of a grand piano. J. Acoust. Soc. Am.  134(2013) 648–665. DOI: 10.1121/1.4809649.

    [17] S. Bilbao: Numerical sound synthesis. John Wileyand Sons, Chichester, UK, 2009, 1–456.

    [18] S. Siddiq: A physical model of the nonlinear sitarstring. Arch. Acoust. 37  (2012) 73–79.

    [19] D. Kartofelev, A. Stulov, H.-M. Lehtonen, V.Välimäki: Modeling a vibrating string terminatedagainst a bridge with arbitrary geometry. Proc.Stockholm Musical Acoust. Conf., Stockholm, Swe-den, August 2013.

    [20] J. Bensoam: A reciprocal variational approach to thetwo-body frictionless contact problem in elastody-namics. Int. J. of Mech. Sci.  45 (2010) 1530–1535.

    [21] T. Hughes, R. Taylor, J. Sackman, A. Curnier, W.Kanoknukulchai: A finite element method for a class

    of contact-impact problems. Comp. Meth. Appl.Mech. Eng.  8  (1976) 249–276.

    19

  • 8/9/2019 Bilbao Ao

    20/20