The double pendulum is a simple multibody system. It contains two links and a pivot mount that connect with joints. This system is nonlinear and does under certain conditions exhibit chaos. In this example, you assemble a double pendulum using custom blocks for the links and the pivot mount. You can later use this model to study the chaotic motion of a double pendulum.
To model the double pendulum, you represent each physical component and constraint using a Simscape™ Multibody™ block. The double pendulum system contains three rigid bodies—one pivot mount and two binary links— that connect in series through a pair of revolute joints. You represent the pivot mount and the binary links using the custom library blocks that you created in previous examples. You represent the two joints using two Revolute Joint blocks from the Joints library.
You can guide model assembly. By specifying joint state targets, you can instruct Simscape Multibody to assemble a joint in the configuration you want. State targets that you can specify include position and velocity. At times, a state target may conflict with other state targets, or even with other kinematic constraints in the model. In these cases, you can prioritize the most important state targets by assigning them a high priority level. During assembly, if two targets conflict with each other, Simscape Multibody assembles the high priority target first. To specify both state target values and priority levels, you use the State Targets menu of the joint block dialog boxes.
Start a new model.
Drag these blocks into the model. The two Revolute Joint blocks provide the double pendulum two rotational degrees of freedom.
At the MATLAB® command prompt, enter
A custom block library with the same name opens up.
Drag these custom blocks into the model. Each block represents a rigid body in the double pendulum. See the tutorials in the table for detailed instructions on how to create the blocks.
|Binary Link A||2|
Connect the blocks as shown in the figure.
In the Revolute Joint block dialog boxes, select State Targets > Specify Position Target. You can now specify the desired starting positions of the two joints.
In Value, enter these joint angles.
|Block Name||Value (degrees)|
To visualize the model, update the block diagram. You can do this from the menu bar by selecting Simulation > Update Diagram. Mechanics Explorer opens with a 3-D view of the double pendulum assembly. Click the isometric view button to obtain the perspective in the figure.
To check the assembly status of the revolute joints, use the Model Report utility. You can open this utility from the Mechanics Explorer menu bar by selecting Tools > Model Report. The figure shows the assembly information for the double pendulum.
Run the simulation, e.g., by selecting Simulation > Run. Mechanics Explorer shows a 3-D animation of the double pendulum assembly. The assembly moves due to gravity, specified in the Mechanism Configuration block.
To see a complete model of the double pendulum assembly, at the MATLAB command prompt enter: