MODELLING & SIMULATION OF BOUNCING …...MODELLING & SIMULATION OF BOUNCING OBJECTS: NEWTON’S...

10
MODELLING & SIMULATION OF BOUNCING OBJECTS: NEWTON’S CRADLE REVISITED Peter C. Breedveld University of Twente, Cornelis J. Drebbel Institute for Mechatronics Control Engineering Laboratory, EL8250, P.O. Box 217, 7500 AE Enschede, Netherlands; email: [email protected] Abstract The port-based or ‘object-oriented’ modelling and simulation of bouncing objects is presented. It is shown that some traditional concepts used in modelling of bouncing objects are heavily influenced by the original purpose, i.e. the analytical solution of the relation between some state of a system of multiple objects before a bounce (‘begin state’) and some state after a bounce (‘end state’), by assuming an instantaneous exchange of momentum and kinetic energy between two objects. As this is incompatible with a port-based approach, the paper presents an alternative, continuous approach describing the short storage of potential energy during the contact phase. A popular example, viz. Newton’s cradle, is chosen as a running example to demonstrate the validity and the practical value of the underlying ideas. 1 Introduction The topic of modelling and simulation of colliding objects with a focus on exchange of energy and momentum like in the famous example of Newton’s cradle (Figure 1) is not just a classroom topic. Apart from the generalisations that can be made for models of systems impacting objects in any form, the example of Newton’s cradle itself is even a: b: Figure 1: Newton’s cradle (a: front view, b: perspective view) Proc. of Mechatronics 2002, University of Twente, 24-26 June 2002

Transcript of MODELLING & SIMULATION OF BOUNCING …...MODELLING & SIMULATION OF BOUNCING OBJECTS: NEWTON’S...

MODELLING & SIMULATION OFBOUNCING OBJECTS:

NEWTON’S CRADLE REVISITED

Peter C. Breedveld

University of Twente, Cornelis J. Drebbel Institute for MechatronicsControl Engineering Laboratory, EL8250, P.O. Box 217, 7500 AE Enschede,

Netherlands; email: [email protected]

Abstract

The port-based or ‘object-oriented’ modelling and simulation of bouncingobjects is presented. It is shown that some traditional concepts used inmodelling of bouncing objects are heavily influenced by the originalpurpose, i.e. the analytical solution of the relation between some state of asystem of multiple objects before a bounce (‘begin state’) and some stateafter a bounce (‘end state’), by assuming an instantaneous exchange ofmomentum and kinetic energy between two objects. As this is incompatiblewith a port-based approach, the paper presents an alternative, continuousapproach describing the short storage of potential energy during thecontact phase. A popular example, viz. Newton’s cradle, is chosen as arunning example to demonstrate the validity and the practical value of theunderlying ideas.

1 Introduction

The topic of modelling and simulation of colliding objects with a focus on exchange ofenergy and momentum like in the famous example of Newton’s cradle (Figure 1) is notjust a classroom topic. Apart from the generalisations that can be made for models ofsystems impacting objects in any form, the example of Newton’s cradle itself is evena: b:

Figure 1: Newton’s cradle (a: front view, b: perspective view)

Proc. of Mechatronics 2002, University of Twente, 24-26 June 2002

useful for the description of certain molecular effects (Arnolds et al., 2000).Furthermore, in many engineering systems no competent models can be found withoutmodelling some impact phenomenon. A presentation on hybrid system models in whichit was claimed that true dynamic simulation of a problem like Newton’s cradle isvirtually impossible, induced the recognition that the modelling approach presentedherein and used by the author successfully for many years (Breedveld et al., 1994) isworthwhile to present to a wider audience. This is mentioned as it illustrates the lack ofattention for the trade-off between conceptual and numerical complexity in themodelling process (Breedveld, 1996).

The reader should note that by a ‘dynamic simulation model’ a model is meantthat is not simply keeping track of the logistics of the momentum and energybalance, but computes the continuous trajectory of the objects before, duringand after the bounce. In case of hybrid models, the continuous model is used todetect the instant of the impact. Next some instantaneous bookkeeping isperformed in the traditional ‘begin-state-end-state style’ that requires quitedifferent concepts than the concepts used in continuous dynamic models.Finally the continuous model needs to be reinitialised with the outcome of thebookkeeping and restarted (Mosterman & Biswas, 1997).

