MotionView 2017 Tutorials PDF
MotionView 2017 Tutorials PDF
MotionView
Tutorials
Special Notice: Pre-release versions of Altair software are provided as is, without warranty of any
kind. Usage is strictly limited to non-production purposes.
The Altair web site is a valuable online companion to Altair software. Visit www.altairhyperworks.com
for tips and tricks, training course schedules, training/tutorial videos, and other useful information.
Altair training courses provide a hands-on introduction to our products, focusing on overall
functionality. Courses are conducted at our main and regional offices or at your facility. If you are
interested in training at your facility, please contact your account manager for more details. If you do
not know who your account manager is, please send an e-mail to [email protected] and your account
manager will contact you.
When contacting Altair support, please specify the product and version number you are using along
with a detailed description of the problem. Many times, it is very beneficial for the support engineer to
know what type of workstation, operating system, RAM, and graphics board you have, so please have
that information ready. If you send an e-mail, please specify the workstation type, operating system,
RAM, and graphics board information in the e-mail.
To contact an Altair support representative, reference the following table or the information available
on the HyperWorks website:
http://www.altairhyperworks.com/ClientCenterHWSupportProduct.aspx
For questions or comments about this help system, send an email to [email protected].
In addition, the following countries have resellers for Altair Engineering: Colombia, Czech Republic,
Ecuador, Israel, Russia, Netherlands, Turkey, Poland, Singapore, Vietnam, Indonesia
Official offices with resellers: Canada, China, France, Germany, India, Malaysia, Italy, Japan, Korea,
Spain, Taiwan, United Kingdom, USA
See www.altair.com for complete contact information.
MotionView Tutorials
Introduction
..........................................................................................................................3
Interactive
..........................................................................................................................33
MV-1011: Extension and Retraction Analysis of the Main Landing Gear of an Aircraft
........................................................................................................................................................84
Animation
..........................................................................................................................94
Plotting
..........................................................................................................................106
Contact Simulation
..........................................................................................................................168
MV-2040: Load Estimation for a Fore Canard Actuator Mechanism under Aero-dynamic
........................................................................................................................................................269
Loads
Automated
..........................................................................................................................294
Optimization-DOE-Stochastics
..........................................................................................................................323
Durability - Fatigue
..........................................................................................................................351
Advanced Simulation
..........................................................................................................................408
MV-7003: Simulating a Single Input Single Output (SISO) Control System Using
........................................................................................................................................................529
MotionView and MotionSolve
MV-7004: Inverted Pendulum Control Using MotionSolve and MATLAB
........................................................................................................................................................533
Introduction
Interactive
Animation
Plotting
Contact Simulation
Automated
Optimization-DOE-Stochastics
Durability Fatigue
Advanced Simulation
1. To access model files, visit Altair Connect or the Altair Client Center.
A user ID and password are required to access the model files. Follow the instructions at the
website to obtain login credentials.
2. Select the required file package and download it onto your system.
Note that the files may require unzipping before proceeding with the tutorials. When extracting
zipped files, preserve any directory structure included in the file package.
It is recommended that you complete the HWD-0010: HyperWorks Desktop Environment tutorial (in
order to familiarize yourself with the HyperWorks Desktop graphical user interface) prior to going
through the exercises in these tutorials.
Invoking MotionView:
In Windows - go through the Start Menu (Start Menu > Programs > Altair HyperWorks
installation > MotionView).
OR
MotionView is one of the clients that reside under the HyperWorks Desktop (HWD) framework. The
framework provides a common layout for all clients. Other clients that are available under this
framework are: Hypermesh, HyperView, HyperGraph 2D, HyperGraph 3D, MediaView, TextView, and
TableView. The client is selected, or changed, using the Client selector drop-down menu:
The HWD graphical user interface can be broadly categorized into six segments:
Main Menu
The Main menu bar includes all functionalities that are available through the various toolbars.
Additionally, the Main menu contains other useful utilities like FlexPrep, Import CAD/FEM, Macros,
etc.
Note - The Main menu varies between the different clients of HyperWorks Desktop.
The following table summarizes the functionalities available in the Main menu of MotionView:
File Provides options to manage The same options are available through
files (Creating new models, HWD Standard Toolbar also.
Opening and Saving models/
Sessions, Importing and
Exporting a Solver Deck,
etc.).
Assembly Wizard
Attachment Wizard
Implicit Graphics
Data Summary
Topology Summary
Task Wizard
View Reports
Tools Provides you with access to Check Model Available in Run panel.
various tools and special
utilities: Import CAD or Fem Available in
the Main menu (File > Import >
Check Model Import Geometry) and also in the
Import CAD or FE
CG/Inertia Summary
Custom Wizards
Reports
Templex Functions
Options
Toolbars provide quick access to commonly used features. HyperWorks Desktop toolbars are
static and will not change, regardless of which application is active. Some of the toolbars
become inactive when different clients are selected. In the table below, all of the HWD toolbars
are introduced. Please be sure to note the toolbars that are not applicable to the MotionView
client.
Note - To navigate
through different pages of
a session, use the
Previous Page or
Note - Please refer to the Hyperworks Desktop Users Guide > Graphical User Interface >
Toolbars topic for a detailed explanation of each toolbar listed above.
Client specific toolbars provide access to options required for pre- or post-processing of FEA/MBD
models. MotionView has a set of toolbars for building an MBD model. Each MotionView toolbar group
provides access to entities with similar characteristics. For example, all entity such as Joints and
Motions are grouped in the Constraint toolbar. The table below shows MotionView toolbars with a
brief explanation of their usage.
A left click on an entity icon sets the filter to select that particular entity from the graphic screen,
while a right-click on a toolbar icon enables adding that entity to the model (see the Points
example below):
Tab Area
The tab area docks different browsers, the purpose of the browsers is to navigate through the
hierarchy tree and execute some operations specific to the selected items. Available for all clients
is the Session Browser, which allows you to browse to the different pages or windows in an HWD
session, as well as execute certain page and window operations. In addition to the Session
Browser, client specific browsers are shown based on the active window. For example, when the
MotionView is active client in the working window, the MotionView Project Browser is shown;
similarly, when HyperView is active, the Results Browser is shown. Specifically, the MotionView
Project Browser helps you browse/select different modeling entities, in addition to executing
certain modeling operations. Other browsers include the Organize Browser (used for data
management and collaboration) and the Process Manager (used for process automation). Please
refer to the client specific online help regarding the available browsers. Finally, browsers can be
placed on either side of the graphic window (Left/Right/Both) through the Menu bar by using the
View > Tab Area menu options.
A left mouse click on an entity in the Project Browser selects that entity and the details of entity
are displayed in the Panel area (see the example below):
A right click on an object brings up a context menu with options that are relevant to the selected
object.
Similarly, a right mouse click on the Model (the topmost folder in the browser hierarchy) displays
up a context menu with options useful in model building.
Below the client specific toolbar is the panel area where you can view and modify the various
values and properties of a selected entity. Panels may have several tabs which organize the
various properties and values of the entity type selected. For example, the Spring Damper panel
has the connectivity information and properties displayed in three tabs (as shown below):
Connectivity tab: Allows you to specify the type of spring, the bodies to attach, and the
attachment points.
Properties tab: Allows you to set the stiffness and damping properties of a spring.
Preload tab: Allows you to set a 'preload' on a spring by specifying a force value or spring free
length.
Graphics window is the model visualization area where you can interactively work on the model.
The following table illustrates the various mouse clicks available for model visualization:
Operation Action
Left click on an entity like a Point, Selection (the selected entity is highlighted by
Graphic, etc. (while the Entity Selector a white boarder around it).
and an entity icon is depressed in the
toolbar).
Hold the left mouse button and move Displays the entity name on the mouse tooltip
over the model (while the Entity and selects the entity upon releasing mouse
Selector and an entity icon is depressed button.
in the toolbar).
Ctrl + Left mouse button Rotates the model (observe the mouse
tooltip).
Note - The items under the Main Menu, Browser, and Client specific toolbars differ from client to
client.
Exercise:
In this exercise you will learn to:
In Windows - go through the Start Menu (Start Menu > Programs > Altair HyperWorks
installation > MotionView).
In Mac - go through the Applications > Altair HyperWorks > installation version number >
MotionView
OR
OR
3. From the Open Model dialog, locate and select the model definition file
SingleCylinderEngine_model.mdl, located in your working directory.
4. Click Open.
The single cylinder engine model displays in the graphics window (fit to the window).
5. Upon successful loading of a model into MotionView, the status bar will display the Ready message
(in the lower left corner of the screen). The Project Browser lists all of the entities in the model.
Click on the Expand /Collapse button of each entity (Bodies, Points, Joints, Motions,
etc.) to browse through the entities. Use the mouse controls in the graphics area to rotate, pan,
and zoom the model.
6. Expand the Bodies folder in Project Browser by clicking on the next to Bodies (
).
Note Each entity will have a label and a unique variable name. For example, the crank shaft
body has a label of CRANK_SHAFT and a variable name of b_CRANKSHAFT.
The corresponding entity panel (Bodies in this case) is displayed in the bottom of the window.
8. From the Properties tab, observe the Mass and Inertia properties of the body.
The Origin point defines the body CG location and the orientation is defined with respect to global
reference frame using direction cosines DxDyDz.
1. Left click the Motion icon on the Constraint toolbar to change the graphical selection to a
motion entity. Move the cursor in the graphics area with left mouse button pressed to identify
the motion CrankShaft Rotation and release the mouse button to select it.
OR
Browse to the Motions entity in Project Browser and click on next to Motions and select
CrankShaft Rotation.
Note Implicit graphics are displayed for all applicable entities, allowing you to visualize their
location and orientation. See the MotionView Users Guide for details about controlling
the visualization of implicit graphics.
Note You can also click the Save Model icon, , on the Standard toolbar to the save the
file in working directory with the existing name. If the model is new, you will be
prompted to input the name of the model.
3. Click Save.
Upon clicking Run, MotionSolve is invoked and solves the model. The HyperWorks Solver View
window appears which shows the progress of the solution along with messages from the solver
(Run log). This log is also written to a file with the extension .log to the solver file base name.
Note Please note that the Add Page option adds a page with the current client (MotionView
in this case).
3. From the Load Model panel, click on the Select file icon next to Load model.
Note H3D is an Altair binary file for HyperView. The H3D file contains both model and results
data from a solver run. Please see the Appendix (below) for various use cases of H3D
files in MotionView/MotionSolve.
6. From the Animation toolbar, click the Start/Pause Animation button to animate the
results.
7. Rotate, pan, and zoom the model using the mouse controls for better visualization and
understanding of the results.
10. From the Page Controls toolbar, click the arrow next to the Page Window Layout button
and select the two window layout from the pop-up menu.
11. Click in the graphics area of second window in order to make it the active window.
HyperGraph 2D .
Note The Client selector displays the icon of the current client (HyperGraph in this case).
14. From the Build Plots panel, click the Open File icon, , next to Data file.
15. Browse to your working directory and select the MotionSolve results file
SingleCylinderEngine_model_10rad_per_sec.abf.
Note ABF is the Altair Binary File for HyperGraph. Other output files from MotionSolve (.mrf
and .plt) can also be used for reading results into HyperGraph.
21. Observe the top right corner of the page which displays the current page (2 of 2). Click on
Previous Page icon, or Next page icon, to navigate to page 1 (the MotionView model).
2. Browse to your working directory and specify the File name as mywork.mvw.
Note A session file saves the complete HWD data (the page, window, client, and results
information). Please refer to the Appendix below for details regarding the different types
of HyperWorks Desktop files.
3. Click Save.
Click Yes to the message asking if you would like to discard all of the current session data and
start new session.
3. Browse to your working directory and select the session file saved in previous step mywork.mvw.
5. Browse through the pages to look at the model, plots, and animation that you worked on during
Appendix
The following table summarizes the different file types in HWD and the location where the file can
be loaded and saved.
H3D is an Altair format for storing model and result information. In general, an H3D file is used for
post-processing results in HyperView; however the H3D file has a few other use cases in
MotionView/MotionSolve.
Graphic H3D File This type of H3D contains Model information only. A graphical H3D file
is an imported geometry into MotionView for visualization of a body.
Flexbody H3D File This type of H3D contains Model and Flexible body information.
Therefore, MotionView can use it as a graphic, as well as to represent
a deformable body by accessing the modes, mass, and inertia
information. HyperView can read it as both Model and Results, and
also animate the mode shapes, modal displacements, stresses, etc. (if
available).
Results H3D File This type of H3D is written by MotionSolve. It contains Model and
Results information. HyperView can read it as both Model and Results,
and also animate the position, deformation, stresses, forces, etc.
MV-1011: Extension and Retraction Analysis of the Main Landing Gear of an Aircraft
Multi Body Dynamics (MBD) is defined as the study of dynamics of a system of interconnected
bodies. A mechanism (MBD system) constitutes a set of links (bodies) connected (constrained) with
each other to perform a specified action under application of force or motion. The motion of
mechanisms is defined by its kinematic behavior. The dynamic behavior of a mechanism results from
the equilibrium of applied forces and the rate of the change of momentum.
MBD Modeling
A classical MBD formulation uses a rigid body modeling approach to model a mechanism. A rigid body is
defined as a body in which deformation is negligible.
In general, in order to solve an MBD problem, the solver requires following information:
C ar Trunk-Lid Mechanism
The trunk-lid shown in the image above uses a four-bar mechanism for its opening and closing
motions.
The four links (bodies) in four-bar mechanism are namely; Ground Body, Follower, Coupler, and Input
Link. In this example, the Ground Body is the car body and Input Link is the trunk-lid body. The
remaining two bodies (Follower and Coupler) form the part of the mechanism used to aid the opening
and closing of car trunk-lid.
Points
Bodies
Constraints (Joints)
Graphics
Input (Motion or Force)
Output
Copy trunk.hm and trunklid.hm, located in the mbd_modeling\interactive folder, to the <working
directory>.
From the Project Browser, right-click on Model and select Add > Reference Entity > Point
from the context menu.
OR
Note Other entities like Bodies, Markers, etc. can also be created using either of the methods
listed above (Project Browser or toolbar).
The label allows you to identify an entity in the graphical user interface, while the variable name
is used by MotionView to uniquely identify an entity.
Note When using the Add "Entity" dialog for any entity, you can use the label and variable
defaults. However as a best modeling practice, it is recommended that you provide
meaningful labels and variables for easy identification of the entities. For this exercise,
please follow the prescribed naming conventions.
5. Click OK.
The Points panel is displayed. Point A is highlighted in the Points list of the Project Browser.
The table below lists the coordinates of the points needed for this model:
Point Location
Label Variable X Y Z
Repeat steps 2 through 4 and click Apply to create points B through I. Remember to substitute
B, C, etc., for A when entering the label and variable names in the Add Point or PointPair
dialog. Clicking the Apply button allows you to continue to add points without exiting the Add
"Entity" dialog.
After keying in the label and variable name for Point I, click OK to close the dialog.
Click the Data Summary... button located in the upper right corner of the Points panel.
The Data Summary dialog shows the table of points and you can enter all the coordinates in
this table.
Expression Builder
Click Close.
8. Change the view to left, by clicking on the XZ Left Plane View icon on the Standard Views
toolbar.
3. Click OK.
The Bodies panel is displayed. The new body that you just added is highlighted in the model tree
of the Project Browser.
Mass = 1
Click the CM Coordinates tab to specify the location of the center of mass of the body.
A cyan border appears around the collector indicating that the collector is now active for
selection.
8. From the graphics area, select Point G on the model by using the left click of the mouse. While
selecting, keep the left mouse button pressed and move the cursor over the points to see the
label. Release the mouse button when Point G is located.
OR
Point G is selected as the origin of the center of mass marker for the input link.
Note - The above-mentioned methods for selecting a point can also be applied to other
entities such as: body, joint, etc. For selecting the Ground Body or the Global Origin,
you can click on the triad representing the Global Coordinate System on the screen
Retain the default orientation scheme (Orient two axes) and accept the default values for
.
Follower b_follower
Coupler b_coupler
10. Specify the mass and inertia for these links as:
Mass = 1
11. Specify points B and D as the origin of the center of mass marker for Follower and Coupler,
respectively.
12. Retain the default orientation (Global coordinate system) for the CM marker.
1. From the Project Browser, right-click on Model and select Add > Constraint > Joint from the
context menu.
OR
2. Specify the label as Follower-Ground and variable name as j_follower_ground for the new
joint.
4. Click OK.
The Joints panel is displayed. The new joint you added is highlighted in the model tree in the
Project Browser.
5. Under the Connectivity tab, double click the first Body collector .
7. Click OK.
Notice that in the Joints panel the Follower Body is selected for and the cyan border
moves to .
8. Click in the graphics window. With the left mouse button pressed move the cursor to the global
XYZ triad .
13. To specify an axis of rotation, under Alignment Axis, click the downward pointing arrow next to
Point and select Vector.
14. Specify the Global Y axis vector as the axis of rotation of the revolute joint.
15. Repeat steps 1 through 14 to create the three remaining revolute joints: points C, E, and F.
1. From the Project Browser, right-click on Model and select Add > Constraint > Motion from the
context menu.
OR
2. Specify the label as Motion_Expression and the variable name as mot_expr for the new motion.
3. Click OK.
The Motion panel is displayed. The new motion is highlighted in the model tree in the Project
Browser.
5. From the model tree, select the revolute joint at Point F (Input-Ground) that you created in the
previous step.
7. From the Properties tab, select Expression by clicking on the downward arrow next to Linear.
9. Click on the button to open the Expression Builder and enter following expression between
the back quotes `60d*sin(2*0.1*PI*TIME)`.
Note This method of creating an expression can also be used for specifying non-linear
properties for other entities like Force, Spring Damper, Bushing, etc.
Add a displacement output between two bodies using the default entities.
Add another output to record the displacement of a particular point G on the input link relative
to the global frame based on Expressions.
1. From the Project Browser, right-click on Model and select Add > General MDL Entity >
Output from the context menu.
OR
2. Specify the label as Input Link Displacement and the variable name as o_disp for the new
output.
For Body 1 and Body 2, select Input Link and Ground Body, respectively.
For Pt on Body 1 and Pt on Body 2, select point I and the Global Origin point, respectively.
5. Add one more output with the label as Input Link CM Displacement and the variable name as
o_cm_disp to calculate the X displacement between the CM markers Input Link and the global
origin:
From the Properties tab, expand the following trees: Bodies/Input Link/Marker CM.
Select idstring.
From the Properties tab, expand the following items in the tree: Markers/Global Frame.
Select idstring.
6. Click OK.
7. To check for errors, go to the Tools menu and select Check Model. Any errors in your model
topology are listed in the Message Log.
The above function DX measures the distance between Input Links CM (center of mass) marker
and marker representing the Global Frame in the X direction of the Global Frame. Refer to the
MotionSolve Reference Guide for more details regarding the syntax and usage of this function.
In this step you will add graphics for visualization of a mechanism. MotionView graphics can be
broadly categorized into three types: implicit, explicit, and external graphics.
Implicit Graphics The small icons that you see in the MotionView interface when you
create entities like points, bodies, joints, etc. are called implicit
graphics. These are provided only for guidance during the model
building process and are not visible when animating simulations.
Explicit Graphics These graphics are represented in form of a tessellation, are written to
the solver deck and subsequently available in the results. Explicit
graphics are of two types.
Primitive Graphics These graphics help in better visualization of the model and are also
visible in the animation. The various types of Primitive Graphics in
MotionView are Cylinder, Box, Sphere, etc.
External Graphics One can import in various CAD formats or Hypermesh files into
MotionView. The Import CAD or FE.. utility in MotionView can be
used to convert a CAD model or a Hypermesh model to h3d graphic
format which can be imported into MotionView. One can also import .g,
ADAMS View .shl and wavefront .obj files directly into MotionView.
Note - Implicit graphics of Individual entities can be turned on or off by using the Visible
check box for each entity.
Click Close.
The state of the implicit graphics (whether on or off) is not saved in your model (.mdl) or
session (.mvw) files. MotionView uses its default settings when:
From the Project Browser, right click on Model and select Add > Reference Entity >
Graphic from the context menu.
OR
2. In the Add Cylinder or CylinderPair dialog, enter the label as Follower Cylinder and the
variable name as gcyl_follower.
Note The name of the dialog changes with the graphic type. For example, the dialog name
changes to Add Box or BoxPair when the Box graphic type is selected.
4. In the Connectivity tab, double-click the Body button below Parent. Select the
Follower from the Select a Body list and click OK.
Note The cylinder graphic can also be used to create a conical graphic. By default, the Radius
2 field is parameterized with respect to Radius 1, such that Radius 2 takes the same
value of Radius 1. Specify different radii to create a conical graphic.
10. For the remaining bodies in your model, follow steps 2 through 9 to create the appropriate explicit
graphics for other links.
Step 7: Add external graphics and convert a HyperMesh file to an H3D file.
MotionView has a conversion utility that allows you to generate detailed graphics for an MDL model
using HyperMesh, Catia, IGES, STL, VDAFS, ProE, or Unigraphics source files. MotionView uses
HyperMesh to perform the conversion.
In this step, you will use this conversion utility to convert a HyperMesh file of a car trunk lid into the
H3D format.
Or
2. Activate the Import CAD or Finite Element Model Only radio button.
4. Click the browser button next to Input File and select trunklid.hm, located in <working
directory>, as your input file.
The Output Graphic File field is automatically populated with the trunklid.h3d file from the
<working directory>.
The Import CAD or FE utility runs HyperMesh in the background to translate the HyperMesh file
into an H3D file.
Note The H3D file format is a neutral format in HyperWorks. It finds wide usage such as
graphics and result files. The graphic information is generally stored in a tessellated
form.
6. When the import is complete the Message Log appears with the message "Translating/
Importing the file suceeded!". Clear the Message Log.
7. Use steps 1 through 6 to import the trunk graphics by converting the trunk.hm file to trunk.h3d.
3. In the Connectivity tab, double click the Body collector under Parent. Select Input
Link from the Select a Body list.
Note Observe the change in the trunk lid graphic color to the Input Link body color.
5. Similarly, select the newly created g_trunk graphic from the Project Browser and set the
as Ground Body.
If the model is new you will be prompted to input the name of the model, otherwise the model will
be saved in the working directory with the existing name.
Note Existing models can be saved to another file using the Save As > Model option located
in the File menu.
7. From the Save As Model dialog, browse to your working directory and specify the File name: as
trunklid_mechanism.mdl.
Trunk-lid mechanism
In this step, you will use MotionSolve to perform a kinematic simulation of the mechanism for a
simulation time of 5 seconds, with a step size of 0.01 second.
2. Click on the Check Model button on the Model Check toolbar to check the model for errors.
3. From the Main tab of the Run panel, specify Transient as the Simulation type.
4. In the field located to the right of the Save and run current model option, specify the name for
the XML file as trunklid_mechanism_run.
MotionView uses the base name of your XML file for other result files generated by MotionSolve.
See the MotionView Users Guide for details about the different result file types.
6. Specify an End time of 5 for your simulation and a Print interval of 0.01 (the time unit is
second by default).
Note - You can access the Units form from the Forms panel, .
7. Click the Run button located on the right side of the panel to solve the model using MotionSolve.
Upon clicking Run, MotionSolve is invoked and solves the model. The HyperWorks Solver View
window appears which shows the progress of the solution along with messages from the solver
(Run log). This log is also written to a file with the extension .log to the solver file base name.
9. Review the window for solution information and be sure to watch for any warnings/errors.
Step 10: View animation and plot results on the same page.
Once the run is successfully complete, both the Animate and Plot buttons are active.
This opens HyperView in another window and loads the animation in that window.
2. To start the animation, click the Start/Stop Animation icon, , on the toolbar.
3. To stop/pause the animation, click the Start/Stop Animation icon again, , on the toolbar.
This opens HyperGraph and loads the results file in a new window.
Y Component DM (Magnitude)
8. Click Apply.
This plots the magnitude of the displacement of Point I relative to the Global Origin.
3. Click Save.
Appendix
Real
This type of field can contain a real number or the parametric expression that should evaluate to
a real number. This type of field is found in Points, Bodies , Force Linear. Note that only the
value of the expression as evaluated goes into the solver deck and not the parametric equation.
String
This type of field can contain a string or a parametric expression that should evaluate to a
string. This type of field is found in entity such as DataSets with strings as Datamember,
SolverString etc. As in case of Linear field, only the value of the expression as evaluated goes
into the solver deck and not the parametric expression.
Example: b_inputlink.label
Integer
This type of field can contain an integer or a parametric expression that evaluates to an integer.
This type of field is found such as DataSets with an integer as Datamember. Even in this case,
only the value of the expression as evaluated goes into the solver deck and not the parametric
equation.
Templex Parser
A math program available in HyperWorks that can perform more complex programming than the
math parser, other than evaluating a MotionView expression.
The following type of fields in MotionView are evaluated by the templex parser that evaluates a
parameterized expression:
Expressions
This type of field is different than the three listed above because it can contain a combination
of text and parametric expression. It is generally used to define a solver function (or a function
that is recognized by the solver). This type of expression is embedded within back quotes ( `
` ) and any parametric reference is provided within curly braces {}. The presence of back
quotes suggests the math parser to pass the expression through Templex. Templex evaluates
any expression within curly braces while retaining the other text as is.
These fields are available in entity panels such as: Bushings, Motions, Forces with properties
that toggle to Expression, Independent variable for a curve input in these entities, and Outputs
of the type Expression.
CAD or FE or File > Import > Geometry, . The Import CAD or FE dialog is displayed.
CAD or FE assemblies can be imported into MotionView as graphics only to be associated with existing
bodies, or as new bodies with calculated mass and inertia properties along with graphics.
The multi-body aspects of any CAD assembly that can be imported in MotionView are:
Component Mass
Component Moments of Inertia
Component Center of Gravity Location
Component Graphics
The CAD import utility calls HyperMesh in the background to write out graphic file (*.h3d) which holds
the geometry information in a tessellated form. While importing CAD or FE to create new bodies with
mass and inertia, the utility uses HyperMesh to calculate mass, inertia and CG location.
Exercise
In the following exercise, we will import a CAD assembly into MotionView, simplify the model from a
multi-body analysis point of view, and define constraints, model inputs and model outputs.
Please copy all of the files from the mbd_modeling\automation\CAD folder into your <working
directory>.
Or
3. Under Import Options, select Import CAD or Finite Element Model With Mass and Inertias.
7. Click Open.
The Output Graphic File field is automatically filled with Front_Assembly_graphic.h3d as the
H3D filename.
Note The MDL Options allow for flexibility while importing. The CAD file can be imported either
in an existing System/Assembly or a new System can be created
Note This section helps control the size of mesh (or tessellation). When the MBD model being
created is used to solve non-contact problems, use the default option under Allow
Hypermesh to specify mesh options. The Launch Hypermesh to create MDL
points option allows you to select nodes in HyperMesh which can be imported into
MotionView as MDL points. This is not needed for this tutorial since you will be creating
these additional points using a Macro. For models that involves contacts, it is
recommended to use Control mesh coarseness for contacts The Interactive mesh
(launches HyperMesh) option can be used to mesh the surfaces manually. This is
particularly useful when a finer mesh may be needed, such as in case of contact
problems, to obtain better results.
Note The Locator Points options can be used in cases where the CAD model being imported is
not in the same coordinate system as the MBD model in MotionView. This option gives
you control to specify three nodes or coordinates on the source graphic which can then
be used to orient using three points in MotionView after it's imported. This option is not
needed for tutorial as the imported graphic is in the required position. Select None from
the options
Note This dialog helps to generate mass and inertia information. The table displays different
bodies or components being imported along with the volume and mass information based
on a default density of 7.83e-6. The density value can be modified for each of the
components. Alternatively, a CAD summary file can be used to extract mass/inertia
Import C AD dialog
14. Leave the default value of the density for the other components. Click OK.
15. If the import into MotionView is successful, the message "Translating/Importing the file
succeeded!" is displayed in the Message Log.
The body, along with the associated graphics, is displayed in the graphics area.
Note The Extract mass/inertia data from CAD summary file: option can be used only for
CATIA summary file. Currently, summary files from other CAD packages are not
supported under this option.
3. Select the Merge Bodies option. This option is used to merge two or more bodies into a single
body.
4. From the Merge Bodies dialog, enter Strut_rod as the label and b_Strut_rod as variable name.
Click OK.
6. Repeat steps 2 to 4 for merging the bodies: Strut_tube_1_body1 and Strut_tube_body1. Enter
the label as Strut_tube and variable name as b_Strut_tube for the new body to be created..
1 Wheel_Hub_body1 Wheel_Hub
2 Lower_Control_Arm_body1 Lower_Control_Arm
3 Axle_Shaft_body1 Axle_Shaft
o Mass and inertia of the newly created body upon Merge will be equal to the effective mass
and inertias of the bodies being merged.
o A new CG point is created at the effective CG location of the bodies being merged.
o The Merge option works only within same container (System/Assembly/Analysis). Merging
bodies which belong to different container entities is not supported. The context menu item will
not appear in these cases.
o If the bodies that are being merged are referred to in expressions, post Merge these
expressions need to be corrected to point to the newly created body.
o Graphics that belong to bodies being merged are automatically resolved to the new body.
o Joints, bushings etc. that are associated with the bodies being merged if any, are
automatically resolved to the new body.
1. From the Macros menu, select Create Points > Using Coordinates or click the Create points
The points are added to the model. These extra points will be used for defining joints,
orientations and other model inputs.
Note To use this macro import option, you have to create the *.csv file in the format shown
below:
1. From the Project Browser, right-click Model and select Add > Constraint > Joint (or right-click
2. Specify the Label and Variable as Wheel Spindle RJ and j_whl_spindle_revj, respectively.
4. Click OK.
6. Add the rest of the joints of the model using the table below:
7. From the Project Browser, right-click Model and select Add > Force Entity > Spring Dampers
9. Check Create explicit graphics check-box to create an explicit graphic for the spring damper
entity.
11. For Body1 and Body2, specify Strut_tube and Strut_rod, respectively.
12. For Point1 and Point2, specify Point9 and Point0, respectively.
Add >Reference Entity > Body (or right-click the Bodies icon, , from the toolbar). Add a
body with Label and Variable as Jack and b_jack, respectively.
2. Click the body Properties tab and specify the Mass and the three principle inertia values of the
body as 0.01, 100, 100, and 100, respectively.
3. Click the CM Coordinates tab and select the Use CM Coordsys check box.
4. Pick Point10 (bottom of Wheel body)as the CM Origin point for the Jack body.
5. From the Project Browser, right-click Model and select Add > Reference Entity > Graphic (or
right-click the Graphic icon, , from the toolbar) to add a graphic. Specify the Label of the
graphic as Jack Plate and select the Type as Cylinder from the drop-down menu.
8. Pick Point10 as the Origin. For Direction, toggle to Vector and select Global Z.
9. Click the Properties tab. Specify a value of -30 in the field next to it.
Notice that the Radius 2 field is updated with the same value as Radius 1.
11. From the Project Browser, right-click Model and select Add > Constraint > Joint (or right-click
the Joints icon, , from the toolbar). Specify the Label and Variable as Jack Wheel Inplane
and j_jack_wheel, respectively. For Type, select Inplane Joint from the drop-down menu.
13. From the Connectivity tab, select Wheel as Body1, select Jack as Body2, pick Point10 as
Origin and Vector Global Z as Normal.
14. Add another joint and specify the Label and Variable as Jack Ground Trans and j_jack_grnd,
respectively. For Type, select Translational Joint.
16. From the Connectivity tab, select Jack as Body1, Ground Body as Body2, pick Point10 as
Origin and Vector Global Z as the Alignment Axis.
17. All the joints required to complete the model are now in place.
Front suspension
1. From the Project Browser, right-click Model and select Add > Constraint > Motion (or right-
click the Motion icon, , from the toolbar) to add a motion. For Label, specify Jack Motion.
For Variable, specify mot_jack.
2. From the Connectivity tab, select Jack Ground Trans (the translation joint between Jack and
Ground Body) as the Joint.
3. From the Properties tab, change the property type to Expression from the pull-down menu.
Type in the expression `50*sin(TIME)` as the displacement Motion expression.
4. Add another motion to arrest the free spinning of the wheel. Add a motion and specify the label
and variable name as Wheel Spindle and mot_wheel, respectively.
6. From the Properties tab, verify that the value of the Motion is 0.0.
This motion of 0.0 radians keeps the Wheel body from spinning freely about its axis.
8. Click Check Model toolbar. In the Message Log that is displayed, verify that there are no
warnings or errors. Clear the message log.
10. Specify a name for the MotionSolve input XML file by clicking the Save and run current model
icon, .
13. Once the run is complete, click Animate to view the animation of the simulation.
Sequential Simulation
Often, the total dynamic behavior of a multi-body model needs to be captured through more than one
solution sequence. Typical examples include:
2. One type of analysis has to occur before the other. For example, a static solution is required
before a dynamic run.
3. Complex models may not solve with a single solver setting. The solver settings may need to be
changed for a certain period in the overall simulation time.
Such conditions may be simulated by providing a set of commands to the solver that achieves the
above type of sequences. Such simulations are referred to as sequential simulations. Generally,
the solver receives more than one solution (simulate) command. Youll learn to script such a
simulation sequence through this exercise.
Exercise
In this exercise, a landing gear mechanism is simulated for its extension and retraction. A sequence of
simulations need to be scripted such that the mechanism is retracted within a certain period of time at
which the simulation is halted, the model configuration is changed for retraction and the solution is
executed again for extension.
Phase 1
In this phase, you will prepare the landing gear model to simulate the retraction of the landing gear.
Or
Once the model is loaded it will look as it does below. Review the model for its bodies and joints.
The model consists of linkages of the cylinder and piston that hold the wheel as well as linkages
for the extension and retraction of the whole landing gear unit within the aircraft body. The
model also contains a body defined for aircraft but without graphics. As a first step, youll add a
graphic for the aircraft body part for visual representation.
4. Select the option Import CAD or Finite Element Model Only. With this selection, only the
graphics will be imported without creating any bodies.
5. For Input File, select HyperMesh. For Output File, select H3D.
6. Click the Input File file browser icon, , and select the HyperMesh file
Aircraft_Structure.hm as the input file.
8. Click OK.
9. When the H3D file is generated and the graphic is imported, the import success message is
displayed. Click OK.
11. Select the just-added graphic from the Graphic area. The panel for the aircraft body is displayed
The H3D file has only one component, (aircraft_body), so the Component list can be set to
All or use the drop-down menu to select the the sole component.
1. From the Project Browser, right-click on Model and select Add Constraint > Motions (or right-
click the Motions icon, , from the toolbar). Add a motion with Label as Retraction Motion
and Varname as mot_ret. Resolve the Joint to the Cylindrical Joint ActPis_ActCyl_Cyl
(shown in the image below), which is defined between the bodies Activating Cylinder and
Activating Piston.
Rev joint
2. From the Motion panel > Properties tab, under Define by, select Expression. In the
Expression field, enter the expression `STEP(TIME,0,0,5,-750)`.
Note The above STEP expression ramps the value of motion from 0 at 0 second to -750 at 5
seconds. For more information on this solver function available within MotionSolve,
please refer the MotionSolve on-line help.
Translation joint
4. From the Properties tab of the panel, under Define by, select Expression. In the Expression
field, enter the expression `STEP(TIME,0,0,2,-100)`.
2. Click the Save and run current model browser button and enter the name for the run file as
lg_retract.xml. Click Save.
3. Click Run. Once the simulation is completed, close the solver window and the Message Log.
4. From the Run panel, review the results animation by clicking on Animate button.
Phase 2
In this phase, write a Templex template to script and run a sequential simulation to simulate the
retraction and extension of the landing gear mechanism.
1. From the Project Browser, right-click Model and select Add Constraint > Motions (or right-
click the Motions icon, , from the toolbar). Add another motion with Label as Extension
Motion and Variable Name as mot_ext. Resolve the motion to the same joint for which the
Retraction Motion has been defined.
2. From the Properties tab, set the type of motion as Expression and enter the following in the
Expression field: `STEP(TIME,5,-750,10,0) `.
1. From the Project Browser, right-click on Model and select Add > General MDL Entity >
Template (or right-click the Template icon, , from the toolbar). Specify a Label and
Varname and click OK.
3. Enter the script given below. The entries in the curly braces {}, refer to the idstring of either
Extension Motion or Retraction Motion. These idstring attribute can also be accessed using
the Expression builder, .
Note The following commands are MotionSolve command statements in the XML format. Since
the solver refers to entities through their ID numbers, the element_id value is resolved
to the motion IDs. If you have used different varnames for the motions than mentioned
below, the text could differ.
<Deactivate
element_type = "MOTION"
element_id = "{MODEL.mot_ext.idstring}"
/>
<Simulate
analysis_type = "Transient"
end_time = "5.0"
print_interval = "0.01"
/>
<Deactivate
element_type = "MOTION"
element_id = "{MODEL.mot_ret.idstring}"
/>
<!-Activate the extension motion that was deactivated during the first simulation --
>
<Activate
element_type = "MOTION"
element_id = "{MODEL.mot_ext.idstring}"
/>
<Simulate
analysis_type = "Transient"
end_time = "10.0"
print_interval = "0.01"
/>
<STOP/> <!- Stop the simulation. Any further commands below this command will
not be executed -->
Block 1 Deactivates the motion which defines the extension of the landing gear.
Block 2 Simulates the model for the retraction of the landing gear.
Block 4 Activates the motion which defines the extension of the landing gear.
Block 5 Simulates the model for the extension of the landing gear.
The Stop command is used to stop the simulation at the time set in the last Simulate block.
Note A template can be used either to add modeling entities to the solver deck, such as
joints, markers, and so on, that may not be supported by MotionView, or command
entities such as simulation parameters, activation and deactivation, and so on. The
MotionSolve XML is divided into two sections.
1. From the Run panel, specify the filename as MLG_Simulation.xml and click Run.
2. Once the solution is complete, close the HyperWorks Solver View window.
Phase 3
In this phase, you will create output requests and re-run the model to measure the Angular
Displacement and Angular Velocity of the landing gear.
1. From the Project Browser, right-click on Model and select Add > General MDL Entity >
Introduction
In this tutorial, you will learn how to:
Transient Transient animation displays the model in its time step positions as
calculated by the analysis code. Transient animation is used to
animate the transient response of a structure or multi-body system.
Transient/Static/
Transient Rigid or Flexible Bodies H3D H3D
Quasi-Static
Transient/Static/
Transient Purely rigid GRA GRA
Quasi-Static
Transient/Static/
Transient One or more flexible bodies FLX FLX
Quasi-Static
Note Copy all of the h3d files located in the mbd_modeling\animation folder to your <working
directory>.
1. From the File menu, select New > Session to start a new session.
If a warning message is displayed, asking if you want to discard the current data, click Yes to
continue.
2. Click the Select application drop-down menu, , from the toolbar, and select HyperView
4. Click the file browser icon, , next to Load model and select the model file as
single_pendulum.h3d, located in your working directory.
5. The field for Load results will be automatically updated with the same path and name.
6. Click Apply.
7. Click the XZ Left Plane View icon on the Standard Views toolbar to change to the left view
of the model.
8. Click the Start/Pause Animation icon, , on the Animation toolbar to start the animation.
9. Right-click on the Fit Model/Fit All Frames icon on the Standard Views toolbar to fit the
entire animation in the window.
From this panel, you can control the parameters like speed, start time, end time of the animation.
Drag the vertical slider bar on the left to change the animation speed from fast to slow.
Current time: show all the time steps.
The Animate start and Animate end sliders can be set to restrict the animation to a certain
window in time. For example, moving the start slider to 0 and end slider to 3.5 to restrict the
animation to these time limits and covers only a partial cycle of motion.
1. Retain the animation file single_pendulum.h3d that was loaded in Step 1 above.
2. To trace the pendulum motion, click the Tracing button, , on the toolbar.
Tracing panel
3. Under Trace select Component from the radio buttons on the left.
4. Pick the entity/component that needs to be traced by clicking on it from the graphics window.
7. Animate the model. This displays the last 10 steps in the animation.
8. To turn the tracing off, click the Delete button to remove the selected components from the
tracing list.
10. Use the Display Options to change the line color and thickness.
1. Add a new page to the session by clicking on the Add page button, , on the Page Controls
toolbar.
other parts moving with respect to the fixed part, click on the Tracking, , button on the
Results toolbar.
Tracking panel
4. Add a tracking system to the animation by clicking on the Add button under Tracking Systems.
5. Under the Track pull down menu select Component and click on a part from the model currently
loaded.
7. Click the Start/Pause Animation icon, , on the Animation toolbar to start the animation,
and click the Start/Pause Animation icon again, , to stop the animation.
1. Retain the model front_ride.h3d loaded in the previous exercise Step 3 above.
3. Click the arrow to the right of the Entity option menu to expand it.
The list contains the following entity types: Components, Systems, Assembly Hierarchy, and
Sets.
4. Select Assembly Hierarchy from this list to show all the parts of the model in the entity list tree
below.
Select All from the list of buttons next to the entity list tree (All, None, Flip, and Displayed).
Select a color from the color palette under the Color section.
Click All from the list of buttons next to the entity list tree.
Click All from the list of buttons next to the entity list tree.
9. Use the On/Off buttons next to ID: to display and hide the entity IDs.
Introduction
In this tutorial, you will learn how to:
Copy all of the h3d files located in the mbd_modeling\animation folder to your <working
directory>.
1. Start a new MotionView session or refresh your MotionView session by pressing SHIFT+F9.
3. Load the MotionSolve result file front_ride.h3d from your working directory.
Vector panel
6. Click on the Display sub-tab and select By Magnitude for Size scaling.
7. Click on Apply.
10. Click on the Clear Vector button to clear the force vector.
12. Repeat the Steps 6 to 9 to view the Moment vectors of the simulation.
13. Under Display options: try changing the scale of the vectors by changing the Scale value:.
Collision Detection
HyperView allows you to view and detect collisions between bodies during simulations.
4. Click the Load model file browser and select collision.h3d, from your working directory.
5. Click the Load results file browser and select collision.h3d from the same location
specified in Step 4 above.
6. Click Apply.
8. After the file is read, click the Start/Stop Animation icon, , to stop the animation.
10. Click the Add button in the leftmost column under Collision Sets to add a new collision set.
Note Clicking on the Components input collector will display the Extended Entity Selection
dialog. The Extend Entity Selection dialog provides you with criteria based selection
options available for entity selection in HyperView. This method of selection is not used
in this tutorial. See the Selecting Entities Using the Input Collector topic (located in the
HyperView) to learn more about using this selection method.
15. Under the Proximity section, click Enable Proximity checking and specify the Minimum
Distance for the proximity check.
Wherever areas of the trunklid collide with the trunk (car body), the colliding elements turn red.
The color yellow indicates proximity. When neither proximity nor collision is detected, the bodies
retain their natural colors.
Try to view the Element and Component results alternately by clicking on the radio buttons in
the Show Results by: section.
Note Please refer to HyperView tutorial Using Keyboard Shortcuts and Function Keys - HV-2050 for
more information regarding keyboard shortcuts.
2. Load the file front_ride.h3d as the model and result file from your working directory.
3. Click on the Measure button, , on the Annotations toolbar to go to the Measure panel.
6. Click on the Nodes button and from the graphic window pick on a point of your choice.
10. For the Y Axis: select X and activate the Live link check box.
Note The Live Link helps you correlate the measured value with the animation. As you
animate the current animation model a small square marker moves on the measured curve
to indicate the value of the curve at the corresponding time step of the animation.
12. Repeat Point 10 and 11 twice more by selecting Y and Z respectively and clicking on OK each
time.
13. Click the Start/Pause Animation icon, , to start the animating the results.
14. You will see a marker on all the three plots which corresponding to the simulation time step in the
HyperView window.
Introduction
In this tutorial you will learn to:
Theory
The Build Plots panel allows you to import plot files that can be plotted in a 2D layout. The panel
allows you to control what curves are to be plotted either in single or multiple windows.
Tools
The Build Plots panel can be accessed in any one of these three applications: MotionView, HyperView
or HyperGraph.
Copy the Demo.plt file, located in the mbd_modeling\plotting folder, to your <working
directory>.
6. Click Open.
The Y Request text box displays the data available in the file.
Two curves are plotted in the plot window, each with its own line type and color. The legend
identifying the curves is located in the upper right hand corner of the plot.
Single plot window with multiple curves created using the Build Plots panel
Step 2: To build multiple curves on multiple plots using the plot file.
In this step you will select multiple curves and plot them in multiple windows.
5. Press CTRL and under Y Component: select X, Psi, MAG and RMAG.
This selection creates one plot for every request selected under Y component. There will be
four plots created. You could have one page for each plot. However, this tutorial wants all four
plots on the same page.
7. Click the Page Layout button , located next to the Show Legends check box.
9. Click Apply.
A second page is added to the page list with four windows and the plots you requested.
Multiple plots with multiple curves created using the Build Plots panel
Note The procedure to plot and edit curves from other result/request files (for example, .req, .abf,
etc.) remains the same as described in this tutorial.
Note To save a session as a script file with curve data: select the Options panel icon from the
Annotations toolbar, and activate the Save All Curve Data To Session File / Report
Template check box (located on the Session tab).
2. Select a directory.
4. Confirm that Session (*.mvw) is selected from the Save as type drop-down menu.
5. Click Save.
This saves your current work session as a session script file called Demo1.mvw.
2. Click No, since you saved the session in the previous step.
General Entities
Definition Based Entities
General Entities
Have one statement to define the entity. They may have one or more statements to set their
properties.
Are defined through a block statement, called definition, and its instance is created in a model
by an instantiation statement.
The block generally begins with a *Define() statement and end with a *EndDefine()
statement.
The entity (or block) is comprised of a series of other MDL entities or members.
These entities are reusable. Once defined, the same entity-definition may be instantiated
several times within the same model or different model files.
Some of the commonly used user-defined entities are outlined in the table below:
Entity Description
Note The system, assembly, and analysis are together referred to as container entities (or simply
containers).
Following is the recommended convention for variable names which allows the user to identify
the modeling entity during debugging. You are not restricted to this nomenclature, however
you are encouraged to adopt it.
This list of entities and their properties is not comprehensive. For a complete list, refer to the MDL
Language Reference on-line help.
ActionReactionForce frc_ b1, b2, fx, fy, fz, id, tx, ty, tz
p_knuckle_cg A point representing the center of mass point for the knuckle body.
The table below lists some commonly used keywords and what they represent:
Keyword Refers to
These are statements that define an entity and establish topological relation between one entity and
the other. For example, *Body(b_body, Body, p_cg). In this example, the *Body statement
defines a body having its CG at point p_cg. Through this statement the body (b_body) is topologically
connected to point p_cg.
These statements assign properties to the entities created by topological entities. For example,
*SetBody() is a property statement that assign mass and inertia properties to a body defined using
*Body(). Since most of the property statements begin with *Set, they are generally referred as
Set statements.
Building upon the concept of a definition block, these terminologies are used specifically with regard to
container entities such as Systems, Assembly, and Analysis.
The block of statements when contained within a *Define() block are termed as a Definition. The
statements within the block may include:
2. Set statements that assign properties. These Set statements within a definition block are
called "Default Sets", as they are considered as default values for the entities in the definition.
Any statements or block that resides outside the context of *Define() block are termed as Data.
These include:
1. Set statements within a *BeginContext() block that relate to entities within a system,
assembly, or analysis definition.
The syntax of the MDL statement is an asterisk (*) followed by a valid statement with its
arguments defined.
Statements without a leading asterisk (*) are considered comments. In this tutorial, comment
statements are preceded by // to improve readability. The comments are not read in by the
MotionView graphical user interface and are removed if the model MDL is saved back or saved
to a different file.
MDL accepts statements in any order, with a few exceptions.
*BeginMDL(argument list)
//Topology section
*Point
*Body
*System()
// definitions sub-section
*DefineSystem(..)
..
.*EndDefine()
*BeginContext()
..
..
*EndContext()
*EndMDL
*BeginMdl()
*EndMdl()
*Point()
*Body()
*Graphic() - cylinder
*Graphic() - sphere
*RevJoint()
*SetPoint()
*SetBody()
//date
*BeginMdl(model_name, "model_label")
where
*EndMdl()
It is strongly recommended that you look for the syntax of the corresponding statements by
invoking the online Help and typing the statement in the Index. In MDL statements, only the
keywords are case sensitive.
where:
//Points
2. Using the same *Point statement create another point which would be pendulum center of mass:
where:
Square brackets,[ ], in the description of any statement syntax means that an argument is
optional.
//Bodies
4. Define the graphics for the body for visualization. To attach graphics to the body, use the
*Graphic() statement for spheres and cylinder to display the link and the sphere.
where:
POINT|VECTOR Keyword to indicate the type of entity used to orient the cylinder.
If POINT is used, the following argument should resolve to a point,
otherwise it should resolve to a vector.
orient_entity The variable name of the entity for orienting the cylinder.
CAPEND]
For this exercise, use all of the arguments. The statement is:
//Graphics for cylinder
where:
POINT|VECTOR Keyword to suggest the method of orientation for the joint using a
point or vector.
point|vector A point or vector that defines the rotational axis of the revolute
joint.
6. Create an entity output statement. The syntax for *Output - output on entities is:
where:
//Output
7. Set property values for the entities you created in your MDL model file. This is done in the
property data section of the MDL model file. For this problem, use the *SetSystem(),
*SetPoint(), and *SetBody() statements.
*SetPoint(p_pendu_pivot, 0, 5, 5)
Your MDL model file will look like the file below (it summarizes the key sections of the MDL model
file for this exercise):
//Pendulum Model
//05/31/XX
//Topology information
//declaration of entities
//Points
//Bodies
//Graphics
//Revolute Joint
//End Topology
// Property Information
*SetPoint(p_pendu_pivot, 0, 5, 5)
*EndMDL()
1. Launch MotionView .
OR
4. From the Open Model dialog, locate and select the file pendulum.mdl.
5. Click Open.
7. From the Standard View toolbar, click the YZ Rear Plane View button.
9. Go to the Tools menu and click on Check Model to check for any modeling errors.
Go to the Run panel and select Transient as the Simulation Type: option.
From the Main tab, use the Save and run current model file browser, and enter pendulum
for the xml.
Click Run.
Upon completion of the run, close the solver window and clear the message log.
2. The animation file pendulum.h3d will be loaded in the adjacent window. Click on that window to
activate it.
3. Click the Start/Pause Animation icon on the Animation toolbar to start the animation, and
4. Right-click on the Fit Model/Fit All Frames icon icon on the Standard Views toolbar to fit
the visualization in all frames of the animation.
9. Click Apply.
The plot for the displacement of the pendulum in the Z direction is shown.
11. Close the session using the File menu (File > Exit).
Perform certain operations on the entire system at once (for example; turning systems on/off,
making the whole system compliant/rigid, translation, etc.). An operation, such as translation
on a system, is automatically performed on all the subsystems within that system.
The concept of system definition is analogous to the procedures/subroutines in a programming
language.
A procedure is a program that needs information from the main program. The procedure can be
called /instantiated any number of times. A procedure is a part of main program, but can be
maintained separately.
Similarly, a system definition is a model aggregate which needs information from the main model. It
can be called/instantiated any number of times. A system definition is a part of the main model
which can be maintained separately.
A system definition is represented by a *DefineSystem() block. This block should end with a
*EndDefine() statement that indicates the end of a definition block. All entities defined within this
block are considered to be part of the system definition.
def_sys is the variable name of the system definition and will be used while instantiating this
system.
att_1, att_2, att_n is a list of arguments that act as attachments to the system.
The picture above shows a system definition of an SLA suspension. It is an incomplete system which
needs information about the attachment bodies and points to get connected to.
Excluding the *Attachment() statement, other entities in a system definition are similar to an MDL
model file.
A system receives information about entities external to the system via attachments.
Any MDL entity can be passed to a system as an attachment.
The *Attachment() statement inside the system definition declares the arguments in the
*DefineSystem block as an attachment, along with assigning what type of entity the
attachment is going to be.
The same variable name as the attachment should be referred within the definition when
defining an entity that depends on the external entity.
Refer to the entries in bold in the example below. Reference line numbers are for reference
only and are not part of the MDL file.
o Line 2 - defines a system with a variable name sys_definition and has one argument
b_body_att as an attachment.
o Line 7 - creates a revolute joint between b_sys_body which is a body defined within
this system (not shown) and b_body_att which is a body that is an attachment to this
system.
arg_1, arg_2, arg,_n entity variable names that act as attachment to the
system. The number of arguments should match the number of attachments
listed and declared in the system definition.
A definition can be instantiated multiple times. For example, a single system definition file for
an SLA suspension can be used to create multiple SLA suspension systems within one or more
vehicle model files.
The following example illustrates a system definition and its instantiation within an MDL model
file. Some of the terms in the example below are in bold to highlight a few key relationships
between a system definition and its instantiation. Reference numbers are for the example only,
and are not contained in an MDL file.
o A system instance with variable name system1 is created in line 2, that refers to the
definition sys_definition. B_Ground (Ground Body) which is passed as an argument
for the attachment.
// Model : Body.mdl
1
*BeginMDL(base_model, "Base Model")
8 *EndMDL()
You can instantiate systems within your model in one of three ways:
2. Import a system from the System/Assembly panel in the MotionView MBD Model window.
The exercises that follow explain the first two methods; the third is covered in a separate tutorial.
*System()
*SetSystem()
*Attachment()
Problem
In Steps 1 and step 2:
Modify the pendulum model from tutorial MV-1060 to create a pendulum system definition file
called sys_pendu.mdl.
Use this system definition to add another pendulum to the pendulum model from the tutorial
MV-1060 to obtain the double pendulum model shown in the figure below.
Save your base model file as doublependulum.mdl.
Perform a dynamic simulation of the transient response and view the animation.
1. Copy the pendulum.mdl file, located in the mbd_modeling\mdl folder, to your <working
directory>.
Below is a sample MDL file for the pendulum model in tutorial MV-1060.
//Pendulum Model
//05/31/XX
//Topology information
//declaration of entities
//Points
//Bodies
//Graphics
//Revolute Joint
//Output
//End Topology
// Property Information
*SetPoint(p_pendu_pivot, 0, 5, 5)
*EndMDL()
You can convert the above MDL file into a system definition by making small changes to your MDL
file. It is important to note that this conversion is not applicable in all cases, and some of the
conditions that need to be taken care are described later in this tutorial.
2. Replace the *BeginMDL() and *EndMDL() statements with the *DefineSystem() and
*EndDefine() statements, respectively. Specify an appropriate variable name for the system
definition.
Note As mentioned earlier, the attachment entity can be any MDL entity. Therefore one needs
to specify the entity type that the variable represents (for example, att_point represents
the POINT entity).
5. Use *Attachment statement to specify the entity type that each variable represents.
*Attachment (att_point, "Pivot Point", POINT, "Attachment point where the pendulum
definition gets attached")
*Attachment (att_body, "Attachment body" , BODY, " Any body to which the pendulum
definition gets attached")
Note In the original model variable p_pendu_pivot was representing the pivot point. While
converting the pendulum model to pendulum system definition, this pivot point would be
provided by the attachment point.
The *RevJoint() statement refers to the B_Ground and p_pendu_pivot. Replace B_Ground with
the att_body and p_pendu_pivot with att_point.
The *Graphic() statement for the cylinder refers to the variable p_pendu_pivot. Replace the
variable p_pendu_pivot with att_point.
Note All of these variable replacements show that wherever applicable, the attachment
variables should replace the original variables.
10. Retain the *Output() statement. This allows you to obtain displacement outputs on each
pendulum body in your model.
12. Parameterize the points in the system so that they are positioned with respect to each other in a
certain way. In this case, you can set the CM point to be 5 units away from the attachment
point in the y and z direction (att_point.y+5, att_point.z+5).
// system.mdl
// created on:
//Topology Data
// Declaration of Entities
//Attachments
//Points
//Bodies
//Joints
//Output
//Graphics
// Property Data
*EndDefine()
3. Copy the content in the sys_pendu.mdl file from*DefineSystem() to *EndDefine() after the
*BeginMDL() statement.
4. Instantiate the first pendulum system using the *System() statement. Refer to the MDL Language
Reference online help for syntax. For example:
Reference the system definition used by the system by specifying its variable name as the third
argument in the *System() statement. The variable name of the system definition should be
the same as you specified in the corresponding *DefineSystem() statement. In the above
example, system1 uses the system definition sys_def_pendulum.
If the system definition contains attachments, resolve those attachments when you instantiate
the system. For example, sys_def_pendulum has an attachment, att_body, to reference
body_2 in the *RevJoint() statement. In system1, the pendulum body, b_link, should be
connected to the ground body, B_Ground. Therefore, B_Ground is specified as the attachment
body in the *System() statement.
Use Pendulum CM (p_pendu_cm) and the Pendulum Body (b_link) from the first system as
the attachment.
The exact statement that you should use is shown below:
*System(system2, "Second Pendulum System", sys_def_pendulum,
system1.p_pendu_cm, system1.b_link )
//Topology Data
// Declaration of Entities
//Attachments
*Attachment (att_body, "Attachment body" , Body, " Any body to which the
pendulum definition gets attached")
//Points
//Bodies
//Joints
//Output
//Graphics
*EndDefine()
*EndMDL()
9. Take a close look at items listed in the Project Browser. You will now notice a 'hand' under the
System icon for the First Pendulum System and the Second Pendulum System. This indicates
that both of these systems share a single definition. This feature is called a Shared Definition.
10. When a System definition is shared among different instances, any modifications to one of those
instances can be made to reflect in all of the instances. This can be achieved as follows:
11. Under Legacy Support, uncheck the Create a separate definition when modifying a shared
instance option. This will ensure that when entities in a shared instance are modified, the
changes will be reflected across all of the instances without creating a separate definition.
13. Run the MotionSolve simulation and post-process the results. From the Main tab of the Run
Panel , specify the End time as 1.0 and the Print interval as 0.01.
Problem
In this exercise:
Use MotionView to add another pendulum link to your double pendulum model to obtain the
triple pendulum shown in the image below.
Solve and view the animation.
1. Start MotionView and open the pendulum model file from Exercise 1 (the previous exercise) in the
MBD Model window.
4. Using the Select File: file browser , pick the system definition you just created, sys_pendu.mdl.
5. Click Import.
7. Under Label, remove the default label and enter Third Pendulum System as the new label.
8. Under Variable, remove the default variable and enter system3 as the new variable.
9. Click OK.
The *Attachment() line added to the system definition now appears in the Attachments tab for
the system folder of the newly added system. Attach the third link of the pendulum to the
second link in the pendulum system.
2. From the Attachments tab, activate the collector for Attachment body to select a
body attachment.
3. Expand the Bodies folder in the second pendulum system and pick the Pendulum Body (which
belongs to system2).
4. Click OK.
5. Next, activate the collector for Pivot Point to select a point attachment.
6. Expand the Points folder under the second pendulum system and select the Pendulum CM point.
7. Click OK.
An analysis is a collection of loads, motions, output requests, and entities (bodies, joints, etc.)
describing a particular event applied to a model. For example, an analysis to determine the kinematics
of a four-bar mechanism can be described in one analysis, while another analysis can be used to study
a dynamic behavior. In both cases, while the overall model is the same, the analysis container may
contain different entities that form the event. The kinematic analysis can contain motion and related
outputs, while the dynamic analysis may contain forces and its corresponding outputs.
A analysis definition block begins with *DefineAnalysis() and ends with *EndDefine(). All
entities defined within this block are considered to be part of the analysis definition.
The syntax of *DefineAnalysis() is as follows:
Where;
ana_def_name is the variable name of the analysis definition and will be used while
instantiating the analysis.
The following table illustrates an analysis definition and its subsequent instantiation within an
MDL file. Two files, an analysis definition file and the model file, work together when
instantiating a particular analysis under study. Some of the terms in the example below are in
bold to highlight a few key relationships between the files.
// Model : Body.mdl
1
*BeginMDL(base_model, "Base Model")
8 *EndMDL()
The following table details the relationships between the analysis definition and its instantiation
in the MDL Model file.
Variable Relationship
1. Use the following function expression to create the impulse torque about the x axis.
Tx = step(TIME,.3, 0, .31, 10) + step(TIME, .31, 0, .32, -10)
2. Apply this torque to estimate the natural frequencies of the triple pendulum model shown in the
Your analysis applies to a pendulum with any number of links or to more general systems.
*ActionReactionForce()
*SetForce()
*Output()
Note Refer to the MotionView Reference Guide (located in the HyperWorks Desktop Reference
Guide) for the syntax of the above MDL statements.
In the text editor, define an analysis with a variable name of def_ana_0 and one argument
j_att as an attachment.
*DefineAnalysis(def_ana_0, j_att)
3. The torque may be applied between two bodies connected by a revolute joint, with the origin of
the revolute joint taken as the point of application of the force. This allows you to have only one
attachment; the revolute joint.
Create an *Attachment() statement which defines j_att as the attachment and Joint as the entity
type. Make sure that the variable name used in the statement is the same as is used in the
*DefineAnalysis() statement.
Note Refer to the description of the dot separator in MDL. You can access
properties of an entity by using the dot separator.
For example, bodies attached to the revolute joint can be accessed as:
<joint variable name>.b1 and as <joint variable name>.b2.
5. Use the *SetForce() statement to set the value to the force defined in the previous step.
Create a *SetForce() statement with a variable name of force_1 (the existing force) and the
following torque values:
TX = step(TIME,.3,0,.31,10) + step(TIME,.31,0,.32,-10),TY = 0,TZ = 0
*DefineAnalysis( def_ana_0,j_att )
*EndDefine()
4. Using the Select File: file browser , pick the analysis definition you just created,
analysis.mdl.
5. Click Import.
7. Click OK.
8. Select the newly added analysis by clicking on Analysis 0 in the Project Browser, and resolve
the joint attachment by selecting any one of the pivot joints of the triple pendulum:
10. Solve the model. From the Main tab of the Run panel , specify the End time as 1.0 and the
Print interval as 0.01.
12. Plot the output "Input Torque" using the .abf file from the solution.
Create a dataset to specify the start time, mid time, end time, and the force magnitude
Include dataset definition in the analysis definition
Vary the magnitude and time of the impulse torque
In many occasions, it is convenient to provide inputs or change the design variables of a model
through a single interface. The variables could be in the form of real numbers, integers, or strings. Or
it could also be the name of a file. Having a dataset enables such a modeling scenario.
A dataset is a collection of user-defined variables whose values are used or referred by another entity
within MDL. Datasets are either created using the MDL language or the graphical user interface.
This exercise will focus on creating a dataset using MDL. A dataset is defined using a
*DefineDataSet() - *EndDefine() block, which is similar to other definition based entities such as
Systems and Analyses. The definition is then instantiated using the *DataSet() statement.
Refer to the MDL Language Reference online help for the correct syntax for the MDL statements you
choose to use.
1. In a new document in a text editor, create the *DefineDataSet() and *EndDefine() block. You
will create data members belonging to the dataset between these statements.
The data members that you need to define in the dataset are:
Starting time
Mid time
End time
Force magnitude
As all the data members are real numbers, we will use *Real() to define them.
You can also define other types of members such as: integers, strings, options, or a file (as
applicable to your model).
*DefineDataSet(ds_def_force)
*EndDefine()
1. In a text editor, open the analysis definition file created in tutorial MV-1080. Include the dataset
definition in it by using the *Include() statement before the *DefineAnalysis() statement.
2. Instantiate this dataset definition using the *DataSet() statement within the
*DefineAnalysis() block and after the *Attachment() statement.
where
optional arguments are arguments that are passed as attachments (if any)
Instantiate the dataset by choosing a suitable variable name and label. The ds_def should be
the same as the variable of the dataset definition used in the *DefineDataset() statement.
3. Set the default values of the data members in the dataset by using the *SetReal() statement
within the *DefineAnalysis() block.
*SetReal(real_name, real_value)
where
real_name is the variable name of the data member for which the value is being set.
For example, the *SetReal() statement for start time would be:
*SetReal(ds_force.start_time, 0.3)
4. Set the default values of all the data members used in the dataset definition.
6. Change the appropriate values in the *SetForce() statement by incorporating the dataset
members. The idea is to use the dot operator to browse through the model hierarchy and access
the dataset values (for example, use ds_force.start_time.value to access the start time
value from the dataset). This is illustrated in the following statement:
*SetForce(force_1, EXPR, `step(TIME, {ds_force.start_time.value}, 0,
{ds_force.mid_time.value}, {ds_force.force_magnitude.value}) +
step(TIME, {ds_force.mid_time.value}, 0, {ds_force.end_time.value}, -
{ds_force.force_magnitude.value})`,0,0)
The expressions within the curly braces ({}) get processed by Templex in MotionView and get
evaluated to the appropriate values defined in the dataset.
*DefineAnalysis( def_ana_0,j_att )
*SetReal(ds_force.start_time, 0.3)
*SetReal(ds_force.mid_time, 0.31)
*SetReal(ds_force.end_time, 0.32)
*SetReal(ds_force.force_magnitude, 10)
*EndDefine()
7. Save the above work in a new analysis definition file named analysis_dataset.mdl.
2. Delete the existing analysis (if any) by right-clicking on the Analysis in the Project Browser and
clicking Delete.
4. From the Import/Export tab, import the new analysis definition file analysis_dataset.mdl
following similar steps used to import the analysis in the earlier exercise (MV-1080).
5. From the Project Browser, expand the Datasets folder and select Force Data.
You will see the dataset with the Labels and Values for all of the members in the dataset.
6. Change the Starting Time to 0.5, Mid Time to 0.55, End Time to 0.6 and the Force
Magnitude to 15.
8. Compare the Input Torque in the plot window with that of the earlier analysis.
You can now change the force parameters easily through the dataset graphical user interface and
re-run your analysis.
OR
3. Specify sys_pendu as the Variable, Pendulum as the Label, and def_sys_pendu as the
Definition Name.
4. Click OK.
The Pendulum system is added to the model and its corresponding panel is displayed.
2. Specify the Label as Attachment Point and arg_p for the Variable, select Point (from the
drop-down menu), and verify that the Type is set to Single only.
3. Click OK.
We have created two attachments to the Pendulum system which will be used to attach this
system to other entities of a model.
Notice that the both of the newly created attachments are Unresolved, which means that the
attachments are not yet referring to another entity in the model.
7. Similarly, click the collector, select Ground Body from the model tree, and
click OK.
OR
3. Specify the Label as Mass CG, Variable as p_cg, and the Type as Single.
4. Click OK.
7. From the model tree, expand the Pendulum > Attachments > Attachment Point folders and
select x (x is one of the property attributes of the point entity Attachment point).
Through the above steps the point Mass CG is parameterized with regard to the X coordinate of
the point Attachment Point and is placed at a distance of 50 length units in the X direction.
Alternatively, the expressions in Y and Z can be filled by copying the arg_p.x+50 expression from
X Coordinate and editing it.
Note The background color of the field changes for parametric expressions.
12. Right-click on the Pendulum system in the Project Browser and select Add > Reference Entity
> Body.
13. Enter Mass for the Label and b_mass for the Variable, and click OK.
14. From the Properties tab specify the Mass as 1 and the Inertia properties as 1000 for Ixx, Iyy
and Izz respectively.
15. Click on the CM Coordinates tab and check the Use center of mass coordinate system
option. Pick the point Mass CG as the Origin.
17. Specify the Label as Rod, the Variable as gcyl_rod, the Type as Cylinder, and click OK.
18. From the Connectivity tab; double click on the Body collector for Parent and pick Mass in the
Pendulum system, click on the Point collector and pick Mass CG as Origin, and for Direction
double click the Point collector and select the attachment to the system Attachment Point.
20. Next, add a Sphere graphic by right-clicking on the Pendulum system in the Project Browser
and selecting Add > Reference Entity > Graphic.
21. Specify the Label as Mass, the Variable as gsph_mass, the Type as Sphere, and click OK.
22. Pick Mass for the Parent body and Mass CG as the Origin.
25. Select Revolute Joint from the drop-down menu, specify the Label as Pivot, the Variable as
j_pivot, the Type as Single, and click OK.
26. From the Connectivity tab, double click on and select Mass from the Select a Body
dialog (model tree). For the second body, click on the collector and browse through the
model tree (Model > Pendulum > Attachments) and select Attachment Body.
Note Alternatively, you can click on the Global Triad (at the bottom left of the triad) to pick
Ground Body via the Attachment Body.
3. Click on the Select file file browser and browse to your <working directory>.
4. Specify the name of the file as sys_pend_gui.mdl by clicking on the folder icon and clicking on
Save.
Note The Export option is only available for Systems and Analyses. For other definitions like
Datasets or Templates, the definition can be copied from the model .mdl file.
3. Click on the Select file file browser and browse to your <working directory>.
6. Select def_sys_pendu.
8. Click OK.
Double click on the collector. In the model tree that appears, click on the
Pendulum system, select Mass CG from the list on the right, and click OK.
Click on the collector. In the model tree that appears, click on the
Pendulum system, select Mass from the list on the right, and click OK.
The same system definition can be reused to instantiate several times either within the same
model or in a different model.
Import CAD geometry with graphic settings suitable for contact simulation.
Setup 3D rigid body contact between meshed geometries in the multi-body model.
Perform a transient analysis to calculate the contact forces between these geometries.
Post-process the results using a report generated automatically.
For these purposes, you will make use of a slotted link model.
Introduction
This tutorial will guide you through the new 3-D rigid body contact capabilities in MotionSolve version
14.0 and later using the mesh-to-mesh contact approach. This approach makes use of surface
meshes for the bodies coming in contact during the simulation. A surface mesh is defined as an
interconnected set of triangles that accurately represent the surface of a 3D rigid body. MotionSolve
prescribes certain conditions for such a surface mesh.
Each component mesh should form a closed volume. This means that the given mesh should
not contain any open edges (edge which is part of only one element) or T- connections (2
elements join at the common edge in form of a T).
Mesh should be of uniform size.
Element surface normal should point in the direction of expected contact.
You can learn more about the best practices for contact modeling by clicking here.
For such a meshed representation of 3D rigid bodies, MotionSolve uses a numerical collision engine
that detects penetration between two or more surface meshes and subsequently calculates the
penetration depth(s) and the contact force(s).
There are numerous 3D contact applications (gears, cams, mechanisms with parts in contact etc.)
that may be solved using this approach.
Such mechanisms find common application in valve actuators, air compressors, certain reciprocating
and rotary engines among others. The figure below illustrates a slotted link mechanism that will be
modeled in this tutorial.
A slotted link mechanism. The cam is in contact with the slotted link as shown, whereas the pin comes into contact with
the slots.
Or
Import Options radio button to Import CAD or Finite Element Model with Mass and
Inertias.
Input File as Parasolid and specify the input CAD geometry as slotted_link.x_t in your
Notice the Output Graphic File text field is automatically populated with the same path and
name, however it is suffixed with a _graphic.h3d extension. This is the file that will be used to
specify the graphics in the model. You may change the name or path of the graphic H3D if you
wish.
Expand the Meshing Options for Surface Data by clicking on the expand button ( ) if it is
not already expanded. Ensure that the option to Allow HyperMesh to specify mesh options
is checked.
Activate the Control mesh coarseness for contacts check box. Set the slider to 5. This
option tells HyperMesh to mesh the CAD geometry such that it can be used for 3D contact in
MotionSolve.
Note The slider controls the coarseness of the generated mesh, with 1 being the coarsest and
10 being the most fine. A very coarse mesh will have large triangles, which may not
represent the curvature of the CAD surfaces accurately. Alternatively, a very fine mesh
will have extremely small triangles that may increase element numbers and thereby the
solution time. The best practice is to strike a balance between mesh fineness and
performance that satisfies the modeling purpose.
At this stage, the Import CAD or FE dialog should look like the figure below:
MotionView will invoke HyperMesh in the background, to mesh the geometry and calculate its
volume properties. Another dialog appears where the components in the CAD file can be reviewed
along with their mass, density, and volume properties.
The converted geometry is loaded into MotionView for visual inspection. You can inspect the
surface mesh by swapping the display to a meshed representation.
Displaying mesh lines for all the components of the input C AD geometry
Displaying the surface mesh for all the components of the input C AD geometry
Pin Rigid Body The pin body. Together the cam and the pin bodies
engage the slotted link.
Link Rigid Body A connector body between the pin and the cam.
Slotted_Link Graphic The graphic that represents the slotted link body. This
is a tessellated graphic.
Cam Graphic The graphic that represents the cam body. This is a
tessellated graphic.
Pin Graphic The graphic that represents the pin body. This is a
tessellated graphic.
Link Graphic The graphics that represent the link body. This is a
tessellated graphic.
The Pin, Link, and the Cam bodies are fixed to each other and pivoted with to the Ground Body at
the Cam center. The Slotted link can translate with respect to the Ground Body.
3 Cam Pivot Revolute Joint Cam Ground Body Global Origin Global Y
2. Apply a Motion on the Cam Pivot joint of the type Displacement and the Expression as
`360d*TIME`.
2. Change the Label to Cam Slotted Link Contact. Verify that RigidToRigidContact is selected
and click OK.
3. From the Connectivity tab of the Contact panel, resolve Body I to Cam and Body J to
Slotted_Link. Doing this will automatically select the respective graphics that are attached to
these bodies.
To make sure that the geometries are well defined, ensure that the normals are oriented correctly
and there are no open edges or T-connections in the geometries.
4. Activate the Highlight contact side check box. This will color the geometries specified for this
contact force element according to the direction of the surface normals. Verify that both
geometries are completely red, that is make sure that there are no blue patches for either
geometry (to visualize clearly, you may have to deactivate the other graphic and reactivate).
The color red indicates the direction of surface normal and is the side of the expected contact.
Next, you can check for open edges or T-connections. If the associated graphics mesh has any
open edges or T-connections, the Highlight mesh errors option would be active. If it is active,
check the box for Highlight mesh errors. Doing this will highlight any open edges or T
Connections in the geometry.
The graphics associated in this contact entity dont have mesh errors. Hence you should see
Highlight mesh errors grayed out.
As you can see, the geometry seems to be clean and there are no free edges or T connections in
the model.
Output of the type Expression that can be used to plot the contact forces for
that contact element.
5. Next, you need to specify the contact properties. Click on the Properties tab to bring up the
Normal Force and the Friction Force property sub-tabs within the contact panel. In this model
you will use an Impact model with the following properties:
Stiffness 1000.0
Exponent 2.1
Damping 0.1
6. Repeat Steps 1 - 5 for creating contact between the Pin body (Body I) and the Slotted_Link
(Body J). You may define the label for this contact to be Pin Slotted Link Contact. Define the
same contact properties as listed in Step 5 above.
7. For the contact force element Pin Slotted Link Contact, you will also instruct MotionSolve to find
the precise time at which contact first occurs between the two colliding bodies. Navigate to the
Advanced tab. Check the box for Find precise contact event. In the text field below, specify a
value of 0.01.
Note With the Find precise contact event option, MotionView automatically adds a sensor
entity (defined by Sensor_Event in the solver deck), which has a zero_crossing
attribute. During simulation, when the contact force is detected for the first time (force
value crossing zero), MotionSolve will cut down its step size by the given factor and try
to determine the contact event more precisely.
1. Navigate to the Run panel by clicking on the Run icon on the toolbar.
2. Change the Simulation type to Transient and specify an end time of 3.0 seconds.
3. To obtain accurate results, you will specify a smaller step size than the default.
4. From the Run panel, specify a name for your XML model and click on the Run button. The
transient simulation is started.
In the HyperWorks Solver View window that pops up, you should be able to see a message from
the solver that confirms that the mesh based contact method is being used for the contact
calculations.
Verifying that the mesh based contact is used for the simulation
Analysis reports
This brings up a list of the history of simulations you have completed in the past using
MotionView.
3. Click OK.
The first HyperView page (second in the session) displays a contour plot colored by maximum
penetration depth over the entire length of the simulation. You may hide one or more parts to
view this clearly in the graphic area. This is illustrated in the figure below. The cam graphic has
been made transparent to see the penetration depths better.
Note The contact overview colored by penetration depth is only available for meshed
geometries.
The third page in the session can be used to animate the results while viewing a contour
plot of the penetration depth colored by magnitude. This allows you visualize the penetration
depths at different times of the animation.
Click on the Animation Controls icon, , on the Animation toolbar and move the
Click on Contour panel button on the toolbar and select the Cam body as the
Components collector.
Click Apply.
The penetration depth contour animation on the cam body can be visualized.
The fourth page in the session can be used to visualize the contact forces in the animation
of the results. By default, the contact report plots the total contact force for each contact
element.
Click on the Animation Controls icon, , on the Animation toolbar and move the
visible. To change the scale, go to the Vector panel , click on the Display tab and
change the Size scaling option as appropriate.
The total contact force between the cam body and the slotted link
The current force vectors are displayed on each node of the mesh that is in contact at each
time step.
From the Results browser deactivate the following Components: Contact Graphic(Cam
Slotted Link Contact) and Contact Graphic (Pin Slotted Link Contact). Activate the
Contact Region Output (by either clicking on the icon in the browser or using the right-
click context menu).
For the Result type, select the type of result you would like to see from the drop-down
menu. Next, click Apply.
This will plot the result type you selected for all the relevant graphics in the model. You may
have to scale the force vectors accordingly to make sure they are visible.
As an example, the point slip velocity vectors are plotted in the figure below:
Navigate to the next page . This is the last page in the session.
Each time a new contact entity is created in MotionView, a corresponding output force request is
created that can be used to plot the contact forces between the graphics specified in the
contact entity. These can then be visualized in HyperGraph. The last page of the contact report
plots the contact force magnitude for all the contact elements in the model.
Click Add Page and change the client to HyperGraph 2D (if it is not already
selected).
Under Y Type, select Expressions and select a request in the Y Request window.
As an example, select REQ/70000003 Force Pin Slotted Link Contact as the Y Request
and F4 as Y Component to plot.
Click Apply.
Summary
In this tutorial, you learned how to create a good meshed representation from CAD geometry. Further,
you learned how to setup contact between meshed geometries. Also, you were able to inspect the
geometry to make sure the surface normals were correct and there were no open edges or T
connections.
You were also able to setup a transient analysis to calculate the contact forces between these
geometries and post-process the results via vector and contour plots in addition to plotting the
contact force requests.
Setup semi-analytical contact between a primitive spherical geometry and a meshed geometry.
Perform a transient analysis to calculate the contact forces between these geometries.
Process the results.
Compare the analysis time when using meshed representation for the spheres.
For these purposes, you will make use of a ball bearing model.
Introduction
This tutorial will guide you through the new analytical 3-D rigid body contact capabilities in
MotionSolve. When one or both of the rigid bodies in contact are primitive spheres, MotionSolve uses
a semi-analytical or fully analytical contact method respectively to calculate the penetration depth(s)
and subsequently the contact force(s). This is explained in the table below:
A semi-analytical contact
method that computes contact
Primitive Sphere Mesh Sphere Mesh between the primitive sphere
(Body I) and the tessellated
geometry (Body J).
There are several 3D contact applications that involve spherical geometries (ball bearings, re-
circulating ball systems etc.) using the analytical approach for computing the contact forces in such
scenarios offers several benefits:
1. The simulation time is reduced when using the semi-analytical or fully analytical approach.
2. The simulation is more robust since the dependence on the mesh quality is removed.
3. The simulation results are often more accurate since there are no or lesser effects of mesh
discretization.
A typical ball bearing geometry with six balls. A cutaway section shows how the balls are in contact with the outer and
inner races.
The geometries for all surfaces except the balls are meshed in this geometry. Only the six balls are
defined as primitive spheres.
The figure above shows the model as it is setup in MotionView. This model has all the necessary
contacts defined except for a few which you will setup next. The following table describes the
components present in this model.
Rim Rigid Body The rim body that keeps the balls in place
Ball1_inter, , Ball5_inter 3D rigid body Contact force element between the balls and
contact the Rim
Ball1_upper, , Ball5_upper 3D rigid body Contact force elements between the balls and
contact the Outer Race
Ball1_inter, , Ball5_inter 3D rigid body Contact force elements between the balls and
contact the Inner Race
Solver Units Data Set The solver units for this model. These are set
to Newton, Millimeter, Kilogram, Second
Gravity Data Set Gravity specified for this model. The gravity is
turned on and acts in the negative Z direction
Outer Race Graphic Graphic The graphic that represents the outer race
body. This is a tessellated graphic
Inner Race Graphic Graphic The graphic that represents the inner race
body. This is a tessellated graphic
Rim Graphic Graphic The graphic that represents the rim body. This
is a tessellated graphic
Ball 1 Primitive, , Ball 6 - Graphic The graphics that represent the ball bodies.
Primitive These are primitive geometries
Inner Race Rev Revolute Joint Revolute joint defined between the Inner Race
and Ground Body
Outer Race Fixed Fixed Joint Fixed joint defined between the Outer Race and
Ground Body
Input Motion to Inner Race Motion A motion defined on the Inner Race Rev joint
that actuates the mechanism
4. Verify that RigidToRigidContact is selected in the drop-down menu and click OK.
6. To make sure that the geometries are well defined for contacts, the normals of the surface mesh
should be along the direction of contact and there should be no open edges or T-connections in
the geometries. To make sure the normals are oriented correctly, activate the Highlight contact
side box. This will color the geometries specified for this contact force according to the direction
of the surface normals. You should make sure both geometries are completely red i.e. there are
no blue patches for either geometry. To see this clearly, you may have to deactivate the Outer
Race graphic. This is illustrated in the figures below.
7. Next, you can check for open edges or T-connections. If the associated graphics mesh has any
open edges or T-connections, the Highlight mesh errors option would be active. Activate the
box for Highlight mesh errors if there are any mesh errors. Doing this will highlight any open edges
or T Connections in the geometry.
The graphics associated in this contact entity dont have mesh errors. Hence you should see
Highlight mesh errors grayed out.
Stiffness 500.0
Exponent 3.0
Damping 1.0
9. Repeat steps 1 3 for creating contact between the Ball 6 body and the Outer Race body and
also between the Ball 6 body and the Inner Race body. The details for these are listed in the
table below:
1. To setup a transient analysis, navigate to the Run panel by clicking on the Run button in the
toolbar .
2. From the Run panel, change the Simulation type to Transient and specify an end time of 2.0
seconds.
3. Further, to obtain accurate results, you will need to specify a smaller step size than the default.
Click on the Simulation Settings button and navigate to the Transient tab.
6. In the HyperWorks Solver View window that pops up, a message is displayed from the solver
that confirms that the semi-analytical contact method is being used for the contact calculations.
As you may have noticed, you did not have to explicitly specify the contact force method to be used.
MotionSolve automatically detects if one or both the bodies in contact are primitive spheres and
accordingly changes the contact force method being used.
1. Motionview makes available an automated report for model containing contacts. The report
automatically adds animation and plots to the session. The report can be accessed through
Analysis > View Reports menu option.
3. Additional pages are added to the report. Use the Page Navigation buttons (located
at the upper right corner of the window, below the menu bar area and above the graphics area)
to view these pages.
Contact Overview
MotionSolve writes out a static load case to the H3D file that can be used to view the maximum
penetration on all the geometry in contact throughout the length of the simulation. This enables you
to inspect your results to see where the maximum penetration depth occurred in your geometry/
geometries. You may hide one or more parts to view this clearly in the graphic area.
Note You may Fit the graphic area in case the graphics are not visible in the Graphics area.
1. From the Results browser select the components Ball 1 Primitive to Ball 6 Primitive.
3. Similarly, Hide the Rim graphic and Inner Race graphic in order to visualize the contours on the
Outer Race graphic.
1. Navigate to the next page , which shows a transient animation of the penetration depth.
2. You can visualize the contours individually on the components by isolating the components. For
example, to visualize the contours on the Inner Race graphic, select the component in the
Results browser, right-click and select Isolate from the context menu.
1. Navigate to the next page , which shows a transient animation of the contact forces.
3. Select Transparent Element and Feature Lines from the toolbar options.
5. Activate the Display tab and change the Size Scaling option to By Magnitude and use a value
of 5.
Animating the total contact force (the outer race graphic is turned off for better visualization)
Note You may turn off curves from the Plot browser to look at individual force plots.
1. Each time a new contact entity is created in MotionView, a corresponding output force request is
created that can be used to plot the contact forces between the geometries specified in the
contact entity.
2. Go to the next page , which has a HyperGraph plot of all the contact force magnitudes.
Summary
In this tutorial, you learned how to setup semi-analytical contact between a primitive spherical
geometry and a meshed geometry. Further, you were able to inspect the geometry to make sure the
surface normals were correct and there were no open edges or T connections.
You were also able to setup a transient analysis to calculate the contact forces between these
geometries and post-process the results via vector and contour plots, in addition to plotting the
contact force requests.
Finally, you were able to compare the analysis time between a fully meshed representation of the
spheres and the model that you created. A significant speedup was observed which makes the semi-
analytical contact method the first choice for solving 3D contact models when applicable.
Introduction
This tutorial will guide you through the new 2D rigid body contact capabilities in MotionSolve which
can be used when contact occurs in a plane. In this tutorial, we will model a roller type cam-follower
mechanism with the help of 2D rigid to rigid contact as there are no out-of-plane contact forces that
are expected.
Exercise
Copy the files Cam_Follower_Input.mdl, CamProfile.h3d, Cam_Fixed.csv and Cam_Variable.csv
from the location
<installation_directory>\tutorials\mv_hv_hg\mbd_modeling\interactive\ to your <Working
directory>.
1. Launch MotionView.
Or
3. From the Open model dialog, select the file Cam_Follower_Input.mdl from your working
directory and click Open.
Once the model is loaded it will look as it does below. Review the model for its bodies, graphics,
markers, joints and motion.
4. In the Run panel , click the Save and run current model browser button
5. Click the Run button. Once the simulation is completed, close the solver window and the
Message Log.
Notice that the FollowerRoller is not in contact with the Cam since there is no contact defined in
the model.
7. Return to MotionView window using the Page Window Layout button located on the
HyperWorks Page Controls toolbar as shown below.
1. From the Project browser right-click on Model and select Add Reference Entity > Curve (or
3. From the Properties tab, use the first drop-down menu to change the curve from 2D Cartesian
to 3D Cartesian.
Note Only 3D Cartesian types of Curve Entities are supported for the Curve Graphics.
4. Use the fourth drop-down menu to change the curve from Open Curve to Closed Curve.
5. From the Properties tab, click on the x radio button. Select Math from the second drop-down
menu on the left. Enter 5*SIN(2*PI*(0:1:0.01)) in the Expression Builder and hit Enter on
the keyboard.
Note Now having created the Curve Entity, let us create a Curve Graphics to graphically represent
the FollowerRoller body on the screen and later use it to define 2D Contact.
9. For Label, enter Roller_Curve. For Variable, enter gcrv_roller and click OK (as shown in the
image below).
Note The Body/Point option (Parent type) has been selected by default on the Connectivity
tab.
11. Now the Point collector is highlighted by default , click once on the same.
Note Curve Graphics representing the FollowerRoller should now be graphically visible as shown
in the image below.
Note At this point we can deactivate (or delete) the original cylinder graphics used to represent
FollowerRoller.
The variable portion of cam will be controlled by the coordinates of some points in our model.
1. Right-click the Curves icon to insert a new Curve Entity and provide Cam_Fixed_Curve for
the Label and crv_cam_fix for the Variable.
2. From the Properties tab, use the first drop-down menu to change the curve from 2D Cartesian
to 3D Cartesian.
3. Retain the default selection for the fourth drop-down menu to Open Curve.
4. From the Properties tab, click on the x radio button. Retain the default File option in the second
drop-down menu on the left.
5. Click on the file browser icon and select Cam_Fixed.csv from the working directory. Click
Open.
6. Select Column 1 for the Component. Retain all other options on the panel to its default values.
The panel should look like the image below:
7. Similarly click on the y radio button, the same file should be selected by default. This time, select
Column 2 for the Component.
8. Click on the z radio button, the same file should be selected by default. This time, select Column
3 for the Component.
Note Now, having created the Curve Entity, let us create a Curve Graphics to just graphically
visualize and make sure that the imported data is located as per our requirement.
Variable Value
Label: Cam_Fixed_Curve
Variable: gcrv_cam_fix
Body: Cam
Curve: Cam_Fixed_Curve
Note Curve Graphics representing the fixed portion of Cam should now be graphically visible as
shown in the image below.
Firstly, let us create some points in the model using Menu > Macros > Create Points > using
Coordinates.
1. From Main menu, click Macros > Create Points > using Coordinates (or click Create Points
using Coordinates button from the MotionView Toolbar > Point Macros toolbar).
Note Now that we have fixed portion Curve Graphics representing Cam, we can deactivate (or
delete) the original H3D file graphics used to represent Cam.
Now let us use the newly created points to create the variable portion of the cam profile using the
Create Curve from Points/Nodes macro.
4. From the Main menu, click Macros > Create Curve from Points/Nodes (or click the Create
Curve from Points/Nodes macro button from the MotionView toolbar > Point Macros
toolbar).
6. Edit the Labels prefix for the new Curve Entity as well as the Curve Graphics to be created to
Cam_Variable_Curve.
OR
Note The selected Point 0 is highlighted in the graphics screen and also listed in the panel.
8. Now repeat the above step to pick all the points from Point 1 to Point 9.
Note A node associated with File graphic H3D can also be picked. However, the curve created
would not be parametrically linked with the node. Picking a point retains the parametric
relation between the point and the curve.
A new Curve Entity and a new Curve Graphics (Cam_Variable_Curve) has been added to the
model as shown in the image below.
Note Review the newly created Curve Entity by selecting it from the model tree as shown in
the image below. Notice (by clicking as shown in the image below) how the X, Y and Z
values in the panel are parametrically pointing to the points selected while using the
macro. Thus, by changing the coordinates of these Points in the model, the curve can be
modified.
Variable Value
Label: Cam_Curve
Variable: crv_cam
Open/Closed: Closed
2. From the Properties tab, click on the x radio button. Select Math from the second drop-down
menu on the left. Enter {CAT(crv_cam_fix.x, crv_0.x)} in the Expression Builder and hit
Enter on the keyboard.
Note By using CAT function, we are able to append the data-points of variable portion of cam
to the data-points of fixed portion of cam. The panel should display merged data of both
fixed and variable portions of cam profile as shown in the image below.
Note Now having created the Curve Entity, let us create Curve Graphics to graphically represent the
Cam body on the screen and later use it to define 2D Contact.
4. From the Project browser right-click on Model and select Add Reference Entity > Graphic (or
6. For Label, enter Cam_Curve. For Variable, enter gcrv_cam and click OK.
Note The Body/Point option (Parent type) has been selected by default on the Connectivity tab.
This time, let us use the Marker option since we already have a CamMarker in the model which
is associated with Cam (Body) and PivotPoint (Point).
7. From the Connectivity tab, select the drop-down menu of Parent and change it to Marker.
Note The panel should now look like shown in the image below.
Note Curve Graphics representing the Cam should now be graphically visible on screen as
shown in the image below.
5. Next, the Body J collector will be highlighted automatically. Click once and select the
FollowerRoller body from the Select a Body dialog box.
Note Fixed and Variable Curve Graphics are selected by default since they are associated with
Cam body. Let us remove the same from the contact definition as they are not required.
6. Uncheck (or deselect) Cam_Fixed_Curve and Cam_Variable_Curve from the list of Curves
under Body I.
Note The arrow display indicates the inside of Cam and FollowerRoller as contacting side. This
needs to be corrected.
8. Click the Flip Contact Side check box for both Body I and Body J curves.
Note The highlighted contact side for both the bodies should now be as shown in the image
below.
9. Review the Properties tab, the default selections are fine for the model.
10. Review the Advanced tab, turn on the Find precise contact event and Change simulation
max step size options with its default values.
2. From the Save As Model dialog, browse to your working directory and specify the File name: as
Cam_Follower.mdl.
At this point, you are ready to run your model. We expect a lot quicker run using 2D curve contact as
compared to an equivalent model using 3D contact where the solver has to work harder to determine
contact for a 3D tessellated geometry.
Note To obtain accurate results, a smaller step size and a finer print interval have been
selected in this model. You can review the same by checking Simulation Settings
button.
4. Specify a new name for your results by clicking on file browser icon Cam_Follower.xml and
click the Save button as shown in the image below.
Note You can even plot the graph of FollowerShaft vertical displacement during the entire simulation
using HyperGraph. To do the same, follow the steps mentioned below.
3. In the MotionView window, from the Run panel click the Plot button.
where:
modal matrix
Craig Bampton
Craig Chang
Note At the end of this tutorial, links to online help direct you to where you can learn more about
the theory behind flexible bodies and CMS method.
There are two ways you can generate flexible bodies using Optistruct:
FlexPrep is a MotionView utility which allows you to generate a flexible body from a finite element
mesh. It also allows translation between various flexbody formats. These translations are
discussed in the next section, "Flexbody Translation Using Flexprep".
generate a flexible body from any Optistruct or Nastran bulk data file.
create RBE2 spiders.
You can manually insert certain cards in the Optistruct input deck to run the Component Mode
Synthesis routine. These cards allow file size reduction of a flexbody. This helps in faster pre/
post-processing and overall better efficiency of the process.
Note You can manually edit the preparation file generated by FlexPrep to reduce the size of
the flexible body H3D.
Note Once the flexbody H3D is created, it can be used in the MBD model and the model can be
submitted to either MotionSolve or ADAMS. This is covered in the following tutorials.
Stress recovery and fatigue calculations are done in two stages during the MBD analysis:
For stress recovery in the pre-processing stage, element stresses are obtained using the
orthogonalized displacement modes. Every displacement mode is associated with a particular
number of stress modes, each representing a basic stress tensor. This particular number
depends on the type of elements used in the flexible body, for example, one, two, or three-
dimensional elements. These stress modes are then saved to the H3D file.
In the post-processing stage, the actual stress recovery and fatigue index calculations are
carried out. The modal participation factors obtained from the simulation are used to linearly
superimpose the stress modes to come up with the stress tensor for each element. This stress
tensor is used to calculate the other components of stresses: Principal, Shear, or von Mises.
get familiar with the flexible body generation techniques available in MotionView and Optistruct.
be introduced to all available features in FlexBodyPrep for flexbody generation.
be introduced to the various options available in Optistruct to reduce the size of the H3D file.
There are two ways you can generate the flexible bodies for MBD simulation in Hyperworks:
In the given input file, interface nodes are already created at the center of the bushing mounts and
the spring attachment location. You will create the interface node at the lower ball joint and its
connection to the LCA in the exercise.
Note Copy the sla_flex_left.fem file, located in the mbd_modeling\flexbodies folder, to your
working directory before proceeding further.
3. From the pull down menu, pick the option Create Optistruct prp (preparation) file and
generate the h3d flexbody.
4. Click on the file browser icon, , next to Select Bulk Data file and select the input bulk data
file sla_flex_left.fem from your working directory.
Note You can use any Optistruct (FEM) or Nastran (nas, dat, bdf) bulk data files.
5. For Save the *.h3d file as, enter the name of the output H3D file as sla_flex_left.h3d in
your <working directory>.
6. For the Component mode synthesis type, select Craig-Bampton to perform Craig-Bampton
component mode synthesis.
Note If the interface node IDs are within a range, you can specify as 10001:10003.
The interface nodes are the nodes where constraints or forces are applied in the MBD analysis.
8. For the Cutoff type and value, select Highest Mode # and enter a value of 10.
MotionView allows you to specify a limit on the modal information contained in your H3D file. Two
methods are available to set these limits.
Specify a maximum number of Eigen modes for which modal data is included in your H3D file.
OR
Specify an upper cut-off frequency for the Eigen modes. When a cut-off frequency is specified,
normal modes analysis can be performed using one of two algorithms: Lanczos or the
automated multi-level sub-structuring eigenvalue solution, AMSES.
With this option set, Flex Prep puts relevant cards in the OptiStruct input deck to calculate the
modal stresses while processing your bulk data file.
Note The Create Recovery H3D option is useful in fatigue analysis. A smaller flex H3D file is
generated that contains the minimum amount of information required for MBD simulation
in MotionSolve. A larger file, *_recov.h3d, is also generated that contains additional
information for displacement, velocity, acceleration, stress, and strain. Refer to
Recovering MBD Analysis Results in OptiStruct to learn more about using this method
for fatigue analysis.
11. Under Specify units in bulk data file, select the following:
Length Millimeter
Force Newton
Time Second
Note HyperMesh is unit-less and you need to make sure to use consistent units, or the
flexbody generated will have incorrect modal frequencies. In the given input file, the
density used is in unit kg/mm^3. Hence, you will use kilogram as the mass unit in this
exercise.
12. There are three RBE2 spiders already in sla_flex_left.fem. The fourth RBE2 spider should be
created using the Create RBE2 Spiders option explained in the next step.
Note: If the finite element model definition is complete (all interface nodes and connections already
exist), this step is not required.
An RBE2 is a rigid element whose independent degrees of freedom are specified at a single grid point
and whose dependent degrees of freedom are specified at an arbitrary number of grid points. This is
usually used to model relatively stiff connections.
2. HyperMesh is invoked. The input file, sla_flex_left.fem, is imported into HyperMesh and the
FE model is displayed in the graphics area of the screen.
Note If HyperMesh asks for a user profile, click Cancel and go to the utility panel in the
Browser area.
The Tab area displays a Utility tab with a user-defined page with three buttons (steps 1 to 3).
Note If the user defined page with the three buttons is not displayed, follow these steps to
view it:
From the Utility menu, click the User button, located at the bottom of the page.
4. Zoom into the area of the lower ball joint location as shown in the image below:
8. Click the Step 3: Save and Close, which will save the modified file and automatically grab the ID
of the center (interface) node. Give a new name to the file sla_flex_left_complete.fem and
check to see if the interface node ID is added to the flex prep.
Based on the inputs provided here, FlexBodyPrep creates a new FEM file by appending _prp to the
input filename and submits it to Optistruct. In this case, sla_flex_left_complete_prp.fem is
created.
Messages from the FlexBodyPrep translator are displayed in the Output window. Check the
status of the Optistruct run and look for any error messages there.
1. From Select window mode drop-down menu on the toolbar, select HyperView.
The flexible arm model and its modal results are contained in the H3D flex file you created using
the Flexprep wizard.
HyperView automatically updates the Load results file field with the same filename.
Flexible LC A Model
HyperView sequentially animates the flexible control arm through its mode shapes. The mode
number and its frequency are displayed at the top-right of the window.
7. Click the Select animation mode arrow and from the drop-down list, select Set Modal
Animation Mode.
8. To animate a particular mode shape, go to the Results Browser and change the mode from
Undeformed Model Frame to Mode 7.
10. Click the Contour button, , to view the stresses on the flexbody.
11. From the Result type drop-down menu, select Stress and vonMises. For Entity with layers,
select Z1 as shown in image below:
The above exercise demonstrated generating a flexible body using MotionView. Flexible bodies
can also be generated by using Hypermesh and Optistruct. To learn more, you can refer to
tutorial OS-1930 - Generating a Flexible Body for use in Altair MotionSolve.
The sla_flex_left.h3d flexbody created in the earlier exercise is the lower control arm of a left
front SLA suspension. Now, we will create a symmetric flexible body for the right front SLA suspension
by invoking flex prep in batch mode.
Note In this exercise, you will run the FlexPrep translator from the MS DOS prompt for the Windows
Operating System. You may follow analogous steps for the Linux/Mac OS terminal.
4. Go through the usage options for running the FlexPrep translator in batch mode.
6. FlexPrep creates the mirrored lower control arm sla_flex_right.h3d flexbody file.
2. The first few lines of the FEM file are given below with explanation for each line:
Line 1: SUBCASE 1
Line 3: CMSMETH 1
Line 4: STRESS=ALL
Line 5: STRAIN=ALL
A generalized input deck (FEM file) need the cards specified above to generate a flexbody from
Optistruct. The definition of each line is as follows:
Line 2: OUTFILE used to specify a base name for the H3D file.
Line 3: CMSMETH is the card defining the component mode synthesis solution method used to
generate flexbodies in Optistruct.
Line 4: STRESS=ALL use to specify that modal stresses are to be computed by Optistruct for all
the elements in the model.
Line 5: STRAIN=ALL use to specify that modal strain values are to be computed by Optistruct
for all the elements in the model.
Line 8: PARAM COUPMASS -1 defines values for parameters used by Optistruct for the
generation of a flexbody. In this case, lumped mass matrix approach is used by Optistruct for
eigenvalue analysis.
Line 9: PARAM CHECKEL YES parameter to perform element quality check before running the job.
Specifying NO makes the solver skip the element check. Elements with poor quality may lead to
inaccurate results.
Line 10: CMSMETH CB 10 component mode synthesis method selected is Craig Brampton and 10
modes are requested.
Lines 11 to 14: ASET1 defines the boundary degrees of freedom for the interface nodes.
With these cards specified, Optistruct generates a flexbody H3D file. The flexbody size can be
large based on the bulk data file, number of interface nodes, and modes and stress/strain details.
It is possible to reduce the size by using any of following methods:
MODEL Set Reduces the model information that is used for graphical display.
STRESS/STRAIN Set Reduces the number of elements on which stress or strain
calculation is requested.
OUTLINE Reduces the model information to display only boundary edges.
Reduced DOF Reduces the number of DOF that contribute to the flexible body information.
Modifying the Input Deck to Incorporate Stress/Strain Set, Model Set, Outline
and Released DOF into the Flexbody
In finite element modeling, nodes or elements can be grouped together to form a SET. These groups
can then be used in other modeling cards that can take the nodes and elements as inputs collectively.
STRESS=[setid|ALL|NONE]
STRAIN=[setid|ALL]
If NONE is specified, the stress is not calculated on any elements. (Not having the STRESS card has
the same effect).
In the FEM file that is opened, you can observe SET cards defined for nodes (keyword GRID) and
elements (keyword ELEM).
1. Modify the cards STRESS=ALL and STRAIN=ALL as STRESS=5 and STRAIN=5, respectively.
4. Generate the flexbody using FlexBodyPrep. From the Optistruct Flexbody Generation drop-
down menu, select the option Create h3d flexbody using pre-existing prp file.
Note You can use Optistruct to generate the flexbody. To run Optistruct from the command
prompt, type the following the working directory: <install>\hwsolvers\bin\win32
\Optistruct.bat sla_left_stress_strain_set.fem.
5. Start a new MotionView session and change the window type to HyperView.
7. Go to the Contour panel to apply Stress and Strain contours. You will see that only a few
elements display the contours. These are the elements that were pre-selected for stress and
strain computations using the element set.
Where MODEL is the Optistruct card that determines the elements to be written to the result file
(H3D). setid is the ID of set that defines the element displayed.
4. Save the file sla_flex_left_model_set.fem to your working directory and close the file.
5. Run the FEM deck in Optistruct or you generate the flexbody using FlexBodyPrep. From the
Optistruct Flexbody Generation drop-down menu, select the option Create h3d flexbody
using pre-existing prp file.
You will see that only a part of the flexbody is displayed. Only those elements included in the set
that is used with the MODEL card are displayed here.
PLOTEL EID G1 G2
Where PLOTEL is the element type, EID is the element ID, G1 and G2 are the nodes used to define the
element. For example: PLOTEL 8786 4698 1702
The FEM file that you are working with already contain PLOTEL elements.
You can use the features option in HyperMesh to generate the PLOTEL elements of the
feature edges of your model automatically. The features option is available on the Tool page
in HyperMesh.
Save the FEM file and run it in Optistruct to generate the flexbody that displays only the
PLOTEL elements.
1. Open the FEM deck sla_flex_left_model_set.fem, saved earlier in your working directory.
Within the BULK DATA, you will be able to see the many PLOTEL elements.
5. Run the FEM deck in Optistruct or you can generate the flexbody from FlexPrep. From the
Optistruct Flexbody Generation drop-down menu, select the option Create h3d flexbody
using pre-existing prp file.
You will see that the flexbody is shown only as lines or edges defined by the PLOTEL elements
The ASET1 card is used define the boundary degrees of freedom of an interface node of a flexbody.
This means that the interface node of ID 4927 will be constrained for all DOF, where 123456
represents the three translational and three rotational nodes in that order. Thus, to release a DOF
from the interface node (for example, rotation about X), the C value will be 12356.
1. Modify the ASET1 card corresponding to interface node 10004 in the deck as follows:
ASET1, 123, 10004
3. Save the file in your working directory as sla_flex_left_rdof.fem and close the file.
4. Run the FEM deck in Optistruct or generate the flexbody from FlexPrep. From the Optistruct
Flexbody generation drop-down menu, select the option Create h3d flexbody using pre-
existing prp file.
5. Check the size of the H3D file generated and you will notice a reduction in size; this is due to the
released DOF incorporated into the flexbody.
Compare the sizes of all the H3D files generated using the cards mentioned in this step to know
the reduction in file size.
use the flexible bodies created in tutorial MV-2010 in an MBD model and solve the model using
MotionSolve.
Step 1: Replacing rigid bodies with flexible bodies and solving them in
MotionSolve.
In this exercise, you will integrate the flexbodies into your MBD model.
1. From the MotionView menu bar, select Model > Assembly Wizard to bring up the wizard.
2. Use the criteria from the table below to assemble a front end half vehicle model.
Panel Selection
You should make sure to select Frnt. SLA susp (1 pc LCA) since the flexible bodies you have
created are for this suspension geometry.
3. From the MotionView menu bar, select Analysis >Task Wizard to display the wizard.
4. Load a Static Ride Analysis task from the Task Wizard - Front end tasks. Click Next and click
Finish.
7. Under the Properties tab for the Lwr control arm-left, deselect the symmetry check-box,
Symmetric properties.
8. The Remove Symmetry confirmation dialog is displayed. Click Retain to retain the current
values of properties of Lwr control arm-right.
9. Select the Flex Body (CMS) check box and click Yes to confirm both sides as deformable.
Notice that the graphics of the rigid body lower control arm vanishes.
10. Using the Graphic file browser, , select the file sla_flex_left.h3d (created in earlier tutorial
MV-2010) from your working directory.
11. You will see that the H3D file field is populated automatically with the same path and the file
name as the graphic file you specified in point 10.
Properties panel
Note You need to specify the flexbody H3D file as the H3D file. Specify the same or any other
file as the Graphic file.
Use of large flexbodies is becoming very common. For faster pre-processing, you can use any graphic
file for the display and use the flexbody H3D file to provide the data to the solver. You can use the
input FEM deck or the CAD file used for the flexbody generation to generate a graphic H3D file using
the CAD to H3D Conversion and specify that file as the Graphic file. This will make pre-processing
a much more efficient process.
The Locate button on this panel is an optional step to relocate a flexible body if it is not imported in
the desired position. This may happen if the coordinate system used while creating the flexible body
in the original FEM model does not match the MBD model coordinate system. However, if your flexible
body is already in the desired position, you can skip this step.
The Nodes panel is used to resolve the flexbodys attachments with the vehicle model, since the
vehicle model is attached to the flexible body at these interface nodes.
This panel lists all markers of the connections (joints/forces)on the body which is now flexible.
These markers can interact with the flexible body only through a node. This panel is used to map
each of the markers to a node. The panel also displays the point coordinates of the marker origin
which are nothing but coordinates of a point entity that the connections are referring to.
13. Click the Find All button on the Nodes dialog to find nodes on the flexible body that are located
closest to the interface points on the vehicle model. Node ID column is populated with the
interface node numbers for each row of connections. Also, the node coordinate table is also
populated along with the Offset with respect to the point coordinates.
14. Observe a small offset for the Lwr ball jt-Marker J-left. It suggests a difference in the
coordinate values between the point at which the joint Lwr ball jt is defined and its
corresponding location of the interface node 10004. Click Align to move the point to the nodal
coordinate position.
Note Many times there is a little offset between the flexible body interface node and its
corresponding point in the model. When you click the Align button, MotionView moves
the connection point in the model to the node location on the flexible body. This could
affect other entities that reference this point. Hence, this option should be used with
caution. Generally, it is common to have minor offsets (values between 0.001mm to
0.1mm). If the offset is more than the tolerance value, MotionView inserts a dummy
body between the flexible body and the nearest connection point. If the offset value is
too high, it could indicate an mismatch of the FE model information with respect to the
MBD model. In such an event, it is recommended to review the models and reconcile the
differences.
Note By default, for frequencies under 100Hz, 1% damping is used. For frequencies greater
than 100Hz and less than 1000Hz, 10% damping is used. Modes greater than 1000 Hz use
critical damping. You can also give any initial conditions to the modes.
Please note that when selecting the modes, the simulation results may vary as you
change the modes to be included in the simulation.
Now you will review the properties of the FEM model file.
20. From the Tools menu, select Check Model to check your complete MBD model for errors.
22. Click the Run icon, , on the toolbar and run the model with simulation type Quasi-Static,
specifying the filename as sla_flex_ride.xml.
23. Once the run is complete, load the MotionSolve result file sla_flex_ride.h3d (located in your
working directory) in a HyperView window and view the animation of the run.
2. Click the Model Browser on the left of the graphics area and expand the model tree to review all
components, properties, and materials of the model.
4. Identify the interface nodes of the flexible body. Please check the following nodes by ID: 9751,
9750, 10090.
1. In MotionView, from the FlexTools menu, select Flex Prep. The FlexBodyPrep dialog is
displayed.
2. Once the FlexBodyPrep dialog is displayed, enter the following information in the FlexBodyPrep
dialog to generate the flexbody for building the door closure model.
3. See the image above where the entries and options on the FlexBodyPrep dialog are labeled with
numbers.
5. For #3, Save the h3d file as:, specify the output H3D file as metro_door_flex.h3d.
6. For #4, Specify Interface Node List, specify the interface node numbers as: 9751+9750+10090.
7. For #5, Cutoff type and value: select Highest Mode # and enter 20.
8. For #6, activate both Perform stress recovery and Perform strain recovery, and select No for
Perform element check in Optistruct model.
11. The flexbody H3D file is generated in the selected folder with the name metro_door_flex.h3d.
For this model, use the following units for length, mass, force, and time, respectively: millimeter,
megagram, Newton, second.
Model Units
1. From the Forms panel, , change the Mass units from the default Kilogram to Megagram.
Points
1. From the Project Browser right-click Model and select Add Reference Entity > Point (or right
click on Points icon, , from the toolbar. Add the points as shown in the table below.
In this model, there are two bodies: one body to represent the car and another to represent the
flexible door.
1. From the Project Browser, right-click Model and select Add Reference Entity > Body (or right-
click the Bodies icon, , from the toolbar. Add a body and label it Car Body.
2. Specify the center of mass of the body as the point Car Body CG from the CM Coordinates tab.
3. Click the Properties tab of the Car Body and enter the mass and inertia properties values as
shown in Table 2 below.
6. Browse and specify the metro_door_flex.h3d file as the Graphic file: and H3D file: of the Door
Body. Use the flexbody file generated in Step 2 above.
After Point 6 above, we see that the Door Body has a graphical representation, but Car Body is still
not graphically represented. Lets add a File Graphic to the Car Body so that visualization of the
model becomes more meaningful.
2. From the Input File drop-down menu, select HyperMesh. Use the file browser to select the
HyperMesh file car_body_graphics.hm. The Output Graphic File field is automatically
populated.
3. Click OK. The HyperMesh file is converted to H3D and imported into the MotionView window.
5. From the Connectivity tab, double-click the Body button and pick Car Body as the body. This
will associate the selected graphic with the Car Body.
Joints
For this body, we will need to add a total of four constraints/joints. One of these joints will need to
be added using the XML Template.
1. From the Project Browser, right-click Model and select Add Constraint > Joint (or right-click
the Joints icon, , from the toolbar). Add joints as specified in the table below.
Once the joints are specified and since there is a flexible body in the model, the interface nodes
of the flexible body have to be associated with corresponding joint markers.
4. From the Nodes dialogue, click Find All to find the interface node numbers and to resolve them
with the respective connection markers.
Initial Conditions
In this simulation, we will have body initial velocity as the primary motion input to the model.
1. From the Project Browser, select the Door Body from the filter on the left.
3. Activate WZ and specify a value of 5.0 for the same. This will be the magnitude of the initial
angular velocity about the global Z axis that will be applied to the Door Body.
4. Do a test simulation to check how the model behaves with just the initial velocity and the
constraints.
To represent the locking mechanism of the car door, we will use a sensor activated fixed joint
between the Car Body and the Door Body that initially is deactivated. The fixed joint will need to be
created using XML templates since the MotionView interface allows joints to be created using bodies
and points. In this case, we need to create the joint between two initially non-coincident markers.
1. From the Project Browser, right-click Model and select Add Reference Entity > Marker (or
right-click the Marker icon, , from the toolbar. Add two markers as specified in the table
below.
2. Once the markers are created, repeat steps 2-4 under Joints above to resolve the node
connections of Car Door Body with the maker Door Lock Mark.
Sensor
In this model, we will use an Event Sensor to detect the closing of the door. At the instance of the
event detection, the fixed joint between the door and the car body is activated to simulate the actual
locking mechanism.
1. From the Project Browser, right-click Model and select Add General MDL Entity > Sensor (or
right-click the Sensor icon, , from the toolbar. Add a sensor and label it Lock Recognize.
2. Click the Signal tab and change the signal type from Linear to Expression.
The DY function accepts three markers as arguments. It returns the Y distance of the first
marker from the second marker in the third markers reference frame. In this case, the first
marker is the maker labeled Door Lock Mark, which belongs to the Car Door Body. The second
and the third marker is Car Body Lock Mark, which belongs to the Car Body.
4. From the Compare To tab, specify 0.0010 for Value: and 0.0001 for Error: Under Respond if:,
select Signal is less than VALUE + ERROR.
5. From the Response tab, activate the Return to command file check box.
To simulate the door lock, we need a fixed joint between the door and the car body. The fixed joint
needs to be activated with the sensor. The activation of the joint and the deactivation of the sensor
can be done using a sequential simulation operation.
1. From the Project Browser, right-click Model and select Add General MDL Entity > Template
(or right-click the Template icon, , from the toolbar). Add a template to the model and label
it Lock Fix Joint.
2. From the Properties tab of the template, under Type:, select Write text to solver input deck.
3. Type in the following definition of the fixed joint in XML format in the template are of the panel:
<Constraint_Joint
id = "1001"
type = "FIXED"
i_marker_id = "{the_model.m_door.idstring}"
j_marker_id = "{the_model.m_car.idstring}"
/>
This defines the fixed joint between the two markers Door Lock Mark and Car Body Lock Mark.
4. From the Project Browser, right-click Model and select Add General MDL Entity > Template
(or right-click the Template icon, , from the toolbar) to add another template.
6. From the Properties tab of the template, under Type, select Write text to solver command
file.
7. Below are XML Commands for the sequential simulation. Enter the following blocks of XML
commands in the template area of the panel:
<Deactivate
element_type = "JOINT"
element_id = "1001"
/>
<Simulate
analysis_type = "Transient"
end_time = "1.0"
print_interval = "0.001"
/>
<Activate
element_type = "JOINT"
element_id = "1001"
/>
<Deactivate
element_type = "SENSOR"
element_id = "{the_model.sen_0.idstring}"
/>
<Param_Transient
integrator_type = "VSTIFF"
/>
These set of XML blocks define a sequential simulation operation as specified in the steps below:
8. Save the model once by selecting Export > Solver Deck from File menu.
9. From the Run panel, click the file browser, , next to Save and run current model and specify
a name for the solver XML file.
11. Once the run is complete, click Animate to animate the simulation results.
Theory
You can submit Adams dataset language files (ADM and ACF) directly to MotionSolve, thus avoiding
manual translation. The Adams model is first automatically translated into the MotionSolve XML format
and then it is solved. If the Adams model has a flexible body represented by the MNF and MTX files,
the MotionView Flexprep utility will be used to generate an H3D flexible body file (using the MNF file).
This H3D flexbody file is the MotionSolve equivalent of the Adams MNF and MTX files. It holds the
mass and inertia properties, as well as the flexibility properties which allow the body to deform under
the application of loads. The deformation is defined using a set of spatial modes and time dependent
modal coordinates.
Process
In this tutorial, an Adams single cylinder engine model (ADM and ACF) is provided. To improve the
accuracy of the model responses, the connecting rod is modeled as a flexbody (MNF and MTX). This
chapter deals with transient analysis of this single cylinder engine model using MotionSolve.
We will modify the ACF file to include an argument that would generate a flexbody H3D file.
MotionSolve internally calls OptiStruct, which generates the H3D flexbody file. The ADM and ACF is
translated into MotionSolve XML format and solved. MotionSolve outputs the results H3D file, which
can be loaded in HyperView for animation. In HyperView, external graphics (for piston and crank) can
be added for visualization.
MotionSolve supports most of the Adams statements, commands, functions, and user subroutines.
Refer to the MotionSolve Users Guide help for additional details.
Tools
Copy the following files, located in the mbd_modeling\motionsolve folder, to your <working
directory>:
single_cylinder_engine.adm
single_cylinder_engine.acf
connecting_rod_flex_body.h3d
Flexible_body.mnf
Flexible_body.mtx
piston.h3d
crank.h3d
3. From the toolbar, click the arrow next to the Open Session icon, , and select Open
FLEX_BODY/1, H3D_FILE=connecting_rod_flex_body.h3d
5. From the toolbar, click the Save Document icon, , and save the file as
single_cylinder_engine.acf to your <working directory>.
Note The connecting_rod_flex_body.h3d file that has been used in this tutorial is generated
using the FlexPrep utility in MotionView. Refer to the MotionView online help for more
information on converting an Adams MNF file into a MotionView H3D flexbody.
2. For Input file, click Browse and select All files (*.*) from the file type menu. Select the input
file single_cylinder_engine.acf from your <Working directory>.
3. Click Run.
MotionSolve translates the Adams model (ADM, ACF) to the MotionSolve XML format and solves it.
MotionSolve internally invokes OptiStruct, which converts the connecting rod flexbody MNF and
MTX files to a flexbody H3D file.
Note MotionSolve is completely integrated into MotionView. You can also use the Run icon,
, from the toolbar in MotionView to perform this action. MotionSolve can also be run
from the command prompt. Open a DOS command window, and at the command prompt
type:
[install_path]\hwsolvers\scripts\motionsolve.bat input_filename.
[fem,acf,xml]
The Load results file field will be automatically be updated with the
single_cylinder_engine.h3d file.
3. Click Apply.
4. From the Add Object panel, , using the Add object from: browser, select the piston.h3d
file. If the Add Object icon is not visible on the toolbar, select the View menu > Toolbars >
HyperView > Tools.
5. For Select object, select All to add all objects to the list.
6. Using the expansion button, , select Piston as the component with which you want the
selected object to move.
8. Click Add.
Note Remember to select the crank.h3d file in the Add Object from: browser and attach it to
Crank using the expansion button.
10. Click the Contour icon, , on the toolbar. From the Result type drop-down menu, select the
data type that should be used to calculate the contours.
11. Select a data component from the second drop-down menu located below Result type.
Note If you select Mag (Magnitude), the results system is disabled (since magnitude is the
same for any coordinate system).
13. Click the Start Animation icon, , on the toolbar to animate the model.
Note In the Add Object from: browser, you can directly select a wavefront file (*.obj) from
Adams to add graphics. Whereas, if you have a Parasolid file (*.x_t) from Adams, use
the Tools menu > Import CAD or FE utility in MotionView to generate an H3D file. You
can then use this file to add the graphics.
Forces acting on a flexible body may be an aerodynamic load, liquid pressure, a thermal load, an
electromagnetic force or any force generating mechanism that is spread out over the flexible body,
such as non-uniform damping or visco-elasticity. It may be even a contact force between two bodies.
These distributed loads can be conveniently transformed from Nodal to Modal domain and represent
as Modal Forces.
If we define as the mode shapes of the flexible body, and as the Nodal load acting on the
flexible body, the equivalent Modal load on the flexible body is defined as:
Exercise:
In this exercise, you will create a flexible body of a Fore Canard of an aircraft with aero-dynamic loads
using Optistruct. Aero-dynamic loads for three operating positions of the fore canard, namely -10
deg, 0 deg, and 10deg, considering an air speed of 200m/sec at 1 atm pressure are available from a
CFD simulation using AcuSolve. A later section of the exercise involves embedding this flexible body in
the actuator mechanism model in MotionSolve to estimate actuator loads required for the operation of
fore canard.
Copy all of the files located in the mbd_modeling\flexbodies\modalforce folder to the <working
directory>.
Note Please note model units are Newton-Meter-KG-Sec, therefore all properties defined are
consistent with this unit system.
Average pressure distribution over the surface of canard is exported as text file from
AcuFieldView. This file contains the location and value of the pressure. The
AerodynamicLoad_0deg.csv, AerodynamicLoad_Negative10deg.csv, and
AerodynamicLoad_Positive10deg.csv files contain the pressure distribution information for
0deg, -10 deg, and 10 deg of canard orientation respectively.
Verify that the create radio button is selected and specify a new load collector name as
AerodynamicLoad_0deg.
With drop-down menu for card image set as no card image, click on the create button.
Follow steps above to create the other two load collectors with names as
AerodynamicLoad_Negative10deg and AerodynamicLoad_Positive10deg.
Click return.
Analysis page
Pressures panel
Select entities from the drop-down menu to switch the surface selection type from faces to
elems.
Upon selection of the above settings, you can select elements on which pressure loads are
applied and a CSV file for pressure load info.
Pressure loads for each position are created under their respective load collectors so that you can
scale them in MotionSolve with respect to the canard position. Create a pressure load for 0deg
by following the steps below.
Left click on the Set Current Load Collector button located at the bottom.
Information bar at the bottom with current model, component, and load collector information
Select the Fore Canard collector from the component collector list and activate the select
button to return back to pressures panel.
The Open dialog box is displayed. Browse to your <working directory> to select the
AerodynamicLoad_0deg.csv file and click Open.
Note The pressure load on each element is obtained by a linear interpolation of pressure values
with respect to its location.
Follow the above steps to create pressure loads for -10deg and +10deg under the respective
load collectors AerodynamicLoad_Negative10deg and AerodynamicLoad_Positive10deg.
Three load cases modeled in previous step represent nodal forces. These nodal forces are
transformed as modal forces using CMS method. In this step you modify the existing CMSMETH
card image to include three load sets.
C MS load collector card image dialog with method specified as C raig-Bampton (C B) and the number of modes
as 25
Observe that the Card Image shows an option to specify three load sets.
Specify load collectors for three load sets by following the steps below:
Click Return.
8. Generate flexbody.
Your model is now ready for solving to generate a flexbody. The two control cards required to
solve for flexbody creation are already specified in the model.
Click on GLOBAL_CASE_CONTROL in the next card to see the CMS load collector specified
for CMSMETH solution.
Analysis Page
On successful completion of solver run, open the flexbody flex_ForeCanard.h3d created from
Optistruct run in HyperView to review the various mode shapes. Your flexbody contains 34
modes constituting normal modes, constraint modes, and Static modes.
Four bodies namely Fore Canard, Torque Arm, Piston, and Cylinder.
A motion on the Piston with an expression 0.025*SIN(2*PI*TIME) to extend and retract the
piston by 25mm at 1 Hz. This piston motion varies the fore canard angular position between
-9.619 deg to +9.984 deg.
The Fore canard angular position is measured from the RevJnt_TorqueArm_Gnd joint
rotation angle using the expression `RTOD({j_4.AZ})`.
The Piston force is measured from the Piston Motion using the expression
`MOTION({mot_0.idstring},{0},{4},{j_2.i.idstring})`.
Output requests
Solve the model with the rigid Canard to review piston forces without aero-dynamic loads.
Invoke the Run panel by clicking the Run Solver button, , in the toolbar.
Select the Simulation type as Quasi-static, the End time as 1 sec, and the Print
interval as 0.01.
After the simulation is completed, click on the Animate button to view the animation in
HyperView.
Initial position 0 deg (meshed) and rotated position 10deg at 0.25 sec of simulation
Plot the Piston Force versus Fore Canard Angular Position by selecting the below data in
HyperGraph.
X Type Expression
X Component F2
Y Type Expression
Y Component F3
The piston forces in this case are due to the canard mass moment of inertia.
Browse and select the Fore Canard body from Project browser.
Body panel
Browse to your working directory, specify flex_ForeCanard.h3d for the Graphic and H3D files.
The aero-dynamic loads are estimated at three distinct positions of canard namely -10 deg, 0deg,
10deg. We assume the each pressure load to linearly vary in interval 10deg on a 0 to 1 scale.
This variation of the aero-dynamic loads is achieved by scaling Modal Forces with respect to
canard angle using an expression.
Specify the Label as Angle Measure and the Variable name as sv_ang.
Click OK.
This creates an explicit variable that measures the Fore Canard angle.
Add a ModalForce:
From the Connectivity tab, specify Fore Canard for the FlexBody.
Specifying flexbody
From the Properties tab, specify the scaling type, expression, and load case ID as shown
below:
The product of the two STEP functions evaluates to gradually increasing the value of the scale
from 0 to 1 and then back to 0, while the canard angular position varies from -10deg to 10 deg as
shown in the expression below:
1. Invoke the Run panel by clicking the Run Solver button, , in the toolbar.
3. Select the Simulation type as Quasi-static, the End time as 1 sec, and the Print interval as
0.01.
5. After the simulation is completed, click on the Animate button to view the animation in
HyperView.
9. Click on the Plot button from MotionView Run panel to load the ForeCanard_withAeroloads.abf
file in HyperGraph2D.
10. Plot the Piston Force versus Fore Canard Angular Position by selecting below data in
HyperGraph2D.
X Type Expression
X Component F2
Y Type Expression
Y Component F3
You can overlay the plots to observe the difference in piston forces with and without aero-
dynamic forces.
Overlay of results
4. Click Next.
6. Click Next.
Powertrain = None
8. Click Next.
11. From the Select springs, dampers and stabilizer bars dialog, select the following:
13. From the Select jounce and rebound bumpers dialog, set the options to None, and click Next.
14. From the Select Driveline Systems dialog, set the Front Driveline to Independent Forward,
and click Next.
All of the required systems that are necessary to build a front suspension model have now been
selected.
15. Click Next to load the assembled model and bring up the Attachment Wizard.
The Attachment Wizard shows the attachment choices which are available for each sub-
system. In this exercise, we will simply review the options in each sub-system and accept the
default selections.
16. From the Attachment Wizard, review the choices for each sub-system and click Next until the
last page of the dialog is reached.
This model represents a front end suspension of a vehicle with a Short Long Arm type (also known as
Wishbone) of suspension and a steering system. The vehicle body is fixed to ground. The upper and
lower control arms of the suspension are attached to the vehicle body at one end through bushings,
while they are connected to a knuckle on the other end through ball joints. A wheel hub (no graphics
for this body are in the model) is mounted on the knuckle through a revolute joint. The wheel is fixed
to the wheel hub.
The steering system consists of a rack with a translation joint with a rack housing (through a dummy
body). The ends of the rack are connected to a tie rod at each end through ball joints and the other
end of the tie rod is connected to the steer arm of the knuckle through ball joints. The rack gets its
movement from the steering column through a coupler constraint between the rack and the pinion.
Step 2: Adding a static ride analysis task using the Task Wizard.
The Analysis Task Wizard allows you to assign an event analysis to the model using a wizard. This
default suspension wizard is configured such that the available analyses choices are dependent on the
system selections made in the Assembly Wizard. Since this is a half-vehicle model, only events that
are applicable for a half-vehicle model are available. A full vehicle model would contain a different set
of analysis events.
In this step, we will add a static ride analysis for the suspension assembly. Through this analysis, the
kinematic characteristic of the suspension can be studied for varying vertical positions of the wheels.
Both wheels are exercised such that they move vertically along the same direction.
2. In the Task Wizards Front end tasks dialog select the Front end task as Static Ride
Analysis from the pull down menu.
3. Click Next.
5. Click Finish.
The Vehicle parameters dialog is displayed. Vehicle parameters such as wheelbase, jounce, and
rebound distances can be changed in this dialog.
The static ride analysis event consists of a pair of jacks that are attached to the wheels at the
tire contact patch location. The jacks are actuated through Actuator Forces that exercises them
in the vertical direction in a sinusoidal fashion.
The model tree in the Project Browser now includes an analysis called Static ride analysis. It is
possible to add many different analysis tasks to the same model, however only one analysis task
may be active at one time.
9. Expand the Static ride analysis folder and also the Forms folder (located underneath) by clicking
the + sign next to each folder in the Project Browser.
11. Change the values for Jounce travel (mm) and Rebound travel (mm) to 50.0.
12. Click and save the model as sla_ride.mdl in your <working directory>.
4. After the job is completed, close the Run window and the Message Log.
6. Select Front Ride-MSolve SDF based Report My Front SLA Supsension and click OK.
This analysis comes with a Standard Report Template that plots the results and loads the
animation in subsequent pages.
7. Once the process of adding the pages is complete, use the Previous Page/Next Page buttons
(located at the upper right corner of the window, below the menu bar area and above
the graphics area) to navigate and review the plots and animation pages.
8. The last page is the TextView client with an open Suspension Design Factors (SDF) report. This
report lists the suspension factors at each time interval of the simulation.
The path to the .reports file can also be set by selecting the Set Wizard path option under the
Model menu.
When View Reports from the Analysis menu is selected, MotionView displays the contents of the
.reports file in the Reports dialog. When you select a report from the dialog, MotionView loads the
requested report definition file into your session.
E:/Altair/hw/mdl/mdllib/Libs/Tasks/adams/Front/Ride/ms_rep_kc_front.tpl
The first line contains the report label, model label, and the date and time when the solver input files
were saved. This information is contained in the Reports dialog. It is recommended that you give
your models specific names, otherwise they will be labeled Model.
Line 2 contains the name of the report definition file that the report is to be derived from.
Line 3 contains an MDL statement called *Report(). This statement specifies the report definition
variable name along with the required parameters. Refer to the MDL online help for more information.
3. Change the X and Y coordinates of LCA frnt bush by -5 and +5 respectively (for example, if the
existing value of X is 932.15, append -5 to it so that the expression is 932.15-5).
4. Similarly, change the X and Y coordinates of UCA rear bush by +3 and -5 respectively. In
addition, change the Z coordinate of Lwr ball jt by +10.
5. Click on the Bushings tab and change the KZ values of LCA frnt bush and UCA frnt bush by -
200 and +200 respectively.
7. Go to the Run panel , and specify sla_ride_change.xml as the new file name for the xml file.
9. After the job is completed, close the Run window and the Message Log.
11. Select the latest report (the report located at the top of the list) and click OK.
The results from the latest run will be overlayed in the plot and animation windows. Compare the
plots.
13. Click the Entity Attributes panel button on the Visualization toolbar to enter the Entity
Attributes panel.
14. Activate the Auto apply mode check box (located in the middle portion of the panel).
15. Select a color from the color palette and click the All button.
All graphics belonging to the active result will change to the selected color.
16. Repeat steps 12 to 14 for sla_ride_change.h3d, however be sure to select a different color
from the color palette.
17. From the Animation toolbar, click the Start/Pause Animation button to animate the
results.
View the animation and observe the differences between the two overlayed models.
18. Navigate back to the MotionView page and save the model .
19. Click the Save Session icon on the Standard toolbar and save your session as
my_susp_analysis.mvw in your working directory.
The model, plot, and animation information is saved in the session file.
Learn the advantages of using Tcl programming to save time and effort in MBD model building
with MotionView
Work with the HyperWorks Desktop Tcl interface
Build a simple model using Tcl commands
About Tcl
Tool Command Language or Tcl (typically pronounced as "tickle" or "tee-see-ell") is a scripting
language that is commonly used for quick prototyping, scripted applications, GUIs, and testing.
Tcl/Tk is highly portable, and runs on different flavors of UNIX, windows, Macintosh and more.
This proves useful to those who work on various platforms.
Once the session handle is retrieved, it can be used to access all objects in the HyperWorks
database as shown below:
Windows are retrieved as shown below. Windows are assigned a client type, which can be modified.
A window's client type cannot be changed after the client handle has been retrieved. The client
handle must be released and retrieved again if the window's client type is changed.
The top level hwi command object supports the following utility commands:
Note Putting a # character in the beginning of any line makes it a comment and that line is not
evaluated. In addition, all HyperWorks Tcl commands are case sensitive.
The structure of every Tcl script created for HyperWorks Desktop products should follow the
following structure:
hwi OpenStack
hwi CloseStack
3. A TkCon window opens up and displays the version of Tcl and Tk installed with Hyperworks.
The prompt prints sess as the command output if the command is successful. This command
assigns the Session Handle to the variable "sess".
5. To view all the option/commands available with the hwi class type in hwi ListMethods at the
command prompt. This will list all the options available under hwi.
6. Now, type:
This command will assign the Project handle to the variable "proj".
7. The next step is to obtain the Page handle, the command for it is:
proj GetPageHandle page 1
The variable "page" now points to the page handle of the first page of the session.
Note Please refer the "Programming with Tcl/Tk Commands" online help under the "HyperView,
MotionView and HyperGraph" Reference Guide for the explanation on the syntax of these
commands.
8. To get the control of the window we need to get the window handle the command for that is:
page GetWindowHandle win 1
This assigns the window handle of the first window to the variable "win".
Note A HyperWorks session has multiple clients (HyperView, MotionView, HyperGraph 2D, etc). When
MotionView is invoked, the default client is MotionView. The GetClientHandle command gets
you the access to the MotionView model object through the Client Handle.
10. To be able to set different views and fit the model in the graphics window the view control handle
is required, the command to get view control handle is:
win GetViewControlHandle vch
11. To start with a new blank model we will run the command:
mc CreateBlankModel
Note Once the model handle is obtained we can now start creating entities using the
InterpretEntity and InterpretSet statements.
To build a simple pendulum we will be using 2 points, 1 body, 3 graphic entities, and 1
revolute joint.
Where:
Parameters The parameters which are required to create the respective entity (for
example, CM point for Body).
13. To start with Add a point for the pendulum pivot with variable p_0 and label Pivot with a
command:
m InterpretEntity p Point p_0 "\"Pivot\""
14. Now to set the properties of the point just created, the command is:
m InterpretSet SetPoint p_0 0.0 0.0 0.0
15. p is the Point handle for Tcl and is released with p ReleaseHandle command:
p ReleaseHandle
16. To create a point for the location of the pendulum mass and set the property for it, the set of
commands are:
m InterpretEntity p Point p_1 "\"Mass\""
p ReleaseHandle
17. Add the pendulum body and set its mass and inertia properties type in the following commands:
m InterpretEntity b Body b_0 "\"Pendulum\"" p_1
b ReleaseHandle
g ReleaseHandle
g ReleaseHandle
g ReleaseHandle
19. The pendulum will need to be connected to the ground with a revolute:
m InterpretEntity j RevJoint j_0 "\"Joint_Pivot_Rev\"" B_Ground b_0 p_0 V_Global_Y
j ReleaseHandle
20. After adding any entity to the model the database has to be updated by using the evaluate
command:
m Evaluate
22. The model is ready to be run. Go to the Run panel, specify a name for the result file and click on
the Run button to run the model using MotionSolve. Use the Animate button to view the
animation.
23. The handles obtained through the commands in the above steps now have to be released using
the ReleaseHandle command. Type in the following:
m ReleaseHandle;
mc ReleaseHandle;
win ReleaseHandle;
page ReleaseHandle;
proj ReleaseHandle;
sess ReleaseHandle;
24. In a text editor paste all the above Tcl commands and save the file as pendulum.tcl in the
working directory. This file can be "sourced" and the model can be built in one step. The complete
script is given below for your reference (please see the bottom of the tutorial).
Note You can also use the file pendulum.tcl located in the automation folder.
3. Click on Command Window. A TkCon window opens up at the bottom of the screen.
5. To invoke a Tcl script, use the command source pendulum.tcl, where pendulum.tcl is the file
that you saved in the previous step.
6. This will build the complete model by sequentially running the commands in the file line by line.
*BeginModelDefaults()
*EndMenu()
*EndModelDefaults()
Replace <working_directory> with the actual path on your machine to the working
directory, using forward slashes for the path, if necessary.
6. Click Register.
10. You should see a new menu My Scripts in the modeling client. This should be available every time
you open the MotionView session as long you have the preference file registered.
11. Click on My Scripts -> Build Simple Pendulum menu and run the script.
hwi OpenStack
win GetClientHandle mc
mc CreateBlankModel
mc GetModelHandle m
## Adding graphics to the pendulum and the Ground to improve result visualization
## Adding the Revolute joint between the Ground and the pendulum body
vch Fit
after 1000
mc ExportModel simple_pendu.xml
mc RunSolverScript simple_pendu.xml
m ReleaseHandle;
mc ReleaseHandle;
win ReleaseHandle;
page ReleaseHandle;
proj ReleaseHandle;
sess ReleaseHandle;
hwi CloseStack;
## End of Script
Invoke a TCL script from MotionView. The TCL script automates the model building, solver
runs and post processing in MotionView.
Link the script to a Menu Item on the menu bar in MotionView.
3. Right-click in the Command Window and select File > Load File.
5. Click Open.
Note You can also invoke the script by using the following steps:
*BeginModelDefaults()
*EndMenu()
*EndModelDefaults()
3. Save the file as script_invoke_menu.mvw and place at any convenient location on your
machine.
A preference file is a special script file that is read each time the program is started. It
specifies default user settings such as the order in which colors are assigned, the default
printer, default page layout, the autosave interval, and so on. Custom menu options in
MotionView can be added using a preference file.
To learn more about the preference file, type preference file under the Index tab under the
Help menu.
To learn more about the preference file statements, type preference statements under the
Index tab under the Help menu.
5. Click Register.
8. A menu called MotionView Tutorial Script is added to the Menu bar, under which you will find
the Menu item Tutorial Script.
9. Once this preference file is set, the new menu will appear every time HyperWorks Desktop is
invoked.
10. Start a new session of HyperWorks Desktop by pressing the SHIFT + F9 on your keyboard.
12. Click the Tutorial Script under MotionView Tutorial Script menu to invoke the script
simple_auto.tcl which in turn will make MotionView to perform the scripted operations.
Note If you no longer want your new menu item to appear on the menu bar, you can un-set the
preference file by going to the File menu and selecting Load > Preference File. From the
Preferences dialog, select script_invoke_menu.mvw and click on the Unregister button.
This will make MotionView unload the preference file.
This tutorial illustrates how to build a model with sensor elements to capture the state of a body, use
the sensor signal to activate some joints and deactivate others, and carry out a sequential
simulation.
OR
From the File menu, select Open > Model to open the model Sequential_simulation.mdl.
2. From the Project Browser, right-click on Model and select Add Constraint > Joint (or right-
click on the Joints icon, , from the toolbar). Under Type, select Translational Joint. Label
the joint slider trans.
This joint will be deactivated when the slider body coincides with the picker body during
simulation.
When you create a fixed joint between the slider and the picker and they come in contact, you
need to define two markers which are initially not coincident, but coincide during the course of
simulation. Creating a joint based on markers must be done using Templex, as it is not possible to
create it from the user interface.
5. From the Project Browser, right-click Model and select Add Reference Entity > Marker (or
right-click on Marker icon, , from the toolbar). Label it Marker Slider Track and set the
properties as shown in the image below:
6. Similarly, create another marker with the label Marker Picker Track and set the properties of
the markers as shown in the image below:
7. From the Project Browser, right-click Model and select Add Control Entity > Sensor (or right-
click the Sensor icon, , from the toolbar) to add a new sensor.
9. In the Compare to field, enter 0.0010 for the Value and 0.0010 for Error. Set Respond if to
Signal is greater than VALUE - ERROR.
This directs the solver to look into the template for further instruction on how to proceed once
the signal is attained.
11. From the Project Browser, right-click on Model and select Add Constraint > Motion (or right-
click on the Motion icon, , from the toolbar. Set the properties as shown in the figure below.
General MDL Entity > Template (or right-click on the Template icon, , from the toolbar).
2. Label it Fixed Joint Defn. For Type, select Write text to solver input deck. Enter the
following commands as they are listed below in the same order.
<Constraint_Joint
id = "5000"
type = "FIXED"
j_marker_id = "{the_model.m_1.idstring}"
/>
<ResOutput
plt_angle = "YAW_PITCH_ROLL"
/>
<ResOutput
mrf_file = "TRUE"
/>
<ResOutput
plt_file = "TRUE"
/>
<ResOutput
abf_file = "TRUE"
/>
<Deactivate
element_type = "JOINT"
element_id = "5000"
/>
<Simulate
analysis_type = "Transient"
end_time = "3.5"
print_interval = "0.01"
/>
<Deactivate
element_type = "JOINT"
element_id = "{the_model.j_1.idstring}"
/>
<Deactivate
element_type = "SENSOR"
element_id = "{the_model.sen_0.idstring}"
/>
<Activate
element_type = "JOINT"
element_id = "5000"
/>
<Simulate
analysis_type = "Transient"
end_time = "5."
print_interval = "0.01"
/>
<Stop/>
1. Click the Run Solver button, , and activate the Export MDL snapshot check box. This will
save your model file and export the solver data.
2. Click the Save and run current model button, , and enter a name for the solver run file. This
will save the model in the current state to run_xml_snapshot.mdl, where run_xml is the base
name of the solver run file being provided in the next step.
4. Click the Simulation Settings button. In the pop-up dialog, from the Transient tab, select
DSTIFF for the Integrator type. Click Close.
6. Once the solver procedure is complete, the Animate button on the Main tab is activated. Click
Animate to animate the model. Click to start the animation and to stop the animation.
Theory
HyperStudy allows you to perform Design of Experiments (DOE), optimization, and stochastic studies in
a CAE environment. The objective of a DOE, or Design of Experiments, study is to understand how
changes to the parameters (design variables) of a model influence its performance (response).
After a DOE study is complete, approximation can be created from the results of the DOE study.
The approximation is in the form of a polynomial equation of an output as a function of all input
variables. This is called as the regression equation.
Note The goal of DOE is to develop an understanding of the behavior of the system, not to find an
optimal, single solution.
HyperStudy can be used to study different aspects of a design under various conditions, including
non-linear behavior.
Copy the files hs.mdl and target_toe.csv, located in the mbd_modeling\doe folder, to your
<working directory>.
In the following steps, you will create a study to carry out subsequent DOE study on a front SLA
suspension model.
Or
From the menu bar, select File > Open > Model.
3. Select the file model hs.mdl, located in your <working directory>, and click Open.
4. Review the model and the toe-curve output request under Static Ride Analysis.
Or
Or
From main menu, select File > New. The HyperStudy - Add Study dialog is displayed.
Under Location, click the file browser and select <working directory>\.
Click OK.
7. Model definition.
Click OK.
Please note that following details are automatically filled when you define the model (previous
step).
o Under Active, check the box to activate or deactivate the model from study.
o Point to the source file (here model file is sourced from MotionView through the MotionView
HyperStudy interfacing)
Enter a name for the solver input file with the proper extension (for Motionsolve ->.xml) and
select the solver execution script MotionSolve - standalone ( ms ).
Click Import Variables to specify the design variables for the study.
The Model Browser window opens in MotionView, allowing you to select the variables
interactively.
Select the following from the Browser using the Model Parameter Tree dialog:
Front SLA susp. Otr tie-rod ball-jt -left Y Double-click or Click Add
Front SLA susp. Otr tie-rod ball-jt left Z Double-click or Click Add
Click Done.
From the Define design variables tab, edit the upper and lower bounds of the design variables
according to the following table.
Right click on the column header row to view more options that you may want to add.
This section allows you to specify the initial run for DOE.
Select the Nominal Run radio button for this study and click the Apply button.
12. Evaluate.
Make sure that all settings for the run (Write, Execute and Extract) are activated.
MotionSolve runs in the background and the analysis is carried out for the base configuration.
Please note the messages in status bar of the HyperStudy interface and the MotionView
interface. If message log is not visible, click the Message log button, , or go to View >
Message log to display the log.
Click the ellipses, , in the Expression cell of Response table to launch the Expression
Builder.
Note: You can move the cursor over the function to display the function help.
The elements of Vector 1 contain actual data points of the toe curve from the
solver run for the nominal configuration.
The elements of Vector 2 contain data points from the target curve.
Click the File Sources tab to source the data from the files.
Vector 1:
Click OK.
Click the ellipses, , in the File cell of vector table data to launch the Vector Source
(Vector 1(v_1)) dialog box.
Click the file browser button, , and select the file m_1.mrf from <working directory>
\approaches\nom_1\run__00001\m_1\.
You have now selected the toe curve data from the solver run as the data elements for Vector
1.
Click OK.
Vector 2:
Create a vector to hold the data elements from the target toe curve.
Click Add File Source to display the HyperStudy - Add File Source dialog box.
Click OK.
Click the file browser button, , and select the file target_toe.csv, located in your
<working directory>\.
Click OK.
sum((v_1-v_2)^2)
This expression evaluates the sum of the square of the difference between the actual toe
change values (from solver run) and the targeted toe curve (from imported file). In the next
tutorial, MV-3010, we will use HyperStudy to minimize the value of this expression to get the
required suspension configuration.
15. Click Evaluate expression to verify that the expression is evaluated correctly. You should get a
value of 16.289.
If you do not encounter any error messages and were able to successfully extract the response
for the nominal run, click Next to go to Post Processing.
Observe the table with the design variable values used for the nominal run and other tabs with
the post-processing options.
Observe various reporting formats available. The images and data captured during the post-
processing can be exported in any of the formats provided on Report page.
Right-click in the Explorer browser area and from the context menu, click Add Approach
to display the Add Approach dialog.
Or
From the Edit menu bar, click the Add Approach option to display the HyperStudy - Add
dialog.
Accept the default label and variable name and click OK.
All variables are used in the present DOE study, so make sure that all design variables are
active.
All the design variables in this study are controlled. Therefore, for Category, leave all variables
set to Controlled.
There is only one response in the present study - make sure to select the response.
The design space for the DOE study is created in this step. The present study has four design
variables with two levels each. A full factorial will give 24 = 16 experiments, as the number of
experiments are less. We will do a full factorial run. Selecting any mode from the list shows all
possible options in the Parameters panel area on the left side of GUI.
Click the Levels tab to see the design variables and number of levels.
Note: Options which are not applicable will be grayed out or a message will be shown.
DOE run:
The Tasks tab of Evaluate shows a table of 16 rows and four columns. Column 1 shows the
experiment number while other columns corresponding to each experiment get updated with the
experiment status of failure or success in the three stages of model execution: Write, Execute
and Extract.
Design variable values used under each experiment can be seen under the Evolution Data tab.
Once all the runs are finished, the tasks table gets filled up with the status for each run
(Success/Fail).
In the present DOE study, all runs are successfully completed. Click Next to go to Post
Processing.
The post-processing section has variety of utilities to helps user to effectively post process
results. Run Summary tab of Post processing page will provide a summary of design along with
responses.
The New Generation HyperStudy allows you to sort data by right-clicking on the column heading
and selecting the options from context menu.
The options to post-process are available in other tabs. The main effects can be plotted by
selecting the Linear Effects tab.
Click the Linear Effects tab to open the main effects plot window. From the Channel page,
select Variables and Responses for which main effects need to be plotted. Press the left
mouse button and move over the variable or responses list for multiple selection.
Select all controlled variables and responses to plot the main effect plot. This plot shows the
effect of each parameter on the response.
Note: Click on window icon, , (highlighted above) to toggle it to multiple windows, . Each
curve is displayed in a different plot window.
Interactions:
Interactions can be plotted from the Interactions tab following the above procedure. Here, we
will use the post-processing window to plot the interactions. Click Launch Post Processing to
display the Post-processing window.
Or
Click Close.
Close the Post Processing application. Confirm the request to quit the application.
Step 3: Approximation.
System response is approximated by using various curve fitting methods. An approximation for the
response with the design variables variation is calculated using the data from above DOE study. The
accuracy of the approximation can be checked and improved.
1. Adding an approximation.
Right-click in the Browser area and from the context menu, click Add Approach to display the
Add Approach dialog.
Accept the default label and variable names and click OK.
Click Next.
2. Input matrix.
Click OK.
A matrix table is created. Select the following options to specify the DOE results as the input
matrix.
Click Import Matrix to import the DOE results for the input matrix.
In this section, the approximation type and its properties are defined.
Click Evaluate Tasks to evaluate the approximation for the DOE experiments.
Upon completion, the table is populated with the status value (Success or Fail).
Click the Evolution Data tab to observe the experiment table with responses from the
MotionSolve run and responses predicted using approximation. The same can be viewed in
graph format by selecting the Evolution plot tab.
Select Sum of Squared of Squared Error and Squared of Squared Error_MLSM to plot
against the experiment numbers.
Post-processing provides you with statistical parameters and graphical tools useful in validating
the correctness of approximation.
The Residuals tab shows the difference between the response value from the solver and the
response value from the regression equation.
The residual values can be used to determine which runs are generating more errors in the
regression model.
The Trade-off 3D tab shows the plots of the main effects vs. response from the approximation.
From the toolbar, click the Save icon, , to save the study.
Note All study files will be saved in the study directory with the folder names that are the same as
the tree varnames. For example, nom_1,doe_1 and fit_1.
Theory
In general, an optimization problem consists of:
The changes in the design variables cause some change in model responses. Such responses can
become either objective function or design constraints. Examples of such responses include
displacements and forces.
The response to be minimized or maximized becomes the objective function, while the rest of the
responses that need to be within a certain tolerance range become constraints. Only one response
can be defined as objective function.
HyperStudy can be used to set-up and perform an optimization study on a MotionView model. You can
also use HyperStudy to perform optimization studies involving both linear and non-linear CAE analysis
as well as perform optimization of mathematical equations using Templex. HyperStudy creates the
input parameter files using Templex and provides iterative changes to them during the optimization
process. HyperStudy uses HyperOpt (a general purpose, wrap around software) as the optimization
engine to perform optimization, in conjunction with both linear and non-linear CAE analysis software.
HyperOpt uses a robust sequential response surface methodology for optimization.
The files needed for this tutorial are hs.mdl, target_toe.csv (used in tutorial MV-3000); Setup.xml
saved in tutorial MV-3000 and the nom_run folder created in tutorial MV-3000.
These files should be in the <working-directory> that was used in tutorial MV-3000.
Note: If you copy the Setup.xml file from the above location, the path in the <Folder> tag in the
file needs to be edited to point to your <Working directory>.
In the following steps you will perform an optimization study on a front SLA suspension model and
determine the optimum coordinate positions of the inner and outer tie-rod points while trying to
achieve a target toe curve. The baseline model will then be compared with the optimized model.
6. Click on open file icon, , browse to your study directory and select Setup.xml file created
during the MV-3000 tutorial.
Right-click in the Explorer Browser area and from the context menu, click Add Approach to
launch the HyperStudy - Add dialog box.
Or
From the Edit menu bar, click the Add Approach icon, , to launch the HyperStudy - Add
dialog box.
Accept the default label and variable name and click OK.
This panel displays all the variables and their upper and lower bounds.
Accept the default label and variable names and click OK.
In this exercise, minimize the Sum of Squared Error response function to obtain optimum values
for the design parameters: the Y and Z coordinate positions of the inner and outer tie-rod points.
Check to make sure that the type is set as Minimize from the drop-down menu.
Check to make sure that the Evaluate From option is set to Solver.
10. We will not have any constraints and unused responses in our design, so click Apply and then
click Next to go to Specifications.
Accept the default Optimization Engine: Adaptive Response Surface Method and click Apply
and Next. The Maximum iterations and Convergence criteria are specified in the same dialog.
MotionSolve is launched sequentially and the HyperOpt engine attempts to find a solution to the
problem.
Once the optimization is complete, an Iteration table is created with status of each run. The
present study took nine iterations to achieve the target. Browse through the other tabs of this
page to get more understanding of the iteration history.
14. From the list on the right side of the GUI, select the Objective function named Objective_1 .
In this panel, you can see the plots variations in the values of the objectives, constraints, design
variables, and responses during different design iterations. The Iteration History Table displays
the same data in a tabular format.
4. Click the Page Layout icon on the toolbar and select the two-window layout.
7. Use the Build Plots file browser and select the file target_toe.csv, located in the <working
directory>.
Type = Unknown
Request = Block 1
Component = Column 1
Type = Unknown
Request = Block 1
Component = Column 2
11. Using the file browser on the Build Plots panel, select the file <working directory>
\approaches\nom_1\run__0001\m_1\m_1.abf
Type = Expressions
Component = F2
Type = Expressions
Component = F3
You should end up with a session looking like the one shown below. Notice the optimized toe-
curve.
Optimization results
You may also overlay the animation of the optimal configuration (run 6) over the nominal run.
Notice the toe angle differences.
Identifying and summarizing all loads acting on one/multiple body(ies) for any given time
step(s) in a tabular format.
Identifying and transferring all the forces and moments for one component at any given time
step(s) to a NASTRAN input deck that contains GRID, CORD, FORCE, and MOMENT cards.
Editing the MDL model file to add force output requests on body(ies).
When performing the MS/ADAMS solver run on the MotionView model, you will get a metadata file (an
ASCII file written out from MotionView that contains information about force output on a body).
This file along with the solver output files viz. MS (*.plt) or ADAMS (*.req) become the input files for
this utility. The application scope of this utility is shown in the figure below:
Interaction diagram
3. Load the front vehicle model file load_export.mdl, located in <working directory>.
4. Right-click on The Model in the Project Browser and select Add General MDL Entity > Output,
6. Use the drop-down menu to change the Output type from the default Displacement to Force.
9. In the Frnt macpherson susp system folder, expand the Bodies folder and select the body Lwr
control arm left. (or you can pick the Lwr Control arm - left directly from the model in the
graphics area by clicking the Body collector once).
10. Repeat steps 4 through 9 to create an output force request on Lwr control arm right.
13. Save the solver input file as load_export.xml, to the <working directory>.
All bodies for which force outputs are requested are displayed in a tree structure in the Body
Selection panel. You can select one or multiple bodies from the tree. In this step select the
body Lwr control arm-left.
3. Expand the sys_frnt_susp folder and select the body Lwr control arm left.
All the forces acting on the lwr control arm left are displayed in the Force Selection panel.
You can choose any number of loads acting on the body. Only the loads selected by you are
exported by the utility.
5. The Time Selection panel allows you to enter/select the time steps for which the loads are to be
exported.
7. The current simulation runs from 0 to 2 seconds. Specify a Minimum Time Step Value of 1 and
a Maximum Time Step Value of 2.
Note After time step input, you must click the Apply button to verify the validity of the time
steps. If a time step entered is not present in the ADAMS request file, an error message
is generated and you must make appropriate corrections.
11. Select OPTISTRUCT/NASTRAN [1] by using the radio button under the Export panel.
Nastran options
This dialog allows you to enter the Nastran node ID numbers in the second column of the table.
the reference frame (LPRF/Global) in which the GRID cards are written
whether or not to explicitly output the CORD1R card in the Nastran input deck (Yes/No)
This creates a subcase file, in addition to the Nastran input deck, in the same directory as the
.dat file.
Note In point 2 above, if you select multiple bodies, the Nastran Export Panel will look as shown
below:
Convert results from a multi-body simulation run into file formats which can be used for fatigue
analysis using a tool like NCode
Write a fatigue analysis file from the MotionView animation window (HyperView)
Tools
The following functionalities are used in this tutorial: Fatigue Prep, Flex File Gen, and build plots.
The Flex File Gen feature allows you to create an .flx file using the Flex File Gen tool. This file
references a .gra file (rigid body graphics), a .res file (flex and rigid body results), and .H3D files
(flexbody graphics). These files are required to animate ADAMS results that contain flexbodies. The
.flx file can be loaded directly into the animation window.
The form shown above, describes the set of file translations possible using the Fatigue Prep
wizard.
5. Click Next.
The Altair flexible body pre-processor is launched and the FES file is created in your working
directory.
Using the Fatigue Prep wizard, you can convert your results files to .fes, .asc or .dac files.
You can use these files for fatigue and durability analysis in Ncodes FE-Fatigue software.
5. Click Next.
6. Click the file browser button attached to Select req file and select indy.req from the
durability_fatigue folder.
Note The DAC file format does not support unequal time steps since only frequency is
specified, not each time step. Therefore your REQ file needs to have equal output time
steps.
7. Click on the file browser attached to Select DAC file and specify indy.dac as an output filename
in <working directory>\.
Once you select Displacement, Y requests and Y components will populate the text boxes.
Note You can select any number of Y requests and Y components for REQ2DAC conversion.
13. From the Build Plots panel, load the file indy_D_997000_X.dac from <working directory>\.
Note In this filename, D represents Displacement, 9970000 represents the request number, and
X represents the component. This is how you get the information about the DAC file you
are plotting.
You may plot the corresponding request from the original REQ file for comparison.
This dialog lists the files you will need for this conversion.
4. Using the Save the *flx file as file browser, select your destination file to be <working-dir>
\sla_flex.
5. In the Number of FlexBodies field, enter 2 since this model includes two lower control arms as
flexible bodies.
6. From the Select model source (*.gra) file browser, select the sla_flex.gra file located in the
durability_fatigue folder.
7. From the Select result source (ASCII *.res) file browser, select the sla_flex.res file located in
the durability_fatigue folder.
8. Using the first file browser under Select flexible body source (*.h3d), select the sla_flex.h3d
file located in the durability_fatigue folder.
9. Using the second file browser under Select Flexible Body Source (*.h3d), select the
sla_flex_m.h3d file located in the durability_fatigue folder.
These values should correspond to the actual IDs of the flexible bodies in the ADM input deck of
the ADAMS solver.
The deformation of these flexible bodies during animation can be scaled using the Def. Scale field.
In this case, accept the default value of 1.000.
The translator is launched and the resulting FLX file is created in the destination directory.
12. Select the TextView window from the Select application list.
13. Click the arrow next to the Open Session icon, , on the Standard toolbar and select Open
Document .
Note To load transients results for selected time intervals check the Optional flx statements
check-box to enter the Start Time, End Time and Increment.
To load selected mode shapes from modal animation files for models with one or more
flexible bodies, check the Optional flx statements for linear analysis check-box to
enter the Start Mode and End Mode.
Additional statements are inserted in the FLX file reflecting the above mentioned
parameters.
2. Use the Open drop-down menu on the Standard toolbar (click the arrow next to the Open
3. Use the Load model file browser to select the file, sla_flex.flx that you just created. The
Load result field automatically populates with the same file name.
4. Click Apply.
Observe the animating model, which is a combination of rigid multi-bodies and two flexible lower
control arms.
7. Choose different options from the Result Type drop down menu, to view the various results
available in the analysis result files.
For a detailed description of writing a fatigue analysis file from here, refer to the Fatigue Manager
topic in the HyperView Users Guide.
Introduction
Starting in version 14.0, MotionSolve introduced a new form of flexible body referred as Non Linear
Finite Elements (NLFE). Unlike the conventional flexible body, where the body is represented in a
modal form, NLFE is modeled in a direct Finite Element form.
NLFE Formulation
MotionSolve uses Absolute Nodal Coordinate Formulation (ANCF) to model large displacement and large
deformation (NLFE) bodies. The absolute nodal coordinate formulation[1 ] is developed based on finite
element formulation and is designed for large deformation multibody analysis. In the absolute nodal
coordinate formulation, slopes and displacements are used as the nodal coordinates instead of
infinitesimal or finite rotations.
ANCF uses the shape function matrix, together with the nodal coordinates to describe arbitrary rigid
body motion. For these reasons, the absolute nodal coordinate formulation leads to a constant mass
matrix in two- and three-dimensional cases. The constant mass matrix simplifies the nonlinear
equations of motion and, consequently, accelerates the time integration of the nonlinear equations of
motion.
Where,
s1 to s4 are shape functions of beam.
Modeling non-linear behavior above the elasticity limit (like plastic deformation, strain hardening,
fracture etc.) is not supported. In the current version, MotionView supports modeling of 1D line
elements only (Beam and Cable elements). Beam elements can have 18 types of cross-sections and
the dimensions of the cross-section can be changed linearly in the axial direction. Beam elements can
resist axial, shear, torsion and bending loads. The Cable element maintains a constant cross-section,
thus it can resist only axial and bending loads.
Exercise 1
In this exercise, you will model a 1m long cantilever beam with a cross-section dimension of
110mmx14mm to perform a bending test and compare it with an analytical solution.
Copy the centerline.csv file, located in the mbd_modeling\nlfe\intro folder, to your <working
directory>.
The following table lists the various tabs available in the NLFE Body panel:
Type: Beam
dim1: 14.0
dim2: 110.0
The panel also displays the image of the cross-section indicating what the different dimensions
(dim1 and dim2) refer to.
Note The Properties tab has two sub-tabs called Start and End. These sub-tabs are used
to set the dimensions at two different ends of the beam. By default, the End dimensions
are parametrically equated to the Start dimensions. If a different set of dimensions are
provided at the start and end, the cross section varies linearly along the length of the
beam.
9. Click on the Manage Materials button located in the upper right corner of the Properties tab.
MotionView provides a list of commonly used Linear Elastic, as well as Hyper Elastic material by
default.
11. Review the property values and notice that the Elastic line check box for Approach is selected.
The default standard materials provided are defined with the Elastic Line option checked on.
Materials without the Elastic Line are solved using the continuous mechanics approach, where in
the cross-section deformation is taken into consideration. The Elastic Line approach ignores
cross-section deformation effects, which gives results closer to an analytical solution.
13. From the Connectivity tab, define the beam centerline by importing point data from a CSV file.
Click on the Import Points button located in upper right corner.
The .csv file must be in the following format: the first column must hold the X-coordinates, the
second column the Y-coordinates, and the third column the Z-coordinates. There can also be a
header row that begins with a # indicating a commented line.
16. Fit the model (by hitting 'F' on the the keyboard) to view the NLFE Body that was created.
Note The Orientation tab is used to set the cross section orientation (YZ plane of the beam).
Use the XY Plane or XZ Plane option to position the Y or the Z-axis (the remaining axis
will be positioned so that it is orthonormal to the remaining two axes).
Intermediate Beam elements orientation is linearly varied from Start orientation to End orientation.
The Orientation option is useful in defining twist along the beam length.
19. Click on Initial Conditions tab to review the NLFEBody initial velocities.
S.No Label Varia Type Body 1 Body 2 Origin(s Orientati Referenc Referenc
ble ) on e1 e2
name Method
Note Each grid on an NLFE body has 12 DOFs: 3 translational, 3 rotational, and 6 related to
the length and angle between the gradient vectors. Using a fixed joint constrains the
positions of the grid and the rigid body rotations. However, the gradients at the grid are
free. This means that the cross-section at the fixed joint can twist about the grid and
also deform based on Poissons ratio. To arrest these DOFs, an NLFE element called
CONN0 can be used.
There is no graphical user interface support for creating this constraint. By default,
MotionView creates a CONN0 element at all of those grids of the NLFE body through
which it is attached to a constraint/force entity.
2. Create a load at the cantilever beam end point (Point_11) as specified in the table below:
1 Load frc_load Action only Scalar Force Cantilever Point_11 Global Frame
along Z axis of Beam
Ref Frame
3. From the Trans Properties tab, specify the expression for force as ` -1000*time`.
Note Negative value is specified to apply load along negative Z-axis direction.
Where,
= Load (N)
= Beam length = 1000mm
= Youngs Modulus = 2.1e+05 N/mm2
3. Add an output request Load to measure the magnitude of the applied Load.
1. Invoke the Run panel by clicking on the Run Solver button on the toolbar.
3. Select the Simulation type as Quasi-static, the end time as 1 sec, and the Print interval as
0.01.
5. After the simulation is completed, click on the Animate button to view the animation in
HyperView.
7. Click the Plot button in the MotionView Run panel to load the .abf file in HyperGraph.
8. Plot Deflection vs Load calculated from linear elasticity theory and NLFE by selecting the data
below in HyperGraph.
X Component FZ
Y Type Expression
Y Component F2 & F3
10. Rename the two curves as Analytical and NLFE as shown below:
It can be observed from the plot that the NLFE and Analytical curves almost overlap.
12. Click on the Contour button on the toolbar to activate the Contour panel.
13. Under Result type, select NLFE Stress (t) and XX.
Similarly, you can view Displacement, Strain, etc. for an NLFE body in HyperView. All FE contours
and types are available in HyperView for an NLFE body.
In this exercise, a uni-axial tensile test on a rubber strip (2mmx25mmx50mm) will be performed.
Hyper-elastic material constants have been sourced from reference[3 ].
Density ( ): 1.1e-6
2. Create 9 intermediate points between the above points using the Create Points Along a Vector
macro.
3. Right-click on the Body icon in the Model-Reference toolbar. Add a new NLFE body with
the Label as Rubber Strip and the Variable name as nlfeb_rubber_yeoh.
Type as Beam
Cross-section as Bar
dim1 = 2
dim2 = 25
Activate the first Point collector and select the point Rubber End 1.
Select the next available intermediate points one by one into other collectors, with the last
point being Rubber End 2.
S.N Label Vari Type Body 1 Body 2 Origin( Orientation Refere Referen
o able s) Method nce 1 ce 2
nam
e
Expression: `50*time`
4. Go to the Solver Gravity dataset and change the Gravity option to Off.
5. Click the Save Model icon on the Standard toolbar and save your model as
rubber_strip.mdl in your <working directory>.
Engineering Strain =
Engineering Stress =
1. Add an Output of the Type Expressions with the Label as Eng strain(F2), Eng Stress
(F3) and the expressions as shown below:
F2: `(DM({j_trans.i.idstring},{j_fix.i.idstring})-50)/50`
F3: `MOTION({mot_axial.idstring},{0},{2},{0})/50`
Output requests
Note In the above expression F2, the solver function DM() measures the distance magnitude
between two markers; the I marker of the Translation Joint and the I marker of the Fix
Joint. Expression F3 uses the solver function MOTION() which measures the reaction
force due to the imposed motion Axial Motion.
3. Select the Simulation type as Transient; the End time: 4, and the Print interval: 0.01.
4. Click Run.
5. As the solver is executing, a warning message similar to the one shown below may be displayed:
WARNING: Maximum vonMises strain exceeded maximum strain (YS) specified for NLFE
element BEAM12 (id=20000000) on Body_Flexible (id=30102) at time=1.183E+00
This message states that the maximum vonMises strain in your NLFE component exceeded what
was specified (2.0) at time 1.18s. This message lets you know if your component is deforming
more than what you would expect it to, which allows you to inspect your results and make
corrections in modeling your system if required.
6. After the simulation is completed, click on Animate to view the animation in HyperView.
Stress contour
9. Return to MotionView Run panel and click on Plot button to load the .abf file in HyperGraph.
10. Plot Engineering Stress vs Engineering Strain by selecting the data below in HyperGraph.
X Type Expression
X Component F2
Y Type Expression
Y Component F3
Note The animation shows the true stress due to cross-section deformation.
References:
1) JUSSI T, SOPANEN and AKI M. MIKKOLA: Description of Elastic Forces in Absolute Nodal
Coordinate Formulation. Journal of Nonlinear Dynamics 34: 5374, 2003.
2) Oleg Dmitrochenko:Finite elements using absolute nodal coordinates for large-deformation
flexible multibody dynamics. Proceedings of the Third International Conference on Advanced
Computational Methods in Engineering (ACOMEN 2005).
3) Sung Pil Jung, TaeWon Park, Won Sun Chung: Dynamic analysis of rubber-like material using
absolute nodal coordinate formulation based on the non-linear constitutive law. Journal of
Nonlinear Dyn (2011) 63: 149157.
C am Follower Mechanism
1. Helical Spring
2. Stabilizer Bar
3. Belt-Pulley
The spring component is added as a body, which means the mass and inertia of the spring is
included in the model.
The dynamics induced by the mass of the spring can be modeled and simulated (for example,
surge in springs).
If the deformations in the model are likely to go beyond the linear assumptions, NLFE will
account for it.
Stress strain and deformation contours can be visualized.
Coil-to-coil clash is modeled automatically.
Exercise
Copy the CamFollower_stg1.mdl and CamProfile.h3d files, located in the mbd_modeling\nlfe
\helicalspring folder, to your <working directory>.
3. Review the model. From the Project Browser the following can be seen - the Model is organized
using a CamFollower system which contains:
A Cam, Follower, Joints, Graphics, and a Spring which make the complete topology.
The spring with a pre-load is acting between the Follower and Ground Body.
4. Click on the Run Solver toolbar icon , and Run the model with the settings as shown in the
Run panel image below. This will be the initial run which will be used to compare the results with
the NLFE spring model.
The coil spring will now be replaced with an NLFE Helical Spring component in the next section.
Note This toolbar may not be turned on by default. From the View menu, select Toolbars >
MotionView and then click on the toolbar name to turn the display on/off.
Spring parameters
Additional parameters
Label Specify label prefix for the spring profile Point Spring
points created.
Note These parameters have been chosen for the following reasons:
The stiffness of the coil spring being replaced is: 14.6 N/mm.
The equation for the coil spring stiffness: G.d4 /[8.n.D3 ] (Where: G = Modulus of
rigidity; d = Wire dia.; n = No. of active coils; D = Spring mean diameter).
Substituting the values from the table above in the equation and using Steel with
80769 N/mm2 for material:
The spring overshoots the upper plate as shown above. This is because the spring has been
created with no pre-load on it.
9. Review the NLFE Spring systems added. The following entities are available in the System:
An NLFE Spring.
DataSet with spring parameters that were used to create the spring.
Template with unsupported elements. These are automatically created and include elements
that define coil-to-coil contacts.
Go to the Connectivity tab. In this tab there is a View drop-down menu with two options
available: No Load and Loaded. The No Load view shows the unloaded positions of the
spring.
Select the Loaded option. In this view the Import Loaded Profile button can be used to
browse a .csv file containing the pre-loaded positions and gradients of the spring.
Click on the Import Loaded Profile button to invoke the Import Loaded Points Information
From File dialog.
Browse the file PreLoaded_positions.csv from the working directory and click OK to import
the loaded positions.
The spring will be displayed in wireframe and solid. The one in wireframe is the No Load
position (free/relaxed configuration) and the solid representation is that of pre-loaded spring.
Note Refer to the Appendix in the NLFE Body Panel Connectivity Tab topic to learn how
you can generate a preloaded position CSV file.
11. The pre-loaded positions can be viewed using the expansion button in the panel.
12. The fixed joints created by the NLFEHelicalSpring Component utility will be at the free
positions. You need to move one of these to the pre-loaded positions. Inspecting the spring
positions reveals that the spring is compressed at the top while the bottom position is the same in
both the configurations.
1. To solve the model, invoke the Run panel using the Run Solver button in the toolbar.
2. Assign a name for the .xml file and click on the Run button.
3. After the simulation is completed, click on the Animate button to view the animation in
HyperView.
6. Click the Contour icon on the toolbar to activate the Contour panel.
7. Under Result type: select NLFE Stress (t), Averaging method: Simple, and click Apply to
view stress contours.
Similarly, you can view Displacement, Strain, etc. for an NLFE body in HyperView. All FE contours
and types are available for an NLFE body.
3. Split the window into two using the Page Window Layout button on the toolbar.
4. In the left window open the .abf file corresponding to the solver run with the original spring
(created in Step 1), make the selections shown below and click Apply.
X Type Time
Y Component DY
5. Select the right window, make the following selections and click Apply.
X Type Time
Y Component FY
6. Select the left window, browse to the .abf file of NLFE results and plot the corresponding
displacement.
7. Select the right window, make selections as shown below and click Apply.
Y Request REQ/70000002
Spring_toLowerBody_att(ForcesOnFollower)
Y Component FY
8. Apply axis labels and formatting as appropriate. The comparison is shown below:
Upon closer inspection there are some differences in the results, especially in the Spring Forces.
These could be attributed to the following reasons:
NLFE spring has mass and inertias associated with it as it is represented as a body. A regular
spring is a force entity without any mass/inertias.
The difference in force outputs is particularly seen when the spring displacement is high. This
is the point where the coil-to-coil contact happens. During this event, the effective number of
coils reduces, thus increasing the spring stiffness marginally and hence the force outputs.
MV-7003: Simulating a Single Input Single Output (SISO) Control System Using MotionView and
MotionSolve_2
Spline3Ds are reference data plotted in three-dimensional coordinates which have two independent
vectors or axis. These can be visualized as a number of 2D Splines (Curves) placed at regular
intervals along a third axis. For instance, a bushing is generally characterized by a Force versus the
Displacement curve. Lets say, the Force versus displacement also varies with temperature.
Effectively, there are two independent variables for the bushing force - Displacement and
Temperature. Another example is the Engine Pressure (or Force) versus the Crank angle map
(popularly known as P-Theta diagram). The P-theta map will vary at different engine speeds (or
RPM). Such a scenario can be modeled using Spline3D.
The model has two systems: System Cyl1 and System Flywheel.
In the System Flywheel, the Flywheel (fixed to Crank) is driven by a velocity based Motion
between markers which refers to a curve (Crank_RPM) for inputs.
Motion Panel - Properties Tab (with Expression referring to the C urve using AKISPL function)
C urve C rank_RPM
Two Solver Variables: Crank_angle (deg) and Crank_RPM keep track of the angular rotation
(in degrees) and velocity (in RPM) of the crank respectively.
In System Cyl1:
o The solver variables in System Flywheel are passed as attachments to this system and
carry the variable names arg_Crank_angle_SolVar and arg_Crank_RPM_SolVar. These
will be used in defining the independent variables while defining the combustion force using
Spline3D
From the Project Browser, right-click on System Cyl1 and select Add > Reference Entity >
Spline3D from the context menu.
OR
Select System Cyl1 in the Project Browser and then right-click on the Spline3D icon on
the Reference Entity toolbar.
The Spline3D panel is displayed in the panel area with the Properties tab active.
The data for the spline can be defined using either the File or Value methods. For the File type,
a reference to an external file in .csv format must be provided. In case of the Value type, the
values can be imported from a .CSV file (using Import) or they can be entered in manually. In
this tutorial, we will import the values from an external file.
6. Browse to the FTheta.csv file in your <working directory> and click OK.
The .csv file that is to be used as the source for Spline3D needs to be in the following format:
The first column must hold the X-axis values (shown in blue below) which is the first
independent variable.
The top row holds the Z-axis values (shown in red below) which is the second independent
variable.
The other columns must have the Y-axis values (shown in green below) with each column
belonging to the particular Z-axis values heading that column.
Note The same format is applicable when using the File input type.
11. Activate the Linear Extrapolation check box. This will ensure that the values are extrapolated if
the Solver starts looking for values beyond the range of the user provided data.
12. To visualize the spline graphically, click on the Show Spline button to display the Spline3D
viewer dialog.
The imported values are Combustion Force on Piston vs Theta (crank angle) diagrams at
different speeds (as shown below). The F-Theta profiles vary slightly at different engine or crank
speeds. The same plot was visualized in the previous section in the Spline3D viewer by placing
the four different plots along the Z-axis.
From the Project Browser, right-click on System Cyl1 and select Add > Force Entity > Force
from the context menu.
OR
Select System Cyl1 in the Project Browser and then right-click on the Force icon on the
Force Entity toolbar.
The Force panel is displayed in the panel area with the Connectivity tab active.
3. From the Connectivity tab, use the Force drop-down menu to change the type to Action
reaction.
4. Resolve the connections as shown in the image below, either through picking in the graphics area
or using the model tree (by double clicking on the input collector).
Note The Body 2 reference to Ground Body is through an attachment to the System Cyl1
system.
6. Double click on the Spline3D collector, , to display the Select a Spline3D dialog.
Note The solver function MOD() used in Independent variable X refers to the solver variable
Crank_angle (deg) in System Flywheel (via attachment arg_Crank_angle_SolVar to
System Cyl1). This function calculates the remainder of the division of first argument
value (value of the solver variable) by the second argument value (720); thereby
resetting the value of Independent variable X every 720 degrees.
12. Save the model with a different name (File > Save As > Model).
1. To solve the model, invoke the Run panel using the Run Solver button on the General
Actions toolbar.
2. Since the crank RPM input data is for 40 seconds, enter 40 in the End time field and change the
Print interval to 0.001.
3. Assign a name and location for the MotionSolve XML file using the browser icon .
4. The Run panel with the inputs from the previous steps is shown below:
5. Click the Run button in the panel to invoke MotionSolve and solve the model.
8. From the Animation toolbar, use the Start/Pause Animation button to animate the model.
9. Visualize forces on the Piston using the Vector panel (select the Piston graphics for the
Assemblies collector).
You may also set all graphics to be transparent for easy visualization using the WireFrame/
Transparent Elements and Feature Lines option located on the Visualization toolbar.
10. From the Page Controls toolbar, click the Add Page icon to add a new page.
11. Use the Select application drop-down menu to change the client on the new page to
HyperGraph 2D.
12. From the Page Controls toolbar, click the arrow next to the Page Window Layout button
13. From the Build Plots panel, use the Data file browser to load the .plt file from the
MotionSolve run.
14. In the first window (top left), plot the Crank_angle (deg) by selecting the following:
Y Component = f3
Y Type = Force
Y Component = Z
16. Finally, we will plot the Force vs Theta plots at different speeds as applied on the piston (this will
demonstrate the usage of Spline3D input used in Step 2 of this tutorial). Click in the graphics
area of the third window (bottom) to make it the active window.
19. Click in the Curve field and rename the curve as 500 RPM.
21. Enter the expressions shown below to extract the data from the curve in the first and the second
window respectively between 6 and 7 seconds.
x = p2w1c1.y[subrange(p2w1c1.x,6,7)]
y = p2w2c1.y[subrange(p2w2c1.x,6,7)]
Note p2w1c1 refers to the Curve 1 plotted on Page 2, Window 1. If for any reason the page,
window, or curve numbering is different, suitable modifications should be made to the
expression.
The subrange function returns the indices of the vector within a specified range. For
more information on the subrange function, please refer to the Templex and Math
Reference Guide.
24. Assign different colors to these curves using the Curve Attributes panel , or by selecting the
curves in the Plot Browser and changing the color in the Properties table.
25. After completing the plots, compare them with the input data for the Spline3D plot in Step 2. A
comparison is shown below:
This tutorial will show you how to replace five MotionView entities with their corresponding usersubs.
Copy the model file required for this exercise, engine_baseline.mdl, along with all of the H3D files
located in the mbd_modeling\motionsolve\python_usersub folder to your <working directory>.
The model we are using is a single cylinder engine, and uses a curve, an output, a force, and a motion
entity. The system also uses default damping.
The curve is read from a CSV file, and gives a force value based on the angular displacement
of the connecting rod.
The output returns the displacement magnitude of the piston.
The force entity uses the angle of the connecting rod and the curve to apply a variable
pressure force to the piston.
The motion entity applies an angular motion to the Crank_Grnd revolute joint.
The default damping of the system is 1, however it can be changed in the Bodies panel.
The following is a list of the entities and usersubs we will be using in this tutorial, along with a brief
description of their usage:
2. Click on the folder icon located next to the Save and run current model option, and browse to
your <working directory>. Specify the name as engine_baseline.xml for the MotionSolve
input XML file.
3. Check your model for errors, and then click the Run button to run your model.
This will give you result files to compare with your usrsub results.
Python can use many MotionSolve functions and inputs when certain syntax rules are followed. When
using a MotionSolve function such as AKISPL or SYSFNC, the string py_ must be added to the
beginning. For example, py_sysfnc( would be the correct usage of SYSFNC in Python. When
defining a usersub function in Python, the name of the function and the inputs must match those
outlined in the MotionSolve online help pages exactly. When accessing model data in python through
a function such as SYSFNC, use the exact property name in quotations as the id input. Model
properties that are passed into Python in the function definition can be accessed throughout the
script, and do not need additional defining to use. An example of these syntax rules being used is
shown below:
def REQSUB(id, time, par, npar, iflag):
[A, errflg] = py_sysfnc(DX,[par[0],par[1]])
return A
1. Open a new Python file, and define a function with the name SPLINE_READ using def
SPLINE_READ():", giving the appropriate inputs and outputs. The inputs and outputs used are:
id, file_name, and block_name.
2. Import the Python CSV package by including import csv after the function definition.
3. Open pressure_curve.csv in the function, and read the file to your Python script as a variable.
This can be done with variable = open(pressure_curve.csv, r).
4. Change the format of this variable from csv by defining a new variable, and using csv.reader()
to read your variable file.
5. Define an empty list, L, to store the pressure_curve data values. Iterate through the list
using for item in curv:. Append each item as a separate list value with L.append(item).
6. Remove the headers from the csv file by redefining the list from the second value till the end of
the list. This can be done with L = L[1:].
7. Define a counter variable to be used later. Define two lists that are half the length of L, and set
them equal to zero. To do this, use x = 16*[0.0] twice; once with the x value and once with
the y value.
8. Create a while loop dependent on your counter variable being less than the length of your list,
minus one.
9. In each iteration of the loop, define your x and y data values for the index i as a floating value
of each half of your L data sets. This should look like x[i] = float(L[i][0]) and y[i] =
float(L[i][1]). Increase your counter variable by 1.
10. Define a z variable with a floating value of 0.0, and close the csv file. Defining a z variable is
necessary, as the next function we will use requires an x, y, and z variable.
11. Use the put_spline MotionSolve function, and return the id, as well as the lists containing the
first and second column of values and the z variable. This should be done with errflg =
py_put_spline(id,x,y,z) followed by return errflg.
import csv
ifile= open('pressure_curve.csv','r') ## opens data file as readable variable
curv = csv.reader(ifile) ## reads csv data, stores as useable
var.
1. In MotionView, go to the Curve panel , and locate the Force_Pressure curve in the project
directory tree to the left of the MotionView workspace.
4. Click on the User-Defined tab, and use the File name file browser to select the
pressure_curve.csv file.
5. Check the box marked Use local file and function name. Use the Local File file browser (the
folder button to the right) to locate and select the nonlin_spline.py file.
6. Change the Function Type in the drop-down menu from DLL to Python, and ensure the function
name is SPLINE_READ. You do not need to enter anything for the Block name, as it is not
needed in this tutorial.
1. Create another Python file, and define a function named REQSUB with the appropriate inputs and
outputs. The syntax for this is def REQSUB(id, time, par, npar, iflag).
2. Use the sysfnc utility to implement the DM (or displacement magnitude) function on the first
and second input parameters, and define a variable and an error flag by writing [D, errflg] =
py_sysfnc(DM,[par[0],par[1]]).
3. Return a list of eight values, where the second value is your variable, and the rest are equal to 0.
This will be your result variable, and should look like result = [0,D,0,0,0,0,0,0].
2. From the Properties tab, select User Defined from the first drop-down menu.
3. Click in the text field labeled Output, and then click on the button to open the Expression
Builder.
4. In the text field of the Expression Builder, click inside the parentheses and add {},{}.
7. Check the Use local file and function name box, and select Python from the Function Type
drop-down menu.
1. Open a new Python file, and define the function GFOSUB by typing def GFOSUB(id, time, par,
npar, dflag, iflag):.
2. Import "pi" from the Python math library using from math import pi.
3. Use the AZ function for angle in the z direction with the sysfnc command, to save it as a
variable. To do this, type [A, errflg] = py_sysfnc(AZ,[par[1],par[2]]).
4. The angle will be measured in radians by default, so change the variable defined in the previous
step to degrees. As the model extends from the origin into the negative y direction, you will need
to multiply by -1. The method used in this tutorial is B = ((-1)*A*180)/pi.
5. Define another variable using the akispl utility, which interpolates the force values from the
curve. You will need input arguments of your angle B, zero to specify a two dimensional curve,
and zero for the curve input and the order. This line is written as [C, errflg] =
py_akispl(B,0,par[0],0).
6. Return a list three elements long, where the second element is the variable defined with the Akima
interpolation function. The data from interpolation is stored in the first column, so use return
[0,C[0],0].
1. In MotionView, go to the Forces panel , and locate the Force_Gas_Pressure force in the
project directory tree to the left of the MotionView workspace.
3. From the User-Defined tab, edit the Force value with the Expression Builder to include the
curve idstring, the ground marker idstring, and the crank marker idstring.
5. Check the Use local file and function name box, and select Python from the Function Type
drop-down menu.
1. Open a new python file, and define the MOTSUB function, including the required inputs. The
correct syntax for this is def MOTSUB(id, time, par, npar, iord, iflag):.
2. The MOTSUB user subroutine requires a function or expression, and its first and second order
derivatives. Create conditional statements using the function order variable iord to define the
function and its first and second derivatives with if iord==0:, elif iord==1: and
else:.
3. The function and its derivatives should be defined with the same variable name. The function
used in this tutorial is A = 10.0461*time. This makes the first derivative equal to A =
10.0461, and the second derivative equal to A = 0.0.
if iord==0: ## function
A = 10.0461*time
elif iord==1: ## first derivative
A = 10.0461
else: ## second derivative
A = 0.0
return A ## returns function based on iord input
1. In the directory tree on the left side of the HyperWorks desktop, locate the Motion_Crank
motion and click on it.
Because we defined the function in the Python script, we do not need to modify USER() text
field.
4. Check the box labeled Use local file and function name, select Python from the Function Type
drop-down menu.
5. Use the Local File file browser to locate and select the mot_nonlin.py file.
1. Open a new Python file and define the DMPSUB function with def DMPSUB():, giving it the
following inputs: id, time, par, npar, freq, nmode, h.
4. In each iteration of the loop, set each index in your variable equal to 1 by adding cratios[i] =
1.0.
5. At the end of your script, return the list variable with return cratios.
for i in xrange(nmode):
cratios[i] = 1.0 ## sets marker damping to 1
1. In the directory tree on the left side of the HyperWorks desktop, locate the Conrod body and
click on it (this is a flexbody in the model).
2. From the Properties tab, click on the Modes button (located in the lower right corner of the
panel) to display the Modes dialog.
Because we defined the damping in our dmp_nonlin.py script, we do not need to change the
USER() expression.
5. Change the End time to 5.0, and the Print interval to 0.01.
6. Now, export the MotionSolve file using File > Export > Solver Deck.
Note Currently there is no GUI option available to specify the DAMPSUB file defining flexbody damping,
therefore the dmp_nonlin.py must be manually added to the MotionSolve file (*.xml) by
adding following statements to the flexbody definition:
is_user_damp = "TRUE"
usrsub_param_string = "USER()"
interpreter = "Python"
script_name = "dmp_nonlin.py"
usrsub_fnc_name = "DMPSUB"
1. Go to the Run panel , click on/activate the Run MotionSolve file radio button.
2. Switch the application from MotionView to HyperGraph 2D by selecting it from the Client
Selector drop-down menu (located on the left-most end of the Client Selector toolbar).
3. In HyperGraph, click the Build Plots panel button on the Curves toolbar.
4. In the Build Plots panel, locate your baseline results from your working directory using the Data
file file browser. Select the file baseline.abf, and click Open.
5. The x and y axes options are be shown below. The default x variable is Time. For the y variable:
select Marker Displacement for Y Type, leave the default for Y Request, and select DM for Y
Component.
6. Click the Apply button (located on the far right side of the panel).
7. For your usersub results, repeat steps 4 through 6, using REQSUB and RESULT(2) for Y Type
and Y Component respectively.
2. Switch the application from HyperGraph 2D to HyperView using the Client Selector drop-down
menu.
4. Locate your baseline.h3d results file in your working directory, and click Open.
5. Click Apply.
6. Open the Entity Attributes panel , and click the Off button next to the Display option.
Make sure that the Auto apply mode check box is checked.
7. In the model window, click on the piston head, and both crank components.
9. Set Result type to Deformation->Displacement (v), and click on the flexbody in the model
window.
10. Click the Apply button (located in the lower middle portion of the panel).
11. Next, click on the Tracking Systems panel button located on the Results toolbar.
12. From the Track drop-down menu, select Component, then click on the flexbody in your model
window.
13. Separate your model window into two halves using the Page Window Layout drop-down menu
14. In the blank model window, repeat steps 3 through 12 for your usersub h3d file.
15. Click on the Start/Pause button on the Animation toolbar to animate your models.
1. Create a C/C++, FORTRAN, Tcl, or Python source file that contains the user-defined modeling
entity.
Refer to the MotionSolve User's Guide for a list of supported solver subroutines and a general
guideline on setting up and using subroutines in your model.
2. Obtain a DLL by compiling and linking your user subroutine(s) for C/C++ or Fortran, or use the source
file directly for Tcl or Python.
MotionSolve supports two separate levels of user DLLs and the algorithm attempts to resolve the
symbols, starting from the most specific library.
You can create an environment variable called MS_USERSUBDLL and set it to the DLL file. This
environment variable is not defined automatically when MotionSolve is installed. However, Fortran,
and C/C++ DLLs are provided in the installation folder <installation_directory>\hwsolvers
\usersub\subdll\win32\. This allows you to run some of the test models that use user
subroutine DLLs.
Note The DLL that is loaded is based on the "most specific" rule: number one overrides
number two.
3. Modify the corresponding entity in your multi-body model to be "user defined" and point it to your
DLL. This can be done in two ways:
Regardless of the method you select, you will end up with an XML file where one or more entities
are now user defined.
For example, consider the coupler modeling element in the XML file:
The coupler modeling element in the XML file can also be defined as:
<Constraint_Coupler
id = "1"
type = "TwoJoint"
i_marker_id_joint1 = "30603030"
j_marker_id_joint1 = "30602031"
body1_id_joint1 = "30603"
body2_id_joint1 = "30602"
joint_type_joint1 = " "
i_marker_id_joint2 = "30603040"
j_marker_id_joint2 = "30604040"
body1_id_joint2 = "30603"
body2_id_joint2 = "30604"
joint_type_joint2 = " "
usrsub_param_string = "USER(-8.5)"
usrsub_dll_name = "NULL">
</Constraint_Coupler>
In this case, MotionSolve looks for a machine level DLL as defined by the value of the
MS_USERSUBDLL environment variable.
4. Run MotionSolve, verifying that it picks up the appropriate DLL during simulation.
2. Load the MDL model file Pendu_model.mdl from your <working directory>.
3. From the Project Browser, right-click on Model and select Add Constraint > Motions (or right-
click the Motions icon, , from the toolbar). Add a Displacement motion to the revolute joint
between the Pendulum Body and the Ground Body.
7. Click the Save and run current model: folder icon, , and browse to your <working
directory>. Specify the name as Pendu_model.xml for the MotionSolve input XML file.
10. Click the Check button, , to check for any modeling errors.
11. After verifying that there are no errors, click the Run button.
12. Once the run is complete, the Animate button is activated. Click Animate to view the animation
of the simulation.
13. From the Run panel, click the Plot button to view the time-histories of the output request.
1. Create an environment variable MS_USERSUBDLL and set the value to the DLL file.
Right-click on the My Computer icon. From the Advanced tab, select Environment
variables > New (under User variables).
3. From the Connectivity tab, check the User-defined properties check box.
Note To use an element level (specific) DLL/Interpreter function, you can check the Use local
dll and function name check-box and point to the DLL using the folder icon, .
The string `USER(100001,5,2)` is used to pass arguments to the MOTSUB user subroutine. The
MOTSUB user subroutine calculates motion using the parameters par1 and par2 in
USER(branch_id, par1, par2) as follows:
motion_val= par1*TIME^par2
Note Click the Save File icon, , on the Main toolbar to save the file in working directory
with the existing name. If its a new model, you will be prompted for the name of the
model.
7. Save and run current model , , and browse to your <working directory>. Specify
Pendu_model_usersub.xml for the MotionSolve input XML file.
10. From the Main tab, click the Check button to check for any modeling errors.
11. After verifying that there are no errors, click the Run button.
12. In the plot window, plot the results from the ABF file Pendu_model_usersub.abf to overlay the
results on top of the results from the Pendu_model.abf file
13. In the animation window, check the Overlay option on the Load Model panel.
14. Select the file Pendu_model_usersub.h3d using the Load model folder icon .
This will overlay the new animation over the existing animation.
Note If the value of the usrsub_param_string is set as USER(3.142, 1) the results from
step 2 will be the same as results from step 1.
17. Open the MotionSolve XML file Pendu_model.xml (saved in step 1) from the <working
directory>.
20. Browse through the XML file to locate the Motion_Joint block.
<Motion_Joint
id = "301001"
label = "Motion 0"
type = "USERSUB"
val_type = "D"
usrsub_param_string = "USER(100001,5,2)"
usrsub_dll_name = "NULL"
usrsub_fnc_name = "MOTSUB"
joint_id = "301001"
joint_type = "R"
/>
Note When the value for the usrsub_dll_name parameter in the above block is set to NULL,
MotionSolve looks for the subroutine in a machine level DLL. This DLL is passed to
MotionSolve by the MS_USERSUBDLL environment variable.
To use an element level DLL, set the value of the usrsub_dll_name parameter to point to the
DLL.
For example, the MOTSUB user subroutine calculates motion using the parameters par1 and par2 in
USER(branch_id, par1, par2) as follows:
motion_val= par1*TIME^par2
MotionSolve uses the value returned from the user subroutine to calculate the motion.
In this tutorial, we will model a knife-edge cam follower mechanism with the help of a PTCV joint.
Exercise
Copy all the files from the mbd_modeling\interactive folder to your <Working directory>.
1. Start a new MotionView Session. We will work with the default units (kg, mm, s, N).
5. Click on the Properties tab and specify the coordinates as X = 0.0 , Y = 0.0, and Z = 0.0.
6. Follow the same procedure and create the points specified in the following table:
Point X Y Z
1. From the Project Browser right-click on Model and select Add Reference Entity > Body (or
3. From the Project Browser right-click on Model and select Add Reference Entity > Body (or
5. From the Properties tab, specify the following for the two bodies:
The Select a Point dialog is displayed. Choose CamCM and click OK.
9. For the Follower body, under the CM Coordinates tab, check the Use CM Coordsys box.
The Select a Point dialog is displayed. Choose FollowerCM and click OK.
1. From the Project Browser right-click on Model and select Add Constraint > Joint (or right-click
The Select a Body dialog is displayed. Choose Cam and click OK.
The Select a Body dialog is displayed. Choose Ground Body and click OK.
The Select a Point dialog is displayed. Choose PivotPoint and click OK.
7. For Axis click on the arrow and choose Vector. Now click on Vector.
The Select a Vector dialog is displayed. Choose Global Z and click OK.
8. From the Project Browser right-click on Model and select Add Constraint > Joint (or right-click
The Select a Body dialog is displayed. Choose Follower and click OK.
The Select a Body dialog is displayed. Choose Ground Body and click OK.
The Select a Point dialog is displayed. Choose FollowerJoint and click OK.
14. For Axis click on the arrow and choose Vector. Now click on Vector.
The Select a Vector dialog is displayed. Choose Global Y and click OK.
1. From the Project Browser right-click on Model and select Add Reference Entity > Marker (or
4. The Select a Body dialog is displayed. Choose Cam and click OK.
6. The Select a Point dialog is displayed. Choose PivotPoint and click OK.
8. Add another marker by right-clicking on Model in the Project Browser and selecting Add
Reference Entity > Marker (or right-click the Markers icon on the Model-Reference
toolbar).
11. The Select a Body dialog is displayed. Choose Follower and click OK.
13. The Select a Point dialog is displayed. Choose FollowerPoint and click OK.
1. From the Project Browser right-click on Model and select Add Reference Entity > Graphic (or
4. Click on the file browser icon and select CamProfile.h3d from the model folder.
The Select a Body dialog gets displayed. Choose Cam and click OK.
7. Add another graphic by right-clicking on Model in the Project Browser and selecting Add
Reference Entity > Graphics (or right-click the Graphics icon on the Model-Reference
toolbar).
10. Click on the browser icon and select FollowerProfile.h3d from the model folder.
The Select a Body dialog gets displayed. Choose Follower and click OK.
Next, we will add some joint graphics for better visualization and aesthetics.
1. From the Project Browser right-click on Model and select Add Reference Entity > Graphic (or
2. For Label, enter PivotGraphicOne (the first graphic to show the cam pivot).
The Select a Body dialog gets displayed. Choose Ground Body and click OK.
The Select a Point dialog is displayed. Choose PivotPoint and click OK.
6. Click on the arrow below Direction and select the Vector option.
7. Click on Vector.
The Select a Vector dialog is displayed. Choose Global Z and click OK.
Property Value
Length 7.5
Offset -3.75
Radius 1 4.000
Radius 2 4.000
10. Add another graphic by right-clicking on Model in the Project Browser and selecting Add
Reference Entity > Graphics (or right-click the Graphics icon on the Model-Reference
toolbar).
11. For Label, enter PivotGraphicTwo (the second graphic to show the cam pivot).
12. Choose Cylinder from the drop-down menu and click OK.
The Select a Body dialog gets displayed. Choose Cam and click OK.
The Select a Point dialog is displayed. Choose PivotPoint and click OK.
15. Click on the arrow below Direction and select the Vector option.
The Select a Vector dialog is displayed. Choose Global Z and click OK.
Property Value
Length 7.6
Offset -3.8
Radius 1 2.000
Radius 2 2.000
19. Add another graphic by right-clicking on Model in the Project Browser and selecting Add
Reference Entity > Graphics (or right-click the Graphics icon on the Model-Reference
toolbar). Add.
20. For Label, enter FollowerJointGraphic (the graphic for the follower translational joint).
21. Choose Box from the drop-down menu and click OK.
The Select a Body dialog gets displayed. Choose Ground Body and click OK.
The Select a Point dialog gets displayed. Choose FollowerJoint and click OK.
25. For axis orientation, use the vector Global Z as the Z-axis and the vector Global X, to define
the ZX plane.
Property Value
Length X 15
Length Y 10
Length Z 10
1. From the Project Browser right-click on Model and select Add Reference Entity > Curve (or
3. From the Properties tab, use the first drop-down menu to change the curve from 2D Cartesian
to 3D Cartesian.
5. Click on the file browser icon and select CamProfile.csv. Click Open.
8. Click on the file browser icon and select CamProfile.csv. Click Open.
11. Click on the file browser icon and select CamProfile.csv. Click Open.
12. Choose the properties of the curve as shown in the figure below:
13. From the Properties tab, use the fourth drop-down menu to set the curve type to Closed
Curve.
1. From the Project Browser right-click on Model and select Add Constraint > Advanced Joint (or
The Select a Body dialog gets displayed. Choose Follower and click OK.
The Select a Point dialog gets displayed. Choose FollowerPoint and click OK.
The Select a Curve dialog gets displayed. Choose CamProfile and click OK.
The Select a Marker dialog gets displayed. Choose CamMarker and click OK.
1. From the Project Browser right-click on Model and select Add Constraint > Motions (or right-
3. From the Connectivity tab, double-click on Joint. Choose CamPivot and click OK.
Direction Value
X 0
Y -9810
Z 0
1. From the Project Browser right-click on Model and select Add General MDL Entity > Output
3. From the Properties tab, choose Expressions from the drop-down menu.
7. Click OK.
The PTCV(id, jflag, comp, ref_marker) function returns the reaction on the PTCV joint:
4. Click on the browser icon and specify a file name of your choice.
5. Click Save.
6. Click Check Model button on the Model Check toolbar to check the model for errors.
The icon can be used to start the animation, and the icon can be used to stop/pause the
animation.
One would also like to inspect the displacement profile of the follower in this mechanism. For this,
we will plot the Y position of the center of mass of the follower.
2. Use the Page Layout drop-down menu on the Page Controls toolbar to select the three-
window layout .
3. Highlight the lower right window and use the Select application drop-down menu to change the
7. Click Apply.
8. The profile for the Y-displacement of the follower should look like the one shown below:
The profile of the cam has been designed to obtain the above Y-profile for the follower.
Now, we come to the discussion regarding lift-offs. In some cases, the dynamics of the system may
cause the follower to lose contact with the cam. This is called lift-off. In such cases, modeling the
system using a PTCV joint will give us incorrect results. This is because the PTCV joint constrains the
follower point to be always on the curve and hence cannot model lift-offs. For such cases, contact
modeling has to be used (refer tutorial MV-1010 for contact modeling). However, one would like to
start with a PTCV model since modeling a PTCV joint is a lot easier than modeling contact. Given this
scenario, the following modeling steps should be followed:
2. Monitor the PTCV joint reaction. If the reaction on the follower is a pulling reaction, it means lift-
off would have occurred and one needs to go for a contact model. Otherwise, the PTCV model is
good enough.
Now, lets check if our PTCV model is good enough. For this, we need to plot the reaction profile
on the follower. Since the follower is moving along the Y-axis, any negative reaction along the Y-
axis is a pulling reaction. So, lets plot the Y-reaction on the follower. For this:
3. Add a new page to the session by clicking on the Add Page icon .
7. Click Apply.
If we zoom in on one cycle by scaling the X-axis, the profile looks like this:
We see that the Y component of the PTCV reaction on the follower is always positive and hence
it is never a pulling reaction. Thus, our PTCV model is good enough to model the dynamics since
there is no expected lift-off.
In this tutorial, we learned how to model a PTCV joint and use it to model a cam-follower mechanism.
We also discussed lift-offs and ways of verifying the suitability of a PTCV joint model for modeling the
dynamics of a particular system.
In this tutorial, we will model a roller type cam-follower mechanism with the help of a CVCV
constraint.
Exercise
Copy the files CamProfile.h3d and CamProfile.csv , located in the mbd_modeling\interactive
folder, to your <Working directory>.
1. Start a new MotionView Session. We will work in the default units (kg, mm, s, N).
5. Click on the Properties tab and specify the coordinates as X = 0.0 , Y, = 0.0, and Z = 0.0
6. Follow the same procedure for the points specified in the following table:
Point X Y Z
1. From the Project Browser right-click on Model and select Add Reference Entity > Body (or
3. Right-click on Bodies in the Project Browser and select Add Body to define a second body.
5. Right-click on Bodies in the Project Browser and select Add Body to define a third body.
8. For the Cam body, under the CM Coordinates tab, check the Use CM Coordsys box.
11. For the FollowerShaft body, under the CM Coordinates tab, check the Use CM Coordsys box.
14. For the FollowerRoller body, under the CM Coordinates tab, check the Use CM Coordsys box.
1. From the Project Browser right-click on Model and select Add Constraint > Joint (or right-click
7. For Axis click on the arrow and choose Vector. Now click on Vector.
8. Right-click on Joints in the Project Browser and select Add Joint to define a second joint.
14. For Axis, click on the arrow and choose Vector. Now click on Vector.
15. Right-click on Joints in the Project Browser and select Add Joint to define a third joint.
21. For Axis click on the arrow and choose Vector. Now click on Vector.
1. From the Project Browser right-click on Model and select Add Reference Entity > Marker (or
6. Right-click on Markers in the Project Browser and select Add Marker to define a second
marker.
1. From the Project Browser right-click on Model and select Add Reference Entity > Graphic (or
4. Click on the browser icon and select CamProfile.h3d from the model folder.
7. Right-click on Graphics in the Project Browser and select Add Graphic to define a second
graphic.
12. Click on the arrow below Direction and select the Vector option.
Property Value
Length 75
Offset -37.5
Radius 1 2.000
Radius 2 2.000
16. Right-click on Graphics in the Project Browser and select Add Graphic to define a third
graphic.
18. Choose Cylinder from the drop-down menu and click OK.
21. Click on the arrow below Direction and select the Vector option.
Property Value
Length 5.0
Offset -2.5
Radius 1 5.000
Radius 2 5.000
Next, we will add some joint graphics for better visualization and aesthetics.
1. Right-click on Graphics in the Project Browser and select Add Graphic to define another
graphic.
2. For Label, enter CamPivotGraphicOne (first graphic to show the cam pivot).
6. Click on the arrow below Direction and select the Vector option.
7. Click on Vector.
Property Value
Length 7.5
Offset -3.75
Radius 1 4.000
Radius 2 4.000
10. Right-click on Graphics in the Project Browser and select Add Graphic to define another
graphic.
11. For Label, enter CamPivotGraphicTwo (second graphic to show the cam pivot).
12. Choose Cylinder from the drop-down menu and click OK.
15. Click on the arrow below Direction and select the Vector option.
Property Value
Length 7.6
Offset -3.8
Radius 1 2.000
Radius 2 2.000
Repeat this process for the FollowerRevJoint and label the graphics as:
and
19. Right-click on Graphics in the Project Browser and select Add Graphic to define another
graphic.
20. For Label, enter FollowerTransJointGraphic (the graphic for the translational joint).
25. For axis orientation, use the vector Global Z as the Z-axis and the vector Global X to define
the ZX plane.
Property Value
Length X 15
Length Y 10
Length Z 10
At the end of this step, your model should look like the one shown in the figure below:
1. From the Project Browser right-click on Model and select Add Reference Entity > Curve (or
3. From the Properties tab, use the first drop-down menu to change the curve from 2D Cartesian
to 3D Cartesian.
5. Click on the file browser icon and select CamProfile.csv. Click Open.
8. Click on the file browser icon and select CamProfile.csv. Click Open.
11. Click on the file browser icon and select CamProfile.csv. Click Open.
Notice the different column numbers used for the x, y and z properties.
13. From the Properties tab, use the fourth drop-down menu to set the curve type to Closed
Curve.
14. Right-click on Curves in the Project Browser and select Add Curve to define another curve.
16. From the Properties tab, use the first drop-down menu to change the curve from 2D Cartesian
to 3D Cartesian.
18. Select Math from the second drop-down menu on the left.
21. Select Math from the second drop-down menu on the left.
24. Select Math from the second drop-down menu at the left.
26. From the Properties tab, use the fourth drop-down menu to change the curve from Open Curve
to Closed Curve.
1. From the Project Browser right-click on Model and select Add Constraint > Advanced Joint
1. Click the Project Browser right-click on Model and select Add Constraint > Motions (or right-
3. From the Connectivity tab, double-click on Joint. Choose CamPivot and click OK.
Direction Value
X 0
Y -9810
Z 0
1. From the Project Browser right-click on Model and select Add General MDL Entity > Output
3. From the Properties tab, choose Expressions from the drop-down menu.
7. Click OK.
The CVCV (id, jflag, comp, ref_marker) function returns the reaction on the CVCV joint:
4. Click on the browser icon and specify a file name of your choice.
5. Click Save.
6. Click the Check Model button on the Model Check toolbar to check the model for errors.
The icon can be used to start the animation, and the icon can be used to stop/pause the
animation.
One would also like to inspect the displacement profile of the follower in this mechanism. For this,
we will plot the Y position of the center of mass of the follower.
window layout .
3. Highlight the lower right window and use the Select application drop-down menu to change the
7. Click Apply.
The profile for the Y-displacement of the follower should look like the one shown below:
The profile of the cam has been designed to obtain the above Y-profile for the follower.
Now, we come to the discussion on lift-offs. In some cases, the dynamics of the system may cause
the follower to lose contact with the cam - this is called lift-off. In such cases, modeling the system
using a CVCV joint will give us incorrect results. This is because the CVCV joint constrains the
follower point to be always on the curve. For such cases, contact modeling has to be used. However
one would like to start with a CVCV model whenever applicable, since modeling a CVCV joint is a lot
easier than modeling contact. Given this scenario, the following modeling steps should be followed:
2. Monitor the CVCV joint reaction. If the reaction on the follower is a pulling reaction, it means
that 'lift-off' would have occurred and one needs to go for a contact model. Otherwise, the CVCV
model is good enough.
Now, lets check if our CVCV model is good enough. For this, we need to plot the reaction profile
on the follower roller. Since the follower is moving along the Y-axis, any negative reaction along
the Y-axis is a pulling reaction. So, lets plot the Y-reaction on the follower roller. For this:
3. Add a new page to the session by clicking on the Add Page icon .
7. Click Apply.
If we zoom in on one cycle by scaling the X-axis, the profile looks like this:
We see that the Y component of the CVCV reaction on the follower is always positive, and hence
it is never a pulling reaction. Thus, our CVCV model is good enough to model the dynamics since
there is no expected lift-off.
In this tutorial, we learned how to model a CVCV joint and use it to model a cam-follower mechanism.
We also discussed 'lift-offs' and ways of verifying the suitability of a CVCV joint model for modeling
the dynamics of a particular system.
Exercise
Copy the file KG_N_MM_S_50elems2.h3d, located in the mbd_modeling\interactive folder, to your
<working directory>.
1. Start a new MotionView Session. We will work with the default units (kg, mm, s, N).
2. From the Project Browser right-click on Model and select Add Reference Entity > Point (or
5. Click on the Properties tab and specify the coordinates as X = 152.4, Y, = 0.0, and Z = 0.0.
6. Follow the same procedure for the other points specified in the table below:
Point X Y Z
1. From the Project Browser right-click on Model and select Add Reference Entity > Body (or
For the remainder of this tutorial - accept the default names that are provided for the rest of the
variables that you will be asked for.
5. Click on the Graphic file browser icon , select KG_N_MM_S_50elems2.h3d from the <working
directory> and click Open.
The same path will automatically appear next to the H3D file browser icon .
8. From the Properties tab, specify the following for the Ball:
9. For the Ball body, under the CM Coordinates tab, check the Use center of mass coordinate
system box.
13. For the Ball body, from the Initial Conditions tab - check the Vx box under Translational
velocity and enter a value of 100 into the text box.
This sets a value of 100 for the translational velocity of the ball in the X-direction. A somewhat
high value of Vx is introduced to make the motion of the ball clearly visible in the animation.
1. From the Project Browser right-click on Model and select Add Reference Entity > Marker (or
7. Right-click on Markers in the Project Browser and select Add Marker to define a second
marker. Continue adding markers until Marker10 is reached.
8. For subsequent labels; enter Marker1, Marker2, etc. until Marker10 is reached.
9. From the Properties tab, always select the Beam (after double-clicking on Body each time).
0 Beam PointbeamInterface1
1 Beam Point0
2 Beam Point1
3 Beam Point2
4 Beam Point3
5 Beam Point4
6 Beam Point5
7 Beam Point6
8 Beam Point7
9 Beam Point8
10 Beam PointbeamInterface2
1. From the Project Browser right-click on Model and select Add Constraint > Joint (or right-click
10. Right-click on Joints in the Project Browser and select Add Joint to define a second joint.
1. Click the Project Browser tab, right-click on Model and select Add Reference Entity >
Deformable Curve (or right-click the Deformable Curves icon on the Model-Reference
toolbar).
3. From the Properties tab, select Marker for Data type, and NATURAL for Left end type and
Right end type.
4. Check the box just to the left of the Marker collector (which situated to the far right of Data
Type).
7. Select all the markers one by one, starting from Marker 0 to Marker 10.
1. From the Project Browser right-click on Model and select Add Constraint > Advanced Joint
3. From the Connectivity tab select: PointToDeformableCurveJoint, Ball for Body, Point4 for
Point, and DeformableCurve 0 for DeformableCurve.
1. Click the Project Browser tab, right-click on Model and select Add Reference Entity > Graphic
3. For Type, choose Sphere from the drop-down menu and click OK.
8. From the Properties tab, enter 2.0 as the radius of the Ball.
2. For the beam which has already been defined, click on the Nodes button.
3. Uncheck the Only search interface nodes box and then click on Find All.
At the end of these steps your model should look like the one shown in the figure below:
5. Click Save.
6. Click the Check Model button on the Model Check toolbar to check the model for errors.
The icon can be used to start the animation, and the icon can be used to stop/pause the
animation.
One would also like to inspect the displacement profile of the beam and the ball. For this, we will
plot the Z position of the center of mass of the ball.
3. Use the Select application drop-down menu to change the application from MotionView to
HyperGraph 2D .
7. Click Apply.
The profile for the Z-displacement of the ball should look like the one shown below:
Exercise
Copy the files membrane.h3d and membrane.fem, located in the mbd_modeling\interactive folder,
to your <working directory>.
1. Start a new MotionView Session. We will work with the default units (kg, mm, s, N).
2. Click the Project Browser tab, right-click on Model and select Add Reference Entity > Point
5. Click on the Properties tab and specify the coordinates as X = 0.0, Y = 0.0, and Z = 0.0.
6. Follow the same procedure for the other points specified in the following table:
Point X Y Z
1. From the Project Browser, right-click on Model and select Add Reference Entity > Body (or
For the remainder of this tutorial - accept the default names for the rest of the variables that you
will be asked for.
5. Click on the Graphic file browser icon and select membrane.h3d from the <working
directory>.
The same path will automatically appear next to the H3D file browser icon .
6. Right-click on Bodies in the Project Browser and select Add Body to define a second body.
8. From the Properties tab, specify the following for the Ball:
9. For the Ball body, under the CM Coordinates tab, check the Use center of mass coordinate
system box.
13. For the Ball body, from the Initial Conditions tab - check the Vx box under Translational
velocity and enter a value of 1 into the text box.
This sets a value of 1 for the translational velocity of the ball in the X direction.
1. From the Macros menu, select Create Markers For Deformable Surface.
The Create Markers For Deformable Surface utility is displayed at the bottom of the screen.
2. For Select the body, use the Body input collector to select Membrane.
3. Click on the Select the FEM file file browser icon and select the membrane.fem file.
4. Use the default values for the Maximum number of marker rows and Maximum number of
marker columns.
1. From the Project Browser, right-click on Model and select Add Constraint > Joint (or right-
10. Repeat the same procedure for the other three joints.
1. From the Project Browser, right-click on Model and select Add Constraint > Advanced Joint
PointToDeformableSurface Joint
1. From the Project Browser, right-click on Model and select Add Reference Entity > Graphic (or
3. For Type, choose Sphere from the drop-down menu and click OK.
8. Under the Properties tab, enter 1.0 as the radius of the Ball.
2. For the membrane which has already been defined, click on the Nodes button.
3. Uncheck the Only search interface nodes box and then click on Find All.
At the end of these steps your model should look like the one shown in the figure below:
4. Click the Transient tab and as specify the Maximum step size as 0.001 (as the solution is not
converged for the default step size of 0.01):
6. Verify that the Save and run current model radio button is selected.
8. Click Save.
9. Click the Check Model button on the Model Check toolbar to check the model for errors.
10. To run the model, click the Run button on the panel.
The icon can be used to start the animation, and the icon can be used to stop/pause the
animation.
One would also like to inspect the displacement profile of the beam and the ball. For this, we will
plot the Z position of the center of mass of the ball.
3. Use the Select application drop-down menu to change the application from MotionView to
HyperGraph 2D .
5. Click on the browser icon and load the result.abf file from the <working directory>.
The profile for the Z-displacement of the ball should look like the one shown below:
Exercise
Copy the following files Plate.h3d and membrane.fem, located in the mbd_modeling\interactive
folder, to your <working directory>.
1. Start a new MotionView Session. We will work with the default units (kg, mm, s, N).
2. From the Project Browser right-click on Model and select Add Reference Entity > Point (or
5. Click on the Properties tab and specify the coordinates as X = 0.0, Y = 0.0, and Z = 50.0.
6. Follow the same procedure for the other points specified in the following table:
Point X Y Z
1. From the Project Browser right-click on Model and select Add Reference Entity > Body (or
For the remainder of this tutorial - accept the default names that are provided for the rest of the
variables that you will be asked for.
5. Click on the Graphic file browser icon and select Plate.h3d from the <working directory>.
The same path will automatically appear next to the H3D file browser icon .
8. From the Properties tab, specify the following for the Ball:
9. For the Ball body, under the CM Coordinates tab, check the Use center of mass coordinate
system box.
1. From the Macros menu, select Create Markers For Deformable Surface.
The Create Markers For a Deformable Surface utility is displayed at the bottom of the screen.
2. For Select the Body, use the Body input collector to select Membrane.
3. Click on the Select the FEM file file browser icon and select the membrane.fem file.
4. Use the default values for the Maximum number of marker rows and Maximum number of
marker columns.
5. Click Generate.
1. From the Project Browser right-click on Model and select Add Constraint > Joint (or right-click
10. Repeat the same procedure for the other three joints.
1. From the Project Browser right-click on Model and select Add Force Entity > Contact (or right-
4. From the Connectivity tab; select Linear as the calculation method, Ball for Body, BallCM for
Point, and DeformableSurface 1 for DeformableSurface.
6. Click on the Properties tab and enter 10 for Radius, 1000 for Stiffness, and 0.2 for Damping.
1. From the Project Browser right-click on Model and select Add Reference Entity > Graphic (or
3. For Type, choose Sphere from the drop-down menu and click OK.
2. For the membrane which has already been defined, click on the Nodes button.
3. Uncheck the Only search interface nodes box and then click on Find All.
At the end of these steps your model should look like the one shown in the figure below:
4. Click on the browser icon and save the file as result.xml in the <working directory>.
5. Click Save.
6. Click the Check Model button on the Model Check toolbar to check the model for errors.
The can be used to start the animation, and the icon can be used to stop/pause the
animation.
One would also like to inspect the displacement profile of the membrane and the ball. For this, we
will plot the Z position of the center of mass of the ball.
3. Use the Select application drop-down menu to change the application from MotionView to
HyperGraph 2D .
7. Click Apply.
The profile for the Z-displacement of the ball should look like the one shown below:
We can also plot the penetration distance for this flexible contact.
2. Click Apply.
define forces.
used as independent variables for interpolating through splines or curves.
used as input signals for generic control modeling elements.
define program output signals.
The MotionSolve expressions and user-subroutines allow you to define fairly complex user-defined
dynamic states.
The expression type is used when the algorithm defining the differential equation is simple enough to
be expressed as a simple formula. In many situations, the dynamic state is governed by substantial
logic and data manipulation. In such cases, it is preferable to use a programming language to define
the value of a differential equation. The user-defined subroutine, DIFSUB, allows you to accomplish
this.
Two types of solver variables are available. The first, and probably the most convenient, is the
expression valued variable. The second is the user-subroutine valued variable.
The expression method is used when the algorithm defining the algebraic state is simple. In many
situations, the algebraic state is governed by substantial logic and data manipulation. In those cases,
it is preferable to use a programming language to define the value of a solver variable. The user-
defined subroutine, VARSUB, enables you to do this.
Solver Variables are quite versatile and have many different applications in modeling multi-body
systems. They are commonly used to create signals of interest in the simulation. The signal may
then be used to define forces, independent variables for interpolation, inputs to generic control
elements, and output signals.
MotionSolve expressions and user-subroutines allow for fairly complex algebraic states to be defined.
For more information, please refer to the MotionView and MotionSolve User's Guides in the on-line
help.
2. From the Project Browser, right-click on Model and select Add > Control Entity > Solver
Variable (or right-click on the Solver Variables icon, , from the toolbar).
5. In the Variable field, assign a variable name to the solver variable or leave the default name.
7. From the Properties tab, under Type:, select Linear and enter a value of 1.4 in the field.
Differential Equation (or right-click on the Solver Differential Equation icon, , from the
toolbar.
3. In the Label field, assign a label to the solver diff or leave the default label.
4. In the Variable field, assign a variable name to the solver diff or leave the default name.
This is an implicit differential equation that has a constant (Cp/R). The initial condition of the
differential equation (IC) and its first derivative (IC dot) are known (given).
8. Select SolverDiff 0. From the Properties tab, select Implicit and specify IC and IC dot as 2000
and -58875, respectively.
`-DIF1 ({diff_0.id})/DIF({diff_0.id})+{sv_3.value.lin}*DIF1({diff_1.id})/
DIF({diff_1.id})`
You can use the model tree to access entity variables in your model. As you can see for the
above expression, to refer to the ID of the differential equation, browse for it from the list-tree on
the Properties tab and select the ID. Click Apply. The name of the selected entity or property
is inserted into the expression.
13. Repeat steps 8 through 13 to modify the remaining two differential equations:
Implicit: Yes.
IC: 560
IC_dot: -4710
Value Expression:
`DIF1({diff_0.id})/DIF({diff_0.id})-DIF1({diff_1.id})/DIF({diff_1.id})-
DIF1({diff_2.id})/DIF({diff_2.id})`
Implicit: No.
IC: 0.000256
Value Expression:
`-{sv_1.value.lin} *sqrt({sv_0.value.lin}*DIF({diff_2.id})*DIF({diff_0.id}) /
{sv_2.value.lin})*0.5787`
1. Click the Run button, , on the toolbar. The Run panel is displayed.
5. Click Save.
7. To run the model, click Run. The solver will get invoked here.
For your convenience, MotionSolve contains a subroutine build tool for Windows and Linux that can
build the subroutine for you. Using this subroutine requires no programming knowledge.
You can also build your user subroutine using an integrated development environment like Microsoft
Visual Studio on Windows. This is explained in this tutorial.
Follow these steps to build a MotionSolve-compatible shared library using available source code.
Start > All Programs > Altair HyperWorks (64-bit) > Tools > MotionSolve Subroutine Builder
The next step is to specify the source code or the object files that you will be using to build the
shared library. The following are valid source file types and can be used to build a shared library:
The source code or object files must all be located in the same directory. You must
have write-to-disk permissions for this directory. If you do not have write-to-disk
permissions for this directory, please copy the source code to a location where you
Important do have write-to-disk permissions.
Also, if your source/object code is located in different folders on your disk, please
copy all source/object code, along with any relevant files (like headers, for example)
to one common directory. Use this as your working directory in the following steps.
2. Navigate to your working directory and choose the source files as required. You can choose
multiple files by holding down the CTRL button while clicking the file names, or by clicking and
dragging your mouse pointer.
2. Navigate to the directory where you want the shared library to be built. Click Select Folder to
choose the current folder as the output directory.
Note The shared library name must contain only alphanumeric characters (A-Z, a-z, 0-9) with
the exception of the underscore (_) character.
2. For the Windows platform, if you have multiple compilers installed on your computer, you can
choose which compiler to use while building your shared library:
Additionally, you will see the shared library built by the tool in your working directory (C:\Test in
this case). You can use this library in a MotionSolve simulation.
The tool also creates a temporary directory inside your working directory while building the shared
library. The contents of this temporary directory can be used for debugging and informational
purposes.
Note The temporary directory created inside of your working directory contains some useful
information:
build.bat: a batch file that contains the compiler and linker commands used to build the
shared library.
build_output.log: a log file that contains messages from the compiler and linker. The
contents of this file are useful when debugging an unsuccessful build.
For a successful build, this directory also contains compiled objects, the linked library and other
temporary files. If you specified only C/C++ source files and/or object files, the tool also creates
a Microsoft Visual Studio solution file in this directory.
4. If, however, your build is unsuccessful, the following dialog box is displayed:
5. To investigate the cause of build failure, you may want to look at the build_output.log file at
the location stated in the dialog box above. This file typically contains compiler/link time errors or
warnings that may help you debug your source code.
FAQs
Q. Can the tool build a shared library when both FORTRAN and C/C++ source code is specified?
A. Yes, the tool can handle mixed source code as well as object files.
Q. Where can I get sample templates for the syntax of the C/C++/FORTRAN code?
A. Sample user subroutine code is provided in the HyperWorks installation in the following locations:
Note: For MotionSolve to use the functions defined in the source code, these functions must be
exported on the Windows platform (on Linux, all functions are automatically exported). The
syntax to do this for C/C++ and FORTRAN is described below.
CLINKAGE
DLLFUNC void STDCALL ARYSUB (int *id, double *time, double *par,
int *npar, int *dflag, int *iflag, int *nvalue, double *value)
{
}
FORTRAN
In FORTRAN syntax, the same function above can be exported as shown below:
A. Yes, this can matter in certain cases. For example, when building FORTRAN source code and
defining MODULES, you may want to include the source file that contains the definition of any defined
modules before the source files that refer to these modules.
Q. I am not able to compile FORTRAN files even though I have a supported Intel FORTRAN compiler
installed. Whats wrong?
A. The build tool relies on an environment variable to detect the version of the Intel FORTRAN compiler
and its location on your machine. Make sure you have the environment variable IFORT_COMPILERxx
(where xx is the version of the compiler 10, 11 or 12) defined correctly on your system and pointing
to the installed version.
Note If you are using a version newer than Visual Studio 2005, you will be prompted to
convert the project file. Please proceed with the default options for the conversion.
Once converted, the new project file is loaded to your workspace.
4. In the Solution Explorer, the CPP subroutines that are part of the solution are listed.
5. Double-click any of the CPP files that you want to modify/view and make the required changes.
Make sure that the target type for the shared library matches your HyperWorks installation. For
example, choose x64 for a 64-bit installation of HyperWorks.
8. Select Build > Build Solution to build the DLL. You will be prompted to save the solution. Save
the solution in a directory of your choice.
9. After successfully completing the build, Visual Studio displays a message as shown below:
Consider the problem of maintaining the reference speed of a rotor in the presence of disturbances. A
block diagram of the control system is shown in Figure 1 below.
One simple approach is to design a proportional integral (PI) controller (Ogata, 1995), such that:
Exercise
The model contains a body called rotor that is attached to ground by a revolute joint. The joint
axis is parallel to the global Z-axis. There is a torsional spring-damper with only damping and no
stiffness.
The model also contains output requests for the displacement and velocity of the rotor body.
4. Click OK.
5. To maintain a linear speed of 3 rad/sec, from the Type drop-down menu, select Linear and enter
3 as the value of the solver variable.
1. From the Project Browser, right-click on Model and select Add General MDL Entity > Control
SISO (or right-click on the Control SISO icon, , from the toolbar).
2. Click OK.
3. From the Input tab, select Expression from the Type drop-down menu and enter this expression:
'-WZ({MODEL.b_0.cm.idstring})+{sv_0.value}'
Note the single back quotes, indicating the expression is not to be processed by MDL, but by
Templex. The parameters inside the curly braces are evaluated.
7. Similarly, for Denominator coefficients, click Append and enter 0 and 1 for the coefficients of 1
and s, respectively.
1. From the Project Browser, right-click on Model and select Add Force Entity > Force (or right-
3. Leave the label and variable name default settings and click OK.
4. From the Connectivity tab, under Force, select Action Reaction and for Properties, select
Rotational.
5. Set Local ref. frame by double-clicking Ref Marker and selecting Global Frame.
6. Double-click Body 1 for Action force on: and select the rotor body.
7. Double-click Body 2 for Reaction force on: and select Ground Body.
11. You may also click to access the expression builder and create this expression using the model
tree.
3. Enter Control force for the Label name and click OK.
1. Click the Run button, , on the toolbar to display the Run panel.
2. Under Simulation type, select Transient and specify the output (.xml) filename.
4. Click Run.
Reference
K. Ogata, Modern Control Engineering, 1990, Prentice-Hall Inc., Englewood Cliffs, N.J., US
Start by loading the file inv_pendu.mdl, located in the mbd_modeling\motionsolve folder, into
MotionView. Upon examination of the model topology, you will notice that everything needed for this
exercise is already included in the model. However, depending on which task you are performing, you
will need to activate or deactivate certain entities.
Compute Eigenvalues
1. From the Project Browser, click the Forces folder and make sure that Control ForceOL is
activated, while Control Force CL and Disturbance-step are deactivated.
6. Click Run.
7. Once the solution is complete, close the solver execution window and the message log.
8. The eigenvalues computed by MotionSolve are shown in the table below and can be viewed in
the inv_pendu_ol_eig.eig file using a text editor
EIGENVALUES
There is one eigenvalue with a positive real part, indicating that the system is unstable in the
current configuration.
9. Click Animate.
where A,B,C,and D are the state matrices, x is the state vector, u is the input vector, and y is the
output vector. The A,B,C,and D matrices depend on the choice of states, inputs, and outputs. The
states are chosen automatically by MotionSolve and the chosen states are reported in one of the
output files. We need to define only the inputs and outputs.
1. Expand the Solver Variables folder in the Project Browser and examine the entities..
a. Control Force Variable - CL is used to define the control input after the control law has
been found. Ignore this at this stage.
b. Control Force Variable - OL is used to define the control plant input, which is a force
named Control Force - OL. This force is applied to the slider body. This variable is set to
zero. It is needed by MotionSolve to properly generate the linearized system matrices.
c. Solver variable Pendulum Rotation Angle defines the control plant output and measures the
pendulum rotation about the Global Y-axis.
2. Expand the Solver Array folder in the Project Browser and examine the solver arrays that are
defined.
a. Select Plant-I This array defines a solver array entity of type Plant-Input. Ensure that
Solver Variable is set to Control Force Variable - OL. Click OK.
b. Select Plant-O This array defines a solver array entity of type Plant-Output. Ensure that
Solver Variable is set to Pendulum Rotation Angle.
Note Please note that the plant input and plant output IDs used in linearization are specified
automatically by MotionView while exporting the solver deck.
Linear tab in Simulation Settings dialog for specifying the MATLAB matrix files output
6. From the Simulation Settings dialog > Linear tab, select the State-Space matrices (MATLAB)
option.
You should get six new files with base name inv_pendu_state_matrices and extensions
.a, .b, .c, .d, .pi, .po. The .pi and .po files contain information about the input and output
variables.
4. Translation velocity along the global X-axis of the pendulum body center of mass marker.
It can be easily verified using MATLAB that the system is completely state controllable [1, 2]. We
employ a full-state feedback control law
u = -k*x, where u is the control input, k is the gain vector, and x is the state vector. Then,
assuming the desired pole locations are stored in vector P, you may use the pole placement method to
compute k. For desired poles at [-20 20 20 20] (rad/s), the acker function in MATLAB yields
k=1e3[-2.4186 -0.0163 -0.070 -0.0033].
1 -2.027203E+00 0.000000E+00
2 -3.673652E+00 0.000000E+00
3 -3.461575E+00 1.336447E+00
4 -3.461575E+00 -1.336447E+00
They all have negative real parts, hence the system is stabilized. Note that the negative real
parts are close to the desired poles (-20 rad/s = -3.038 Hz).
Fy=0
Fz=0
1. From the Project Browser, activate deactivated outputs Output control force - final and
Output Disturbance step.
5. Specify the End time and Print interval as 3.0 and 0.01, respectively.
7. Once the job is completed, close the solver window and plot the following results in a new
HyperGraph page using inv_pendu_dyn.abf.
Figure 2: Plots of disturbance and control forces as well as slider translational and pendulum angular
displacements.
References
Feedback Control of Dynamic Systems, G. G. Franklin, J. D. Powell, and A. Emami-Naeini, Third Edition,
Addison Wesley.
See also
Pre-requisites:
Supported Versions - Third Party Software in the XML Format Reference Guide.
<Control_PlantInput
id = "30100100"
num_element = "2"
variable_id_list = "30100400, 30100500"
sampling_period = "0.01"
offset_time = "0.0"
label = "for controller 1"
usrsub_param_string = "USER(987654321)"
usrsub_dll_name = "rtw_BusSuspension2PMIMODiscrete"
usrsub_fnc_name = "PINSUB"
hold_order = "2"
/>
<Control_PlantOutput
id = "30100200"
num_element = "2"
variable_id_list = "30100200, 30100300"
sampling_period = "0.01"
offset_time = "0.0"
label = "for controller 1"
usrsub_param_string = "USER(987654321)"
usrsub_dll_name = "rtw_BusSuspension2PMIMODiscrete"
usrsub_fnc_name = "POUTSUB"
hold_order = "2"
/>
<Control_PlantInput
id = "30100300"
num_element = "2"
variable_id_list = "30100800, 30100900"
sampling_period = "0.01"
offset_time = "0.0"
label = "for controller 2"
usrsub_param_string = "USER(987654321)"
Attribute Description
usrsub_param_string Set this parameter equal to "USER(id)", where the ID is an integer (for
example, 123) that you choose. The ID identifies the Simulink Coder
library, links all Control_PlantInput's and Control_PlantOutput's that
use the library, and must be unique.
Note: There can be more than one Control_PlantInput/
Control_PlantOutput per library.
usrsub_dll_name The name of the DLL that is used (for example, from Simulink Coder).
usrsub_fnc_name The name of the user function/subroutine that MotionSolve calls. This
has to necessarily be "PINSUB" for Control_PlantInput and "POUTSUB"
for Control_PlantOutput.
In this case, this MotionSolve model has been prepared for you. Copy the MotionSolve and Simulink
models, rtw_BusSuspension2PMIMODiscrete.xml and rtw_BusSuspension2PMIMODiscrete.mdl,
located in the motionsolve\cosimulation folder to your <working directory>.
Note: If you have multiple inports/outports, you must retain the above illustrated naming scheme. All
your inports must be defined as In1, In2, , Inx. Similarly, all your outports must be named as
Out1, Out2, , Outx. This is a limitation within the current co-simulation framework and will be
addressed in a future release. See Appendix B for more information.
The order of these Inport's and Outport's must match the order of the Control_PlantOutputs and
Control_PlantInput's, respectively, in the MotionSolve model.
5. Once this is done, change the Language option to C++ in this same Code Generation window.
Simulink Coder does not allow using a variable-step integrator for the Generic Real-Time target
that is required by MotionSolve to generate this code (more details on selecting the Generic Real-
Time target later in this tutorial). So, under the Solver option on the left, choose the Fixed-
step solver, as shown below:
Note See the Mathworks documentation for more details on selecting an appropriate fixed-step
size for your model (in particular, if the model has multiple sample times, you will likely
need to choose a step size equal to the least common denominator of the specified
sample times so that each sample time is hit by the solver).
7. Next, in the left-side browser/tree, select the Code Generation option again.
<Simulink_model>_grt_rtw
slprj
You should see messages that look similar to those below and end with:
or similar.
1. Open a command prompt in your working directory (where Simulink has generated the code).
where,
<mdl_name> is the name of the Simulink model (without the extension .mdl)
<altair_root> is the complete path to the root folder of the HyperWorks installation
<msvs_root> is the complete path to the root folder of the MSVS installation
<win32|win64> specify win32 or win64 depending on the required platform of the DLL
Notes:
1. To successfully issue the ms_rtw_pre command, please include the path of the MotionSolve
binaries in the PATH environment variable. This can be done locally by issuing the following
command on Windows:
set PATH = <MS_bin_path>;%PATH%
where <MS_bin_path> is the path to the MotionSolve binaries; for example, C:\Program Files
\Altair\13.0\hwsolvers\motionsolve\bin\win64
2. If the path to <altair_root> and/or <msvs_root> contains spaces, make sure to enclose the
path in quotes.
Automatically modifies the project settings and source files of the original solution generated
by Simulink Coder
Compiles and links the source code to generate a DLL that can be used with MotionSolve
You can confirm that this process has completed successfully by looking at the output in the
command window. On successful execution, you should see something like the following:
========== Build: 1 succeeded, 0 failed, 0 up-to-date, 0 skipped ==========
1 file(s) copied.
1. In this example, the ms_pre_rtw script should have created the generated DLL into the same
folder where the MotionSolve model (.xml) resides. If the DLL is created elsewhere, copy it to
the working directory of the MotionSolve .xml file.
2. Open a command window and change the path into this folder in order to run the model.
3. You will be running the MotionSolve model on command line, so certain environment variables must
be set to be able to invoke MotionSolve. See the MotionSolve Users Guide for more details on
the options to run on the command line.
4. Run the MotionSolve model in the command line by issuing the command mbd_d x.xml x.mrf.
The simulation should run quickly and you should review your results to confirm that the process
worked as expected.
Appendix A
This section discusses the access functions CoSimAPI_SimulinkRTW_Update_U(api,model,input)
and CoSimAPI_SimulinkRTW_Update_Y(api,model,output). These are added to the Simulink model
source code in order to help perform the co-simulation via the DLL.
CoSimAPI_SimulinkRTW_Update_U(void *api, const RT_MODEL_x x_M, ExternalInputs_x &x_U)
This method updates the input data structure in the Simulink Coder generated code with the output
from MotionSolve.
The first argument requests a pointer to the API ID. The API ID is passed from the model XML in the
line usrsub_param_string = "USER(987654320)". The first parameter in the USER() string is always
the ID of the API. The MotionSolve API provides the method void * CoSimAPI_Get_API_Ptr(int
api_id) to get the API pointer, where the api_id is the number specified in the XML file in the
USER() string.
The second argument requests data structure x_M related to the generated Simulink Coder model
information where x is the name of the model. The x_M data structure is inherent to the Simulink
code.
The last argument requests input x_U where x_U is the data structure used by the Simulink Coder
code to store the external inputs (see Appendix B).
CoSimAPI_SimulinkRTW_Update_Y(void *api, const RT_MODEL_x x_M, const
ExternalOutputs_x x_y)
This method updates the input for the MotionSolve solver with output from the RTW generated code.
The first and second arguments are the same as described in the previous section.
The last argument requests RTW output x_Y which is deposited to MotionSolve for that current time
step, where x_Y is the data structure used by the Simulink Coder code to store the external outputs
(see Appendix B).
Typically, the Simulink Coder generated code (SCGC) uses the following notations:
Output port from Simulink with single channel rtw_MS_Y.Out1, rtw_MS_Y.Out2 etc.
So for example, for a model with two Control_PlantInput (CPI) elements where the first has three
channels and the second has two channels, the corresponding data structure in Simulink Coder code
would be:
CPI #1: rtw_MS_U.In1[0], rtw_MS_U.In1[1] and rtw_MS_U.In1[2]
The same scheme is applicable for the data structure that handles Control_PlantOutput ports.
Note If the Simulink model has labels defined for the input/output links, then these labels will replace
In and Out in the data structure described above. In and Out are the default names
used by Simulink in case the links are not named. In this scenario, you need to change the
first input variable name specified in the rtw api function template
CoSimAPI_SimulinkRTW_Update_U(api,model,input) into the one you specified.
For example, if you name the first input to be myIn instead of In1, you need to make the following
change to that function template:
double *u_ptr = (double *)&u.myIn;
Use Python to make a user subroutine for MotionSolve. It is assumed that you are familiar with
Python and MotionSolve XML syntax.
Convert a model with six SFOSUBs, written in C, into a Python usersub.
Using scripting language such as Python gives you power with reduced complexity. These scripts are
interpreted and do not require compiling. Therefore, you do not need a building tool to build
subroutines. Furthermore, scripts are easier to read and understand, and can be used for faster
prototyping.
If you do not have much programming experience, writing scripts for user-subroutines is simpler than
writing C code. For a C user, the usage is even simpler. Besides following the language syntax of
Python, you only need to follow the rules to convert the C code into Python scripts.
For your reference, a sample set of Python user subroutines is available in the hwsolvers
\motionsolve\usersub\py_src folder.
becomes
istat = py_datout()
In C utility functions, the input and output arguments are combined in an argument list. In
Python, the arguments of the py_* utility functions are strictly the input arguments. All output
arguments should be moved to the left-side as return values of the function call.
2. In C utility functions, any input or output array argument is generally followed by an integer
argument for the array size. In Python utility functions, the integer argument for the array size is
removed because it is not necessary.
ipar[0] = (int)par[0];
ipar[1] = (int)par[1];
c_sysfnc("DM", ipar, 2, &dm, &errflg);
simply becomes
[dm, errflg] = py_sysfnc("DM", [par[0],par[1]])
and
ipar[0] = (int)par[1];
ipar[1] = (int)par[0];
c_sysary("TDISP", ipar, 2, u1, &nstates, &errflg);
becomes
[coord2, istate] = py_rcnvrt(sys1, coord1, sys2)
DLLFUNC void STDCALL SFOSUB (int *id, double *time, double *par,
int *npar, int *dflag, int *iflag, double *result)
{
// --- Add your local definitions here ---------------------
double vector[3],dm,vm;
int ipar[2], iord;
int errflg;
1. interpreter = "Python"
2. script_name = "script_name.py"
4. The following image shows the difference between using C user sub and Python user sub in this
example:
5. In the original model, there are six Force_Scalar_TwoBody elements that use SFOSUB written in
C:
<Force_Scalar_TwoBody
id = "30701"
type = "Force"
i_marker_id = "30701010"
j_marker_id = "30701011"
usrsub_param_string =
"USER(50,30301010,30401010,30301010,30401010,10,10,2.0,0.001,0.01)"
usrsub_dll_name = "NULL"
usrsub_fnc_name = "SFOSUB"
/>
<Force_Scalar_TwoBody
id = "30801"
type = "Force"
i_marker_id = "30801010"
j_marker_id = "30801011"
Introduction
Friction is defined as a resistance force opposing motion. Friction appears at the physical interface
between any two surfaces in contact. Friction force arises mainly due to adhesion, surface roughness
and plowing at the contact surfaces.
1. When contacting surfaces are smoother and brought to closer proximity; molecular adhesive
forces forms resistance to motion.
2. When contact surfaces are highly rough to cause abrasion on sliding; surface roughness resists
motion.
3. When one surface in contact is relatively soft, plowing effect causes most of resistance.
Friction forces generated depend on:
The friction force varies based on its states (as shown in the above figure). The (a) section shows
Coulomb friction, (b) shows Stiction plus Coulomb friction, and F(c) shows how the friction force may
decrease continuously from the static friction level due to lubrication also known as Stribeck effect.
Friction-velocity relation or damping characteristics of friction will aid in dampening vibrations. There
are other behaviors of friction such as pre-sliding and hydrodynamic effects of lubrications during
dynamic simulations. Resistant forces from the above mentioned effects need consideration in design
of drive systems and high-precision servo mechanisms. So, its important to model friction accurately
to capture system dynamics.
Joint friction
Friction in joint depends on its geometry. MotionSolve uses an analytical model to represent friction
for different joints based on geometry, preloads, torque and lubrication.
MotionSolve uses LuGre model for friction representation. LuGre model is a bristle model emerged for
controls applications. LuGre model was presented by Canudas de Wit, Olsson, strom, and Lischinsky.
Stemming from a collaboration among researchers at the Lund Institute of Technology (Sweden) and
in Grenoble France (Laboratoire dAutomatique de Grenoble), the LuGre model captures a variety of
behaviors observed in experiments, from velocity and acceleration dependence of sliding friction, to
hysteresis effects, to pre-slip displacement and lubrication.
LuGre model can model friction considering geometry of joint, preload, moment arm, force and torque.
Friction is supported for a subset of joints namely Revolute, Spherical, Translational Joint, Cylindrical,
and Universal Joint. Please refer to our MotionSolve online help for a detailed explanation of friction for
each constraint.
This tutorial uses an experimental model of a block sliding on a table to demonstrate friction forces
under stick-slip condition and frequency dependency of friction forces.
The leader and follower model constitutes two rigid bodies namely Leader and Follower respectively
connected to the Ground body by translation joints and inter connected by a linear spring. In the
following steps you will add friction and apply motions to study friction behavior of the translation
joint.
3. From the Friction Properties tab, check the Use Friction option to activate friction on joint.
Note MotionView populates the panel with default properties that are appropriate with units N,
mm, second. You will need to scale properties such as Stiction Transition Velocity,
Force Preload, and Geometric properties (Initial Overlap, Reaction Arm) according to
the units.
5. Select the LuGre Parameters tab to modify the Bristle properties. Modify the Damping
Coefficient value to 0.0316.
Note Default properties of bristle are appropriate with units N, mm, second.
1. Right click the Output icon from General MDL Entity Tool bar.
Fx component =1
9. Click OK.
10. Repeat the process for F3, F4, F6, F7, and F8 by changing the second parameter to 2, 3, 4, 5,
and 6 accordingly.
The function FRICTION(ID, comp) computes the friction force component specified in the comp
corresponding to the joint ID.
1. Right click the Outputs icon on the General MDL Entity toolbar.
3. Under the Main tab, click on the icon to specify the name and location of the MotionSolve
.xml file. Save the file with the name Stick_Slip.xml in your working directory.
4. Notice that after saving the file, the Run button to the right becomes active.
5. Specify the End time as 25 sec and leave the other values at their default setttings.
Y Component VX
Y Type Expression
Y Request Friction_Force
Y Component F4
6. To start the animation, click the Start/Pause Animation icon on the toolbar.
The Leader body moving at a constant velocity elongates the spring increasing spring force
linearly. The friction force counteracts the spring force, and there is a small displacement of
Follower body when the applied force reaches the break-away force.
= 0.15x1x9.81
= 1.47 Newton.
This expression varies velocity from 1.1 mm/sec to 3 mm/sec at a frequency of 1 rad/sec.
Velocity variation
Note Multiply `time` with 10, 25 will vary velocity at frequencies 10rad/sec and 25 rad/sec
respectively.
3. Under the Main tab, click on the icon to specify the name and location of the MotionSolve
.xml file. Save the file with the name Hysteresis_1radpersec.xml in your working directory.
4. Specify the End time as 3 seconds and the Print Interval as 0.0001 seconds.
6. Modify the velocity expression of the Follower Translation Joint and run the model with the file
names and end times specified in the table below:
Y Component VX
Y Type Expression
Y Request Friction_Force
Y Component F4
There is an initial transition of friction force values, therefore you will plot hysteresis curve
excluding first cycle data (in other words, 0 to 1 sec.).
Populate X data to select velocity between time interval 1 to 3 secs using the subrange
function: p1w2c1.y[subrange(p1w2c1.x,1,3)].
Populate Y data to select Friction force between time interval 1 to 3 secs using the subrange
function: p1w2c2.y[subrange(p1w2c1.x,1,3)].
The velocity variation with higher frequency will have widest hysteresis loop.
In this scenario, MotionSolve computes the displacements and rotations for the rigid bodies, while
AcuSolve computes the forces and moments on those bodies. Both solvers exchange data with each
other while stepping forward in time via the TCP socket protocol. This means that the two solvers
can be located on different machines and on different platforms and still communicate with one
another. For example, the CFD simulation can run on an HPC, while the MBS simulation can run locally
on a laptop.
Tutorial Objectives
In this tutorial, you will learn how to setup a model in MotionView that will be coupled with AcuSolve.
You will use the MotionSolve-AcuSolve co-simulation interface to couple the rigid body dynamics of a
check valve within a pipe with the flow field. The AcuSolve model has already been setup for you and
is located at <installation directory>\14.0\tutorials\mv_hv_hg\mbd_modeling\motionsolve
\cosimulation\Check_Valve_Coupled.acs. Steps for running this model in AcuSolve are included as
part of this tutorial.
To learn more about how to setup the model in AcuSolve, please refer to <installation_directory>
\14.0\acusolve\<platform>\help\acu\acusolve_tut\Tutorials\Check_Valve_Coupled\.
Software Requirements
To successfully complete this tutorial, the following must be installed:
3. AcuSolve v14.0.
Machine A Machine B
From the table above, the co-simulation is currently only supported for the Windows 64-bit platform
for MotionView and MotionSolve. You may use either a Windows 64-bit or a Linux 64-bit installation of
AcuSolve.
The geometry that is modeled in this tutorial is illustrated in Figure 2 below. It consists of:
The check valve assembly consists of a disc-like body mounted on a stem. When fluid flows in the
direction specified by the red arrows in Figure 2 above, the fluid forces the shutter body to translate
in the same direction as the fluid. The motion of the shutter body is also affected by a spring damper
attached between the shutter body and the perforated plate. Finally, 3D rigid body contact is
modeled between the shutter body and the stop to arrest the motion of the shutter body in the
direction of the flow.
For the MBS model, only 1/12 of the shutter body and the perforated plate are modeled.
At the start of the simulation, the flow field is stationary. A pressure specified at the inlet drives the
flow, which varies over time as a piecewise linear function. This is illustrated in Figure 3. As this
pressure rises, the flow accelerates which in turn pushes the shutter body open and allows flow
through the pipe.
This dynamics of this kind of model can be termed as being tightly coupled between the two solvers.
This means that the motion of the rigid bodies affects the fluid flow field, which in turn affects the
rigid body motion in a cyclical fashion.
The rest of this tutorial assumes that this model has been correctly setup in AcuSolve. Note that the
model is designed to translate the shutter body until it collides with the perforated plate. The
MotionView model has been designed with a contact between these two bodies that causes the
shutter body to rebound appropriately. To allow the rigid bodies to come into contact without the
AcuSolve finite element mesh fully collapsing, the perforated plate in the fluid model has been offset
by 0.002m in the positive X direction. This allows the MotionView model to react as specified by the
contact entity while keeping the AcuSolve mesh from fully collapsing.
This model is prepared to run in MotionSolve but requires modifications to run in co-simulation with
AcuSolve. These steps are outlined below.
Once the model is loaded into MotionView, the graphical window displays the shutter valve,
perforated plate, joint and spring entities, as well as a graphical representation of the spring
damper as shown in Figure 4.
Solver Units Data Set The units for this model (Newton, Meter,
Kilogram and Second).
Gravity Data Set Gravity specified for this model. The gravity
is turned on and acts in the negative Y
direction.
Shutter Body Graphic Graphic The graphic that represents the shutter
body. This graphic is used both for the co-
simulation and for the contact force
calculations.
Fixed Fixed Joint This fixed joint clamps the perforated plate
body to the ground.
Step 2: Specify the wet body that will interact with AcuSolve
To couple with AcuSolve, you need to specify one or more "wet" bodies. A "wet" body is a body in
the MotionSolve model which interacts with the fluid flow and thus has forces and moments acting on
it. Such a body can translate or rotate due to the actuating fluid force/moment as computed by
AcuSolve as well as due to any actuating forces/moments in the MotionSolve model. In this example,
we will define a single "wet" body the shutter body that translates along the X axis due to fluid
impinging on it.
To specify a body as "wet" in MotionView, you have to make use of a system definition, which is
described below.
1. Add the system definition to your model by locating the Model system in your Project Browser
and select it.
2. The system definition that is used for this co-simulation is located at <altair>\14.0\utility
\mbd\fluid_force\sys_fluid_force.mdl. Click Import to import the file.
The Import Definition dialog is displayed. Leave the labels as-is and click OK.
Figure 7: Defining the rigid body associated with the wet body
If you examine the contents of this system under the project browser on the left, you will see the
following new components have been created:
Shutter Body - AcuSolveForce Action Only, The force and moment calculated by
TransRotational Force AcuSolve is applied to the wet body
through this force component.
Plant Input Control Plant Input AcuSolve deposits the forces and
torques into this modeling element.
FromAS_TX
FromAS_TY
FromAS_TZ
At this point, you have setup the model in MotionView to interact with AcuSolve.
1. Deactivate the template Define co-simulation with AcuSolve as shown in Figure 8 below:
By doing this, you are deactivating the flag which tells MotionSolve that this model is intended for
co-simulation with AcuSolve. Thus, MotionSolve simulates this model as a stand-alone model
without co-simulating with AcuSolve.
You may run this model using the Run panel in MotionView and ensure that there are no error or
warning messages reported. This is recommended to ensure that the model works properly before
attempting a co-simulation.
If you load the animation H3D generated from running this model, you will see that there is no
motion in any of the parts. This is because all of the actuation for this model comes from
AcuSolve, which was disabled for this simulation.
3. After you have verified the model, re-activate the template Define co-simulation with AcuSolve
to perform a co-simulation, shown in Figure 9 below:
1. To export the model to your working directory, click the Export to Solver button, , and export
the solver deck to your working directory.
1. The name of the wet body/bodies need to match between MotionSolve and AcuSolve. The
names of the wet body/bodies are specified in the *.inp file on the AcuSolve side.
Note The names are case-sensitive and must match exactly (see the text in red below).
MotionSolve (.xml):
<Body_Rigid
AcuSolve (.inp):
EXTERNAL_CODE_SURFACE( "Valve wall" ) {
2. The print_interval for the MotionSolve model needs to match the step size for the AcuSolve
model. For this tutorial it is set to 0.002s.
4. Also, verify that the end times for both models are set to the same values. For this tutorial, the
end times for both the AcuSolve and MotionSolve models are set to 0.35s.
See the Run Panel in MotionView to set the print_interval, step size (h_max), and end times.
Note that the units in the MotionSolve and AcuSolve models do not need to match to run the co-
simulation; however, the units must match to overlay the results animations in HyperView. The
units in MotionView are set via the Units form shown below:
All values in the MotionSolve model are set with respect to these units settings.
3. Activate the as_cosim option. When this flag is enabled, it tells the Run Manager to do the
following:
Invoke the MotionSolve executable and run the model that is specified.
Invoke the middleware acuMSI, which enables communication between MotionSolve and
AcuSolve.
When you activate this option, the following dialog is displayed and you are prompted for
additional options:
acuMSI options
-aport <integer> Specifies the communication port number for communication between
AcuSolve and acuMSI. The default is 48000.
Note If you need to change the default port for communication between
AcuSolve and acuMSI, in addition to changing this argument, you
also have to specify the changed port number in the AcuSolve input
file.
Note If you need to change the default port for communication between
MotionSolve and acuMSI, in addition to changing this argument, you
also have to specify the changed port number in an environment
variable MS_AS_PORT. MotionSolve checks for this environment
variable at the start of the simulation and changes its listening port
accordingly.
-mi <integer> Specifies the maximum number of iterations per time step between the two
solvers. The default is 0.
-v <integer> Specifies the verbosity level of the output file from acuMSI. The default is
set to 0 (verbosity OFF).
6. You are now setup to start the co-simulation on the MotionSolve side. Click Run.
2. From the Start menu, select All Programs > Altair HyperWorks 14.0 (64-bit) > AcuSolve >
AcuSolve Job Launcher. In the window that is displayed, change the field Problem name as
specified by the AcuSolve .inp file. Make sure your Problem directory is set to your current
working directory.
For this model, the default values are used. AcuSolve runs using a single processor, and
AcuConsole generates the input files and launches AcuSolve.
As the solution starts, an AcuTail window opens. After executing acuPrep, AcuSolve stops at the
acuRun path step. Its waiting for the execution of the MotionSolve process.
Soon, AcuSolve and MotionSolve should begin to communicate with one another. You should be
able to see relevant time stepping information in both solver windows. For example, you should
see something like the following in the MotionSolve window at the beginning of the co-simulation:
INFO: [AS-COSIM] Connected to AcuMsi on port 94043
The co-simulation should take roughly 15 minutes to complete on a laptop (Intel i7. 2.8GHz).
Note that there is no order dependency on launching the co-simulation either MotionSolve or
AcuSolve can be launched first.
1. To launch HyperView (HyperGraph), from the Start menu, select All Programs > Altair
HyperWorks 14.0 (64-bit) > HyperView (HyperGraph).
The animation H3D generated by the MotionSolve part of the co-simulation contains only the results
from MotionSolve. Similarly, the result files from AcuSolve only contain the results for the AcuSolve
model. To animate the results from the co-simulation, follow these steps:
o Click the file open button, , next to Load model and navigate to the results directory
(the same directory where the .xml file is located).
o Click Apply.
HyperView loads the MotionSolve results file into the graphical window at the first time step.
From this point, you can animate the transient results using Start/Stop on the Animation
Slider.
2. To load the AcuSolve results, they must first be converted to the .h3d format. This can be
accomplished by using the AcuSolve utility, acuTrans. AcuTrans is available from the Start
menu. Select All Programs > Altair HyperWorks 14.0 (64-bit) > AcuSolve > AcuSolve Cmd
Prompt.
3. Navigate to the results directory and execute the following command to convert the AcuSolve
database into the .h3d format:
4. Using acuTrans, overlay the newly-created H3D over the MotionSolve result H3D in HyperView.
Figure 20: Overlaying AcuSolve H3D over the MotionSolve H3D in HyperView
Once loaded, the graphical window contains both results and can be animated as before. To
visualize the information contained within the AcuSolve results, a Contour plot may be used. Click
Figure 21: Overlaying AcuSolve H3D over the MotionSolve H3D in HyperView
This creates a contour plot of the velocity magnitude overlaid with the results from MotionSolve in
one window.
Figure 22: Velocity magnitude plot overlaid with the MotionSolve results in HyperView
You can also interpret the results with a two dimensional plot using HyperGraph. HyperWorks Desktop
can be used in a multi-window layout, allowing both HyperView and HyperGraph to be open at the
same time.
1. First, open HyperView following the steps described in the previous section.
2. From the toolbar, click the Page Window Layout button, , and split the page into two
vertical pages.
This automatically adjusts the graphical window to accommodate two pages, defaulting to two
instances of HyperView.
3. Click anywhere in the page on the right and switch to HyperGraph by clicking the Page Selector
4. Click the Build Plots button, , to load the .plt file from the same results directory.
Once the .plt file is loaded into HyperGraph, the two outputs are available for plotting.
o Click Apply.
HyperGraph can be used to create additional traces on the same plot to generate the following
plots.
Figure 27: The MotionSolve animation side-by-side with the MotionSolve plot results
SMP co-simulation uses shared memory while exchanging data between the two solvers. This
approach requires that both MotionSolve and MATLAB be installed on the same machine. Additionally,
the two software must be both 64-bit. The rest of this tutorial describes the co-simulation using the
SMP approach.
For IPC co-simulation, the two solvers are run on two separate processes with data being exchanged
through sockets. Since the two solvers run on different processes, this method allows you to run a
co-simulation between MotionSolve and MATLAB installed on separate machines. Additionally, the two
software need not be 64-bit. As an example, a 32-bit MATLAB can be used to co-simulate with a 64-
bit installation of MotionSolve on a different machine.
MotionSolve
MATLAB/Simulink (MATLAB Version 7.6(R2008a), Simulink Version 7.1(R2008a)) (or newer)
Hardware requirements:
Both the pendulum and the cart are modeled as rigid bodies. The controller, modeled in Simulink,
provides a control force to the cart to stabilize the inverted pendulum and prevent it from falling. This
control force is applied to the cart via a translational force. The model setup is illustrated in Figure 1
below.
The pre-designed controller generates a control force that keeps the pendulum upright. The controller
uses the pendulums orientation and angular velocity along with the carts displacement and velocity
as inputs to calculate the direction and magnitude of the force needed to keep the pendulum upright.
A block diagram of the control system is shown in Figure 2.
is the angular velocity of the pendulum about its center of gravity as measured in the
ground frame of reference
x is the translational displacement of the cart measured from its model configuration in the
ground frame of reference
x& is the translational velocity of the cart measured in the ground frame of reference
R
is a reference signal for the pendulums angular displacement
Rx&
is a reference signal for the carts translational velocity
A disturbance is added to the computed control force to assess the system response. The controller
force acts on the cart body to control the displacement and velocity profiles of the cart mass.
Solve the baseline model in MotionSolve only (i.e., without co-simulation) by using the inverted
pendulum model with a continuous controller modeled by a Force_Vector_OneBody element.
You can use these results to compare to an equivalent co-simulation in the next steps.
Review a modified MotionSolve inverted pendulum model that mainly adds the
Control_PlantInput and Control_PlantOutput entities that allow this model to act as a plant for
Simulink co-simulation.
Review the controller in Simulink.
Perform a co-simulation and compare the results between the standalone MotionSolve model
and the co-simulation model.
Before you begin, copy all the files in the <installation_directory>\tutorials\mv_hv_hg
\mbd_modeling\motionsolve\cosimulation folder to your working directory (referenced as
<Working Directory> in the tutorial). Here, <altair> is the full path to the HyperWorks installation.
Fdist
is the disturbance force,
Fcontrol K1 error K 2
error K 3 errorx K 4 errorx&
is the control force,
Ki
are gains applied to each of the error signals
error is the error (difference between reference and actual values) on the input signals.
The angular displacement and velocity of the pendulum are obtained by using the AY() and WY()
expressions respectively. The translational displacement and velocity of the cart are obtained similarly,
by using the DX() and VX() expressions.
Slider Trans Joint Translational Joint Translational joint between the cart body
and the ground
Pendulum Rev Joint Revolute Joint Revolute joint between the pendulum body
and the cart body
Control Force Vector Force The control force applied to the cart body
Output control force Output request Use this request to plot the control force
Output slider displacement Output request Use this request to plot the carts
displacement
Output slider velocity Output request Use this request to plot the carts velocity
Output pendulum Output request Use this request to plot the pendulums
displacement displacement
Output pendulum velocity Output request Use this request to plot the pendulums
velocity
Pendulum Angular Velocity Solver Variable This variable stores the rotational velocity
of the pendulum via the expression VY()
The results that we get from Step 2 will be used as the baseline to compare the results that we
get from co-simulation.
Step 2: Use modified MotionSolve Model to define the plant in the control
scheme.
A MotionSolve model needs a mechanism to specify the input and output connections to the Simulink
model. The MotionSolve model (XML) used above is modified to include the Control_PlantInput and
Control_PlantOutput model elements and provide these connections. In this tutorial, this has already
been done for you, and you can see this by opening the model
InvertedPendulum_Cosimulation.mdl from your <Working_Directory>.
Plant Input Simulink Plant input This Control_PlantInput element is used to define
the inputs to the MotionSolve model
Plant Output Simulink Plant output This Control_PlantOutput element is used to define
the outputs from the MotionSolve model
The Control_PlantInput element defines the inputs to a mechanical system or plant. For this
model, only one input is defined in the Plant Input Simulink solver array. This is set to the ID
of the solver variable that holds the control force from Simulink.
The inputs specified using the Control_PlantInput and Control_PlantOutput elements can be
accessed using the PINVAL() and POUVAL() functions, respectively. Since the Control_PlantInput
and Control_PlantOutput list the ids of solver variables, these input and output variables may also
be accessed using the VARVAL() function. For more details, please refer to the MotionSolve User's
Guide on-line help.
Plant Input: A single control force that will be applied to the cart.
Plant Output: The pendulums angular displacement and angular velocity; the carts
translational displacement and velocity.
In the shell/command window that calls MATLAB (with the set command on Windows, or the
setenv command on Linux)
Environment Path
variable
Windows Linux
NUSOL_DLL_DI <altair>\hwsolvers <altair>\hwsolvers\motionsolve\bin\linux64
R \motionsolve\bin\win64
where <altair> is the full path to the HyperWorks installation. For example, on Windows, this would
typically be C:\Program Files\Altair\14.0.
Note that other optional environment variables may be set for your model. See MotionSolve
Environment Variables for more information on these environment variables.
The S-Function libraries for co-simulation with MotionSolve are called either:
mscosimipc for Inter Process Communication (IPC) using TCP/IP sockets for communication.
Please see the tutorial MV-7003 for details on how to use IPC for co-simulation. The rest of this
tutorial is described for the Shared Memory (SMP) communication process.
Changing the name of this library in the S-Function block in Simulink changes the communication
behavior of the co-simulation.
The location of these files needs to be added to the search path of MATLAB for the S-Function to use
mscosim.
a. From the Matlab menu, select File > Set Path This is shown in Figure 6 below.
b. From the dialog box, add the directory where the mscosim libraries reside.
c. Select Save and Close. This procedure permanently adds this directory to the MATLAB/
Simulink search path.
2. Use MATLAB commands.
to add the directory where mscosim library resides into the MATLAB search path. It remains valid
until you exit MATLAB. You can also create a .m script to make this process more easily
repeatable.
For example, you can set the MATLAB Path and the necessary environment variables using
MATLAB commands in a MATLAB (.m) script:
addpath('<altair>\hwsolvers\motionsolve\bin\win64')
setenv('NUSOL_DLL_DIR','<altair>\hwsolvers\motionsolve\bin\win64')
setenv(LD_LIBRARY_PATH, '<altair>\hwsolvers\motionsolve\bin\linux64:<altair>
\hwsolvers\common\bin\linux64\')
3. Click Open.
You will see the control system that will be used in the co-simulation.
The S-function (system-function) is one of the blocks provided by Simulink and represents the
MotionSolve model. It can be found in the Simulink User-Defined Functions block library. An S-
Function allows you to model any general system of equations with inputs, outputs, states, and
so on, and is somewhat analogous to a Control_StateEqn in MotionSolve. See the MATLAB/
Simulink documentation for more details.
3. MotionSolve user DLL name (optional); enter empty single quotes ('') if not used.
3. Click the file browser icon, , and load the InvertedPendulum_NoCosimulation.mrf file. This
was the baseline results created by running MotionSolve by itself.
5. Select Marker Displacement for Y-Type, then REQ/70000004 Output slider displacement (on
Slider cart) for Y Request, and DX for Y Component to plot the carts translational displacement:
7. Select Marker Force for Y-Type, then REQ/70000002 Output control force- (on Slider cart)
for Y Request, and FX for Y Component to plot the X component of the control force:
8. Click the file browser icon, , and load the InvertedPendulum_Cosimulation.mrf file. This
was the co-simulation results run with Simulink.
9. Select Marker Displacement for Y-Type, then REQ/70000004 Output slider displacement
(on Slider cart) for Y Request, and DX for Y Component to overlay the plot in the left window.
You will notice that both the signals match as shown below.
Figure 11: C omparison of the cart displacement and cart control force between the two models
The blue curves represent results from the MotionSolve-only model and the red curves represent
results from the co-simulation.
SMP co-simulation uses shared memory while exchanging data between the two solvers. This
approach requires that both MotionSolve and MATLAB be installed on the same machine. Additionally,
the two software must be both 64-bit. Please see MV-7002 for additional information.
For IPC co-simulation, the two solvers are run on two separate processes with data being exchanged
through sockets. Since the two solvers run on different processes, this method allows you to run a
co-simulation between different build types (32-bit/64-bit) for MotionSolve and MATLAB. As an
example, a 32-bit MATLAB can be used to co-simulate with a 64-bit installation of MotionSolve on the
same or different machine. The rest of this tutorial describes the co-simulation using the IPC
approach.
MotionSolve
MATLAB/Simulink (MATLAB Version 7.6(R2008a), Simulink Version 7.1(R2008a)) (or newer)
Hardware requirements:
Simulation Environment
In this tutorial, it is assumed that MATLAB is installed on Machine A and MotionSolve is installed on
Machine B. The following scenarios are feasible:
Note When you start the co-simulation from Simulink, a few MotionSolve binaries are loaded by
Simulink at runtime. For this purpose, MotionSolve is needed to be installed on the machine
where Simulink resides. Also, this installation of MotionSolve must be of the same build type as
Simulink. For example, to do an IPC co-simulation between Simulink 32-bit and MotionSolve 64-
bit, you would need to install a 32-bit MotionSolve on the same machine where the Simulink
32-bit software is installed. The table above is updated below to reflect this:
* Altair HyperWorks no longer supports 32-bit version of MotionSolve starting version 13.0 and beyond. To
use the 32-bit version of MotionSolve, you will need to install the 12.0.x version of HyperWorks.
This tutorial describes the process to perform a co-simulation between a 64-bit installation of Simulink
on Machine A and a 64-bit installation of MotionSolve on Machine B i.e., the scenario that is in
blue text in the table above. This is illustrated better in Figure 1 below.
Consider an inverted pendulum, mounted on a cart. The pendulum is constrained at its base to the
cart by a revolute joint. The cart is free to translate along the X direction only. The pendulum is given
an initial rotational velocity causing it to rotate about the base.
The pre-designed controller generates a control force that keeps the pendulum upright. The controller
uses the pendulums orientation and angular velocity along with the carts displacement and velocity
as inputs to calculate the direction and magnitude of the force needed to keep the pendulum upright.
A block diagram of the control system is shown in Figure 3.
is the angular velocity of the pendulum about its center of gravity as measured in the
ground frame of reference
x is the translational displacement of the cart measured from its model configuration in the
ground frame of reference
R
is a reference signal for the pendulums angular displacement
Rx&
is a reference signal for the carts translational velocity
A disturbance is added to the computed control force to assess the system response. The controller
force acts on the cart body to control the displacement and velocity profiles of the cart mass.
Solve the baseline model in MotionSolve only (i.e., without co-simulation) by using the inverted
pendulum model with a continuous controller modeled by a Force_Vector_OneBody element.
You can use these results to compare to an equivalent co-simulation in the next steps.
Review a modified MotionSolve inverted pendulum model that mainly adds the
Control_PlantInput and Control_PlantOutput entities that allow this model to act as a plant for
Simulink co-simulation.
Review the controller in Simulink.
Perform a co-simulation and compare the results between the standalone MotionSolve model
and the co-simulation model.
Before you begin, copy all the files in the <altair>\tutorials\mv_hv_hg\mbd_modeling
\motionsolve\cosimulation folder to your working directory (referenced as <Working Directory>
in the tutorial). Here, <altair> is the full path to the HyperWorks installation.
Fdist
is the disturbance force,
Fcontrol K1 error K 2
error K 3 errorx K 4 errorx&
is the control force,
Ki
are gains applied to each of the error signals
error is the error (difference between reference and actual values) on the input signals.
The angular displacement and velocity of the pendulum are obtained by using the AY() and WY()
expressions respectively. The translational displacement and velocity of the cart are obtained similarly,
by using the DX() and VX() expressions.
1. From the Start menu, select All Programs > Altair HyperWorks 14.0 > MotionView. Open the
model InvertedPendulum_NoCosimulation.mdl from your <Working Directory>.
Slider Trans Joint Translational Joint Translational joint between the cart body
and the ground
Pendulum Rev Joint Revolute Joint Revolute joint between the pendulum
body and the cart body
Control Force Vector Force The control force applied to the cart
body
Output control force Output request Use this request to plot the control force
Output slider displacement Output request Use this request to plot the carts
displacement
Output slider velocity Output request Use this request to plot the carts
velocity
Output pendulum Output request Use this request to plot the pendulums
displacement displacement
Output pendulum velocity Output request Use this request to plot the pendulums
velocity
Pendulum Angular Velocity Solver Variable This variable stores the rotational
velocity of the pendulum via the
expression VY()
The results that we get from Step 2 will be used as the baseline to compare the results that we
get from co-simulation.
Step 2: Use modified MotionSolve Model to define the plant in the control
scheme.
A MotionSolve model needs a mechanism to specify the input and output connections to the Simulink
model. The MotionSolve model (XML) used above is modified to include the Control_PlantInput and
Control_PlantOutput model elements and provide these connections. In this tutorial, this has already
been done for you, and you can see this by opening the model
InvertedPendulum_Cosimulation.mdl from your <Working_Directory>.
The Control_PlantInput element defines the inputs to a mechanical system or plant. For this
model, only one input is defined in the Plant Input Simulink solver array. This is set to the ID
of the solver variable that holds the control force from Simulink.
The Control_PlantOutput element defines the outputs from a mechanical system or plant. For
this model, four outputs are defined in the Plant Output Simulink solver array. These are the
pendulum rotation angle, the pendulum angular velocity, slider displacement and slider
velocity.
The inputs specified using the Control_PlantInput and Control_PlantOutput elements can be
accessed using the PINVAL() and POUVAL() functions, respectively. Since the Control_PlantInput
and Control_PlantOutput list the ids of solver variables, these inputs and output variables may
also be accessed using the VARVAL() function. For more details, please refer to the MotionSolve
Users Guide on-line help.
Plant Input: A single control force that will be applied to the cart.
Plant Output: The pendulums angular displacement and angular velocity; the carts translational
displacement and velocity.
Windows Linux
LD_LIBRARY_PATH - <altair>\hwsolvers\motionsolve\bin\linux64:
<altair>\hwsolvers\common\bin
\linux64:$LD_LIBRARY_PATH
where <altair> is the full path to the HyperWorks installation on Machine A i.e. on the machine
where Simulink in installed. For example, on Windows, this would typically be C:\Program Files\Altair
\14.0.
Note that other optional environment variables may be set for your model. See MotionSolve
Environment Variables for more information on these environment variables.
mscosim for Shared Memory (SMP) communication. Please see the tutorial MV-7002 for details
on how to use SMP communication for co-simulation.
mscosimipc for Inter Process Communication (IPC) using TCP/IP sockets for communication.
Changing the name of this library in the S-Function block in Simulink changes the communication
behavior of the co-simulation.
The location of these files needs to be added to the search path of MATLAB for the S-Function to use
mscosimipc.
a. From the Matlab menu, select File > Set Path This is shown in Figure 7 below.
b. From the dialog box, add the directory where the mscosimipc libraries reside.
c. Select Save and Close. This procedure permanently adds this directory to the MATLAB/
Simulink search path.
to add the directory where mscosimipc library resides into the MATLAB search path. It remains
valid until you exit MATLAB. You can also create a .m script to make this process more easily
repeatable.
For example, you can set the MATLAB Path and the necessary environment variables using
MATLAB commands in a MATLAB (.m) script:
addpath('<altair>\hwsolvers\motionsolve\bin\win64')
setenv('NUSOL_DLL_DIR','<altair>\hwsolvers\motionsolve\bin\win64')
setenv('RADFLEX_PATH',['<altair>\hwsolvers\common\bin\win64')
setenv(MS_SERVER_IP_ADDRRESS,192.168.1.123)
3. Click Open.
You will see the control system that will be used in the co-simulation.
4. The model contains an S-function block. Double click on the S-Function named mscosim. In the
dialog box that is displayed, change the name of the S-function to mscosimipc.
The S-function (system-function) is one of the blocks provided by Simulink and represents the
MotionSolve model. It can be found in the Simulink User-Defined Functions block library. An S-
Function allows you to model any general system of equations with inputs, outputs, states, and
so on, and is somewhat analogous to a Control_StateEqn in MotionSolve. See the MATLAB/
Simulink documentation for more details.
5. Double-click the S-function with name mscosimipc. In the dialog box that is displayed, under
the S Function Parameters, enter the following using single quotes:
3. MotionSolve user DLL name (optional); enter empty single quotes ('') if not used.
Note The first argument i.e. the MotionSolve XML model name must be exactly the same as
the XML file that will be run on Machine B during the co-simulation.
On Machine A, click Simulation > Start to start the co-simulation. Simulink uses ODE45 to
solve the Simulink model. From this, the co-simulation should begin and Simulink will wait to
connect to the MotionSolve model.
After starting the simulation in Simulink, MotionSolve will connect with the Simulink model and the
subsequent co-simulation will result in an output .mrf file for post-processing. Set the Scopes in
the Simulink model to display the results. Also, check the .log file to make sure no errors or
warnings were issued by MotionSolve.
5. Select Marker Displacement for Y-Type, then REQ/70000004 Output slider displacement
(on Slider cart) for Y Request, and DX for Y Component to plot the carts translational
displacement:
7. Select Marker Force for Y-Type, then REQ/70000002 Output control force- (on Slider cart)
for Y Request, and FX for Y Component to plot the X component of the control force:
8. Click the file browser icon, , and load the InvertedPendulum_Cosimulation.mrf file. This
was the co-simulation results run with Simulink.
Select Marker Force for Y-Type, then REQ/70000002 Output control force- (on Slider cart)
for Y Request, and FX for Y Component to overlay the plot in the right window.
You will notice that both the signals match as shown below.
Figure 13: C omparison of the cart displacement and cart control force between the two models
The blue curves represent results from the MotionSolve-only model and the red curves represent
results from the co-simulation.
Theory
This chapter deals with modal analysis of Multi-Body Dynamic (MBD) systems. This kind of analysis
gives insight about system stability. Vehicle dynamics engineers often use the planar half-car model to
analyze the ride quality of vehicles. You will use the ADAMS/Linear simulation to do a modal analysis of
this type of model.
Process
Using the MotionView interface, you can obtain modal results in two ways: using MotionSolve and
ADAMS/Linear. These two ways are illustrated in the flowcharts below:
3. From the Open Model dialog, locate and select the halfcar_lin.mdl file located in
mbd_modeling\externalcodes folder.
6. Click the Forms icon, , on the Model-General toolbar and select the Solution Options form.
This ensures the ADAMS solver will first do a static analysis and then a linear modal analysis on
your model.
Complete the following steps only if you have connected the ADAMS solver
! to the Run button in the MotionView interface through the preferences file.
If ADAMS solver is not linked to MotionView, for the purpose of this tutorial,
go to Step 2: Viewing ADAMS/Linear Modal Results.
9. From the Script combo box, change the script to Altair Executable.
5. Click the Load model file browser and select the file halfcar_lin_adams.gra, located in
<Working directory>.
7. Click Apply.
8. From the Results Browser, click on the arrow next to Time History Animation and use the
Change load case drop-down menu to set the load case to Mode Animation @ Time =
0.000000.
9. The modes will automatically load and be displayed in the Simulation drop-down menu (located
directly under the Change load case drop-down menu).
While an ADAMS Linear analysis may be performed multiple times through a transient simulation, in
this example, the linear analysis was performed only at time step = 0.0.
13. Click the Start/Pause Animation icon again, , to stop transient animation.
Note To visualize a single mode while using the ADAMS/Solver, the Modal icon is used, .
15. Click the Page Layout icon on the Page Controls toolbar and select a four-window layout
Note that the current window becomes one of the four windows.
18. Repeat steps 16 and 17 for the remaining windows (Note - the Edit menu can also be used to
copy and paste windows into the four-window layout), and then load Simulation Modes 4, 5,
and 6.
Notice that the animations signify the pitch and bounce modes of car
! vibrations. The "wheel hop" resonance can also be seen in this example.
Analyzing the above occurrences can help isolate vibrations by
appropriately designing car suspensions.
In this exercise, you will use this file to plot the model eigenvalues in the complex plane.
Submit a model built in ADAMS directly to MotionSolve and post process the results in
MotionView.
Build a model in MotionView, submit it to ADAMS solver and post process the results using
MotionView.
Exercise
2. Start a new MotionView session by selecting New > Session from the File menu.
OR
Note If the Import Solver Deck button is not visible, click on the Import drop-down menu
(the down arrow next to the icon) and select the Import Solver Deck option.
5. From the Import Solver Deck dialog, use the Select file browser to locate and select the .adm
file.
6. Click Import.
The MotionView message log generates warning messages for all unsupported ADAMS statements
in your model. Unsupported ADAMS statements are stored in the Unsupported Statements
template. This template and its contents can be viewed from the Templates panel on the
MotionView toolbar.
Note adm is an input file for the solver. Due to this the model comes out flat and there is no
hierarchy. In addition, you would see many markers involved.
Now the model is in the MotionView domain. You can modify the model the way you want and
then run MotionSolve from the MotionView interface.
Copy the ADAMS input files quick_return.adm and quick_return.acf, located in the
externalcodes folder, to your current <working directory>.
1. Invoke MotionSolve.
3. Click on Run.
This would start a MotionSolve run in a command prompt. MotionSolve would run in a batch
mode. MotionSolve would read the information from the ADAMS command file (*.acf) and ADAMS
model data file (*.adm) , generate the solver input file (*.xml) then run it.
Note MotionSolve generates *.log file which holds information for the solver run. It is always a
good idea to go through the log file for detailed information.
1. Copy the file V_Engine.mdl, located in the externalcodes folder, to your current <working
directory>.
2. Invoke MotionView.
7. Right-click on ADAMS Model in the Project Browser and select Model > Add General MDL
Entity > Template, or click on Templates icon on the Model-General toolbar, to add a
template.
Note This is a very important feature when it comes to solver neutral modeling. The
statements written in this section are directly written to the solver input deck. You can
pass modeling entities to these templates. Please refer to the template "Solution Option-
ACF file" to understand how values from datasets are passed to an acf file.
8. Add the following statement in the template: !The idstring for center of mass maker for
body 0 is {Model.b_0.cm.idstring}.
Note This is a comment and will not change the model. One needs to be familiar with solver
input file formats to use this feature.
9. From the File menu, select Export > Solver Deck. This saves the ADAMS input files (*.adm/
*.acf). You can then run the ADAMS solver using these files.
10. If the ADAMS solver is hooked to MotionView, click on the Run icon .
MotionSolve
ADAMS
ABAQUS
MDL models can be exported to any of these solvers for analysis:
User can change the solver mode and then export the model to the particular solver.
User can register a script to run a solver from within MotionView. Refer to the Tip and Trick,
"Start an ADAMS run from within MotionView" available on Altairs website.
If the user needs to add any statement specific to the solver, Templex template can be used
in the model. Refer to tutorial MV-4010 for some more details about the Templex template.
The results from these solvers can be post processed in MotionView.
Copy the folder named solver_neutral, located in the mbd_modeling\externalcodes folder, to
your <working directory>.
Exercise
6. From the Main tab, specify your output filename as <working directory>\ms.xml.
10. From the Project Browser, under the Data Sets folder select Solution Options.
12. You can enter the simulation parameters for the ADAMS solver into this table.
Do not complete the following steps without connecting the ADAMS solver to
the RUN button.
! For this tutorial, you can assume the ADAMS run is complete and go to
Step 2: Comparing Solver Animations.
15. From the Script combo box, select the script ADAMS Executable.
1. Click the Add Page icon, , on the Page Controls toolbar to add a new page to your session.
3. Click the Page Layout, , icon on the toolbar and select the three horizontal windows
layout, .
Window 1 Window 2
5. Click the Start/Pause Animation icon, , on the Animation toolbar to animate the model.
Notice that if the same solver parameters are chosen, the results from different solvers are in-
sync.
Export Abaqus solver input deck (*.inp) for the rigid body model
Replace a rigid body in the model with a ABAQUS substructure (flexible body) and export
ABAQUS solver input deck (*.inp)
Replace a rigid body with ABAQUS inp (nodal FE component) file and export ABAQUS solver
input deck (*.inp)
Exercise
In the first step of the exercise, you will be creating an Abaqus substructure. The second step
involves the replacement of the rigid lower control arm with the Abaqus substructure. In the third step
you will run the solver, and in last step you will post process the results.
Copy the folder abaqus, located in the mbd_modeling\externalcodes folder, to your <working
directory>.
It is assumed that you are familiar with flexible multi-body dynamics in Abaqus. Here is a brief
overview of the steps you would need to do in Abaqus to generate a substructure:
The Abaqus *.inp deck of a substructure generation analysis should look something like this:
*NODE...
*ELEMENT...
*MATERIAL...
*STEP
*FREQUENCY, EIGENSOL=LANCZOS
20
*BOUNDARY
RETAINED_NODES, 1, 6
*END STEP
*STEP
*SUBSTRUCTURE GENERATE
RETAINED_NODESET,1,6
1,20,1
*END STEP
This is just a sample deck. For detailed syntax you may have to look up Abaqus documentation.
The intermediate files (*.stt, *.mdl, *.prt) created by Abaqus during the substructure
generation analysis are required for reference during the MBD system analysis. You will need to
generate these files in Abaqus. The result files (*.mrf, *.odb) which are needed for the post-
processing step of this tutorial are provided.
Once the substructure is generated you should be ready to integrate it in your MBD model.
1. Start a new MotionView session and load the file sla_abaqus.mdl, located in <working
directory>.
3. From the Project Browser, under the Bodies folder select the Lwr control arm.
4. On the Properties tab for the LCA-Left, activate the Deformable check-box.
Notice that the graphics of the rigid body lower control arm vanishes.
Now you would need to specify a particular INP file that was used to create the flexible body.
6. For Functional source, select the Use nodal FEA body option from the drop-down menu.
Properties tab
Note The file carm_left.h3d is the graphic file for the lower control arm-left body. This
file is for display and assists in allowing faster pre-processing. The flexbody (or the INP
file in this case) is used to provide data to the solver. The graphic H3D file can be
generate from the input (INP) file (or CAD file) using the Import CAD or FE option
located in the Tools menu in MotionView. In this exercise the graphic H3D files are
provided.
If the INP file is located in the same directory as the H3D graphic file, the Inp file field
would be populated automatically. Otherwise, one also has the option of selecting the
INP file from its respective location.
8. Click Nodes .
9. Click the Find ALL button on the Nodes dialog to find nodes on the flexible body that are located
closest to the interface points on the vehicle model. The vehicle model is attached to the flexible
body at these interface nodes.
Nodes dialog
You can attach joints to the flexible body only at the interface nodes. These
attachment nodes are created during your substructure generation analysis in Abaqus.
Creating more attachment points increases the actual number of modes calculated, and
may increase the CPU time.
11. Repeat steps 6 through 9 to integrate the right side flexible body carm_right.inp in your model.
13. From the Tools menu, select Check Model to check your complete MBD model for errors.
MotionView writes out the INP file for the whole MBD system. It is important that this INP deck should
contain the substructure path references for the model to run successfully in Abaqus. The way to
include these is via Templates in MotionView. Templex templates can be used to export syntax
directly to the solver input deck, including parametric substitution if required.
1. From the Project Browser, under the Templates folder select the Abaqus output template.
2. Click the expansion button, , on the panel and read through the template.
The remaining text of the template is written according to the position specified. In this
case there are two substructure paths included for the two flexible bodies. You will need
to add or delete such paths depending on the number of flexible bodies integrated in your
model.
4. From the Project Browser, under the Data Sets folder select ABAQUS Solution Options.
6. Save your model as an MDL file named sla_flex.mdl in the working directory.
Note You can run your model in ABAQUS at this stage. Select ABAQUS from the SolverMode
menu and click on the Run icon on the toolbar to display the Run panel. Specify a file
name for the inp file using the Save and run current model option and check the
Export MDL animation file check box. Click on the Run button. MotionView will write
the inp file and the maf file (which will be used for animation). If the ABAQUS solver
script is linked to MotionView, the job will be submitted to ABAQUS.
Note MotionView has FIL2MRF translator residing in Tool..Custom wizards. Using this will allow you
to translate an Abaqus fil file to an mrf file. In this exercise the mrf file is provided to you.
The carm_left.odb and carm_right.odb files needed in this step will be generated once the
model successfully runs in Abaqus.
1. Click the Add Page icon, , on the toolbar to add a new page to your session.
3. Load the sla_flex.maf and sla_flex.mrf as model and results files, respectively.
4. In the same window, again click the Load model file browser and select the carm_left.odb file
from your working directory.
6. Repeat the steps 4 and 5 to also overlay carm_right.odb file on the same model.
8. Click the Start/Pause Animation icon, , on the Animation toolbar to animate the model.
Assemble the vehicle for full vehicle simulations using Assembly Wizard
Attach the driver using Task Wizard
What is Altair Advanced Driver?
The Altair Driver is a set of MotionView models and libraries that allows MotionView users to control
and script vehicle events. Example events include:
Steering
Throttle
Gear
Brake
Clutch
Using Altair Driver you can simulate any number of full vehicle events using these features:
Scripting break up the simulation into different maneuvers; select the controllers for vehicle
inputs and define conditions that end each maneuver.
Open-loop, closed-loop, and user-defined controllers to control.
Longitudinal speed or acceleration.
Exercise
4. Choose Full vehicle with advanced driver option. This takes care of all the dependencies of the
advanced driver. Click Next.
8 Next No
9 Finish No
2. Select Altair Advanced Driver Analysis from the Full vehicle Driver task drop-down menu.
The Altair Advanced Driver with icon is added to the browser tree. Selecting the driver icon
will open up the Altair Driver panel. This automatically resolves all of the vehicle attachments for
the Advanced Driver.
The objective of the example is to script an event with 50% throttle, 0% brake and 0 steering angle.
An event can be broken down into smaller sub-events or maneuvers. For the sake of simplicity we will
model this as a single maneuver event.
1. Open any text editor and copy and paste the following text into it. Be sure to read through the
comments for a better understanding on what is written in the ADF.
$-----------------------------------------------------------------ALTAIR_HEADER
FILE_TYPE = 'ADF'
FILE_VERSION = 1.0
FILE_FORMAT = 'ASCII'
$--------------------------------------------------------------------------UNITS
$In this block we specify the units in which this file should be read
[UNITS]
(BASE)
$--------------------------------------------------------------------VEHICLE_IC
$In this block we specify the initial conditions specifically initial speed of the
[VEHICLE_INITIAL_CONDITIONS]
VX0 = -20.0
VY0 = 0.0
VZ0 = 0.0
$--------------------------------------------------------------STEERING_STANDARD
$This block specifies the saturation and cutoff frequency for the low pass filter for
$steering output signal. These signals are global and are active for the entire event
[STEER_STANDARD]
MAX_VALUE = 3.141593
MIN_VALUE = -3.141593
SMOOTHING_FREQUENCY = 10.0
INITIAL_VALUE = 0.0
$--------------------------------------------------------------THROTTLE_STANDARD
$This block specifies the saturation and cutoff frequency for the low pass filter for
MAX_VALUE = 1.0
MIN_VALUE = 0.00
SMOOTHING_FREQUENCY = 10.0
INITIAL_VALUE = 0.5
$---------------------------------------------------------------BRAKING_STANDARD
$This block specifies the saturation and cutoff frequency for the low pass filter for
[BRAKE_STANDARD]
MAX_VALUE = 1.0
MIN_VALUE = 0.0
SMOOTHING_FREQUENCY = 10.0
INITIAL_VALUE = 0.0
$-----------------------------------------------------------------MANEUVERS_LIST
$This block provides the list of all the maneuvers, simulation time for each maneuver
[MANEUVERS_LIST]
$---------------------------------------------------------------------MANEUVER_1
[MANEUVER_1]
TASK = 'STANDARD'
(CONTROLLERS)
$of controller.
[OL_STEER_0]
TAG = 'OPENLOOP'
TYPE = 'CONSTANT'
VALUE = 0.0
$---------------------------------------------------------OL_BRAKE
[OL_0]
TAG = 'OPENLOOP'
TYPE = 'CONSTANT'
VALUE = 0.0
$---------------------------------------------------------OL_THROTTLE
[OL_0.5]
TAG = 'OPENLOOP'
TYPE = 'CONSTANT'
VALUE = 0.5
4. The Edit driver file button can be used for editing the file.
7. Select the recent run in the View Reports dialog and click OK.
9. Next let's try slightly different initial conditions. We will start the throttle at 0 and brake at 100%
. Click the Edit Driver File button to open up the file editor.
10. Change the INITIAL_VALUE attribute in the THROTTLE_STANDARD block in the ADF, from 0.5 to
0.
[THROTTLE_STANDARD]
MAX_VALUE = 1.0
MIN_VALUE = 0.00
SMOOTHING_FREQUENCY = 10.0
INITIAL_VALUE = 0.5 0
11. Similarly, change the INITIAL_VALUE attribute in the BRAKE_STANDARD block in the ADF, from
0.0 to 1.0.
[BRAKE_STANDARD]
MAX_VALUE = 1.0
MIN_VALUE = 0.0
SMOOTHING_FREQUENCY = 10.0
In this example we will model a simple event with constant 20% throttle, constant 0% throttle and
1. Open any text editor and copy/paste the following text into it.
$-----------------------------------------------------------------ALTAIR_HEADER
[ALTAIR_HEADER]
FILE_TYPE = 'ADF'
FILE_VERSION = 1.0
FILE_FORMAT = 'ASCII'
$--------------------------------------------------------------------------UNITS
[UNITS]
(BASE)
$--------------------------------------------------------------------VEHICLE_IC
[VEHICLE_INITIAL_CONDITIONS]
VY0 = 0.0
VZ0 = 0.0
$--------------------------------------------------------------STEERING_STANDARD
[STEER_STANDARD]
MAX_VALUE = 3.141593
MIN_VALUE = -3.141593
SMOOTHING_FREQUENCY = 10.0
INITIAL_VALUE = 0.0
$--------------------------------------------------------------THROTTLE_STANDARD
[THROTTLE_STANDARD]
MAX_VALUE = 1.0
MIN_VALUE = 0.00
SMOOTHING_FREQUENCY = 10.0
INITIAL_VALUE = 0.2
$---------------------------------------------------------------BRAKING_STANDARD
[BRAKE_STANDARD]
MAX_VALUE = 1.0
MIN_VALUE = 0.0
SMOOTHING_FREQUENCY = 10.0
INITIAL_VALUE = 0.0
$-----------------------------------------------------------------MANEUVERS_LIST
[MANEUVERS_LIST]
$---------------------------------------------------------------------MANEUVER_1
[MANEUVER_1]
(CONTROLLERS)
$---------------------------------------------------------OL_STEER.
$SIGNAL_CHANNEL tells the driver which solver variable in Signal Generator to over-ride
$with the EXPRESSION value. The EXPRESSION should be consistent with MOTIONSOLVE.
[OL_STEER]
TAG = 'OPENLOOP'
TYPE = 'EXPRESSION'
SIGNAL_CHANNEL =0
EXPRESSION = 'DTOR(60)*SIN(2*PI*0.5*TIME)'
$---------------------------------------------------------OL_THROTTLE
[OL_THROTTLE]
TAG = 'OPENLOOP'
TYPE = 'CONSTANT'
VALUE = 0.2
$---------------------------------------------------------OL_BRAKE
[OL_BRAKE]
TAG = 'OPENLOOP'
TYPE = 'CONSTANT'
VALUE = 0.0
In this example we will model a simple event with braking signal as a curve.
1. Open text editor and copy/paste the following text into it.
$-----------------------------------------------------------------ALTAIR_HEADER
[ALTAIR_HEADER]
FILE_TYPE = 'ADF'
FILE_VERSION = 1.0
FILE_FORMAT = 'ASCII'
$--------------------------------------------------------------------------UNITS
(BASE)
$--------------------------------------------------------------------VEHICLE_IC
[VEHICLE_INITIAL_CONDITIONS]
VX0 = -20.0
VY0 = 0.0
VZ0 = 0.0
$--------------------------------------------------------------STEERING_STANDARD
[STEER_STANDARD]
MAX_VALUE = 3.141593
MIN_VALUE = -3.141593
SMOOTHING_FREQUENCY = 10.0
INITIAL_VALUE = 0.0
$--------------------------------------------------------------THROTTLE_STANDARD
[THROTTLE_STANDARD]
MAX_VALUE = 1.0
MIN_VALUE = 0.00
SMOOTHING_FREQUENCY = 10.0
INITIAL_VALUE = 0.0
$---------------------------------------------------------------BRAKING_STANDARD
[BRAKE_STANDARD]
MAX_VALUE = 1.0
MIN_VALUE = 0.0
SMOOTHING_FREQUENCY = 10.0
INITIAL_VALUE = 0.0
$-----------------------------------------------------------------MANEUVERS_LIST
$---------------------------------------------------------------------MANEUVER_1
[MANEUVER_1]
TASK = 'STANDARD'
(CONTROLLERS)
$---------------------------------------------------------OL_STEER.
$SIGNAL_CHANNEL tells the driver which solver variable in Signal Generator to over-ride
$with the EXPRESSION value. The EXPRESSION should be consistent with MOTIONSOLVE.
[OL_STEER]
TAG = 'OPENLOOP'
TYPE = 'CONSTANT'
VALUE = 0.0
$---------------------------------------------------------OL_THROTTLE
[OL_THROTTLE]
TAG = 'OPENLOOP'
TYPE = 'CONSTANT'
VALUE = 0.0
$---------------------------------------------------------OL_BRAKE
[OL_BRAKE]
TAG = 'OPENLOOP'
BLOCK = 'BRAKE_CRV'
$---------------------------------------------------------CURVE_DATA
[BRAKE_CRV]
INDEPENDENT_VARIABLE = 'TIME'
DEPENDENT_VARIABLE = 'BRAKE_SIGNAL'
INTERPOLATION = 'LINEAR'
{TIME BRAKE_SIGNAL}
0 0
1 0
2 0.2
3 0.5
4 0.8
5 1.0
6 1.0
7 0
10 0
$Example DDF
[ALTAIR_HEADER]
FILE_TYPE = 'DDF'
FILE_VERSION = 1.0
FILE_FORMAT = 'ASCII'
$---------------------------------------------------UNITS
[UNITS]
(BASE)
[DEMAND_VECTORS]
{X Y Z}
0 0 0
-4 0 0
-1 0 0
-2 0 0
-5 0 0
-3 0 0
Sequence of straights and arcs: Path is provided as a table of straights and circular section.
[PATH]
'ST' 100.0 0
'ST' 100.0 0
'ST' 200.0 0
Predefined path: Path is one of the predefined paths visualization (Constant Radius, Single
lane change, Double lane change, and Slalom).
TYPE = 'CONSTANT_RADIUS'
RADIUS = 30
INITIAL_STRAIGHT = 45
TURN = 'LEFT
Demand velocity or acceleration profile is similar to open loop signal explained in tutorial 1. All
methods constant, expression and curve are valid for demand signal definition as well.
Exercise
8 Next No
9 Finish No
1. Open any text editor and copy and paste the following text into it. Be sure to read through the
comments for a better understanding on what is written in the ADF.
$-----------------------------------------------------------------ALTAIR_HEADER
[ALTAIR_HEADER]
FILE_TYPE = 'ADF'
FILE_VERSION = 1.0
FILE_FORMAT = 'ASCII'
$--------------------------------------------------------------------------UNITS
$In this block we specify the units in which this file should be read
[UNITS]
(BASE)
$--------------------------------------------------------------------VEHICLE_IC
$In this block we specify the initial conditions specifically initial speed of the
[VEHICLE_INITIAL_CONDITIONS]
VX0 = -15.0
VY0 = 0.0
VZ0 = 0.0
$--------------------------------------------------------------STEERING_STANDARD
$This block specifies the saturation and cutoff frequency for the low pass filter for
$steering output signal. These signals are global and are active for the entire event
[STEER_STANDARD]
MAX_VALUE = 3.141593
MIN_VALUE = -3.141593
SMOOTHING_FREQUENCY = 10.0
INITIAL_VALUE = 0.0
$--------------------------------------------------------------THROTTLE_STANDARD
$This block specifies the saturation and cutoff frequency for the low pass filter for
[THROTTLE_STANDARD]
MAX_VALUE = 1.0
MIN_VALUE = 0.00
SMOOTHING_FREQUENCY = 10.0
INITIAL_VALUE = 0.5
$---------------------------------------------------------------BRAKING_STANDARD
$This block specifies the saturation and cutoff frequency for the low pass filter for
[BRAKE_STANDARD]
MAX_VALUE = 1.0
MIN_VALUE = 0.0
SMOOTHING_FREQUENCY = 10.0
$-----------------------------------------------------------------MANEUVERS_LIST
$This block provides the list of all the maneuvers, simulation time for each maneuver
[MANEUVERS_LIST]
$---------------------------------------------------------------------MANEUVER_1
[MANEUVER_1]
TASK = 'STANDARD'
(CONTROLLERS)
$---------------------------------------------------------STEER
$controller.
[FEEDFORWARD_STEER]
TAG = 'FEEDFORWARD'
LOOK_AHEAD_TIME = 0.5
PATH = 'PREDEFINED'
BLOCK = 'PATH'
$---------------------------------------------------------PATH
TYPE = 'CONSTANT_RADIUS'
RADIUS = 40
INITIAL_STRAIGHT = 20
TURN = 'LEFT'
[FEEDFORWARD_TRACTION]
TAG = 'FEEDFORWARD'
TYPE = 'FOLLOW_VELOCITY'
LOOK_AHEAD_TIME = 0.5
DEMAND_SIGNAL = 'DEMAND_SPEED'
$---------------------------------------------------------DEMAND_SPEED
$Block containing all the information about the velocity profile to be followed
[DEMAND_SPEED]
TYPE = 'CONSTANT'
VALUE = 15.0
2. Save the ADF.
5. Next let's try the same path using another method - Sequence of straight and arcs.
[FEEDFORWARD_STEER]
TAG = 'FEEDFORWARD'
LOOK_AHEAD_TIME = 0.5
BLOCK = 'PATH'
7. Replace the path block in the ADF with the following text.
[PATH]
{KEY PAR0 PAR1}
'ST' 20 0
'ARC' 40 6.28318
In this example we will create an event to follow a straight line while accelerating the vehicle
constantly with 2 m/s2.
1. Open any text editor and copy/paste the following text into it.
$-----------------------------------------------------------------ALTAIR_HEADER
[ALTAIR_HEADER]
FILE_TYPE = 'ADF'
FILE_VERSION = 1.0
FILE_FORMAT = 'ASCII'
$--------------------------------------------------------------------------UNITS
[UNITS]
(BASE)
$--------------------------------------------------------------------VEHICLE_IC
[VEHICLE_INITIAL_CONDITIONS]
VX0 = -20.0
VY0 = 0.0
VZ0 = 0.0
$--------------------------------------------------------------STEERING_STANDARD
[STEER_STANDARD]
MAX_VALUE = 3.141593
MIN_VALUE = -3.141593
SMOOTHING_FREQUENCY = 10.0
INITIAL_VALUE = 0.0
$--------------------------------------------------------------THROTTLE_STANDARD
[THROTTLE_STANDARD]
MAX_VALUE = 1.0
SMOOTHING_FREQUENCY = 10.0
INITIAL_VALUE = 0.2
$---------------------------------------------------------------BRAKING_STANDARD
[BRAKE_STANDARD]
MAX_VALUE = 1.0
MIN_VALUE = 0.0
SMOOTHING_FREQUENCY = 10.0
INITIAL_VALUE = 0.0
$-----------------------------------------------------------------MANEUVERS_LIST
[MANEUVERS_LIST]
$---------------------------------------------------------------------MANEUVER_1
[MANEUVER_1]
TASK = 'STANDARD'
(CONTROLLERS)
$---------------------------------------------------------STEER
$controller.
[FEEDFORWARD_STEER]
LOOK_AHEAD_TIME = 0.5
PATH = 'PREDEFINED'
BLOCK = 'PATH'
$---------------------------------------------------------PATH
[PATH]
TYPE = 'CONSTANT_RADIUS'
RADIUS = 40
INITIAL_STRAIGHT = 20
TURN = 'LEFT'
[FEEDFORWARD_TRACTION]
TAG = 'FEEDFORWARD'
TYPE = 'FOLLOW_VELOCITY FOLLOW_ACCELERATION'
LOOK_AHEAD_TIME = 0.5
DEMAND_SIGNAL = 'DEMAND_SPEEDDEMAND_ACC'
$---------------------------------------------------------DEMAND_ACC
$Block containing all the information about the acceleration profile to be followed
[DEMAND_SPEED]
TYPE = 'CONSTANT'
VALUE = 2.0
2. Run the simulation and study the results.
In this example well give path as a table of Cartesian coordinated of centerline points. Well define the
velocity profile as well along the path.
1. Open text editor and copy/paste the following text into it.
$-----------------------------------------------------------------ALTAIR_HEADER
[ALTAIR_HEADER]
FILE_TYPE = 'ADF'
FILE_VERSION = 1.0
FILE_FORMAT = 'ASCII'
$--------------------------------------------------------------------------UNITS
[UNITS]
(BASE)
[DEMAND_SPEED]
TYPE = 'CURVE'
BLOCK = 'DEMAND_CURVE'
$-------------------------DEMAND_CURVE
[DEMAND_CURVE]
INDEPENDENT_VARIABLE = 'PATH_S'
DEPENDENT_VARIABLE = SIGNAL
INTERPOLATION = 'LINEAR'
{PATH_S SIGNAL}
0 30
250 35
400 10
584 10
680 25
780 10
942 10
1300 40
1695 10
1868 10
1958 10
2040 15
2109 15
2173 15
2300 20
2409 15
2524 15
2647 10
2811 10
3500 50
Examples of the end conditions can be End maneuver when longitudinal velocity is greater
than 10 m/s or when roll angle reaches steady state
End conditions can be logically coupled (OR-ed or AND-ed) by splitting them into groups
Multi-maneuver events
Events consisting for more than one maneuver these maneuvers are executed sequentially
Controllers can only be changed while switching the maneuvers
Hence, rule of thumb whenever need to change the controller, change the maneuver
Driver does following while switching the maneuvers
o Halts previous maneuver
o Saves the signals value that acts as initial value for next maneuver in case of parametric
expressions , there is a list of signals that driver monitors. Please refer to the
documentation for more details.
o Executes the change of/in controller
When in a multi-maneuver event, expressions need to be re-evaluated before the start of the
maneuver in order to maintain the continuity of the signals.
{ Expression in Curly Braces } - Instruction to driver to evaluate the expression before
giving it to MotionSolve
{SIGNAL} is evaluated as VARVAL(signal solver variable id)
{SIGNAL_0} is evaluated as Signal Value at the end of last maneuver
{%SIGNAL} is evaluated as {SIGNAL} {SIGNAL_0}
Driver evaluates the expressions for the maneuver before the start of the maneuver
Example:
Exercise
8 Next No
9 Finish No
1. Open any text editor and copy and paste the following text into it. Be sure to read through the
comments for a better understanding on what is written in the ADF.
$-----------------------------------------------------------------ALTAIR_HEADER
[ALTAIR_HEADER]
FILE_TYPE = 'ADF'
FILE_VERSION = 1.0
FILE_FORMAT = 'ASCII'
$--------------------------------------------------------------------------UNITS
[UNITS]
(BASE)
{length force angle mass time}
'meter' 'newton' 'radians' 'kg' 'sec'
$--------------------------------------------------------------VEHICLE_IC
[VEHICLE_INITIAL_CONDITIONS]
VX0 = -17.5
VY0 = 0.0
VZ0 = 0.0
$--------------------------------------------------------------STEERING_STANDARD
[STEER_STANDARD]
$Upper and lower bounds are kept to match the event requirement of saturating at
$270 deg and -540 deg respectively
MAX_VALUE = 4.712
MIN_VALUE = -9.425
SMOOTHING_FREQUENCY = 5
INITIAL_VALUE = 0.0
$--------------------------------------------------------------THROTTLE_STANDARD
[THROTTLE_STANDARD]
MAX_VALUE =1
MIN_VALUE =0
SMOOTHING_FREQUENCY = 5
INITIAL_VALUE = 0.0
$---------------------------------------------------------------BRAKING_STANDARD
[BRAKE_STANDARD]
MAX_VALUE =1
MIN_VALUE =0
SMOOTHING_FREQUENCY = 5
INITIAL_VALUE = 0.0
$-----------------------------------------------------------------MANEUVERS_LIST
[MANEUVERS_LIST]
{name simulation_time h_max print_interval}
'GO_STRAIGHT' 2.0 0.01 0.1
'LEFT_TURN' 12.0 0.001 0.1
'RIGHT_TURN' 10.0 0.001 0.1
Maneuver 2 stops when roll rate is consistently 0 (with mentioned tolerance) for 0.5 seconds.
The Engine speed based shift controller upshifts whenever engine speed goes above the upshift RPM,
and it downshifts when the engine speed goes below the downshift RPM. The Gear shift controller
also controls the throttle and clutch signal as shown in the figure below.
8 Next No
9 Finish No
We will modify the ADF which was written for MV-8001 (example 3) and incorporate a gear and clutch
controller.
1. Open any text editor and copy and paste the following text into it. Be sure to read through the
comments for a better understanding on what is written in the ADF.
$-----------------------------------------------------------------ALTAIR_HEADER
[ALTAIR_HEADER]
FILE_TYPE = 'ADF'
FILE_VERSION = 1.0
FILE_FORMAT = 'ASCII'
$--------------------------------------------------------------------------UNITS
[UNITS]
(BASE)
{length force angle mass time}