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.
This domain example is an informational resource made freely available by Wolfram Research.
Use of This Example
- You may not use this example for any purpose that is unlawful or dangerous.
- You assume total responsibility and risk for your use of this example.
- You may not present this example with any alteration to its trade dress, trademarks, or design.
License
All content in this bundle is licensed under the Creative Commons Attribution-NonCommercial-ShareAlike 3.0 Unported License. By accessing the content or using it in any way, you accept and agree to be bound by the terms of this license. If you do not agree to these Terms of Use, you may not use this content. Wolfram Research reserves the right to change, modify, add to, or remove portions of these Terms of Use at any time without notice. Please refer back to www.wolfram.com for the latest Terms of Use.
A summary of the licensing terms can be found at:
http://creativecommons.org/licenses/by-nc-sa/3.0
The full legal code can be found at:
http://creativecommons.org/licenses/by-nc-sa/3.0/legalcode