After the above mentioned presentation an operational (meaning that it can be simulatedwith realistic results), dynamic, port-based model of a five-ball Newton cradle wasproduced within 10 minutes and a corresponding full 3D animation about 20 minuteslater in the modelling and simulation package 20-sim (URL: http://www.20sim.com).This software was designed to support the port-based or ‘object-oriented’ approach tomodelling. The concept of the switched 0-junction or X0-junction (Breedveld, 1996)modulated by the configuration states was used to switch elasticity (energy state) anddamping on and off, depending on the contact situation. Figure 2 shows the bond graphinput for 20-sim. The reason for the discrepancy between the above-mentionedconclusion and this result was studied afterwards and the results are presented in thispaper along with a generic approach to the modelling and simulation of bouncingobjects.

Note that the model mainly consists of standard bond graph and block diagram elementsavailable in 20-sim. A crucial addition for this case is a submodel of the X0-junction thatrepresents that power exchange depends on the configuration state. It is controlled by theconfiguration variables (positions) represented by full signal arrows in the bond graph,not to be confused with the energy states (displacements) related to the storage ofpotential energy via C-type storage ports represented by bond (half-arrows) in the bondgraph. Merely for reasons of experimentation comfort some minor, non-essentialmodifications to some basic elements were made for this particular case were all bodiesand contacts are assumed identical. The constitutive parameters describing the mass, thedamping, the contact stiffness and the ‘stiffness’ of the spring representing the effect ofgravity for small angles of the pendulum were all set to ‘global’ in order to be able toinput and change them all at once. Another minor extension is that all storage elementswere extended with an output signal ‘energy’ and an expression to compute this storedenergy. This way not only the total momentum in the system could be monitored via asum operator, but also the total energy (cf. Figure 2). In later versions of the model also amodification was made to the contact stiffness in order to improve the performance ofthe model. The necessity of this modification is one of the main topics of this paper andis discussed in section 4, in particular subsection 4.2.

Proc. of Mechatronics 2002, University of Twente, 24-26 June 2002

2 Port-based or ‘object-oriented’ modelling

The most important goal of this paper is to emphasise that it is possible to create a modelof systems like Newton’s cradle, using a generic tool and generic modelling concepts ina local, port-based way. This approach to modelling has also been addressed as ‘object-oriented modelling’, because there is some resemblance with object orientation incomputer science. However, as this analogy may also lead to false conclusions,especially regarding inheritance, this terminology is not preferred in a modelling context.

Figure 2: 20-sim input of a port-based model of the cradle represented by a bond graphand expansions of the most important submodels (cf. the hierarchy browser in each case)

Proc. of Mechatronics 2002, University of Twente, 24-26 June 2002

Considerable efficiency is achieved during port-based modelling not only by savingmodel implementation time by reusing submodels, but also by the extendibility of themodel (Figure 2). An extension of the model of the cradle from five balls to, forinstance, nine balls mainly consists of a straightforward copy and paste action and aconnection of the copied part to the original by drawing a bond and one or twoconfiguration signals.

The availability of many websites claiming to present simulations of Newton’s cradle,like Java applets (e.g. URL: http://home.a-city.de/walter.fendt/phe/ncradle.htm), is quitemisleading in the sense that the problem of simulating this system seems to be solved.However, many of these ‘models’ merely consist of a sequence of snapshots of someintermediate states that are played in a movie. However, note that true dynamicsimulations are all made by programs dedicated to a specific model of this specificsystem. By contrast, herein the attempt is made to use a generic, multidisciplinary(‘multiphysics’) modelling and simulation environment (20-sim) to obtain a competentmodel with a minimum of conceptual complexity, allowing a local, port-based approachand numerically solvable at an acceptable ratio of numerical costs and modellingefficiency. It is shown that the classical, textbook-style model is not suited for creatingsuch a generic dynamic system model for simulation based on a local, port-basedapproach. It is also shown that making the model structure physically more realisticfinally results in the required solution even though the model may be numerically quitestiff at some instants.

3 The classical model and its drawbacks

The classical model of rigid bouncing objects is based on what might be called ‘beginstate-end state-reasoning’. This results in a discrete energy balance and a discretemomentum balance based on a kind of ‘integral formulation’ Newton’s third law thatnormally reads: ‘action = - reaction’, i.e. in terms of forces or momentum flows. Bycontrast the integral formulation reads: ‘for every impulse on a body, the body exerts anequal and opposite impulse’. Note that an ‘impulse’ may be considered a momentumflow multiplied by a (small) time interval, which becomes a Dirac pulse in the limit.

Algebraic relations thus relate the momenta and kinetic energies of bouncing objects justbefore and just after a collision. There is a possibility to add damping in the form of arestitution factor that equals 1 in case of a fully elastic and 0 in case of a fully inelasticcollision. In case of two objects with identical mass m the two solutions in the elasticcase show that either ‘nothing happens’ (i.e. no impact) or ‘nothing seems to happen’,i.e. the impact mutually transfers the velocity of the bodies such that they seem tocontinue their original trajectory after changing identity (two equations with twounknown variables, where the superscripts o and n stand for ‘old’ and ‘new’):

1 2 1 22 2 2 21 1 1 1

1 2 1 22 2 2 2

n n o o

n n o o

mv mv mv mv

mv mv mv mv

+ = +

+ = +

1 2 1 22 2 2 2

1 2 1 2

n n o o

n n o o

v v v v

v v v v

+ = + + = +

1 2

1 2

2 1

,

, or

,

o o

n n

o o

v v

v v

v v

=

However, in case of more than two objects, like the five balls in Newton’s cradle, andassuming that more than two balls are in contact at the same time, i.e. involved in thesame impact, the momentum and energy balance result in many possible solutions forthe momentum distribution over the balls after the collision (two equations with more

Proc. of Mechatronics 2002, University of Twente, 24-26 June 2002

than two unknown variables). Note that Newton’s cradle operates the way it does due tothe small time delay between the momentum exchanges between the balls. This delay iscaused by the finite propagation (speed of sound), such that the impact can be seen as aseries of rapidly succeeding impacts between two equal balls. In this particular case thesolution becomes unique due to the sequencing into a series of two-ball collisions.However, also note that a physical system containing multiple objects involved in justone impact indeed is quite sensitive to its initial conditions up to a degree that thebehaviour becomes stochastic. The non-reproducible ball-break in a snooker game is anexample of such a situation.

Important characteristics of the classical approach are that the momentum transfer andconsequently the transfer of kinetic energy are assumed to be instantaneous, i.e.infinitely fast, which enforces momentum bookkeeping at the moment of the bounce. Asthe colliding objects may or may not be in contact with other rigid objects, as is the casefor Newton’s cradle, this bookkeeping involves the complete system, i.e. has to beglobal, which creates a conflict with the local approach in port-based modelling. Notethat for systems like an ideal version of Newton’s cradle this bookkeeping can still beanalysed analytically, but as soon as spatial motions of multiple rigid objects are allowedand the number of objects in the system increases, this approach may result in acombinatorial explosion. In fact, it was this argument that made the speaker in thepresentation referred to in the introduction conclude that a model of Newton’s cradleusing this approach ‘is virtually impossible’.

In dynamic system simulations a complicating factor is that not only the event of thebounce has to be detected properly, but also that the contents of the integratorsrepresenting the momentum have to be reset instantaneously with the results of theglobal bookkeeping at the moment of the event. In other words: direct access is requiredto the state vector of the numerical integration. A user of an arbitrary simulation packagegenerally does not have the possibility to access these states directly from his model withprocess time ‘frozen’. Even when this option is available and the considerableconceptual effort is invested to implement the model this way, the simulation has to bere-initialised after each bounce, which is rather time-consuming. The globalbookkeeping not only requires that the modelling and simulation environment supportsthe event construct and instantaneous change of state variables (integrator contents), butalso a mechanism to describe and to treat the logistics of simultaneous events asoccurring in the case of Newton’s cradle, i.e. a finite state machine. This requires that thebookkeeping globally keeps track of all positions of the objects as well as their momentaand is able to derive the logistics of the instantaneous momentum transfer between allrigid objects involved in the bounce via the common algebraic relations, i.e. assuming asequence of two-ball collisions. All this has to be treated in harmony with the numericalintegration method, i.e. the numerical integration has to be properly reinitialised aftereach impact. These kinds of system models have attracted quite some attention under theincorrect terminology ‘hybrid systems’, even though the system itself has no relationwhatsoever with any of the hybrid aspects of the numerical tools required to solve these‘hybrid models’. Without saying that support of a global event mechanism (finite statemachine) should be avoided in a simulation tool, it is claimed that it requires quite someconceptual load during modelling as well as numerical load during computation(frequent re-initialisation of the numerical integration algorithm) to solve models thisway. Nevertheless, situations may occur in which it is more efficient to invest all thisconceptual effort and obtain the largest computational efficiency, e.g. in case of modelsthat are used in large numbers of so-called productions runs. It should be noted that theabove refers to generic simulation environments and not for simulations that were made

Proc. of Mechatronics 2002, University of Twente, 24-26 June 2002

for the specific model like the Java applets on the internet as these are usuallynumerically quite efficient for the purpose they are built for.

Summarizing the key assumptions in the classical approach that lead to this rathercomplex situation:1. instantaneous momentum transfer between objects, due to the assumptions about

the infinitely stiff nature of the contact2. instantaneous momentum propagation within an object, due to the assumption of

the infinite propagation speed within a rigid body of finite dimensions3. ideal sequencing of momentum transfer corresponding to the order of the objects in

the chain (in order to prevent ambiguous solutions in case of more than two ballsimpacting)

Note that the latter only holds in case of propagation of a single event. For instance, ifthe outer balls are made to hit the balls in the cradle at rest from both sides, interferencemay disturb the sequencing. Figure 3 shows that the continuous model represents thiseffect. The classical model certainly does not display this interference of the twoopposite waves. Depending on the implementation, this situation may even result in adead lock situation in the classical model due to simultaneous occurrence of two events.

0.5 0.51 0.52 0.53 0.54 0.55 0.56 0.57 0.58time {s}

Figure 3: Magnified simulation snapshot of the force pulses per contact (top-to-bottom =left-to-right contact) in a 13-ball cradle with 3 balls left & 2 balls right lifted in initialposition showing interference of the two impact series resulting from the simultaneous

impacts.

4 An alternative approach: continuous model

4.1 Finite transfer and finite propagation

Obviously, the above assumptions were made in the classical model to be able to analysetextbook style problems with bouncing rigid bodies like Newton’s cradle analytically.By contrast, in dynamic systems simulation these assumptions destroy the commonapproach of locally connecting ideal phenomena in a network and fully tracing theenergetic processes. The effect of the first two assumptions of the classical approachmay be relaxed rather easily while at the same time restoring the local connection ofphenomena. This is achieved by the introduction of some contact elasticity of theobjects, which may easily be extended with some damping in order to make the resultsmore realistic. In this way, the momentum exchange is not instantaneous, but is

Proc. of Mechatronics 2002, University of Twente, 24-26 June 2002

described by the process of converting kinetic energy into potential energy vice versa. Inthis conceptual approach a major part of the global bookkeeping is done locally by thebalance equations in line with the modelling credo: ‘let the physics do the bookkeepingas much as possible’. Naturally, this will lead in many cases to rather stiff systems suchthat common fixed-step integration techniques would not only require quite somesimulation time, but also introduce some inaccuracy in cases with little damping.However, modern variable-step methods like the BDF method or VODE ADAMS,combined with fast implementations like in 20-sim result in simulations of realisticmodels of Newton’s cradle that can be performed several times faster than real-time, alsodue to the fact that the system model is only stiff during the short moment of the impact,but not in between. Furthermore, it cannot be mentioned sufficiently that this approach ismainly focussed on creating a competent model efficiently, not in describing all conceptsthat have a physical interpretation in the numerically most accurate way. For instance,this means that the parameter(s) characterizing the C-type element that describes theelasticity of the contact do(es) not need to be the parameter(s) that follow(s) from theelasticity and configuration of the material, but may be chosen such that the totalbehaviour of the model is competently described.

4.2 SequencingThe third assumption should also be satisfied by this approach, as finite propagationshould induce sequencing in principle. However, it appears that in a model with linearcontact elasticity (C-type element is a spring according to Hooke’s law) the forceimpulses generated by the impacts are strongly overlapping. It also appears thatchanging the stiffness of the contact not only shortens duration of the individual eventsand increases the amplitude of the impulse in such a way that the area remains constant,but also shortens the time scale of the events in such a way that the shape resulting fromthe overlap remains the same. It was also checked that the accuracy of the numericalintegration did not cause this overlap. There are several ways to achieve realisticsequencing. A simple and reliable way to achieve separation of the impulses is creating a‘dead band’ in the constitutive relation of the spring. An alternative way to achieve thisseparation is changing the order of the constitutive relation of the spring. A quadraticspring still exhibits considerable overlap, but in third and higher order relations theoverlap is reduced to a level in which the separation is almost ideal. Note that theHertzian contact theory requires a constitutive relation of order 3/2 that still results in anamount of overlap that generates unrealistic simulation results. Another disadvantage ofthe Hertzian relation is that a square root has to be computed due to the non-integerpower (3/2) which results in numerical load and inaccuracy. For this reason it is advisedto use only integer powers of the displacement and to compute them by plainmultiplication instead of using the power operator ‘ ^ ’, e.g. replace ‘x^3’ by ‘x*x*x’.Nevertheless, it does have in common with all other relations with order higher than onethat it is continuous in the derivative when the contact occurs, i.e. upon switching theX0-junction on. By contrast, the linear relation is discontinuous in the derivative.

0 2 4 6 8 10time {s}

Figure 4: Dynamicsimulation (continuous!) ofthe 5-ball cradle: macro-view (10 sec.) at the forcepulses in the 4 contacts thatappear merely assimultaneous spikes in thisview (cf. Figure 5)

Proc. of Mechatronics 2002, University of Twente, 24-26 June 2002

Although the behaviour that results from overlapping results in an alternativemomentum distribution, it may still be realistic. Experiments with a real Newton’s cradleshow that some momentum is transferred to the balls that are supposed to remain at restafter an ideal sequence of impacts. This means that a modeller can use the width of thedead band or the order of the constitutive relation as parameters to control the overlap inhis model in such a way as to achieve realistic behaviour.

0.702481 0.702482 0.702482 0.702482 0.702482 0.702482time {s}

Figure 5: Micro-view of the force pulses in the first impact sequence in Figure 4; twocases starting from the initial condition shown in Figure 1 (2 left balls lifted): 1) withouta dead band; 2) with a small dead band, sufficient to obtain the required separation (cf.Table 1). The force pulses in the contacts 1-2, 2-3, 3-4 and 4-5 respectively are shown

