-
To prepare the generated model for testing, do the following:
Usually generated components are just components. They have to be connected to be
tested. Below is a simple example to fix the cylinder before simulating it.
-
In MyGeneratedModels, create a new model
TestMyGeneratedCylinder. See Create a New Class or Extend from an Existing Class Using the New Class Command.
-
Instantiate MyGeneratedCylinder by dragging it into the
TestMyGeneratedCylinder model.
Note:
Make sure you drag the right model, do not drag the locked one.
-
Drag Modelica.Mechanics.MultiBody.World into
TestMyGeneratedCylinder.
-
Connect the World component to the main axis frame of the
MyGeneratedCylinder component.
-
Change the direction of gravity to the negative z axis by changing the parameter
n of the World component.
The MyGeneratedCylinder model is now connected to a
simple "test rig" to test it. Notes:
- The structure of libraries is often more elaborate, for example, it is common to
have a separate library for some generated models, and another library for the use
of them in customer models.
- It is useful to look at the diagram of the generated model. Components with mass
equal to zero, but volume not null, are marked by red on the diagram.
-
Simulate the model. See Simulating a Behavior.
Considering the mass, inertia, and joints, the result is computed and the
corresponding 3D appears.
|