WOLFRAM SYSTEM MODELER

BouncingBalls2D

Bouncing balls in 2D with collision detection

Wolfram Language

In[1]:=
SystemModel["EducationExamples.Physics.BouncingBalls.BouncingBalls2D"]
Out[1]:=

Information

 

Bouncing Balls: Handle Events and Discontinuities

 

Introduction

A ball is dropped from a given height h, dropping onto a hard surface, and bouncing back according to the restitution coefficient e. This example shows the event handling capabilities of SystemModeler.

In order to get the full experience of this example, you need the following:

 

These pages show an overview of the example. For the full example, open the accompanying notebook BouncingBalls.nb.

View the model text for this model.

 

Analysis

Simulate with a large number of different initial heights h the ball is dropped from and show the bounces of the ball.

height

Varying the coefficient of restitution or the gravity shows different behavior.

restitutiongravity

Also see the balls bouncing in a 2D space in BouncingBalls2D.

 

Parameters (5)

g

Value: 9.81

Type: Real

Description: gravity acceleration

nr

Value: 5

Type: Integer

Description: number of balls

aInit

Value: zeros(nr, 2)

Type: Real[nr,2]

Description: initial acceleration

wallx

Value: 6

Type: Real

Description: distance along the x-axis to the wall from the center

wally

Value: 10

Type: Real

Description: distance along the y-axis to the wall from the center