WOLFRAM SYSTEM MODELER

Newton's cradle example setup using PlanarMechanics

# 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:

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:

#### 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 Value: 0 Type: TranslationalDampingConstant (N⋅s/m) Description: Impact friction 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 Type: Fixed Description: Frame fixed in the planar world frame at a given position and orientation Type: Fixed Description: Frame fixed in the planar world frame at a given position and orientation Type: Fixed Description: Frame fixed in the planar world frame at a given position and orientation Type: Fixed Description: Frame fixed in the planar world frame at a given position and orientation Type: Fixed Description: Frame fixed in the planar world frame at a given position and orientation Type: Revolute Description: A revolute joint Type: Revolute Description: A revolute joint Type: Revolute Description: A revolute joint Type: Revolute Description: A revolute joint Type: Revolute Description: A revolute joint Type: FixedTranslation Description: A fixed translation between two components (rigid rod) Type: FixedTranslation Description: A fixed translation between two components (rigid rod) Type: FixedTranslation Description: A fixed translation between two components (rigid rod) Type: FixedTranslation Description: A fixed translation between two components (rigid rod) Type: FixedTranslation Description: A fixed translation between two components (rigid rod) Type: Ball Description: PlanarMechanics body with eqations for potential and kinetic energy calculations Type: Ball Description: PlanarMechanics body with eqations for potential and kinetic energy calculations Type: Ball Description: PlanarMechanics body with eqations for potential and kinetic energy calculations Type: Ball Description: PlanarMechanics body with eqations for potential and kinetic energy calculations Type: Ball Description: PlanarMechanics body with eqations for potential and kinetic energy calculations Type: Collision Description: Collision model for two colliding masses Type: Collision Description: Collision model for two colliding masses Type: Collision Description: Collision model for two colliding masses Type: Collision Description: Collision model for two colliding masses