from top to bottom as a function of time (note the short time interval).

state: | ball: 1 2 3 4 5begin moving moving stopped stopped stoppedintermediate 1 moving stopped moving stopped stoppedintermediate 2 stopped moving stopped moving stoppedintermediate 3 stopped stopped moving stopped movingend stopped stopped stopped moving moving

Table 1: ‘State diagram’ resulting from the transitions during one impact generated bythe force pulses (momentum exchanges) in the contacts corresponding to figure 5.

Note that an accurate description of the shape of the impulse is usually not required, asthe reason that the pulses are finite is merely to prevent the problems with the hybridmodels discussed previously and not to get insight in the dynamics at this time scale. Theprice to be paid is that the two-time-scale model may become numerically quite stiff.Notwithstanding, almost all simulation experiments with this kind of model of Newton’scradle could be performed faster than real-time, provided that the simulated plot was sentto the screen after simulation in order to prevent the simulation process being sloweddown by heavy graphical IO. No physical damping was assumed to create numericallychallenging cases and the numerical dissipation was kept extremely low by setting theerror bounds of the variable step integration routines (BDF and VODE Adams) quitetight. Nevertheless, if the solution does not have to be extremely accurate, modern

no dead band: overlap small dead band:

desired sequencing

Proc. of Mechatronics 2002, University of Twente, 24-26 June 2002

