WOLFRAM SYSTEM MODELER

NewtonsCradle

Placeholder for the NewtonsCradle example model, available on the Wolfram SystemModeler website.

Wolfram Language

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

Information

 
 

Library Dependency

This is a placeholder model. It 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.

The following documentation is taken from the main example of the downloadable model. Once you have downloaded all the model dependencies, the model can be downloaded here.

Newton's Cradle

 

Introduction

This model shows the Newton's Cradle experiment.

 

Dynamics

The cradle is modeled using the PlanarMechanics Modelica library. 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 a 22.5 degree angle, 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.

 

Simulation

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 in the top-right corner.
  • When the build has finished and simulation has completed, click the Animation button in the toolbar.
  • 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 to play the animation.

Plot the Results

Explore how the energy is conserved in the system by plotting the totalKineticEnergy, totalPotentialEnergy, and totalEnergy variables.

The variables will be plotted directly when simulating the model.

You should now see the following graph:

Also try plotting the Contact and AngleVelocityAcceleration plots. Do this by double clicking the plot in the Stored Plots section.

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.