Page 97 -
P. 97

84 Hard disks and spheres

                                     A collision occurs when the norm ofthe spatial distance vector

                                                  x k (t) − x l (t) =  ∆ x  +∆ v ·(t − t 0 )   (2.1)

                                                     ∆x(t)     x k (t 0 )−x l (t 0 )  v k −v l
                                     equalstwice the radius σ of the disks (see Fig. 2.2). This can happen at
                                     two times t 1 and t 2 , obtained by squaring eqn (2.1), setting |∆x| = 2σ,
                                     and solving the quadratic equation

                                                                                     2
                                                                        2
                                                                               2
                                                                                           2
                                                 −(∆ x · · · ∆ v ) ±  (∆ x · · · ∆ v ) − (∆ v ) ((∆ x ) − 4σ )
                                       t 1,2 = t 0 +                                         . (2.2)
                                                                    (∆ v ) 2
                                     The two disks will collide in the future only if the argument ofthe square
                                     rootis positiveand if they are approaching each other ((∆ x · · · ∆ v ) < 0,
                                     see Alg. 2.2 (pair-time)). The smallest ofall the pair collisiontimes
                                     obviously gives the nextpaircollisionin the wholesystem (see Alg. 2.1
                                     (event-disks)). Analogously, the parameters for the next wall collision
                                     are computed froma simpletime-of-flight analysis (see Fig. 2.3,and
                                     Alg. 2.1 (event-disks) again).
                                                  procedure pair-time
                                                  input ∆ x (≡ x k (t 0 ) − x l (t 0 ))
                                                  input ∆ v (≡ v k − v l  =0)
                                                               2
                                                                            2
                                                                                 2
                                                                      2
                                                  Υ ← (∆ x · · · ∆ v ) −|∆ v | (|∆ x | − 4σ )
                                                  if (Υ > 0 and (∆ x · · · ∆ v ) < 0)then
                                                                             √
                                                    (            2              3
                                                      t pair ← t 0 − (∆ x · · · ∆ v )+  Υ /∆ 2
                                                                                    v
                                                  else

                                                      t pair ←∞
                                                  output t pair
                                                  ——
                                       Algorithm 2.2 pair-time. Pair collision time for two particles starting
                                       at time t 0 from positions x k and x l, and with velocities v k and v l.










                                              t 0              t 1              t 2


                                           Fig. 2.3 Computing the wall collision time t wall =min(t 1,t 2).

                                       Continuing ourimplementation of Alg. 2.1 (event-disks), wenow
                                     compute the velocities after the collision: collisions with a wall ofthe
                                     box lead to a change ofsign ofthe velocity component normal to the
   92   93   94   95   96   97   98   99   100   101   102