Exercise 2: Add Systems from the Systems/Assembly Panel
In this tutorial you will learn how to instantiate a system from the MotionView graphical interface using the Systems/Assembly panel.
- Add another pendulum link to the double pendulum model (from Exercise 1: Create and Use System Definitions) and create the triple pendulum shown in Figure 1.
- Solve and view the animation.
Add the System Definition from MotionView
In this step you will learn how to add system definitions to a model from MotionView.
- Start a new MotionView session and open the pendulum model from Exercise 1: Create and Use System Definitions in the MBD modeling window.
- In the Project Browser, click on Model.
- In the Systems/Assembly panel, click the Import/Export tab.
- Click the (file browser) and select the sys_pendu.mdl system you just created.
-
Click Import.
- In the dialog, under Select a definition, click sys_def_pendulum. Specify the Label as Third Pendulum System and the Variable as system3.
- Click OK.
Resolve Attachments and Update Points
In this step, you will use the MotionView graphical user interface to resolve attachments and update points in your model.
-
In the Project Browser, select the newly added
system.
In the Attachments tab for the system, the *Attachments() line is added to the system definition.
-
Attach the third pendulum link to the second link in the pendulum system.
- From the Attachments tab, double-click the collector for Attachment body.
- In the dialog, expand the folders Pendulum Body. Then click OK. and select
- Double-click the collector Pivot Point.
-
In the dialog, expand the folders Pendulum CM point. Then
click OK.
and select the You should see the third pendulum system in the modeling window.
- Save the model as triplependulum.mdl for future use.
-
Run MotionSolve and view the results.
Important: Definitions need to be independent, therefore a *DefineXXX block should not contain another *DefineXXX block within them. The left side of Figure 5 shows a *Define block inside another *Define block. Such definitions are referred to as nested definitions and may result in MotionView giving errors while reading such definitions. The right side of Figure 5 shows the correct way of placing definitions.In Exercise 1: Create and Use System Definitions, you authored a system definition by modifying an existing model MDL, in other words replacing *BeginMDL() and *EndMDL() with *DefineSystem() and *EndDefine(). While you can employ this method in many cases, take care that any existing definition block within the *BeginMDL block does not end up being nested. You must move such definition blocks out so the blocks are independent with regard to each other.