WOLFRAM SYSTEM MODELER

NewtonsCradleModel

Newton's cradle example setup using PlanarMechanics

Diagram

Wolfram Language

In[1]:=
SystemModel["EducationExamples.Physics.NewtonsCradle.NewtonsCradleModel"]
Out[1]:=

Information

Library Dependency

This model requires the PlanarMechanics library.

  • The free PlanarMechanics library was created especially for modeling multibody systems with two-dimensional mechanical components. Compared to the MultiBody library, currently available in the Modelica Standard Library, it is simpler to use and it is more optimized to planar modeling. Planar models of mechanical systems are useful in many different applications, for example, in contact problems that are more easily modeled in 2D than in 3D.

Model

This model shows the Newton's Cradle experiment.

Five spheres are connected to a revolute joint through a stiff rod and hung next to each other. One of the spheres is released at an angle of 80 degrees, and gravity will pull it downward in a swinging motion, which will lead the sphere to collide with the adjacent sphere.

The collision between the spheres is modeled as a spring with a gap.

Automatic 3D Animation

Multibody and PlanarMechanics systems have visualizers to show what a real-world system would look like.

To show a 3D animation of the model, follow the steps below:

Click the Simulate button:

Click the Animation button: animate

Use your mouse or trackpad to drag the animation to a good angle and zoom in with your scroll wheel or by using the trackpad. Then click the Play button: play

Plot the Results

Explore how the energy is conserved in the system. When first simulating the model, you will see the following plot:

Also try plotting the Ball Positions plot to see a parametric plot of the ball trajectories, or the All Energy Types to see how kinetic energy is temporaraly stored as elastic energy during collisions.

Change Parameters

Changing parameters for the simulation can be done rapidly in Simulation Center. The impactd parameter describes the energy that is lost due to friction when the balls collide with each other. The default value for this parameter is 0, which means that no energy is lost due to collisions.

Try changing the impactd parameter to see how it affects the system:

  • Switch to the Parameter tab on the left in the Experiment Browser.
  • Scroll down to the impactd parameter and change its value to 1000 by typing into the box to the right of the parameter.
  • Simulate again by following the steps in the Automatic 3D Animation and Plot sections to see the effects of your changes.

Also try changing the impactc parameter to make collisions more or less stiff, or change the phi0 to change the initial angle of the ball.

Parameters (3)

impactc

Value: 1e8

Type: TranslationalSpringConstant (N/m)

Description: Impact stiffness

impactd

Value: 0

Type: TranslationalDampingConstant (N⋅s/m)

Description: Impact friction

phi0

Value: 1.39626340159546

Type: Angle (rad)

Description: Initial angle of ball 1

Components (25)

planarWorld

Type: PlanarWorld

Description: Planar world coordinate system + gravity field + default animation definition

fixed1

Type: Fixed

Description: Frame fixed in the planar world frame at a given position and orientation

fixed2

Type: Fixed

Description: Frame fixed in the planar world frame at a given position and orientation

fixed3

Type: Fixed

Description: Frame fixed in the planar world frame at a given position and orientation

fixed4

Type: Fixed

Description: Frame fixed in the planar world frame at a given position and orientation

fixed5

Type: Fixed

Description: Frame fixed in the planar world frame at a given position and orientation

revolute1

Type: Revolute

Description: A revolute joint

revolute2

Type: Revolute

Description: A revolute joint

revolute3

Type: Revolute

Description: A revolute joint

revolute4

Type: Revolute

Description: A revolute joint

revolute5

Type: Revolute

Description: A revolute joint

rope1

Type: FixedTranslation

Description: A fixed translation between two components (rigid rod)

rope2

Type: FixedTranslation

Description: A fixed translation between two components (rigid rod)

rope3

Type: FixedTranslation

Description: A fixed translation between two components (rigid rod)

rope4

Type: FixedTranslation

Description: A fixed translation between two components (rigid rod)

rope5

Type: FixedTranslation

Description: A fixed translation between two components (rigid rod)

ball1

Type: Ball

Description: PlanarMechanics body with eqations for potential and kinetic energy calculations

ball2

Type: Ball

Description: PlanarMechanics body with eqations for potential and kinetic energy calculations

ball3

Type: Ball

Description: PlanarMechanics body with eqations for potential and kinetic energy calculations

ball4

Type: Ball

Description: PlanarMechanics body with eqations for potential and kinetic energy calculations

ball5

Type: Ball

Description: PlanarMechanics body with eqations for potential and kinetic energy calculations

collision1_2

Type: Collision

Description: Collision model for two colliding masses

collision2_3

Type: Collision

Description: Collision model for two colliding masses

collision3_4

Type: Collision

Description: Collision model for two colliding masses

collision4_5

Type: Collision

Description: Collision model for two colliding masses