altair motionview 11.0 tutorials

493
HyperWorks is a division of Altair altairhyperworks.com

Upload: doanhanh

Post on 11-Feb-2017

547 views

Category:

Documents


48 download

TRANSCRIPT

Page 1: Altair MotionView 11.0 Tutorials

HyperWorks is a division of Altair altairhyperworks.com

Page 2: Altair MotionView 11.0 Tutorials

Altair Engineering Support Contact Information Web site www.altairhyperworks.com

Location Telephone e-mail

Australia 64.9.413.7981 [email protected]

Brazil 55.11.3884.0414 [email protected]

Canada 416.447.6463 [email protected]

China 86.400.619.6186 [email protected]

France 33.1.4133.0992 [email protected]

Germany 49.7031.6208.22 [email protected]

India 91.80. 6629.4500 1.800.425.0234 (toll free)

[email protected]

Italy 39.800.905.595 [email protected]

Japan 81.3.5396.2881 [email protected]

Korea 82.70.4050.9200 [email protected]

Mexico 55.56.58.68.08 [email protected]

New Zealand 64.9.413.7981 [email protected]

North America 248.614.2425 [email protected]

Scandinavia 46.46.460.2828 [email protected]

United Kingdom 01926.468.600 [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

Copyright© Altair Engineering Inc. All Rights Reserved for: HyperMesh® 1990-2014; HyperCrash® 2001-2014; OptiStruct® 1996-2014; RADIOSS®1986-2014; HyperView®1999-2014; HyperView Player® 2001-2014; HyperStudy® 1999-2014; HyperGraph®1995-2014; MotionView® 1993-2014; MotionSolve® 2002-2014; HyperForm® 1998-2014; HyperXtrude® 1999-2014; Process Manager™ 2003-2014; Templex™ 1990-2014; TextView™ 1996-2014; MediaView™ 1999-2014; TableView™ 2013-2014; BatchMesher™ 2003-2014; HyperMath® 2007-2014; Manufacturing Solutions™ 2005-2014; HyperWeld® 2009-2014; HyperMold® 2009-2014; solidThinking® 1993-2014; solidThinking Inspire® 2009-2014; solidThinking Evolve®™ 1993-2014; Durability Director™ 2009-2014; Suspension Director™ 2009-2014; AcuSolve® 1997-2014; AcuConsole® 2006-2014; SimLab®™2004-2014 and Virtual Wind Tunnel™ 2012-2014.

In addition to HyperWorks® trademarks noted above, Display Manager™, Simulation Manager™, Compute Manager™, PBS™, PBSWorks™, PBS GridWorks®, PBS Professional®, PBS Analytics™, PBS Desktop™, PBS Portal™, PBS Application Services™, e-BioChem™, e-Compute™ and e-Render™ are trademarks of ALTAIR ENGINEERING INC.

Altair trademarks are protected under U.S. and international laws and treaties. Copyright© 1994-2014. Additionally, Altair software is protected under patent #6,859,792 and other patents pending. All other marks are the property of their respective owners. ALTAIR ENGINEERING INC. Proprietary and Confidential. Contains Trade Secret Information. Not for use or disclosure outside of ALTAIR and its licensed clients. Information contained inHyperWorks® shall not be decompiled, disassembled, or “unlocked”, reverse translated, reverse engineered, or publicly displayed or publicly performed in any manner. Usage of the software is only as explicitly permitted in the end user software license agreement. Copyright notice does not imply publication

Page 3: Altair MotionView 11.0 Tutorials

i

Proprietary Information of Altair Engineering

MotionView 13.0 TutorialsAltair Engineering

MotionView Tutorials

..........................................................................................................................4Introduction

........................................................................................................................................................5MV-100: Introduction to the MotionView Environment

..........................................................................................................................35Interactive

........................................................................................................................................................36MV-1000: Interactive Model Building and Simulation

........................................................................................................................................................71MV-1035: Importing CAD or FE into MotionView

........................................................................................................................................................85MV-1011: Extension and Retraction Analysis of the Main Landing Gear of an Aircraft

..........................................................................................................................95Animation

........................................................................................................................................................96MV-5000: Rigid body Animation - Basic

........................................................................................................................................................102MV-5010: Rigid body Animation - Advanced

..........................................................................................................................107Plotting

........................................................................................................................................................108MV-6000: Plotting Basics

..........................................................................................................................113Model Definition Language

........................................................................................................................................................114MV-1060: Introduction to MDL

........................................................................................................................................................128MV-1070: Creating a Simple Pendulum System using MDL

........................................................................................................................................................145MV-1080: Creating an Analysis using MDL

........................................................................................................................................................151MV-1090: Creating a Dataset using MDL

........................................................................................................................................................155MV-1030: Creating a System Definition Using the MotionView GUI

..........................................................................................................................168Flexible Body Modeling and Simulation using MotionView andMotionSolve

........................................................................................................................................................169MV-2000: Introduction to Flexible Bodies

........................................................................................................................................................173MV-2010: Flexbody Generation using Flex Prep and Radioss

........................................................................................................................................................190MV-2020: Use of Flexbody in MBD Models

........................................................................................................................................................196MV-2021: Simulating an Automotive Door Closure Event

........................................................................................................................................................206MV-2035: Solving Flexbody ADM/ACF in MotionSolve

..........................................................................................................................211Automated

Page 4: Altair MotionView 11.0 Tutorials

ii

Proprietary Information of Altair Engineering

Altair EngineeringMotionView 13.0 Tutorials

........................................................................................................................................................212MV-1032: Model Building and Simulation using Wizards

........................................................................................................................................................221MV-1040: Model Building using Tcl

........................................................................................................................................................230MV-1050: Automation Using TCL

........................................................................................................................................................233MV-1051: Understanding Sequential Simulation

..........................................................................................................................241Optimization-DOE-Stochastics

........................................................................................................................................................242MV-3000: DOE using MotionView - HyperStudy

........................................................................................................................................................265MV-3010: Optimization using MotionView - HyperStudy

..........................................................................................................................271Durability - Fatigue

........................................................................................................................................................272MV-3030: Load Export

........................................................................................................................................................280MV-3040: Durability and Fatigue Tools

..........................................................................................................................288Advanced Simulation

........................................................................................................................................................289MV-1010: Contact Simulation using MotionSolve

........................................................................................................................................................294MV-1015: Using Spline3D to Model Combustion Forces in an Engine

........................................................................................................................................................311MV-1023: Using Python Subroutines in MotionView Model Building

........................................................................................................................................................328MV-1024: Using User Subroutines in MotionSolve Models

........................................................................................................................................................335MV-1025: Modeling Point-to-Curve (PTCV) Higher-Pair Constraint

........................................................................................................................................................351MV-1026: Modeling Curve-to-Curve (CVCV) Higher-Pair Constraint

........................................................................................................................................................370MV-1027: Modeling Point-to-Deformable-Curve (PTdCV) Higher-Pair Constraint

........................................................................................................................................................379MV-1028: Modeling Point-to-Deformable-Surface (PTdSF) Higher-Pair Constraint

........................................................................................................................................................387MV-1029: Modeling Point-to-Deformable-Surface Force (PTdSF) Higher-PairConstraint

........................................................................................................................................................395MV-7000: Modeling Differential Equations Using MotionView and MotionSolve

........................................................................................................................................................402MV-7001: Building User Subroutines in Altair MotionSolve

........................................................................................................................................................412MV-7002: Co-simulation with Simulink

........................................................................................................................................................422MV-7003: Simulating a Single Input Single Output (SISO) Control System UsingMotionView and MotionSolve

........................................................................................................................................................426MV-7004: Inverted Pendulum Control Using MotionSolve and MATLAB

........................................................................................................................................................433MV-7005: Linking Matlab/Simulink Generated Code (Simulink Coder) with MotionSolve

........................................................................................................................................................444MV-7006: Python UserSub for MotionSolve

........................................................................................................................................................449MV-7007: Adding Friction to Joints

Page 5: Altair MotionView 11.0 Tutorials

iii

Proprietary Information of Altair Engineering

MotionView 13.0 TutorialsAltair Engineering

..........................................................................................................................467Working with External Codes

........................................................................................................................................................468MV-4000: Eigen Analysis using ADAMS/Linear

........................................................................................................................................................473MV-4010: Working with ADAMS

........................................................................................................................................................477MV-4020: Solver Neutral Modeling

........................................................................................................................................................480MV-4030: Flexible Bodies for MotionView with Abaqus

Page 6: Altair MotionView 11.0 Tutorials

1 MotionView 13.0 Tutorials

Proprietary Information of Altair Engineering

Altair Engineering

MotionView Tutorials

File Location All files referenced in the MotionView tutorials are located in theHyperWorks installation directory under <installation_directory>/

tutorials/mv_hv_hg/.

If you need more help finding the installation directory, see Finding theInstallation Directory <installation_directory> or contact your

systems administrator.

Finding the Installation Directory <install_directory>

Most tutorials use files that are located in the tutorials/directory of the software installation. In

the tutorials, file paths are referenced as <installation_directory>/../. In order to locate the

files needed, you will need to determine the path of the installation directory <installation_directory>. This path is dependent on the installation that was performed at your

site.

To determine what this path is, follow these instructions:

1. Launch the application.

2. From the Help menu, select Updates.

The HyperWorks Update Information dialog opens. The installation directory path appearsafter Altair Home:.

The MotionView tutorial model files are located in <installation_directory>/tutorials/

mv_hv_hg.

Introduction

MV-100: Introduction to the MotionView Environment

Interactive

MV-1000: Interactive Model Building and Simulation

MV-1035: Importing CAD or FE into MotionView

MV-1011: Extension and Retraction Analysis of the Main Landing Gear of an Aircraft

Animation

MV-5000: Rigid body Animation - Basic

MV-5010: Rigid body Animation - Advanced

Plotting

MV-6000: Plotting Basics

Page 7: Altair MotionView 11.0 Tutorials

Altair Engineering 2

Proprietary Information of Altair Engineering

MotionView 13.0 Tutorials

Model Definition Language

MV-1060: Introduction to MDL

MV-1070: Creating a Simple Pendulum System using MDL

MV-1080: Creating an Analysis using MDL

MV-1090: Creating a Dataset using MDL

MV-1030: Creating a System Definition Using the MotionView GUI

Flexible Body Modeling and Simulation using MotionView and MotionSolve

MV-2000: Introduction to Flexible Bodies

MV-2010: Flexbody Generation using Flexprep and Optistruct

MV-2020: Use of Flexbody in MBD Models

MV-2021: Simulating an Automotive Door Closure Event

MV-2035: Solving Flexbody ADM/ACF in MotionSolve

Automated

MV-1032: Model Building and Simulation using Wizards

MV-1040: Model Building using TCL

MV-1050: Automation using TCL

MV-1051: Understanding Sequential Simulation

Optimization-DOE-Stochastics

MV-3000: DOE using MotionView - HyperStudy

MV-3010: Optimization using MotionView - HyperStudy

Durability – Fatigue

MV-3030: Load Export

MV-3040: Durability and Fatigue Tools

Advanced Simulation

MV-1010: Contact Simulation using MotionSolve

MV-1015: Using Spline3D to model the Combustion Forces in an Engine

MV-1023: Using Python Subroutines in MotionView Model Building

MV-1024: Using User Subroutines in MotionSolve Models

MV-1025: Modeling Point-to-Curve (PTCV) higher-pair constrain

MV-1026: Modeling Curve-to-Curve using Templates

Page 8: Altair MotionView 11.0 Tutorials

3 MotionView 13.0 Tutorials

Proprietary Information of Altair Engineering

Altair Engineering

MV-1027: Modeling Point-to-Deformable-Curve (PTDCV) Higher-Pair Constraint

MV-1028: Modeling Point-to-Deformable-Surface (PTdSV) Higher-Pair Constraint

MV-1029: Modeling Point-to-Deformable-Surface Force (PTdSFforce) Higher-Pair Constraint

MV-7000: Modeling Differential Equations Using MotionView and MotionSolve

MV-7001: Building User Subroutines in Altair MotionSolve

MV-7002: Co-simulation with Simulink

MV-7003: Simulating a Single Input Single Output (SISO) Control System Using MotionView andMotionSolve

MV-7004: Inverted Pendulum Control Using MotionSolve and MATLAB

MV-7005: Linking Matlab/Simulink Generated Code with MotionSolve

MV-7006: Python UserSub for MotionSolve

MV-7007: Adding Friction to Joints

Working with External Codes

MV-4000: Eigen Analysis using ADAMS/Linear

MV-4010: Working with ADAMS

MV-4020: Solver Neutral Modeling

MV-4030: Flexible Bodies for MotionView with Abaqus

Page 9: Altair MotionView 11.0 Tutorials

Altair Engineering 4

Proprietary Information of Altair Engineering

MotionView 13.0 Tutorials

Introduction

MotionView is one of the applications within HyperWorks Desktop. The following tutorials will introduceyou to model building for multi-body applications using MotionView.

It is recommended that you complete the HWD-0010: HyperWorks Desktop Environment tutorial (inorder to familiarize yourself with the HyperWorks Desktop graphical user interface) prior to goingthrough the exercises in these tutorials.

Page 10: Altair MotionView 11.0 Tutorials

5 MotionView 13.0 Tutorials

Proprietary Information of Altair Engineering

Altair Engineering

MV-100: Introduction to the MotionView Environment

This tutorial contains an introduction to the MotionView graphical user interface.

Invoking MotionView:

In Windows - go through the Start Menu (Start Menu > Programs > Altair HyperWorksinstallation > MotionView).

OR

In Linux - invoke ~hw_install/altair/scripts/mview in an "open terminal" (where

~hw_install is the location where HyperWorks is installed).

The MotionView interface:

MotionView is one of the clients that reside under the HyperWorks Desktop (HWD) framework. Theframework provides a common layout for all clients. Other clients that are available under thisframework are: Hypermesh, HyperView, HyperGraph 2D, HyperGraph 3D, MediaView, and TextView. The client is selected, or changed, using the Client selector drop-down menu:

Page 11: Altair MotionView 11.0 Tutorials

Altair Engineering 6

Proprietary Information of Altair Engineering

MotionView 13.0 Tutorials

The image below shows the HWD graphical user interface with MotionView activated as the client:

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:

Main Menu Item Functionality Alternatives

File Provides options to managefiles (Creating new models,Opening and Saving models/Sessions, Importing andExporting a Solver Deck,etc.).

The same options are available throughHWD Standard Toolbar also.

Page 12: Altair MotionView 11.0 Tutorials

7 MotionView 13.0 Tutorials

Proprietary Information of Altair Engineering

Altair Engineering

Main Menu Item Functionality Alternatives

Edit Provides options to managethe pages and windows of asession (Cut, Copy, Paste,and Overlay of the page andwindow).

Same options are available through Page Edit Toolbar also.

View Allows you to manage thedisplay of the graphical userinterface (the display ofBrowsers, Command Window,Panel Area, Tab Area,Toolbars, etc.).

Solver Mode Allows you to switchbetween solvers modes(MotionSolve, ADAMS, andABAQUS).

Model Allows you to access thefollowing:

Assembly Wizard

Attachment Wizard

Set Wizard Paths

Implicit Graphics

Data Summary

Topology Summary

Analysis Allows you to access thefollowing:

Task Wizard

View Reports

Tools Provides you with access tovarious tools and specialutilities:

Check Model

Freeze Output Ids

Import CAD or FE

Model Identification Tool

CG/Inertia Summary

Check Model – Available in Run panel.

Import CAD or Fem – Available in the Main menu (File > Import >Import Geometry) and also in the

HWD Standard Toolbar .

Page 13: Altair MotionView 11.0 Tutorials

Altair Engineering 8

Proprietary Information of Altair Engineering

MotionView 13.0 Tutorials

Main Menu Item Functionality Alternatives

Custom Wizards

Reports

MS UserSub Build Tool

Templex Functions

Options

FlexTools Provides you with access tovarious utilities:

Flex Prep – Used forgeneration and translationof flexbody files.

Flex File Gen - Generatesan animation file for ADAMSflexbody results.

Fatigue Prep – Helpful inthe translation of MBDresult files to other formatsuseful in fatigue analysis.

Load Export – Allows youto export loads from anMBD analysis.

Macros Provides you with access tomacros that are useful formodeling and modeldebugging.

Applications Allows you to invoke otherHyperWorks applications fromthe MotionView graphicaluser interface.

Help Provides you with access tothe online help.

Page 14: Altair MotionView 11.0 Tutorials

9 MotionView 13.0 Tutorials

Proprietary Information of Altair Engineering

Altair Engineering

HWD Standard Toolbars

Toolbars provide quick access to commonly used features. HyperWorks Desktop toolbars arestatic and will not change, regardless of which application is active. Some of the toolbarsbecome inactive when different clients are selected. In the table below, all of the HWD toolbarsare introduced. Please be sure to note the toolbars that are not applicable to the MotionViewclient.

Toolbar Purpose Image

Client Selector Selecting the HWD clientfrom the drop-down list.

Standard Options for file management(Creating, Editing, Saving,Importing, and Exporting offiles etc.).

Page Controls Options to:

Create and Delete pagesand windows.

Expand, Swap, andSynchronize selectedwindows.

Navigate throughdifferent pages of asession.

Page Edit Options to manage pagesand windows of a session(Cut, Copy, Paste, andOverlay of a page andwindow).

AnimationToolbar

Provides controls for theanimation of results.

Note - Available in HyperView and HyperGraph only.

StandardViews

Options to view model indifferent orthogonal views.

Page 15: Altair MotionView 11.0 Tutorials

Altair Engineering 10

Proprietary Information of Altair Engineering

MotionView 13.0 Tutorials

Toolbar Purpose Image

3D ViewControls

Options to control the 3Dview of the model (Rotate,Pan, Zoom, etc.).

2D ViewControls

Options to control the 2Dview of plots (Pan, Zoom,etc.).

Note - Available in HyperGraph only.

Reports Options to Create/Open/Define Report Templates.

Scripting Options to Create/Open/Debug/Run Tcl andHyperMath scripts.

Note - Not available in MotionView.

ImageCapture

Capture Image/Video of theactive page.

Note - Please refer to the Hyperworks Desktop User’s Guide > Graphical User Interface >Toolbars topic for a detailed explanation of each toolbar listed above.

Page 16: Altair MotionView 11.0 Tutorials

11 MotionView 13.0 Tutorials

Proprietary Information of Altair Engineering

Altair Engineering

Client Specific Toolbars

Client specific toolbars provide access to options required for pre- or post-processing of FEA/MBDmodels. MotionView has a set of toolbars for building an MBD model. Each MotionView toolbar groupprovides access to entities with similar characteristics. For example, all entity such as Joints andMotions are grouped in the Constraint toolbar. The table below shows MotionView toolbars with abrief explanation of their usage.

Toolbar Purpose Image

General Actions Options to render graphics,provide access to the Run panel(change solver settings andsubmit jobs to the solver), andthe Entity Selector.

Depressing the Entity Selector

icon indicates the graphicscreen is in entity selectionmode. If no other entity iconsare depressed, the selection isnot filtered to a particular entity(any entity that has a graphicalrepresentation on the screencan be selected).

Container Entity Select/Add container entitieslike Assemblies, Systems, andAnalyses.

Reference Entity Select/Add entities like Points,Bodies, Vectors, Markers, etc.

Constraint Select/Add constraint entitieslike Joints, Motions, Couplers,etc.

Force Entity Select/Add force entities likemulti-axial Forces, SpringDampers, Bushings, Beams,Contacts, etc.

Page 17: Altair MotionView 11.0 Tutorials

Altair Engineering 12

Proprietary Information of Altair Engineering

MotionView 13.0 Tutorials

Toolbar Purpose Image

Control Entity Select/Add entities like SolverVariables, Solver Arrays, SISOController, Differentials, andSensors which are useful indefining controlled simulations.

General MDL Entity Select/Add general MDL entitieslike Datasets, Templates, Formsand Output Requests.

Model Check Checks the model.

Point Macros Access point creation macrosuseful in adding points withrespect to a reference frame,along a vector, along a curveand at an arc center.

Other Macros Other macros useful in modelingand debugging: calculateangles, find connected entities,create markers for a deformablesurface and contact propertieseditor.

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 Pointsexample below):

Left mouse click - Filters selection to a Point entity.

Right mouse click - Opens the Add Point dialog to add a Point.

Note - Mouse over the icons to display a tip about the type of entity that can be selected oradded.

Page 18: Altair MotionView 11.0 Tutorials

13 MotionView 13.0 Tutorials

Proprietary Information of Altair Engineering

Altair Engineering

Browsers

Tab Area

The tab area docks different browsers, the purpose of the browsers is to navigate through thehierarchy tree and execute some operations specific to the selected items. Available for all clientsis the Session Browser, which allows you to browse to the different pages or windows in an HWDsession, as well as execute certain page and window operations. In addition to the SessionBrowser, client specific browsers are shown based on the active window. For example, when theMotionView 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 MotionViewProject Browser helps you browse/select different modeling entities, in addition to executingcertain modeling operations. Other browsers include the Organize Browser (used for datamanagement and collaboration) and the Process Manager (used for process automation). Pleaserefer to the client specific online help regarding the available browsers. Finally, browsers can beplaced on either side of the graphic window (Left/Right/Both) through the Menu bar by using theView > Tab Area menu options.

Mouse Options in the Project Browser

A left mouse click on an entity in the Project Browser selects that entity and the details of entityare 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 selectedobject.

Page 19: Altair MotionView 11.0 Tutorials

Altair Engineering 14

Proprietary Information of Altair Engineering

MotionView 13.0 Tutorials

For example, a right click on a Point entity brings up a context menu that provides options toeither Deactivate, Rename, Add, Delete, or Cut the point entity along with options to filterentities.

Similarly, a right mouse click on the Model (the topmost folder in the browser hierarchy) displaysup a context menu with options useful in model building.

Page 20: Altair MotionView 11.0 Tutorials

15 MotionView 13.0 Tutorials

Proprietary Information of Altair Engineering

Altair Engineering

Panel Area

Below the client specific toolbar is the panel area where you can view and modify the variousvalues and properties of a selected entity. Panels may have several tabs which organize thevarious properties and values of the entity type selected. For example, the Spring Damper panelhas 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 theattachment 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 freelength.

Page 21: Altair MotionView 11.0 Tutorials

Altair Engineering 16

Proprietary Information of Altair Engineering

MotionView 13.0 Tutorials

Graphics Window

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,Graphic, etc. (while the Entity Selectorand an entity icon is depressed in thetoolbar).

Selection (the selected entity is highlighted bya white boarder around it).

Hold the left mouse button and moveover the model (while the EntitySelector and an entity icon is depressedin the toolbar).

Displays the entity name on the mouse tooltipand selects the entity upon releasing mousebutton.

Right-click on a model entity. Displays a context menu with various options: Select, Cut, and Delete against each entityname.

Ctrl + Left mouse button Rotates the model (observe the mousetooltip).

Ctrl + Left click Picks the center of rotation.

Ctrl + Right mouse button Translates/Pans the model.

Ctrl + Middle mouse button Selects the window to fit.

Ctrl + Middle click Fits the model to the window.

Page 22: Altair MotionView 11.0 Tutorials

17 MotionView 13.0 Tutorials

Proprietary Information of Altair Engineering

Altair Engineering

The controls for the mouse can be found under Tools > Options > Mouse:

You can customize the mouse controls using this dialog.

Note - The items under the Main Menu, Browser, and Client specific toolbars differ from client toclient.

Exercise:

In this exercise you will learn to:

Open and Save a model in MotionView.

Add a Page and change the Page Layout in a Session.

Change between HWD clients.

Open and Save a HWD session.

Prior to beginning this tutorial, please copy all of the files from the <Installation directory>

\tutorials\mv_hv_hg\mbd_modeling\introductory to your <working directory>.

Page 23: Altair MotionView 11.0 Tutorials

Altair Engineering 18

Proprietary Information of Altair Engineering

MotionView 13.0 Tutorials

Step 1: Opening a MotionView model file.

1. Start MotionView:

In Windows - go through the Start Menu (Start Menu > Programs > Altair HyperWorksinstallation > MotionView).

In Linux - invoke ~hw_install/altair/scripts/mview in an "open terminal" (where

~hw_install is the location where HyperWorks is installed).

In Mac - go through the Applications > Altair HyperWorks > installation version number >MotionView

OR

invoke ~hw_install/altair/scripts/mview in an "open terminal" (where

~hw_install is the location where HyperWorks is installed).

2. Click the Open Model icon, , on the Standard toolbar.

OR

From the File menu select Open > Model.

Page 24: Altair MotionView 11.0 Tutorials

19 MotionView 13.0 Tutorials

Proprietary Information of Altair Engineering

Altair Engineering

3. From the Open Model dialog, locate and select the model definition fileSingleCylinderEngine_model.mdl, located in your working directory.

Note MDL stands for “Model Definition Language”. MDL is an ASCII programmable language formodeling in MotionView. See the MotionView Reference Guide for details about thedifferent MDL statements.

Page 25: Altair MotionView 11.0 Tutorials

Altair Engineering 20

Proprietary Information of Altair Engineering

MotionView 13.0 Tutorials

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 (

).

Page 26: Altair MotionView 11.0 Tutorials

21 MotionView 13.0 Tutorials

Proprietary Information of Altair Engineering

Altair Engineering

7. Click on the CRANK_SHAFT body from the bodies listed to review its properties.

Note Each entity will have a label and a unique variable name. For example, the crank shaftbody 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.

Page 27: Altair MotionView 11.0 Tutorials

Altair Engineering 22

Proprietary Information of Altair Engineering

MotionView 13.0 Tutorials

9. Click on CM Coordinates tab to review the CM point of the body and its orientation.

The Origin point defines the body CG location and the orientation is defined with respect to globalreference frame using direction cosines DxDyDz.

Step 2: Selecting and modifying a motion.

In this step you will modify the crank shaft rotational velocity to 10rad/sec.

1. Left click the Motion icon on the Constraint toolbar to change the graphical selection to amotion entity. Move the cursor in the graphics area with left mouse button pressed to identifythe motion CrankShaft Rotation and release the mouse button to select it.

OR

Page 28: Altair MotionView 11.0 Tutorials

23 MotionView 13.0 Tutorials

Proprietary Information of Altair Engineering

Altair Engineering

Browse to the Motions entity in Project Browser and click on next to Motions and selectCrankShaft Rotation.

Note Implicit graphics are displayed for all applicable entities, allowing you to visualize theirlocation and orientation. See the MotionView User’s Guide for details about controllingthe visualization of implicit graphics.

2. From the Motion panel, click on the Properties tab.

3. Enter 10 in the Value field.

Step 3: Saving a MotionView model.

1. From the File menu, select Save As > Model.

The Save As Model dialog is displayed.

Note You can also click the Save Model icon, , on the Standard toolbar to the save thefile in working directory with the existing name. If the model is new, you will beprompted to input the name of the model.

Page 29: Altair MotionView 11.0 Tutorials

Altair Engineering 24

Proprietary Information of Altair Engineering

MotionView 13.0 Tutorials

2. Browse to your working directory and specify the File name: asSingleCylinderEngine_model_10rad_per_sec.mdl.

3. Click Save.

Step 4: Solving the model.

1. Click the Run icon, , on the General Actions toolbar.

The Run panel is displayed.

2. Click the Run button to solve the model using MotionSolve.

Upon clicking Run, MotionSolve is invoked and solves the model. The HyperWorks Solver Viewwindow 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.

Page 30: Altair MotionView 11.0 Tutorials

25 MotionView 13.0 Tutorials

Proprietary Information of Altair Engineering

Altair Engineering

3. Once the job is completed, close the solver execution window.

4. Clear the message log.

Step 5: Adding pages to a session.

In this section you will learn how to add a page, change to different HWD clients, change the pagelayout, and navigate between pages. You will also load the result files to view the animation and theplot. Even though there are both Animate and Plot buttons in the MotionView Run panel, clickingthose buttons will result in the HyperView and HyperGraph clients opening automatically in differentwindows on the same page, however in this exercise you will manually do the same on a differentpage, in order to familiarize yourself with the concept of page and window within the HWDenvironment.

1. Click on the Add Page icon from Page Controls toolbar.

A new page is added with MotionView as the client.

Note Please note that the Add Page option adds a page with the current client (MotionViewin this case).

2. From the Select application drop-down menu, select HyperView to change the current windowto HyperView.

Page 31: Altair MotionView 11.0 Tutorials

Altair Engineering 26

Proprietary Information of Altair Engineering

MotionView 13.0 Tutorials

3. From the Load Model panel, click on the Select file icon next to Load model.

The Load Model File dialog is displayed.

4. Browse to your working directory and select the animation results file SingleCylinderEngine_model_10rad_per_sec.h3d.

The Load results field is automatically populated withSingleCylinderEngine_model_10rad_per_sec.h3d.

Note H3D is an Altair binary file for HyperView. The H3D file contains both model and resultsdata from a solver run. Please see the Appendix (below) for various use cases of H3Dfiles in MotionView/MotionSolve.

Page 32: Altair MotionView 11.0 Tutorials

27 MotionView 13.0 Tutorials

Proprietary Information of Altair Engineering

Altair Engineering

5. Click Apply to load the results.

6. From the Animation toolbar, click the Start/Pause Animation button to animate theresults.

7. Rotate, pan, and zoom the model using the mouse controls for better visualization andunderstanding of the results.

8. Click the Start/Pause Animation button to stop the animation.

9. Add a window to the current page to plot 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.

Page 33: Altair MotionView 11.0 Tutorials

Altair Engineering 28

Proprietary Information of Altair Engineering

MotionView 13.0 Tutorials

12. Use the Select application drop-down menu to change the application from HyperView to

HyperGraph 2D .

Note The Client selector displays the icon of the current client (HyperGraph in this case).

13. Click the Build Plots icon, , on the Curves toolbar.

14. From the Build Plots panel, click the Open File icon, , next to Data file.

The Open Data File dialog displays.

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.

16. Click Open.

Page 34: Altair MotionView 11.0 Tutorials

29 MotionView 13.0 Tutorials

Proprietary Information of Altair Engineering

Altair Engineering

17. Plot the angular velocities of the crank shaft:

For X Type, select Time.

For Y Type, select Marker Velocity.

For Y Request, select REQ/70000002.

For Y Component, select Wx.

18. Click Apply and observe Wx = 10 rad/sec.

Two Window Layout (with HyperView and HyperGraph 2D)

19. From the Animation toolbar, click the Start/Pause Animation button to animate theresults.

20. Click on Expand/Reduce Window icon, to expand or reduce an active window.

Page 35: Altair MotionView 11.0 Tutorials

Altair Engineering 30

Proprietary Information of Altair Engineering

MotionView 13.0 Tutorials

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, on the Page Controls toolbar to navigate topage 1 (the MotionView model).

MotionView with Single Cylinder Engine Model

Page 36: Altair MotionView 11.0 Tutorials

31 MotionView 13.0 Tutorials

Proprietary Information of Altair Engineering

Altair Engineering

Step 6: Saving a session file.

1. From the File menu, select Save As > Session.

The Save Session As dialog is displayed.

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 resultsinformation). Please refer to the Appendix below for details regarding the different typesof HyperWorks Desktop files.

3. Click Save.

Your work is saved as a session file.

Page 37: Altair MotionView 11.0 Tutorials

Altair Engineering 32

Proprietary Information of Altair Engineering

MotionView 13.0 Tutorials

Step 7: Opening a session file.

1. From the File menu, select New > Session to start a new session.

Click Yes to the message asking if you would like to discard all of the current session data andstart new session.

2. From the File menu, select Open > Session.

The Open Session File dialog is displayed.

Page 38: Altair MotionView 11.0 Tutorials

33 MotionView 13.0 Tutorials

Proprietary Information of Altair Engineering

Altair Engineering

3. Browse to your working directory and select the session file saved in previous step mywork.mvw.

4. Click Open.

5. Browse through the pages to look at the model, plots, and animation that you worked on during

the exercise using the icons.

Page 39: Altair MotionView 11.0 Tutorials

Altair Engineering 34

Proprietary Information of Altair Engineering

MotionView 13.0 Tutorials

Appendix

HyperWorks Desktop file types:

The following table summarizes the different file types in HWD and the location where the file canbe loaded and saved.

File Type Extension Window Mode

Session script .mvw Any

Report template .tpl Any

MDL .mdl MotionView

Animation .gra, .res (Adams and Optistruct),h3d, .flx, .mrf

HyperView

Plot .req, .mrf, .abf, .plt, .res (ADAMS) HyperGraph

Templex script,any text file

.tpl, .txt TextView

Options for loading and saving different file types

H3D file use cases in MotionView/MotionSolve:

H3D is an Altair format for storing model and result information. In general, an H3D file is used forpost-processing results in HyperView; however the H3D file has a few other use cases inMotionView/MotionSolve.

Graphic H3D File This type of H3D contains Model information only. A graphical H3D fileis 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 representa deformable body by accessing the modes, mass, and inertiainformation. HyperView can read it as both Model and Results, andalso animate the mode shapes, modal displacements, stresses, etc. (ifavailable).

Results H3D File This type of H3D is written by MotionSolve. It contains Model andResults information. HyperView can read it as both Model and Results,and also animate the position, deformation, stresses, forces, etc.

H3D contains different blocks of information based on the above needs:

Model Information – Nodes and Elements

Flexible Body Information – Modes, Interface Nodes, Mass/Inertia

Results – Position, Displacements, Stress, Strain, etc.

Page 40: Altair MotionView 11.0 Tutorials

35 MotionView 13.0 Tutorials

Proprietary Information of Altair Engineering

Altair Engineering

Interactive

MV-1000: Interactive Model Building and Simulation

MV-1035: Importing CAD or FE into MotionView

MV-1011: Extension and Retraction Analysis of the Main Landing Gear of an Aircraft

Page 41: Altair MotionView 11.0 Tutorials

Altair Engineering 36

Proprietary Information of Altair Engineering

MotionView 13.0 Tutorials

MV-1000: Interactive Model Building and Simulation

Multi Body Dynamics (MBD) Overview

MBD Definition

Multi Body Dynamics (MBD) is defined as the “study of dynamics of a system of interconnectedbodies”. A mechanism (MBD system) constitutes a set of links (bodies) connected (constrained) witheach other to perform a specified action under application of force or motion. The motion ofmechanisms is defined by its kinematic behavior. The dynamic behavior of a mechanism results fromthe 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 isdefined as a body in which deformation is negligible.

In general, in order to solve an MBD problem, the solver requires following information:

Rigid body inertia and location

Connections – type, bodies involved , location, and orientation

Forces and motions – bodies involved , location, orientation, and value

MotionView facilitates quick and easy ways of modeling items, such as a system, through graphicalvisualization.

Page 42: Altair MotionView 11.0 Tutorials

37 MotionView 13.0 Tutorials

Proprietary Information of Altair Engineering

Altair Engineering

In this tutorial, you will learn how to:

Create a model of a four-bar trunk lid mechanism interactively through the MotionViewgraphical user interface.

Perform a kinematic analysis on the model using MotionSolve.

Post-process the MotionSolve results in the animation and plot windows.

Car Trunk-Lid Mechanism

The trunk-lid shown in the image above uses a four-bar mechanism for its opening and closingmotions.

Page 43: Altair MotionView 11.0 Tutorials

Altair Engineering 38

Proprietary Information of Altair Engineering

MotionView 13.0 Tutorials

A schematic diagram of the four-bar mechanism is shown below:

The four links (bodies) in four-bar mechanism are namely; Ground Body, Follower, Coupler, and InputLink. In this example, the Ground Body is the car body and Input Link is the trunk-lid body. Theremaining two bodies (Follower and Coupler) form the part of the mechanism used to aid the openingand closing of car trunk-lid.

The following entities are needed to build this model:

Points

Bodies

Constraints (Joints)

Graphics

Input (Motion or Force)

Output

Copy trunk.hm and trunklid.hm from the

<installation_directory>\tutorials\mv_hv_hg\mbd_modeling\interactive to the <working

directory>.

Page 44: Altair MotionView 11.0 Tutorials

39 MotionView 13.0 Tutorials

Proprietary Information of Altair Engineering

Altair Engineering

Exercise

Step 1: Creating points.

1. Start a new MotionView Session.

2. Add a point using one of the following methods:

From the Project Browser, right-click on Model and select Add > Reference Entity > Pointfrom the context menu.

OR

Right-click on the Points icon, , on the Reference Entity toolbar.

The Add Point or PointPair dialog is displayed.

Note Other entities like Bodies, Markers, etc. can also be created using either of the methodslisted above (Project Browser or toolbar).

3. For Label, enter Point A.

Page 45: Altair MotionView 11.0 Tutorials

Altair Engineering 40

Proprietary Information of Altair Engineering

MotionView 13.0 Tutorials

4. For Variable, enter p_a.

The label allows you to identify an entity in the graphical user interface, while the variable nameis used by MotionView to uniquely identify an entity.

Note When using the Add "Entity" dialog for any entity, you can use the label and variabledefaults. However as a best modeling practice, it is recommended that you providemeaningful 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.

Points Panel - Properties Tab

Page 46: Altair MotionView 11.0 Tutorials

41 MotionView 13.0 Tutorials

Proprietary Information of Altair Engineering

Altair Engineering

6. Enter the values for the X, Y, and Z coordinates for point A, listed in the table below.

The table below lists the coordinates of the points needed for this model:

Point Location

Label Variable X Y Z

Point A p_a 921 580 1124

Point B p_b 918 580 1114

Point C p_c 915 580 1104

Point D p_d 896 580 1106

Point E p_e 878 580 1108

Point F p_f 878 580 1118

Point G p_g 830 580 1080

Point H p_h 790 580 1088

Point I p_i 825 580 1109

Page 47: Altair MotionView 11.0 Tutorials

Altair Engineering 42

Proprietary Information of Altair Engineering

MotionView 13.0 Tutorials

7. Other (multiple) points can be entered using the following method:

Repeat steps 2 through 4 and click Apply to create points B through I. Remember to substituteB, C, etc., for A when entering the label and variable names in the Add Point or PointPairdialog. 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.

The points panel for Point I is displayed.

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 inthis table.

Data Summary Dialog

Page 48: Altair MotionView 11.0 Tutorials

43 MotionView 13.0 Tutorials

Proprietary Information of Altair Engineering

Altair Engineering

Since the Y value of all the points are the same, you can parameterize the value by: selecting

the Y coordinate field, clicking on the button to invoke the Expression Builder, and thenselecting the Y value of Point A as shown in figure below:

Expression Builder

Copy the above expression and paste it into the Y coordinate field of other remaining points.

Enter the X and Z coordinates as listed in the table above.

Note Press ENTER on the keyboard to move to the next field.

Page 49: Altair MotionView 11.0 Tutorials

Altair Engineering 44

Proprietary Information of Altair Engineering

MotionView 13.0 Tutorials

Click Close.

8. Change the view to left, by clicking on the XZ Left Plane View icon on the Standard Viewstoolbar.

Step 2: Creating bodies.

The mechanism consists of four rigid-body links: Ground (car body), Input Link, Coupler, and Follower. Ground Body is available by default when a new MotionView client is invoked, hence creating theGround Body separately is not required. In this step, you'll create the Input Link, Coupler, andFollower rigid-body links in the mechanism.

1. Right-click on the Bodies icon, , on the Reference Entity toolbar.

The Add Body or BodyPair dialog is displayed.

Page 50: Altair MotionView 11.0 Tutorials

45 MotionView 13.0 Tutorials

Proprietary Information of Altair Engineering

Altair Engineering

2. Specify the label as Input Link and the variable name b_inputlink.

3. Click OK.

The Bodies panel is displayed. The new body that you just added is highlighted in the model treeof the Project Browser.

4. Click the Properties tab.

5. Enter the following values for mass and inertia:

Mass = 1

Ixx, Iyy, Izz = 1000, Ixy, Ixz, Iyz = 0

Click the CM Coordinates tab to specify the location of the center of mass of the body.

6. Select the Use center of mass coordinate system check box.

Page 51: Altair MotionView 11.0 Tutorials

Altair Engineering 46

Proprietary Information of Altair Engineering

MotionView 13.0 Tutorials

7. Under the Origin, click the Point collector .

A cyan border appears around the collector indicating that the collector is now active forselection.

8. From the graphics area, select Point G on the model by using the left click of the mouse. Whileselecting, keep the left mouse button pressed and move the cursor over the points to see thelabel. Release the mouse button when Point G is located.

OR

Page 52: Altair MotionView 11.0 Tutorials

47 MotionView 13.0 Tutorials

Proprietary Information of Altair Engineering

Altair Engineering

Click again to launch the Select a Point dialog.

Select Point G from the model tree.

Click OK.

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 otherentities 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

.

Page 53: Altair MotionView 11.0 Tutorials

Altair Engineering 48

Proprietary Information of Altair Engineering

MotionView 13.0 Tutorials

Retain the default orientation scheme (Orient two axes) and accept the default values for

.

9. Repeat steps 1 through 8 to create the two remaining links with the following label and variablenames:

Label Variable Name

Follower b_follower

Coupler b_coupler

10. Specify the mass and inertia for these links as:

Mass = 1

Ixx, Iyy, Izz = 1000, Ixy, Ixz, Iyz = 0

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.

Step 3: Creating revolute joints.

The mechanism consists of revolute joints at four points: A, C, E, and F. The axis of revolution isparallel to the global Y axis.

1. From the Project Browser, right-click on Model and select Add > Constraint > Joint from thecontext menu.

OR

Click the Joints icon, , on the Constraint toolbar.

The Add Joint or JointPair dialog is displayed.

2. Specify the label as Follower-Ground and variable name as j_follower_ground for the new

joint.

Page 54: Altair MotionView 11.0 Tutorials

49 MotionView 13.0 Tutorials

Proprietary Information of Altair Engineering

Altair Engineering

3. Under Type, select Revolute Joint from the drop-down menu.

4. Click OK.

The Joints panel is displayed. The new joint you added is highlighted in the model tree in theProject Browser.

5. Under the Connectivity tab, double click the first Body collector .

The Select a Body dialog is displayed.

Page 55: Altair MotionView 11.0 Tutorials

Altair Engineering 50

Proprietary Information of Altair Engineering

MotionView 13.0 Tutorials

6. From the model tree, select Bodies from the left-hand column and Follower from the right-handcolumn.

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 .

9. Release the left mouse button when Ground Body is displayed in the graphics window.

Page 56: Altair MotionView 11.0 Tutorials

51 MotionView 13.0 Tutorials

Proprietary Information of Altair Engineering

Altair Engineering

10. Under Origin, double click the Point collector .

The Select a Point dialog is displayed.

11. Select Point A as the joint origin.

12. Click OK.

13. To specify an axis of rotation, under Alignment Axis, click the downward pointing arrow next toPoint 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.

Revolute Joint Label Variable Name Body 1 Body 2 Point Vector

Follower-Ground j_follower_ground Follower Ground A Global Y

Follower-Coupler j_follower_coupler Follower Coupler C Global Y

Coupler-Input j_coupler_input Coupler Input Link E Global Y

Input-Ground j_input_ground Input Link Ground F Global Y

Revolute joint information

Step 4: Specify a motion for the mechanism.

The input for this model will be in the form of a Motion. A Motion can be specified as Linear,Expression, Spline3D, or Curve. In this step, a Motion is specified using an expression.

1. From the Project Browser, right-click on Model and select Add > Constraint > Motion from thecontext menu.

OR

Right-click on the Motion icon, , on the Constraint toolbar.

The Add Motion or MotionPair dialog appears.

Page 57: Altair MotionView 11.0 Tutorials

Altair Engineering 52

Proprietary Information of Altair Engineering

MotionView 13.0 Tutorials

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 ProjectBrowser.

4. From the Connectivity tab, double click on the Joint collector .

The Select a Joint dialog is displayed.

5. From the model tree, select the revolute joint at Point F (Input-Ground) that you created in theprevious step.

Page 58: Altair MotionView 11.0 Tutorials

53 MotionView 13.0 Tutorials

Proprietary Information of Altair Engineering

Altair Engineering

6. Click OK.

The Motion panel is displayed.

7. From the Properties tab, select Expression by clicking on the downward arrow next to Linear.

8. Click in the Expression field.

The Expression Builder is activated.

9. Click on the button to open the Expression Builder and enter following expression betweenthe back quotes `60d*sin(2*0.1*PI*TIME)`.

Page 59: Altair MotionView 11.0 Tutorials

Altair Engineering 54

Proprietary Information of Altair Engineering

MotionView 13.0 Tutorials

The above expression is a SIN function with an amplitude of 60 degrees and frequency of 0.1 Hz. With the above expression the trunk lid is opened to an angle of 60 degrees and back in a totaltime period of 5 seconds.

10. Click OK.

Note This method of creating an expression can also be used for specifying non-linearproperties for other entities like Force, Spring Damper, Bushing, etc.

Step 5: Creating outputs.

You can create outputs using bodies, points and markers. You can also directly request force,bushing, and spring-damper entity outputs. Another way to create outputs is to create mathexpressions dependent on any of the above mentioned entities.

In this step, you will:

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 relativeto 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

Right-click on the Outputs icon, , on the General MDL Entity toolbar.

The Add Output dialog is displayed.

2. Specify the label as Input Link Displacement and the variable name as o_disp for the new

output.

3. Click OK.

Page 60: Altair MotionView 11.0 Tutorials

55 MotionView 13.0 Tutorials

Proprietary Information of Altair Engineering

Altair Engineering

4. To create a Displacement output between two points on two bodies:

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.

Record the displacement on Both points, one relative to the other.

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 drop-down menu, select Expressions.

Click in the F2 field. This activates the button.

Click on the button.

The Expression Builder dialog is displayed.

From the Motion tab, select DX.

Place the cursor inside the brackets after DX.

From the Properties tab, expand the following trees: Bodies/Input Link/Marker CM.

Select idstring.

Page 61: Altair MotionView 11.0 Tutorials

Altair Engineering 56

Proprietary Information of Altair Engineering

MotionView 13.0 Tutorials

Click Add to populate the expression.

Add a comma to separate the next expression.

Add a pair of curly brackets "{}".

Place the cursor inside the added brackets.

From the Properties tab, expand the following items in the tree: Markers/Global Frame.

Select idstring.

Page 62: Altair MotionView 11.0 Tutorials

57 MotionView 13.0 Tutorials

Proprietary Information of Altair Engineering

Altair Engineering

Click Add to populate the expression.

6. Click OK.

7. To check for errors, go to the Tools menu and select Check Model. Any errors in your modeltopology are listed in the Message Log.

The above function DX measures the distance between Input Link’s CM (center of mass) markerand 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.

Page 63: Altair MotionView 11.0 Tutorials

Altair Engineering 58

Proprietary Information of Altair Engineering

MotionView 13.0 Tutorials

Note The back quotes in the expression are used so that the MDL math parser evaluates theexpression. Entity properties like idstring, value, etc. get evaluated when they are

placed inside curly braces {}, otherwise they are understood as plain text. Refer to the

Evaluating Expressions in MotionView topic to learn more about various kinds ofexpressions and form of evaluation adopted by MotionView.

Step 6: Add graphic primitives.

At this stage your trunk lid model does not contain any graphics, and the entities created in previoussteps are represented only by implicit graphics (which are not available in solver deck or results file).

Trunk-lid with only implicit graphics

In this step you will add graphics for visualization of a mechanism. MotionView graphics can bebroadly categorized into three types: implicit, explicit, and external graphics.

Implicit Graphics The small icons that you see in the MotionView interface when youcreate entities like points, bodies, joints, etc. are called implicitgraphics. These are provided only for guidance during the modelbuilding process and are not visible when animating simulations.

Explicit Graphics These graphics are represented in form of a tessellation, are written tothe solver deck and subsequently available in the results. Explicitgraphics are of two types.

Primitive Graphics These graphics help in better visualization of the model and are alsovisible in the animation. The various types of Primitive Graphics inMotionView are Cylinder, Box, Sphere, etc.

External Graphics One can import in various CAD formats or Hypermesh files intoMotionView. The ‘Import CAD or FE..’ utility in MotionView can beused to convert a CAD model or a Hypermesh model to h3d graphicformat which can be imported into MotionView. One can also import .g,ADAMS View .shl and wavefront .obj files directly into MotionView.

Page 64: Altair MotionView 11.0 Tutorials

59 MotionView 13.0 Tutorials

Proprietary Information of Altair Engineering

Altair Engineering

MotionView allows you to turn on and off implicit graphics for some of the commonly used modelingentities.

1. To turn on all implicit graphics:

From the Model main menu, select Implicit Graphics...

Turn on the Visible check box.

Note - Implicit graphics of Individual entities can be turned on or off by using the Visiblecheck 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:

You create a new model in another model window.

You start a new session.

You load an existing .mdl/.mvw file into a new MotionView session.

Page 65: Altair MotionView 11.0 Tutorials

Altair Engineering 60

Proprietary Information of Altair Engineering

MotionView 13.0 Tutorials

To visualize the four-bar mechanism, you need to add explicit graphics to the model. In thisstep, you will add cylinder graphics for Follower, Coupler, and Input Links.

To add explicit graphics to your model:

From the Project Browser, right click on Model and select Add > Reference Entity >Graphic from the context menu.

OR

Right-click on the Graphics panel icon, , on the Reference Entity toolbar.

The Add Cylinder or CylinderPair dialog is displayed.

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 namechanges to Add Box or BoxPair when the Box graphic type is selected.

3. From the Type drop-down menu, select Cylinder. Click OK.

4. In the Connectivity tab, double-click the Body button below Parent. Select theFollower from the Select a Body list and click OK.

This assigns the graphics to the parent body.

5. To select the origin point of the cylinder, click below Origin.

6. Pick Point A in the graphics area.

7. Click under Direction.

Page 66: Altair MotionView 11.0 Tutorials

61 MotionView 13.0 Tutorials

Proprietary Information of Altair Engineering

Altair Engineering

8. Select Point C for .

9. From the Properties tab, enter 2 in the Radius 1: field.

Note The cylinder graphic can also be used to create a conical graphic. By default, the Radius2 field is parameterized with respect to Radius 1, such that Radius 2 takes the samevalue 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 explicitgraphics for other links.

Label Variable name Graphic type Body Origin Direction Radius

FollowerCylinder

gcyl_follower Cylinder Follower Point A Point C 2

CouplerCylinder

gcyl_coupler Cylinder Coupler Point C Point E 2

Input LinkCylinder 1

gcyl_inputlink_1 Cylinder Input Link Point F Point E 2

Input LinkCylinder 2

gcyl_inputlink_2 Cylinder Input Link Point E Point G 2

Input LinkCylinder 3

gcyl_inputlink_3 Cylinder Input Link Point G Point H 2

Input LinkCylinder 4

gcyl_inputlink_4 Cylinder Input Link Point H Point I 2

Page 67: Altair MotionView 11.0 Tutorials

Altair Engineering 62

Proprietary Information of Altair Engineering

MotionView 13.0 Tutorials

After the addition of cylinder graphics for all three links, the Model will look as shown below:

Four-bar mechanism of the trunk-lid assembly

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 modelusing HyperMesh, Catia, IGES, STL, VDAFS, ProE, or Unigraphics source files. MotionView usesHyperMesh to perform the conversion.

In this step, you will use this conversion utility to convert a HyperMesh file of a car trunk lid into theH3D format.

1. From the Tools menu, select Import CAD or FE….

Or

Click on the Import Geometry icon on the Standard toolbar.

The Import CAD or FE dialog is displayed.

2. Activate the Import CAD or Finite Element Model Only radio button.

3. From the Input File option drop-down menu, select HyperMesh.

4. Click the browser button next to Input File and select trunklid.hm, located in <working

directory>, as your input file.

5. Click the file browser button next to Output File and specify the name for the output H3Dfiles as trunklid.h3d under <working directory>.

Page 68: Altair MotionView 11.0 Tutorials

63 MotionView 13.0 Tutorials

Proprietary Information of Altair Engineering

Altair Engineering

6. Click OK to begin the import process.

The Import CAD or FE utility runs HyperMesh in the background to translate the HyperMesh fileinto an H3D file.

Note The H3D file format is a neutral format in HyperWorks. It finds wide usage such asgraphics and result files. The graphic information is generally stored in a tessellatedform.

7. Click OK when the Import was a Success! message is displayed.

Important - Please also make sure to refer to the Message Log for unit conversioninformation.

Page 69: Altair MotionView 11.0 Tutorials

Altair Engineering 64

Proprietary Information of Altair Engineering

MotionView 13.0 Tutorials

8. Use steps 1 through 7 to import the trunk graphics by converting the trunk.hm file to trunk.h3d.

Step 8: Attach H3D objects to the input link and ground bodies.

In this step, you will attach the trunk lid H3D object to the input link and the trunk H3D object toGround.

1. Click the Graphics icon on the Reference Entity toolbar.

2. Select g_trunklid - from the graphics area.

3. In the Connectivity tab, double click the Body collector under Parent. Select InputLink from the Select a Body list.

4. Click OK.

The Graphics panel is displayed.

Note Observe the change in the trunk lid graphic color to the Input Link body color.

Page 70: Altair MotionView 11.0 Tutorials

65 MotionView 13.0 Tutorials

Proprietary Information of Altair Engineering

Altair Engineering

5. Similarly, select the newly created g_trunk graphic from the Project Browser and set the

as Ground Body.

6. Click the Save Model icon on the Standard toolbar.

If the model is new you will be prompted to input the name of the model, otherwise the model willbe saved in the working directory with the existing name.

Note Existing models can be saved to another file using the Save As > Model option locatedin the File menu.

7. From the Save As Model dialog, browse to your working directory and specify the File name: astrunklid_mechanism.mdl.

Page 71: Altair MotionView 11.0 Tutorials

Altair Engineering 66

Proprietary Information of Altair Engineering

MotionView 13.0 Tutorials

8. Click Save.

Trunk-lid mechanism

Step 9: Solve the model with MotionSolve.

MotionSolve can be used to perform kinematic, static, quasi-static, and dynamic analyses of multi-body mechanical systems. The input file for MotionSolve is an XML file called MotionSolve XML. Thesolution in MotionSolve can be executed from MotionView.

In this step, you will use MotionSolve to perform a kinematic simulation of the mechanism for asimulation time of 5 seconds, with a step size of 0.01 second.

1. Click the Run icon, , on the General Actions toolbar.

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 forthe 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 User’s Guide for details about the different result file types.

Page 72: Altair MotionView 11.0 Tutorials

67 MotionView 13.0 Tutorials

Proprietary Information of Altair Engineering

Altair Engineering

5. Activate the Export MDL snapshot check box (in order to save the model at the stage in whichthe Run is executed).

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.

8. Check the Message Log for more information.

Upon clicking Run, MotionSolve is invoked and solves the model. The HyperWorks Solver Viewwindow 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.

1. Click the Animate button.

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.

4. Return to the MotionView window.

5. Click the Plot button.

This opens HyperGraph and loads the results file in a new window.

Page 73: Altair MotionView 11.0 Tutorials

Altair Engineering 68

Proprietary Information of Altair Engineering

MotionView 13.0 Tutorials

6. Leave the X-axis Data Type as Time.

7. Input the following y-axis data:

Y Type Marker Displacement

Y Request Displacement (on Input Link)

Y Component DM (Magnitude)

8. Click Apply.

This plots the magnitude of the displacement of Point I relative to the Global Origin.

Your session should look like the figure below:

Session with model, plot, and animation

Step 11: Save your work as a session file.

1. From the File menu, select Save As > Session File.

2. Specify the file name as trunklid_mechanism for your session.

3. Click Save.

Your work is saved as trunklid_mechanism.mvw session file.

Page 74: Altair MotionView 11.0 Tutorials

69 MotionView 13.0 Tutorials

Proprietary Information of Altair Engineering

Altair Engineering

Appendix

Evaluating Expressions in MotionView

Expressions in MotionView are evaluated by two kinds of parsers:

Math Parser

A MotionView parser that evaluates a MotionView expression as real/integer/string for a field asappropriate.

Real

This type of field can contain a real number or the parametric expression that should evaluate toa real number. This type of field is found in Points, Bodies , Force – Linear. Note that only thevalue of the expression as evaluated goes into the solver deck and not the parametric equation.

Example: p_a.x, b_0.mass

String

This type of field can contain a string or a parametric expression that should evaluate to astring. 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 goesinto 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 parametricequation.

Templex Parser

A math program available in HyperWorks that can perform more complex programming than themath parser, other than evaluating a MotionView expression.

The following type of fields in MotionView are evaluated by the templex parser that evaluates aparameterized expression:

Expressions

This type of field is different than the three listed above because it can contain a combinationof text and parametric expression. It is generally used to define a solver function (or a functionthat 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 backquotes suggests the math parser to pass the expression through Templex. Templex evaluatesany expression within curly braces while retaining the other text as is.

For example in the expression ` DX({b_inputlink.cm.idstring},

{Global_Frame.idstring})` , the templex evaluates the ID (as a string) of the cm of the

Input link body (b_ inputlink) and that of marker Global Frame while retaining “DX” as is.

Page 75: Altair MotionView 11.0 Tutorials

Altair Engineering 70

Proprietary Information of Altair Engineering

MotionView 13.0 Tutorials

These fields are available in entity panels such as: Bushings, Motions, Forces with propertiesthat toggle to Expression, Independent variable for a curve input in these entities, and Outputsof the type Expression.

Page 76: Altair MotionView 11.0 Tutorials

71 MotionView 13.0 Tutorials

Proprietary Information of Altair Engineering

Altair Engineering

MV-1035: Importing CAD or FE into MotionView

This tutorial introduces you to an important modeling approach: Building an MBD model from CAD data.

In this tutorial, you will learn to:

Import a CAD assembly into MotionView.

Import a CSV file to create Points

Create an MBD model using the imported data.

Import CAD or FE Utility Introduction

The Import CAD or FE utility in MotionView allows you to import CAD or FE assemblies. CAD formatsinclude CATIA, Parasolid, Pro E, STEP, JT, SolidWorks and Unigraphics. FE formats includeHyperMesh, Optistruct, and Nastran. To access this utility, from the menu bar select Tools > Import

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 existingbodies, 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 withmass 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 amulti-body analysis point of view, and define constraints, model inputs and model outputs.

All the files necessary to complete this exercise are located at:

<installation_directory>\tutorials\mv_hv_hg\mbd_modeling\automation\CAD\

Please copy all the files from this folder into your <working directory>.

Page 77: Altair MotionView 11.0 Tutorials

Altair Engineering 72

Proprietary Information of Altair Engineering

MotionView 13.0 Tutorials

Step 1: Loading the CAD file into MotionView.

In this step, we will focus on understanding the process of import and model simplification.

1. Launch a New session, , of MotionView.

2. From the menu bar, select File > Import > Geometry,

Or

Click on the Import Geometry icon, , on the Standard toolbar.

The Import CAD or FE dialog is displayed.

3. Under Import Options, select Import CAD or Finite Element Model With Mass and Inertias.

4. From the Input File pull-down menu, select STEP.

5. Click the icon to select the STEP file.

6. Select the file Front Assembly.step from your <working directory>.

7. Click Open.

8. Click the Output Graphic File icon, , and specify front_assembly.h3d as the H3D filename.

9. Click Save.

Page 78: Altair MotionView 11.0 Tutorials

73 MotionView 13.0 Tutorials

Proprietary Information of Altair Engineering

Altair Engineering

10. Click the plus button, , next to MDL Options and review the various options.

Note The MDL Options allow for flexibility while importing. The CAD file can be imported eitherin an existing System/Assembly or a new System can be created

For this exercise, accept the defaults.

11. Click the plus button, , next to Meshing Options for Surface Data and review the options.

Note This option helps control the size of mesh (or tessellation). When the MBD model beingcreated is used to solve non-contact problems, use the default Allow Hypermesh tospecify mesh options. The Launch Hypermesh to create MDL points option allowsyou 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 pointsusing a Tcl Macro. The Interactive mesh (launches HyperMesh) option can be usedto mesh the surfaces manually. This is particularly useful when a finer mesh may beneeded, such as in case of contact problems, to obtain better results.

12. Click the plus button, , next to Locator Points (Must be in source reference frame) andreview the options.

Page 79: Altair MotionView 11.0 Tutorials

Altair Engineering 74

Proprietary Information of Altair Engineering

MotionView 13.0 Tutorials

Note The Locator Points options can be used in cases where the CAD model being imported isnot in the same coordinate system as the MBD model in MotionView. This option givesyou control to specify three nodes or coordinates on the source graphic which can thenbe used to orient using three points in MotionView after it's imported. This option is notneeded for tutorial as the imported graphic is in the required position. Select None fromthe options

13. Click OK.

The Import CAD dialog is displayed.

Note This dialog helps to generate mass and inertia information. The table displays differentbodies or components being imported along with the volume and mass information basedon a default density of 7.83e-6. The density value can be modified for each of thecomponents. Alternatively, a CAD summary file can be used to extract mass/inertia

14. Set Input file length to Millimeter.

15. Under Component, select Wheel_body1. In the Apply density to selected componentsfield, change the value of the density to 8.5e-7 and click Apply.

Import CAD dialog

16. Leave the default value of the density for the other components. Click OK.

Page 80: Altair MotionView 11.0 Tutorials

75 MotionView 13.0 Tutorials

Proprietary Information of Altair Engineering

Altair Engineering

17. If the import into MotionView is successful, a message box is displayed as shown below.

18. Click OK and clear 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 forCATIA summary file. Currently, summary files from other CAD packages are notsupported under this option.

Step 2: Consolidate and rename the suspension assembly bodies.

1. There are three bodies with their names prefixed with Strut_rod. These bodies in reality arejoined together and hence can be represented as one body. Having these bodies separateincreases the complexity of the model, and we are not interested in their interactions with eachother. We will merge these three bodies into one.

2. In the Project Browser, select these bodies: Strut_rod_1_body1, Strut_rod_body1 andStrut_rod_body2. Right-click to bring up the context menu.

Page 81: Altair MotionView 11.0 Tutorials

Altair Engineering 76

Proprietary Information of Altair Engineering

MotionView 13.0 Tutorials

3. Select the Merge 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.

5. The three selected bodies are deleted and replaced by a new body with the label and variablenames as entered in step 4. The mass and inertia values of this body are equivalent to theeffective mass and inertia of the bodies being replaced.

6. Repeat steps 2 to 4 for merging the bodies: Strut_tube_1_body1 and Strut_tube_body1. Enterthe label as Strut_tube and variable name as b_Strut_tube for the new body to be created..

7. From the Project Browser, select Wheel_body1 (Wheel part) .

8. Press F2 or right-click on Wheel_body1 and select Rename.

9. Change the label of the selected body to Wheel.

Page 82: Altair MotionView 11.0 Tutorials

77 MotionView 13.0 Tutorials

Proprietary Information of Altair Engineering

Altair Engineering

10. Similarly, rename the following parts:

S. No Original Label New Label

1 Wheel_Hub_body1 Wheel_Hub

2 Lower_Control_Arm_body1 Lower_Control_Arm

3 Axle_Shaft_body1 Axle_Shaft

11. Save the model as front_susp.mdl.

Notes on the Merge Bodies option:

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 Pair bodies cannot be 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 willnot 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.

Page 83: Altair MotionView 11.0 Tutorials

Altair Engineering 78

Proprietary Information of Altair Engineering

MotionView 13.0 Tutorials

Step 3: Create points.

After creating the bodies, additional points are needed that will be used to specify joint locations andjoint orientations. These points can be created using the macros available in the Macros menu.

1. From the Macros menu, select Create Points > Using Coordinates or click the Create points

using Coordinates icon, .

Page 84: Altair MotionView 11.0 Tutorials

79 MotionView 13.0 Tutorials

Proprietary Information of Altair Engineering

Altair Engineering

2. Click to load a point table file.

3. Select the file suspension_points.csv from your working directory.

4. Click Open. All the point coordinates in the CSV file are imported into the utility.

5. Specify Varname prefix as p_susp.

Page 85: Altair MotionView 11.0 Tutorials

Altair Engineering 80

Proprietary Information of Altair Engineering

MotionView 13.0 Tutorials

6. Click OK.

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:

1st Column - X coordinates.

2nd Column - Y coordinates.

3rd Column - Z coordinates.

7. Save the model, .

Step 4: Creating joints and spring damper.

In this step, we will add the joints to connect the bodies and a spring damper between Strut tube andStrut rod.

1. From the Project Browser, right-click Model and select Add > Constraint > Joint (or right-click

the Joints icon, , from the toolbar).

The Add Joint or JointPair dialog is displayed.

2. Specify the Label and Variable as Wheel Spindle RJ and j_whl_spindle_revj, respectively.

3. For Type, select Revolute Joint.

4. Click OK.

Page 86: Altair MotionView 11.0 Tutorials

81 MotionView 13.0 Tutorials

Proprietary Information of Altair Engineering

Altair Engineering

5. For Body1 of the joint, specify Wheel.

For Body2, specify Wheel_Hub.

For Origin, specify Point7. (Point around the Wheel center).

For Axis, specify Point19. (Point around Axle Shaft center).

6. Add the rest of the joints of the model using the table below:

S.No

Label Type Body 1 Body 2 Origin(s) OrientationMethod

Reference 1

Reference 2

1 Strut HubFix

Fixed Joint Wheel_Hub Strut_rod Point8

2 StrutTrans

TranslationJoint

Strut_rod Strut_tube Point23 Axis(Pt) Point9

3 StrutTubeGround UJ

Universal Joint Strut_tube GroundBody

Point9 Shaft(Pt)

Shaft(Vect)

Point23 Global X

4 Axle HubFix

Fixed Joint Axle_Shaft Wheel_Hub Point19

5 HubControlArm Ball

Ball Joint Lower_Control Arm

Wheel_Hub Point3

6 ControlArmGroundRev

Revolute Joint Lower_Control Arm

GroundBody

Point1 Axis(Pt) Point2

7. From the Project Browser, right-click Model and select Add > Force Entity > Spring Dampers

(or right-click the Spring damper icon, , from the toolbar).

8. Specify the Label and Variable as Strut-SpringDamper and sd_strut, respectively.

9. Check Create explicit graphics check-box to create an explicit graphic for the spring damperentity.

10. Click OK.

Page 87: Altair MotionView 11.0 Tutorials

Altair Engineering 82

Proprietary Information of Altair Engineering

MotionView 13.0 Tutorials

11. For Body1 and Body2, specify Strut_tube and Strut_rod, respectively.

12. For Point1 and Point2, specify Point9 and Point0, respectively.

13. Click the Properties tab and specify a stiffness (K linear) of 10 and damping (C linear) of

0.1.

14. Save the model.

Step 5: Add a Jack to the model.

1. Next, add a jack to this model and use the jack exercise the wheel through a vertical motion. From the Project Browser, right-click Model and select

Add >Reference Entity > Body (or right-click the Bodies icon, , from the toolbar). Add abody 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 thebody 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 thegraphic as Jack Plate and select the Type as Cylinder from the drop-down menu.

6. Accept the default variable.

7. From the Connectivity tab, select the Parent Body as Jack.

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.

10. Specify a value of 250 for Radius 1.

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.

12. Click OK.

13. From the Connectivity tab, select Wheel as Body1, select Jack as Body2, pick Point10 asOrigin 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.

15. Click OK.

16. From the Connectivity tab, select Jack as Body1, Ground Body as Body2, pick Point10 asOrigin and Vector Global Z as the Alignment Axis.

17. All the joints required to complete the model are now in place.

Page 88: Altair MotionView 11.0 Tutorials

83 MotionView 13.0 Tutorials

Proprietary Information of Altair Engineering

Altair Engineering

18. Save the model.

Front suspension

Step 6: Specifying motion inputs and running the model in MotionSolve.

In this step, we will create a motion that is applied to the jack and solve the model.

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 andGround 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 labeland variable name as Wheel Spindle and mot_wheel, respectively.

5. From the Connectivity tab, select Wheel Spindle RJ as the Joint.

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.

7. Save the model.

8. Click Check Model toolbar. In the Message Log that is displayed, verify that there are no

warnings or errors. Clear the message log.

Page 89: Altair MotionView 11.0 Tutorials

Altair Engineering 84

Proprietary Information of Altair Engineering

MotionView 13.0 Tutorials

9. Go to the Run panel, .

10. Specify a name for the MotionSolve input XML file by clicking the Save and run current model

icon, .

11. From the Simulation type: drop-down menu, select Static+Transient.

12. Click Run.

13. Once the run is complete, click Animate to view the animation of the simulation.

Page 90: Altair MotionView 11.0 Tutorials

85 MotionView 13.0 Tutorials

Proprietary Information of Altair Engineering

Altair Engineering

MV-1011: Extension and Retraction Analysis of theMain Landing Gear of an Aircraft

In this tutorial, you will learn how to create a sequential simulation script to simulate the extensionand retraction of the landing gear.

Sequential Simulation

Often, the total dynamic behavior of a multi-body model needs to be captured through more than onesolution sequence. Typical examples include:

1. The model configuration changes after a certain amount of time.

2. One type of analysis has to occur before the other. For example, a static solution is requiredbefore a dynamic run.

3. Complex models may not solve with a single solver setting. The solver settings may need to bechanged 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 theabove type of sequences. Such simulations are referred to as sequential simulations. Generally,the solver receives more than one solution (simulate) command. You’ll learn to script such asimulation sequence through this exercise.

Exercise

In this exercise, a landing gear mechanism is simulated for its extension and retraction. A sequence ofsimulations need to be scripted such that the mechanism is retracted within a certain period of time atwhich the simulation is halted, the model configuration is changed for retraction and the solution isexecuted again for extension.

Page 91: Altair MotionView 11.0 Tutorials

Altair Engineering 86

Proprietary Information of Altair Engineering

MotionView 13.0 Tutorials

Main Landing gear of an aircraft

Note Copy the files MainLandingGear.mdl, Aircraft_Structure.hm and MainLandingGear.h3d

from the location <installation_directory>\tutorials\mv_hv_hg\mbd_modeling\interactive\aero to

your <Working directory>.

Phase 1

In this phase, you will prepare the landing gear model to simulate the retraction of the landing gear.

Step 1: Opening the landing gear mechanism.

In this step, you will open a landing gear model and attach a graphic for the aircraft body.

1. From the Model-Main toolbar, click the Open Model icon, .

Or

Open model by selecting File > Open > Model.

Page 92: Altair MotionView 11.0 Tutorials

87 MotionView 13.0 Tutorials

Proprietary Information of Altair Engineering

Altair Engineering

2. From the Open model dialog, select the file MainLandingGear.mdl and click Open.

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 linkagesfor the extension and retraction of the whole landing gear unit within the aircraft body. Themodel also contains a body defined for aircraft but without graphics. As a first step, you’ll add agraphic for the aircraft body part for visual representation.

Main landing gear mechanism

Use a HyperMesh file to create a graphic for the aircraft body.

3. From the Tools menu, select the Import CAD or FE utility.

4. Select the option Import CAD or Finite Element Model Only. With this selection, only thegraphics 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 fileAircraft_Structure.hm as the input file.

7. Save the file as Aircraft_Structure.H3D in the working directory.

8. Click OK.

9. When the H3D file is generated and the graphic is imported, the import success message isdisplayed. Click OK.

Page 93: Altair MotionView 11.0 Tutorials

Altair Engineering 88

Proprietary Information of Altair Engineering

MotionView 13.0 Tutorials

10. Click the Graphics icon in the MotionView toolbar.

The model after importing a graphic for the aircraft body.

11. Select the just-added graphic from the Graphic area. The panel for the aircraft body is displayed

12. From the Connectivity tab

Resolve the Body collector to Aircraft 5.

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.

Page 94: Altair MotionView 11.0 Tutorials

89 MotionView 13.0 Tutorials

Proprietary Information of Altair Engineering

Altair Engineering

Step 2: Defining a motion to retract the landing gear.

In this step, define the motion to retract the landing gear.

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 andActivating Piston.

Rev joint

2. From the Motion panel > Properties tab, under Define by, select Expression. In theExpression 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 5seconds. For more information on this solver function available within MotionSolve, please referthe RADIOSS, MotionSolve and Optistruct on-line help.

Page 95: Altair MotionView 11.0 Tutorials

Altair Engineering 90

Proprietary Information of Altair Engineering

MotionView 13.0 Tutorials

3. Add another motion and name it Aligning_Motion. Resolve the Joint to the Cylinderical Joint

LnkCyl_LnkPis_Cyl defined between the MLG Cyl and MLG Pis bodies (see the image below).

Translation joint

4. From the Properties tab of the panel, under Define by, select Expression. In the Expressionfield, enter the expression `STEP(TIME,0,0,2,-100)`.

5. Save your model as landinggear_motion.mdl.

Step 3: Running a dynamic analysis to simulate the retraction of the mainlanding gear.

In this step, run a transient analysis of the main landing gear mechanism.

1. In the Run panel, set the End time to 5 seconds.

2. Click the Save and run current model browser button and enter the name for the run file aslg_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.

Page 96: Altair MotionView 11.0 Tutorials

91 MotionView 13.0 Tutorials

Proprietary Information of Altair Engineering

Altair Engineering

Phase 2

In this phase, write a Templex template to script and run a sequential simulation to simulate theretraction and extension of the landing gear mechanism.

Step 1: Defining an extension motion for the landing gear.

In this step, model the extension motion of the landing gear.

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) `.

Step 2: Defining a template to run the sequential simulation.

In this step, write a template to script a sequential simulation.

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 andVarname and click OK.

2. For Type, select Write text to solver command file.

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. Sincethe 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 textcould differ.

<!—-Deactivate the extension motion first -->

<Deactivate

element_type = "MOTION"

element_id = "{MODEL.mot_ext.idstring}"

/>

<!—-Simulate for 5 seconds -->

<Simulate

analysis_type = "Transient"

end_time = "5.0"

Page 97: Altair MotionView 11.0 Tutorials

Altair Engineering 92

Proprietary Information of Altair Engineering

MotionView 13.0 Tutorials

print_interval = "0.01"

/>

<!—-Deactivate the retraction motion -->

<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 for 5 more seconds -->

<Simulate

analysis_type = "Transient"

end_time = "10.0"

print_interval = "0.01"

/>

<STOP/> <!—- Stop the simulation. Any further commands below this command willnot be executed -->

The above script has five blocks.

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 3 – Deactivates the motion used to retract 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.

Page 98: Altair MotionView 11.0 Tutorials

93 MotionView 13.0 Tutorials

Proprietary Information of Altair Engineering

Altair Engineering

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 assimulation parameters, activation and deactivation, and so on. The MotionSolve XML is dividedinto two sections.

1.Model section: All model elements are defined. To write to this section from the template, for Type select Write text to Solver input deck.

2. Command section: Commands for the solver simulation are defined. To write to this sectionfrom the template, for Type select Write text to Solver command file.

Step 3: Simulating and animating the model.

In this step, run the model to simulate the retraction and extension of the main landing gear modeland animate it.

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.

3. Click the Animate button and review the animation.

Phase 3

In this phase, you will create output requests and re-run the model to measure the AngularDisplacement and Angular Velocity of the landing gear.

1. From the Project Browser, right-click on Model and select Add > General MDL Entity >

Outputs (or right-click the Outputs icon, , from the toolbar).

2. Create an output request. From the Outputs panel:

Set Type to Displacement and Entity.

Use the drop-down menu to select the Joint collector.

For the Joint, select the Revolute Joint between the Main LG Cylinder and Aircraft-5,MLG_Ac_Rev.

3. Create another output request to measure the velocity at the same joint as above.

Page 99: Altair MotionView 11.0 Tutorials

Altair Engineering 94

Proprietary Information of Altair Engineering

MotionView 13.0 Tutorials

4. Re-run the analysis with these output requests and plot the requested results from the generatedPLT file in HyperGraph.

5. Save your model and exit your HyperWorks session.

Page 100: Altair MotionView 11.0 Tutorials

95 MotionView 13.0 Tutorials

Proprietary Information of Altair Engineering

Altair Engineering

Animation

MV-5000: Rigid body Animation - Basic

MV-5010: Rigid body Animation - Advanced

Page 101: Altair MotionView 11.0 Tutorials

Altair Engineering 96

Proprietary Information of Altair Engineering

MotionView 13.0 Tutorials

MV-5000: Rigid body Animation - Basic

Introduction

In this tutorial, you will learn how to:

Use some features available for post-processing animation results in HyperView

Control the display of the simulation results using Entity Attributes

HyperWorks animation functions allow you to view your model in motion. The three animation typesinclude transient, linear, and modal. You can select the animation type from the animation typesdrop-down menu.

Animation types menu

Transient Transient animation displays the model in its time step positions ascalculated by the analysis code. Transient animation is used toanimate the transient response of a structure or multi-body system.

Linear Linear animation creates and displays an animation sequence thatstarts with the original position of the model and ends with the fullydeformed position of the structure or multi-body system. Anappropriate number of frames are linearly interpolated between the firstand last positions. Linear animation is usually selected when results arefrom a static analysis.

Modal Modal animation creates and displays an animation sequence thatstarts and ends with the original position of the structure or multi-bodysystem. The deforming frames are calculated based on a sinusoidalfunction. Modal animation is most useful for displaying mode shapes.

Page 102: Altair MotionView 11.0 Tutorials

97 MotionView 13.0 Tutorials

Proprietary Information of Altair Engineering

Altair Engineering

Multi-body Analysis Types, Animation Mode Settings, and File Types

The tables below show the animation analysis types, mode settings, and the model and results filetypes required to animate MotionSolve and Adams results.

Multi-bodyAnalysis Type

Animation Mode Setting

Parts in Model ModelFile

ResultsFile

Transient/Static/Quasi-Static Transient Rigid or Flexible Bodies H3D H3D

Linear Modal Rigid or Flexible Bodies H3D H3D

Animation Information for MotionSolve Results

Multi-bodyAnalysis Type

Animation Mode Setting

Parts in Model ModelFile

ResultsFile

Transient/Static/Quasi-Static Transient Purely rigid GRA GRA

Transient/Static/Quasi-Static Transient One or more flexible bodies FLX FLX

Linear Modal Purely rigid GRA RES

Linear Modal One or more flexible bodies FLX FLX

Animation Information for Adams Results

Step 1: Viewing and Controlling Animation Files.

In this exercise, you will view and control the pendulum animation based on the files output by MotionSolve.

Note Copy all the h3d files from the location <installation_directory>\tutorials\mv_hv_hg

\mbd_modeling\animation\ 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 tocontinue.

2. Click the Select application drop-down menu, , from the toolbar, and select HyperView

.

Page 103: Altair MotionView 11.0 Tutorials

Altair Engineering 98

Proprietary Information of Altair Engineering

MotionView 13.0 Tutorials

3. Click the Load Results icon, , from the Standard toolbar.

The Load model and results panel is displayed.

Load model and results panel

4. Click the file browser icon, , next to Load model and select the model file assingle_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.

HyperView loads the animation file.

7. Click the XZ Left Plane View icon on the Standard Views toolbar to change to the left viewof 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 theentire animation in the window.

10. Click the Animation Controls icon, , on the Animation toolbar.

From this panel, you can control the parameters like speed, start time, end time of the animation.

Animation Controls panel

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 certainwindow 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.

Page 104: Altair MotionView 11.0 Tutorials

99 MotionView 13.0 Tutorials

Proprietary Information of Altair Engineering

Altair Engineering

11. Click the Start/Pause Animation icon, , on the Animation toolbar to stop the animation.

Step 2: Tracing Entities.

HyperView allows you to trace the path of any moving part while animating.

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.

5. Change the view to the Iso view.

6. Under Tracing mode: select Last and specify 10 as the steps.

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 thetracing list.

9. Try the From First Step and All Steps options.

10. Use the Display Options to change the line color and thickness.

Step 3: Tracking Entities.

The Tracking option allows one of the parts of the animation to be fixed to the center of theanimation window and the rest of the parts move relative to the tracked part.

1. Add a new page to the session by clicking on the Add page button, , on the Page Controlstoolbar.

2. Load the animation file front_ride.h3d from your working directory.

Page 105: Altair MotionView 11.0 Tutorials

Altair Engineering 100

Proprietary Information of Altair Engineering

MotionView 13.0 Tutorials

3. To Track or fix any part of your model in the center of the animation window and to see all the

other parts moving with respect to the fixed part, click on the Tracking, , button on theResults 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 currentlyloaded.

6. Select the Displacements and/or Rotations to track the part.

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.

Step 4: Editing Entity Attributes.

In this exercise, you will edit the graphic entity attributes.

1. Retain the model front_ride.h3d loaded in the previous exercise Step 3 above.

2. Click the Entity Attributes icon, , on the Visualization toolbar.

The Entity Attributes panel is displayed.

Entity Attributes panel

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, andSets.

4. Select Assembly Hierarchy from this list to show all the parts of the model in the entity list treebelow.

Page 106: Altair MotionView 11.0 Tutorials

101 MotionView 13.0 Tutorials

Proprietary Information of Altair Engineering

Altair Engineering

5. To change the color of the entire model:

Select Assembly Hierarchy from the Entity option menu.

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.

6. To change the entire model to wire frame:

Click All from the list of buttons next to the entity list tree.

Click the Wire Frame icon, , beside Shaded.

7. To make the entire model transparent and shaded:

Click All from the list of buttons next to the entity list tree.

Click the Shaded icon, .

Click the Transparent icon, .

8. Use the On/Off buttons to turn the entities on or off.

9. Use the On/Off buttons next to ID: to display and hide the entity IDs.

Page 107: Altair MotionView 11.0 Tutorials

Altair Engineering 102

Proprietary Information of Altair Engineering

MotionView 13.0 Tutorials

MV-5010: Rigid body Animation - Advanced

Introduction

In this tutorial, you will learn how to:

View force and moment vectors from a MotionSolve results file.

Use the collision detection feature

Use the measure panel to extract information from the animation results

Step 1: Force and Moment Graphics.

HyperView allows you to view the change in force and moment in the form of dynamic vectors thatrepresent the magnitude and direction of the force and moment.

Copy all the h3d files from the location <installation_directory>\tutorials\mv_hv_hg

\mbd_modeling\animation\ to your <working directory>.

1. Start a new MotionView session or refresh your MotionView session by pressing SHIFT+F9.

2. Change the application on the page to HyperView.

3. Load the MotionSolve result file front_ride.h3d from your working directory.

4. Click on Vector icon, , on the toolbar.

Vector panel

5. Under the Result type: select Force (v).

6. Under Display options: select By Magnitude for Size scaling.

7. Click on Apply.

8. Now, animate the results by clicking on the Start/Pause Animation button, .

9. You will see an arrow whose size and direction change dynamically as the simulation is animatedfrom start to end. This arrow represents the magnitude and direction of force on a body or at ajoint as it is specified for force output in the model.

10. Click on the Clear Vector button to clear the force vector.

Page 108: Altair MotionView 11.0 Tutorials

103 MotionView 13.0 Tutorials

Proprietary Information of Altair Engineering

Altair Engineering

11. For the Result type: now select Moment (v).

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.

Step 2: Using the Collision Detection Option.

1. Click the Add a page button, , from the toolbar.

2. Use the Select Application menu to select HyperView as the application.

3. Click the Load Results icon, on the toolbar.

The Load Model and Results panel is displayed.

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.

7. Click the Start/Pause Animation icon, , to animate the model.

8. After the file is read, click the Start/Stop Animation icon, , to stop the animation.

Page 109: Altair MotionView 11.0 Tutorials

Altair Engineering 104

Proprietary Information of Altair Engineering

MotionView 13.0 Tutorials

9. Click the Collision Detection button, on the Tools toolbar (if this toolbar is not visible bydefault, go to the View menu and select Toolbars > HyperView > Tools).

The Collision Detection panel is displayed.

Collision Detection panel

10. Click the Add button in the leftmost column under Collision Sets to add a new collision set.

11. Pick the Trunk body in the graphics area.

Note Clicking on the Components input collector will display the Extended Entity Selectiondialog. The Extend Entity Selection dialog provides you with criteria based selectionoptions available for entity selection in HyperView. This method of selection is not usedin this tutorial. See the Selecting Entities Using the Input Collector topic (located in theHyperView User's Guide) to learn more about using this selection method.

12. Click the Add to Group A button.

13. Next, pick the Car body in the graphics area.

14. Click the Add to Group B button.

15. Under the Proximity section, click Enable Proximity checking and specify the MinimumDistance for the proximity check.

Page 110: Altair MotionView 11.0 Tutorials

105 MotionView 13.0 Tutorials

Proprietary Information of Altair Engineering

Altair Engineering

16. Under the Show result by: section select Elements by clicking on the radio button next to it.

17. Click Apply.

18. Click the Start/Pause Animation icon, , to start the animation.

The animation begins.

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 bodiesretain their natural colors.

19. Stop the animation.

20. Try these additional steps:

Try to view the Element and Component results alternately by clicking on the radio buttons inthe Show Results by: section.

Click on Summary below to get a text summary of the penetration.

Step 3: Using the Measure Panel.

HyperView allows you to measure certain parameters during post processing of the results.

Refresh your MotionView session by pressing SHIFT+F9.

Note Please refer to HyperView tutorial Using Keyboard Shortcuts and Function Keys - HV-2050 formore information regarding keyboard shortcuts.

1. Change the Application to HyperView.

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.

4. Under Measure Groups click on Add to add a Measure Group.

5. From the measure type pull-down menu select Position.

6. Click on the Nodes button and from the graphic window pick on a point of your choice.

7. Turn on the check boxes for X, Y and Z.

Page 111: Altair MotionView 11.0 Tutorials

Altair Engineering 106

Proprietary Information of Altair Engineering

MotionView 13.0 Tutorials

8. Click the Create Curves button (located on the right side of the panel).

The Create Curves dialog is displayed.

9. From the Place on drop-down menu select New Plot.

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 youanimate the current animation model a small square marker moves on the measured curveto indicate the value of the curve at the corresponding time step of the animation.

11. Click OK.

12. Repeat Point 10 and 11 twice more by selecting Y and Z respectively and clicking on OK eachtime.

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.

For more advanced animation options, refer to the HyperView tutorials.

Page 112: Altair MotionView 11.0 Tutorials

107 MotionView 13.0 Tutorials

Proprietary Information of Altair Engineering

Altair Engineering

Plotting

MV-6000: Plotting Basics

Page 113: Altair MotionView 11.0 Tutorials

Altair Engineering 108

Proprietary Information of Altair Engineering

MotionView 13.0 Tutorials

MV-6000: Plotting Basics

Introduction

In this tutorial you will learn to:

Import a MotionSolve result (plot) file for plotting curves

Plot multiple curves in a single window

Plot multiple curves in different windows on a single page

Save your work as a session (mvw) file

Theory

The Build Plots panel allows you to import plot files that can be plotted in a 2D layout. The panelallows 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, HyperViewor HyperGraph.

Copy the file<installation_directory>\tutorials\mv_hv_hg\mbd_modeling\plotting\Demo.plt to your

<working directory>.

Step 1: Opening a plot file.

1. Start a new MotionView session.

2. Select HyperGraph 2D from the Select application menu, , on the toolbar.

The toolbar is located right below the plot window.

3. Click the Build Plots icon, , on the toolbar.

4. Click the Open File icon, , on the Build Plots panel.

5. Select the file <working directory>\Demo.plt.

6. Click Open.

This file contains several curves.

7. Confirm that Time is selected under X Type:.

8. For Y Type: click on Displacement to select it.

The Y Request text box displays the data available in the file.

9. Click the Y Request expansion button to view the Y Request list.

Page 114: Altair MotionView 11.0 Tutorials

109 MotionView 13.0 Tutorials

Proprietary Information of Altair Engineering

Altair Engineering

10. Press CTRL button on the keyboard and click on REQ/70000006 and REQ/70000007 (or left-click and drag the mouse to select both REQ/70000006 and REQ/70000007). Click OK.

11. Select X under Y Component:.

12. Set Layout as one plot per Component.

13. Click Apply.

Two curves are plotted in the plot window, each with its own line type and color. The legendidentifying 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.

1. Stay in Build Plots panel.

2. Leave Time selected under X:.

3. Leave Displacement selected under Y Type:.

4. Leave REQ/70000006, and REQ/70000007 selected under Y Request:.

5. Press CTRL and under Y Component: select X, Psi, MAG and RMAG.

Page 115: Altair MotionView 11.0 Tutorials

Altair Engineering 110

Proprietary Information of Altair Engineering

MotionView 13.0 Tutorials

6. Select One plot per Component from the Layout pull down menu , located in the lower leftcorner of the panel.

This selection creates one plot for every request selected under Y component. There will befour plots created. You could have one page for each plot. However, this tutorial wants all fourplots on the same page.

7. Click the Page Layout button , located next to the Show Legends check box.

8. Select the four window layout option .

The Page Layout dialog automatically closes.

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.

Page 116: Altair MotionView 11.0 Tutorials

111 MotionView 13.0 Tutorials

Proprietary Information of Altair Engineering

Altair Engineering

Step 3: To save this work session.

You can save your work with multiple curves in multiple windows on multiple pages as a session file. Asession allows later retrieval either for display, printing, or to continue adding more information. Thesession file is a script with the extension .mvw. The contents of an .mvw file are all the information in

the program that gets recorded in the script file.

Note To save a session as a script file with curve data: select the Options panel icon from theAnnotations toolbar, and activate the Save All Curve Data To Script File check box (locatedon the Session tab).

1. From the File menu, select Save As > Session.

2. Select a directory.

Page 117: Altair MotionView 11.0 Tutorials

Altair Engineering 112

Proprietary Information of Altair Engineering

MotionView 13.0 Tutorials

3. In the File name text box type Demo1.mvw.

Save Session As dialog

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.

Step 4: To exit the program.

1. From the File menu, select Exit.

A dialog displays prompting you to save the session.

2. Click No, since you saved the session in the previous step.

For more advanced plotting options, refer to the HyperGraph tutorials.

Page 118: Altair MotionView 11.0 Tutorials

113 MotionView 13.0 Tutorials

Proprietary Information of Altair Engineering

Altair Engineering

Model Definition Language

MV-1060: Introduction to MDL

MV-1070: Creating a Simple Pendulum System using MDL

MV-1080: Creating an Analysis using MDL

MV-1090: Creating a Dataset using MDL

MV-1030: Creating a System Definition Using the MotionView GUI

Page 119: Altair MotionView 11.0 Tutorials

Altair Engineering 114

Proprietary Information of Altair Engineering

MotionView 13.0 Tutorials

MV-1060: Introduction to MDL

In this tutorial, you will learn how to:

Create a model using the Model Definition Language (MDL).

Run a dynamic simulation of this model for a time of 2 seconds and 500 steps.

Plot the rotation of the pendulum about the global X-axis and view the animation.

MDL stands for Model Definition Language. A MotionView model is an object that holds the informationin the form of this language which is required to describe a mechanical system. The completeinformation about the model is stored in the MDL format. MDL is an ASCII programmable language.

Some benefits of MDL include:

Opening and editing in any text editor

Assisting with model debugging

Using conditional statements "if" for custom modeling requirements

Building modular and reusable models

Parameterizing the models

Use modeling entities which are not available through GUI (for example, CommandSets)

Section 1: Entities in MDL

A modeling entity is saved to MDL in the form of MDL statements. All MDL statements begin with anasterisk (*).

There are two types of entities:

General Entities

Definition Based Entities

General Entities

Have one statement to define the entity. They may have one or more statements to set theirproperties.

Some examples include points, bodies, joints, etc.

Each general entity has certain properties consistent with its type. For example, a point hasthe properties x-coordinate, y-coordinate, z-coordinate, label, state, and varname (variablename).

Page 120: Altair MotionView 11.0 Tutorials

115 MotionView 13.0 Tutorials

Proprietary Information of Altair Engineering

Altair Engineering

Definition Based Entities

Are defined through a block statement, called definition, and its instance is created in a modelby 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 instantiatedseveral 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

System A system entity defines a collection of modeling entities. Thesedefinitions may be used repeatedly within the same model or differentMDL model files. A model can be organized into different systems. Examples of system entities include SLA suspension system, wiper bladesystem, and power-train system. Systems can be hierarchical in nature(for example, a system can be a child of another system).

Assembly An assembly is similar to a system entity, except that the definitionresides in a separate file than the model file.

Analysis An analysis is a collection of entities (bodies, joints, etc.) describing aparticular analysis task or event applied to a model. For example, astatic ride analysis is one of the analysis that can be applied to a model. An analysis can only be instantiated under Model (the top level rootsystem). A system can be a child of an analysis, however the reverse isnot true.

Dataset A dataset is a collection of user-defined variables of type integer, real,string, Boolean, or filename. These variables can be referred orparameterized to other entity properties. Datasets are displayed in atabular form, thereby offering a single window to modify a model. Generally, design variables are collectively defined in the form of adataset. A dataset can be instantiated within a system or an analysis.

Template A template is a utility that uses the Templex program in HyperWorks. It can be used to create user-defined calculations and codesembedded into the model. The output of such code can be written outto solver deck or execute another program. Another use is toimplement solver statements and commands not supported by MDL andto generate text reports.

Note The system, assembly, and analysis are together referred to as container entities (or simplycontainers).

Page 121: Altair MotionView 11.0 Tutorials

Altair Engineering 116

Proprietary Information of Altair Engineering

MotionView 13.0 Tutorials

Section 2: Properties of Entities

Each entity has variable, label, and other properties associated with it.

Each entity should have a unique variable name.

Following is the recommended convention for variable names which allows the user to identifythe modeling entity during debugging. You are not restricted to this nomenclature, howeveryou are encouraged to adopt it.

This list of entities and their properties is not comprehensive. For a complete list, refer to the MDLLanguage Reference on-line help.

General Entities Naming Convention Properties

Point p_ x, y, z, label, state, varname

Body b_mass, IXX, IYY, IZZ, IXY, IYZ, IXZ, cg,cm, im, lprf, label, state, varname

RevJoint j_ b1, b2, i, j, id

Vector v_ x, y, z, label, state, varname

Marker m_ body, flt, x-axis, y-axis, z-axis, origin

ActionReactionForce frc_ b1, b2, fx, fy, fz, id, tx, ty, tz

General entities, their naming conventions, and properties

Definition Based Entities Naming Convention Properties

System sys_ Label, varname, state

Analysis ana_ Label, varname, state

Dataset ds_ Label, varname, state

Template tmplt_ Label, varname, state

User-defined entities, their naming conventions, and properties

Page 122: Altair MotionView 11.0 Tutorials

117 MotionView 13.0 Tutorials

Proprietary Information of Altair Engineering

Altair Engineering

To access entity properties; use the entity varname, followed by a dot separator, followed by theproperty. Below are some examples:

Entity Varname Varname Represents

b_knuckle A body representing the knuckle in the mechanical system.

p_knuckle_cg A point representing the center of mass point for the knuckle body.

Entity Property Name Property Accessed

b_knuckle.cm The center of mass marker of the knuckle body, b_knuckle.

b_knuckle.cm.idThe ID of the center of mass marker of the knuckle body, b_knuckle.

p_knuckle_cg.x The x coordinate of p_knuckle_cg.

Section 3: Global Variables

MotionView comes with Global Variables, by default, which are available for use anywhere in themodel. These variables are case sensitive.

The table below lists some commonly used keywords and what they represent:

Keyword Refers to

B_Ground Ground body

P_Global_Origin Global Origin

V_Global_X, V_Global_Y, V_Global_Z Vectors along the global XYZ axes

Global_Frame Global reference marker

MODELReference to the top level system of themodel

Common keywords in MotionView

Page 123: Altair MotionView 11.0 Tutorials

Altair Engineering 118

Proprietary Information of Altair Engineering

MotionView 13.0 Tutorials

Section 4: MDL Statement Classification

Topology statements

These are statements that define an entity and establish topological relation between one entity andthe 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.

Property or Set Statements

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.

Definition and Data

Building upon the concept of a definition block, these terminologies are used specifically with regard tocontainer 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:

1. Topology statements that define entities.

2. Set statements that assign properties. These Set statements within a definition block arecalled "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.

2. Some of the *Begin statements, such as *BeginAssemblySelection and *BeginAnalysis.

Section 5: MDL Model File Overview

MDL model file is an ASCII file; it can be edited using any text editor.

All statements in a model are contained within a *BeginMDL() - *EndMDL() block.

The syntax of the MDL statement is an asterisk (*) followed by a valid statement with itsarguments defined.

Statements without a leading asterisk (*) are considered comments. In this tutorial, commentstatements are preceded by // to improve readability. The comments are not read in by theMotionView graphical user interface and are removed if the model MDL is saved back or savedto a different file.

MDL accepts statements in any order, with a few exceptions.

Page 124: Altair MotionView 11.0 Tutorials

119 MotionView 13.0 Tutorials

Proprietary Information of Altair Engineering

Altair Engineering

To help you learn this language, the code in the tutorial examples will follow this structure:

//comments about the MDL file

*BeginMDL(argument list)

//Topology section

*Point…

*Body…

*System(…)

// definitions sub-section

*DefineSystem(..)…

..

.*EndDefine()

//Property of entities directly in *BeginMDL()//Property section for entitieswithin Systems and analysis

*BeginContext()

..

..

*EndContext()

.

*EndMDL

Exercise: Build a Pendulum Model using MDL Statements

The figure below shows the schematic diagram of a pendulum. The pendulum is connected to theground through a revolute joint at the global origin. The pendulum falls freely under gravity, whichacts in the negative global-Z direction. Geometry and inertia properties are shown in the figure. Thecenter of mass of the pendulum is located at (0, 10, 10).

Schematic representation of the pendulum

Page 125: Altair MotionView 11.0 Tutorials

Altair Engineering 120

Proprietary Information of Altair Engineering

MotionView 13.0 Tutorials

The following MDL statements are used in this exercise:

*BeginMdl()

*EndMdl()

*Point()

*Body()

*Graphic() - cylinder

*Graphic() - sphere

*RevJoint()

*Output() - output on entities

*SetPoint()

*SetBody()

Step 1: Create an MDL model file.

1. In a text editor, create the following comment statements describing the purpose of the MDLmodel file:

//Pendulum falling under gravity

//date

2. Create a *BeginMdl() - *EndMdl() block to signify the beginning and end of the MDL model file.

Create all other MDL model file statements between these block statements:

The syntax for the *BeginMdl() statement is:

*BeginMdl(model_name, "model_label")

where

model_name The variable name of the model.

model_label The descriptive label of the model.

For this model, use:

*BeginMdl(pendulum, "Pendulum Model")

*EndMdl()

It is strongly recommended that you look for the syntax of the corresponding statements byinvoking the online Help and typing the statement in the Index. In MDL statements, only thekeywords are case sensitive.

Page 126: Altair MotionView 11.0 Tutorials

121 MotionView 13.0 Tutorials

Proprietary Information of Altair Engineering

Altair Engineering

Step 2: Create the entity declarations required for the problem.

1. Create a point where the pendulum pivot would be placed using a *Point() statement. The

syntax is:

*Point(point_name, "point_label", [point_num])

where:

point_name The variable name of the point.

point_label The descriptive label of the point.

point_num An optional integer argument assigned to thepoint as its entity number.

For this problem, you will need point_name and point_label.

//Points

*Point(p_pendu_pivot, "Pivot Point")

2. Using the same *Point statement create another point which would be pendulum center of mass:

*Point(p_pendu_cm, "Pendulum CM")

3. Use the *Body() statement to define the ball’s body. The syntax is:

*Body(body_name, "body_label", [cm_origin], [im_origin], [lprf_origin],[body_num])

where:

body_name The variable name of the body.

body_label The descriptive label of the body appearing in thegraphical display of the body.

cm_origin An optional argument for the center of mass point ofthe body.

im_origin An optional argument for the origin point of the inertiamarker of the body.

lprf_origin An optional argument for the origin point of the localpart reference frame of the body.

body_num An optional integer argument assigned to the body asits entity number.

Square brackets,[ ], in the description of any statement syntax means that an argument is

optional.

Page 127: Altair MotionView 11.0 Tutorials

Altair Engineering 122

Proprietary Information of Altair Engineering

MotionView 13.0 Tutorials

This problem requires body_name, body_label, and cm_origin.

//Bodies

*Body(b_link, "Ball", p_pendu_cm)

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.

Statement syntax for sphere graphics:

*Graphic(gr_name, "gr_label", SPHERE, body, origin, radius)

where:

gr_name The variable name of the graphic.

gr_label The descriptive label of the graphic.

SPHERE This argument indicates that the graphic is a sphere.

body The body associated with the graphic.

origin The location of center point of the sphere.

radius The radius of the sphere.

For this exercise, use all of the arguments. The statement is:

//Graphics for sphere

*Graphic(gr_sphere, "pendulum sphere graphic", SPHERE, b_link, p_pendu_cm, 1)

Statement syntax for cylinder graphics:

*Graphic(gr_name, "gr_label", CYLINDER, body, point_1, POINT|VECTOR,orient_entity, radius, [CAPBOTH|CAPBEGIN|CAPEND])

where

gr_name The variable name of the graphic.

gr_label The descriptive label of the graphic.

CYLINDER This argument indicates that the graphic is a cylinder.

body The body associated with the graphic.

Point1 The location of one end of the cylinder.

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.

Page 128: Altair MotionView 11.0 Tutorials

123 MotionView 13.0 Tutorials

Proprietary Information of Altair Engineering

Altair Engineering

orient_entity The variable name of the entity for orienting the cylinder.

radius

[CAPBOTH|

CAPBEGIN|

CAPEND]

The radius of the cylinder.

An optional argument that identifies if either or both cylinder endsshould be capped (closed).

For this exercise, use all of the arguments. The statement is:

//Graphics for cylinder

*Graphic(gr_link, "pendulum link graphic", CYLINDER, b_link p_pendu_pivot, POINT,p_pendu_cm, 0.5, CAPBOTH )

5. Create a revolute joint at the pivot point. The syntax is:

*RevJoint(joint_name, "joint_label", body_1,body_2, origin, POINT|VECTOR, point|vector, [ALLOW_COMPLIANCE])

where:

joint_name The variable name of the joint.

joint label The descriptive label of the revolute joint.

body 1 The first body constrained by the revolute joint.

body 2 The second body constrained by the revolute joint.

origin The locations of revolute joint.

POINT|VECTOR Keyword to suggest the method of orientation for the joint using apoint or vector.

point|vector A point or vector that defines the rotational axis of the revolutejoint.

[ALLOWCOMPLIANCE]

An optional argument that indicates the joint can be madecompliant (a joint that is compliant is treated like a bushing andcan be toggled between compliant and non-compliant).

For this problem, you will use the following statement:

//Revolute Joint

*RevJoint(j_joint, "New Joint", B_Ground, b_link, p_pendu_pivot, VECTOR,V_Global_X)

Page 129: Altair MotionView 11.0 Tutorials

Altair Engineering 124

Proprietary Information of Altair Engineering

MotionView 13.0 Tutorials

6. Create an entity output statement. The syntax for *Output - output on entities is:

*Output(out_name, "out_label", DISP|VEL|ACCL|FORCE, entity_type, ent_name,[ref_marker], [I_MARKER|J_MARKER|BOTH_MARKERS])

where:

out_name The variable name of the output.

out_label The descriptive label of the output.

DISP|VEL|ACCL|FORCE An argument that indicates whether the output type isdisplacement, velocity, acceleration, or force.

entity_type Keyword to indicate the type of entity on which the outputis being requested. Valid values are: BODY|JOINT|BEAM|BUSHING|FORCE|SPRINGDAMPER

ent_name The entity on which output is requested.

ref_marker An optional argument for the reference marker in which theoutput is requested.

I_MARKER|J_MARKER|BOTH_MARKERS

Keyword to indicate the capture of output on the I marker,J Marker or both markers. The default is both markers.

In order to obtain the displacement versus time output of the falling ball, you will use the *Output() statement as follows.

//Output

*Output(o_pendu, "Disp Output", DISP, BODY, b_link)

7. Set property values for the entities you created in your MDL model file. This is done in theproperty data section of the MDL model file. For this problem, use the *SetSystem(),

*SetPoint(), and *SetBody() statements.

//Property data section

*SetPoint(p_pendu_pivot, 0, 5, 5)

*SetPoint(p_pendu_cm, 0, 10, 10)

*SetBody(b_link, 1, 1000, 1000, 1000, 0, 0, 0)

8. Save the model as pendulum.mdl.

Your MDL model file will look like the file below (it summarizes the key sections of the MDL modelfile for this exercise):

//Pendulum Model

//05/31/XX

*BeginMDL(pendulum, "Pendulum Model")

Page 130: Altair MotionView 11.0 Tutorials

125 MotionView 13.0 Tutorials

Proprietary Information of Altair Engineering

Altair Engineering

//Topology information

//declaration of entities

//Points

*Point(p_pendu_pivot, "Pivot Point")

*Point( p_pendu_cm, "Pendulum CM")

//Bodies

*Body(b_link, "Ball", p_pendu_cm)

//Graphics

*Graphic(gr_sphere, "pendulum sphere graphic", SPHERE, b_link, p_pendu_cm, 1)

*Graphic(gr_link, "pendulum link graphic", CYLINDER, b_link, p_pendu_pivot,p_pendu_cm, 0.5, CAPBOTH)

//Revolute Joint

*RevJoint(j_joint, "New Joint", B_Ground, b_link, p_pendu_pivot, VECTOR,V_Global_X)

//Output

*Output(o_pendu, "Disp Output", DISP, BODY, b_link)

//End Topology

// Property Information

*SetPoint(p_pendu_pivot, 0, 5, 5)

*SetPoint(p_pendu_cm, 0, 10, 10)

*SetBody( b_link, 1, 1000, 1000, 1000, 0, 0, 0)

*EndMDL()

Step 3: Load and run the MDL model file.

1. Launch MotionView .

2. Click the Open Model icon, , on the Standard toolbar.

OR

From the File menu, select Open > Model.

Page 131: Altair MotionView 11.0 Tutorials

Altair Engineering 126

Proprietary Information of Altair Engineering

MotionView 13.0 Tutorials

4. From the Open Model dialog, locate and select the file pendulum.mdl.

5. Click Open.

6. Observe and review the model in the graphics area.

7. From the Standard View toolbar, click the YZ Rear Plane View button.

The model is seen as shown in the image below:

8. Use the Project Browser to view the model entities and verify their properties.

9. Go to the Tools menu and click on Check Model to check for any modeling errors.

10. Perform the following steps to run MotionSolve:

Go to the Run panel and select Transient as the Simulation Type: option.

Set the End time as 2 seconds.

Click on the Simulation Settings button.

The Simulation Settings dialog is displayed.

Click on the Transient tab and review the integrator parameters.

Click Close to close the dialog.

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.

Step 4: Animate and plot the results.

1. Click Animate.

2. The animation file pendulum.h3d will be loaded in the adjacent window. Click on that window to

activate it.

Page 132: Altair MotionView 11.0 Tutorials

127 MotionView 13.0 Tutorials

Proprietary Information of Altair Engineering

Altair Engineering

3. Click the Start/Pause Animation icon on the Animation toolbar to start the animation, and

click the Start/Pause Animation icon again to pause the animation.

4. Right-click on the Fit Model/Fit All Frames icon icon on the Standard Views toolbar to fitthe visualization in all frames of the animation.

5. Click on the MotionView window to make it active.

6. From the Run panel, click Plot.

7. The plot window will be added, with the pendulum.abf loaded.

8. Select Y Type as Marker Displacement, Y Request as REQ/70000000 Disp Output – (on

Ball), and Y component as DZ.

9. Click Apply.

The plot for the displacement of the pendulum in the Z direction is shown.

10. Click the Start/Pause Animation icon, , to review the plot and animation together. Click , to pause the animation.

Your session page should look similar to the image below:

11. Close the session using the File menu (File > Exit).

Page 133: Altair MotionView 11.0 Tutorials

Altair Engineering 128

Proprietary Information of Altair Engineering

MotionView 13.0 Tutorials

MV-1070: Creating a Simple Pendulum System usingMDL

In this tutorial, you will learn how to create a definition based entity (such as a system) using MDL.

Using systems allows you to:

Organize your model file modularly

Reuse system definition files

Easily debug and maintain your files

Create a library of modeling components

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 translationon 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 programminglanguage.

Analogy between programming and MDL approach

A procedure is a program that needs information from the main program. The procedure can becalled /instantiated any number of times. A procedure is a part of main program, but can bemaintained separately.

Similarly, a system definition is a model aggregate which needs information from the main model. Itcan be called/instantiated any number of times. A system definition is a part of the main modelwhich can be maintained separately.

Use of system definition is two-step process:

1. Defining the system

2. Instantiation of the system definition in the model

Page 134: Altair MotionView 11.0 Tutorials

129 MotionView 13.0 Tutorials

Proprietary Information of Altair Engineering

Altair Engineering

Section 1: System Definitions

A system definition is a reusable system model that can be a part of any model as long all theattachment requirements are satisfied.

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.

A typical system definition example is shown below:

*DefineSystem(def_sys, att_1, att_2…att_n)

In the system definition example above:

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.

A system definition can be created in two ways:

1. Using the text editor.

2. Created from graphical user interface. This requires minimal text editing. Refer to tutorial MV-1032.

Note This tutorial covers Method 1, as it covers all the details of the system definition.

Page 135: Altair MotionView 11.0 Tutorials

Altair Engineering 130

Proprietary Information of Altair Engineering

MotionView 13.0 Tutorials

Section 2: System Attachments

The picture above shows a system definition of an SLA suspension. It is an incomplete system whichneeds 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.

The general structure of a system definition is:

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 whendefining an entity that depends on the external entity.

Refer to the entries in bold in the example below. Reference line numbers are for referenceonly 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 4 - declares b_body_att as an attachment with the entity type as Body.

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.

Page 136: Altair MotionView 11.0 Tutorials

131 MotionView 13.0 Tutorials

Proprietary Information of Altair Engineering

Altair Engineering

Note An attachment entity need not serve as a physical attachment to entities inside thesystem definition. It may be used to represent external variables being passed into thesystem definition. For example, datasets may also serve as attachments.

Section 3: Instantiating a System

Instantiating a system means creating an instance of a system definition. A system isinstantiated using a *System() MDL statement, which has the following syntax:

o *System(varname, “label”, def_varname, arg_1, arg_2, …, arg_n) where,

varname – variable name of the system instance.

label – descriptive label for the system.

def_varname – variable name of the system definition being instantiated.

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 attachmentslisted and declared in the system definition.

A definition can be instantiated multiple times. For example, a single system definition file foran SLA suspension can be used to create multiple SLA suspension systems within one or morevehicle model files.

The following example illustrates a system definition and its instantiation within an MDL modelfile. Some of the terms in the example below are in bold to highlight a few key relationshipsbetween 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.

o The system definition is described within the *DefineSystem() and *EndDefine()

block between line 3 and line 7. Attachment b_att gets resolved to B_Ground.

Page 137: Altair MotionView 11.0 Tutorials

Altair Engineering 132

Proprietary Information of Altair Engineering

MotionView 13.0 Tutorials

ReferenceNumbers

System Instantiation with Definition

1// Model : Body.mdl

*BeginMDL(base_model, "Base Model")

2//Instantiate the system definition sys_definition

*System(system1, "First System", sys_definition, B_Ground)

3//Begin System Defintion Block

*DefineSystem(sys_definition, b_att)

4

//Declare a body attachment to the system

*Attachment(b_att, "Body Attachment", Body, "Add an bodyexternal to this system")

5

//Entities within the system

*Point(p_sys, "Point in the system")

*Body(b_sys, "Body in the system")

6

//Define a joint with the body b_sys and the bodyattachment b_att

*RevJoint(j_rev, "Revolute Joint", b_sys, b_att, p_sys,VECTOR, V_Global_X)

7 *EndDefine() //End Definition Block

8 *EndMDL()

You can instantiate systems within your model in one of three ways:

1. Manually author the MDL file as shown in the example above.

2. Import a system from the System/Assembly panel in the MotionView MBD Model window.

3. Use the Assembly Wizard in the MotionView MBD Model window.

The exercises that follow explain the first two methods; the third is covered in a separate tutorial.

Page 138: Altair MotionView 11.0 Tutorials

133 MotionView 13.0 Tutorials

Proprietary Information of Altair Engineering

Altair Engineering

Exercise 1: Creating and Using System Definitions

The following exercise illustrates how system definition can be generated from the original system MDLfile. The later part of the exercise shows two different ways of system instantiation.

The following MDL statements are used in this exercise:

*DefineSystem()

*System()

*SetSystem()

*Attachment()

Problem

In Steps 1 and step 2:

Modify the pendulum model from tutorial MV-1060 to create a pendulum system definition filecalled 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.

Schematic representation of the double pendulum

Page 139: Altair MotionView 11.0 Tutorials

Altair Engineering 134

Proprietary Information of Altair Engineering

MotionView 13.0 Tutorials

Properties table for the double pendulum

Step 1: Create a system definition.

The structure of a system definition is similar to an MDL model file. You can reuse the pendulum modelfile you created in the previous exercise to generate a more generalized system definition.

1. Copy the file pendulum.mdl from the <installation_directory>\tutorials\mv_hv_hg

\mbd_modeling\mdl to your <working directory>.

Below is a sample MDL file for the pendulum model in tutorial MV-1060.

//Pendulum Model

//05/31/XX

*BeginMDL(pendulum, "Pendulum Model")

//Topology information

//declaration of entities

//Points

*Point(p_pendu_pivot, "Pivot Point")

*Point( p_pendu_cm, "Pendulum CM")

//Bodies

*Body(b_link, "Ball", p_pendu_cm)

//Graphics

*Graphic(gr_sphere, "pendulum sphere graphic", SPHERE, b_link, p_pendu_cm, 1)

*Graphic(gr_link, "pendulum link graphic", CYLINDER, b_link, p_pendu_pivot, POINT,p_pendu_cm, 0.5, CAPBOTH)

//Revolute Joint

*RevJoint(j_joint, "New Joint", B_Ground, b_link, p_pendu_pivot, VECTOR,V_Global_X)

Page 140: Altair MotionView 11.0 Tutorials

135 MotionView 13.0 Tutorials

Proprietary Information of Altair Engineering

Altair Engineering

//Output

*Output(o_pendu, "Disp Output", DISP, BODY, b_link)

//End Topology

// Property Information

*SetPoint(p_pendu_pivot, 0, 5, 5)

*SetPoint(p_pendu_cm, 0, 10, 10)

*SetBody( b_link, 1, 1000, 1000, 1000, 0, 0, 0)

*EndMDL()

You can convert the above MDL file into a system definition by making small changes to your MDLfile. It is important to note that this conversion is not applicable in all cases, and some of theconditions 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.

3. The pendulum system definition would need information about:

Where to connect (attachment point or pivot point)

What body to connect to (attachment body)

Let’s use att_point and att_body as the attachment entities.

4. Use these variables in the *DefineSystem () statement:

*DefineSystem (sys_def_pendulum, att_point, att_body)

Note As mentioned earlier, the attachment entity can be any MDL entity. Therefore one needsto 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 pendulumdefinition gets attached")

*Attachment (att_body, "Attachment body" , BODY, " Any body to which the pendulumdefinition 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 beprovided by the attachment point.

Page 141: Altair MotionView 11.0 Tutorials

Altair Engineering 136

Proprietary Information of Altair Engineering

MotionView 13.0 Tutorials

6. The point p_pendu_pivot is now passed as an attachment, therefore we do not need to define

the pivot point. Delete the statement *Point (p_pendu_pivot, "Pivot Point").

7. Retain pendulum CM point as it is.

8. Retain the *Body() statement to create the pendulum body.

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.

9. Retain the sphere *Graphic() statement.

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 attachmentvariables should replace the original variables.

10. Retain the *Output() statement. This allows you to obtain displacement outputs on each

pendulum body in your model.

11. Remove *setpoint(p_pendu_pivot, 0, 5, 5).

12. Parameterize the points in the system so that they are positioned with respect to each other in acertain 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).

13. The following file shows a sample system definition (system.mdl):

// system.mdl

// created on:

*DefineSystem(sys_def_pendulum, att_point, att_body)

//Topology Data

// Declaration of Entities

//Attachments

*Attachment (att_point, "Pivot Point", Point, "Attachmentpoint where the pendulum definition gets attached")

*Attachment (att_body, "Attachment body" , Body, " Any bodyto which the pendulum definition gets attached")

//Points

*Point( p_pendu_cm, "Pendulum CM")

//Bodies

*Body(b_link, "Ball", p_pendu_cm)

//Joints

*RevJoint(j_joint, "New Joint", att_body, b_link, att_point,

Page 142: Altair MotionView 11.0 Tutorials

137 MotionView 13.0 Tutorials

Proprietary Information of Altair Engineering

Altair Engineering

VECTOR, V_Global_X)

//Output

*Output(o_pendu, "Disp Output", DISP, BODY, b_link)

//Graphics

*Graphic(gr_sphere, "pendulum sphere graphic", SPHERE,b_link, p_pendu_cm, 1 )

*Graphic(gr_link, "pendulum link graphic", CYLINDER, b_link,att_point, POINT, p_pendu_cm, 0.5, CAPBOTH )

// Property Data

*SetPoint(p_pendu_cm, 0, att_point.y+5, att_point.z+5)

*SetBody(b_link, 1, 1000, 1000, 1000, 0, 0, 0)

*EndDefine()

14. Save the file as sys_pendu.mdl.

Step 2: Add a system definition by manually authoring your MDL file.

In step 1, you created a reusable system definition. In this step, you will instantiate this systemdefinition in your model file. In the manual approach, you will write an MDL file which includes thesystem definition and instantiates it several times.

1. Create a new empty file in a text editor.

2. Begin the model file with a *BeginMDL() statement.

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:

*System(system1, "First Pendulum System", sys_def_pendulum, P_Global_Origin,B_Ground)

When you instantiate a system, remember:

Reference the system definition used by the system by specifying its variable name as the thirdargument 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 instantiatethe 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.

It is recommended to add the *System() statement before *DefineSystem(), although this

not mandatory.

Page 143: Altair MotionView 11.0 Tutorials

Altair Engineering 138

Proprietary Information of Altair Engineering

MotionView 13.0 Tutorials

5. Repeat Step 4 with appropriate modifications, to create the second pendulum system using the *System() statement again.

Provide a different variable name, system2, for the system instance.

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 )

6. Close the MDL file with the *EndMDL() statement.

A sample MDL file is provided below:

*BeginMDL(model, "MODEL")

*System(system1, "First Pendulum System", sys_def_pendulum, P_Global_Origin,B_Ground)

*System(system2, "Second Pendulum System", sys_def_pendulum, system1.p_pendu_cm,system1.b_link )

*DefineSystem(sys_def_pendulum, att_point, att_body)

//Topology Data

// Declaration of Entities

//Attachments

*Attachment (att_point, "Pivot Point", Point, "Attachment point where thependulum definition gets attached")

*Attachment (att_body, "Attachment body" , Body, " Any body to which thependulum definition gets attached")

//Points

*Point( p_pendu_cm, "Pendulum CM")

//Bodies

*Body(b_link, "Pendulum Body", p_pendu_cm)

//Joints

*RevJoint(j_pivot, " Revolute Joint at Pivot Point ", b_link, att_body,att_point, VECTOR, V_Global_X)

//Output

*Output(o_pendu, "Disp Output", DISP, BODY, b_link)

//Graphics

*Graphic(gr_sphere, "pendulum sphere graphic", SPHERE, b_link, p_pendu_cm, 1 )

*Graphic(gr_link, "pendulum link graphic", CYLINDER, b_link, att_point, POINT,p_pendu_cm, 0.5, CAPBOTH )

Page 144: Altair MotionView 11.0 Tutorials

139 MotionView 13.0 Tutorials

Proprietary Information of Altair Engineering

Altair Engineering

// Property Data

*SetPoint(p_pendu_cm, 0, att_point.y+5, att_point.z+5)

*SetBody(b_link, 1, 1000, 1000, 1000, 0, 0, 0)

*EndDefine()

*EndMDL()

7. Save the model as doublependulum.mdl.

8. Open the MDL file in MotionView and review the model.

9. Take a close look at items listed in the Project Browser. You will now notice a 'hand' under theSystem icon for the First Pendulum System and the Second Pendulum System. This indicatesthat 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 thoseinstances can be made to reflect in all of the instances. This can be achieved as follows:

From the Tools menu, select Options.

The Options dialog is displayed.

Page 145: Altair MotionView 11.0 Tutorials

Altair Engineering 140

Proprietary Information of Altair Engineering

MotionView 13.0 Tutorials

Click on the Build Model option (located near the bottom of the tree).

11. Under Legacy Support, uncheck the Create a separate definition when modifying a sharedinstance option. This will ensure that when entities in a shared instance are modified, thechanges will be reflected across all of the instances without creating a separate definition.

12. Click OK to close the dialog.

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.

Exercise 2: Adding Systems from the Systems/Assembly Panel

This exercise demonstrates how to instantiate a system from the MotionView graphical user interfaceusing the Systems/Assembly panel.

Problem

In this exercise:

Use MotionView to add another pendulum link to your double pendulum model to obtain thetriple pendulum shown in the image below.

Solve and view the animation.

Page 146: Altair MotionView 11.0 Tutorials

141 MotionView 13.0 Tutorials

Proprietary Information of Altair Engineering

Altair Engineering

The triple pendulum

Properties table for the triple pendulum

Page 147: Altair MotionView 11.0 Tutorials

Altair Engineering 142

Proprietary Information of Altair Engineering

MotionView 13.0 Tutorials

Step 1: Add the system definition from MotionView.

Adding system definitions to a model is similar to adding other entities except the system definitionsare loaded from a file.

1. Start MotionView and open the pendulum model file from Exercise 1 (the previous exercise) in theMBD Model window.

2. From the Project Browser, click Model.

The Systems/Assembly panel is displayed.

3. Click the Import/Export tab.

4. Using the Select File: file browser , pick the system definition you just created, sys_pendu.mdl.

5. Click Import.

The Specify entity details dialog is displayed.

6. Under Select a definition, select sys_def_pendulum.

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.

Page 148: Altair MotionView 11.0 Tutorials

143 MotionView 13.0 Tutorials

Proprietary Information of Altair Engineering

Altair Engineering

Step 2: Resolve attachments and update points.

1. Select the newly added system from the Project Browser.

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 thesecond link in the pendulum system.

2. From the Attachments tab, activate the collector for Attachment body to select abody attachment.

The Select a Body dialog is displayed.

3. Expand the Bodies folder in the second pendulum system and pick the Pendulum Body (whichbelongs to system2).

4. Click OK.

5. Next, activate the collector for Pivot Point to select a point attachment.

The Select a Point dialog is displayed

6. Expand the Points folder under the second pendulum system and select the Pendulum CM point.

7. Click OK.

The third pendulum system should be visible in the graphics area.

8. Save the model as triplependulum.mdl for future use.

9. Run MotionSolve and view the results.

Page 149: Altair MotionView 11.0 Tutorials

Altair Engineering 144

Proprietary Information of Altair Engineering

MotionView 13.0 Tutorials

Important Note Regarding Definitions:

One important aspect of definitions is that they need to be independent, therefore a *DefineXXX block should not contain another *DefineXXX block within them. For example, the

figure on the left (below) shows a *Define block inside another *Define block. Such

definitions are referred as nested definitions and may result in MotionView giving errors whilereading such definitions. The figure on the right shows the correct way of placing definitions.

In Exercise 1, the method to author a system definition is described by modifying an existingmodel MDL, in other words replacing *BeginMDL() and *EndMDL() with *DefineSystem() and

*EndDefine(). While this method can be employed in many cases, care should be taken so

that any existing definition block within the *BeginMDL block should not end up being nested

as described above. Such a definition block must be moved out of the block so that thedefinition blocks are independent with regard to each other.

Page 150: Altair MotionView 11.0 Tutorials

145 MotionView 13.0 Tutorials

Proprietary Information of Altair Engineering

Altair Engineering

MV-1080: Creating an Analysis using MDL

In this tutorial, you will learn how to create an analysis definition and instantiate it in an MDL file.

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 kinematicsof a four-bar mechanism can be described in one analysis, while another analysis can be used to studya dynamic behavior. In both cases, while the overall model is the same, the analysis container maycontain different entities that form the event. The kinematic analysis can contain motion and relatedoutputs, while the dynamic analysis may contain forces and its corresponding outputs.

An analysis definition is similar to a system definition in syntax and usage, except:

o Analysis definitions use *DefineAnalysis(), while system definitions use

*DefineSystem().

o Analysis can be instantiated under the top level Model only.

o Only one analysis can be active in the model at a given instance.

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:

*DefineAnalysis(ana_def_name, arg_1,arg_2, ..., arg_n)

Where;

ana_def_name is the variable name of the analysis definition and will be used while

instantiating the analysis.

arg_1,arg_2..arg_n are a list of arguments passed to the analysis definition as

attachments.

The following table illustrates an analysis definition and its subsequent instantiation within anMDL file. Two files, an analysis definition file and the model file, work together wheninstantiating a particular analysis under study. Some of the terms in the example below are inbold to highlight a few key relationships between the files.

ReferenceNumbers

System Instantiation with Definition

1// Model : Body.mdl

*BeginMDL(base_model, "Base Model")

2//Instantiate the analysis definition ana_def

*Analysis(ana1, "Analysis 1", ana_def, j_rev)

3//Begin Analysis Defintion Block

*DefineAnalysis(ana_def,j_joint_att)

4 //Declare a joint attachment to the analysis

Page 151: Altair MotionView 11.0 Tutorials

Altair Engineering 146

Proprietary Information of Altair Engineering

MotionView 13.0 Tutorials

ReferenceNumbers

System Instantiation with Definition

*Attachment(j__joint_att, "Joint Attachment", Joint, "Addan joint external to this analysis to apply motion/force")

5

//Entities within the analysis

*Point(p_1, "Point in the analysis")

*Body(b_1, "Body in the analysis")

6

//Define a joint with the body b_sys and the bodyattachment b_att

*Motion(mot, "Joint Motion", JOINT, j_joint_att, ROT)

7 *EndDefine() //End Definition Block

8 *EndMDL()

The following table details the relationships between the analysis definition and its instantiationin the MDL Model file.

Variable Relationship

j_joint_att The varname of the attachment, declared in the *Attachment()

statement (line 4) in the analysis definition file, appears as anargument in the *DefineAnalysis() statement (line 3). A motion is

applied on this joint using the *Motion() statement (line 6).

ana_def The varname of the analysis definition is specified in the *DefineAnalysis() statement (line 3). The analysis definition is

used by ana1 in the *Analysis() statement (line 2).

Defining relationships between the analysis definition and MDL model files

Exercise: Creating an Analysis Definition

An experimental technique for estimating the natural frequencies of structures is to measure theresponse to an impulsive force or torque, then look at the response in the frequency domain via aFourier Transform. The peaks in the frequency response indicate the natural frequencies. In thistutorial, we will create an analysis to simulate this test procedure. The analysis applies an impulsivetorque to the system and measures the response.

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)

Page 152: Altair MotionView 11.0 Tutorials

147 MotionView 13.0 Tutorials

Proprietary Information of Altair Engineering

Altair Engineering

2. Apply this torque to estimate the natural frequencies of the triple pendulum model shown in theimage below:

Schematic representation of a triple pendulum in stable equilibrium

Your analysis applies to a pendulum with any number of links or to more general systems.

Properties table for the triple pendulum

The following MDL statements are used in this exercise:

*Attachment()

*ActionReactionForce()

*SetForce()

*Output()

Note Refer to the MotionView Reference Guide (located in the HyperWorks Desktop ReferenceGuide) for the syntax of the above MDL statements.

Page 153: Altair MotionView 11.0 Tutorials

Altair Engineering 148

Proprietary Information of Altair Engineering

MotionView 13.0 Tutorials

Step 1: Create the analysis definition file.

1. Open an empty file in a text editor.

2. Create the *DefineAnalysis() and *EndDefine() block. All other statements will be added

between this block.

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 ofthe revolute joint taken as the point of application of the force. This allows you to have only oneattachment; 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.

*Attachment(j_att, “Joint Attachment”, Joint, “Select joint to apply torque”)

4. Use the *ActionReactionForce() statement to define an applied torque. Please note to

reference the correct properties of the attachment joint to reach the bodies involved in the joint.

Note Refer to the description of the dot separator in MDL. You can accessproperties 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.

Create an *ActionReactionForce() statement with the following:

Variable name of force_1.

Force type as ROT (rotational).

Body 1 as j_att.b1 (attachment joint body 1).

Body 2 as j_att.b2 (attachment joint body 2).

Force application point as j_att_i.origin (the attachment joint origin).

Reference frame as Global_Frame (global).

*ActionReactionForce( force_1, "Torque", ROT, j_att.b1, j_att.b2, j_att.origin,Global_Frame )

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

Page 154: Altair MotionView 11.0 Tutorials

149 MotionView 13.0 Tutorials

Proprietary Information of Altair Engineering

Altair Engineering

6. Use an *Output() statement to output the applied force.

Define an *Output() statement with the following:

Variable name of o_force.

Output type as FORCE.

Entity type as FORCE.

Variable name of force_1 (the action-reaction force created in Step 3 above).

Reference frame as Global_Frame (global).

*Output( o_force, "Input Torque", FORCE, FORCE, force_1, Global_Frame)

7. Save the analysis definition as analysis.mdl.

The saved file analysis.mdl will look like this:

*DefineAnalysis( def_ana_0,j_att )

*Attachment(j_att, “Joint Attachment”, Joint, “Select joint to apply torque”)

*ActionReactionForce( force_1, "Torque", ROT, j_att.b1, j_att.b2, j_att.origin, Global_Frame )

*SetForce( force_1, EXPR, `step(TIME,.3,0,.31,10) + step(TIME,.31,0,.32,-10)`)

*Output( o_force, "Input Torque", FORCE, FORCE, force_1, Global_Frame)

*EndDefine()

Step 2: Instantiate the analysis in a model.

1. Start MotionView and open the <installation_directory>\ tutorials\mv_hv_hg\mbd_modeling\mdl\triplependulum.mdl

file.

2. From the Project Browser, click Model.

The Systems/Assembly panel is displayed.

3. Click the Import/Export tab.

4. Using the Select File: file browser , pick the analysis definition you just created,analysis.mdl.

5. Click Import.

Page 155: Altair MotionView 11.0 Tutorials

Altair Engineering 150

Proprietary Information of Altair Engineering

MotionView 13.0 Tutorials

6. Make sure that the Select a definition drop-down menu is set to Analysis.

7. Click OK.

8. Select the newly added analysis by clicking on Analysis 0 in the Project Browser, and resolvethe joint attachment by selecting any one of the pivot joints of the triple pendulum:

From the Attachments tab, select the Joint Attachment.

Select any pivot joint of the triple pendulum.

9. Save your model as new_triplependulum.mdl.

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.

11. View the animation .

12. Plot the output "Input Torque" using the .abf file from the solution.

Page 156: Altair MotionView 11.0 Tutorials

151 MotionView 13.0 Tutorials

Proprietary Information of Altair Engineering

Altair Engineering

MV-1090: Creating a Dataset using MDL

In this tutorial, you will learn how to:

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 modelthrough a single interface. The variables could be in the form of real numbers, integers, or strings. Orit 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 entitywithin 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.

Exercise: Defining a Dataset

Step 1: Create a dataset definition.

The following steps illustrate how to create a dataset definition.

Refer to the MDL Language Reference online help for the correct syntax for the MDL statements youchoose 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.

Use one *Real() statement to define one data member.

You can also define other types of members such as: integers, strings, options, or a file (asapplicable to your model).

Page 157: Altair MotionView 11.0 Tutorials

Altair Engineering 152

Proprietary Information of Altair Engineering

MotionView 13.0 Tutorials

2. Save the file in the working directory as dataset.mdl. Your file should look like this:

*DefineDataSet(ds_def_force)

*Real(start_time, "Starting Time")

*Real(mid_time, "Mid Time")

*Real(end_time, "End Time")

*Real(force_magnitude, "Force Magnitude")

*EndDefine()

Step 2: Include the dataset in the analysis definition and instantiate.

The dataset will be included in the analysis definition by using the *Include() statement. The

dataset entities will be incorporated in the expression for torque.

1. In a text editor, open the analysis definition file created in tutorial MV-1080. Include the datasetdefinition in it by using the *Include() statement before the *DefineAnalysis() statement.

The syntax is:

*Include("dataset.mdl")

2. Instantiate this dataset definition using the *DataSet() statement within the

*DefineAnalysis() block and after the *Attachment() statement.

The syntax for the *DataSet() statement is:

*DataSet(ds_name, "ds_label", ds_def, [optional arguments])

where

ds_name is the variable name of the dataset.

ds_label is the label of the dataset.

ds_def is the variable name of the existing dataset definition.

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.

*DataSet(ds_force, “Force Data”, ds_def_force)

3. Set the default values of the data members in the dataset by using the *SetReal() statement

within the *DefineAnalysis() block.

The syntax for the *SetReal() statement is:

*SetReal(real_name, real_value)

where

real_name is the variable name of the data member for which the value is being set.

real_value is the value of the data member.

Page 158: Altair MotionView 11.0 Tutorials

153 MotionView 13.0 Tutorials

Proprietary Information of Altair Engineering

Altair Engineering

As the data member is a part of the dataset, the correct form of referring to the variable name ofthe real entity is ds_name.real_name.

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.

Include the lines below after the *DataSet() statement:

*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)

5. The *SetForce() statement in the analysis definition looks like:

*SetForce( force_1, EXPR, `step(TIME,.3,0,.31,10) + step(TIME,.31,0,.32,-10)`)

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 accessthe 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 getevaluated to the appropriate values defined in the dataset.

The analysis definition file should look as below:

*Include(“dataset.mdl”)

*DefineAnalysis( def_ana_0,j_att )

*Attachment(j_att, “Joint Attachment”, Joint, “Select joint to apply torque”)

*DataSet(ds_force, “Force Data”, ds_def_force)

*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)

*ActionReactionForce( force_1, "Torque", ROT, j_att.b1, j_att.b2, j_att.origin, Global_Frame )

Page 159: Altair MotionView 11.0 Tutorials

Altair Engineering 154

Proprietary Information of Altair Engineering

MotionView 13.0 Tutorials

*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})`)

*Output( o_force, "Input Torque", FORCE, FORCE, force_1, Global_Frame)

*EndDefine()

7. Save the above work in a new analysis definition file named analysis_dataset.mdl.

Step 3: Change the dataset parameters and run the analysis.

1. In MotionView, load the triple pendulum model created in tutorial MV-1080.

2. Delete the existing analysis (if any) by right-clicking on the Analysis in the Project Browser andclicking Delete.

3. Click on Model in the Project Browser.

The Systems/Assembly panel is displayed.

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.

7. Solve the model.

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 andre-run your analysis.

9. Save your model as triplependulum_dataset.mdl.

Page 160: Altair MotionView 11.0 Tutorials

155 MotionView 13.0 Tutorials

Proprietary Information of Altair Engineering

Altair Engineering

MV-1030: Creating a System Definition Using theMotionView GUI

In the earlier exercise, you learned about MDL and authoring a definition using the MDL languagethrough a text editor. In general, many of the definitions (such as systems, datasets, and analyses)are created using the MotionView graphical user interface. This tutorial demonstrates how to create asystem using the GUI and save its definition to a file, which is an alternate way of creating a definitionother than using the text editor.

Exercise: Creating a System Definition Using the GUI.

This exercise will help you learn to:

Create systems using the MotionView graphical user interface

Export a system definition to a file

Reuse the saved definition by instantiating it in the model

Step 1: Creating a system instance.

1. To create a system, right-click on Model in the Project Browser and select Add > System/Assembly.

OR

Right-click on the System/Assembly panel button on the Container Entity toolbar.

The Add System/Assembly dialog is displayed.

2. Select the System radio button and click Next.

The Add System dialog is displayed.

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.

Step 2: Adding attachments to the system.

1. From the Attachments tab, click on the Add button (located in the middle of the panel).

The Add an Attachment dialog 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.

Page 161: Altair MotionView 11.0 Tutorials

Altair Engineering 156

Proprietary Information of Altair Engineering

MotionView 13.0 Tutorials

4. Add another attachment with the Label as Attachment Body and Variable as arg_b, select

Body from the drop-down menu, and specify the Type as Single only.

We have created two attachments to the Pendulum system which will be used to attach thissystem to other entities of a model.

Notice that the both of the newly created attachments are Unresolved, which means that theattachments are not yet referring to another entity in the model.

5. Double click on the collector.

The Select a Point dialog is displayed.

Page 162: Altair MotionView 11.0 Tutorials

157 MotionView 13.0 Tutorials

Proprietary Information of Altair Engineering

Altair Engineering

6. Select Global Origin from the list on the right side of the dialog and click OK.

7. Similarly, click the collector, select Ground Body from the model tree, andclick OK.

Step 3: Adding entities to the system.

1. Select Pendulum in the Project Browser.

2. Right-click and select Add > Reference Entity > Point.

OR

Right-click on the Points panel button on the Reference Entity toolbar).

The Add Point or PointPair dialog is displayed.

3. Specify the Label as Mass CG, Variable as p_cg, and the Type as Single.

4. Click OK.

The Points panel is displayed with the properties of Mass CG.

Page 163: Altair MotionView 11.0 Tutorials

Altair Engineering 158

Proprietary Information of Altair Engineering

MotionView 13.0 Tutorials

5. From the Properties tab, click in the X Coordinate field and click on the button on theExpression bar.

The Expression Builder is displayed.

6. Delete 0.0 from the Expression area (located at the top of the dialog).

Page 164: Altair MotionView 11.0 Tutorials

159 MotionView 13.0 Tutorials

Proprietary Information of Altair Engineering

Altair Engineering

7. From the model tree, expand the Pendulum > Attachments > Attachment Point folders andselect x (x is one of the property attributes of the point entity Attachment point).

8. Click the Add button (located in the middle of the dialog).

arg_p.x is automatically filled in the Expression area.

Page 165: Altair MotionView 11.0 Tutorials

Altair Engineering 160

Proprietary Information of Altair Engineering

MotionView 13.0 Tutorials

9. Append +50 to this expression.

The complete expression should now read: arg_p.x+50.

10. Click OK to close the dialog.

Through the above steps the point Mass CG is parameterized with regard to the X coordinate ofthe point Attachment Point and is placed at a distance of 50 length units in the X direction.

Page 166: Altair MotionView 11.0 Tutorials

161 MotionView 13.0 Tutorials

Proprietary Information of Altair Engineering

Altair Engineering

11. Repeat the above steps for the Y and Z Coordinates, by selecting attribute y and z respectivelyin the expression bar. Specify the expression for the Y Coordinate as arg_p.y and arg_p.z+100

for the Z Coordinate.

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.

The Add Body or BodyPair dialog is displayed.

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 systemoption. Pick the point Mass CG as the Origin.

Page 167: Altair MotionView 11.0 Tutorials

Altair Engineering 162

Proprietary Information of Altair Engineering

MotionView 13.0 Tutorials

16. Right-click on the Pendulum system in the Project Browser and select Add > Reference Entity> Graphic.

The Add "Graphic" dialog is displayed.

17. Specify the Label as Rod, the Variable as gcyl_rod, the Type as Cylinder, and click OK.

The Graphics panel is displayed.

18. From the Connectivity tab; double click on the Body collector for Parent and pick Mass in thePendulum system, click on the Point collector and pick Mass CG as Origin, and for Directiondouble click the Point collector and select the attachment to the system Attachment Point.

19. Go to the Properties tab and change the value of Radius 1 to 2.

20. Next, add a Sphere graphic by right-clicking on the Pendulum system in the Project Browserand 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.

23. From the Properties tab, specify 25 for the Radius.

Page 168: Altair MotionView 11.0 Tutorials

163 MotionView 13.0 Tutorials

Proprietary Information of Altair Engineering

Altair Engineering

24. Right-click on the Pendulum system in the Project Browser and select Add > Constraint >Joint.

The Add Joint or JointPair dialog is displayed.

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.

The Joints panel is displayed.

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 themodel 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 pickGround Body via the Attachment Body.

Page 169: Altair MotionView 11.0 Tutorials

Altair Engineering 164

Proprietary Information of Altair Engineering

MotionView 13.0 Tutorials

27. Similarly, for Origin select Attachment Point (located under Model > Pendulum >Attachments). Use the Alignment axis drop-down menu to change from Point to Vector andselect Global Y for the Alignment axis.

28. Save the model to your <working directory> as pend_gui.mdl.

Step 4: Exporting the system definition.

1. Select the Pendulum system in the Project Browser and click on the Import/Export tab inthe Systems/Assembly panel.

2. Select the Export option.

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.

Page 170: Altair MotionView 11.0 Tutorials

165 MotionView 13.0 Tutorials

Proprietary Information of Altair Engineering

Altair Engineering

5. Open the above file in a text editor.

The system definition content will look as displayed below:

*DefineSystem( def_sys_pendu, arg_p, arg_b )

*Attachment( arg_p, "Attachment Point", Point, "Select attachment.",P_Global_Origin, )

*Attachment( arg_b, "Attachment Body", Body, "Select attachment.",B_Ground, )

*SetDefaultSystemInstance( sys_pendu, "Pendulum" )

*Point( p_cg, "Mass CG" )

*Body( b_mass, "Mass", p_cg, , , , )

*Graphic( gcyl_rod, "Rod", CYLINDER, b_mass, p_cg, POINT, arg_p, 2.0,gcyl_rod.r1, , 0.0, CAPBOTH )

*Graphic( gsph_mass, "Mass", SPHERE, b_mass, p_cg, 25.0 )

*RevJoint( j_pivot, "Pivot", b_mass, arg_b, arg_p, VECTOR, V_Global_Y )

*SetPoint( p_cg, arg_p.x+50, arg_p.y, arg_p.z+100 )

*SetBodyInertia( b_mass, 1.0, 1000.0, 1000.0, 1000.0,0.0, 0.0, 0.0 )

*Set( b_mass.usecm, true )

*EndDefine()

Note The Export option is only available for Systems and Analyses. For other definitions likeDatasets or Templates, the definition can be copied from the model .mdl file.

Step 5: Instantiating the system definition.

1. Select the Model system in the Project Browser.

2. Click the Import/Export tab in the Systems/Assembly panel.

3. Click on the Select file file browser and browse to your <working directory>.

4. Select the sys_pend_gui.mdl file and click Open.

Page 171: Altair MotionView 11.0 Tutorials

Altair Engineering 166

Proprietary Information of Altair Engineering

MotionView 13.0 Tutorials

5. Click the Import button.

The Import System/Analysis Definition dialog is displayed.

6. Select def_sys_pendu.

7. Change the Label to Pendulum 2 and the Variable to sys_pendu_2.

8. Click OK.

The system definition is instantiated.

9. Select the Pendulum 2 system in the Project Browser.

Page 172: Altair MotionView 11.0 Tutorials

167 MotionView 13.0 Tutorials

Proprietary Information of Altair Engineering

Altair Engineering

10. Go to the Attachments tab and resolve the attachments in the following manner:

Double click on the collector. In the model tree that appears, click on thePendulum 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 thePendulum system, select Mass from the list on the right, and click OK.

11. Save the model to your <working directory> as pend_2_gui.mdl.

The same system definition can be reused to instantiate several times either within the samemodel or in a different model.

Page 173: Altair MotionView 11.0 Tutorials

Altair Engineering 168

Proprietary Information of Altair Engineering

MotionView 13.0 Tutorials

Flexible Body Modeling and Simulationusing MotionView and MotionSolveMV-2000: Introduction to Flexible Bodies

MV-2010: Flexbody Generation using Flexprep and Optistruct

MV-2020: Use of Flexbody in MBD Models

MV-2021: Simulating an Automotive Door Closure Event

MV-2035: Solving Flexbody ADM/ACF in MotionSolve

Page 174: Altair MotionView 11.0 Tutorials

169 MotionView 13.0 Tutorials

Proprietary Information of Altair Engineering

Altair Engineering

MV-2000: Introduction to Flexible Bodies

Why Flexible Bodies?

Traditional multi-body dynamic (MBD) analyses involve the simulation of rigid body systemsunder the application of forces and/or motions.

In the real world, any continuous medium deforms under the application of force. Rigid bodysimulations do not capture such deformations and this may lead to inaccurate results. Inclusionof flexible bodies in MBD simulations accounts for flexibility.

MotionView provides the modeling tools required to incorporate flexible bodies in your MBD model.Flexible MBD simulations allow you to:

capture body deformation effects in simulations.

acquire greater accuracy in load predictions.

study stress distribution in the flexible body.

perform fatigue analysis.

However, flexible bodies introduce an additional set of equations in the system and consequently,have a higher computational cost as compared to rigid body systems.

What is a Flexible Body?

Finite element models have very high number of degrees of freedom. It is hard for MBD solversto handle these.

A flexible body is a modal representation of a finite element model. The finite element model isreduced to very few modal degrees of freedom.

The nodal displacement in physical coordinates is represented as a linear combination of a smallnumber of modal coordinates.

where:

U nodal displacements vector

modal matrix

Q matrix of modal participation factors or modal coordinates to bedetermined by the MBD analysis.

MotionView uses the process of Component Mode Synthesis(CMS) to reduce a finiteelement model to set of orthogonal mode shapes.

Page 175: Altair MotionView 11.0 Tutorials

Altair Engineering 170

Proprietary Information of Altair Engineering

MotionView 13.0 Tutorials

Two types of CMS methods are supported in Optistruct:

Craig Bampton

Craig Chang

Note At the end of this tutorial, links to online help direct you to where you can learn more aboutthe theory behind flexible bodies and CMS method.

Flexbody Generation Using Optistruct

There are two ways you can generate flexible bodies using Optistruct:

1. Using the FlexPrep utility in MotionView.

2. Manually editing the input deck.

Using the FlexPrep utility in MotionView interface

FlexPrep is a MotionView utility which allows you to generate a flexible body from a finite elementmesh. It also allows translation between various flexbody formats. These translations arediscussed in the next section, "Flexbody Translation Using Flexprep".

Page 176: Altair MotionView 11.0 Tutorials

171 MotionView 13.0 Tutorials

Proprietary Information of Altair Engineering

Altair Engineering

Using the FlexPrep GUI, you can:

generate a flexible body from any Optistruct or Nastran bulk data file.

create RBE2 spiders.

request for stresses and strains.

create Optistruct preparation file which can be used in the file size reduction of a flexiblebody.

Manually Editing the Input Deck

You can manually insert certain cards in the Optistruct input deck to run the Component ModeSynthesis 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 ofthe flexible body H3D.

By modifying the input deck, you can:

request only the skin elements of the flexbody to display .

request stress and strain information for a selected set of elements.

use released degrees of freedom for the interface nodes.

The following data is included in a flexbody H3D file:

1.Nodal positions.

2. Element connectivity.

3. Eigenvalues of all modes.

4. Inertia invariants (optional).

5.Nodal mass.

6.Nodal inertia (optional).

7. Translational displacement mode shapes.

8. Rotational displacement mode shapes.

9. Interface node IDs (optional).

10.Element stress/strain tensors (optional).

11.Global (rigid) inertia properties (optional).

Flexprep.exe always generates points 1, 2, 3, 4, 5, 6, 7, 8, 9, and 11 and writes them to the

H3D file. Points 4, 6, 9, and 11 are not strictly required.

Flexbody Translation Using FlexPrep

FlexPrep allows you to translate a flexbody from one format to another. Using FlexPrep, you can:

1. Mirror an existing flexible body H3D file about a plane.

2. Translate an ADAMS MNF file to an Altair H3D file.

3. Translate an H3D file to an ADAMS MTX file.

4. Translate an Altair H3D file to ADAMS MNF file.

Page 177: Altair MotionView 11.0 Tutorials

Altair Engineering 172

Proprietary Information of Altair Engineering

MotionView 13.0 Tutorials

5. Translate an Nastran PCH file to an Altair H3D file.

6. Translate an Altair H3D file to DADS DFD file.

Note Once the flexbody H3D is created, it can be used in the MBD model and the model can besubmitted to either MotionSolve or ADAMS. This is covered in the following tutorials.

Stress Recovery and Fatigue Calculations

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 theorthogonalized displacement modes. Every displacement mode is associated with a particularnumber of stress modes, each representing a basic stress tensor. This particular numberdepends 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 arecarried out. The modal participation factors obtained from the simulation are used to linearlysuperimpose the stress modes to come up with the stress tensor for each element. This stresstensor is used to calculate the other components of stresses: Principal, Shear, or von Mises.

Page 178: Altair MotionView 11.0 Tutorials

173 MotionView 13.0 Tutorials

Proprietary Information of Altair Engineering

Altair Engineering

MV-2010: Flexbody Generation using Flex Prep andRadioss

In this tutorial you will:

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:

1. Using FlexPrep utility in MotionView interface.

2. Manually editing the input deck (*.fem) for Optistruct solver.

Introduction to Flex Prep

Flex Prep is a tool in MotionView which is used to:

create flexbody H3D files using Optistruct.

create flexbody H3D file from ADAMS MNF and NASTRAN PCH.

translate flexbody H3D file to ADAMS MTX, Altair H3D (mirrored), ADAMS MNF, DADS FDF, andnCode FES.

Exercise: Creating and Simulating Flexible LCA

In this exercise, you will generate a flexible body for a left Lower Control Arm of a front SLAsuspension. The input file is a pre-prepared .fem file (sla_flex_left.fem) which has finite element

modeling information for the LCA (elements and nodes). Interface nodes for the flexible body are:

the center nodes at the front and rear bushing mounts

location where the spring is attached

the center of the lower ball joint attaching to the knuckle.

In the given input file, interface nodes are already created at the center of the bushing mounts andthe spring attachment location. You will create the interface node at the lower ball joint and itsconnection to the LCA in the exercise.

Step 1: Using FlexBodyPrep.

Once you provide the required input, Flex Prep generates an input deck (_prp.fem) for the Optistruct

solver with all the required cards, and then it calls Optistruct to run the job. Please refer to tutorial MV-2000 to understand all the inputs and process.

Note The file sla_flex_left.fem needed to start this exercise is located in the folder

<installation_directory>\tutorials\mv_hv_hg\mbd_modeling\flexbodies. Please copy

it to your working directory before proceeding further.

1. Open a new MotionView session.

Page 179: Altair MotionView 11.0 Tutorials

Altair Engineering 174

Proprietary Information of Altair Engineering

MotionView 13.0 Tutorials

2. From the Flex Tools menu, select Flex Prep.

Launching Flex Prep

2. Select Optistruct Flexbody generation.

3. From the pull down menu, pick the option Create Optistruct prp (preparation) file andgenerate the h3d flexbody.

4. Click on the file browser icon, , next to Select Bulk Data file and select the input bulk datafile 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-Bamptoncomponent mode synthesis.

7. In the Specify Interface Node List field, enter 10001+10002+10003.

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.

Limiting Modal Information

MotionView allows you to specify a limit on the modal information contained in your H3D file. Twomethods 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.

We used the first method in this exercise.

9. Switch on Perform stress recovery by clicking on the check box next to it.

With this option set, the Flex Prep puts relevant cards in the Optistruct input deck to calculatethe modal stresses while processing your bulk data file.

10. Switch on Perform Strain Recovery by clicking on the check box next to it.

With this option set, the Flex Prep puts relevant cards in the Optistruct input deck to calculatethe modal strains while processing your bulk data file.

Page 180: Altair MotionView 11.0 Tutorials

175 MotionView 13.0 Tutorials

Proprietary Information of Altair Engineering

Altair Engineering

11. Under Specify units in bulk data file, select the following:

Mass Units Kilogram

Length Millimeter

Force Newton

Time Second

Note HyperMesh is unit-less and you need to make sure to use consistent units, or theflexbody generated will have incorrect modal frequencies. In the given input file, the density usedis in unit kg/mm^3. Hence, you will use kilogram as the mass unit in this exercise.

Generally, FE analysts using mm-N-sec as Length, Force and Time units need to specify mass as aderived unit as N-sec^2/mm (equivalent to tonne/mm^3/MEGAGRAMS). If the model that youuse in the future may have such units, use MEGAGRAMS for the mass units in FlexBodyPrep.

12. There are three RBE2 spiders already in the sla_flex_left.fem. The fourth RBE2 spider should

be created using the Create RBE2 Spiders option explained in the next step.

Step 2: Create RBE2 Spiders.

If you have a circular hole in your finite element (FE) model and need to use the center of the hole asthe interface node, you need to transfer the loads from the center node to the peripheral nodes. Thisfeature allows to you create RBE2 spiders at the hole in the FE model to transfer forces from theinterface node to peripheral nodes of the hole.

Note: If the finite element model definition is complete (all interface nodes and connections alreadyexist), this step is not required.

Description of an RBE2 Spider

An RBE2 is a rigid element whose independent degrees of freedom are specified at a single grid pointand whose dependent degrees of freedom are specified at an arbitrary number of grid points. This isusually used to model relatively stiff connections.

1. Click the Create RBE2 Spider button.

Page 181: Altair MotionView 11.0 Tutorials

Altair Engineering 176

Proprietary Information of Altair Engineering

MotionView 13.0 Tutorials

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 theBrowser 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 viewit:

From the View menu, select the Utility Menu.

From the Utility menu, click the User button, located at the bottom of the page.

3. The Info button details the procedure to create RBE2 spiders.

4. Zoom into the area of the lower ball joint location as shown in the image below:

5. Click the Step 2: Superspider to create one spider at a time.

Page 182: Altair MotionView 11.0 Tutorials

177 MotionView 13.0 Tutorials

Proprietary Information of Altair Engineering

Altair Engineering

6. Select a node on the periphery of the hole and click Proceed.

7. The script would create a RBE2 Spider automatically as shown in image below:

8. Click the Step 3: Save and Close, which will save the modified file and automatically grab the IDof 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.

Page 183: Altair MotionView 11.0 Tutorials

Altair Engineering 178

Proprietary Information of Altair Engineering

MotionView 13.0 Tutorials

9. The new interface node IDs are automatically added to the interface node list in FlexBodyPrep asdisplayed in the image below:

10. Click OK to launch Optistruct in a command window.

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 thestatus of the Optistruct run and look for any error messages there.

11. Click OK in the Output window to close.

Page 184: Altair MotionView 11.0 Tutorials

179 MotionView 13.0 Tutorials

Proprietary Information of Altair Engineering

Altair Engineering

Step 3: Viewing the model and verifying results.

In this exercise, you will verify your work in Step 1 by viewing the flexible control arm in HyperView.

1. From Select window mode drop-down menu on the toolbar, select HyperView.

The Load model and results: panel is displayed.

2. Click the Load model file browser and select the H3D flex file, <working directory>/

sla_flex_left.h3d.

The flexible arm model and its modal results are contained in the H3D flex file you created usingthe Flexprep wizard.

Load model and results fields

HyperView automatically updates the Load results file field with the same filename.

Page 185: Altair MotionView 11.0 Tutorials

Altair Engineering 180

Proprietary Information of Altair Engineering

MotionView 13.0 Tutorials

3. Click Apply to load the model into the HyperView.

Flexible LCA Model

4. Click the Select animation mode arrow and select Set Transient Animation Mode, .

5. Animate the results by clicking the Start Animation icon, .

HyperView sequentially animates the flexible control arm through its mode shapes. The modenumber and its frequency are displayed at the top-right of the window.

6. Stop the cycling of modes by clicking the Pause Animation icon , .

Page 186: Altair MotionView 11.0 Tutorials

181 MotionView 13.0 Tutorials

Proprietary Information of Altair Engineering

Altair Engineering

7. Click the Select animation mode arrow and from the drop-down list, select Set ModalAnimation Mode.

8. To animate a particular mode shape, go to the Results Browser and change the mode fromUndeformed Model Frame to Mode 7.

Selecting specific mode using the Simulation selector panel

Note Although there is not a direct correlation possible, you can recognize the first six modesas rigid body modes due to near zero frequency values. If there are more than six modesthat are near zero, it generally indicates a model integrity problem (one or more elementsare free and not connected to other elements).

Page 187: Altair MotionView 11.0 Tutorials

Altair Engineering 182

Proprietary Information of Altair Engineering

MotionView 13.0 Tutorials

9. Click the Animation icon, , to animate the selected mode.

Toggle the animation on and off by clicking the button.

You can similarly animate other modes of the flexible body.

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:

Page 188: Altair MotionView 11.0 Tutorials

183 MotionView 13.0 Tutorials

Proprietary Information of Altair Engineering

Altair Engineering

12. Click Apply to display the contours and the legend in the graphic area.

vonMises Stress contours displayed on the model

The above exercise demonstrated generating a flexible body using MotionView. Flexible bodiescan also be generated by using Hypermesh and Optistruct. To learn more, you can refer totutorial OS-1930 - Generating a Flexible Body for use in Altair MotionSolve.

Step 4: Invoking FlexPrep in batch mode.

The FlexPrep executable can also be invoked in batch mode.

To run the FlexPrep from the command line in LINUX or Mac:

<install_path>/altair/scripts/flexprep

To run the FlexPrep from the command line in DOS:

<install_path>\io\translators\bin\<os>\flexprep.exe (where <os> is either win32 or win64).

Page 189: Altair MotionView 11.0 Tutorials

Altair Engineering 184

Proprietary Information of Altair Engineering

MotionView 13.0 Tutorials

The usage options and corresponding syntax is listed if the above command is given without anyarguments.

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 suspensionby invoking flex prep in batch mode.

Note In this exercise, you will run the FlexPrep translator from the MS DOS prompt for the WindowsOperating System. You may follow analogous steps for the Linux/Mac OS terminal.

1. From the Start menu, open an MS DOS prompt window.

2. Use the cd command to navigate to your working directory.

3. Enter the command to launch FlexPrep <install_path>\translators\flexprep.exe.

4. Go through the usage options for running the FlexPrep translator in batch mode.

5. Enter the following command:

<install_path>\io\translators\bin\<os>\flexprep.exe sla_flex_left.h3dsla_flex_right.h3d -MIRROR_XZ

6. FlexPrep creates the mirrored lower control arm sla_flex_right.h3d flexbody file.

Exercise: Manual Methods to Reduce the Size of the Flexbody

The previous exercise discussed flexbody generation using FlexPrep. It is possible to generateflexbodies directly from Optistruct by editing the input FEM file and adding the cards that invoke theflexbody generation from Optistruct. Steps 1 to 4 below discuss these cards in brief.

Understanding the Optistruct input file for flexbody generation

1. Open the file sla_flex_left_complete_prp.fem in any text editor.

2. The first few lines of the FEM file are given below with explanation for each line:

Line 1: SUBCASE 1

Line 2: OUTFILE, sla_flex_left

Line 3: CMSMETH 1

Line 4: STRESS=ALL

Line 5: STRAIN=ALL

Line 6: BEGIN BULK

Line 7: DTI, UNITS, 1, KG, N, MM, S

Line 8: PARAM COUPMASS -1

Line 9: PARAM CHECKEL YES

Line 10: CMSMETH, 1, CB, , 10

Line 11: ASET1, 123456, 10001

Page 190: Altair MotionView 11.0 Tutorials

185 MotionView 13.0 Tutorials

Proprietary Information of Altair Engineering

Altair Engineering

Line 12: ASET1, 123456, 10002

Line 13: ASET1, 123456, 10003

Line 14: ASET1, 123456, 10004

SET DATA FOLLOWS

BULK DATA FOLLOWS

A generalized input deck (FEM file) need the cards specified above to generate a flexbody fromOptistruct. The definition of each line is as follows:

Line 1: SUBCASE – indicates the start of a new subcase definition.

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 togenerate flexbodies in Optistruct.

Line 4: STRESS=ALL – use to specify that modal stresses are to be computed by Optistruct for allthe elements in the model.

Line 5: STRAIN=ALL – use to specify that modal strain values are to be computed by Optistructfor all the elements in the model.

Line 6: BEGIN BULK – defines the start of FE entities in the model.

Line 7: DTI, UNITS – defines the units for the flexbody.

Line 8: PARAM COUPMASS -1 – defines values for parameters used by Optistruct for thegeneration of a flexbody. In this case, lumped mass matrix approach is used by Optistruct foreigenvalue 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 toinaccurate results.

Line 10: CMSMETH CB 10 – component mode synthesis method selected is Craig Brampton and 10modes 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 belarge 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 isrequested.

OUTLINE – Reduces the model information to display only boundary edges.

Reduced DOF – Reduces the number of DOF that contribute to the flexible body information.

Page 191: Altair MotionView 11.0 Tutorials

Altair Engineering 186

Proprietary Information of Altair Engineering

MotionView 13.0 Tutorials

Modifying the Input Deck to Incorporate Stress/Strain Set, Model Set, Outlineand Released DOF into the Flexbody

In finite element modeling, nodes or elements can be grouped together to form a SET. These groupscan then be used in other modeling cards that can take the nodes and elements as inputs collectively. In flexible body generation, the need to incorporate these sets in the Optistruct input deck is:

to reduce the size of the flexbody.

to help increase the speed of the multi-body pre-processing, simulation and animation.

Step 1: Stress/strain set in Optistruct.

The cards STRESS and STRAIN specify the elements for which the stress and strain computationshave to be carried out during flexbody generation. Use this card if you are interested in viewingstress results for the body in your analysis. If the objective of using a flexible body is to incorporatethe flexibility of the body and not calculate stresses, then not using this card drastically reduces thesize of the H3D.

Syntax of the STRESS and STRAIN cards:

STRESS=[setid|ALL|NONE]

STRAIN=[setid|ALL]

setid is the ID of the set of elements.

Alternatively, if ALL is specified, the stress/strain is calculated for all elements.

If NONE is specified, the stress is not calculated on any elements. (Not having the STRESS card hasthe same effect).

In the FEM file that is opened, you can observe SET cards defined for nodes (keyword GRID) andelements (keyword ELEM).

1. Modify the cards STRESS=ALL and STRAIN=ALL as STRESS=5 and STRAIN=5, respectively.

2. Modify the OUTFILE to read as OUTFILE, sla_flex_left_stress_set.

3. Save the file as sla_flex_left_stress_set.fem and close the file.

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 commandprompt, 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.

6. Load in the H3D file sla_flex_left_stress_set.h3d generated by Optistruct.

7. Go to the Contour panel to apply Stress and Strain contours. You will see that only a fewelements display the contours. These are the elements that were pre-selected for stress andstrain computations using the element set.

Page 192: Altair MotionView 11.0 Tutorials

187 MotionView 13.0 Tutorials

Proprietary Information of Altair Engineering

Altair Engineering

Step 2: Model Set in Optistruct.

This card lets you control the display of elements of the flexbody in the H3D file while using the H3Dfile during pre- and post-processing in MotionView.

Syntax of the MODEL card:

MODEL=setid|PLOTEL

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.

The PLOTEL option will be discussed further in this tutorial

1. Open the FEM input deck sla_flex_left_stress_set.fem in a text editor.

2. Add the model card as MODEL=4 above the line STRESS=5.

3. Change the OUTFILE line to read as OUTFILE, sla_flex_left_model_set.

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 theOptistruct Flexbody Generation drop-down menu, select the option Create h3d flexbodyusing pre-existing prp file.

6. In HyperView, load the H3D file generated by Optistruct.

You will see that only a part of the flexbody is displayed. Only those elements included in the setthat is used with the MODEL card are displayed here.

Step 3: Outline feature using PLOTEL elements in Optistruct.

The size of the flexbody can be greatly reduced by using PLOTEL elements in the Optistruct inputdeck for flexbody generation. In case you would like only the edges of the flexbody to be displayed in MotionView, PLOTEL elements can be defined in the input deck and displayed using the MODEL card.PLOTEL is a one-dimensional dummy element for use in display. This element does not contribute anymass or stiffness to the part.

Syntax of the PLOTEL element:

PLOTEL EID G1 G2

Where PLOTEL is the element type, EID is the element ID, G1 and G2 are the nodes used to define theelement. For example: PLOTEL 8786 4698 1702

The FEM file that you are working with already contain PLOTEL elements.

Page 193: Altair MotionView 11.0 Tutorials

Altair Engineering 188

Proprietary Information of Altair Engineering

MotionView 13.0 Tutorials

The procedure to incorporate the PLOTEL feature is briefly explained here:

You can use the features option in HyperMesh to generate the PLOTEL elements of thefeature edges of your model automatically. The features option is available on the Tool pagein HyperMesh.

The picture below shows a flexbody model with PLOTEL elements created with the featuresoption:

Use the MODEL card and specify the PLOTEL option.

MODEL=PLOTEL (to skip writing rigid elements like RBE2 as part of plotel, use optional keywordNORIGID)

Save the FEM file and run it in Optistruct to generate the flexbody that displays only thePLOTEL elements.

1. Open the FEM deck sla_flex_left_model_set.fem, saved earlier in your working directory.

2. Replace the MODEL=4 by MODEL=PLOTEL.

Within the BULK DATA, you will be able to see the many PLOTEL elements.

3. Change the OUTFILE line to read as OUTFILE, sla_flex_left_plotel_set.

4. Save the file as sla_flex_left_plotel_set.fem.

Page 194: Altair MotionView 11.0 Tutorials

189 MotionView 13.0 Tutorials

Proprietary Information of Altair Engineering

Altair Engineering

5. Run the FEM deck in Optistruct or you can generate the flexbody from FlexPrep. From theOptistruct Flexbody Generation drop-down menu, select the option Create h3d flexbodyusing pre-existing prp file.

6. In HyperView, load the H3D file generated by Optistruct.

You will see that the flexbody is shown only as lines or edges defined by the PLOTEL elements

Step 4: Released DOF method for interface nodes in Optistruct.

The released DOF (degrees of freedom) feature enables you to free some degrees of freedom of theinterface nodes. If the appropriate DOF (corresponding DOF that are free in the MBD model) arereleased for a particular interface node, the simulation is not affected in any way. Depending on thekind of kinematic constraints in the model and the MBD simulation being carried out, you can releasethe appropriate degrees of freedom at the interface nodes to reduce the size of the H3D filegenerated.

The ASET1 card is used define the boundary degrees of freedom of an interface node of a flexbody.

Syntax of the ASET1 card:

ASET1 C G1 or ASET1, C, G1

Where ASET1 is the card name, C is the DOF to be constrained, and G1 is the node ID. For example:

ASET1, 123456, 4927

This means that the interface node of ID 4927 will be constrained for all DOF, where 123456represents the three translational and three rotational nodes in that order. Thus, to release a DOFfrom 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

2. Change OUTFILE to read as OUTFILE, sla_flex_left_rdof.

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 OptistructFlexbody 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 thereleased DOF incorporated into the flexbody.

Compare the sizes of all the H3D files generated using the cards mentioned in this step to knowthe reduction in file size.

Page 195: Altair MotionView 11.0 Tutorials

Altair Engineering 190

Proprietary Information of Altair Engineering

MotionView 13.0 Tutorials

MV-2020: Use of Flexbody in MBD Models

In this tutorial you will:

use the flexible bodies created in tutorial MV-2010 in an MBD model and solve the model usingMotionSolve.

Exercise: Simulating a Front SLA suspension with FlexibleLCA

Step 1: Replacing rigid bodies with flexible bodies and solving them inMotionSolve.

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

Model Type Front-end of the vehicle

Driveline Configuration Defaults <No driveline>

Primary Systems Front Suspension = Frnt. SLA susp (1 pc LCA)and defaults for the rest

Steering Subsystems Steering Column = Steering column 1 (not forabaqus) and Steering boost = None

Springs, Dampers, and Stabars Defaults

Jounce/Rebound Bumpers Defaults

Label and Varname Defaults

Attachment Wizard Compliant = Yes; Defaults for the rest

Assembly Wizard settings

You should make sure to select Frnt. SLA susp (1 pc LCA) since the flexible bodies you havecreated 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 clickFinish.

5. The Vehicle Parameters form is displayed. Click Finish.

Page 196: Altair MotionView 11.0 Tutorials

191 MotionView 13.0 Tutorials

Proprietary Information of Altair Engineering

Altair Engineering

6. From the Project Browser, select Lwr control arm from the Bodies folder (located underneaththe FrntSLA Susp (1 pc.LCA) system).

The Bodies panel is displayed.

7. Under the Properties tab for the Lwr control arm-left, deselect the symmetry check-box,Symmetric properties.

8. The Set Symmetry confirmation dialog is displayed. Click Retain to retain the current values ofproperties of Lwr control arm-right.

9. Select the Deformable 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 filename as the graphic file you specified in point 10.

Properties panel

The flexible body drops into the right position.

Note You need to specify the flexbody H3D file as the H3D file. Specify the same or any otherfile as the Graphic file.

External Graphics for Flexbodies

Use of large flexbodies is becoming very common. For faster pre-processing, you can use any graphicfile for the display and use the flexbody H3D file to provide the data to the solver. You can use theinput FEM deck or the CAD file used for the flexbody generation to generate a graphic H3D file usingthe CAD to H3D Conversion and specify that file as the Graphic file. This will make pre-processinga much more efficient process.

Page 197: Altair MotionView 11.0 Tutorials

Altair Engineering 192

Proprietary Information of Altair Engineering

MotionView 13.0 Tutorials

Locate Feature

The Locate button on this panel is an optional step to relocate a flexible body if it is not imported inthe desired position. This may happen if the coordinate system used while creating the flexible bodyin the original FEM model does not match the MBD model coordinate system. However, if your flexiblebody is already in the desired position, you can skip this step.

12. Click Nodes….

The Nodes panel is displayed.

The Nodes panel is used to resolve the flexbody’s attachments with the vehicle model, since thevehicle 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 mapeach of the markers to a node. The panel also displays the point coordinates of the marker originwhich 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 locatedclosest to the interface points on the vehicle model. Node ID column is populated with theinterface node numbers for each row of connections. Also, the node coordinate table is alsopopulated 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 thecoordinate values between the point at which the joint Lwr ball jt is defined and itscorresponding location of the interface node 10004. Click Align to move the point to the nodalcoordinate position.

Note Many times there is a little offset between the flexible body interface node and itscorresponding point in the model. When you click the Align button, MotionView movesthe connection point in the model to the node location on the flexible body. This couldaffect other entities that reference this point. Hence, this option should be used withcaution. Generally, it is common to have minor offsets (values between 0.001mm to0.1mm). If the offset is more than the tolerance value, MotionView inserts a dummybody between the flexible body and the nearest connection point. If the offset value istoo high, it could indicate an mismatch of the FE model information with respect to theMBD model. In such an event, it is recommended to review the models and reconcile thedifferences.

15. Close the Nodes dialog.

Page 198: Altair MotionView 11.0 Tutorials

193 MotionView 13.0 Tutorials

Proprietary Information of Altair Engineering

Altair Engineering

16. Click the Modes button. The Modes panel is displayed. This option lets you select the modesthat will be active during the simulation. By default, the rigid body modes are deactivated. Youcan also change the damping used for modes.

Note By default, for frequencies under 100Hz, 1% damping is used. For frequencies greaterthan 100Hz and less than 1000Hz, 10% damping is used. Modes greater than 1000 Hz usecritical damping. You can also give any initial conditions to the modes.

Please note that when selecting the modes, the simulation results may vary as youchange the modes to be included in the simulation.

17. Click Close.

Page 199: Altair MotionView 11.0 Tutorials

Altair Engineering 194

Proprietary Information of Altair Engineering

MotionView 13.0 Tutorials

18. Repeat steps 7 through 17 to integrate the right side flexible body sla_flex_right.h3d (created

in tutorial MV-2010) in your model.

Your model should look like the image below:

Now you will review the properties of the FEM model file.

19. Click the FEM Inertia Props tab.

The following information is displayed:

Bodies panel/FEM Inertia Props tab

20. From the Tools menu, select Check Model to check your complete MBD model for errors.

Page 200: Altair MotionView 11.0 Tutorials

195 MotionView 13.0 Tutorials

Proprietary Information of Altair Engineering

Altair Engineering

21. From the Standard toolbar, click the Save Model icon, , to save your model as an MDL filenamed sla_flex.mdl.

The Save As Model dialog is displayed.

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.

Page 201: Altair MotionView 11.0 Tutorials

Altair Engineering 196

Proprietary Information of Altair Engineering

MotionView 13.0 Tutorials

MV-2021: Simulating an Automotive Door ClosureEvent

In this tutorial, you will learn how to:

use an FEM file to create a flexible body file.

use body data to create a rigid body model.

make the door flexible and use the flexbody file created in the model.

set up a door closure simulation.

Note

Copy the files metro_door.fem and car_body_graphics.hm from the location

<installation_directory>\tutorials\mv_hv_hg\mbd_modeling\flexbodies

to your <Working directory>.

Step 1: Review of a finite element model for the flexible door.

In this step, we will review the contents of the finite element (FE) model, which is the starting pointfor creating a flexible body.

1. Import the model metro_door.fem in HyperMesh.

2. Click the Model Browser on the left of the graphics area and expand the model tree to review allcomponents, properties, and materials of the model.

Page 202: Altair MotionView 11.0 Tutorials

197 MotionView 13.0 Tutorials

Proprietary Information of Altair Engineering

Altair Engineering

3. The FEM model should have the following attributes:

A decent, quality mesh on all components.

The Section properties are assigned to all components.

All components refer to appropriate materials.

4. Identify the interface nodes of the flexible body. Please check the following nodes by ID: 9751,9750, 10090.

5. Export the FEM as metro_door_flex.fem for Flexbody Generation.

Page 203: Altair MotionView 11.0 Tutorials

Altair Engineering 198

Proprietary Information of Altair Engineering

MotionView 13.0 Tutorials

Step 2: Generating the flexbody using Flex Prep

In this step, we will use the FEM file created in Step 1 and use Flex Prep to generate a flexible bodyH3D file. A pre-requisite for going through this step of the tutorial is an understanding of Flex Prepas described in the tutorial: MV-2010: Flexbody Generation using Flexprep and Optistruct.

1. In MotionView, from the FlexTools menu, select Flex Prep. The FlexBodyPrep dialog isdisplayed.

2. Once the FlexBodyPrep dialog is displayed, enter the following information in the FlexBodyPrepdialog to generate the flexbody for building the door closure model.

Page 204: Altair MotionView 11.0 Tutorials

199 MotionView 13.0 Tutorials

Proprietary Information of Altair Engineering

Altair Engineering

3. See the image above where the entries and options on the FlexBodyPrep dialog are labeled withnumbers.

4. For #2, Select Bulk Data file (fem/nas/bdf/dat):, specify the input file metro_door_flex.fem

generated in Step 1.

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 forPerform element check in Optistruct model.

9. For Mass units, select Megagram.

10. Click OK to start the flexbody generation.

11. The flexbody H3D file is generated in the selected folder with the name metro_door_flex.h3d.

Page 205: Altair MotionView 11.0 Tutorials

Altair Engineering 200

Proprietary Information of Altair Engineering

MotionView 13.0 Tutorials

Step 3: Creating the MBD model of the car door.

In this step, you will create the MBD model of the car door, after which the door closure simulationcan be performed.

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

For building this model, a total of six points need to be created.

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.

Table 1 – Points required for the model

Bodies

In this model, there are two bodies: one body to represent the car and another to represent theflexible 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 asshown in Table 2 below.

Table 2 – Mass and inertia properties of the car body

4. Add another body and label it Car Door.

Page 206: Altair MotionView 11.0 Tutorials

201 MotionView 13.0 Tutorials

Proprietary Information of Altair Engineering

Altair Engineering

5. From the Properties tab, click the Deformable check box.

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.

Graphics

After Point 6 above, we see that the Door Body has a graphical representation, but Car Body is stillnot graphically represented. Let’s add a File Graphic to the Car Body so that visualization of themodel becomes more meaningful.

1. From the Tools menu, select Import CAD or FE.

2. From the Input File drop-down menu, select HyperMesh. Use the file browser to select theHyperMesh file car_body_graphics.hm.

Page 207: Altair MotionView 11.0 Tutorials

Altair Engineering 202

Proprietary Information of Altair Engineering

MotionView 13.0 Tutorials

3. From the Output File drop-down menu, select H3D. Specify the name of the H3D file ascar_body_graphics.h3d.

4. Click OK. The HyperMesh file is converted to H3D and imported into the MotionView window.

5. From the Graphics panel, , click the graphic just now added.

6. From the Connectivity tab, double-click the Body button and pick Car Body as the body. Thiswill 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 tobe 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.

Table 3 – List of the joints to be created and their topology

Once the joints are specified and since there is a flexible body in the model, the interface nodesof the flexible body have to be associated with corresponding joint markers.

2. From the Bodies panel, select Car Door.

Page 208: Altair MotionView 11.0 Tutorials

203 MotionView 13.0 Tutorials

Proprietary Information of Altair Engineering

Altair Engineering

3. From the Properties tab, click the Nodes… button.

4. From the Nodes dialogue, click Find All to find the interface node numbers and to resolve themwith 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.

2. Click the Initial Conditions tab.

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 theconstraints.

Markers

To represent the locking mechanism of the car door, we will use a sensor activated fixed jointbetween the Car Body and the Door Body that initially is deactivated. The fixed joint will need to becreated using XML templates since the MotionView interface allows joints to be created using bodiesand 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 tablebelow.

Table 4 – List of markers to be created and their topology

2. Once the markers are created, repeat steps 2-4 under Joints above to resolve the nodeconnections 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 theevent detection, the fixed joint between the door and the car body is activated to simulate the actuallocking 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.

Page 209: Altair MotionView 11.0 Tutorials

Altair Engineering 204

Proprietary Information of Altair Engineering

MotionView 13.0 Tutorials

3. Use the following expression as the signal: DY({MODEL.m_door.idstring},

{MODEL.m_car.idstring},{MODEL.m_car.idstring}).

The DY function accepts three markers as arguments. It returns the Y distance of the firstmarker from the second marker in the third marker’s reference frame. In this case, the firstmarker is the maker labeled Door Lock Mark, which belongs to the Car Door Body. The secondand 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.

Templates

To simulate the door lock, we need a fixed joint between the door and the car body. The fixed jointneeds to be activated with the sensor. The activation of the joint and the deactivation of the sensorcan 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 labelit 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.

5. Specify the label as Seq Sim Commands.

6. From the Properties tab of the template, under Type, select Write text to solver commandfile.

Page 210: Altair MotionView 11.0 Tutorials

205 MotionView 13.0 Tutorials

Proprietary Information of Altair Engineering

Altair Engineering

7. Below are XML Commands for the sequential simulation. Enter the following blocks of XMLcommands 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"/><Simulate analysis_type = "Transient" end_time = "2.5" print_interval = "0.001"/><Stop/>

These set of XML blocks define a sequential simulation operation as specified in the steps below:

A.Deactivate Fixed Joint (initially).

B. Simulate for 1 second.

C.Activate Fixed Joint.

D.Deactivate Sensor.

E. Change the Integrator Type to VSTIFF.

F. Simulate for 1.5 seconds.

G.Stop simulation.

Continuing from step 7:

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 specifya name for the solver XML file.

10. Click Run to run the model in MotionSolve.

11. Once the run is complete, click Animate to animate the simulation results.

Page 211: Altair MotionView 11.0 Tutorials

Altair Engineering 206

Proprietary Information of Altair Engineering

MotionView 13.0 Tutorials

MV-2035: Solving Flexbody ADM/ACF in MotionSolve

In this tutorial, you will learn how to:

solve an ADM/ACF model that has flexbodies using MotionSolve.

use the Add Object panel in Hyperview and view the transient analysis results fromMotionSolve.

Theory

You can submit Adams dataset language files (ADM and ACF) directly to MotionSolve, thus avoidingmanual translation. The Adams model is first automatically translated into the MotionSolve XML formatand 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 themass and inertia properties, as well as the flexibility properties which allow the body to deform underthe application of loads. The deformation is defined using a set of spatial modes and time dependentmodal coordinates.

Process

In this tutorial, an Adams single cylinder engine model (ADM and ACF) is provided. To improve theaccuracy of the model responses, the connecting rod is modeled as a flexbody (MNF and MTX). Thischapter 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 istranslated into MotionSolve XML format and solved. MotionSolve outputs the results H3D file, whichcan be loaded in HyperView for animation. In HyperView, external graphics (for piston and crank) canbe added for visualization.

MotionSolve supports most of the Adams statements, commands, functions, and user subroutines.Refer to the MotionSolve User’s Guide help for additional details.

Tools

Copy the following files from <installation_directory>\tutorials\mv_hv_hg\mbd_modeling

\motionsolve 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

Page 212: Altair MotionView 11.0 Tutorials

207 MotionView 13.0 Tutorials

Proprietary Information of Altair Engineering

Altair Engineering

Note Below is a table listing the flexbody files in Adams and the equivalent files for MotionSolve:

Adams MotionSolve

Flexbody file mnf and mtx h3d flexbody

Post processinganimation

Gra and res h3d-animation

Plot Req plt/abf

Step 1: Modifying the ACF file.

1. Start a new MotionView session.

2. Click the Select Application icon, ,and choose Text View, .

3. From the toolbar, click the arrow next to the Open Session icon, , and select Open

document , . Select single_cylinder_engine.acf, located in your <working directory>.

4. Add the following text in line 3 :

FLEX_BODY/1, H3D_FILE=connecting_rod_flex_body.h3d

The ACF file should look like this:

5. From the toolbar, click the Save Document icon, , and save the file assingle_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 moreinformation on converting an Adams MNF file into a MotionView H3D flexbody.

Page 213: Altair MotionView 11.0 Tutorials

Altair Engineering 208

Proprietary Information of Altair Engineering

MotionView 13.0 Tutorials

Step 2: Running the ACF file in MotionSolve.

1. Click Start > All Programs > Altair HyperWorks > MotionSolve.

2. For Input file, click Browse and select All files (*.*) from the file type menu. Select the inputfile 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 andMTX files to a flexbody H3D file.

MotionSolve outputs the following files:

Results H3D file - single_cylinder_engine.h3d

Plot files - single_cylinder_engine.abf and single_cylinder_engine.plt

Log file - single_cylinder_engine.log

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 commandwindow, and at the command prompt type:

[install_path]\hwsolvers\scripts\motionsolve.bat input_filename.[fem,acf,xml]

Step 3: View transient analysis results in HyperView by adding externalgraphics.

Since the ADM file does not carry the external graphic information, the results from MotionSolve willnot contain this information either. From Adams, you can export a Parasolid file which can be used forvisualizing results in HyperView. In this step, we will attach the piston and crank external graphic forbetter result visualization.

1. Start a new HyperView session.

Page 214: Altair MotionView 11.0 Tutorials

209 MotionView 13.0 Tutorials

Proprietary Information of Altair Engineering

Altair Engineering

2. Using the Load model file browser, , select: single_cylinder_engine.h3d, located in your <workingdirectory>.

The Load results file field will be automatically be updated with the single_cylinder_engine.h3d file.

3. Click Apply.

The model is displayed in the window.

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 theselected object to move.

7. For Reference system, select the Global coordinate system.

8. Click Add.

Notice that the piston graphic is added to the model.

9. Repeat steps 5 through 8 to add the crank object to the model.

Note Remember to select the crank.h3d file in the Add Object from: browser and attach it toCrank using the expansion button.

10. Click the Contour icon, , on the toolbar. From the Result type drop-down menu, select thedata 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 thesame for any coordinate system).

12. Click Apply.

The contour is displayed.

13. Click the Start Animation icon, , on the toolbar to animate the model.

Page 215: Altair MotionView 11.0 Tutorials

Altair Engineering 210

Proprietary Information of Altair Engineering

MotionView 13.0 Tutorials

14. Click the Stop Animation icon, , on the toolbar to stop the animation.

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) fromAdams, use the Tools menu > Import CAD or FE utility in MotionView to generatean H3D file. You can then use this file to add the graphics.

Refer to the MotionView help for additional details.

Page 216: Altair MotionView 11.0 Tutorials

211 MotionView 13.0 Tutorials

Proprietary Information of Altair Engineering

Altair Engineering

Automated

MV-1032: Model Building and Simulation using Wizards

MV-1040: Model Building using TCL

MV-1050: Automation Using TCL

MV-1051: Understanding Sequential Simulation

Page 217: Altair MotionView 11.0 Tutorials

Altair Engineering 212

Proprietary Information of Altair Engineering

MotionView 13.0 Tutorials

MV-1032: Model Building and Simulation usingWizards

In this tutorial, you will learn:

About the Assembly and Task Wizards in MotionView

How to build a model using the Assembly and Task Wizards

How to view a standard report

How to modify a model and compare results using the Report Template

Model Wizards are powerful tools in MotionView that can be used to quickly build models with standardtopology that is used repeatedly. There are two standard wizards available: the Assembly Wizardand the Task Wizard (which work in conjunction with one another). Both of these wizards rely on alibrary of pre-saved system, analysis, and report definition files to automate the processes of buildingmodels, analyzing them, and post-processing the results. The wizard mechanics are shown in theflowchart below:

A collection of systems and analyses are stored as a library.

The Assembly Wizard presents the user with various options to select systems to instantiate(in the form of a series of panels).

The systems selected by the user in the panels are instantiated using the system definitionscontained in the MotionView client library, thereby assembling the model comprised of differentsystems. An Attachment Wizard follows, which is used to select possible attachment optionsfor each system that is instantiated.

Page 218: Altair MotionView 11.0 Tutorials

213 MotionView 13.0 Tutorials

Proprietary Information of Altair Engineering

Altair Engineering

On the model is built, the Task Wizard is invoked in order to attach applicable events to themodel. The selected analysis is instantiated using the analysis definition stored in the library.

Exercise: Automated Modeling and Analysis Using Wizards

In this exercise, we will build a suspension model of a vehicle using the standard wizard libraryavailable in MotionView. A static ride event will be attached to this model using the Task Wizard. The model will then be solved in MotionSolve and an automated report will be generated.

Step 1: Building a front suspension model using the Assembly Wizard.

1. Start a new session in MotionView.

2. On the Model menu, click Assembly Wizard.

The Assembly Wizard dialog is displayed.

3. For Model type, select Front end of vehicle.

4. Click Next.

5. For Drive type, select Front Wheel Drive.

6. Click Next.

Page 219: Altair MotionView 11.0 Tutorials

Altair Engineering 214

Proprietary Information of Altair Engineering

MotionView 13.0 Tutorials

7. From the Primary Systems for Front end of vehicle dialog, specify the following:

Vehicle body = Body fixed to ground

Front subframe = None

Front suspension = Front SLA susp (1 pc. LCA)

Steering linkage = Rackpin steering

Powertrain = None

8. Click Next.

9. From the Select steering subsystems dialog, specify the following:

Steering Column = Steering column 1 (not for abaqus)

Steering Boost = None

10. Click Next.

11. From the Select springs, dampers and stabilizer bars dialog, select the following:

Front shocks = Frnt shock absorber (with inline jts)

Front stabilizer bars = None

12. Click Next.

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 beenselected.

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 thedefault selections.

16. From the Attachment Wizard, review the choices for each sub-system and click Next until thelast page of the dialog is reached.

Page 220: Altair MotionView 11.0 Tutorials

215 MotionView 13.0 Tutorials

Proprietary Information of Altair Engineering

Altair Engineering

17. Click Finish.

Your model should look as follows:

A brief description of the model:

This model represents a front end suspension of a vehicle with a Short Long Arm type (also known asWishbone) of suspension and a steering system. The vehicle body is fixed to ground. The upper andlower 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 graphicsfor this body are in the model) is mounted on the knuckle through a revolute joint. The wheel is fixedto the wheel hub.

The steering system consists of a rack with a translation joint with a rack housing (through a dummybody). The ends of the rack are connected to a tie rod at each end through ball joints and the otherend of the tie rod is connected to the steer arm of the knuckle through ball joints. The rack gets itsmovement 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. Thisdefault suspension wizard is configured such that the available analyses choices are dependent on thesystem selections made in the Assembly Wizard. Since this is a half-vehicle model, only events thatare applicable for a half-vehicle model are available. A full vehicle model would contain a different setof analysis events.

In this step, we will add a static ride analysis for the suspension assembly. Through this analysis, thekinematic 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.

Page 221: Altair MotionView 11.0 Tutorials

Altair Engineering 216

Proprietary Information of Altair Engineering

MotionView 13.0 Tutorials

1. On the Analysis menu, click Task Wizard.

2. In the Task Wizards – Front end tasks dialog select the Front end task as Static RideAnalysis from the pull down menu.

3. Click Next.

4. Read the information in the dialog box.

5. Click Finish.

The Vehicle parameters dialog is displayed. Vehicle parameters such as wheelbase, jounce, andrebound distances can be changed in this dialog.

6. Retain the current parameters and click Finish.

Your model should look as follows:

The static ride analysis event consists of a pair of jacks that are attached to the wheels at thetire contact patch location. The jacks are actuated through Actuator Forces that exercises themin the vertical direction in a sinusoidal fashion.

The model tree in the Project Browser now includes an analysis called Static ride analysis. It ispossible to add many different analysis tasks to the same model, however only one analysis taskmay be active at one time.

7. Go to the Project Browser, right-click on Model and select Rename (or left click on Model andpress F2 on the keyboard).

Page 222: Altair MotionView 11.0 Tutorials

217 MotionView 13.0 Tutorials

Proprietary Information of Altair Engineering

Altair Engineering

8. Rename the Model label to My Front SLA Suspension.

9. Expand the Static ride analysis folder and also the Forms folder (located underneath) by clickingthe + sign next to each folder in the Project Browser.

10. Select the Static Ride Parameters Form.

The Forms panel is displayed.

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>.

Step 3: Running the simulation and viewing a report.

The static ride simulation is a 10 second quasi-static run. Within the 10 seconds the jack moves injounce (vertically upwards), then moves down until the rebound position is reached (distance from theinitial position downwards), and then back to its initial position. The amount of travel is as per thedistance specified in the Static Ride parameters form.

1. Click the Run icon, , on the General Actions toolbar.

2. Save your model as sla_rigid.xml in your <working directory>.

3. Click on the Run button to submit the simulation job to MotionSolve.

4. After the job is completed, close the Run window and the Message Log.

5. From the Analysis menu, click View Reports.

The View Reports dialog is displayed.

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 theanimation in subsequent pages.

7. Once the process of adding the pages is complete, use the icons on the Page Controlstoolbar 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. Thisreport lists the suspension factors at each time interval of the simulation.

Page 223: Altair MotionView 11.0 Tutorials

Altair Engineering 218

Proprietary Information of Altair Engineering

MotionView 13.0 Tutorials

How does viewing pre-specified results work?

A report that refers to a report template file (a template that contains plot and animation definitions)can be defined in the MotionView model using the *Report() MDL statement. Whenever a model

containing such a report definition is submitted to a solver, MotionView writes a record of the reportinto a log file named .reports. You can specify the location of this file with the preference file

statement *RegisterReportsLog(path). The default location of the .reports file is:

UNIX - <user home>

PC - C:\Documents and Settings\<user>

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.

Below is a sample entry from the .reports log file:

Front Ride - MSolve Report Front Static Ride 02/10/XX 06:07:58

E:/Altair/hw/mdl/mdllib/Libs/Tasks/adams/Front/Ride/ms_rep_kc_front.tpl

*Report(rep_kc_frnt_mc, Front Ride - MSolve Report, repdef_kc_frnt, "E:/Temp/sla_rigid.h3d", "E:/Temp/sla_rigid.h3d", "E:/Temp/sla_rigid.plt")

The first line contains the report label, model label, and the date and time when the solver input fileswere saved. This information is contained in the Reports dialog. It is recommended that you giveyour 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.

Step 4: Modifying model parameters and comparing the results.

Next, we will modify the suspension parameters. After the simulation is run again, the results canthen be compared.

1. Return to the MotionView client page.

2. Right-click on Frnt SLA susp (1 pc. LCA) in the Project Browser and select Data Summary.

The Data Summary dialog is displayed.

Page 224: Altair MotionView 11.0 Tutorials

219 MotionView 13.0 Tutorials

Proprietary Information of Altair Engineering

Altair Engineering

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.

6. Click the Close button to close the Data Summary dialog.

7. Go to the Run panel , and specify sla_ride_change.xml as the new file name for the xml file.

8. Click the Run button.

9. After the job is completed, close the Run window and the Message Log.

10. From the Analysis menu, click View Reports.

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 theplots.

Page 225: Altair MotionView 11.0 Tutorials

Altair Engineering 220

Proprietary Information of Altair Engineering

MotionView 13.0 Tutorials

12. In the Hyperview client (page 17 of the session), use the Change Model drop-down menu(located in the Results Browser) to change the active result to sla_ride_baseline.h3d as

shown below:

13. Click the Entity Attributes panel button on the Visualization toolbar to enter the EntityAttributes 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 theresults.

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 asmy_susp_analysis.mvw in your working directory.

The model, plot, and animation information is saved in the session file.

Page 226: Altair MotionView 11.0 Tutorials

221 MotionView 13.0 Tutorials

Proprietary Information of Altair Engineering

Altair Engineering

MV-1040: Model Building using Tcl

In this tutorial you will:

Learn the advantages of using Tcl programming to save time and effort in MBD model buildingwith 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 scriptinglanguage that is commonly used for quick prototyping, scripted applications, GUIs, and testing.

More About Tcl/Tk

Tcl has a simple and programmable syntax.

Tcl is open source.

HyperWorks has an inbuilt Tcl interpreter which has libraries to help end users.

Tcl can be used as a standalone or embedded in applications like HyperWorks Desktop(including MotionView).

Unlike C which is a complied language, TCL is interpreted. Tcl programs are simple scriptsconsisting of Tcl commands that are processed by a Tcl interpreter.

Tcl is extensible. New Tcl commands can be implemented using C language and integratedeasily. Many people have written extension packages for common tasks and are freely availableon the internet.

Engineering teams use different resources and application. Tcl can be used to glue thoseresources together. This greatly helps in automating the work flow.

Tk is a Graphical User Interface toolkit that makes it possible to quickly create powerful GUIs.

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.

Tcl with MotionView

When building huge multibody models in MotionView, you will come across cases where thesame steps are repeated multiple times. Such steps, or the set of steps, can be automatedsuing Tcl in order to save time and effort wasted in performing repetitive and time consumingtasks.

Like all of the HyperWorks Desktop applications, MotionView has Tcl command layers which helpin accessing the various functionalities of the product and utilizing them to write scripts toautomate processes.

The Tcl scripts can be called by Tk applications or tied in to a process manager.

Tcl scripts can be registered in a preference file and be made a part of product with Menushortcuts.

Page 227: Altair MotionView 11.0 Tutorials

Altair Engineering 222

Proprietary Information of Altair Engineering

MotionView 13.0 Tutorials

The HyperWorks Desktop handles and the HyperWorks database consists of a hierarchy ofobjects, the root of which is the hwi object which is automatically created. The hwi provides accessto the hwiSession object and a few high level utilities. Currently, HyperWorks supports only onesession per run. The session object can be retrieved by issuing the following command at the Tclcommand prompt:

(System32) 1 % hwi GetSessionHandle sess1

Once the session handle is retrieved, it can be used to access all objects in the HyperWorksdatabase as shown below:

(System32) 2 % sess1 GetProjectHandle proj1

(System32) 3 % proj1 GetPageHandle page1 1

Windows are retrieved as shown below. Windows are assigned a client type, which can be modified.

(System32) 4 % page1 GetWindowHandle win1 1

(System32) 5 % win1 SetClientType "Animation"

(System32) 6 % win1 GetClientHandle post1

A window's client type cannot be changed after the client handle has been retrieved. The clienthandle must be released and retrieved again if the window's client type is changed.

Every HyperWorks command object supports the following utility commands:

ListMethods: Displays the method commands which can be performed on an object.

ListHandles: Lists the names of all command objects of the same type.

ReleaseHandle: Releases the command object.

The top level hwi command object supports the following utility commands:

ListAllHandles: Displays all command objects currently in use.

Exercise: Model Building using Tcl

Step 1: Building a Simple Pendulum through Tcl commands.

In this exercise you will write a simple Tcl script to build a simple pendulum model.

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 thefollowing structure:

hwi OpenStack

Obtain All necessary handles

Perform some function

Release All obtained handles individually

hwi CloseStack

Page 228: Altair MotionView 11.0 Tutorials

223 MotionView 13.0 Tutorials

Proprietary Information of Altair Engineering

Altair Engineering

1. Open a new MotionView session.

2. Go to View menu, and click on Command Window.

3. A TkCon window opens up and displays the version of Tcl and Tk installed with Hyperworks.

4. In the Command Prompt type:

hwi GetSessionHandle sess

The prompt prints sess as the command output if the command is successful. This commandassigns 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:

sess GetProjectHandle proj

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 thesecommands.

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".

9. Now to get the client handle type in:

win GetClientHandle mc

Note A HyperWorks session has multiple clients (HyperView, MotionView, HyperGraph 2D, etc). WhenMotionView 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 handleis 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

Page 229: Altair MotionView 11.0 Tutorials

Altair Engineering 224

Proprietary Information of Altair Engineering

MotionView 13.0 Tutorials

12. To obtain the handle of the model just created in the previous step type in the command:

mc GetModelHandle m

Note Once the model handle is obtained we can now start creating entities using theInterpretEntity and InterpretSet statements.

To build a simple pendulum we will be using 2 points, 1 body, 3 graphic entities, and 1revolute joint.

The syntax for the InterpretEntity command is given below:

modelHandle InterpretEntity EntityHandle Entitytype EntityVariableName EntityLabel <Parameters>

Where:

EntityHandle - The handle for the entity.

Entitytype - The type of entity to create (Point, Body, Graphic, etc.).

EntityVariableName – The variable name for the entity to view in MotionView.

EntityLabel – The label for entity to view in MotionView.

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 acommand:

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 ofcommands are:

m InterpretEntity p Point p_1 "\"Mass\""

m InterpretSet SetPoint p_1 p_0.x+100 p_0.y p_0.z

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

m InterpretSet SetBodyInertia b_0 0.5 100 100 100

m InterpretSet SetOrientation b_0.cm TWOAXES ZX

b ReleaseHandle

Page 230: Altair MotionView 11.0 Tutorials

225 MotionView 13.0 Tutorials

Proprietary Information of Altair Engineering

Altair Engineering

18. To add the graphics on the body for visualization the three graphic entities are added using thecommands:

m InterpretEntity g Graphic gra_0 "\"Graphic_Pivot\"" CYLINDER B_Ground p_0V_Global_Y 1 1 10 -5 CAPBOTH

g ReleaseHandle

m InterpretEntity g Graphic gra_1 "\"Graphic_Pendulum_Cylinder\"" CYLINDER b_0 p_0 p_1 1 CAPBOTH

g ReleaseHandle

m InterpretEntity g Graphic gra_2 "\"GraphicMass_Cylinder\"" CYLINDER b_0 p_1V_Global_Y 5 5 3 -2 CAPBOTH

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 evaluatecommand:

m Evaluate

21. To the fit model in the graphics window:

vch Fit

22. The model is ready to be run. Go to the Run panel, specify a name for the result file and click onthe Run button to run the model using MotionSolve. Use the Animate button to view theanimation.

23. The handles obtained through the commands in the above steps now have to be released usingthe 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 completescript is given below for your reference (please see the bottom of the tutorial).

Note You can also use the file pendulum.tcl located at:

<installation_directory>\tutorials\mv_hv_hg\mbd_modeling\automation\

Copy this file to your <working directory>.

Page 231: Altair MotionView 11.0 Tutorials

Altair Engineering 226

Proprietary Information of Altair Engineering

MotionView 13.0 Tutorials

Step 2: Sourcing the Tcl file.

1. Start a new MotionView session.

2. Go to the View menu from the menu bar.

3. Click on Command Window. A TkCon window opens up at the bottom of the screen.

4. Change the directory to current working directory by using the cd command.

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.

Step 3: Registering the Tcl in the preference file.

1. Open a text editor with a new file.

2. Write the following statements:

*Id("HyperWorks vXX.X")

*BeginModelDefaults()

*BeginMenu(scripts, "My Scripts")

*MenuItem(flexprep, "Build Simple Pendulum", Tcl, "<working directory>/pendulum.tcl")

*EndMenu()

*EndModelDefaults()

Page 232: Altair MotionView 11.0 Tutorials

227 MotionView 13.0 Tutorials

Proprietary Information of Altair Engineering

Altair Engineering

Note Please refer to online help if you need to know more about the syntax.

Replace <working_directory> with the actual path on your machine to the workingdirectory, using forward slashes for the path, if necessary.

3. Save the file as mypreference.mvw in the <working directory>.

4. Start a new MotionView session.

5. From File menu select Load > Preference File.

The Preferences dialog is displayed.

6. Click Register.

7. Select the file mypreference.mvw you created.

A new registered preference is added to the list.

8. Select the new preference and click Load.

9. Close the session and start a new one.

10. You should see a new menu My Scripts in the modeling client. This should be available every timeyou 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.

Page 233: Altair MotionView 11.0 Tutorials

Altair Engineering 228

Proprietary Information of Altair Engineering

MotionView 13.0 Tutorials

The complete script is given below for your reference:

## Macro to Build a Simple Model in MotionView ##

## Requesting for the Handles required to Use MotionView ##

hwi OpenStack

hwi GetSessionHandle sess

sess GetProjectHandle proj

proj GetPageHandle page [proj GetActivePage]

page GetWindowHandle win [page GetActiveWindow]

win GetClientHandle mc

win GetViewControlHandle vch

mc CreateBlankModel

mc GetModelHandle m

## Building the Model using the InterpretEntity statements ##

m InterpretEntity p Point p_0 "\"Pivot\""m InterpretSet SetPoint p_0 0.0 0.0 0.0p ReleaseHandlem InterpretEntity p Point p_1 "\"Mass\""m InterpretSet SetPoint p_1 p_0.x+100 p_0.y p_0.zp ReleaseHandle

m InterpretEntity b Body b_0 "\"Pendulum\"" p_1m InterpretSet SetBodyInertia b_0 0.5 100 100 100m InterpretSet SetOrientation b_0.cm TWOAXES ZXb ReleaseHandle

## Adding graphics to the pendulum and the Ground to improve result visualization

m InterpretEntity g Graphic gra_0 "\"Graphic_Pivot\"" CYLINDER B_Ground p_0V_Global_Y 1 1 10 -5 CAPBOTHg ReleaseHandlem InterpretEntity g Graphic gra_1 "\"Graphic_Pendulum_Cylinder\"" CYLINDER b_0p_0 p_1 1 CAPBOTHg ReleaseHandlem InterpretEntity g Graphic gra_2 "\"GraphicMass_Cylinder\"" CYLINDER b_0 p_1V_Global_Y 5 5 3 -2 CAPBOTHg ReleaseHandle

## Adding the Revolute joint between the Ground and the pendulum body

m InterpretEntity j RevJoint j_0 "\"Joint_Pivot_Rev\"" B_Ground b_0 p_0V_Global_Yj ReleaseHandle

Page 234: Altair MotionView 11.0 Tutorials

229 MotionView 13.0 Tutorials

Proprietary Information of Altair Engineering

Altair Engineering

m Evaluate

vch Fit

after 1000

## Running the Model ##

mc ExportModel simple_pendu.xml

mc RunSolverScript simple_pendu.xml

## Releasing All the Handles

m ReleaseHandle;

mc ReleaseHandle;

win ReleaseHandle;

page ReleaseHandle;

proj ReleaseHandle;

sess ReleaseHandle;

hwi CloseStack;

## End of Script

Page 235: Altair MotionView 11.0 Tutorials

Altair Engineering 230

Proprietary Information of Altair Engineering

MotionView 13.0 Tutorials

MV-1050: Automation Using TCL

In this tutorial, you will:

Invoke a TCL script from MotionView. The TCL script automates the model building, solverruns and post processing in MotionView.

Link the script to a Menu Item on the menu bar in MotionView.

Exercise: Automation using TCL

Step 1: Running the Script manually.

1. Start a new session.

2. From the View menu, click on Command Window.

A TkCon window opens up at the bottom of the screen.

The Command Window

3. Right-click in the Command Window and select File > Load File.

The Source File dialog is displayed.

4. Select the file simple_auto.tcl from the location

<installation_directory>\tutorials\mv_hv_hg\mbd_modeling\automation.

5. Click Open.

Note The script does the following:

Builds a Simple Pendulum model.

Runs the model through the MotionSolve Solver (the pendulum is modeled to just swingunder gravity).

Creates new windows for Animation and Plotting and loads the animation results and theplotting results in these windows.

Note You can also invoke the script by using the following steps:

In the Tk Console type cd <installation_directory>/tutorials/mv_hv_hg/

mbd_modeling/automation.

The Command Window acts like a UNIX shell.

Type in Source simple_auto.tcl and press Enter.

Page 236: Altair MotionView 11.0 Tutorials

231 MotionView 13.0 Tutorials

Proprietary Information of Altair Engineering

Altair Engineering

Step 2: Creating a Menu Item that invokes the script automatically.

The TCL-script simple_auto.tcl that was discussed in Step 1 can be linked to a Menu Item on the

MotionView Menu bar.

1. Open a new text file in a text editor.

2. Type in the following lines in the text file:

*Id("MotionView v12.0")

*BeginModelDefaults()

*BeginMenu(fut_mv_1050, "MotionView Tutorial Script")

*MenuItem(automation_tutorial, "Tutorial Script", TCL,{ getenv("ALTAIR_HOME") + "/tutorials/mv_hv_hg/mbd_modeling/automation/simple_auto.tcl" } )

*EndMenu()

*EndModelDefaults()

3. Save the file as script_invoke_menu.mvw and place at any convenient location on your

machine.

Note The script_invoke_menu.mvw file is a preference file.

A preference file is a special script file that is read each time the program is started. Itspecifies default user settings such as the order in which colors are assigned, the defaultprinter, default page layout, the autosave interval, and so on. Custom menu options inMotionView can be added using a preference file.

To learn more about the preference file, type ‘preference file’ under the Index tab under theHelp menu.

To learn more about the preference file statements, type ‘preference statements’ under the Index tab under the Help menu.

Page 237: Altair MotionView 11.0 Tutorials

Altair Engineering 232

Proprietary Information of Altair Engineering

MotionView 13.0 Tutorials

4. In MotionView, go to the File menu and select Load > Preference File.

The Preferences dialog is displayed.

5. Click Register.

6. Open the script_invoke_menu.mvw that you created.

A new registered preference is added to the list.

7. Select the new preference and click Load.

8. A menu called MotionView Tutorial Script is added to the Menu bar, under which you will findthe Menu item Tutorial Script.

New menu item in HyperWorks Desktop - MotionView

9. Once this preference file is set, the new menu will appear every time HyperWorks Desktop isinvoked.

10. Start a new session of HyperWorks Desktop by pressing the SHIFT + F9 on your keyboard.

11. Check to make sure that the application is set to MotionView.

12. Click the Tutorial Script under MotionView Tutorial Script menu to invoke the scriptsimple_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 thepreference file by going to the File menu and selecting Load > Preference File. From thePreferences dialog, select script_invoke_menu.mvw and click on the Unregister button.

This will make MotionView unload the preference file.

Page 238: Altair MotionView 11.0 Tutorials

233 MotionView 13.0 Tutorials

Proprietary Information of Altair Engineering

Altair Engineering

MV-1051: Understanding Sequential Simulation

Sequential Simulation allows you to write simulation instructions to change the model, modify thesolver settings and submit analyses.

This tutorials covers the following topics:

Fixed joint definition between non-coinciding points using marker definitions.

Using a sensor to activate the joint when two markers coincide during simulation.

Using Templex statements to:

o Deactivate a fixed joint when markers are non-coincident.

o Activate a fixed joint when markers coincide.

o Simulate until t = 5.00 seconds.

This tutorial illustrates how to build a model with sensor elements to capture the state of a body, usethe sensor signal to activate some joints and deactivate others, and carry out a sequentialsimulation.

Exercise: Running a Sequential Simulation on a Model

Note Copy all the files from the location <installation_directory>\tutorials\mv_hv_hg

\mbd_modeling\interactive\sequential_simulation

to your <Working directory>.

Step 1: Creating joints, markers and sensors.

1. Start a new MotionView session.

2. From the Standard toolbar, click the Open Model icon, .

OR

From the File menu, select Open > Model to open the model Sequential_simulation.mdl.

The model contains two bodies, namely a slider and a picker. You need to create markers, joints,and a sensor as well as use Templex statements to perform a sequential simulation.

Page 239: Altair MotionView 11.0 Tutorials

Altair Engineering 234

Proprietary Information of Altair Engineering

MotionView 13.0 Tutorials

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. Labelthe joint slider trans.

3. For Body 1, select slider.

For Body 2, select Ground Body.

For Origin, select slider cg.

Define the Alignment axis using the point slider end.

Page 240: Altair MotionView 11.0 Tutorials

235 MotionView 13.0 Tutorials

Proprietary Information of Altair Engineering

Altair Engineering

4. Add another joint. For Type, select Fixed Joint and label the joint picker rest fix.

For Body 1, select picker.

For Body 2, select Ground Body.

For Origin, select part fix.

This joint will be deactivated when the slider body coincides with the picker body duringsimulation.

When you create a fixed joint between the slider and the picker and they come in contact, youneed to define two markers which are initially not coincident, but coincide during the course ofsimulation. Creating a joint based on markers must be done using Templex, as it is not possible tocreate 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:

Page 241: Altair MotionView 11.0 Tutorials

Altair Engineering 236

Proprietary Information of Altair Engineering

MotionView 13.0 Tutorials

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.

8. From the Signal field, select the type as Expression and enter the following expression:

`DX({the_model.m_0.idstring},{the_model.m_1.idstring})`

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.

10. In the Response field, select Return to Command File.

This directs the solver to look into the template for further instruction on how to proceed oncethe 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.

Step 2: Creating a fixed joint between two non-coincident markers usingTemplex.

1. To create a fixed joint between the slider and picker that is activated once the distance betweenthe slider and picker is zero, from the Project Browser, right-click on Model and select Add

General MDL Entity > Template (or right-click on the Template icon, , from the toolbar).

Page 242: Altair MotionView 11.0 Tutorials

237 MotionView 13.0 Tutorials

Proprietary Information of Altair Engineering

Altair Engineering

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"

i_marker_id = "{the_model.m_0.idstring}"

j_marker_id = "{the_model.m_1.idstring}"

/>

The panel should look like this:

Step 3: Creating a template to define the sequential simulation.

In this step, you will write a template to do the following:

Set the type of Output files to be written after the simulation.

Deactivate Joint between Slider and Picker for the initial simulation.

Perform a transient analysis for 3.5 seconds.

Activate Joint between Slider and Picker.

Deactivate Joint between Picker and Ground.

Deactivate the Sensor Element.

Run a transient analysis for 5 seconds.

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).

2. Set the Type as Write text to solver command file.

Page 243: Altair MotionView 11.0 Tutorials

Altair Engineering 238

Proprietary Information of Altair Engineering

MotionView 13.0 Tutorials

3. Type the following commands as listed below.

<ResOutput

plt_angle = "YAW_PITCH_ROLL"

/>

<ResOutput

mrf_file = "TRUE"

/>

<ResOutput

plt_file = "TRUE"

/>

<H3DOutput

switch_on = "TRUE"

increment = "1"

/>

<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}"

/>

Page 244: Altair MotionView 11.0 Tutorials

239 MotionView 13.0 Tutorials

Proprietary Information of Altair Engineering

Altair Engineering

<Activate

element_type = "JOINT"

element_id = "5000"

/>

<Simulate

analysis_type = "Transient"

end_time = "5."

print_interval = "0.01"

/>

<Stop/>

Step 4: Running the simulation and animating the results.

1. Click the Run Solver button, , and activate the Export MDL snapshot check box. This willsave 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. Thiswill 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.

3. Set End time as 5 and the Print interval as 0.01.

4. Click the Simulation Settings button. In the pop-up dialog, from the Transient tab, selectDSTIFF for the Integrator type. Click Close.

5. From the Main tab, click Run.

Page 245: Altair MotionView 11.0 Tutorials

Altair Engineering 240

Proprietary Information of Altair Engineering

MotionView 13.0 Tutorials

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.

Page 246: Altair MotionView 11.0 Tutorials

241 MotionView 13.0 Tutorials

Proprietary Information of Altair Engineering

Altair Engineering

Optimization-DOE-Stochastics

MV-3000: DOE using MotionView - HyperStudy

MV-3010: Optimization using MotionView - HyperStudy

Page 247: Altair MotionView 11.0 Tutorials

Altair Engineering 242

Proprietary Information of Altair Engineering

MotionView 13.0 Tutorials

MV-3000: DOE using MotionView - HyperStudy

In this tutorial, you will:

Use Hyperstudy to set-up a DOE study of a MotionView model

Perform DOE study in the MotionView – HyperStudy environment

Create approximation (using the DOE results) which can be subsequently used to performoptimization of the MotionView model

Theory

HyperStudy allows you to perform Design of Experiments (DOE), optimization, and stochastic studies ina CAE environment. The objective of a DOE, or Design of Experiments, study is to understand howchanges 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 inputvariables. This is called as the regression equation.

The regression equation can then be used to perform Optimization.

Note The goal of DOE is to develop an understanding of the behavior of the system, not to find anoptimal, single solution.

HyperStudy can be used to study different aspects of a design under various conditions, includingnon-linear behavior.

HyperStudy also does the following:

Provides a variety of DOE study types, including user-defined

Facilitates multi-disciplinary DOE, optimization, and stochastic studies

Provides a variety of sampling techniques and distributions for stochastic studies

Parameterizes any solver input model via a user-friendly interface

Uses an extensive expression builder to perform mathematical operations

Uses a robust optimization engine

Includes built-in support for post-processing study results

Includes multiple results formats such as MVW, TXT for study results

Page 248: Altair MotionView 11.0 Tutorials

243 MotionView 13.0 Tutorials

Proprietary Information of Altair Engineering

Altair Engineering

Tools

In MotionView, HyperStudy can be accessed from

The Main-Menu under ‘Applications ->HyperStudy’

You can then select MDL property data as design variables in a DOE or an optimization exercise.Solver scripts registered in the MotionView Preferences file are available through the HyperStudyinterface to conduct sequential solver runs for DOE or optimization.

For any study, the HyperStudy process is shown below:

The HyperStudy process

MotionView MDL files can be directly loaded into HyperStudy. Any solver input file, such as ADAMS,MotionSolve, OptiStruct, Nastran, or Abaqus, can be parameterized and the template file submitted asinput for HyperStudy. The parameterized file identifies the design variables to be changed during DOE,optimization, or stochastic studies. The solver runs are carried out accordingly and the results arethen post-processed within HyperStudy.

Copy the files hs.mdl and target_toe.csv from <installation_directory>\tutorials\mv_hv_hg

\mbd_modeling\doe to your <working directory>.

In the following steps, you will create a study to carry out subsequent DOE study on a front SLAsuspension model.

Page 249: Altair MotionView 11.0 Tutorials

Altair Engineering 244

Proprietary Information of Altair Engineering

MotionView 13.0 Tutorials

While performing a Static Ride Analysis, you will determine the effects of varying the coordinatepositions of the origin points of the inner and outer tie-rod joints on the toe-curve.

Step 1: Study Set-up.

1. Start a new MotionView session.

2. Click the Open Model icon, , on the Model-Main toolbar.

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.

5. From the Applications menu, select HyperStudy.

HyperStudy is launched. The message "Establishing connection between MotionView andHyperstudy" is displayed.

Page 250: Altair MotionView 11.0 Tutorials

245 MotionView 13.0 Tutorials

Proprietary Information of Altair Engineering

Altair Engineering

6. Start new study using one of the following ways:

From the Welcome page, click on the New Study icon, .

Or

From the toolbar, click the New Study icon, .

Or

From main menu, select File > New. The HyperStudy - Add Study dialog is displayed.

Accept the default label and variable names.

Under Location, click the file browser and select <working directory>\.

Click OK.

Page 251: Altair MotionView 11.0 Tutorials

Altair Engineering 246

Proprietary Information of Altair Engineering

MotionView 13.0 Tutorials

7. Model definition.

From the study Setup tree, select Define models.

Click to open the Add Model dialog.

Under Type, select MotionView to add a MotionView model to the study.

Accept the default variable name.

Click OK.

The following table with model data is created.

8. Model data.

Please note that following details are automatically filled when you define the model (previousstep).

o Under Active, check the box to activate or deactivate the model from study.

o The label of model entered in previous step.

o The variable name of model entered in the previous step.

o The model type selected in previous step.

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 ).

Page 252: Altair MotionView 11.0 Tutorials

247 MotionView 13.0 Tutorials

Proprietary Information of Altair Engineering

Altair Engineering

9. Create design variables.

Click Import Variables to specify the design variables for the study.

The Model Browser window opens in MotionView, allowing you to select the variablesinteractively.

Select the following from the Browser using the Model Parameter Tree dialog:

System Point Coordinate Function

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

Parallel Steering Inr tie-rod ball - left Y Double-click or Click Add

Parallel Steering Inr tie-rod ball - left Z Double-click or Click Add

Model Parameter Tree dialog

Click Done.

Click Next to go to Define Design Variables.

Page 253: Altair MotionView 11.0 Tutorials

Altair Engineering 248

Proprietary Information of Altair Engineering

MotionView 13.0 Tutorials

10. Define design variables.

From the Define design variables tab, edit the upper and lower bounds of the design variablesaccording to the following table.

Point Coordinate Lower Upper

Outer tie-rod ball-jt -left Y -571.15 -559.15

Outer tie-rod ball-jt - left Z 246.92 250.92

Inner tie-rod ball - left Y -221.9 -209.9

Inner tie-rod ball - left Z 274.86 278.86

This step also includes definition of other properties to the design variables. The options Detailsand Distributions specify variations of design variables in the range specified. The option LinkVariables is used to link different design variables through a mathematical expression.

Click on each tab to observe these options.

Right click on the column header row to view more options that you may want to add.

Page 254: Altair MotionView 11.0 Tutorials

249 MotionView 13.0 Tutorials

Proprietary Information of Altair Engineering

Altair Engineering

- Click Next to go to Specifications.

11. Specifications.

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.

Click Next to go to Evaluate.

12. Evaluate.

Click Evaluate Tasks to perform the nominal run.

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.

Once the nominal run is complete, click Next to go to Define responses.

Page 255: Altair MotionView 11.0 Tutorials

Altair Engineering 250

Proprietary Information of Altair Engineering

MotionView 13.0 Tutorials

13. Define Response.

Click Add Response to add a new response.

Label the response Sum of Squared Error.

Accept the variable name and click OK.

Response table data

Click the ellipses, …, in the Expression cell of Response table to launch the ExpressionBuilder.

Expression builder

Note: You can move the cursor over the function to display the function help.

For this exercise, the response function requires two vectors:

The elements of Vector 1 contain actual data points of the toe curve from thesolver 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.

Page 256: Altair MotionView 11.0 Tutorials

251 MotionView 13.0 Tutorials

Proprietary Information of Altair Engineering

Altair Engineering

Vector 1:

Click to display the HyperStudy - Add dialog box.

Accept the default label and variable name.

For Select Type, select Solver output file.

Click OK.

Response data table

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\.

This enables the Type, Request and Component fields.

From the Type drop-down menu, select Expressions.

From the Request drop-down menu, select REQ/70000033 toe-curve.

From the Component drop-down menu, select F2.

Page 257: Altair MotionView 11.0 Tutorials

Altair Engineering 252

Proprietary Information of Altair Engineering

MotionView 13.0 Tutorials

Vector 1 source dialog box

You have now selected the toe curve data from the solver run as the data elements for Vector1.

Click on the arrow button, , on the right side of the dialog box to expanding the vectordialog box and preview the curve.

Expanded dialog box of Vector 1 source

Click OK.

Page 258: Altair MotionView 11.0 Tutorials

253 MotionView 13.0 Tutorials

Proprietary Information of Altair Engineering

Altair Engineering

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.

Accept the default label and variable name.

For Select Type, select Reference file.

Click OK.

Response data table

Click the … in the File cell of the Vector 2 table data to launch the Vector Source – (Vector2(v_2)) dialog box.

Click the file browser button, , and select the file target_toe.csv, located in your

<working directory>\.

Set Type to Unknown and Request to Block 1.

From the Component drop-down menu, select Column 1.

Click OK.

Page 259: Altair MotionView 11.0 Tutorials

Altair Engineering 254

Proprietary Information of Altair Engineering

MotionView 13.0 Tutorials

14. In the Expression field, create the following expression:

sum((v_1-v_2)^2)

This expression evaluates the sum of the square of the difference between the “actual toechange” values (from solver run) and the “targeted toe curve” (from imported file). In the nexttutorial, MV-3010, we will use HyperStudy to minimize the value of this expression to get therequired suspension configuration.

15. Click Evaluate expression to verify that the expression is evaluated correctly. You should get avalue of 16.289.

16. Click OK.

If you do not encounter any error messages and were able to successfully extract the responsefor 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 withthe post-processing options.

Click Next to go to Report.

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.

16. From the File menu, select Save As….

17. Save this study set-up as Setup.xml to your <working directory>\.

Page 260: Altair MotionView 11.0 Tutorials

255 MotionView 13.0 Tutorials

Proprietary Information of Altair Engineering

Altair Engineering

Step 2: DOE Study.

1. Adding new DOE study.

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 - Adddialog.

Under Select Type, select Doe.

Accept the default label and variable name and click OK.

Page 261: Altair MotionView 11.0 Tutorials

Altair Engineering 256

Proprietary Information of Altair Engineering

MotionView 13.0 Tutorials

The DOE study tree is displayed in the Browser with name Doe 1.

Click Next to go to Select design variables.

2. Select design variables for the DOE study.

All variables are used in the present DOE study, so make sure that all design variables areactive.

All the design variables in this study are controlled. Therefore, for Category, leave all variablesset to Controlled.

Click Next to go to Select responses.

3. Select responses for the DOE study:

There is only one response in the present study - make sure to select the response.

Click Next to go to Specifications.

4. Specifications for the DOE study:

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 ofexperiments are less. We will do a full factorial run. Selecting any mode from the list shows allpossible 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.

Page 262: Altair MotionView 11.0 Tutorials

257 MotionView 13.0 Tutorials

Proprietary Information of Altair Engineering

Altair Engineering

Click the Interaction tab to observe that all interactions are selected as it is a full factorial run.

Note: Options which are not applicable will be grayed out or a message will be shown.

4. Click Apply to generate the design space.

5. Click Next to go to Evaluate.

DOE run:

The Tasks tab of Evaluate shows a table of 16 rows and four columns. Column 1 shows theexperiment number while other columns corresponding to each experiment get updated with theexperiment status of failure or success in the three stages of model execution: Write, Executeand Extract.

Design variable values used under each experiment can be seen under the Evolution Data tab.

Page 263: Altair MotionView 11.0 Tutorials

Altair Engineering 258

Proprietary Information of Altair Engineering

MotionView 13.0 Tutorials

The last column corresponds to the response value from each run. The values gets populatedonce the run is completed.

Click Evaluate Tasks to start the DOE study.

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 PostProcessing.

6. Viewing Main Effect and Interaction plots:

The post-processing section has variety of utilities to helps user to effectively post processresults. Run Summary tab of Post processing page will provide a summary of design along withresponses.

The New Generation HyperStudy allows you to sort data by right-clicking on the column headingand selecting the options from context menu.

The options to post-process are available in other tabs. The main effects can be plotted byselecting the Linear Effects tab.

Page 264: Altair MotionView 11.0 Tutorials

259 MotionView 13.0 Tutorials

Proprietary Information of Altair Engineering

Altair Engineering

Main Effects:

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 leftmouse 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 theeffect of each parameter on the response.

DOE – Main effects plot

Note: Click on window icon, , (highlighted above) to toggle it to multiple windows, . Eachcurve is displayed in a different plot window.

Interactions:

Interactions can be plotted from the Interactions tab following the above procedure. Here, wewill use the post-processing window to plot the interactions. Click Launch Post Processing todisplay the Post-processing window.

Display the Regressions in one of the following ways:

From the toolbar, click the Display regressions icon, .

Or

From main menu, select Display > Regressions.

Click the Interactions radio button.

By default, all interactions are displayed.

Page 265: Altair MotionView 11.0 Tutorials

Altair Engineering 260

Proprietary Information of Altair Engineering

MotionView 13.0 Tutorials

Click View to select the design variables Otr_tierod_ball_jt-left-z and

Inr_tierod_ball_jt-left-z.

Under Display on the left side of the page, change the variables type from All Variables toControlled Variables from the drop-down menu next to View button. This displays theinteraction plot for these two variables only.

Controlled design variable plot for “Otr_tierod_ball_jt-left-z” & “Inr_tierod_ball_jt-left-z” interaction

Click Close.

Close the Post Processing application. Confirm the request to quit the application.

Page 266: Altair MotionView 11.0 Tutorials

261 MotionView 13.0 Tutorials

Proprietary Information of Altair Engineering

Altair Engineering

Step 3: Approximation.

System response is approximated by using various curve fitting methods. An approximation for theresponse with the design variables variation is calculated using the data from above DOE study. Theaccuracy 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 theAdd Approach dialog.

Under Select Type, select Fit.

Accept the default label and variable names and click OK.

A new tree with the name Fit 1 is created in the Browser.

Click Next.

Page 267: Altair MotionView 11.0 Tutorials

Altair Engineering 262

Proprietary Information of Altair Engineering

MotionView 13.0 Tutorials

2. Input matrix.

Click to display the HyperStudy - Add dialog.

Accept the default label and variable names.

Click OK.

A matrix table is created. Select the following options to specify the DOE results as the inputmatrix.

Under Type, use the drop-down menu to select Input.

For Matrix Source, select Doe 1 from the drop-down menu.

In the present study, we are not using any validation matrix. So, no matrix will be added forvalidation matrix.

Observe that the status shows “Import pending”.

Click Import Matrix to import the DOE results for the input matrix.

Click Next to go to Select design variables.

Select all design variables and click Next to go to Select responses.

Select the response and click Next to go to Specifications.

Page 268: Altair MotionView 11.0 Tutorials

263 MotionView 13.0 Tutorials

Proprietary Information of Altair Engineering

Altair Engineering

In this section, the approximation type and it’s properties are defined.

Select Moving Least Squares (SMLS):

Click Apply to apply the approximation method.

Click Next to go to Evaluate.

Observe an empty Tasks table which corresponds to the DOE experiments.

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 other tabs available to observe the fit.

Click the Evolution Data tab to observe the experiment table with responses from theMotionSolve run and responses predicted using approximation. The same can be viewed ingraph format by selecting the Evolution plot tab.

Select Sum of Squared of Squared Error and Squared of Squared Error_MLSM to plotagainst the experiment numbers.

Page 269: Altair MotionView 11.0 Tutorials

Altair Engineering 264

Proprietary Information of Altair Engineering

MotionView 13.0 Tutorials

This fit shows a good approximation to the response.

Click Next to go to Post Processing.

Post-processing provides you with statistical parameters and graphical tools useful in validatingthe correctness of approximation.

The Residuals tab shows the difference between the response value from the solver and theresponse value from the regression equation.

The residual values can be used to determine which runs are generating more errors in theregression model.

The Trade-off 3D tab shows the plots of the main effects vs. response from the approximation.

Trade-off: 3-D plots

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 asthe tree varnames. For example, nom_1,doe_1 and fit_1.

Page 270: Altair MotionView 11.0 Tutorials

265 MotionView 13.0 Tutorials

Proprietary Information of Altair Engineering

Altair Engineering

MV-3010: Optimization using MotionView -HyperStudy

In this tutorial you will,

Perform an optimization study in the MotionView-HyperStudy environment

Compare the baseline and optimized models

Theory

In general, an optimization problem consists of:

The design constraints

The objective function

The design variables

Design variables change during optimization. The design variables always have a certain range withinwhich they can be modified. Typical examples of design variables are thickness of shell elements,shape vectors, and masses.

The changes in the design variables cause some change in model responses. Such responses canbecome either objective function or design constraints. Examples of such responses includedisplacements and forces.

The response to be minimized or maximized becomes the objective function, while the rest of theresponses that need to be within a certain tolerance range become constraints. Only one responsecan be defined as objective function.

HyperStudy can be used to set-up and perform an optimization study on a MotionView model. You canalso use HyperStudy to perform optimization studies involving both linear and non-linear CAE analysisas well as perform optimization of mathematical equations using Templex. HyperStudy creates theinput parameter files using Templex and provides iterative changes to them during the optimizationprocess. HyperStudy uses HyperOpt (a general purpose, wrap around software) as the optimizationengine 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 anddetermine the optimum coordinate positions of the inner and outer tie-rod points while trying toachieve a target toe curve. The baseline model will then be compared with the optimized model.

Step 1 Optimization Study.

1. Start a new MotionView session.

2. Open the model hs.mdl, located in <working directory>.

3. Review the model and the toe-curve output request.

Page 271: Altair MotionView 11.0 Tutorials

Altair Engineering 266

Proprietary Information of Altair Engineering

MotionView 13.0 Tutorials

4. From the SolverMode menu make sure that MotionSolve is selected.

5. From the Applications menu, launch HyperStudy.

6. Click on open file icon, , browse to your study directory and select Setup.xml file created

during the MV-3000 tutorial.

7. Add a new optimization study:

Right-click in the Explorer Browser area and from the context menu, click Add Approach tolaunch the HyperStudy - Add dialog box.

Or

From the Edit menu bar, click the Add Approach icon, , to launch the HyperStudy - Adddialog box.

Under Select Type, select Optimization.

Accept the default label and variable name and click OK.

The Optimization tree displays in the explorer with name Optimization_1.

Click Next to go to the Select design variables.

8. In the Define design variables panel, verify that all the design variables are checked.

This panel displays all the variables and their upper and lower bounds.

Page 272: Altair MotionView 11.0 Tutorials

267 MotionView 13.0 Tutorials

Proprietary Information of Altair Engineering

Altair Engineering

9. Click Next to go to the Select responses.

Click to launch the HyperStudy - Add Objective dialog box.

Accept the default label and variable names and click OK.

In this exercise, minimize the Sum of Squared Error response function to obtain optimum valuesfor 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 thenclick Next to go to Specifications.

Accept the default Optimization Engine: Adaptive Response Surface Method and click Applyand Next. The Maximum iterations and Convergence criteria are specified in the same dialog.

11. Click Apply and Next to go to Evaluate.

12. Click Evaluate Tasks to start the optimization.

MotionSolve is launched sequentially and the HyperOpt engine attempts to find a solution to theproblem.

Once the optimization is complete, an Iteration table is created with status of each run. Thepresent study took nine iterations to achieve the target. Browse through the other tabs of thispage to get more understanding of the iteration history.

13. Click on the Iteration Plot 2D tab.

Page 273: Altair MotionView 11.0 Tutorials

Altair Engineering 268

Proprietary Information of Altair Engineering

MotionView 13.0 Tutorials

14. From the list on the right side of the GUI, select the Objective function named Objective_1 .

This plots the objective function value against the iterations.

Optimization history plot

In this panel, you can see the plots variations in the values of the objectives, constraints, designvariables, and responses during different design iterations. The Iteration History Table displaysthe same data in a tabular format.

Note that in this study, iteration 6 is the optimal configuration.

Save your study to <working directory> as Study_2.xml.

15. Close the HyperStudy.

Step 2: Comparing the Baseline and Optimized Models.

1. Add a Page to your MotionView session.

2. From the Select application drop-down menu, select HyperView.

3. Load the animation file <working directory>\approaches\nom_1\run__00001\m_1\m_1.h3d

using the Load Model panel.

4. Click the Page Layout icon on the toolbar and select the two-window layout.

5. In the second window, switch to HyperGraph.

6. Click the Build Plots icon on the toolbar.

7. Use the Build Plots file browser and select the file target_toe.csv, located in the <working

directory>.

Page 274: Altair MotionView 11.0 Tutorials

269 MotionView 13.0 Tutorials

Proprietary Information of Altair Engineering

Altair Engineering

8. For X-axis data, select:

Type = Unknown

Request = Block 1

Component = Column 1

9. For Y-axis data, select:

Type = Unknown

Request = Block 1

Component = Column 2

10. Click Apply.

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

12. For X-axis data, select:

Type = Expressions

Request = REQ/70000033 toe-curve

Component = F2

13. For Y-axis data, select:

Type = Expressions

Request = REQ/70000033 toe-curve

Component = F3

14. Click Apply.

Page 275: Altair MotionView 11.0 Tutorials

Altair Engineering 270

Proprietary Information of Altair Engineering

MotionView 13.0 Tutorials

15. Plot another curve from the file

<working directory>\approaches\opt_1\run__00006\m_1\m_1.abf using steps 11-14

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.

Save the session as opt_toe.mvw.

Page 276: Altair MotionView 11.0 Tutorials

271 MotionView 13.0 Tutorials

Proprietary Information of Altair Engineering

Altair Engineering

Durability - Fatigue

MV-3030: Load Export

MV-3040: Durability and Fatigue Tools

Page 277: Altair MotionView 11.0 Tutorials

Altair Engineering 272

Proprietary Information of Altair Engineering

MotionView 13.0 Tutorials

MV-3030: Load Export

The Load Export utility allows you to bridge the gap between Multi-Body Dynamics (MBD) analysisand Finite Element (FE) analysis using MotionView by:

Identifying and summarizing all loads acting on one/multiple body(ies) for any given timestep(s) in a tabular format.

Identifying and transferring all the forces and moments for one component at any given timestep(s) to a NASTRAN input deck that contains GRID, CORD, FORCE, and MOMENT cards.

Using Load Export

To use this utility, specify the components in the MotionView model for which loads are to beprocessed. You can do this by:

Using the MotionView Interface.

OR

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 (anASCII 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 forthis utility. The application scope of this utility is shown in the figure below:

Application Scope of the Load Export Utility

Page 278: Altair MotionView 11.0 Tutorials

273 MotionView 13.0 Tutorials

Proprietary Information of Altair Engineering

Altair Engineering

Step 1: Creating a Metadata File and Launching Load Export.

1. Copy the file load_export.mdl from <installation_directory>\tutorials\mv_hv_hg

\mbd_modeling\externalcodes to <working directory>.

2. Start a new MotionView session.

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,

or right-click the Outputs icon, , on the Model-General toolbar.

The Add Output dialog is displayed.

5. Accept the default selections and click OK.

6. Use the drop-down menu to change the Output type from the default Displacement to Force.

7. Double-click the Body collector.

The Select a Body dialog is displayed.

8. Expand the model-tree.

9. In the Frnt macpherson susp system folder, expand the Bodies folder and select the body Lwrcontrol arm – left. (or you can pick the Lwr Control arm - left directly from the model in thegraphics area by clicking the Body collector once).

10. Repeat steps 4 through 9 to create an output force request on Lwr control arm – right.

11. Click the Run Solver icon .

12. From the Main tab, change End Time to 2 seconds.

13. Save the solver input file as load_export.xml, to the <working directory>.

14. Click on the Run button, to solve the model in MotionSolve.

MotionView creates a metadata file named load_export.meta in the <working directory>.

Page 279: Altair MotionView 11.0 Tutorials

Altair Engineering 274

Proprietary Information of Altair Engineering

MotionView 13.0 Tutorials

Step 2: Using the Load Export Utility and Generating a NASTRAN Input Deck.1. From the Flex Tools menu, select the Load Export utility.

Launching the Load Export utility

The Load Export utility

Page 280: Altair MotionView 11.0 Tutorials

275 MotionView 13.0 Tutorials

Proprietary Information of Altair Engineering

Altair Engineering

2. From the Load Export panel, open the file load_export.meta, located in <working directory>.

All bodies for which force outputs are requested are displayed in a tree structure in the BodySelection panel. You can select one or multiple bodies from the tree. In this step select thebody Lwr control arm-left.

Body Selection panel

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 areexported by the utility.

4. Select all three forces acting on Lwr control arm – left.

Force Selection panel

5. The Time Selection panel allows you to enter/select the time steps for which the loads are to beexported.

6. Click the Range button.

Page 281: Altair MotionView 11.0 Tutorials

Altair Engineering 276

Proprietary Information of Altair Engineering

MotionView 13.0 Tutorials

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.

Activating the Export panel

8. Click Apply.

9. Enter Min/Max Time Step Values.

10. Click Apply on the Time Selection panel.

This activates the Export panel.

Note After time step input, you must click the Apply button to verify the validity of the timesteps. If a time step entered is not present in the ADAMS request file, an error messageis generated and you must make appropriate corrections.

Page 282: Altair MotionView 11.0 Tutorials

277 MotionView 13.0 Tutorials

Proprietary Information of Altair Engineering

Altair Engineering

11. Select OPTISTRUCT/NASTRAN [1] by using the radio button under the Export panel.

Nastran options

12. Click Nastran Options [2] to launch the Nastran Export Panel.

This dialog allows you to enter the Nastran node ID numbers in the second column of the table.

You can specify three additional options:

the Nastran deck format (Large/Small)

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)

Page 283: Altair MotionView 11.0 Tutorials

Altair Engineering 278

Proprietary Information of Altair Engineering

MotionView 13.0 Tutorials

13. Accept the default selections in the Nastran Export dialog.

14. Specify the Node ID’s as follows:

o Lwr ball joint – 1

o LCA rear bush – 2

o LCA frnt bush – 3

15. Click Apply.

16. Click Export on the Load Export panel.

17. Specify a filename.

18. Click Save.

This creates a subcase file, in addition to the Nastran input deck, in the same directory as the.dat file.

Page 284: Altair MotionView 11.0 Tutorials

279 MotionView 13.0 Tutorials

Proprietary Information of Altair Engineering

Altair Engineering

19. Repeat steps 3 through 18 to export the loads on the Lwr control arm – right.

Note In point 2 above, if you select multiple bodies, the Nastran Export Panel will look as shownbelow:

Nastran Export Panel for multiple body selection

Page 285: Altair MotionView 11.0 Tutorials

Altair Engineering 280

Proprietary Information of Altair Engineering

MotionView 13.0 Tutorials

MV-3040: Durability and Fatigue Tools

In this tutorial, you will learn how to:

Convert results from a multi-body simulation run into file formats which can be used for fatigueanalysis 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 Fatigue Prep feature can be accessed by:

On the Flex Tools menu, click Fatigue Prep.

This panel translates the following files:

Original Format Translated Format

Altair .H3D flexbody (modal content) Ncode .FES/.ASC

Ncode .DAC Altair .ABF

ADAMS .RES (modal participation factors) Ncode .DAC

ADAMS .REQ files (loads information) Ncode .DAC

Altair .PLT Ncode .DAC

ADAMS .REQ files (loads information) MTS .RPC

Page 286: Altair MotionView 11.0 Tutorials

281 MotionView 13.0 Tutorials

Proprietary Information of Altair Engineering

Altair Engineering

The Flex File Gen feature can be accessed by:

On the Flex Tools menu, click Flex File Gen.

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 build plots feature can be accessed by:

Go to the HyperGraph client, and click the build plot icon, .

The Build Plots panel constructs multiple curves and plots from a single data file. Curves canbe overlaid in a single window or each curve can be assigned to a new window. Individualcurves are edited using the Define Curves panel.

Step 1: Using the Fatigue Prep Wizard.

1. Start a new MotionView session.

2. Select the MBD Model window.

Page 287: Altair MotionView 11.0 Tutorials

Altair Engineering 282

Proprietary Information of Altair Engineering

MotionView 13.0 Tutorials

3. From the FlexTools menu, select Fatigue Prep.

Fatigue Prep Wizard

The form shown above, describes the set of file translations possible using the Fatigue Prepwizard.

4. Use the drop-down menu to select the H3D to FES option.

5. Click Next.

6. Specify the H3D file as <installation_directory>\tutorials\mv_hv_hg\mbd_modeling

\durability_fatigue\sla_flex.h3d.

7. Specify the FES file as <working directory>\sla_flex_left.fes.

Fatigue Prep Wizard

Page 288: Altair MotionView 11.0 Tutorials

283 MotionView 13.0 Tutorials

Proprietary Information of Altair Engineering

Altair Engineering

8. Click Finish.

The Altair flexible body pre-processor is launched and the FES file is created in your workingdirectory.

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 Ncode’s FE-Fatigue software.

Step 2: Converting ADAMS results from a REQ file to a DAC file.

The Fatigue Prep translator can be used to convert the request files created from an ADAMS run toDAC files. These DAC files can be further used for fatigue or durability analysis.

1. Start a new MotionView session.

2. Select the MBD Model window.

3. From the FlexTools menu, select Fatigue Prep.

4. Select the REQ to DAC option.

5. Click Next.

6. Click the file browser button attached to Select req file and select indy.req from

<installation_directory>\tutorials\mv_hv_hg\mbd_modeling\durability_fatigue.

Note The DAC file format does not support unequal time steps since only frequency isspecified, not each time step. Therefore your REQ file needs to have equal output timesteps.

7. Click on the file browser attached to Select DAC file and specify indy.dac as an output filename

in <working directory>\.

8. Under Y type, select Displacement.

Once you select Displacement, Y requests and Y components will populate the text boxes.

Page 289: Altair MotionView 11.0 Tutorials

Altair Engineering 284

Proprietary Information of Altair Engineering

MotionView 13.0 Tutorials

9. Select first five Y requests and the first three Y components.

REQ to DAC translation

Note You can select any number of Y requests and Y components for REQ2DAC conversion.

Page 290: Altair MotionView 11.0 Tutorials

285 MotionView 13.0 Tutorials

Proprietary Information of Altair Engineering

Altair Engineering

10. Click the Finish button.

The message Translation complete is displayed on the screen.

MotionView generates 15 DAC files for each combination selected.

11. Click Cancel and close the window.

12. Change the application to HyperGraph 2D.

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, andX represents the component. This is how you get the information about the DAC file youare plotting.

14. Click Apply to see the plot.

You may plot the corresponding request from the original REQ file for comparison.

Step 3: Using the Flex File Tool.

1. Start a new MotionView session.

2. From the Flex Tools menu, select Flex File Gen.

3. The Flex File Generator dialog is displayed.

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 file <installation_directory>

\tutorials\mv_hv_hg\mbd_modeling\durability_fatigue\sla_flex.gra.

7. From the Select result source (ASCII *.res) file browser, select the file<installation_directory>\tutorials\mv_hv_hg\mbd_modeling\durability_fatigue

\sla_flex.res.

8. Using the first file browser under Select flexible body source (*.h3d), select<installation_directory>\tutorials\mv_hv_hg\mbd_modeling\durability_fatigue

\sla_flex.h3d.

9. Using the second file browser under Select Flexible Body Source (*.h3d), select<installation_directory>\tutorials\mv_hv_hg\mbd_modeling\durability_fatigue

\sla_flex_m.h3d.

Page 291: Altair MotionView 11.0 Tutorials

Altair Engineering 286

Proprietary Information of Altair Engineering

MotionView 13.0 Tutorials

10. Under ID: field, enter 10404 and 20404 for the two h3ds, respectively.

These values should correspond to the actual IDs of the flexible bodies in the ADM input deck ofthe 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.

11. Click OK.

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 .

Page 292: Altair MotionView 11.0 Tutorials

287 MotionView 13.0 Tutorials

Proprietary Information of Altair Engineering

Altair Engineering

14. Open the sla_flex.flx file.

You should see the following contents of the FLX file:

Note To load transients results for selected time intervals check the Optional flx statementscheck-box to enter the Start Time, End Time and Increment.

To load selected mode shapes from modal animation files for models with one or moreflexible bodies, check the Optional flx statements for linear analysis check-box toenter the Start Mode and End Mode.

Additional statements are inserted in the FLX file reflecting the above mentionedparameters.

Step 4: Viewing Fatigue Results in the Animation Window.

1. Select HyperView using the Select application option on the toolbar.

2. Use the Open drop-down menu on the Standard toolbar (click the arrow next to the Open

Session icon ) to select Open Model .

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.

5. Click the Start/Pause Animation icon, to animate the model.

Observe the animating model, which is a combination of rigid multi-bodies and two flexible lowercontrol arms.

6. Click the Contour icon, on the Results toolbar.

7. Choose different options from the Result Type drop down menu, to view the various resultsavailable in the analysis result files.

For a detailed description of writing a fatigue analysis file from here, refer to the Fatigue Managertopic in the HyperView User’s Guide.

Page 293: Altair MotionView 11.0 Tutorials

Altair Engineering 288

Proprietary Information of Altair Engineering

MotionView 13.0 Tutorials

Advanced Simulation

MV-1010: Contact Simulation using MotionSolve

MV-1015: Using Spline3D to model the Combustion Forces in an Engine

MV-1023: Using Python Subroutines in MotionView Model Building

MV-1024: Using User Subroutines in MotionSolve Models

MV-1025: Modeling Point-to-Curve (PTCV) higher-pair constrain

MV-1026: odeling Curve-to-Curve using Templates

MV-1027: Modeling Point-to-Deformable-Curve (PTDCV) Higher-Pair Constraint

MV-1028: Modeling Point-to-Deformable-Surface (PTdSV) Higher-Pair Constraint

MV-1029: Modeling Point-to-Deformable-Surface Force (PTdSFforce) Higher-Pair Constraint

MV-7000: Modeling Differential Equations Using MotionView and MotionSolve

MV-7001: Building User Subroutines in Altair MotionSolve

MV-7002: Co-simulation with Simulink

MV-7003: Simulating a Single Input Single Output (SISO) Control System Using MotionView andMotionSolve

MV-7004: Inverted Pendulum Control Using MotionSolve and MATLAB

MV-7005: Linking Matlab/Simulink Generated Code with MotionSolve

MV-7006: Python UserSub for MotionSolve

MV-7007: Adding Friction to Joints

Page 294: Altair MotionView 11.0 Tutorials

289 MotionView 13.0 Tutorials

Proprietary Information of Altair Engineering

Altair Engineering

MV-1010: Contact Simulation using MotionSolve

In this tutorial, you will learn how to:

Model contact between two graphics

Perform Transient analysis on a MotionView model with contact forces using MotionSolve

View the Transient analysis results from MotionSolve using MotionView

Theory

The Geneva drive is an indexing mechanism that translates a continuous rotation into an intermittentrotary motion. It is an intermittent gear where the drive wheel (crank) has a pin that reaches into aslot of the driven wheel (slotted disk) and thereby advances it by one step. The drive wheel also hasa raised circular blocking disc that locks the driven wheel in position between steps.

Contact forces are very common in the mechanisms/general machinery domain. MotionSolve uses thePenalty-based Poisson contact normal force model, impact function based model, and user-definedsubroutine for calculating the magnitude and direction of the contact and friction forces. For moreinformation on this, please refer to the MotionSolve online help.

Step 1: Modeling contact.

1. Start a new MotionView session.

2. Click the Open Model icon, , on the Model-Main toolbar.

OR

Open the model by selecting File > Import > Model.

Page 295: Altair MotionView 11.0 Tutorials

Altair Engineering 290

Proprietary Information of Altair Engineering

MotionView 13.0 Tutorials

3. From the Open model dialog, select the file geneva.mdl, located in <installation_directory>

\tutorials\mv_hv_hg\mbd_modeling\Interactive. Click Open to load the model.

Check the model for the following entities in the Project Browser:

Four bodies - Ground, Crank, Slotted Disk, and Stand.

A fixed-joint between the Stand and the Ground.

Tessellated H3D Graphics for the Crank, Slotted Disk, and Stand.

Note Contact modeling begins with the geometry of colliding bodies. The surface geometry maybe defined using CAD or MotionView primitives. The collision detection algorithm inMotionSolve requires that the CAD geometry must first be tessellated (meshed).

The MotionView interface provides a CAD to H3D translator for automatically meshing theCAD model. The H3D file contains the tessellated geometry.

The MotionView primitive graphics are tessellated automatically by MotionSolve.

The following entities need to be added to complete the model:

Two Revolute Joints; one between Crank and stand and the other between Slotted Disk andStand.

Motion at the revolute joint between the Crank and stand.

Torsion Spring Damper to damp any vibrations in the Slotted Disk.

Contact between the Crank graphic and Slotted Disk graphic.

4. From the Project Browser, right-click on Model and select Add Constraint > Joint (or right-

click on the Joints icon, , from the toolbar).

The Add Joint or JointPair dialog is displayed.

5. Use the table below to add two revolute joints in your model.

Please follow the procedure described in Step 3 of MV-1000 for adding a revolute joint.

Revolute Joint Label Body 1 Body 2 Point Vector

Slotted Disk-Stand Slotted Disk Stand body_1-Pivot Global Z

Crank-Stand Crank Stand body_2-Pivot Global Z

The input for this model will be in the form of a motion. A velocity motion will be applied at theCrank-Stand revolute joint.

6. From the Project Browser, right-click on Model and select Add Constraint > Motions (or right-

click the Motions icon, , from the toolbar).

The Add Motion or MotionPair dialog is displayed.

7. Click OK.

8. From the Connectivity tab, select the revolute joint between the Crank and the Stand usingthe Joint button.

Page 296: Altair MotionView 11.0 Tutorials

291 MotionView 13.0 Tutorials

Proprietary Information of Altair Engineering

Altair Engineering

9. From the Connectivity tab, use the Property drop-down menu to change the type of input fromDisplacement to Velocity.

10. From the Properties tab, enter 5 into the Value text box (located next to Linear).

11. From the Project Browser, right-click on Model and select Add Force Entity > Spring Damper

(or right-click the Spring Damper icon, , from the toolbar).

The Spring Damper or Spring DamperPair dialog is displayed.

12. Click OK to accept default values.

13. Select Torsion Spring using the drop-down arrow and click OK.

14. Use the following information to specify the connectivity of the spring damper:

Body 1 Body 2 Origin Point Alignment Vector

Slotted Disk Stand body_1-Pivot Global Z

15. Under the Properties tab, specify the following:

Property Type Value

K Linear 100

C Linear 50

16. From the Project Browser, right-click on Model and select Add Force Entity > Contact (or

right-click the Contact icon, , from the toolbar).

The Contact dialog is displayed.

17. Specify a label and variable name for the contact, or simply accept the defaults.

18. Specify the contact type as RigidToRigidContact.

19. Click OK.

20. Under the Connectivity tab, select Poisson Contact for Calculation Method and CoulombFriction On for Calculation options: using the drop-down arrow.

21. For Body I, select Crank. For Body J, select Slotted Disk. The graphics assigned to the I and Jpart are displayed in the I graphics and J graphics box.

22. For I Graphics, select Crank.

23. Similarly for J graphic, select Slotted Disk.

Page 297: Altair MotionView 11.0 Tutorials

Altair Engineering 292

Proprietary Information of Altair Engineering

MotionView 13.0 Tutorials

24. Click the Properties tab and enter the properties from the following table under the respectivefields.

Property Value Description

Penalty 1000 Models the stiffness of the contact patch.

Restitution Coeff 0.75 Models the energy loss or damping of the contact patch.

MU static 0.7 Coefficient of static friction.

MU dynamic 0.5 Coefficient of dynamic friction.

Stiction transitionvelocity

0.05 The slip velocity at which the coefficient of friction reaches thevalue specified by MU static.

Friction transitionvelocity

0.1 The slip velocity at which the coefficient of friction reaches thevalue specified by MU dynamic.

Note The two primary inputs to the Poisson contact force model are:

Penalty

Coefficient of Restitution (COR)

Too high of a value for penalty may cause numerical difficulties, while too small of a value maylead to excessive penetration.

COR is defined as the ratio of relative speed of separation to the relative speed of approach ofthe colliding bodies. A COR of 1 implies a perfectly elastic collision and a COR of 0 represents aperfectly plastic collision.

Some tuning of these two parameters is usually required to reach stable and accurate results.

Step 2: Performing Transient simulation using MotionSolve.

1. Click the Run Solver icon, , on the toolbar.

The Run panel is displayed.

2. In the Save and run current model field, specify a name for the XML file under <Working

directory>.

MotionView uses the base name of your XML file for other result files generated by MotionSolve. See the MotionView User’s Guide for details about the different result file types.

3. Specify an End Time of 4 for your simulation. Use second as the time unit (this is the default).

4. You can access the Units form from the Forms panel, .

5. Click the Run button to solve the model using MotionSolve.

Page 298: Altair MotionView 11.0 Tutorials

293 MotionView 13.0 Tutorials

Proprietary Information of Altair Engineering

Altair Engineering

Step 3: Viewing the animation in MotionView.

1. Once the run is successfully complete, the Animate button is activated.

Animate button

2. Click the Animate button. This loads the animation in the second window.

3. To start the animation, click the Start/Stop Animation icon, , on the toolbar.

4. To stop the animation, click the Start/Stop Animation icon, , on the toolbar.

Page 299: Altair MotionView 11.0 Tutorials

Altair Engineering 294

Proprietary Information of Altair Engineering

MotionView 13.0 Tutorials

MV-1015: Using Spline3D to Model Combustion Forcesin an Engine

In this tutorial you will learn how to:

Use Spline3D to model an input which depends on two independent variables.

This will be accomplished by building a Single Cylinder Engine model similar to the one shown below:

What are Spline3Ds?

Spline3Ds are reference data plotted in three-dimensional coordinates which have two independentvectors or axis. These can be visualized as a number of 2D Splines (Curves) placed at regularintervals along a third axis. For instance, a bushing is generally characterized by a Force versus theDisplacement curve. Let’s say, the Force versus displacement also varies with temperature. Effectively, there are two independent variables for the bushing force - Displacement andTemperature. 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 (orRPM). Such a scenario can be modeled using Spline3D.

Page 300: Altair MotionView 11.0 Tutorials

295 MotionView 13.0 Tutorials

Proprietary Information of Altair Engineering

Altair Engineering

Exercise

In this exercise, an engine mechanism is simulated where the combustion force that varies with regardto the crank angle and engine speed is modeled using Spline3D.

Step 1: Reviewing the model.

The files needed to start this exercise are located at <installation_directory>\tutorials\mv_hv_hg\mbd_modeling\interactive\spline3d.

1. Copy the files SingleCylEngine.mdl and FTheta.csv to your <working directory>.

2. Start a new MotionView session.

3. Open the SingleCylEngine.mdl model file.

4. Review the model.

The model is a piston cylinder mechanism with a flywheel.

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 Motionbetween markers which refers to a curve (Crank_RPM) for inputs.

Motion Panel - Connectivity Tab

Motion Panel - Properties Tab (with Expression referring to the Curve using AKISPL function)

Page 301: Altair MotionView 11.0 Tutorials

Altair Engineering 296

Proprietary Information of Altair Engineering

MotionView 13.0 Tutorials

The curve Crank_RPM indicates the time history of crank speed during the simulation. Thespeed ramps up to 500 RPM and then to 1000, 1500, and 2000 RPM.

Curve Crank_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.

Outputs are defined to measure the crank angle and RPM.

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 usingSpline3D

o A Combustion_ref marker exists as a reference for a combustion force whose Z axis is

aligned along the direction of travel of the piston.

Next, a combustion force will be added on the piston using a Spline3D.

Page 302: Altair MotionView 11.0 Tutorials

297 MotionView 13.0 Tutorials

Proprietary Information of Altair Engineering

Altair Engineering

Step 2: Adding a Spline3D entity.

1. Add a Spline3D using one of the following methods:

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 onthe Reference Entity toolbar.

The Add Spline3D dialog is displayed.

Page 303: Altair MotionView 11.0 Tutorials

Altair Engineering 298

Proprietary Information of Altair Engineering

MotionView 13.0 Tutorials

2. Enter F_ThetaSpline for the Label and spl3d_F_ThetaSpline for the Variable.

3. Click OK to close the dialog.

The Spline3D panel is displayed in the panel area with the Properties tab active.

4. Click on the Type drop-down menu and select Value.

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. Inthis tutorial, we will import the values from an external file.

Page 304: Altair MotionView 11.0 Tutorials

299 MotionView 13.0 Tutorials

Proprietary Information of Altair Engineering

Altair Engineering

5. Click the Import button to display the Import Values From File dialog.

6. Browse to the FTheta.csv file in your <working directory> and click OK.

Page 305: Altair MotionView 11.0 Tutorials

Altair Engineering 300

Proprietary Information of Altair Engineering

MotionView 13.0 Tutorials

7. In the Warning dialog that appears, click Yes to continue.

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 firstindependent variable.

The top row holds the Z-axis values (shown in red below) which is the second independentvariable.

The other columns must have the Y-axis values (shown in green below) with each columnbelonging to the particular Z-axis values heading that column.

Note The same format is applicable when using the File input type.

Page 306: Altair MotionView 11.0 Tutorials

301 MotionView 13.0 Tutorials

Proprietary Information of Altair Engineering

Altair Engineering

8. Once imported, the values are populated in the panel. You may review these by clicking on the

Expansion button in the panel to open the Spline Values Table Data window.

Page 307: Altair MotionView 11.0 Tutorials

Altair Engineering 302

Proprietary Information of Altair Engineering

MotionView 13.0 Tutorials

9. When manually keying in the values, context menus are available which allow you to Insert/Delete/Append row and column data. You can access these menus by right-clicking on any ofthe row or column headers. If the right-click is made on the last row/column, an Append optionwill also be available.

Context Menu (Row)

Context Menu (Column)

10. Click Close to close the Spline Values Table Data table.

Page 308: Altair MotionView 11.0 Tutorials

303 MotionView 13.0 Tutorials

Proprietary Information of Altair Engineering

Altair Engineering

11. Activate the Linear Extrapolation check box. This will ensure that the values are extrapolated ifthe 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 Spline3Dviewer dialog.

All three axes can be viewed in an isometric view in this window.

Page 309: Altair MotionView 11.0 Tutorials

Altair Engineering 304

Proprietary Information of Altair Engineering

MotionView 13.0 Tutorials

13. Click Close to close the viewer.

The imported values are Combustion Force on Piston vs Theta (crank angle) diagrams atdifferent speeds (as shown below). The F-Theta profiles vary slightly at different engine or crankspeeds. The same plot was visualized in the previous section in the Spline3D viewer by placingthe four different plots along the Z-axis.

Input Data for Spline3D

Step 3: Adding a force using the Spline3D.

A force will now be added to represent the combustion in the cylinder. This force will be mapped tothe Spline3D added in the previous section.

1. Add a Force using one of the following methods:

From the Project Browser, right-click on System Cyl1 and select Add > Force Entity > Forcefrom the context menu.

OR

Select System Cyl1 in the Project Browser and then right-click on the Force icon on theForce Entity toolbar.

The Add Force or ForcePair dialog is displayed.

2. Enter an appropriate Label and Variable name and click OK.

The Force panel is displayed in the panel area with the Connectivity tab active.

Page 310: Altair MotionView 11.0 Tutorials

305 MotionView 13.0 Tutorials

Proprietary Information of Altair Engineering

Altair Engineering

3. From the Connectivity tab, use the Force drop-down menu to change the type to Actionreaction.

4. Resolve the connections as shown in the image below, either through picking in the graphics areaor 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 Cyl1system.

5. Go to Trans Properties tab and change the Fz type to Spline3D.

6. Double click on the Spline3D collector, , to display the Select a Spline3D dialog.

Page 311: Altair MotionView 11.0 Tutorials

Altair Engineering 306

Proprietary Information of Altair Engineering

MotionView 13.0 Tutorials

7. Select System Cyl1 in the model tree and then navigate to and select the F_ThetaSplineSpline3D (which will then be displayed in the right pane).

8. Click OK to close the window.

9. In the Independent variable X field, enter in the following expression: `MOD({arg_Crank_angle_SolVar.VARVAL}, 720)`.

10. In the Independent variable Z field, enter in the following expression: `{arg_Crank_RPM_SolVar.VARVAL}`.

Page 312: Altair MotionView 11.0 Tutorials

307 MotionView 13.0 Tutorials

Proprietary Information of Altair Engineering

Altair Engineering

11. Click the Check Model button on the Model Check toolbar to check the model for errors.

The completed panel is shown below:

Note The solver function MOD() used in Independent variable X refers to the solver variableCrank_angle (deg) in System Flywheel (via attachment arg_Crank_angle_SolVar toSystem Cyl1). This function calculates the remainder of the division of first argumentvalue (value of the solver variable) by the second argument value (720); therebyresetting the value of Independent variable X every 720 degrees.

12. Save the model with a different name (File > Save As > Model).

Step 4: Solving the model and post-processing.

The model is now complete and can be solved in MotionSolve.

1. To solve the model, invoke the Run panel using the Run Solver button on the GeneralActions 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.

6. Close the solver window after the job is completed.

7. Click the Animate button in the panel (now active) to load the animation results in a HyperView window.

Page 313: Altair MotionView 11.0 Tutorials

Altair Engineering 308

Proprietary Information of Altair Engineering

MotionView 13.0 Tutorials

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 theAssemblies 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

and select the three window layout .

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 Type = User Defined

Y Request = REQ/70000003 Crank_angle (deg)

Y Component = f3

Selections for plotting Crank_angle (deg)

Page 314: Altair MotionView 11.0 Tutorials

309 MotionView 13.0 Tutorials

Proprietary Information of Altair Engineering

Altair Engineering

15. Next, click in the graphics area of the second window (top right) to make it the active windowand plot the CombustionForce in the Z direction:

Y Type = Force

Y Request = REQ/70000002 CombustionForce (ForceOnPiston)

Y Component = Z

Selections for plotting CombustionForce

16. Finally, we will plot the Force vs Theta plots at different speeds as applied on the piston (this willdemonstrate the usage of Spline3D input used in Step 2 of this tutorial). Click in the graphicsarea of the third window (bottom) to make it the active window.

17. Click on the Define Curves icon on the Curves toolbar.

18. Click the Add button to add a curve.

19. Click in the Curve field and rename the curve as 500 RPM.

20. Change the Source to Math.

21. Enter the expressions shown below to extract the data from the curve in the first and the secondwindow respectively between 6 and 7 seconds.

x = p2w1c1.y[subrange(p2w1c1.x,6,7)]

y = p2w2c1.y[subrange(p2w2c1.x,6,7)]

Panel entries for plotting Force vs Theta

22. Click Apply to plot.

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 theexpression.

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.

Page 315: Altair MotionView 11.0 Tutorials

Altair Engineering 310

Proprietary Information of Altair Engineering

MotionView 13.0 Tutorials

23. Similarly, add three more plots for 1000, 1500, and 2000 RPM. Use time values of: 16, 17; 26,

27; and 36, 37 respectively (in place of 6, 7 shown in the expression above).

24. Assign different colors to these curves using the Curve Attributes panel , or by selecting thecurves 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. Acomparison is shown below:

Validating the Spline3D used by the Solver

Page 316: Altair MotionView 11.0 Tutorials

311 MotionView 13.0 Tutorials

Proprietary Information of Altair Engineering

Altair Engineering

MV-1023: Using Python Subroutines in MotionViewModel Building

The objective of this tutorial is to replace several entities in a MotionView model with Python usersubroutines. You will run a model initially, and then edit the file to incorporate Python scripts in placeof MotionView entities and compare the results from each simulation.

In this tutorial, you will learn how:

User subroutines are incorporated into MotionView

User subroutines are useful in customizing models

To create Python scripts that can be used to define these subroutines (and how they arecalled by MotionView).

You must be familiar with the MotionView user interface and entities panel, as well as have someexperience defining and modifying entities. Some experience with the Python programming language isnecessary to fully understand the topics covered.

Exercise One - Introduction to User Subroutines

User subroutines are a useful tool to customize simulations and analyses. These subroutines, orusersubs can be created using variety of programming languages like C, Ruby, TCL, and Python. Subroutines created in programming languages like C, C++ and FORTRAN etc. are compiled to create *.dll files using the MS UserSub Build Tool (located in the MotionView Tools menu). These dlls are

then used by the solver. In older versions of MotionView only compiled usersubs (*.dll) were

supported. Starting with MotionView version 11.0, usersubs are enabled to use Python and Matlabscripts. In this tutorial, we will be using Python to create usersubs. User subroutines can make useof external Python scripts in order to define complex simulations, which cannot be created through theMotionView GUI. With a basic knowledge of the Python programming language, a user can easilygenerate intricate experiments to simulate any complex mechanism.

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

from <installation_directory>\tutorials\mv_hv_hg\mbd_modeling\motionsolve\python_usersub to

your <working directory>.

Page 317: Altair MotionView 11.0 Tutorials

Altair Engineering 312

Proprietary Information of Altair Engineering

MotionView 13.0 Tutorials

The single cylinder engine model

The model we are using is a single cylinder engine, and uses a curve, an output, a force, and a motionentity. The system also uses default damping.

The curve is read from a CSV file, and gives a force value based on the angular displacementof 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 variablepressure 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.

Page 318: Altair MotionView 11.0 Tutorials

313 MotionView 13.0 Tutorials

Proprietary Information of Altair Engineering

Altair Engineering

The following is a list of the entities and usersubs we will be using in this tutorial, along with a briefdescription of their usage:

Entity Usrsub Description

Curve SPLINE_READ Reads the curve data file.

Request REQSUB Outputs the requested values

Force GFOSUB Applies a force on the system.

Motion MOTSUB Applies a motion to the system.

Damping DMPSUB Defines the damping of a flexbody.

Step 1: Running the model.

1. Click the Run panel icon, , to access the Run panel.

2. Click on the folder icon located next to the Save and run current model option, and browse toyour <working directory>. Specify the name as 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.

Exercise Two - Adding User Subroutines

Notes on using XML syntax in Python

Python can use many MotionSolve functions and inputs when certain syntax rules are followed. Whenusing 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 thoseoutlined in the MotionSolve online help pages exactly. When accessing model data in python througha 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 thescript, and do not need additional defining to use. An example of these syntax rules being used isshown below:

def REQSUB(id, time, par, npar, iflag):

[A, errflg] = py_sysfnc(“DX”,[par[0],par[1]])

return A

Page 319: Altair MotionView 11.0 Tutorials

Altair Engineering 314

Proprietary Information of Altair Engineering

MotionView 13.0 Tutorials

Step 1: Using SPLINE_READ to Replace the Curve Entity.

The first user-subroutine we will implement uses the SPLINE_READ function to return the curve from

the included pressure_curve.csv file. SPLINE_READ is the usersub that corresponds to the curve

entity in MotionView. It uses data points in an external file to create a curve, which can then beused by other entities.

Writing the Python script:

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 ofthe 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 isnecessary, 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”.

12. Save this file to your working directory as nonlin_spline.py.

Page 320: Altair MotionView 11.0 Tutorials

315 MotionView 13.0 Tutorials

Proprietary Information of Altair Engineering

Altair Engineering

Your nonlin_spline.py Python script should resemble the following:

def SPLINE_READ(id, file_name, block_name):

import csv

ifile= open('pressure_curve.csv','r') ## opens data file as readable variable

curv = csv.reader(ifile) ## reads csv data, stores as useablevar.

L = [] ## creates empty list

for item in curv:

L.append(item) ## separates file values into list

L = L[1:] ## removes block names from list

i=0 ## creates counter

x = 16*[0.0]

y = 16*[0.0] ## splits list into x and y lists

while i < (len(L)-1):

x[i] = float(L[i][0]) ## changes values from str to float

y[i] = float(L[i][1])

i+=1 ## counter increment

z = 0.0 ## defines z value

ifile.close() ## closes data file

errflg = py_put_spline(id,x,y,z) ## var to create MotionSolve spline

return errflg ## returns var

Implementing the Python script:

1. In MotionView, go to the Curve panel , and locate the Force_Pressure curve in the projectdirectory tree to the left of the MotionView workspace.

2. From the Properties tab, check the box marked User-defined.

3. From the Attributes tab, make sure Linear extrapolation is checked.

4. Click on the User-Defined tab, and use the File name file browser to select thepressure_curve.csv file.

5. Check the box marked Use local file and function name. Use the Local File file browser (thefolder button to the right) to locate and select the nonlin_spline.py file.

Page 321: Altair MotionView 11.0 Tutorials

Altair Engineering 316

Proprietary Information of Altair Engineering

MotionView 13.0 Tutorials

6. Change the Function Type in the drop-down menu from DLL to Python, and ensure the functionname is SPLINE_READ. You do not need to enter anything for the Block name, as it is not

needed in this tutorial.

The curve panel using the SPLINE_READ usersub

Step 2: Using REQSUB to Request an Output.

The second user-subroutine will use Python to specify which values to return. In this tutorial, thereturned values will be the magnitude of displacement for the piston.

Writing the Python script:

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]”.

4. Save this file to your working directory as req_nonlin.py.

Your req_nonlin.py Python script should resemble the following:

def REQSUB(id, time, par, npar, iflag):

[D, errflg] = py_sysfnc("DM",[par[0],par[1]]) ## sets "D" as pistondisplacement mag

result = [0,D,0,0,0,0,0,0] ## lists results for output return

return result ## sends list with results to motionsolve as output

Implementing the Python script:

1. In MotionView, go to the Outputs panel , and locate the Output_Conrod_Length output inthe project directory tree to the left of the MotionView workspace.

The Outputs panel is displayed.

2. From the Properties tab, select User Defined from the first drop-down menu.

Page 322: Altair MotionView 11.0 Tutorials

317 MotionView 13.0 Tutorials

Proprietary Information of Altair Engineering

Altair Engineering

3. Click in the text field labeled Output, and then click on the button to open the ExpressionBuilder.

4. In the text field of the Expression Builder, click inside the parentheses and add “{},{}”.

5. From the Expression Builder, locate and select the Marker I idstring (located in the Outputsfolder in the directory) and insert this id string into the expression by positioning the cursor insidea set of braces and clicking the Add button. In addition, add the Marker J idstring into theexpression by repeating this same process.

Expression Builder dialog

6. Click OK to close the dialog.

7. Check the Use local file and function name box, and select Python from the Function Typedrop-down menu.

Page 323: Altair MotionView 11.0 Tutorials

Altair Engineering 318

Proprietary Information of Altair Engineering

MotionView 13.0 Tutorials

8. Use the Local File file browser to locate and select the req_nonlin.py script, and make sure

that the Function name text field reads REQSUB.

Outputs panel using REQSUB

Step 3: Using GFOSUB to Replace the Force Entity.

The GFOSUB user subroutine replaces a force with a user defined Python script. The GFOSUB used here

will take the curve data defined with SPLINE_READ, and change depending on the Conrod angle

according to the curve.

Writing the Python script:

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 previousstep to degrees. As the model extends from the origin into the negative y direction, you will needto 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 Akimainterpolation function. The data from interpolation is stored in the first column, so use “return

[0,C[0],0]”.

7. Save this file to your working directory as gfo_nonlin.py.

Your gfo_nonlin.py Python script should resemble the following:

def GFOSUB(id, time, par, npar, dflag, iflag):

from math import pi

[A, errflg] = py_sysfnc("AZ",[par[1],par[2]]) ## retreives conrod angle

B = ((-1)*A*180)/pi ## converts radians to degrees

[C, errflg] = py_akispl(B,0,par[0],0) ## interpolates data to fit curve

return [0,C[0],0] ## returns C data as force values

Page 324: Altair MotionView 11.0 Tutorials

319 MotionView 13.0 Tutorials

Proprietary Information of Altair Engineering

Altair Engineering

Implementing the Python script:

1. In MotionView, go to the Forces panel , and locate the Force_Gas_Pressure force in theproject directory tree to the left of the MotionView workspace.

2. From the Connectivity tab, check the User-defined properties box.

3. From the User-Defined tab, edit the Force value with the Expression Builder to include thecurve idstring, the ground marker idstring, and the crank marker idstring.

4. Click OK to close the dialog.

5. Check the Use local file and function name box, and select Python from the Function Typedrop-down menu.

6. For Local File, select gfo_nonlin.py from your working directory.

Page 325: Altair MotionView 11.0 Tutorials

Altair Engineering 320

Proprietary Information of Altair Engineering

MotionView 13.0 Tutorials

7. Make sure the Function name is set to GFOSUB.

Step 4: Using MOTSUB to Define a Motion.

Writing the Python script:

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 functionused in this tutorial is “A = 575.6*time”. This makes the first derivative equal to “A = 575.6”,

and the second derivative equal to “A = 0.0”.

4. Return the function variable with “return A”.

5. Save this file to your working directory as mot_nonlin.py.

Your mot_nonlin.py Python script should resemble the following:

def MOTSUB(id, time, par, npar, iord, iflag):

if iord==0: ## function

A = 575.6*time

elif iord==1: ## first derivative

A = 575.6

else: ## second derivative

A = 0.0

return A ## returns function based on iord input

Implementing the Python script:

1. In the directory tree on the left side of the HyperWorks desktop, locate the Motion_Crankmotion and click on it.

The Motions panel is displayed.

Page 326: Altair MotionView 11.0 Tutorials

321 MotionView 13.0 Tutorials

Proprietary Information of Altair Engineering

Altair Engineering

2. In the Motions panel, check the User-defined properties box.

3. Click on the User-Defined tab.

Because we defined the function in the Python script, we do not need to modify USER() textfield.

4. Check the box labeled Use local file and function name, select Python from the Function Typedrop-down menu.

5. Use the Local File file browser to locate and select the mot_nonlin.py file.

Step 5: Using DMPSUB to Add Custom Flexbody Damping.

Writing the Python script:

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”.

2. Define a list the length of “nmode” using “cratios = nmode*[0.0]”.

nmode is the number of modes in the flexbody.

3. Create an “if” statement to iterate along the list of modes in the flexbody. The “xrange()”

function can be used here, resulting in “for I in xrange(nmode):”.

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”.

6. Save your script as dmp_nonlin.py.

Page 327: Altair MotionView 11.0 Tutorials

Altair Engineering 322

Proprietary Information of Altair Engineering

MotionView 13.0 Tutorials

Your dmp_nonlin.py Python script should resemble the following:

def DMPSUB(id, time, par, npar, freq, nmode, h):

cratios = nmode*[0.0] ## makes preallocated list for markers

for i in xrange(nmode):

cratios[i] = 1.0 ## sets marker damping to 1

return cratios ## returns damping values

Implementing the Python script:

1. In the directory tree on the left side of the HyperWorks desktop, locate the Conrod body andclick 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 thepanel) to display the Modes dialog.

3. Use the drop-down menu to select the User Function Damping option.

Because we defined the damping in our dmp_nonlin.py script, we do not need to change the

USER() expression.

4. Go to the Run panel .

Page 328: Altair MotionView 11.0 Tutorials

323 MotionView 13.0 Tutorials

Proprietary Information of Altair Engineering

Altair Engineering

5. Change the End time to 0.01, and the Print interval to 0.001.

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"

Your flexbody definition should look like below:

<Body_Flexible

id = "30104"

lprf_id = "30104002"

mass = "7.424574879203591E-02"

inertia_xx = "1.471824534365642E+02"

inertia_yy = "4.505004745855096E+00"

inertia_zz = "1.501914135052064E+02"

inertia_xy = "-5.546373592613223E-03"

inertia_yz = "-1.984540442733755E-03"

inertia_xz = "1.557626595859531E-03"

cm_x = "1.191728011928773E-03"

cm_y = "-2.225471002399553E+01"

cm_z = "5.469513396916666E-05"

h3d_file = "conrod.h3d"

is_user_damp = "TRUE"

Page 329: Altair MotionView 11.0 Tutorials

Altair Engineering 324

Proprietary Information of Altair Engineering

MotionView 13.0 Tutorials

usrsub_param_string = "USER()"

interpreter = "Python"

script_name = "dmp_nonlin.py"

usrsub_fnc_name = "DMPSUB"

flexdata_id = "30104"

animation_scale = "1."

/>

Exercise Three - Running Your Simulation with Usersubs

Now that all the user subroutines have been implemented, run your model, and compare your resultsto those from your initial test.

Step 1: Using the Run Solver Panel to Run Your Model.

1. Go to the Run panel , click on/activate the Run MotionSolve file radio button.

2. Now browse to the *.xml file saved in previous step.

3. Click the Run button.

Exercise Four - Comparing Your Results

Now that we have results for both the initial model and the model using user subroutines, we willcompare the data to ensure accuracy. We will do this using HyperGraph and Hyperview to comparethe outputs and deformations of the system.

Step 1: Using HyperGraph to Plot the Displacement Magnitudes.

Using the outputs from both simulations, we will compare the displacement magnitude of the piston. Acorrect result from the usersub run will match the results from the initial run.

1. Begin by opening a new window by clicking the Add Page button .

Page 330: Altair MotionView 11.0 Tutorials

325 MotionView 13.0 Tutorials

Proprietary Information of Altair Engineering

Altair Engineering

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 Datafile 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 YComponent.

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 Typeand Y Component respectively.

8. Click Apply.

Comparison of output results from both model simulations

Page 331: Altair MotionView 11.0 Tutorials

Altair Engineering 326

Proprietary Information of Altair Engineering

MotionView 13.0 Tutorials

Step 2: Using HyperView to Compare Flexbody Stresses.

Using HyperView, you can view the stresses and deformations on the flexbody. The results betweenthe two simulations should be the same.

1. Add a new window by clicking the Add Page button .

2. Switch the application from HyperGraph 2D to HyperView using the Client Selector drop-downmenu.

3. Click the Load Results button on the Standard toolbar.

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.

Only the flexbody component should be displayed.

8. Click the Contour panel button located on the Results toolbar.

The Contour panel is displayed.

9. Set Result type to Deformation->Displacement (v), and click on the flexbody in the modelwindow.

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 modelwindow.

13. Separate your model window into two halves using the Page Window Layout drop-down menu

(located on the Page Controls toolbar).

Page 332: Altair MotionView 11.0 Tutorials

327 MotionView 13.0 Tutorials

Proprietary Information of Altair Engineering

Altair Engineering

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.

Comparison of flexbody deformation in HyperView

Page 333: Altair MotionView 11.0 Tutorials

Altair Engineering 328

Proprietary Information of Altair Engineering

MotionView 13.0 Tutorials

MV-1024: Using User Subroutines in MotionSolveModels

User subroutines are created for various reasons. Some include:

To describe a physical phenomenon that is determined by non-trivial logical conditions.

When it is impractical to formulate a complicated expressions in an explicit form.

To take full advantage of a programming language like C/C++ or Fortran and simplerprogramming with interpreters like Tcl, Python, and Ruby.

To use your own subroutines in MotionSolve, follow these steps:

1. Create a C/C++, FORTRAN, Tcl, or Python source file that contains the user-defined modelingentity.

Refer to the MotionSolve User's Guide for a list of supported solver subroutines and a generalguideline 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 sourcefile directly for Tcl or Python.

MotionSolve supports two separate levels of user DLLs and the algorithm attempts to resolve thesymbols, starting from the most specific library.

A) Element Level DLL (most specific)

Specify the name of the DLL in the modeling element definition.

B) Machine Level DLL

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 overridesnumber two.

3. Modify the corresponding entity in your multi-body model to be "user defined" and point it to yourDLL. This can be done in two ways:

A) By modifying the entity in the MotionView interface.

B) By editing the MotionSolve XML file.

Regardless of the method you select, you will end up with an XML file where one or more entitiesare now user defined.

Page 334: Altair MotionView 11.0 Tutorials

329 MotionView 13.0 Tutorials

Proprietary Information of Altair Engineering

Altair Engineering

For example, consider the coupler modeling element in the XML file:

<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 = "C:/work/testsub.dll"></Constraint_Coupler>

The usrsub_dll_name argument defines C:/work/testsub.dll as the element level DLL for this

coupler element. Any element can be defined by pointing to a different DLL.

The coupler modeling element in the XML file can also be defined as:

<Constraint_Couplerid = "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 theMS_USERSUBDLL environment variable.

4. Run MotionSolve, verifying that it picks up the appropriate DLL during simulation.

Page 335: Altair MotionView 11.0 Tutorials

Altair Engineering 330

Proprietary Information of Altair Engineering

MotionView 13.0 Tutorials

Exercise

The model file required for this exercise, Pendu_model.mdl, is available in the HyperWorks Desktop

installation at this location: <installation_directory>\tutorials\mv_hv_hg\mbd_modeling\motionsolve\. Copy the file to

your <working directory>.

Step 1: Using an expression to define motion.

1. Launch a new MotionView session.

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 jointbetween the Pendulum Body and the Ground Body.

4. Click the Properties tab.

Set an expression of 3.142* TIME for the displacement motion.

5. Click the Outputs panel icon, , to access the Outputs panel.

Review the output request.

6. Click the Run panel icon, , to access the Run panel.

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.

8. Confirm that the Simulation type: is set to Transient.

9. Specify 1 as the End Time.

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 animationof the simulation.

13. From the Run panel, click the Plot button to view the time-histories of the output request.

Page 336: Altair MotionView 11.0 Tutorials

331 MotionView 13.0 Tutorials

Proprietary Information of Altair Engineering

Altair Engineering

Step 2: Using the MOTSUB user subroutine to define motion.

In this step, we will use the user subroutine MOTSUB. This user subroutine has been compiled and

linked in the DLL ms_csubdll.dll. This machine level DLL is provided in the HyperWorks installation.

For the Windows 32-bit platform, the DLL is located at: <installation_directory>\hwsolvers

\usersub\subdll\WIN32\.

We will use the ms_csubdll.dll as a machine level DLL.

1. Create an environment variable MS_USERSUBDLL and set the value to the DLL file.

For Windows 32-bit platform users, this will be: <installation_directory>\hwsolvers\usersub\subdll\WIN32\ms_csubdll.dll

Right-click on the My Computer icon. From the Advanced tab, select Environmentvariables > New (under User variables).

Set Variable name: to MS_USERSUBDLL.

Set Variable value: to <installation_directory>\hwsolvers\usersub\subdll\win32

\ms_csubdll.dll.

Page 337: Altair MotionView 11.0 Tutorials

Altair Engineering 332

Proprietary Information of Altair Engineering

MotionView 13.0 Tutorials

2. With the Pendu_model.mdl from the previous step open in the MotionView model window, go to

the Motions panel, .

3. From the Connectivity tab, check the User-defined properties check box.

4. Click the User-Defined tab and enter `USER(100001,5,2)` in the text-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

5. From the File menu, select Export > Model.

Note Click the Save File icon, , on the Main toolbar to save the file in working directorywith the existing name. If it’s a new model, you will be prompted for the name of themodel.

The Export Model panel is displayed.

Specify the file name as Pendu_model_usersub.mdl.

6. Click the Run panel icon, , to access the Run panel.

7. Save and run current model , , and browse to your <working directory>. Specify

Pendu_model_usersub.xml for the MotionSolve input XML file.

Page 338: Altair MotionView 11.0 Tutorials

333 MotionView 13.0 Tutorials

Proprietary Information of Altair Engineering

Altair Engineering

8. Confirm that the Simulation type: is set to Transient.

9. Specify 1 as the End Time.

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 .

15. Click Apply.

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>.

Page 339: Altair MotionView 11.0 Tutorials

Altair Engineering 334

Proprietary Information of Altair Engineering

MotionView 13.0 Tutorials

18. Browse through the XML file to locate the Motion_Joint block.

<Motion_Joint id = "301001" label = "Motion 0" type = "EXPRESSION" val_type = "D" expr = "3.142*TIME" joint_id = "301001" joint_type = "R"/>

19. Open the MotionSolve XML file Pendu_model_usersub.xml 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 bythe MS_USERSUBDLL environment variable.

To use an element level DLL, set the value of the usrsub_dll_name parameter to point to the

DLL.

The usrsub_param_string parameter is used to pass arguments to the user subroutine.

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.

Page 340: Altair MotionView 11.0 Tutorials

335 MotionView 13.0 Tutorials

Proprietary Information of Altair Engineering

Altair Engineering

MV-1025: Modeling Point-to-Curve (PTCV) Higher-PairConstraint

In this tutorial, you will learn how to:

Model a PTCV (point-to-curve) joint

A PTCV (point-to-curve) joint is a higher pair constraint. This constraint restricts a specified point ona body to move along a specified curve on another body. The curve may be open or closed, planar orin 3-d space. The point may belong to a rigid, flexible or point body. This constraint can help avoidmodeling contact in some systems. It may prove advantageous since proper contact modeling (refertutorial MV-1010) in many cases involves fine-tuning of contact parameters. One good example forsuch a system is a knife-edge cam follower mechanism. One can avoid modeling the contact betweenthe cam and follower by defining a PTCV joint: the curve being the cam profile and the point being thetip of the follower.

A Knife-edge Cam Follower Mechanism

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 location <installation_directory>\tutorials\mv_hv_hg\mbd_modeling\interactive\ to your <Working

directory>.

Step 1: Creating points.

Let’s start with creating points that will help us locate the bodies and joints as required. We will definepoints for center of mass of the bodies and joint locations.

1. Start a new MotionView Session. We will work with the default units (kg, mm, s, N).

Page 341: Altair MotionView 11.0 Tutorials

Altair Engineering 336

Proprietary Information of Altair Engineering

MotionView 13.0 Tutorials

2. From the Project Browser right-click on Model and select Add Reference Entity > Point (or

right-click the Points icon on the Model-Reference toolbar).

The Add Point or PointPair dialog is displayed.

3. For Label, enter PivotPoint.

4. Accept the default Variable name and click OK.

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

FollowerCM 0.0 65.557 0.0

FollowerPoint 0.0 25.0 0.0

FollowerJoint 0.0 85.0 0.0

CamCM 0.0 -14.1604 0.0

Step 2: Creating Bodies.

We will have two bodies apart from the ground body in our model visualization; the cam and thefollower. Pre-specified inertia properties will be used to define the bodies.

1. From the Project Browser right-click on Model and select Add Reference Entity > Body (or

right-click the Body icon on the Model-Reference toolbar).

The Add Body or BodyPair dialog is displayed.

2. For Label, enter Cam and click OK.

3. From the Project Browser right-click on Model and select Add Reference Entity > Body (or

right-click the Body icon on the Model-Reference toolbar).

The Add Body or BodyPair dialog is displayed.

4. For Label, enter Follower and click OK.

5. From the Properties tab, specify the following for the two bodies:

Body Mass Ixx Iyy Izz Ixy Iyz Izx

Cam 0.174526 60.3623 63.699 123.276 0.0 0.0 0.0

Follower 0.0228149 7.10381 0.219116 7.22026 0.0 0.0 0.0

Page 342: Altair MotionView 11.0 Tutorials

337 MotionView 13.0 Tutorials

Proprietary Information of Altair Engineering

Altair Engineering

6. For the Cam body, under the CM Coordinates tab, check the Use center of mass coordinatesystem box.

7. Double click on Point.

The Select a Point dialog is displayed. Choose CamCM and click OK.

8. Accept defaults for axes orientation properties.

9. For the Follower body, under the CM Coordinates tab, check the Use CM Coordsys box.

10. Double click on Point.

The Select a Point dialog is displayed. Choose FollowerCM and click OK.

11. Accept defaults for axes orientation properties.

Step 3: Creating Joints.

Here, we will define all the necessary joints except the PTCV joint which will be defined as anadvanced joint later. We require two joints for the model. The first of them is the revolute jointbetween the cam and ground body. The second joint we need is a translational joint between thefollower and ground body.

1. From the Project Browser right-click on Model and select Add Constraint > Joint (or right-click

the Joints icon on the Model-Constraint toolbar).

The Add Joint or JointPair dialog is displayed.

2. For Label, enter CamPivot.

3. Select Revolute Joint as the Type and click OK.

4. From the Connectivity tab, double-click on Body 1.

The Select a Body dialog is displayed. Choose Cam and click OK.

5. From the Connectivity tab, double-click on Body 2.

The Select a Body dialog is displayed. Choose Ground Body and click OK.

6. From the Connectivity tab, double-click on Point.

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 Joints icon on the Model-Constraint toolbar).

The Add Joint or JointPair dialog is displayed.

9. For Label, enter FollowerJoint.

10. Select Translational Joint as the Type and click OK.

Page 343: Altair MotionView 11.0 Tutorials

Altair Engineering 338

Proprietary Information of Altair Engineering

MotionView 13.0 Tutorials

11. From the Connectivity tab, double-click on Body 1.

The Select a Body dialog is displayed. Choose Follower and click OK.

12. From the Connectivity tab, double-click on Body 2.

The Select a Body dialog is displayed. Choose Ground Body and click OK.

13. From the Connectivity tab, double-click on Point.

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.

Step 4: Creating Markers.

Now, we will define some markers required for the definition of the PTCV joint. We need two markers,one associated with the cam (for the curve) and the other associated with the follower (for thepoint).

1. From the Project Browser right-click on Model and select Add Reference Entity > Marker (or

right-click the Markers icon on the Model-Reference toolbar).

The Add Marker or MarkerPair dialog is displayed.

2. For Label, enter CamMarker and click OK.

3. From the Properties tab, double-click on Body.

4. The Select a Body dialog is displayed. Choose Cam and click OK.

5. From the Properties tab, double-click on Point.

6. The Select a Point dialog is displayed. Choose PivotPoint and click OK.

7. Accept the defaults for axes orientation.

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-Referencetoolbar).

The Add Marker or MarkerPair dialog is displayed.

9. For Label, enter FollowerMarker and click OK.

10. From the Properties tab, double-click on Body.

11. The Select a Body dialog is displayed. Choose Follower and click OK.

12. From the Properties tab, double-click on Point.

13. The Select a Point dialog is displayed. Choose FollowerPoint and click OK.

14. Accept the defaults for axes orientation.

Page 344: Altair MotionView 11.0 Tutorials

339 MotionView 13.0 Tutorials

Proprietary Information of Altair Engineering

Altair Engineering

Step 5: Creating Graphics.

Graphics for the cam and follower have been provided as h3d files. We need to associate the h3dswith bodies defined in our model. To make visualization better, we will also create some graphics forthe joints.

1. From the Project Browser right-click on Model and select Add Reference Entity > Graphic (or

right-click the Graphics icon on the Model-Reference toolbar).

The Add Graphics or GraphicPair dialog is displayed.

2. For Label, enter Cam.

3. Choose File from the drop-down menu.

4. Click on the file browser icon and select CamProfile.h3d from the model folder.

5. Click Open and then OK.

6. From the Connectivity tab, double-click on Body.

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-Referencetoolbar).

The Add Graphics or GraphicPair dialog is displayed.

8. For Label, enter Follower.

9. Choose File from the drop-down menu and click OK.

10. Click on the browser icon and select FollowerProfile.h3d from the model folder.

11. Click Open.

12. Under the Connectivity tab, double-click on Body.

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

right-click the Graphics icon on the Model-Reference toolbar).

The Add Graphics or GraphicPair dialog is displayed.

2. For Label, enter PivotGraphicOne (the first graphic to show the cam pivot).

3. Choose Cylinder from the drop-down menu and click OK.

Page 345: Altair MotionView 11.0 Tutorials

Altair Engineering 340

Proprietary Information of Altair Engineering

MotionView 13.0 Tutorials

4. From the Connectivity tab, double-click on Body.

The Select a Body dialog gets displayed. Choose Ground Body and click OK.

5. Double click on Point.

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.

8. From the Properties tab, specify the following values:

Property Value

Length 7.5

Offset -3.75

Radius 1 4.000

Radius 2 4.000

9. For the Cap properties, choose Cap Both Ends.

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-Referencetoolbar).

The Add Graphics or GraphicPair dialog is displayed.

11. For Label, enter PivotGraphicTwo (the second graphic to show the cam pivot).

12. Choose Cylinder from the drop-down menu and click OK.

13. Under the Connectivity tab, double-click on Body.

The Select a Body dialog gets displayed. Choose Cam and click OK.

14. Double click on Point.

The Select a Point dialog is displayed. Choose PivotPoint and click OK.

15. Click on the arrow below Direction and select the Vector option.

16. Click on Vector.

The Select a Vector dialog is displayed. Choose Global Z and click OK.

Page 346: Altair MotionView 11.0 Tutorials

341 MotionView 13.0 Tutorials

Proprietary Information of Altair Engineering

Altair Engineering

17. From the Properties tab, specify the following values:

Property Value

Length 7.6

Offset -3.8

Radius 1 2.000

Radius 2 2.000

18. For the Cap properties, choose Cap Both Ends.

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-Referencetoolbar). Add.

The Add Graphics or GraphicPair dialog is displayed.

20. For Label, enter FollowerJointGraphic (the graphic for the follower translational joint).

21. Choose Box from the drop-down menu and click OK.

22. From the Connectivity tab, double-click on Body.

The Select a Body dialog gets displayed. Choose Ground Body and click OK.

23. For Type, choose Center from the drop-down menu.

24. Double-click on Point.

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 definethe ZX plane.

26. From the Properties tab, specify the following properties:

Property Value

Length X 15

Length Y 10

Length Z 10

Page 347: Altair MotionView 11.0 Tutorials

Altair Engineering 342

Proprietary Information of Altair Engineering

MotionView 13.0 Tutorials

At the end of this step, your model should look like the one shown in the figure below:

A Knife-edge Cam Follower Mechanism in MotionView

Step 6: Creating the Curve.

The curve that we will use here is the curve that defines the profile of the cam. The data for thiscurve has been provided in .csv format. We need to define the curve using the data in the given file.

1. From the Project Browser right-click on Model and select Add Reference Entity > Curve (or

right-click the Curves icon on the Model-Reference toolbar).

The Add Curve dialog is displayed.

2. For Label, enter CamProfile and click OK.

3. From the Properties tab, use the first drop-down menu to change the curve from 2D Cartesianto 3D Cartesian.

4. From the Properties tab, click on the x radio button.

5. Click on the file browser icon and select CamProfile.csv. Click Open.

Page 348: Altair MotionView 11.0 Tutorials

343 MotionView 13.0 Tutorials

Proprietary Information of Altair Engineering

Altair Engineering

6. Choose the properties of the curve as shown in the figure below:

7. From the Properties tab, click on the y radio button.

8. Click on the file browser icon and select CamProfile.csv. Click Open.

9. Choose the properties of the curve as shown in the figure below:

10. From the Properties tab, click on the z radio button.

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:

Notice the different column numbers used for x, y, and z properties.

13. From the Properties tab, use the fourth drop-down menu to set the curve type to ClosedCurve.

Step 7: Creating the PTCV Joint.

Now, we will create the PTCV joint.

1. From the Project Browser right-click on Model and select Add Constraint > Advanced Joint (or

right-click the Advanced Joints icon on the Model-Constraint toolbar).

The Add AdvJoint dialog is displayed.

2. For Label, enter PTCV.

3. Choose PointToCurveJoint from the drop-down menu and click OK.

Page 349: Altair MotionView 11.0 Tutorials

Altair Engineering 344

Proprietary Information of Altair Engineering

MotionView 13.0 Tutorials

4. From the Connectivity tab, double-click on Body 1.

The Select a Body dialog gets displayed. Choose Follower and click OK.

5. From the Connectivity tab, double-click on Point.

The Select a Point dialog gets displayed. Choose FollowerPoint and click OK.

6. From the Connectivity tab, double-click on Curve.

The Select a Curve dialog gets displayed. Choose CamProfile and click OK.

7. From the Connectivity tab, double-click on Ref Marker.

The Select a Marker dialog gets displayed. Choose CamMarker and click OK.

Step 8: Specifying the Cam Motion.

After we have the topology and constraints specified, we need to provide the cam motion. The mostnatural choice here is a uniform motion imposed on the revolute joint.

1. From the Project Browser right-click on Model and select Add Constraint > Motions (or right-

click the Motions icon on the Model-Constraint toolbar).

The Add Motion or MotionPair dialog is displayed.

2. For Label, enter CamMotion and click OK.

3. From the Connectivity tab, double-click on Joint. Choose CamPivot and click OK.

4. From the Properties tab, specify the properties as `10*TIME`.

Step 9: Specifying Gravity.

Since our shaft is along the Y-axis, we want the gravity to be in the negative Y direction. To specifythis:

1. Click the Forms icon on the Model-General toolbar.

The Forms panel is displayed.

Page 350: Altair MotionView 11.0 Tutorials

345 MotionView 13.0 Tutorials

Proprietary Information of Altair Engineering

Altair Engineering

2. Select Gravity and specify the following values:

Direction Value

X 0

Y -9810

Z 0

Step 10: Specifying Output Requests.

We would like to monitor the reaction on PTCV joint since it can help us verify the correctness of ourresults. This will be discussed in detail towards the end of the tutorial when the topic of 'lift-offs' willbe discussed.

1. From the Project Browser right-click on Model and select Add General MDL Entity > Output

(or right-click the Outputs icon on the Model-General toolbar).

The Add Output dialog is displayed.

2. For Label, enter PTCV Reaction and click OK.

3. From the Properties tab, choose Expressions from the drop-down menu.

4. Click in the F2 expression box.

5. Click on the button.

The Expression Builder dialog is displayed.

Page 351: Altair MotionView 11.0 Tutorials

Altair Engineering 346

Proprietary Information of Altair Engineering

MotionView 13.0 Tutorials

6. Populate the expression as 'PTCV({aj_0.idstring},0,2,0)'.

7. Click OK.

Page 352: Altair MotionView 11.0 Tutorials

347 MotionView 13.0 Tutorials

Proprietary Information of Altair Engineering

Altair Engineering

8. Repeat the process for F3, F4, F6, F7, and F8 by changing the 3rd parameter to 3, 4, 6, 7, and8 accordingly.

The PTCV(id, jflag, comp, ref_marker) function returns the reaction on the PTCV joint:

id ID of the PTCV joint

jflag 0 gives reaction on the I-marker and 1 on J-marker

comp component of the reaction

ref_marker reference marker (0 implies Global Frame)

Step 11: Running the Model.

We now have the model defined completely and it is ready to run.

1. Click the Run icon on the toolbar.

The Run panel is displayed.

2. From the Main tab, specify values as shown below:

3. Choose the Save and run current model radio button.

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.

7. To run the model, click the Run button on the panel.

The solver will get invoked here.

Page 353: Altair MotionView 11.0 Tutorials

Altair Engineering 348

Proprietary Information of Altair Engineering

MotionView 13.0 Tutorials

Step 12: Viewing the Results.

1. Once the solver has finished its job, the Animate button will be active. Click on Animate.

The icon can be used to start the animation, and the icon can be used to stop/pause theanimation.

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

application from MotionView to HyperGraph 2D .

4. Click the Build Plots icon on the Curves toolbar.

5. Click on the browser icon and load the result.abf file.

6. Make selections for the plot as shown below:

We are plotting the Y profile of the center of mass of the follower.

7. Click Apply.

8. The profile for the Y-displacement of the follower should look like the one shown below:

Page 354: Altair MotionView 11.0 Tutorials

349 MotionView 13.0 Tutorials

Proprietary Information of Altair Engineering

Altair Engineering

9. If we set the X-axis properties to zoom in on one cycle, the profile looks as 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 maycause the follower to lose contact with the cam. This is called ‘lift-off’. In such cases, modeling thesystem using a PTCV joint will give us incorrect results. This is because the PTCV joint constrains thefollower point to be always on the curve and hence cannot model lift-offs. For such cases, contactmodeling has to be used (refer tutorial MV-1010 for contact modeling). However, one would like tostart with a PTCV model since modeling a PTCV joint is a lot easier than modeling contact. Given thisscenario, the following modeling steps should be followed:

1. Model the system using a PTCV joint.

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 isgood enough.

Now, let’s check if our PTCV model is good enough. For this, we need to plot the reaction profileon the follower. Since the follower is moving along the Y-axis, any negative reaction along the Y-axis is a ‘pulling’ reaction. So, let’s plot the Y-reaction on the follower. For this:

3. Add a new page to the session by clicking on the Add Page icon .

4. Choose HyperGraph 2D and click on Build Plots .

5. Click on the browser icon and load the result.abf file.

6. Make selections for the plot as shown below:

We are plotting the Y profile of the PTCV reaction on the follower.

Page 355: Altair MotionView 11.0 Tutorials

Altair Engineering 350

Proprietary Information of Altair Engineering

MotionView 13.0 Tutorials

7. Click Apply.

The profile should look like the one shown below:

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 henceit is never a ‘pulling’ reaction. Thus, our PTCV model is good enough to model the dynamics sincethere 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 thedynamics of a particular system.

Page 356: Altair MotionView 11.0 Tutorials

351 MotionView 13.0 Tutorials

Proprietary Information of Altair Engineering

Altair Engineering

MV-1026: Modeling Curve-to-Curve (CVCV)Higher-Pair Constraint

In this tutorial, you will learn how to:

Model a CVCV (curve-to-curve) joint

A CVCV (curve-to-curve) joint is a higher pair constraint. The constraint consists of a planar curve onone body rolling and sliding on a planar curve on a second body. The curves are required to be co-planar. This constraint can act as a substitute to contact modeling in many cases where the contactoccurs in a plane. One such case is the cam-follower system, in which the follower is in the form of aroller. Instead of modeling the contact between the cam and the follower, we can specify a CVCVconstraint between their profiles.

A cam roller mechanism

In this tutorial, we will model a roller type cam-follower mechanism with the help of a CVCVconstraint.

Exercise

Copy all the files CamProfile.h3d and CamProfile.csv from the location

<installation_directory>\tutorials\mv_hv_hg\mbd_modeling\interactive\ to your <Working

directory>.

Page 357: Altair MotionView 11.0 Tutorials

Altair Engineering 352

Proprietary Information of Altair Engineering

MotionView 13.0 Tutorials

Step 1: Creating points.

Let’s start with creating points that will help us locate the bodies and joints that we would like to. We will define points for center of mass of the bodies and joint locations.

1. Start a new MotionView Session. We will work in the default units (kg, mm, s, N).

2. From the Project Browser right-click on Model and select Add Reference Entity > Point (or

right-click the Points icon on the Model-Reference toolbar).

The Add Point or PointPair dialog is displayed.

3. For Label, enter PivotPoint.

4. Accept the default variable name and click OK.

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

FollowerShaftCM 0.0 67.5 0.0

FollowerTransJoint 0.0 85.0 0.0

FollowerRevJoint 0.0 30.0 0.0

CamCM 0.0 -14.1604 0.0

Step 2: Creating Bodies.

We will have three bodies apart from the ground body in our model visualization: the cam, the followershaft and the follower roller. Pre-specified inertia properties will be used to define the bodies.

1. From the Project Browser right-click on Model and select Add Reference Entity > Body (or

right-click the Body icon on the Model-Reference toolbar).

The Add Body or BodyPair dialog is displayed.

2. For Label, enter Cam and click OK.

3. Right-click on Bodies in the Project Browser and select Add Body to define a second body.

The Add Body or BodyPair dialog is displayed.

4. For Label, enter FollowerShaft and click OK.

5. Right-click on Bodies in the Project Browser and select Add Body to define a third body.

The Add Body or BodyPair dialog is displayed.

6. For Label, enter FollowerRoller and click OK.

Page 358: Altair MotionView 11.0 Tutorials

353 MotionView 13.0 Tutorials

Proprietary Information of Altair Engineering

Altair Engineering

7. From the Properties tab, specify the following for the three bodies:

Body Mass Ixx Iyy Izz Ixy Iyz Izx

Cam 0.1724 59.339 62.6192 121.240 0.0 0.0 0.0

FollowerShaft 0.0072 3.4270 0.0144 3.4270 0.0 0.0 0.0

FollowerRoller 0.0030 0.0251 0.0251 0.0375 0.0 0.0 0.0

8. For the Cam body, under the CM Coordinates tab, check the Use CM Coordsys box.

9. Double click on Point.

The Select a Point dialog is displayed.

Choose CamCM and click OK.

10. Accept defaults for axes orientation properties.

11. For the FollowerShaft body, under the CM Coordinates tab, check the Use CM Coordsys box.

12. Double click on Point.

The Select a Point dialog is displayed.

Choose FollowerShaftCM and click OK.

13. Accept defaults for axes orientation properties.

14. For the FollowerRoller body, under the CM Coordinates tab, check the Use CM Coordsys box.

15. Double click on Point.

The Select a Point dialog is displayed.

Choose FollowerRevJoint and click OK.

16. Accept defaults for axes orientation properties.

Step 3: Creating Joints.

Here, we will define all the necessary joints except the CVCV joint which will be defined as a advancedjoint later. We require three joints for the model. The first of them is the revolute joint between thecam and ground body. The second joint we need is a translational joint between the follower shaftand ground body and the third joint is the revolute joint that connects the roller to the shaft.

1. From the Project Browser right-click on Model and select Add Constraint > Joint (or right-click

the Joints icon on the Model-Constraint toolbar).

The Add Joint or JointPair dialog is displayed.

2. For Label, enter CamPivot.

3. Select Revolute Joint as the type and click OK.

Page 359: Altair MotionView 11.0 Tutorials

Altair Engineering 354

Proprietary Information of Altair Engineering

MotionView 13.0 Tutorials

4. From the Connectivity tab, double-click on Body 1.

The Select a Body dialog is displayed.

Choose Cam and click OK.

5. From the Connectivity tab, double-click on Body 2.

The Select a Body dialog is displayed.

Choose Ground Body and click OK.

6. Again from the Connectivity tab, double-click on Point.

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. Right-click on Joints in the Project Browser and select Add Joint to define a second joint.

The Add Joint or JointPair dialog is displayed.

9. For Label, enter FollowerTransJoint.

10. Select Translational Joint as the type and click OK.

11. From the Connectivity tab, double-click on Body 1.

The Select a Body dialog is displayed.

Choose FollowerShaft and click OK.

12. From the Connectivity tab, double-click on Body 2.

The Select a Body dialog is displayed.

Choose Ground Body and click OK.

13. Again from the Connectivity tab, double-click on Point.

The Select a Point dialog is displayed.

Choose FollowerTransJoint 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.

15. Right-click on Joints in the Project Browser and select Add Joint to define a third joint.

The Add Joint or JointPair dialog is displayed.

16. For Label, enter FollowerRollerJoint.

17. Select Revolute Joint as the type and click OK.

Page 360: Altair MotionView 11.0 Tutorials

355 MotionView 13.0 Tutorials

Proprietary Information of Altair Engineering

Altair Engineering

18. From the Connectivity tab, double-click on Body 1.

The Select a Body dialog is displayed.

Choose FollowerRoller and click OK.

19. From the Connectivity tab, double-click on Body 2.

The Select a Body dialog is displayed.

Choose FollowerShaft and click OK.

20. Again from the Connectivity tab, double-click on Point.

The Select a Point dialog is displayed.

Choose FollowerRevJoint and click OK.

21. 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.

Step 4: Creating Markers.

Now, we will define markers required for the definition of the CVCV joint. We need two markers, oneassociated with the cam and the other associated with the follower roller.

1. From the Project Browser right-click on Model and select Add Reference Entity > Marker (or

right-click the Markers icon on the Model-Reference toolbar).

2. For Label, enter CamMarker and click OK.

3. From the Properties tab, double-click on Body.

The Select a Body dialog is displayed.

Choose Cam and click OK.

4. From the Properties tab, double-click on Point.

The Select a Point dialog is displayed.

Choose PivotPoint and click OK.

5. Accept the defaults for axes orientation.

6. Right-click on Markers in the Project Browser and select Add Marker to define a secondmarker.

The Add Marker or MarkerPair dialog is displayed.

7. For Label, enter FollowerMarker and click OK.

8. From the Properties tab, double-click on Body.

The Select a Body dialog is displayed.

Choose FollowerRoller and click OK.

Page 361: Altair MotionView 11.0 Tutorials

Altair Engineering 356

Proprietary Information of Altair Engineering

MotionView 13.0 Tutorials

9. From the Properties tab, double-click on Point.

The Select a Point dialog is displayed.

Choose FollowerRevJoint and click OK.

10. Accept the defaults for axes orientation.

Step 5: Creating Graphics.

Graphics for the cam have been provided as an h3d file. We need to associate the h3d with the cambody defined in our model. The follower shaft and roller can be represented using primitive graphics. To make the visualization better, we will also create some graphics for the joints.

1. From the Project Browser right-click on Model and select Add Reference Entity > Graphic (or

right-click the Graphics icon on the Model-Reference toolbar).

The Add Graphics or GraphicPair dialog is displayed.

2. For Label, enter Cam.

3. Choose File from the drop-down menu.

4. Click on the browser icon and select CamProfile.h3d from the model folder.

5. Click Open and then OK.

6. From the Connectivity tab, double-click on Body.

The Select a Body dialog is displayed.

Choose Cam and click OK.

7. Right-click on Graphics in the Project Browser and select Add Graphic to define a secondgraphic.

The Add Graphics or GraphicPair dialog is displayed.

8. For Label, enter FollowerShaft.

9. Choose Cylinder from the drop-down menu and click OK.

10. From the Connectivity tab, double-click on Body.

The Select a Body dialog is displayed.

Choose FollowerShaft and click OK.

11. Double click on Point.

The Select a Point dialog is displayed.

Choose FollowerShaftCM and click OK.

12. Click on the arrow below Direction and select the Vector option.

Page 362: Altair MotionView 11.0 Tutorials

357 MotionView 13.0 Tutorials

Proprietary Information of Altair Engineering

Altair Engineering

13. Click on Vector.

The Select a Vector dialog is displayed.

Choose Global Y and click OK.

14. From the Properties tab, specify the following values:

Property Value

Length 75

Offset -37.5

Radius 1 2.000

Radius 2 2.000

15. For the Cap properties, choose Cap Both Ends.

16. Right-click on Graphics in the Project Browser and select Add Graphic to define a thirdgraphic.

The Add Graphics or GraphicPair dialog is displayed.

17. For Label, enter FollowerRoller.

18. Choose Cylinder from the drop-down menu and click OK.

19. From the Connectivity tab, double-click on Body.

The Select a Body dialog is displayed.

Choose FollowerRoller and click OK.

20. Double click on Point.

The Select a Point dialog is displayed.

Choose FollowerRevJoint and click OK.

21. Click on the arrow below Direction and select the Vector option.

22. Click on Vector.

The Select a Vector dialog is displayed.

Choose Global Z and click OK.

Page 363: Altair MotionView 11.0 Tutorials

Altair Engineering 358

Proprietary Information of Altair Engineering

MotionView 13.0 Tutorials

23. From the Properties tab, specify the following values:

Property Value

Length 5.0

Offset -2.5

Radius 1 5.000

Radius 2 5.000

24. For the Cap properties, choose Cap Both Ends.

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 anothergraphic.

The Add Graphics or GraphicPair dialog is displayed.

2. For Label, enter CamPivotGraphicOne (first graphic to show the cam pivot).

3. Choose Cylinder from the drop-down menu and click OK.

4. From the Connectivity tab, double-click on Body.

The Select a Body dialog is displayed.

Choose Ground Body and click OK.

5. Double click on Point.

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.

8. From the Properties tab, specify the following values:

Property Value

Length 7.5

Offset -3.75

Radius 1 4.000

Radius 2 4.000

Page 364: Altair MotionView 11.0 Tutorials

359 MotionView 13.0 Tutorials

Proprietary Information of Altair Engineering

Altair Engineering

9. For the Cap properties, choose Cap Both Ends.

10. Right-click on Graphics in the Project Browser and select Add Graphic to define anothergraphic.

The Add Graphics or GraphicPair dialog is displayed.

11. For Label, enter CamPivotGraphicTwo (second graphic to show the cam pivot).

12. Choose Cylinder from the drop-down menu and click OK.

13. From the Connectivity tab, double-click on Body.

The Select a Body dialog is displayed.

Choose Cam and click OK.

14. Double click on Point.

The Select a Point dialog is displayed.

Choose PivotPoint and click OK.

15. Click on the arrow below Direction and select the Vector option.

16. Click on Vector.

The Select a Vector dialog is displayed.

Choose Global Z and click OK.

17. From the Properties tab, specify the following values:

Property Value

Length 7.6

Offset -3.8

Radius 1 2.000

Radius 2 2.000

18. For the Cap properties, choose Cap Both Ends.

Repeat this process for the FollowerRevJoint and label the graphics as:

RollerPivotGraphicOne on FollowShaft with a length of 7.5 and radius of 2.

and

RollerPivotGraphicTwo on FollowRoller with a length of 7.6 and radius of 1.

19. Right-click on Graphics in the Project Browser and select Add Graphic to define anothergraphic.

The Add Graphics or GraphicPair dialog is displayed.

20. For Label, enter FollowerTransJointGraphic (the graphic for the translational joint).

Page 365: Altair MotionView 11.0 Tutorials

Altair Engineering 360

Proprietary Information of Altair Engineering

MotionView 13.0 Tutorials

21. Choose Box from the drop-down menu and click OK.

22. From the Connectivity tab, double-click on Body.

The Select a Body dialog is displayed.

Choose Ground Body and click OK.

23. For Type, choose Center from the drop-down menu.

24. Double-click on Point.

The Select a Point dialog is displayed.

Choose FollowerTransJoint and click OK.

25. For axis orientation, use the vector Global Z as the Z-axis and the vector Global X to definethe ZX plane.

26. From the Properties tab, specify the following properties:

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:

Page 366: Altair MotionView 11.0 Tutorials

361 MotionView 13.0 Tutorials

Proprietary Information of Altair Engineering

Altair Engineering

Step 6: Creating the Curves.

The curves that we will use here are the curves that define the profile of the cam and the roller. Thedata for the cam profile curve has been provided in csv format. Since the roller profile is circular - it

can be defined using mathematical expressions.

1. From the Project Browser right-click on Model and select Add Reference Entity > Curve (or

right-click the Curves icon on the Model-Reference toolbar).

The Add Curve dialog is displayed.

2. For Label, enter CamProfile and click OK.

3. From the Properties tab, use the first drop-down menu to change the curve from 2D Cartesianto 3D Cartesian.

4. From the Properties tab, click on the x radio button.

5. Click on the file browser icon and select CamProfile.csv. Click Open.

6. Choose the properties of the curve as shown in the figure below:

7. From the Properties tab, click on the y radio button.

8. Click on the file browser icon and select CamProfile.csv. Click Open.

9. Choose the properties of the curve as shown in the figure below:

10. From the Properties tab, click on the z radio button.

11. Click on the file browser icon and select CamProfile.csv. Click Open.

Page 367: Altair MotionView 11.0 Tutorials

Altair Engineering 362

Proprietary Information of Altair Engineering

MotionView 13.0 Tutorials

12. Choose the properties of the curve as shown in the figure below:

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 ClosedCurve.

14. Right-click on Curves in the Project Browser and select Add Curve to define another curve.

The Add Curve dialog is displayed.

15. For Label, enter FollowerRollerProfile and click OK.

16. From the Properties tab, use the first drop-down menu to change the curve from 2D Cartesianto 3D Cartesian.

17. From the Properties tab, click on the x radio button.

18. Select Math from the second drop-down menu on the left.

19. Enter 5*sin(2*PI*(0:1:0.01)) in the Expression Builder.

20. From the Properties tab, click on the y radio button.

21. Select Math from the second drop-down menu on the left.

22. Enter 5*cos(2*PI*(0:1:0.01)) in the Expression Builder.

23. From the Properties tab, click on the z radio button.

24. Select Math from the second drop-down menu at the left.

25. Enter 0.0*(0:1:0.01) in the Expression Builder.

26. From the Properties tab, use the fourth drop-down menu to change the curve from Open Curveto Closed Curve.

We now have both of the curves defined.

Step 7: Creating the CVCV Joint.

Now, we will create the CVCV joint.

1. From the Project Browser right-click on Model and select Add Constraint > Advanced Joint

(or right-click the Advanced Joints icon on the Model-Constraint toolbar).

The Add AdvJoint dialog is displayed.

2. For Label, enter CVCV.

3. Choose CurveToCurveJoint from the drop-down menu and click OK.

Page 368: Altair MotionView 11.0 Tutorials

363 MotionView 13.0 Tutorials

Proprietary Information of Altair Engineering

Altair Engineering

4. From the Connectivity tab, double-click on Curve 1.

The Select a Curve dialog is displayed.

Choose CamProfile and click OK.

5. From the Connectivity tab, double-click on Curve 2.

The Select a Curve dialog is displayed.

Choose FollowerRollerProfile and click OK.

6. From the Connectivity tab, double-click on Ref Marker 1.

The Select a Marker dialog is displayed.

Choose CamMarker and click OK.

7. Again from the Connectivity tab, double-click on Ref Marker 2.

The Select a Marker dialog is displayed.

Choose FollowerMarker and click OK.

Step 8: Specifying the Cam Motion.

After we have the topology and constraints specified, we need to provide the cam motion. The mostnatural choice here is a uniform motion imposed on the revolute joint.

1. Click the Project Browser right-click on Model and select Add Constraint > Motions (or right-

click the Motions icon on the Model-Constraint toolbar).

The Add Motion or MotionPair dialog is displayed.

2. For Label, enter CamMotion and click OK.

3. From the Connectivity tab, double-click on Joint. Choose CamPivot and click OK.

4. From the Properties tab, specify the properties as `10*TIME`.

Page 369: Altair MotionView 11.0 Tutorials

Altair Engineering 364

Proprietary Information of Altair Engineering

MotionView 13.0 Tutorials

Step 9: Specifying Gravity.

Since our shaft is along the Y-axis, we want the gravity to be in the negative Y direction. To specifythis:

1. Click the Forms icon on the Model-General toolbar.

The Forms panel is displayed.

2. Select Gravity and specify the following values:

Direction Value

X 0

Y -9810

Z 0

Step 10: Specifying Output Requests.

We would like to monitor the reaction on CVCV joint since it can help us verify the correctness of ourresults. This will be discussed in detail towards the end of the tutorial where we will also discuss lift-offs.

1. From the Project Browser right-click on Model and select Add General MDL Entity > Output

(or right-click the Outputs icon on the Model-General toolbar).

The Add Output dialog is displayed.

2. For Label, enter CVCV Reaction and click OK.

3. From the Properties tab, choose Expressions from the drop-down menu.

4. Click in the F2 expression box.

5. Click on the button.

The Expression Builder dialog is displayed.

Page 370: Altair MotionView 11.0 Tutorials

365 MotionView 13.0 Tutorials

Proprietary Information of Altair Engineering

Altair Engineering

6. Populate the expression as 'CVCV({aj_0.idstring},1,2,0)'.

7. Click OK.

Page 371: Altair MotionView 11.0 Tutorials

Altair Engineering 366

Proprietary Information of Altair Engineering

MotionView 13.0 Tutorials

8. Repeat the process for F3, F4, F6, F7, F8 by changing the third parameter to 3, 4, 6, 7, and 8accordingly.

The CVCV (id, jflag, comp, ref_marker) function returns the reaction on the CVCV joint:

id ID of the CVCV joint

jflag 0 gives reaction on the I-marker and 1 on J-marker

comp component of the reaction

ref_marker reference marker (0 implies Global Frame)

Step 11: Running the Model.

We have the model defined completely and it is now ready to run.

1. Click the Run icon on the Model-Main toolbar.

The Run panel is displayed.

2. From the Main tab, specify values as shown below:

3. Choose the Save and run current model radio button.

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.

7. To run the model, click the Run button on the panel.

The solver will get invoked here.

Step 12: Viewing the Results.

1. Once the solver has finished its job, the Animate button will be active. Click on Animate.

The icon can be used to start the animation, and the icon can be used to stop/pause theanimation.

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.

Page 372: Altair MotionView 11.0 Tutorials

367 MotionView 13.0 Tutorials

Proprietary Information of Altair Engineering

Altair Engineering

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

application from MotionView to HyperGraph 2D .

4. Click the Build Plots icon on the Curves toolbar.

5. Click on the browser icon and load the result.abf file.

6. Make selections for the plot as shown below:

We are plotting the Y profile of the center of mass of the follower.

7. Click Apply.

The profile for the Y-displacement of the follower should look like the one shown below:

Page 373: Altair MotionView 11.0 Tutorials

Altair Engineering 368

Proprietary Information of Altair Engineering

MotionView 13.0 Tutorials

If we set the X-axis properties to zoom in on one cycle, the profile will look as 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 causethe follower to lose contact with the cam - this is called ‘lift-off’. In such cases, modeling the systemusing a CVCV joint will give us incorrect results. This is because the CVCV joint constrains thefollower point to be always on the curve. For such cases, contact modeling has to be used. Howeverone would like to start with a CVCV model whenever applicable, since modeling a CVCV joint is a loteasier than modeling contact. Given this scenario, the following modeling steps should be followed:

1. Model the system using a CVCV joint.

2. Monitor the CVCV joint reaction. If the reaction on the follower is a ‘pulling’ reaction, it meansthat 'lift-off' would have occurred and one needs to go for a contact model. Otherwise, the CVCVmodel is good enough.

Now, let’s check if our CVCV model is good enough. For this, we need to plot the reaction profileon the follower roller. Since the follower is moving along the Y-axis, any negative reaction alongthe Y-axis is a ‘pulling’ reaction. So, let’s 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 .

4. Choose HyperGraph 2D and click on Build Plots .

5. Click on the browser icon and load the result.abf file.

6. Make selections for the plot as shown below:

We are plotting the Y profile of the CVCV reaction on the follower roller.

Page 374: Altair MotionView 11.0 Tutorials

369 MotionView 13.0 Tutorials

Proprietary Information of Altair Engineering

Altair Engineering

7. Click Apply.

The profile should look like the one shown below:

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 henceit is never a ‘pulling’ reaction. Thus, our CVCV model is good enough to model the dynamics sincethere 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 modelingthe dynamics of a particular system.

Page 375: Altair MotionView 11.0 Tutorials

Altair Engineering 370

Proprietary Information of Altair Engineering

MotionView 13.0 Tutorials

MV-1027: Modeling Point-to-Deformable-Curve(PTdCV) Higher-Pair Constraint

In this tutorial, you will learn how to:

Model a PTdCV (point-to-deformable-curve) joint

A PTdCV (point-to-deformable-curve) joint is a higher pair constraint. This constraint restricts aspecified point on a body to move along a specified deformable curve on another body. The curve maybe open or closed, planar or in 3-d space. The point may belong to a rigid, flexible or a point mass. Forthis, we define a deformable curve on a beam supported at its ends by revolute joints. A mass isconstrained to move along the curve with a PTdCV constraint.

Exercise

Copy the file KG_N_MM_S_50elems2.h3d from

<installation_directory>\tutorials\mv_hv_hg\mbd_modeling\interactive to <working

directory>.

Step 1: Creating points.

Let’s start with creating points that will help us locate the bodies and joints as required. We willdefine points for center of mass of the bodies and joint locations.

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

right-click the Points icon on the Model-Reference toolbar).

The Add Point or PointPair dialog is displayed.

3. For Label, enter PointbeamInterface1.

4. Accept the default variable name and click OK.

5. Click on the Properties tab and specify the coordinates as X = 152.4, Y, = 0.0, and Z = 0.0.

Page 376: Altair MotionView 11.0 Tutorials

371 MotionView 13.0 Tutorials

Proprietary Information of Altair Engineering

Altair Engineering

6. Follow the same procedure for the other points specified in the table below:

Point X Y Z

PointbeamInterface2 460.80 0.0 0.0

Point0 183.24 0.0 0.0

Point1 214.08 0.0 0.0

Point2 244.92 0.0 0.0

Point3 275.76 0.0 0.0

Point4 306.60 0.0 0.0

Point5 337.44 0.0 0.0

Point6 368.28 0.0 0.0

Point7 399.12 0.0 0.0

Point8 429.96 0.0 0.0

Step 2: Creating Bodies.

We will have two bodies apart from the ground body in our model visualization: the beam and the ball. Pre-specified inertia properties will be used to define the ball.

1. From the Project Browser right-click on Model and select Add Reference Entity > Body (or

right-click the Body icon on the Model-Reference toolbar).

The Add Body or BodyPair dialog is displayed.

2. For Label, enter Beam and click OK.

3. Accept the default variable name and click OK.

For the remainder of this tutorial - accept the default names that are provided for the rest of thevariables that you will be asked for.

4. From the Properties tab, check the Deformable box.

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 .

6. Right-click on Bodies in the Project Browser and select Add Body.

The Add Body or BodyPair dialog is displayed.

Page 377: Altair MotionView 11.0 Tutorials

Altair Engineering 372

Proprietary Information of Altair Engineering

MotionView 13.0 Tutorials

7. For Label, enter Ball and click OK.

8. From the Properties tab, specify the following for the Ball:

Body Mass Ixx Iyy Izz Ixy Iyz Izx

Ball 100 1e6 1e6 1e6 0.0 0.0 0.0

9. For the Ball body, under the CM Coordinates tab, check the Use center of mass coordinatesystem box.

10. Double click on Point.

The Select a Point dialog is displayed.

11. Choose Point4 and click OK.

12. Accept defaults for axes orientation properties.

13. For the Ball body, from the Initial Conditions tab - check the Vx box under Translationalvelocity 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 somewhathigh value of Vx is introduced to make the motion of the ball clearly visible in the animation.

14. Accept all the other default values.

Step 3: Creating Markers.

Now, we will define some markers required for the beam. We will totally define eleven markers here atequal distances along the span of the beam.

1. From the Project Browser right-click on Model and select Add Reference Entity > Marker (or

right-click the Markers icon on the Model-Reference toolbar).

The Add Marker or MarkerPair dialog is displayed.

2. For Label, enter Marker0 and click OK.

3. Under the Properties tab, double-click on Body.

The Select a Body dialog is displayed.

4. Choose Beam and click OK.

5. Under the Properties tab, double-click on Point.

The Select a Point dialog is displayed.

6. Choose PointbeamInterface1 and click OK.

Accept the defaults for axes orientation.

7. Right-click on Markers in the Project Browser and select Add Marker to define a secondmarker. Continue adding markers until Marker10 is reached.

8. For subsequent labels; enter Marker1, Marker2, etc. until Marker10 is reached.

Page 378: Altair MotionView 11.0 Tutorials

373 MotionView 13.0 Tutorials

Proprietary Information of Altair Engineering

Altair Engineering

9. From the Properties tab, always select the Beam (after double-clicking on Body each time).

10. From the Properties tab, select Point0 through Point8, and finally PointbeamInterface2 forMarker10 (by double-clicking on Point every time).

Always accept the defaults for axes orientation.

A table is provided below for reference:

Marker No. Body Point

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

Step 4: Creating Joints.

Here, we will define all the necessary joints except for the PTdCV joint, which will be defined as anadvanced joint later. We require two joints for the model, both of them being fixed joints between thebeam and ground body.

1. From the Project Browser right-click on Model and select Add Constraint > Joint (or right-click

the Joints icon on the Model-Constraint toolbar).

The Add Joint or JointPair dialog is displayed.

2. For Label, enter Joint0.

3. Select Fixed Joint as the type and click OK.

4. From the Connectivity tab, double-click on Body 1.

The Select a Body dialog is displayed.

Page 379: Altair MotionView 11.0 Tutorials

Altair Engineering 374

Proprietary Information of Altair Engineering

MotionView 13.0 Tutorials

5. Choose Beam and click OK.

6. Under the Connectivity tab, double-click on Body 2.

The Select a Body dialog is displayed.

7. Choose Ground Body and click OK.

8. From the Connectivity tab, double-click on Point.

The Select a Point dialog is displayed.

9. Choose PointbeamInterface1 and click OK.

10. Right-click on Joints in the Project Browser and select Add Joint to define a second joint.

The Add Joint or JointPair dialog is displayed.

11. For Label, enter Joint1.

12. Select Fixed Joint as the type and click OK.

13. From the Connectivity tab, double-click on Body 1.

The Select a Body dialog is displayed.

14. Choose Beam and click OK.

15. From the Connectivity tab, double-click on Body 2.

The Select a Body dialog is displayed.

16. Choose Ground Body and click OK.

17. From the Connectivity tab, double-click on Point.

The Select a Point dialog is displayed.

18. Choose PointbeamInterface2 and click OK.

Step 5: Creating Deformable Curves.

Here we will now define the deformable curve on the surface of the beam. The ball is constrained tomove along this curve.

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-Referencetoolbar).

The Add DeformableCurve dialog is displayed.

2. For Label, enter DeformableCurve0, and click OK.

3. From the Properties tab, select Marker for Data type, and NATURAL for Left end type andRight end type.

4. Check the box just to the left of the Marker collector (which situated to the far right of DataType).

The intermediate Add button is changed to an Insert button.

Page 380: Altair MotionView 11.0 Tutorials

375 MotionView 13.0 Tutorials

Proprietary Information of Altair Engineering

Altair Engineering

5. Enter 10 into the text box located just to the right of the Insert button, and then click on the

Insert button.

Eleven Marker collectors are displayed.

6. Click on the individual collectors.

The Select a Marker dialog is displayed.

7. Select all the markers one by one, starting from Marker 0 to Marker 10.

Step 6: Creating Advanced Joints.

Now we will define the advanced PTdCV joint.

1. From the Project Browser right-click on Model and select Add Constraint > Advanced Joint

(or right-click the Advanced Joints icon on the Model-Constraint toolbar).

The Add AdvJoint dialog is displayed.

2. For Label, enter AdvancedJoint 0.

3. From the Connectivity tab select: PointToDeformableCurveJoint, Ball for Body, Point4 forPoint, and DeformableCurve 0 for DeformableCurve.

Step 7:Creating Graphics.

Graphics for the ball will now be built here.

1. Click the Project Browser tab, right-click on Model and select Add Reference Entity > Graphic

(or right-click the Graphics icon on the Model-Reference toolbar).

The Add Graphics or GraphicPair dialog is displayed.

2. For Label, enter Graphic0.

3. For Type, choose Sphere from the drop-down menu and click OK.

4. From the Connectivity tab, double-click on Body.

The Select a Body dialog is displayed.

5. Choose Ball and click OK.

6. Again from the Connectivity tab, double-click on Point.

The Select a Point dialog is displayed.

7. Choose Point4 and click OK.

8. From the Properties tab, enter 2.0 as the radius of the Ball.

9. From the Visualization tab, select a color for the Ball.

Page 381: Altair MotionView 11.0 Tutorials

Altair Engineering 376

Proprietary Information of Altair Engineering

MotionView 13.0 Tutorials

Step 8: Return to the Bodies Panel.

1. Click the Body icon on the Model-Reference toolbar.

2. For the beam which has already been defined, click on the Nodes button.

The Nodes dialog is displayed.

3. Uncheck the Only search interface nodes box and then click on Find All.

4. Close the the Nodes dialog.

At the end of these steps your model should look like the one shown in the figure below:

One final comment before running the model:

This type of constraint does not ensure that the contact point will stay within the range ofdata specified for the curve. Additional forces at the end need to be defined by the user tosatisfy this requirement. If the contact point goes out of range of the data specified for thiscurve, the solver encounters an error (unless additional forces are defined to satisfy this). Inthat case, one has to change the initial velocities for the ball, or increase the range of dataspecified for the curve, or run the simulation for a shorter interval of time.

Page 382: Altair MotionView 11.0 Tutorials

377 MotionView 13.0 Tutorials

Proprietary Information of Altair Engineering

Altair Engineering

Step 9: Running the Model.

We now have the model defined completely and it is ready to run.

1. Click the Run icon on the Model-Main toolbar.

The Run panel is displayed.

2. From the Main tab, specify values as shown below:

3. Choose the Save and run current model radio button.

4. Click on the browser icon and save the file as result.xml.

5. Click Save.

6. Click the Check Model button on the Model Check toolbar to check the model for errors.

7. To run the model, click the Run button on the panel.

The solver will get invoked here.

Step 10: Viewing the Results.

1. Once the solver has finished its job, the Animate button will be active. Click on Animate.

The icon can be used to start the animation, and the icon can be used to stop/pause theanimation.

One would also like to inspect the displacement profile of the beam and the ball. For this, we willplot the Z position of the center of mass of the ball.

2. Click on the Add Page icon and add a new page.

3. Use the Select application drop-down menu to change the application from MotionView to

HyperGraph 2D .

4. Click the Build Plots icon on the Curves toolbar.

5. Click on the browser icon and load the result.abf file.

Page 383: Altair MotionView 11.0 Tutorials

Altair Engineering 378

Proprietary Information of Altair Engineering

MotionView 13.0 Tutorials

6. Make selections for the plot as shown below:

We are plotting the Z position of the center of mass of the ball.

7. Click Apply.

The profile for the Z-displacement of the ball should look like the one shown below:

Page 384: Altair MotionView 11.0 Tutorials

379 MotionView 13.0 Tutorials

Proprietary Information of Altair Engineering

Altair Engineering

MV-1028: Modeling Point-to-Deformable-Surface(PTdSF) Higher-Pair Constraint

In this tutorial, you will learn how to:

Model a PTdSF (point-to-deformable-surface) joint

A PTdSF (point-to-deformable-surface) joint is a higher pair constraint. This constraint restricts aspecified point on a body to move along a specified deformable surface on another body. The pointmay belong to a rigid, flexible, or point body. The deformable surface for this tutorial is defined on arigidly supported plate. A mass is constrained to move on the surface with a PTdSF constraint.

Exercise

Copy the files membrane.h3d and membrane.fem from

<installation_directory>\tutorials\mv_hv_hg\mbd_modeling\interactive to your <working

directory>.

Step 1: Creating points.

Let’s start with creating points that will help us locate the bodies and joints as required. We willdefine points for center of mass of the bodies and joint locations.

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

(or right-click the Points icon on the Model-Reference toolbar).

The Add Point or PointPair dialog is displayed.

3. For Label, enter BallCM.

4. Accept the default variable name and click OK.

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

PointMembInterface39 -55.00 -55.00 0.0

PointMembInterface40 55.00 -55.00 0.0

PointMembInterface41 55.00 55.00 0.0

PointMembInterface42 -55.00 55.00 0.0

Page 385: Altair MotionView 11.0 Tutorials

Altair Engineering 380

Proprietary Information of Altair Engineering

MotionView 13.0 Tutorials

Step 2: Creating Bodies.

We will have two bodies apart from the ground body in our model visualization: the membrane and theball. Pre-specified inertia properties will be used to define the ball.

1. From the Project Browser, right-click on Model and select Add Reference Entity > Body (or

right-click the Body icon on the Model-Reference toolbar).

The Add Body or BodyPair dialog is displayed.

2. For Label, enter Membrane.

3. Accept the default variable name and click OK.

For the remainder of this tutorial - accept the default names for the rest of the variables that youwill be asked for.

4. From the Properties tab, check the Deformable box.

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.

The Add Body or BodyPair dialog is displayed.

7. For Label, enter Ball and click OK.

8. From the Properties tab, specify the following for the Ball:

Body Mass Ixx Iyy Izz Ixy Iyz Izx

Ball 1.00 4000.00 4000.00 4000.00 0.0 0.0 0.0

9. For the Ball body, under the CM Coordinates tab, check the Use center of mass coordinatesystem box.

10. Double click on Point.

The Select a Point dialog is displayed.

11. Choose BallCM and click OK.

12. Accept defaults for axes orientation properties.

13. For the Ball body, from the Initial Conditions tab - check the Vx box under Translationalvelocity 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.

14. Repeat the same for Vy.

Page 386: Altair MotionView 11.0 Tutorials

381 MotionView 13.0 Tutorials

Proprietary Information of Altair Engineering

Altair Engineering

Step 3: Creating Markers and a Deformable Surface.

Now, we will define some markers required for the membrane.

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 ofmarker columns.

5. Click Generate Surface.

The Markers and Deformable Surface are created.

Step 4: Creating Joints.

Here, we will define all the necessary joints except the PTdSF joint, which will be defined as anadvanced joint later. We require four joints for the model, all of them being fixed joints between themembrane and the ground.

1. From the Project Browser, right-click on Model and select Add Constraint > Joint (or right-

click the Joints icon on the Model-Constraint toolbar).

The Add Joint or JointPair dialog is displayed.

2. For Label, enter Joint 1.

Page 387: Altair MotionView 11.0 Tutorials

Altair Engineering 382

Proprietary Information of Altair Engineering

MotionView 13.0 Tutorials

3. Select Fixed Joint as the type and click OK.

4. From the Connectivity tab, double-click on Body 1.

The Select a Body dialog is displayed.

5. Choose Membrane and click OK.

6. From the Connectivity tab, double-click on Body 2.

The Select a Body dialog is displayed.

7. Choose Ground Body and click OK.

8. From the Connectivity tab, double-click on Point.

The Select a Point dialog is displayed.

9. Choose PointMembInterface39 and click OK.

10. Repeat the same procedure for the other three joints.

A table is provided below for your convenience:

Label Type of Joint Body 1 Body 2 Point

Joint 2 Fixed Membrane Ground Body PointMembInterface40

Joint 3 Fixed Membrane Ground Body PointMembInterface41

Joint 4 Fixed Membrane Ground Body PointMembInterface42

Step 5: Creating Advanced Joints.

Now we will define the advanced PTdSF joint.

1. From the Project Browser, right-click on Model and select Add Constraint > Advanced Joint

(or right-click the Advanced Joints icon on the Model-Constraint toolbar).

The Add AdvJoint dialog is displayed.

2. For Label, enter AdvancedJoint 0.

3. Accept the default variable name and click OK.

4. From the Connectivity tab, select:

PointToDeformableSurface Joint

Ball for Body

BallCM for Point

DeformableSurface 1 for DeformableSurface.

Page 388: Altair MotionView 11.0 Tutorials

383 MotionView 13.0 Tutorials

Proprietary Information of Altair Engineering

Altair Engineering

Step 6: Creating Graphics.

Graphics for the ball will now be built here.

1. From the Project Browser, right-click on Model and select Add Reference Entity > Graphic (or

right-click the Graphics icon on the Model-Reference toolbar).

The Add Graphics or GraphicPair dialog is displayed.

2. For Label, enter Ball.

3. For Type, choose Sphere from the drop-down menu and click OK.

4. Under the Connectivity tab, double-click on Body.

The Select a Body dialog gets displayed.

5. Choose Ball and click OK.

6. Again under the Connectivity tab, double-click on Point.

The Select a Point dialog gets displayed.

7. Choose BallCM and click OK.

8. Under the Properties tab, enter 1.0 as the radius of the Ball.

9. Under the Visualization tab, select a color for the Ball.

Step 7: Return to the Bodies Panel.

1. Click the Body icon on the Model-Reference toolbar.

2. For the membrane which has already been defined, click on the Nodes button.

The Nodes dialog is displayed.

3. Uncheck the Only search interface nodes box and then click on Find All.

4. Close the the Nodes dialog.

At the end of these steps your model should look like the one shown in the figure below:

Page 389: Altair MotionView 11.0 Tutorials

Altair Engineering 384

Proprietary Information of Altair Engineering

MotionView 13.0 Tutorials

One final comment before running the model:

This type of constraint does not ensure that the contact point will stay within the range ofdata specified for the surface. Additional forces at the end need to be defined by the user tosatisfy this requirement. If the contact point goes out of range of the data specified for thiscurve, the solver encounters an error (unless additional forces are defined to satisfy this). Inthat case, one has to change the initial velocities for the ball, or increase the range of dataspecified for the curve, or run the simulation for a shorter interval of time.

Step 8: Running the Model.

Now we have the model defined completely and it is ready to run.

1. Click the Run icon on the Model-Main toolbar.

The Run panel is displayed.

2. From the Main tab, specify values as shown below:

End time = 2.000

Print interval = 0.0100

Page 390: Altair MotionView 11.0 Tutorials

385 MotionView 13.0 Tutorials

Proprietary Information of Altair Engineering

Altair Engineering

3. Click on the Simulation Settings button.

The Simulation Settings dialog is displayed.

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):

5. Click Close to close the dialog.

6. Verify that the Save and run current model radio button is selected.

7. Click on the browser icon and save the file as result.xml in the <working directory>.

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 solver will get invoked here.

Step 9: Viewing the Results.

1. Once the solver has finished its job, the Animate button will be active. Click on Animate.

The icon can be used to start the animation, and the icon can be used to stop/pause theanimation.

Page 391: Altair MotionView 11.0 Tutorials

Altair Engineering 386

Proprietary Information of Altair Engineering

MotionView 13.0 Tutorials

One would also like to inspect the displacement profile of the beam and the ball. For this, we willplot the Z position of the center of mass of the ball.

2. Click on the Add Page icon and add a new page.

3. Use the Select application drop-down menu to change the application from MotionView to

HyperGraph 2D .

4. Click the Build Plots icon on the Curves toolbar.

5. Click on the browser icon and load the result.abf file from the <working directory>.

6. Make selections for the plot as shown below:

We are plotting the Z position of the center of mass of the ball.

7. Click Apply.

The profile for the Z-displacement of the ball should look like the one shown below:

Page 392: Altair MotionView 11.0 Tutorials

387 MotionView 13.0 Tutorials

Proprietary Information of Altair Engineering

Altair Engineering

MV-1029: Modeling Point-to-Deformable-SurfaceForce (PTdSF) Higher-Pair Constraint

In this tutorial, you will learn how to:

Model a PTdSFforce (point-to-deformable-surface) joint with a contact force

A PTdSFforce (point-to-deformable-surface) joint is a higher pair constraint with an added contactforce. The force is either modeled as a linear one or a Poisson type here. This constraint restricts aspecified point on a body to move along a specified deformable surface on another body. The pointmay belong to a rigid, flexible or point body. The deformable surface for this tutorial is defined on arigidly supported plate. A mass is constrained to move on the surface with a PTdSFforce constraint. The added feature here is that a flexible contact force acts at the center of mass of the ball betweenit and the deformable surface. In this tutorial we will take up the case of the linear force model.

Exercise

Copy the following file Plate.h3d and membrane.fem from

<installation_directory>\tutorials\mv_hv_hg\mbd_modeling\interactive to your <working

directory>.

Step 1: Creating points.

Let’s start with creating points that will help us locate the bodies and joints as required. We willdefine points for center of mass of the bodies and joint locations.

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

right-click the Points icon on the Model-Reference toolbar).

The Add Point or PointPair dialog is displayed.

3. For Label, enter BallCM.

4. Accept the default variable name and click OK.

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

PointMembInterface39 -55.00 -55.00 0.0

PointMembInterface40 55.00 -55.00 0.0

PointMembInterface41 55.00 55.00 0.0

PointMembInterface42 -55.00 55.00 0.0

Page 393: Altair MotionView 11.0 Tutorials

Altair Engineering 388

Proprietary Information of Altair Engineering

MotionView 13.0 Tutorials

Step 2: Creating Bodies.

We will have two bodies apart from the ground body in our model visualization: the membrane and theball. Pre-specified inertia properties will be used to define the ball.

1. From the Project Browser right-click on Model and select Add Reference Entity > Body (or

right-click the Body icon on the Model-Reference toolbar).

The Add Body or BodyPair dialog is displayed.

2. For Label, enter Membrane and click OK.

3. Accept the default variable name and click OK.

For the remainder of this tutorial - accept the default names that are provided for the rest of thevariables that you will be asked for.

4. From the Properties tab, check the Deformable box.

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 .

6. Right-click on Bodies in the Project Browser and select Add Body.

The Add Body or BodyPair dialog is displayed.

7. For Label, enter Ball and click OK.

8. From the Properties tab, specify the following for the Ball:

Body Mass Ixx Iyy Izz Ixy Iyz Izx

Ball 1.00 40000.00 40000.00 40000.00 0.0 0.0 0.0

9. For the Ball body, under the CM Coordinates tab, check the Use center of mass coordinatesystem box.

10. Double click on Point.

The Select a Point dialog is displayed.

11. Choose BallCM and click OK.

12. Accept defaults for axes orientation properties.

Page 394: Altair MotionView 11.0 Tutorials

389 MotionView 13.0 Tutorials

Proprietary Information of Altair Engineering

Altair Engineering

Step 3: Creating Markers and a Deformable Surface.

Now, we will define some markers required for the membrane.

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 ofmarker columns.

5. Click Generate.

The Markers and Deformable Surface are created.

Step 4: Creating Joints.

Here, we will define all the necessary joints. We require four joints for the model, all of them beingfixed joints between the membrane and the ground.

1. From the Project Browser right-click on Model and select Add Constraint > Joint (or right-click

the Joints icon on the Model-Constraint toolbar).

The Add Joint or JointPair dialog is displayed.

2. For Label, enter Joint 1.

Page 395: Altair MotionView 11.0 Tutorials

Altair Engineering 390

Proprietary Information of Altair Engineering

MotionView 13.0 Tutorials

3. Select Fixed Joint as the type and click OK.

4. From the Connectivity tab, double-click on Body 1.

The Select a Body dialog is displayed.

5. Choose Membrane and click OK.

6. From the Connectivity tab, double-click on Body 2.

The Select a Body dialog is displayed.

7. Choose Ground Body and click OK.

8. From the Connectivity tab, double-click on Point.

The Select a Point dialog is displayed.

9. Choose PointMembInterface39 and click OK.

10. Repeat the same procedure for the other three joints.

A table is provided below for your convenience:

Label Type of Joint Body 1 Body 2 Point

Joint 2 Fixed Membrane Ground Body PointMembInterface40

Joint 3 Fixed Membrane Ground Body PointMembInterface41

Joint 4 Fixed Membrane Ground Body PointMembInterface42

Step 5: Creating Contacts.

Here we will define the contact force between the deformable membrane and the ball.

1. From the Project Browser right-click on Model and select Add Force Entity > Contact (or right-

click the Contacts icon on the Model-Force toolbar).

The Add Contact dialog is displayed.

2. For Label, enter Contact 0.

3. Select PointToDeformableSurfaceContact for the type of contact and click OK.

4. From the Connectivity tab; select Linear as the calculation method, Ball for Body, BallCM forPoint, and DeformableSurface 1 for DeformableSurface.

5. Uncheck the Flip normal checkbox.

6. Click on the Properties tab and enter 10 for Radius, 1000 for Stiffness, and 0.2 for Damping.

Page 396: Altair MotionView 11.0 Tutorials

391 MotionView 13.0 Tutorials

Proprietary Information of Altair Engineering

Altair Engineering

Step 6: Creating Graphics.

Graphics for the ball will now be built here.

1. From the Project Browser right-click on Model and select Add Reference Entity > Graphic (or

right-click the Graphics icon on the Model-Reference toolbar).

The Add Graphics or GraphicPair dialog is displayed.

2. For Label, enter Ball.

3. For Type, choose Sphere from the drop-down menu and click OK.

4. From the Connectivity tab, double-click on Body.

The Select a Body dialog is displayed.

5. Choose Ball and click OK.

6. Again from the Connectivity tab, double-click on Point.

The Select a Point dialog is displayed.

7. Choose BallCM and click OK.

8. From the Properties tab, enter 10 as the radius of the Ball.

9. From the Visualization tab, select a color for the Ball.

Step 7: Return to the Bodies Panel.

1. Click the Body icon on the Model-Reference toolbar.

2. For the membrane which has already been defined, click on the Nodes button.

The Nodes dialog is displayed.

3. Uncheck the Only search interface nodes box and then click on Find All.

4. Close the the Nodes dialog.

At the end of these steps your model should look like the one shown in the figure below:

Page 397: Altair MotionView 11.0 Tutorials

Altair Engineering 392

Proprietary Information of Altair Engineering

MotionView 13.0 Tutorials

Step 8: Running the Model.

Now we have the model defined completely and it is ready to run.

1. Click the Run icon on the Model-Main toolbar.

The Run panel gets displayed.

2. From the Main tab, specify values as shown below:

3. Choose the Save and run current model radio button.

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.

7. To run the model, click the Run button on the panel.

The solver will get invoked here.

Page 398: Altair MotionView 11.0 Tutorials

393 MotionView 13.0 Tutorials

Proprietary Information of Altair Engineering

Altair Engineering

Step 9: Viewing the Results.

1. Once the solver has finished its job, the Animate button will be active. Click on Animate.

The can be used to start the animation, and the icon can be used to stop/pause theanimation.

One would also like to inspect the displacement profile of the membrane and the ball. For this, wewill plot the Z position of the center of mass of the ball.

2. Click on the Add Page icon and add a new page.

3. Use the Select application drop-down menu to change the application from MotionView to

HyperGraph 2D .

4. Click the Build Plots icon on the Curves toolbar.

5. Click on the browser icon and load the result.abf file from the <working directory>.

6. Make selections for the plot as shown below:

We are plotting the Z position of the center of mass of the ball.

7. Click Apply.

The profile for the Z-displacement of the ball should look like the one shown below:

Page 399: Altair MotionView 11.0 Tutorials

Altair Engineering 394

Proprietary Information of Altair Engineering

MotionView 13.0 Tutorials

We can also plot the penetration distance for this flexible contact.

1. Make selections for the plot as shown below:

2. Click Apply.

3. The penetration profile as a function of time looks like the one shown below:

Page 400: Altair MotionView 11.0 Tutorials

395 MotionView 13.0 Tutorials

Proprietary Information of Altair Engineering

Altair Engineering

MV-7000: Modeling Differential Equations UsingMotionView and MotionSolve

Differential equations are very versatile and have many different applications in modeling multi-bodysystems. User-defined dynamic states are commonly used to create low pass filters, apply time lagsto signals, model simple feedback loops, and integrate signals. The signal may be used to:

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-defineddynamic states.

The expression type is used when the algorithm defining the differential equation is simple enough tobe expressed as a simple formula. In many situations, the dynamic state is governed by substantiallogic and data manipulation. In such cases, it is preferable to use a programming language to definethe value of a differential equation. The user-defined subroutine, DIFSUB, allows you to accomplishthis.

Step 1: Build and analyze a simplified model.

In the following exercise, we will build and analyze a simplified model of a pressure vessel blown downusing MotionView and MotionSolve.

1. We specify the following parameters (state variables) as solver variables:

2. Model the following differential equations:

The three states of the system are PT ,T

T and m

T.

Page 401: Altair MotionView 11.0 Tutorials

Altair Engineering 396

Proprietary Information of Altair Engineering

MotionView 13.0 Tutorials

3. Specify the initial conditions for the system as:

4. Run the model in MotionSolve and post-process the results in HyperGraph.

Creating Solver Variables

A solver variable defines an explicit, algebraic state in MotionSolve. The algebraic state may be afunction of the state of the system or any other solver variables that are defined. Recursive orimplicit definitions are not allowed at this time.

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 manysituations, 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-bodysystems. They are commonly used to create signals of interest in the simulation. The signal maythen be used to define forces, independent variables for interpolation, inputs to generic controlelements, 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-linehelp.

Step 2: Add a solver variable.

1. Launch a new session of MotionView.

2. From the Project Browser, right-click on Model and select Add General MDL Entity > Solver

Variable (or right-click on the Solver Variables icon, , from the toolbar).

3. The Add Solver Variable dialog is displayed.

4. In the Label field, assign the label K to the solver variable.

5. In the Variable field, assign a variable name to the solver variable or leave the default name.

Page 402: Altair MotionView 11.0 Tutorials

397 MotionView 13.0 Tutorials

Proprietary Information of Altair Engineering

Altair Engineering

6. Click OK.

7. From the Properties tab, under Type:, select Linear and enter a value of 1.4 in the field.

8. Repeat steps 1 through 7 to create the three remaining solver variables:

Page 403: Altair MotionView 11.0 Tutorials

Altair Engineering 398

Proprietary Information of Altair Engineering

MotionView 13.0 Tutorials

Step 3: Modeling differential equations.

1. From the Project Browser, right-click on Model and select Add General MDL Entity > Solver

Differential Equation (or right-click on the Solver Differential Equation icon, , from thetoolbar.

2. The Add SolverDiff dialog is displayed.

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.

5. Click Apply twice.

6. Click OK. Now, three solver differential equations will be created.

7. Next, we'll model the first differential equation:

This is an implicit differential equation that has a constant (Cp/R). The initial condition of thedifferential 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.

9. Select the type as Expression.

10. To access the expression builder, click in the text field and select the F(x) button, , from the

trio of buttons at the top of the panel, . This will display the Expression Builder. Inthis dialog, you can enter expressions in text boxes without extensive typing and memorization. Itcan be used to construct mathematical expressions.

Page 404: Altair MotionView 11.0 Tutorials

399 MotionView 13.0 Tutorials

Proprietary Information of Altair Engineering

Altair Engineering

11. Populate the expression as shown in the image below:

`-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 theabove expression, to refer to the ID of the differential equation, browse for it from the list-tree onthe Properties tab and select the ID. Click Apply. The name of the selected entity or propertyis inserted into the expression.

Page 405: Altair MotionView 11.0 Tutorials

Altair Engineering 400

Proprietary Information of Altair Engineering

MotionView 13.0 Tutorials

12. Click OK. The new expression is displayed in the text box on the panel.

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`

Step 4: Running the model in MotionSolve.

1. Click the Run button, , on the toolbar. The Run panel is displayed.

2. Specify the values as shown below:

Page 406: Altair MotionView 11.0 Tutorials

401 MotionView 13.0 Tutorials

Proprietary Information of Altair Engineering

Altair Engineering

3. Under the Main tab, choose the Save and run current model radio button.

4. Click on the browser icon, , specify a filename of your choice.

5. Click Save.

6. Click Check Model button, , to check the model.

7. To run the model, click Run. The solver will get invoked here.

8. Post-process the results using Altair HyperGraph.

Page 407: Altair MotionView 11.0 Tutorials

Altair Engineering 402

Proprietary Information of Altair Engineering

MotionView 13.0 Tutorials

MV-7001: Building User Subroutines in AltairMotionSolve

In this tutorial, you will learn how to compile and build a MotionSolve user subroutine. The usersubroutine can be implemented as C/C++ or FORTRAN source code, C/C++ or FORTRAN object files, ora combination of these.

For your convenience, MotionSolve contains a subroutine build tool for Windows and Linux that canbuild 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.

Minimum Software Requirements to Compile and Build MotionSolve UserSubroutine DLLs

Windows

Microsoft Visual Studio version 2005 - both Express and Professional Versions.

Intel Visual FORTRAN Compiler 10.

Linux

GCC version 4.1.2

Using the MotionSolve Subroutine Build Tool to Create SharedLibraries

The Altair subroutine build tool is shipped as part of the MotionSolve installation for both Windows andLinux.

The following steps describe how to build a MotionSolve compatible shared library using availablesource code.

Page 408: Altair MotionView 11.0 Tutorials

403 MotionView 13.0 Tutorials

Proprietary Information of Altair Engineering

Altair Engineering

Launching the Build Tool on Windows

The build tool may be launched via the Start menu by navigating to:

Start > All Programs > Altair HyperWorks 13 (64-bit) > Tools > MotionSolve SubRoutineBuilder

This displays the tool’s GUI:

Launching the Build Tool on Linux

You can launch the build tool from the desktop icon or from the command line by navigating to:

<altair_root>/altair/scripts/

and issuing the following command

./motionsolve_subroutine_builder

This displays the tool’s GUI:

Page 409: Altair MotionView 11.0 Tutorials

Altair Engineering 404

Proprietary Information of Altair Engineering

MotionView 13.0 Tutorials

Specify source code or object files

The next step is to specify the source code or the object files that you will be using to build theshared library. The following are valid source file types and can be used to build a shared library:

C/C++ source code (*.c, *.cpp, *.cxx)

FORTRAN source code (*.f, *.f90)

FORTRAN or C/C++ object files (*.obj in Windows, *.o in Linux)

A combination of the above.

Note: The remainder of this section demonstrates using the build tool on Windows. The steps forusing the tool on Linux are identical.

Important

The source code or object files must all be located in the same directory. Youmust have write-to-disk permissions for this directory. If you do not havewrite-to-disk permissions for this directory, please copy the source code to alocation where you 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 thenext steps.

1. To specify the source/object files, click on the open button, , beside the Source File(s) textbox.

2. Navigate to your working directory and choose the source files as required. You can choosemultiple files by holding down the CTRL button while clicking on the file names, or by clicking anddragging your mouse pointer.

Page 410: Altair MotionView 11.0 Tutorials

405 MotionView 13.0 Tutorials

Proprietary Information of Altair Engineering

Altair Engineering

3. Click Open to select these files.

Specify the output directory

Next, you will specify the output directory where you would like the shared library to be built. Again,you must have write-to-disk permissions for this directory.

1. Click Open, , beside the Output Name text box.

Page 411: Altair MotionView 11.0 Tutorials

Altair Engineering 406

Proprietary Information of Altair Engineering

MotionView 13.0 Tutorials

2. Navigate to the directory where you would like the shared library to be built. Click Select Folderto choose the current folder as the output directory.

Specify the name of the shared library

1. Before building the shared library, you need to specify a name for the shared library. To do this,simply type in the name (without the extension) into the Output Name text box.

Note: The shared library name must contain only alphanumeric characters (A-Z, a-z, 0-9)with the exception of the underscore (“_”) character.

Page 412: Altair MotionView 11.0 Tutorials

407 MotionView 13.0 Tutorials

Proprietary Information of Altair Engineering

Altair Engineering

Build the shared library

1. To build your shared library, click Build.

2. For the Windows platform, if you have multiple compilers installed on your computer, you canchoose which compiler to use while building your shared library:

3. Upon building the source files successfully, the following dialog box is displayed:

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.

Page 413: Altair MotionView 11.0 Tutorials

Altair Engineering 408

Proprietary Information of Altair Engineering

MotionView 13.0 Tutorials

The tool also creates a temporary directory inside your working directory while building the sharedlibrary. The contents of this temporary directory can be used for debugging and informationalpurposes.

Note: The temporary directory created inside of your working directory contains some usefulinformation:

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 while debugging an unsuccessful build.

For a successful build, this directory also contains compiled objects, the linked library and othertemporary 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 will typically contain compiler/link time errorsor warnings that may help you debug your source code.

Exit the tool

1. After you have finished using the tool, you can exit by clicking Quit on the tool. If you built ashared library before quitting, you are given the option to remove the temporary folder created bythe tool.

Page 414: Altair MotionView 11.0 Tutorials

409 MotionView 13.0 Tutorials

Proprietary Information of Altair Engineering

Altair Engineering

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. What platform does the build tool build my library for?

A. The supported platforms are 64-bit Windows and 64-bit Linux.

Q. Is my shared library a debug or release version?

A. The shared library created is a release version library.

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:

For C/C++ source code:<install>\Altair\<version>\hwsolvers\motionsolve\usersub\c_src

For FORTRAN source code:<install>\Altair\<version>\hwsolvers\motionsolve\usersub\f_src

Note: For MotionSolve to use the functions defined in the source code, these functions must beexported on the Windows platform (on Linux, all functions are automatically exported). Thesyntax to do this for C/C++ and FORTRAN is described below.

C/C++

Include the header file msolvsub_c_include.h (located in <install>\Altair\<version>\hwsolvers

\motionsolve\usersub\c_src\include) in your code. To export a function, use the keywords

CLINKAGE, DLLFUNC and STDCALL.

#include " msolvsub_c_include.h"

#include "stdlib.h"

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:

SUBROUTINE ARYSUB (ID, TIME, PAR, NPAR, DFLAG,

& IFLAG, NVALUE, VALUE)

!DEC$ ATTRIBUTES DLLEXPORT :: ARYSUB

Page 415: Altair MotionView 11.0 Tutorials

Altair Engineering 410

Proprietary Information of Altair Engineering

MotionView 13.0 Tutorials

Q. Does the order in which I choose the source files matter?

A. Yes, this can matter in certain cases. For example, when building FORTRAN source code anddefining MODULES, you may want to include the source file that contains the definition of any definedmodules 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 compilerinstalled. What’s wrong?

A. The build tool relies on an environment variable to detect the version of the Intel FORTRAN compilerand 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 pointingto the installed version.

Using the Microsoft® Developer Studio to Build a SharedLibrary

Note: To successfully build a shared library using the steps below, you will need to have write-to-disk permissions for your HyperWorks installation directory.

Build a C++ user subroutine DLL using Microsoft® Visual Studio®

1. Open Microsoft Visual Studio 2005 (Express and Professional Editions will work).

2. From the File menu, select Open > Project/Solution.

Page 416: Altair MotionView 11.0 Tutorials

411 MotionView 13.0 Tutorials

Proprietary Information of Altair Engineering

Altair Engineering

3. Browse to <install>\Altair\<version>\hwsolvers\motionsolve\usersub\c_project, select

the file ms_csubdll.vcproj and click Open.

Note: If you are using a version newer than Visual Studio 2005, you will be prompted toconvert 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, you will see a list of the CPP subroutines that are part of the solution.

5. Double-click any of the CPP files that you want to modify/view and make the required changes.

6. Click Save to save the changes made to the file.

7. Choose the configuration for your shared library.

Make sure that the target type for the shared library matches your HyperWorks installation. Forexample, 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. Savethe solution in a directory of your choice.

9. Upon successful completion of the build, Visual Studio displays a message as shown below:

10. You will find the new DLL ms_csubdll.dll in <install>\Altair\<version>\hwsolvers

\motionsolve\usersub\c_project\<platform>\<config>\ms_csubdll.dll.

Build a FORTRAN user subroutine DLL using Microsoft® Visual Studio®

The same steps can be repeated to build a FORTRAN user subroutine DLL for MotionSolve. The onlydifference is that the project file to be opened in Visual Studio is ms_fsubdll.vfproj. All the other

steps remain the same.

Page 417: Altair MotionView 11.0 Tutorials

Altair Engineering 412

Proprietary Information of Altair Engineering

MotionView 13.0 Tutorials

MV-7002: Co-simulation with Simulink

Tutorial Objectives

In this tutorial, you will learn how to use the MotionSolve-Simulink co-simulation interface, driving themodel from Simulink via an S-Function.

Software and Hardware Requirements

Software requirements:

MotionSolve

MATLAB/Simulink (MATLAB Version 7.6(R2008a), Simulink Version 7.1(R2008a)) (or newer)

Hardware requirements:

PC with 32/64bit CPU, running Windows XP Professional (win32 XP Professional or win64 XPprofessional)

Linux RHL5 32/64

Bus Suspension Model

Consider a bus suspension system that consists of a bus mass, suspension mass, and a road dummybody. The bus mass, suspension mass pair, the road dummy and the suspension mass pair areconstrained with a translation joint. The road dummy is actuated by a sinusoidal motion.

Bus suspension schematic

Page 418: Altair MotionView 11.0 Tutorials

413 MotionView 13.0 Tutorials

Proprietary Information of Altair Engineering

Altair Engineering

Along with the multi-body system, the model contains a pre-designed controller that maintains thereference signals of the desired displacement and velocity. A block diagram of the control system isshown the figure below.

Block diagram of the control system

In the image above:

Gc(S) – Multi-input multi-output (MIMO) controller

D(S) - Displacement of body mass from the bus suspension model

V(S) - Velocity of body mass from the bus suspension model

Rd(S) – Reference (desired) signal of the body mass displacement

Rv(S) - Reference (desired) signal of the body mass velocity

E1 (S) - Displacement tracking error of the body mass

E2 (S) - Velocity tracking error of the body mass

Y1(S) - Control Force 1 output from the controller (displacement)

Y2(S) - Control Force 2 output from the controller (velocity)

The transfer function for the controller is:

x’ = Ax + Bu

y = Cx + Du

where:

A - State matrix

B - Input matrix

C - Output matrix

D - Direct feed-through matrix

Page 419: Altair MotionView 11.0 Tutorials

Altair Engineering 414

Proprietary Information of Altair Engineering

MotionView 13.0 Tutorials

Below is the state-space representation of the controller:

A = [0 0;0 0]

B = [1 0;0 1]

C = [10 0;0 20]

D = [10000 0;0 20000]

u = [Displacement of the bus mass; velocity of the bus mass]

y = [Control force (stiffness); Control force (damping)]

These MIMO controller forces act between the bus mass and the suspension mass to controldisplacement and velocity profiles of the bus mass. In the co-simulation model, a single MIMOcontroller is modeled in Simulink.

In this exercise, you will do the following:

Solve the baseline model in MotionSolve (only, i.e., without co-simulation) by using the bussuspension model with a MIMO continuous controller modeled by a Control_StateEqn element. You can use these results to compare to an equivalent co-simulation in the next steps.

Review a modified MotionSolve bus model that mainly adds the Control_PlantInput andControl_PlantOutput entities that allow this model to act as a plant for Simulink co-simulation.

Review the controller in the state-space form modeled in Simulink.

Perform a co-simulation and compare the results for the standalone MotionSolve model and co-simulation.

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).

Step 1: Run the baseline MotionSolve model.

In this step, use a Linear State Equation (LSE) to model the control system in MotionSolve. LSE(Control_StateEqn with LINEAR option in MotionSolve) is an abstract modeling element that defines ageneric dynamic system. The dynamic system is characterized by a vector of inputs, u, a vector ofdynamic states, x, and a vector of outputs, y. The state vector x is defined through a set ofdifferential equations. The output vector y is defined by a set of algebraic equations. 

Linear Dynamical Systems are characterized by four matrices: A, B, C, and D. These are related to thedynamical system in the following way:

The four matrices A, B, C, D are all constant valued. The first equation defines the states.  Thesecond equation defines the outputs.

The A matrix is called the state matrix. It defines the characteristics of the system.  If there are "n"states, then the A matrix has dimensions n x n. A is required to be non-singular.

The B matrix is called the input matrix. It defines how the inputs affect the states. If there are "m"inputs, the size of the B matrix is n x m.

Page 420: Altair MotionView 11.0 Tutorials

415 MotionView 13.0 Tutorials

Proprietary Information of Altair Engineering

Altair Engineering

The C matrix is called the output matrix. It defines how the states affect the outputs. If there are"p" outputs, the size of the C matrix is p x n.

The D matrix is called the direct feed-through matrix. It defines how the inputs directly affect theoutputs. The size of the D matrix is p x m.

The input variables to the Control_StateEqn element are the reference displacement error andreference velocity error. The output variables are control forces that will be applied between thebus mass and the suspension mass.

1. From the Start menu, select All Programs > Altair HyperWorks 13.0 > MotionSolve.

2. For Input file, click the file browser icon and select the input fileBusSuspensionFeedBack_motionsolve.xml from your <Working Directory>.

3. Click Run.

MotionSolve is invoked and runs the analysis.

The results that we get from Step 3 will be used as the baseline to compare the results that weget from co-simulation.

Step 2: Use modified MotionSolve Model to define the plant in the controlscheme.

A MotionSolve model needs a mechanism to specify the input and output connections to the Simulinkmodel. The MotionSolve model (XML) used above is modified to include the Control_PlantInput andControl_PlantOutput model elements and provide these connections. In this tutorial, this has alreadybeen done for you, and you can see this in the model CoSimuBusSuspensionFeedBack.xml.

In contrast to the block diagram of the control system, the summing junctions have beenabsorbed into the S-function (the MBD model) by appropriately taking the difference betweenthe displacement, velocity, and their corresponding reference values.

The Control_PlantInput element defines the inputs to a mechanical system or plant. You alsoneed to specify the outputs from the plant using the Control_PlantOutput element. The inputsspecified using the Control_PlantInput and Control_PlantOutput elements can be accessedusing the PINVAL(), POUVAL() functions, respectively. Since the Control_PlantInput andControl_PlantOutput elements list the IDs of the solver variables, these inputs and outputvariables may also be accessed using the VARVAL() function. For more details, please refer tothe MotionSolve User's Guide on-line help.

Page 421: Altair MotionView 11.0 Tutorials

Altair Engineering 416

Proprietary Information of Altair Engineering

MotionView 13.0 Tutorials

In this model, we have the following connections:

Plant Input: Two control forces that will be applied between the bus mass and the suspensionmass.

Plant Output: Bus mass displacement and velocity errors.

Step 3: Setting up environment variables to run MotionSolve from MATLABSimulink.

A few environment variables are needed for successfully running a co-simulation using MATLAB. Thesecan be set using one of the following methods:

Control Panel (Windows)

In the shell/command window that calls MATLAB (with the set command on Windows, or the

setenv command on Linux)

Within MATLAB, via the setenv() command

1. Set the environment variables point to the solver binaries:

NUSOL_DLL_DIR: <installation_directory>\hwsolvers\motionsolve\bin\<platform>

…where <installation_directory> is the full path to the HyperWorks installation. <platform>

is win32 for 32-bit Windows, win64 for 64-bit Windows, and so on.

For example, on Windows 64-bit:

set NUSOL_DLL_DIR=C:\Program Files\Altair\13.0\hwsolvers\motionsolve\bin\win64

2. Set the environment variables for licensing:

RADFLEX_PATH: <installation_directory>\hwsolvers\common\bin\<platform>

PATH: <installation_directory>\hwsolvers\common\bin\<platform>;%PATH%

(Notice that the HyperWorks directory is pre-pended to the original PATH).

On Linux machines, you must additionally set the environment variable LD_LIBRARY_PATH:

LD_LIBRARY_PATH: <installation directory>\hwsolvers\common\bin\<platform>

Note that other optional environment variables may be set for your model. See MotionSolveEnvironment Variables for more information on these environment variables.

Step 4: Perform the co-simulation.

The core feature in Simulink that creates the co-simulation is an S-Function (System Function) blockin Simulink. This block requires an S-Function library (a dynamically loaded library) to define itsbehavior. MotionSolve provides this library, but the S-Function needs to be able to find it. To helpMATLAB/Simulink find the S-Function, you need to add the location of the S-Function to the list ofpaths that MATLAB/Simulink uses in order to search for libraries.

The S-Function libraries for co-simulation with MotionSolve are called either:

mscosim – for SMP communication

mscosimipc – for IPC (TCP/IP sockets) communication

Page 422: Altair MotionView 11.0 Tutorials

417 MotionView 13.0 Tutorials

Proprietary Information of Altair Engineering

Altair Engineering

Changing the name of this library in the S-Function block in Simulink changes the communicationbehavior of the co-simulation.

These files are installed under <installation_directory>\hwsolvers\motionsolve\bin

\<platform>.

The location of these files needs to be added to the search path of MATLAB for the S-Function to use mscosim or mscosimipc.

This can be done in one of the following ways:

1. Use the menu options.

a. From the Matlab menu, select File > Set Path…

b. From the dialog box, add the directory where the mscosim and mscosimipc DLL’s reside.

(for example, <installation_directory>\hwsolvers\motionsolve\bin\win64).

c. Select Save and Close. This procedure permanently adds this directory to the MATLAB/Simulink search path.

2. Use MATLAB commands.

At the MATLAB command line, type:

addpath(‘<installation_directory>\hwsolvers\motionsolve\bin\<platform>’)

…to add the directory where mscosim mex DLL 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 usingMATLAB commands in a MATLAB (.m) script:

addpath('<installation_directory>\hwsolvers\motionsolve\bin\win64')

setenv('NUSOL_DLL_DIR','<installation_directory>\hwsolvers\motionsolve\bin\win64')

setenv('RADFLEX_PATH',['<installation_directory>\hwsolvers\common\bin\win64')

setenv('PATH',['<installation_directory>\hwsolvers\common\bin\win64;'getenv('PATH')])

For a Linux machine, additionally:

setenv(‘LD_LIBRARY_PATH’, '<installation_directory>\hwsolvers\common\bin\linux64\')

Page 423: Altair MotionView 11.0 Tutorials

Altair Engineering 418

Proprietary Information of Altair Engineering

MotionView 13.0 Tutorials

Step 5: View the controller modeled in Simulink

1. In the Simulink Library Browser, select File > Open.

The Open file… dialog is displayed.

2. Select the BusSuspension.mdl file from your <Working Directory>.

3. Click Open.

You will see the PI controller modeled in linear state-space form that will be used in the co-simulation.

4. The model contains an S-function block. Name the S-function ‘mscosim’.

The S-function (system-function) is one of the blocks provided by Simulink and represents theMotionSolve 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, andso on, and is somewhat analogous to a Control_StateEqn in MotionSolve. See the MATLAB/Simulink documentation for more details.

Page 424: Altair MotionView 11.0 Tutorials

419 MotionView 13.0 Tutorials

Proprietary Information of Altair Engineering

Altair Engineering

5. Double-click the S-function with name mscosim. In the dialog box that is displayed, under the S

Function Parameters, enter the following using single quotes:

'CoSimuBusSuspensionFeedBack.xml', 'CoSimuBusSuspensionFeedBack.mrf', ''

The three parameters are the following:

1.MotionSolve XML model name.

2.Output MRF name.

3.MotionSolve user DLL name (optional); enter empty single quotes ('') if not used.

Page 425: Altair MotionView 11.0 Tutorials

Altair Engineering 420

Proprietary Information of Altair Engineering

MotionView 13.0 Tutorials

Step 6: Perform the co-simulation.

1. Click Simulation > Start to start the co-simulation. Simulink uses ODE45 to solve the Simulinkmodel. From this, the co-simulation should begin and MotionSolve should create an output .mrf

file for post-processing. Set the Scopes in the Simulink model to display the results. Also, checkthe .log file to make sure no errors or warnings were issued by MotionSolve.

Page 426: Altair MotionView 11.0 Tutorials

421 MotionView 13.0 Tutorials

Proprietary Information of Altair Engineering

Altair Engineering

Step 7: Compare the MotionSolve-only results to the co-simulation results.

1. From the Start menu, select All Programs > Altair HyperWorks 13.0 > HyperGraph.

2. Click the Build Plots icon, .

3. Click the file browser icon, , and load the BusSuspensionFeedBack_motionsolve.mrf file.

These are the baseline results created from running MotionSolve.

4. Select Expressions for Y-Type, then REQ/70000004 LSE Input and Output for Y Request,and F2 for Y Component to plot the damping force from the controller:

5. Click Apply.

6. Click the file browser icon, , and load the CoSimuBusSuspensionFeedBack.mrf file. These are

the co-simulation results run with Simulink.

7. Select Expressions for Y-Type, then REQ/70000004 Plant Input and Output for Y Request,and F2 for Y Component to plot the damping force from the controller:

You will notice that both the signals match as shown below.

Page 427: Altair MotionView 11.0 Tutorials

Altair Engineering 422

Proprietary Information of Altair Engineering

MotionView 13.0 Tutorials

MV-7003: Simulating a Single Input Single Output(SISO) Control System Using MotionView andMotionSolve

This tutorial shows you how to implement a single input single output (SISO) controller in MotionViewand solve it using MotionSolve.

Consider the problem of maintaining the reference speed of a rotor in the presence of disturbances. Ablock diagram of the control system is shown in Figure 1 below.

Figure 1 - Block diagram of the control system.

One simple approach is to design a proportional integral (PI) controller (Ogata, 1995), such that:

This tutorial shows you how to implement this PI controller.

Exercise

Step 1: Loading the rotor model.

1. From the Start menu, select All Programs > Altair HyperWorks 13.0 > MotionView.

2. From the directory <installation_directory>/tutorials/mv_hv_hg/mbd_modeling/

motionsolve, load the file rotor.mdl.

The model contains a body called rotor that is attached to ground by a revolute joint. The jointaxis is parallel to the global Z-axis. There is a torsional spring-damper with only damping and nostiffness.

The model also contains output requests for the displacement and velocity of the rotor body.

Page 428: Altair MotionView 11.0 Tutorials

423 MotionView 13.0 Tutorials

Proprietary Information of Altair Engineering

Altair Engineering

Step 2: Adding a solver variable for reference speed.

1. From the Project Browser, right-click on Model and select Add General MDL Entity > Solver

Variable (or right-click on the Solver Variables icon, , from the toolbar.

The Add SolverVariable dialog will be displayed.

2. Change Label to Reference Speed.

The variable name remains sv_0.

4. Click OK.

5. To maintain a linear speed of 3 rad/sec, from the Type drop-down menu, select Linear and enter3 as the value of the solver variable.

Step 3: Adding a SISO Controller

In this section, add a SISO controller. The input to the controller is the error between the referencespeed solver variable and the rotor angular speed. The output of the controller is the torque to beapplied to the rotor. The parameters for the simulation are chosen, somewhat arbitrarily, as Kp=1 and

K=10.

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).

The Add Control dialog will be displayed.

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 byTemplex. The parameters inside the curly braces are evaluated.

4. Click the Properties tab.

5. To add Numerator coefficients, click Append.

6. Enter 10 and 1 for the coefficients of 1 and s, respectively.

7. Similarly, for Denominator coefficients, click Append and enter 0 and 1 for the coefficients of 1

and s, respectively.

Page 429: Altair MotionView 11.0 Tutorials

Altair Engineering 424

Proprietary Information of Altair Engineering

MotionView 13.0 Tutorials

Step 4: Adding the Control Torque

In this section, create a control torque acting on the rotor body. The Z-component of this torque isthe output of the controller.

1. From the Project Browser, right-click on Model and select Add Force Entity > Force (or right-

click on the Forces icon, , from the toolbar).

2. The Add Force or ForcePair dialog is displayed.

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, selectRotational.

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.

8. Double-click Point 1 for Apply force at: and select Point 0.

9. Click the Rot Properties tab and leave Tx and Ty set to 0.

10. Under Tz, select Expression and enter `{MODEL.siso_0.OUTPUT}`.

11. You may also click to access the expression builder and create this expression using the modeltree.

Step 5: Adding Output Requests for Control Force

1. From the Project Browser, right-click on Model and select Add General MDL Entity > Output

(or right-click on the Outputs icon, , from the toolbar).

2. The Add Output dialog will be displayed.

3. Enter Control force for the Label name and click OK.

4. Specify other choices as shown in figure 2 below:

Figure 2 - Setting up the output request for control force.

Page 430: Altair MotionView 11.0 Tutorials

425 MotionView 13.0 Tutorials

Proprietary Information of Altair Engineering

Altair Engineering

Step 6: Running the Simulation

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.

3. Enter 25 for the End time:.

4. Click Run.

The results are displayed in the image below.

Figure 3 - Simulation results for the PI speed controller.

Reference

K. Ogata, Modern Control Engineering, 1990, Prentice-Hall Inc., Englewood Cliffs, N.J., US

Page 431: Altair MotionView 11.0 Tutorials

Altair Engineering 426

Proprietary Information of Altair Engineering

MotionView 13.0 Tutorials

MV-7004: Inverted Pendulum Control UsingMotionSolve and MATLAB

This tutorial illustrates how to use MotionView and MotionSolve to design a control system thatstabilizes an inverted pendulum. The goal is to design a regulator using the pole placement method. The inverted pendulum MDL model file is supplied.

The tutorial steps include:

Check the stability of the open loop system.

Export linearized system matrices A,B,C, and D using MotionSolve linear analysis.

Design a controller using MATLAB.

Implement a controller in MotionView.

Check the stability of a closed loop system using MotionSolve linear analysis.

Add disturbance forces to the model and run simulation using MotionSolve.

Figure 1 shows the classic inverted pendulum on a slider. The system has two degrees of freedomleading to four state variables. The vertically upright position of the pendulum is unstable. The goalis to design a regulator to stabilize this configuration.

Figure 1: Inverted pendulum model

Page 432: Altair MotionView 11.0 Tutorials

427 MotionView 13.0 Tutorials

Proprietary Information of Altair Engineering

Altair Engineering

We want to find a full-state feedback control law to achieve our goal. The control input is a forceapplied to the slider along the global X-axis. Plant output is the pendulum angle of rotation about theglobal Y-axis.

Start by loading the file inv_pendu.mdl from the directory <installation_directory>\tutorials

\mv_hv_hg\mbd_modeling\motionsolve\ 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.

Step 1: Determine the stability of the open loop model

Compute the eigenvalues to determine the stability of the Inverted pendulum.

Compute Eigenvalues

1. From the Project Browser, click the Forces folder and make sure that Control ForceOL isactivated, while Control Force – CL and Disturbance-step are deactivated.

2. From General Actions toolbar, click the Run icon, .

3. From the Simulation type drop-down menu, select Static + Linear.

4. Specify the output filename as inv_pendu_ol_eig.xml.

5. Select the MDL animation file (.maf) option.

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 inthe inv_pendu_ol_eig.eig file using a text editor

Table - Open Loop Eigenvalues

EIGENVALUES

Number Real(cycles/unit time) Imaginary(cycles/unit time)

1-1.625373E-02 0.00000000E+00

2-4.003211E-01 0.00000000E+00

35.581881E-01 0.00000000E+00

4-1.732850E+00 0.00000000E+00

There is one eigenvalue with a positive real part, indicating that the system is unstable in thecurrent configuration.

9. Click Animate.

The result animation H3D will be loaded in the adjacent window.

Page 433: Altair MotionView 11.0 Tutorials

Altair Engineering 428

Proprietary Information of Altair Engineering

MotionView 13.0 Tutorials

10. From the Results Browser, select individual modes.

11. Click Start/Pause Animation, , to visualize the mode shape.

Step 2: Obtaining a Linearized Model

Usually, the first step in a control system design is to obtain a linearized model of the system in thestate space form,

where A,B,C,and D are the state matrices, x is the state vector, u is the input vector, and y is theoutput vector. The A,B,C,and D matrices depend on the choice of states, inputs, and outputs. Thestates are chosen automatically by MotionSolve and the chosen states are reported in one of theoutput 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 hasbeen found. Ignore this at this stage.

b. Control Force Variable - OL is used to define the control plant input, which is a forcenamed Control Force - OL. This force is applied to the slider body. This variable is set tozero. 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 thependulum rotation about the Global Y-axis.

2. Expand the Solver Array folder in the Project Browser and examine the solver arrays that aredefined.

a. Select Plant-I – This array defines a solver array entity of type Plant-Input. Ensure thatSolver 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 thatSolver Variable is set to Pendulum Rotation Angle.

Note: Please note that the plant input and plant output IDs used in linearization are specifiedautomatically by MotionView while exporting the solver deck.

3. Click the Run icon, .

4. From the Simulation type drop-down menu, select Linear.

Page 434: Altair MotionView 11.0 Tutorials

429 MotionView 13.0 Tutorials

Proprietary Information of Altair Engineering

Altair Engineering

5. Specify the output filename as inv_pendu_state_matrices.xml.

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.

7. From the Main tab, click Run.

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.

The states chosen by the MotionSolve solver are:

1. Angular displacement about the global-Y axis.

2. Translation displacement along the global X-axis.

3. Angular velocity about the global-Y axis.

4. Translation velocity along the global X-axis of the pendulum body center of mass marker.

Page 435: Altair MotionView 11.0 Tutorials

Altair Engineering 430

Proprietary Information of Altair Engineering

MotionView 13.0 Tutorials

Step 3: Control System Design in MATLAB

A detailed discussion of control system design is beyond the scope of this document. However, thesteps to design a regulator using pole placement [1] to stabilize the inverted pendulum are describedbriefly. For details, refer to the standard controls text and the MATLAB documentation.

It can be easily verified using MATLAB that the system is completely state controllable [1, 2]. Weemploy 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].

Step 4: Implementing the Control Force in MotionView

The control force is simply u=-k*x. The model contains a solver variable called Control Force

Variable - CL. It is defined using the expression:

`-1e3*(-2.4186*AY({b_pendu.cm.idstring})-0.0163*DX({b_pendu.cm.idstring}),-0.070*WY({b_pendu.cm.idstring})-0.0033*VX({b_pendu.cm.idstring}))`

Notice that it is simply the dot product between the gain vector (k) and the state vector (x)elements. This solver variable is used to define a force named Control Force - CL.

Activate the force Control Force - CL if it is deactivated.

Step 5: Check the Stability of a Closed Loop System

1. From the SolverMode menu, select MotionSolve. Activate the force Control Force - CL if it isdeactivated.

2. From the Run panel, under Simulation type, select Linear.

3. Specify the output file as inv_pendu_cl_eig.xml and click Run.

4. The eigenvalues are given below.

Table - Closed Loop Eigenvalues

EIGENVALUES at Time = 0.0

Number Real(cycles/unit time) Imag.(cycles/unit time)

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 partsare close to the desired poles (-20 rad/s = -3.038 Hz).

Page 436: Altair MotionView 11.0 Tutorials

431 MotionView 13.0 Tutorials

Proprietary Information of Altair Engineering

Altair Engineering

Step 6: Add Disturbance Force and Run the Simulation

1.Activate force acting on the slider titled Disturbance-step, defined using a step function:

Fx= `step(TIME,.1,0,.5,50) + step(TIME,1,0,1.5,-50)`

Fy=0

Fz=0

Run a dynamic simulation with MotionSolve.

Follow these steps.

1. From the Project Browser, activate deactivated outputs Output control force - final andOutput Disturbance step.

2. From the toolbar, click the Run icon, .

3. From the Simulation type drop-down menu, select Transient.

4. Specify the output filename as inv_pendu_dyn.xml.

5. Specify the End time and Print interval as 3.0 and 0.01, respectively.

6. From the Main tab, click the Run button.

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.

Output Y-Type Y-Request Y-Component

control force Marker Force REQ/70000014 Output control force –final –(on Body Slider)

FX

disturbance force Marker Force REQ/70000017 Output Disturbance step –(onBody Slider)

FX

slider displacement-X

MarkerDisplacement

REQ/70000006 Output slider-disp –(on Bodyslider)

DX

pendulum angulardisplacement

Expressions REQ/70000016 Output Pendu rotation F2

Page 437: Altair MotionView 11.0 Tutorials

Altair Engineering 432

Proprietary Information of Altair Engineering

MotionView 13.0 Tutorials

The plots of disturbance force, control force, slider x displacement, and pendulum angulardisplacement are shown below.

Figure 2: Plots of disturbance and control forces as well as slider translational and pendulum angulardisplacements.

References

Feedback Control of Dynamic Systems, G. G. Franklin, J. D. Powell, and A. Emami-Naeini, Third Edition,Addison Wesley.

See also

MATLAB Documentation, www.mathworks.com.

Page 438: Altair MotionView 11.0 Tutorials

433 MotionView 13.0 Tutorials

Proprietary Information of Altair Engineering

Altair Engineering

MV-7005: Linking Matlab/Simulink Generated Code(Simulink Coder) with MotionSolve

This document describes how to generate a dynamic link library (DLL) using Simulink Coder (formerlyReal-Time Workshop) and link it with MotionSolve to run a co-simulation.

Pre-requisites:

1. A working installation of MotionSolve (v12 and above)

2. A working installation of MATLAB, Simulink, MATLAB Coder, and Simulink Coder

3. A working installation of Microsoft Visual Studio (MSVS) 2010

Check for supported versions of MATLAB and MSVS here:

Supported Versions - Third Party Software in the XML Format Reference Guide.

This example uses MATLAB R2011b with MSVS 2010.

Step 1: Prepare the MotionSolve Model

The MotionSolve model is set up to communicate with an external solver by using the modelingstatements Control_PlantInput and Control_PlantOutput:

<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)"

Page 439: Altair MotionView 11.0 Tutorials

Altair Engineering 434

Proprietary Information of Altair Engineering

MotionView 13.0 Tutorials

usrsub_dll_name = "rtw_BusSuspension2PMIMODiscrete" usrsub_fnc_name = "PINSUB" hold_order = "2" /> <Control_PlantOutput id = "30100400" num_element = "2" variable_id_list = "30100600, 30100700" sampling_period = "0.01" offset_time = "0.0" label = "for controller 2" usrsub_param_string = "USER(987654321)" usrsub_dll_name = "rtw_BusSuspension2PMIMODiscrete" usrsub_fnc_name = "POUTSUB" hold_order = "2" />

The key attributes of Control_PlantInput and Control_PlantOutput needed to link a Simulink

Coder DLL are listed below.

Attribute Description

usrsub_param_string Set this parameter equal to "USER(id)", where the ID is an integer (forexample, 123) that you choose. The ID identifies the Simulink Coderlibrary, 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. Thishas 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 Simulinkmodels, rtw_BusSuspension2PMIMODiscrete.xml and rtw_BusSuspension2PMIMODiscrete.mdl,

respectively, from <installation_directory>\tutorials\mv_hv_hg\mbd_modeling\motionsolve

\cosimulation to your <working directory>.

Page 440: Altair MotionView 11.0 Tutorials

435 MotionView 13.0 Tutorials

Proprietary Information of Altair Engineering

Altair Engineering

Step 2: Preparing the Simulink Model – Generating Code

Before starting with the simulation, the Simulink model needs to be created and prepared to work withMotionSolve. After generating the contents of the Simulink model, MotionSolve requires the Simulinkcomponents Inport and Outport, which represent the interface to the MotionSolve model. Forexample, like the following (blocks labeled below as In1, In2, Out1, Out2):

Note: If you have multiple inports/outports, you must retain the above illustrated naming scheme. Allyour inports must be defined as In1, In2, …, Inx. Similarly, all your outports must be named asOut1, Out2, …, Outx. This is a limitation within the current co-simulation framework and will beaddressed in a future release. See Appendix B for more information.

Page 441: Altair MotionView 11.0 Tutorials

Altair Engineering 436

Proprietary Information of Altair Engineering

MotionView 13.0 Tutorials

The order of these Inport's and Outport's must match the order of the Control_PlantOutput’s and

Control_PlantInput's, respectively, in the MotionSolve model.

1. Open rtw_BusSuspension2PMIMODiscrete.mdl in Simulink.

2. Specify the configuration parameters in the solver, which is used by Simulink Coder. To do this,use the Simulation > Configuration Parameters… menu option as shown below.

Page 442: Altair MotionView 11.0 Tutorials

437 MotionView 13.0 Tutorials

Proprietary Information of Altair Engineering

Altair Engineering

3. In the left-side browser/tree, select the Code Generation option:

Page 443: Altair MotionView 11.0 Tutorials

Altair Engineering 438

Proprietary Information of Altair Engineering

MotionView 13.0 Tutorials

4. Here, change the System target file by clicking Browse… and search for “grt.tlc – Create

Visual C/C++ Solution File for the “grt” target”. This is shown below:

5. Once this is done, change the Language option to “C++” in this same Code Generation window.

Page 444: Altair MotionView 11.0 Tutorials

439 MotionView 13.0 Tutorials

Proprietary Information of Altair Engineering

Altair Engineering

6. Next, in the left-side browser/tree, select the Solver option:

Simulink Coder does not allow using a variable-step integrator for the Generic Real-Time targetthat 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-stepsize for your model (in particular, if the model has multiple sample times, you will likely need tochoose a step size equal to the least common denominator of the specified sample times so thateach sample time is hit by the solver).

7. Next, in the left-side browser/tree, select the Code Generation option again.

Page 445: Altair MotionView 11.0 Tutorials

Altair Engineering 440

Proprietary Information of Altair Engineering

MotionView 13.0 Tutorials

8. Click on Build to build the code. The code generation creates two folders in the current directoryof MATLAB (here <Simulink_model> is the name of the model):

<Simulink_model>_grt_rtw

slprj

You should see messages that look similar to those below and end with:

### Successful completion of Real-Time Workshop build procedure for model: rtw_BusSuspension2PMIMODiscrete

…or similar.

Page 446: Altair MotionView 11.0 Tutorials

441 MotionView 13.0 Tutorials

Proprietary Information of Altair Engineering

Altair Engineering

Step 3: Modifying, Compiling and Linking the Code to Create the DLL

At this point, Simulink Coder has generated source code for the Simulink model, but this must bemodified and recompiled to generate the DLL required by MotionSolve. In the next steps, you will usea script to automatically compile and link this code and generate the Simulink Coder DLL that will beused in the MotionSolve model.

1. Open a command prompt in your working directory (where Simulink has generated the code).

2. Issue the following command:

“ms_rtw_pre <mdl_name> <altair_root> <msvs_root> <win32|win64>”

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.

An example of the above command for this model is:

ms_rtw_pre rtw_BusSuspension2PMIMODiscrete "C:\Program Files\Altair\13.0" "C:\ProgramFiles (x86)\Microsoft Visual Studio 10.0" "win64"

Issuing the above command does the following:

Automatically modifies the project settings and source files of the original solution generatedby 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 thecommand 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.

** RTW dll is ready **

Page 447: Altair MotionView 11.0 Tutorials

Altair Engineering 442

Proprietary Information of Altair Engineering

MotionView 13.0 Tutorials

Step 4: Run a MotionSolve Model with The Generated DLL

At this point, you simply need to point MotionSolve to the Simulink library to complete the co-simulation. By default, it assumes that it is in the same directory as the MotionSolve model.

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 mustbe set to be able to invoke MotionSolve. See the MotionSolve User’s Guide for more details onthe 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 processworked 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 outputfrom MotionSolve.

The first argument requests a pointer to the API ID. The API ID is passed from the model XML in theline 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, constExternalOutputs_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).

Page 448: Altair MotionView 11.0 Tutorials

443 MotionView 13.0 Tutorials

Proprietary Information of Altair Engineering

Altair Engineering

Appendix B

This section describes the data structure that Simulink Coder generated code uses for representingthe external input/output ports. In the following lines, the name of the model is assumed to be rtw_MS (rtw = Real Time Workshop, former name of Simulink Coder).

Typically, the Simulink Coder generated code (SCGC) uses the following notations:

Input port to Simulink with single channel rtw_MS_U.In1, rtw_MS_U.In2 etc.

Output port from Simulink with single channel rtw_MS_Y.Out1, rtw_MS_Y.Out2 etc.

Input port with multiple channels rtw_MS_U.In1[0], rtw_MS_U.In1[1] etc.

Output port with multiple channels rtw_MS_Y.Out1[0], rtw_MS_Y.Out1[1] 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 codewould be:

CPI #1: rtw_MS_U.In1[0], rtw_MS_U.In1[1] and rtw_MS_U.In1[2]

CPI #2: rtw_MS_U.In2[0] and rtw_MS_U.In2[1]

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 namesused by Simulink in case the links are not named. In this scenario, you need to change thefirst 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 followingchange to that function template:

double *u_ptr = (double *)&u.myIn;

to replace the original code:

double *u_ptr = (double *)&u.In1;

Page 449: Altair MotionView 11.0 Tutorials

Altair Engineering 444

Proprietary Information of Altair Engineering

MotionView 13.0 Tutorials

MV-7006: Python UserSub for MotionSolve

In this tutorial, you will learn how to:

Use Python to make a user subroutine for MotionSolve. It is assumed that you are familiar withPython 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 areinterpreted 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 fasterprototyping.

If you do not have much programming experience, writing scripts for user-subroutines is simpler thanwriting C code. For a C user, the usage is even simpler. Besides following the language syntax ofPython, 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 provided with the installation at <instllation_directory>\hwsolvers\motionsolve\usersub\py_src.

Rules for Written Python User Subroutines

It is easy to understand the usage for py_* utility functions from the usage of their c_* counterparts,

with the help of the following rules:

1. The output arguments should be moved to the left-hand-side.

c_datout(&istat);

becomes

istat = py_datout()

In C utility functions, the input and output arguments are combined in an argument list. InPython, 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 integerargument for the array size. In Python utility functions, the integer argument for the array size isremoved 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

[u1, errflg] = py_sysary("TDISP", [par[1],par[0]])

Page 450: Altair MotionView 11.0 Tutorials

445 MotionView 13.0 Tutorials

Proprietary Information of Altair Engineering

Altair Engineering

3. Change the function name from c_* to py_*.

c_rcnvrt(sys1, coord1, sys2, coord2, &istate);

becomes

[coord2, istate] = py_rcnvrt(sys1, coord1, sys2)

Step 1: Convert C sub into Python sub.

1. In this example, the model uses six SFOSUBs written in C code as shown below:

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;

// --- Add your executable code here -----------------------

int itype = (int)par[0]; iord = 0; if (itype==50) { ipar[0] = (int)par[1]; ipar[1] = (int)par[2]; c_sysfnc("DM", ipar, 2, &dm, &errflg); ipar[0] = (int)par[3]; ipar[1] = (int)par[4]; c_sysfnc("VM", ipar, 2, &vm, &errflg); c_impact(dm, vm, par[5], par[6], par[7], par[8], par[9], iord, vector, &errflg); *result = vector[0]; }}

2. Following the rules specified in last section, the corresponding Python script is shown as:

def SFOSUB(id, time, par, npar, dflag, iflag):

[dm, errflg] = py_sysfnc("DM", [par[0],par[1]]) [vm, errflg] = py_sysfnc("VM", [par[2],par[3]])

[vector, errflg] = py_impact(dm, vm, par[4], par[5], par[6], par[7], par[8], 0)

return vector[0]

3. Besides the Python scripts, you also need to specify in the XML model the Python scripts that areused in the user subroutine. MotionSolve provides this definition through two attributes in thecorresponding elements that uysrsub can be defined.

1. interpreter = "Python"

2. script_name = "script_name.py"

This combination replaces the attribute “usrsub_dll_name” in that element.

Page 451: Altair MotionView 11.0 Tutorials

Altair Engineering 446

Proprietary Information of Altair Engineering

MotionView 13.0 Tutorials

4. The following image shows the difference between using C user sub and Python user sub in thisexample:

5. In the original model, there are six Force_Scalar_TwoBody elements that use SFOSUB written inC:

<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" usrsub_param_string = "USER(50,30301010,30501010,30301010,30501010,10,10,2.0,0.001,0.01)" usrsub_dll_name = "NULL" usrsub_fnc_name = "SFOSUB" /> <Force_Scalar_TwoBody id = "30901" type = "Force" i_marker_id = "30901010"

Page 452: Altair MotionView 11.0 Tutorials

447 MotionView 13.0 Tutorials

Proprietary Information of Altair Engineering

Altair Engineering

j_marker_id = "30901011" usrsub_param_string = "USER(50,30301010,30601010,30301010,30601010,10,10,2.0,0.001,0.01)" usrsub_dll_name = "NULL" usrsub_fnc_name = "SFOSUB" /> <Force_Scalar_TwoBody id = "31001" type = "Force" i_marker_id = "31001010" j_marker_id = "31001011" usrsub_param_string ="USER(50,30401010,30501010,30401010,30501010,10,10,2.0,0.001,0.01)" usrsub_dll_name = "NULL" usrsub_fnc_name = "SFOSUB" /> <Force_Scalar_TwoBody id = "31101" type = "Force" i_marker_id = "31101010" j_marker_id = "31101011" usrsub_param_string ="USER(50,30401010,30601010,30401010,30601010,10,10,2.0,0.001,0.01)" usrsub_dll_name = "NULL" usrsub_fnc_name = "SFOSUB" /> <Force_Scalar_TwoBody id = "31201" type = "Force" i_marker_id = "31201010" j_marker_id = "31201011" usrsub_param_string ="USER(50,30501010,30601010,30501010,30601010,10,10,2.0,0.001,0.01)" usrsub_dll_name = "NULL" usrsub_fnc_name = "SFOSUB" />

6. After changing C SFOSUB into Python SFOSUB, the XML content above is replaced with thefollowing:

<Force_Scalar_TwoBody id = "30701" type = "Force" i_marker_id = "30701010" j_marker_id = "30701011" usrsub_param_string ="USER(30301010,30401010,30301010,30401010,10,10,2.0,0.001,0.01)" interpreter = "Python" script_name = "script/sfosub.py" usrsub_fnc_name = "SFOSUB" /> <Force_Scalar_TwoBody id = "30801" type = "Force" i_marker_id = "30801010" j_marker_id = "30801011"

Page 453: Altair MotionView 11.0 Tutorials

Altair Engineering 448

Proprietary Information of Altair Engineering

MotionView 13.0 Tutorials

usrsub_param_string = "USER(30301010,30501010,30301010,30501010,10,10,2.0,0.001,0.01)" interpreter = "Python" script_name = "script/sfosub.py" usrsub_fnc_name = "SFOSUB" /> <Force_Scalar_TwoBody id = "30901" type = "Force" i_marker_id = "30901010" j_marker_id = "30901011" usrsub_param_string ="USER(30301010,30601010,30301010,30601010,10,10,2.0,0.001,0.01)" interpreter = "Python" script_name = "script/sfosub.py" usrsub_fnc_name = "SFOSUB" /> <Force_Scalar_TwoBody id = "31001" type = "Force" i_marker_id = "31001010" j_marker_id = "31001011" usrsub_param_string ="USER(30401010,30501010,30401010,30501010,10,10,2.0,0.001,0.01)" interpreter = "Python" script_name = "script/sfosub.py" usrsub_fnc_name = "SFOSUB" /> <Force_Scalar_TwoBody id = "31101" type = "Force" i_marker_id = "31101010" j_marker_id = "31101011" usrsub_param_string ="USER(30401010,30601010,30401010,30601010,10,10,2.0,0.001,0.01)" interpreter = "Python" script_name = "script/sfosub.py" usrsub_fnc_name = "SFOSUB" /> <Force_Scalar_TwoBody id = "31201" type = "Force" i_marker_id = "31201010" j_marker_id = "31201011" usrsub_param_string ="USER(30501010,30601010,30501010,30601010,10,10,2.0,0.001,0.01)" interpreter = "Python" script_name = "script/sfosub.py" usrsub_fnc_name = "SFOSUB" />

7. With these changes (C code into Python code and XML model change), the model with Pythonuser subroutines are ready to run with MotionSolve.

Page 454: Altair MotionView 11.0 Tutorials

449 MotionView 13.0 Tutorials

Proprietary Information of Altair Engineering

Altair Engineering

MV-7007: Adding Friction to Joints

In this tutorial, you will learn more about:

The MotionSolve joint friction model.

How to model Joint friction in MotionView/MotionSolve.

How to review the friction results.

Introduction

Friction is defined as a resistance force opposing motion. Friction appears at the physical interfacebetween any two surfaces in contact. Friction force arises mainly due to adhesion, surface roughnessand plowing at the contact surfaces.

1. When contacting surfaces are smoother and brought to closer proximity; molecular adhesiveforces forms resistance to motion.

2. When contact surfaces are highly rough to cause abrasion on sliding; surface roughness resistsmotion.

3. When one surface in contact is relatively soft, plowing effect causes most of resistance.

Friction forces generated depend on:

Surface contact geometry and topology

Properties of the bulk and surface materials

Displacement and relative velocity

Lubrication

Friction is highly non-linear and dependents on system states like stiction regime, transition regimeand sliding (or) dynamic regime.

The three characteristics of a friction function

The friction force varies based on its states (as shown in the above figure). The (a) section showsCoulomb friction, (b) shows Stiction plus Coulomb friction, and F(c) shows how the friction force maydecrease continuously from the static friction level due to lubrication also known as Stribeck effect.

Page 455: Altair MotionView 11.0 Tutorials

Altair Engineering 450

Proprietary Information of Altair Engineering

MotionView 13.0 Tutorials

Dynamics of friction

Friction-velocity relation or damping characteristics of friction will aid in dampening vibrations. Thereare other behaviors of friction such as pre-sliding and hydrodynamic effects of lubrications duringdynamic simulations. Resistant forces from the above mentioned effects need consideration in designof drive systems and high-precision servo mechanisms. So, it’s important to model friction accuratelyto capture system dynamics.

Joint friction

Friction in joint depends on its geometry. MotionSolve uses an analytical model to represent frictionfor different joints based on geometry, preloads, torque and lubrication.

Characterizing joint friction using LuGre friction model

MotionSolve uses LuGre model for friction representation. LuGre model is a bristle model emerged forcontrols applications. LuGre model was presented by Canudas de Wit, Olsson, Åstro¨m, and Lischinsky. Stemming from a collaboration among researchers at the Lund Institute of Technology (Sweden) andin Grenoble France (Laboratoire d’Automatique de Grenoble), the LuGre model captures a variety ofbehaviors observed in experiments, from velocity and acceleration dependence of sliding friction, tohysteresis effects, to pre-slip displacement and lubrication.

The Bristle model for friction

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 foreach constraint.

This tutorial uses an experimental model of a “block sliding on a table” to demonstrate friction forcesunder stick-slip condition and frequency dependency of friction forces.

Page 456: Altair MotionView 11.0 Tutorials

451 MotionView 13.0 Tutorials

Proprietary Information of Altair Engineering

Altair Engineering

Exercise

Copy the SlidingTable.mdl file from <Install_directory>\tutorials\mv_hv_hg\mbd_modeling

\motionsolve to your <working directory>.

The leader and follower model constitutes two rigid bodies namely Leader and Follower respectivelyconnected to the Ground body by translation joints and inter connected by a linear spring. In thefollowing steps you will add friction and apply motions to study friction behavior of the translationjoint.

Step 1: Adding Joint Friction.

1. From the Project Browser, browse to the Joints folder and select Follower Translation Joint.

2. From the Joints panel, go to the Friction Properties tab.

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 tothe units.

Page 457: Altair MotionView 11.0 Tutorials

Altair Engineering 452

Proprietary Information of Altair Engineering

MotionView 13.0 Tutorials

4. Uncheck the Bending Moment and Torsion Moment options to exclude joint reaction forces dueto geometry misalignments. Modify the Initial Overlap value to 10mm and leave the remaining

values at their default settings.

5. Select the LuGre Parameters tab to modify the Bristle properties. Modify the DampingCoefficient value to 0.0316.

Note Default properties of bristle are appropriate with units N, mm, second.

6. Leave all the LuGre parameters at their default values.

Step 2: Adding output requests for friction force.

In this step you will create an output to measure the friction forces on the Follower Translation Joint.

1. Right click the Output icon from General MDL Entity Tool bar.

The Add Output dialog is displayed.

2. Change the Label to Friction_Force.

Page 458: Altair MotionView 11.0 Tutorials

453 MotionView 13.0 Tutorials

Proprietary Information of Altair Engineering

Altair Engineering

3. Change the Variable to o_friction.

4. Click OK to add output request.

5. From the Properties tab, select the output type as Expressions.

6. Click in the F2 expression field.

7. Click on the button.

The Expression Builder dialog is displayed.

Page 459: Altair MotionView 11.0 Tutorials

Altair Engineering 454

Proprietary Information of Altair Engineering

MotionView 13.0 Tutorials

8. Populate the Expression Builder with the FRICTION function expression as: `FRICTION({j_contact.id},1)`.

Follower Translation Joint ID = {j_contact.id},

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.

ID The ID of the Joint.

comp The force component. Currently, a range of 1-18 is supported.

1 = Friction force FX along the x-axis of the J marker of the joint.

2 = Friction force FY along the y-axis of the J marker of the joint.

3 = Friction force FZ along the z-axis of the J marker of the joint.

4 = Friction torque TX along the x-axis of the J marker of the joint.

5 = Friction torque TY along the y-axis of the J marker of the joint.

6 = Friction torque TZ along the z-axis of the J marker of the joint.

Page 460: Altair MotionView 11.0 Tutorials

455 MotionView 13.0 Tutorials

Proprietary Information of Altair Engineering

Altair Engineering

Step 3: Adding output request for sliding velocity.

Friction forces are characterized with respect to the relative velocity between bodies under contact.So, you will create an output request to measure Follower body velocity.

1. Right click the Outputs icon on the General MDL Entity toolbar.

The Add Output dialog is displayed.

2. For Label, enter Follower_Velocity.

3. For Variable, enter o_velocity.

4. Click OK to add the output request.

5. From the Properties tab, select the output type as Velocity.

6. Select Entity from the drop-down menu below Velocity.

7. Select entity type to be .

8. Leave to be Global Frame.

Page 461: Altair MotionView 11.0 Tutorials

Altair Engineering 456

Proprietary Information of Altair Engineering

MotionView 13.0 Tutorials

Step 4: Add a constant velocity motion to the leader translation joint.

In this next step we will add constant velocity to the Leader Body. Follower body connected by alinear spring will observe a stick-slip motion due to the friction forces.

1. Right click the Motion icon from the Constraint toolbar.

The Add Motion or MotionPair dialog is displayed.

2. For Label, enter Stick Slip.

3. For Variable, enter mot_leader.

4. Click OK to add motion.

5. From the Connectivity tab:

Select On Joint from the drop-down menu for Define motion.

Select Leader Translation Joint for .

Select Velocity from the drop-down for Property.

6. From the Properties tab:

Select Linear from the drop-down menu for Define by.

Enter 100 for Value.

Page 462: Altair MotionView 11.0 Tutorials

457 MotionView 13.0 Tutorials

Proprietary Information of Altair Engineering

Altair Engineering

Step 5: Simulate the model.

1. Click on the icon to check the model.

2. Switch to the Run panel by clicking on the Run icon

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.

6. Click on the Run button to run the simulation.

Step 6: Viewing animation and plots.

Once the run is complete, the other buttons on the right side of the panel are activated.

1. Click on the Animate button to view the animation.

This invokes HyperView and loads the Stick_Slip.h3d animation file.

2. Next, click on the Plot button to view the plots.

This invokes HyperGraph and loads the Stick_Slip.abf results file.

3. Click on the HyperGraph window to activate it.

Page 463: Altair MotionView 11.0 Tutorials

Altair Engineering 458

Proprietary Information of Altair Engineering

MotionView 13.0 Tutorials

4. Plot Follower velocity versus Time.

Select X-axis Data Type as Time.

Select the following Y-axis data:

Y Type Marker Velocity

Y Request Follower_Velocity - (on Follower)

Y Component VX

Note Scale velocity value to m/sec from mm/sec.

5. Plot Friction force versus Time.

Select X-axis Data Type as Time.

Select the following Y-axis data:

Y Type Expression

Y Request Friction_Force

Y Component F4

Animation and Plot windows

6. To start the animation, click the Start/Pause Animation icon on the toolbar.

Page 464: Altair MotionView 11.0 Tutorials

459 MotionView 13.0 Tutorials

Proprietary Information of Altair Engineering

Altair Engineering

7. The Stick_Slip motion is clearly observed from the animation and plots.

Velocity and Friction Force on Time Scale

The Leader body moving at a constant velocity elongates the spring increasing spring forcelinearly. The friction force counteracts the spring force, and there is a small displacement ofFollower body when the applied force reaches the break-away force.

Break away force = mu static x Normal Load

= 0.15x1x9.81

= 1.47 Newton.

Step 7: Adding time varying velocity to follower translation joint.

In this step you will add “Time varying velocity” to Follower translation joint. Velocity is variedbetween 1.1 mm/sec to 3mm/sec at different frequencies (1 rad/sec, 10 rad/sec & 25rad/sec) toobserve Hysteresis in friction.

1. Right-click the Motions icon on the Constraint toolbar.

The Add Motion or MotionPair dialog is displayed.

2. For Label, enter Hysteresis.

Page 465: Altair MotionView 11.0 Tutorials

Altair Engineering 460

Proprietary Information of Altair Engineering

MotionView 13.0 Tutorials

3. For Variable, enter mot_freq_varying.

4. Click OK to add motion.

5. From the Connectivity tab:

Select On Joint from the drop-down menu for Define motion.

Select Follower Translation Joint for .

Select Velocity from the drop-down for Property.

Page 466: Altair MotionView 11.0 Tutorials

461 MotionView 13.0 Tutorials

Proprietary Information of Altair Engineering

Altair Engineering

6. From the Properties tab:

Select Expression from the drop-down menu for Define by.

Click on the button.

The Expression Builder is displayed.

Populate the Expression Builder with the following expression: `1.1+1.9*ABS(sin(PI*(time)))`

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/secrespectively.

Page 467: Altair MotionView 11.0 Tutorials

Altair Engineering 462

Proprietary Information of Altair Engineering

MotionView 13.0 Tutorials

7. Deactivate motion on the Leader Translation Joint created in earlier steps.

Step 8: Simulate model for varying velocities at different frequencies.

1. Click on the icon to check the model.

2. Switch to the Run panel by clicking on the Run icon

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.

5. Click on the Run button to run the model.

6. Modify the velocity expression of the Follower Translation Joint and run the model with the filenames and end times specified in the table below:

Frequency Expression File name End Time(sec)

10 rad/sec `1.1+1.9*ABS(sin(PI*(10*time)))` Hysteresis_10radpersec.xml 0.3

25 rad/sec `1.1+1.9*ABS(sin(PI*(25*time)))` Hysteresis_25radpersec.xml 0.12

Page 468: Altair MotionView 11.0 Tutorials

463 MotionView 13.0 Tutorials

Proprietary Information of Altair Engineering

Altair Engineering

Step 9: Plotting Hysteresis curves.

1. Select HyperGraph by clicking in the window.

2. Load results for the 1 rad/sec frequency.

Click on the Open Data File icon .

Browse to the working directory and select the Hysteresis_1radpersec.abf file.

3. Plot Follower velocity versus Time.

Select X-axis Data Type as Time.

Select the following for the Y-axis data:

Y Type Marker Velocity

Y Request Follower_Velocity- (on Follower)

Y Component VX

Page 469: Altair MotionView 11.0 Tutorials

Altair Engineering 464

Proprietary Information of Altair Engineering

MotionView 13.0 Tutorials

4. Plot Friction force versus Time.

Select X-axis Data Type as Time.

Select the following for the Y-axis data:

Y Type Expression

Y Request Friction_Force

Y Component F4

Follower Velocity and Friction Force

5. Plotting Friction Hysteresis curve (Friction Force versus Velocity).

There is an initial transition of friction force values, therefore you will plot hysteresis curveexcluding first cycle data (in other words, 0 to 1 sec.).

Click on the Define Curves icon on the Curves toolbar.

Click on the Add button to add a new curve.

Page 470: Altair MotionView 11.0 Tutorials

465 MotionView 13.0 Tutorials

Proprietary Information of Altair Engineering

Altair Engineering

Rename Curve3 as 1rad/sec.

For the X and Y data, select the Source type as Math.

Populate X data to select velocity between time interval 1 to 3 secs using the subrangefunction: p1w2c1.y[subrange(p1w2c1.x,1,3)].

Populate Y data to select Friction force between time interval 1 to 3 secs using the subrangefunction: p1w2c2.y[subrange(p1w2c1.x,1,3)].

Page 471: Altair MotionView 11.0 Tutorials

Altair Engineering 466

Proprietary Information of Altair Engineering

MotionView 13.0 Tutorials

Click the Apply button.

6. Similarly, plot hysteresis curves for frequencies 10rad/sec (Hysteresis_10radpersec.abf) and

25 rad/sec (Hysteresis_10radpersec.abf) following Steps 3 -5 above.

Hysteresis curves at different frequencies

The velocity variation with higher frequency will have widest hysteresis loop.

Page 472: Altair MotionView 11.0 Tutorials

467 MotionView 13.0 Tutorials

Proprietary Information of Altair Engineering

Altair Engineering

Working with External Codes

MV-4000: Eigen Analysis using ADAMS/Linear

MV-4010: Working with ADAMS

MV-4020: Solver Neutral Modeling

MV-4030: Flexible Bodies for MotionView with Abaqus

Page 473: Altair MotionView 11.0 Tutorials

Altair Engineering 468

Proprietary Information of Altair Engineering

MotionView 13.0 Tutorials

MV-4000: Eigen Analysis using ADAMS/Linear

In this tutorial, you will learn how to:

Perform Static+Linear analysis on a MotionView model using ADAMS/Linear

View the Static+Linear analysis results from ADAMS/Linear analysis using MotionView

Theory

This chapter deals with modal analysis of Multi-Body Dynamic (MBD) systems. This kind of analysisgives insight about system stability. Vehicle dynamics engineers often use the planar half-car model toanalyze the ride quality of vehicles. You will use the ADAMS/Linear simulation to do a modal analysis ofthis type of model.

Process

Using the MotionView interface, you can obtain modal results in two ways: using MotionSolve andADAMS/Linear. These two ways are illustrated in the flowcharts below:

Obtaining modal results with MotionSolve or ADAMS/Linear

Page 474: Altair MotionView 11.0 Tutorials

469 MotionView 13.0 Tutorials

Proprietary Information of Altair Engineering

Altair Engineering

Step 1: Obtaining Modal Results with ADAMS/Linear.

1. Start a new MotionView session.

2. Click the Open Model icon, , on the Standard toolbar.

OR

From the File menu select Open > Model.

3. From the Open Model dialog, locate and select halfcar_lin.mdl located in

<installation_directory>\tutorials\mv_hv_hg\mbd_modeling\externalcodes.

4. Click the Open button to load the model.

5. From the SolverMode menu, select ADAMS.

6. Click the Forms icon, , on the Model-General toolbar and select the Solution Options form.

7. Verify that the Solution type is set to Linear/Eig.

This ensures the ADAMS solver will first do a static analysis and then a linear modal analysis onyour model.

8. Click the Run icon on the Model-Main toolbar.

!Complete the following steps only if you have connected the ADAMS solverto 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.

10. Click Run to start the simulation.

Step 2: Viewing ADAMS/Linear Modal Results.

1. Copy the files halfcar_lin_adams.gra and halfcar_lin_adams.res located in

<installation_directory>\tutorials\mv_hv_hg\mbd_modeling\externalcodes to <Working

directory>.

2. Start a new MotionView session.

3. Select HyperView from the Select Application list.

4. Click the Load Results icon, , from the Standard toolbar.

The Load model and results panel is displayed.

5. Click the Load model file browser and select the file halfcar_lin_adams.gra, located in

<Working directory>.

Page 475: Altair MotionView 11.0 Tutorials

Altair Engineering 470

Proprietary Information of Altair Engineering

MotionView 13.0 Tutorials

6. Click the Load results file browser and select the file halfcar_lin_adams.res, located in

<Working directory>.

7. Click Apply.

8. From the Results Browser, click on the arrow next to Time History Animation and use theChange 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 (locateddirectly under the Change load case drop-down menu).

While an ADAMS Linear analysis may be performed multiple times through a transient simulation, inthis example, the linear analysis was performed only at time step = 0.0.

10. Use the Simulation drop-down menu to select Mode 3.

11. Switch the view to Top .

12. Click the Start/Pause Animation icon, , to start transient animation.

The model cycles through its mode shapes/frequencies.

13. Click the Start/Pause Animation icon again, , to stop transient animation.

Page 476: Altair MotionView 11.0 Tutorials

471 MotionView 13.0 Tutorials

Proprietary Information of Altair Engineering

Altair Engineering

14. Switch to Modal animation, .

Note To visualize a single mode while using the ADAMS/Solver, the Modal icon is used, .

For MotionSolve the Start/Stop Animation 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.

16. Click one of the remaining windows to make it active.

17. From the Load model panel, click Apply.

18. Repeat steps 16 and 17 for the remaining windows (Note - the Edit menu can also be used tocopy 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 carvibrations. The "wheel hop" resonance can also be seen in this example. Analyzing the above occurrences can help isolate vibrations byappropriately designing car suspensions.

Linear modal animation – ADAMS/Linear results

Page 477: Altair MotionView 11.0 Tutorials

Altair Engineering 472

Proprietary Information of Altair Engineering

MotionView 13.0 Tutorials

Step 3: Plotting ADAMS/Linear Results for Eigenvalues in the Complex Plane.

A file named halfcar_lin_adams.eig_inf is generated in the directory <working directory> where

the gra and res files are located following an ADAMS/Linear run. The extension eig_inf denotes

eigenvalue information.

In this exercise, you will use this file to plot the model eigenvalues in the complex plane.

Eigenvalues in the complex plane

Page 478: Altair MotionView 11.0 Tutorials

473 MotionView 13.0 Tutorials

Proprietary Information of Altair Engineering

Altair Engineering

MV-4010: Working with ADAMS

MotionView-MotionSolve-ADAMS process flow

MotionView-MotionSolve can work very closely with ADAMS.

Existing ADAMS users can switch to MotionView or MotionSolve in their workflow keeping therest of the flow as it is.

Following are the different ways one can use MotionView or MotionSolve with ADAMS.

Import a model built in ADAMS preprocessor into MotionView preprocessor; solve it withMotionSolve and post process the results using MotionView.

Submit a model built in ADAMS directly to MotionSolve and post process the results inMotionView.

Build a model in MotionView, submit it to ADAMS solver and post process the results usingMotionView.

Post process the ADAMS solver results in MotionView.

Exercise

Step1: Loading an .adm File into MotionView’s MBD Model Window.

1. Copy the file quick_return.adm file from

<installation_directory>\tutorials\mv_hv_hg\mbd_modeling\externalcodes to your

current <working directory>.

2. Start a new MotionView session by selecting New > Session from the File menu.

Page 479: Altair MotionView 11.0 Tutorials

Altair Engineering 474

Proprietary Information of Altair Engineering

MotionView 13.0 Tutorials

3. Make sure the application is MBD model.

4. From the File menu, select Import > Solver Deck.

OR

Click the Import Solver Deck button on the Standard toolbar.

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 statementsin your model. Unsupported ADAMS statements are stored in the Unsupported Statementstemplate. This template and its contents can be viewed from the Templates panel on theMotionView toolbar.

Unsupported ADAMS statements template

7. Use the Project Browser to examine the model tree.

Note adm is an input file for the solver. Due to this the model comes out flat and there is nohierarchy. 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 andthen run MotionSolve from the MotionView interface.

Page 480: Altair MotionView 11.0 Tutorials

475 MotionView 13.0 Tutorials

Proprietary Information of Altair Engineering

Altair Engineering

Step2: Running an ADAMS File with MotionSolve.

In step 1, we learned how to import an ADAMS (.adm) file into MotionView. This allows the user tomodify the model once it is in the MotionView environment. Step 2, shows how a user can run anADAMS model directly in MotionSolve.

Copy the ADAMS input files quick_return.adm and quick_return.acf from the

<installation_directory>\tutorials\mv_hv_hg\externalcodes to your current <working

directory>.

1. Invoke MotionSolve.

2. Browse for the quick_return.acf file in your <working directory>.

3. Click on Run.

This would start a MotionSolve run in a command prompt. MotionSolve would run in a batchmode. 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.

4. You may view the results in HyperView/HyperGraph.

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.

Step 3: Running an MotionView MBD model with ADAMS solver.

In Step 1 and Step 2 we learned how to run an ADAMS model with MotionSolve. Step 3 focuses onrunning a model built in MotionView with the ADAMS solver. If you want to run the ADAMS solver fromthe MotionView interface, please refer to Tip Trick #213 available on Altair’s website.

1. Copy the file V_Engine.mdl from

<installation_directory>\tutorials\mv_hv_hg\externalcodes to your current <working

directory>.

2. Invoke MotionView.

3. Load the model in MotionView.

4. From the menu bar select SolverMode as ADAMS.

Page 481: Altair MotionView 11.0 Tutorials

Altair Engineering 476

Proprietary Information of Altair Engineering

MotionView 13.0 Tutorials

5. From the Project Browser, locate the Datasets folder and select Solution Options as thedataset.

These datasets are used to control the solver run.

6. Change the end time to 3 seconds.

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 atemplate.

Note This is a very important feature when it comes to solver neutral modeling. Thestatements written in this section are directly written to the solver input deck. You canpass 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 solverinput 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 .

11. Check the model.

12. If there are no errors, run the model directly.

Page 482: Altair MotionView 11.0 Tutorials

477 MotionView 13.0 Tutorials

Proprietary Information of Altair Engineering

Altair Engineering

MV-4020: Solver Neutral Modeling

MotionView provides a solver-neutral pre- and post- processing environment to facilitate working withother MBD solvers.

MotionView has the following solver interfaces:

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 Altair’s website.

If the user needs to add any statement specific to the solver, Templex template can be usedin 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 from

<installation_directory>\tutorials\mv_hv_hg\mbd_modeling\externalcodes to your <working

directory>.

Exercise

Step 1: Loading a Solver-Neutral Model and Running Different Solvers.

1. Start a new MotionView session.

2. Copy the folder named solver_neutral from <installation_directory>\tutorials\mv_hv_hg

\mbd_modeling\externalcodes to <working directory>.

3. Load the file model.mdl.

4. From the SolverMode menu, confirm that MotionSolve is selected.

5. Click the RUN icon, , on the Model-Main toolbar.

6. From the Main tab, specify your output filename as <working directory>\ms.xml.

Page 483: Altair MotionView 11.0 Tutorials

Altair Engineering 478

Proprietary Information of Altair Engineering

MotionView 13.0 Tutorials

7. Select the Simulation type: Transient.

8. Click Run.

MotionSolve is launched and completes the run.

9. From the SolverMode menu, select ADAMS.

10. From the Project Browser, under the Data Sets folder select Solution Options.

11. Review the Solution Options dataset.

12. You can enter the simulation parameters for the ADAMS solver into this table.

13. Click the RUN icon, , on the toolbar.

14. Specify the output filename as <working directory>\adams.adm.

!Do not complete the following steps without connecting the ADAMS solver tothe 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.

16. Click the RUN button to start the simulation.

The ADAMS solver is launched and completes the run.

Step 2: Comparing Solver Animations.

1. Click the Add Page icon, , on the Page Controls toolbar to add a new page to your session.

2. Select HyperView from the Select Application drop-down menu.

3. Click the Page Layout, , icon on the toolbar and select the three horizontal windows

layout, .

Page 484: Altair MotionView 11.0 Tutorials

479 MotionView 13.0 Tutorials

Proprietary Information of Altair Engineering

Altair Engineering

4. Load the following model and results files into the three windows:

Window 1 Window 2

Model ms.h3d adams.gra

Results ms.h3d adams.gra

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.

6. Click the Start/Pause Animation icon again, , to stop/pause the animation.

Page 485: Altair MotionView 11.0 Tutorials

Altair Engineering 480

Proprietary Information of Altair Engineering

MotionView 13.0 Tutorials

MV-4030: Flexible Bodies for MotionView with Abaqus

MotionView can write input decks for the Abaqus solver. Users can:

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 exportABAQUS solver input deck (*.inp)

Replace a rigid body with ABAQUS inp (nodal FE component) file and export ABAQUS solverinput deck (*.inp)

The results of the Abaqus solver can be post processed in HyperView.

Here is the flow of flexible body creation and integration:

Integrating Abaqus substructure or FE model in MotionView

Page 486: Altair MotionView 11.0 Tutorials

481 MotionView 13.0 Tutorials

Proprietary Information of Altair Engineering

Altair Engineering

Exercise

In the first step of the exercise, you will be creating an Abaqus substructure. The second stepinvolves the replacement of the rigid lower control arm with the Abaqus substructure. In the third stepyou will run the solver, and in last step you will post process the results.

Copy the folder "abaqus" from

<installation_directory>/tutorials/mv_hv_hg/mbd_modeling/externalcodes to your <working

directory>.

Step 1: Creating the Flexible Body Substructure.

First, you will need to create the flexible body. This stage must be completed in Abaqus, independentof MotionView.

It is assumed that you are familiar with flexible multi-body dynamics in Abaqus. Here is a briefoverview of the steps you would need to do in Abaqus to generate a substructure:

Use standard elements to define the structure

Assign material and geometric properties to the elements

Define the retained degrees of freedom. The retained nodes will connect the substructure tothe rest of the model

Substructures must be created in one analysis and used in a subsequent analysis

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

TYPE=z2, LIBRAYR=carm_right, MASS MATRIX=YES, OVERWRITE, RECOVERY MATRIX=YES

*RETAINED NODAL DOFS, SORTED=NO

RETAINED_NODESET,1,6

*RETAINED EIGENMODES, GENERATE

1,20,1

*END STEP

This is just a sample deck. For detailed syntax you may have to look up Abaqus documentation.

Page 487: Altair MotionView 11.0 Tutorials

Altair Engineering 482

Proprietary Information of Altair Engineering

MotionView 13.0 Tutorials

Note You have been provided with two inp files: carm_left.inp and carm_right.inp. Use these

files to generate the two substructure files (*.sup) for the left and right lower control arms

using Abaqus. These substructure files should be named as carm_left.sup and

carm_right.sup respectively.

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 togenerate 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.

Step 2: Integrating a Flexible Body into the MBD System.

Once you complete the substructure generation step in Abaqus, you should have the <substructure-

name>.sup file. This .sup along with the original <substructure-name>.inp file will be used to

integrate your flexible body into MotionView.

1. Start a new MotionView session and load the file sla_abaqus.mdl, located in <working

directory>.

2. Make sure that the SolverMode is ABAQUS.

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.

5. Click Yes in the question dialog.

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.

Page 488: Altair MotionView 11.0 Tutorials

483 MotionView 13.0 Tutorials

Proprietary Information of Altair Engineering

Altair Engineering

7. Using the Graphic file browser, select carm_left.h3d from your working directory.

Properties tab

Notice that the Inp file field is automatically populated by MotionView.

Note The file carm_left.h3d is the graphic file for the ‘lower control arm-left’ body. Thisfile is for display and assists in allowing faster pre-processing. The flexbody (or the INPfile in this case) is used to provide data to the solver. The graphic H3D file can begenerate from the input (INP) file (or CAD file) using the Import CAD or FE optionlocated in the Tools menu in MotionView. In this exercise the graphic H3D files areprovided.

If the INP file is located in the same directory as the H3D graphic file, the Inp file fieldwould be populated automatically. Otherwise, one also has the option of selecting theINP file from its respective location.

8. Click Nodes….

The Nodes dialog is displayed.

Page 489: Altair MotionView 11.0 Tutorials

Altair Engineering 484

Proprietary Information of Altair Engineering

MotionView 13.0 Tutorials

9. Click the Find ALL button on the Nodes dialog to find nodes on the flexible body that are locatedclosest to the interface points on the vehicle model. The vehicle model is attached to the flexiblebody at these interface nodes.

Nodes dialog

Note In this case there is no offset between the flexible-body interface nodes and theircorresponding interface points on the vehicle model. But if there is an offset you canuse the Align button. When you click the Align button, MotionView moves theconnection point in the model to the node location on the flexible body. If the offset ismore than the tolerance value, MotionView inserts a dummy body between the flexiblebody and the nearest connection point. This affects any other entities that referencethis point.

You can attach joints to the flexible body only at the interface nodes. Theseattachment nodes are created during your substructure generation analysis in Abaqus. Creating more attachment points increases the actual number of modes calculated, andmay increase the CPU time.

10. Close the Nodes dialog.

Page 490: Altair MotionView 11.0 Tutorials

485 MotionView 13.0 Tutorials

Proprietary Information of Altair Engineering

Altair Engineering

11. Repeat steps 6 through 9 to integrate the right side flexible body carm_right.inp in your model.

Your model should look like the image below:

13. From the Tools menu, select Check Model to check your complete MBD model for errors.

Step 3: Running MBD Systems in ABAQUS.

The flexible bodies are now fully integrated in your model. Now you will set up the ABAQUS solver run.

MotionView writes out the INP file for the whole MBD system. It is important that this INP deck shouldcontain the substructure path references for the model to run successfully in Abaqus. The way toinclude these is via Templates in MotionView. Templex templates can be used to export syntaxdirectly to the solver input deck, including parametric substitution if required.

1. From the Project Browser, under the Templates folder select the Abaqus output template.

Page 491: Altair MotionView 11.0 Tutorials

Altair Engineering 486

Proprietary Information of Altair Engineering

MotionView 13.0 Tutorials

2. Click the expansion button, , on the panel and read through the template.

Note For the ABAQUS solver, the location of statements within the solver input deck isimportant. The four keywords used in this template allow you to position the extra text. These keywords must be the first line of the Templex template. For additionalassistance and information on these keywords see the Exporting MDL models to ABAQUStopic in the online help.

The remaining text of the template is written according to the position specified. In thiscase there are two substructure paths included for the two flexible bodies. You will needto add or delete such paths depending on the number of flexible bodies integrated in yourmodel.

{MODEL.sys_frnt_susp.b_lca.l.idstring} is the parameterized path to grab the

element ID number assigned to the left arm substructure.

Now your model is complete and ready to run in ABAQUS solver.

3. Close the Abaqus output template.

4. From the Project Browser, under the Data Sets folder select ABAQUS Solution Options.

5. From the File menu, select Export > Solver Deck.

Page 492: Altair MotionView 11.0 Tutorials

487 MotionView 13.0 Tutorials

Proprietary Information of Altair Engineering

Altair Engineering

6. Save your model as an MDL file named sla_flex.mdl in the working directory.

7. Save your model as sla_flex.inp file in your working directory.

Note You can run your model in ABAQUS at this stage. Select ABAQUS from the SolverModemenu and click on the Run icon on the toolbar to display the Run panel. Specify a filename for the inp file using the Save and run current model option and check theExport MDL animation file check box. Click on the Run button. MotionView will writethe inp file and the maf file (which will be used for animation). If the ABAQUS solverscript is linked to MotionView, the job will be submitted to ABAQUS.

Step 4: Post-processing Abaqus Results.

You will now load the results of the Abaqus run in the Animation window.

Note MotionView has FIL2MRF translator residing in Tool..Custom wizards. Using this will allow youto 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.

2. Select HyperView from the Select window mode drop-down menu.

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.

5. Activate the Overlay checkbox and click Apply.

6. Repeat the steps 4 and 5 to also overlay carm_right.odb file on the same model.

Notice that the substructures are overlayed on your model.

7. Use the Entity Attributes panel, , to turn off the graphics of the rigid control arm.

Page 493: Altair MotionView 11.0 Tutorials

Altair Engineering 488

Proprietary Information of Altair Engineering

MotionView 13.0 Tutorials

8. Click the Start/Pause Animation icon, , on the Animation toolbar to animate the model.

9. Click the Start/Pause Animation icon again, , to stop/pause the animation.