hardware even allows that simple explicit fixed step methods like RK4 provide anacceptable solution, due to the increasing speed of the modern hardware.

4.3 Simulation experiments

Some simulation results (Figures 3 to 6) are shown to give an impression of the impulsesequencing that can be achieved (cf. captions). The competence of the model inmimicking the Newton cradle is best illustrated by animations that should be run by theuser and can be obtained from URL: http://www.ce.utwente.nl/. A free viewer can beobtained from URL: http://www.20sim.com.

0 5 10 15 20 25 30time {s}

Figure 6: Ball positions (left to right = top to bottom) of the simulation in figures 4 & 5during 30 seconds. After 240 seconds the increasing amplitude of the oscillation of the

middle ball is only 10-4 of the amplitude of the other balls (not visible during animation).

5 Context dependence of competent models

Obviously, the paper does not claim to give the most competent model for the simulationof colliding objects. This would truly be impossible as some particular problem contextalways determines the modelling choices. Therefore, the paper merely focuses onpresenting some conceptual and numerical issues that are involved when simulatingbouncing objects and may dramatically improve both model implementation speed aswell as simulation speed and accuracy. This implies that versatile submodels to be usedin the modelling of impacts should be adaptable to the situation by the modeller. Herein,it was shown that a non-logistic approach leads to a model that is conceptually muchsimpler, can be made more realistic even in each of the two extreme cases and requires aless complex numerical approach. The fact that during short periods of the total timescale, viz. during the impacts, the model turns into a quite stiff model requiring manynumerical steps to solve accurately is often called as a potential disadvantage of thisapproach. However, simulations with the full Newton cradle model demonstrate that this‘disadvantage’ has almost no negative effect.

Numerically challenging simulations of the model of this system without any dampingand quite small absolute and relative error bounds still run considerably faster than realtime even on Windows-based PC’s of not even the newest generation. Accurate CPU-time measurements have not been documented as the simulations were performed with

Proc. of Mechatronics 2002, University of Twente, 24-26 June 2002

non-reproducible CPU time. Nevertheless, the computation of for instance 10 minutesreal time of the behaviour of the Newton cradle with about 600 periods and with 2400impacts only took a couple of minutes. The results are such that realistic real-time 3Danimation can be performed afterwards.

6 Conclusion

An alternative approach to the modelling of colliding objects was proposed in a port-based or ‘object-oriented’ approach. It was emphasised that without a specific problemcontext, no statement about model competence can be made. Merely the realisability(implementability) of certain modelling concepts is discussed. The use of finite versusinfinitely short propagation and exchange times highly improves the efficiency of themodelling process despite the stiff, two-time scale model that results. The continuous,finite model also has some characteristics that similar physical realisations display, whilethe hybrid model cannot generate these characteristics. An important new insight wasthat the impact force ‘impulses’ that are the results of a collision and should be properlysequenced to approximate the ideal Newton cradle behaviour, have a shape that dependsneither on the contact stiffness nor on the accuracy settings of the numerical integrationtechnique, but purely on the shape of the constitutive relation between force anddisplacement. This C-type relation is introduced to model the short storage of elasticenergy during an impact. The required shape may be obtained either by introducing adead band or by increasing the order of the relation.

References

Arnolds, H. Rehbein, C. Roberts, G. Levis, R.J. King, D.A. (2000), ‘Femtosecond near-infrared laser desorption of multilayer benzene on pt{111}: a molecular newton'scradle?’, J. Phys. Chem. B 104, pp.3375-3382.

Breedveld, P.C. and Amerongen, J. van (1994), ‘Dynamic systems: Bond graphmodeling and simulation’, part 1 - 4, Dutch Open University, Heerlen, ISBN 90358 1302 2 (series, in Dutch, revised English translation to appear in 2002).

Breedveld, P.C. (1996), ‘The context-dependent trade-off between conceptual andcomputational complexity illustrated by the modeling and simulation of collidingobjects, Proc. Computational Engineering in Systems Applications ‘96IMACS/IEEE-SMC Multiconf., July 9-12, Lille, France, P. Borne et al. (eds.), LatePapers Volume, pp. 48-54.

Mosterman, P.J. and Biswas, G. (1997), ‘Formal specifications from hybrid bond graphmodels,’ in Proceedings of the Eleventh International Workshop on QualitativeReasoning, pp. 131-142, June 3-6, Tuscany, Italy.

Proc. of Mechatronics 2002, University of Twente, 24-26 June 2002