Interfacing with ADAMS

Overview of how the MotionView applications interface with the ADAMS solver.

Guidelines for Exporting MDL Models to ADAMS

MotionView MDL models can be exported to an ADAMS .adm file.

Nearly all MDL entities have one or more corresponding ADAMS entities.

Gravity, Units, and Solver Parameters

MotionView works with gravity, units, and solver parameters for ADAMS.
Gravity
Gravity is an implicit data set, meaning that its definition is created automatically by MotionView. The values for gravity can be accessed through the Forms panel while in the Misc system of a model. Default values for gravity are set in the std_inc file that is part of the MotionView installation. A Templex template is also included in std_inc. This template provides a way for the gravity to be written to the ADAMS input file.
Units
Although MotionView is a "unitless" interface, it is often required that the units you are working with be communicated to the solver input deck. Therefore, the definitions of mass, length, time, and force are automatically generated by MotionView. To access this, go to the Forms panel and select Units under the Misc system. The default values as well as the Templex template used for exporting units to ADAMS are generated from the std_inc file.
Solver Parameters
Solver parameters for Adams are stored as DataSets in MotionView, which are available as default. These datasets can be used to set solver parameters such as integrator parameters, static equilibrium parameters, debug options and result options. The available datasets with brief description and their equivalent adams statement are listed below.
Note: The vehicle dynamics and suspension MDL libraries that are shipped with MotionView contain a solver parameter system for each pre-defined analysis in the library along with a template that writes of these solver parameters to the adams solver deck.
MotionView Dataset Description Adams statement
Equilibrium Parameters Static equilibrium parameters EQUILIBRIUM
GSTIFF Parameters Integrator parameters for GSTIFF integrator INTEGRATOR/GSTIFF
Initial conditions Parameters for initial condition analysis IC
Debug options Dataset to set debug options DEBUG
Output options Specify output options such as saving REQ and GRA file OUTPUT
Result options Set RES file options. RESULTS
Solution options Set simulation options such as type of analysis, end time and number of solution steps SIMULATE

MDL Statement Mapping

Overview of the mapping between MDL statements and the corresponding ADAMS entity.
Note: All entities implicitly create required markers.
All property data for these entities are set in corresponding *Set() statements.
MDL Statement ADAMS Entity
*ActionOnlyForce() VFORCE, VTORQUE, or GFORCE
*ActionReactionForce() VFORCE, VTORQUE, or GFORCE
*AtPointJoint() JPRIM of type ATPOINT
*BallJoint() JOINT of type SPHERICAL
*Beam() BEAM
*Body() PART
*Bush() BUSHING or GFORCE
*CoilSpring() SPRINGDAMPER or SFORCE
*ControlSISO() TFSISO and implicitly ARRAY and VARIABLE
*Coupler() COUPLER
*Curve() SPLINE
*CVJoint() JOINT of type CONVEL
*CylJoint() JOINT of type CYL
*FixedJoint() JOINT of type FIXED
*Graphic() GRAPHIC
*InlineJoint() JPRIM of type INLINE
*InplaneJoint() JPRIM of type INPLANE
*Markert() MARKER
*Motion() MOTION
*OrientJoint() JPRIM of type ORIENT
*Output() REQUEST, 1 or more
*ParallelAxisJoint() JPRIM of type PARALLEL
*PerpAxisJoint() JPRIM of type PERP
*PlanarJoint() JPRIM of type PLANAR
*Polybeam() BEAM (many)
*RevJoint() JOINT of type REVOLUTE
*SolverArray() ARRAY
*SolverDiffEquation() DIFF
*SolverString() STRING
*SolverVariables() VARIABLE
*TorsionSpring() SPRINGDAMPER or SFORCE
*TransJoint() JOINT of type TRANSLATIONAL
*UniversalJoint() JOINT of type UNIVERSAL

MDL CommandSet Mapping

CommandSet statements map to the solver command file, which for ADAMS is the .acf file. Unlike MDL statements, MDL CommandSets are order dependent. This means that the resulting mapping to the .acf file is in the order that the corresponding commands occur in the CommandSet.
Table 1. Supported Commands
CommandSet Statement Maps to .acf version of
*SetForce() VFORCE, VTORQUE, GFORCE, or SFORCE
*SetMotion() MOTION
*SetSolverVariable() VARIABLE
*SetState() entity/ACTIVATE or DEACTIVATE
*Simulate() SIMULATE
*Write() Sends template text into solver input file
Templex Templates and solvermode
Templex templates can be used to directly export syntax to the solver input deck, including parametric substitution if required. For the ADAMS solver, there are no position or order requirements for deck syntax and therefore, the Templex template requires no usage of keywords for positioning and ordering.
solvermode
You can use one MDL model to export to more than one solver. In this case, it is best to wrap the contents within the Templex template or the instance of the Templex template using the solvermode reserved keyword. This can be done two ways:
  • Wrap the entire instance of the Templex template such that the existence of the template depends on the solvermode. For example, an MDL model containing:
    if( solvermode == "ADAMS" )
    
     *Template(.....1...)
    
    else
    
     *Template(.....2...)
    
    endif
    Results in template 1 being used when ADAMS is selected from the Solvers menu. When another solver is selected, template 2 is used. When a template is used, it means that it is displayed on the Templates panel and is acted upon when saving the solver input deck.
  • Wrap the text within a Templex template such that only a portion of the template applies to a particular solver. For example, an MDL model containing:
    *DefineTemplate(........)
    
     {if (solvermode == "ADAMS" ) }
    
         text for adams
    
     {else}
    
         text for other
    
     {endif}
    
    text for all
    
    *EndDefine()
    Results in "text for adams" and "text for all" being exported to the input deck when ADAMS was selected as the solver and "text for other" and "text for all" being exported if any other solver was selected when exporting the model. The same applies for the portion of the template that would be displayed in the user interface.
Template Types
A Templex template can have several destinations as well as a unique default behavior.
  • A USER template does not get exported into any solver file but can be useful for getting parametrically based text into another file (by using the Templex open and close commands) or for text targeted for the interface only.
  • A SOLVER_INPUT template results in the template text being exported to the .adm file for ADAMS.
  • A SOLVER_PARAM template does not apply to the ADAMS solver.
  • A GRAPHICS template results in the template text being exported to the .adm file for ADAMS.
  • An ADAMS template results in the template text being exported to the .adm file for ADAMS. Note that the more recent type, SOLVER_INPUT, supports a neutral solver approach but the original template type ADAMS is supported for backwards compatibility.
  • An ACF template results in the template text being exported to the .acf file for ADAMS. If at least one ACF template is used, it automatically results in the first line of the .acf file being the name of the solver input deck and the second line is left blank. This is different than if the template is used through the *Write() command in a CommandSet, as explained below.

CommandSets

The *Write() statement in an MDL CommandSet causes a Templex template to be exported to the ADAMS .acf. Unlike using an ACF template, the resulting .acf file from a *Write() statement does not automatically result in the first line echoing the name of the solver input deck. This is required to support the neutral solver approach. Therefore, when using *Write() with ADAMS, the following command should be in the first line of the first template that is used and the second line should be left blank. This mimicks what automatically happens in the ACF template type:
*DefineTemplate(tpldef_event_begin)

{AbsToRelative(Solver_File_basename.path, Solver_File_basename.value + ".adm")}

*EndDefine()

Function Expressions

ADAMS supports function expressions for many of its entities. These expressions can be a function of time and state variables. MotionView users can create function expressions that can be exported directly to the resulting solver entity.

The solver neutrality is somewhat limited because the solver needs to handle the syntax that MotionView exports. For ADAMS users, there is no issue because the function expression language is 100% compatible between MotionView and ADAMS.

User Subroutines

Many solvers, including ADAMS, allow you to create your own modified entities through the creation of user subroutines that link to the solver. In MotionView, there are several locations where user subroutines can be used. In these cases, you only need to fill in the syntax required for the call to the user subroutine.

MotionView entities include:
  • *SetBush()
  • *SetCoilSpring()
  • *SetForce()
  • *Output()
The string used for calling a user subroutine can be parametric in MotionView and can be constructed using the Expression Builder.

Launch Solvers from MotionView

MotionView allows you to launch a process automatically after the solver input deck is exported. For ADAMS, the installation contains default launch scripts located in altair/utilities/mbd/launch_scripts. One or more of these launch scripts can be registered through the preferences.mvw file and subsequently selected from the Run panel by using the *RegisterSolverScript() mvw statement.

Post-Processing

There are many areas applicable to post processing depending on the ADAMS analysis. For the animation window, Model refers to the first load field and Results refers to the second load field.
Animation - Transient with Rigid Bodies Only
There are two options available:
  • Load file.gra under Model and file.gra under Results. This is the traditional usage and results in the animation of all primitive graphics that are included in the original .adm file, including force graphics. However, this does not automatically capture the graphics that were added during the pre-processing phase in MotionView (.g, .h3d, .shl). To work around this, manually add the objects through the animation window using the Add Objects panel.
  • Load file.maf under Model and file.gra under Results. The file.maf can be generated while exporting the solver deck .adm (File > Export > Solver Deck) with SolverMode set as ADAMS, or from the Run panel if executing the ADAMS solver script. This automatically captures all graphics that were added in the pre-processing phase, but does not capture force graphics. It is important that the .gra file be a function of an .adm file that resulted from the MDL model being used, and that the .adm file was not edited with respect to the number or IDs of PARTs. In addition, if the MDL model uses Templex templates which contain extra PARTs, it could break the internal mapping required for successful animation.
Animation - Transient with One or More Flexbodies
MotionView automatically creates a filename.flx file when saving the solver input files. To visualize this, load file.flx under Model and file.flx under Results. The .flx file supports the following commands for an ADAMS animation:
  • *ModelSource(path)
  • *ResultsSource(path)
  • *FlexSource(path, ID, scale)
  • *StartTime(real)
  • *EndTime(real)
  • *StartMode(integer)
  • *EndMode(integer)
Animation - Modal with Rigid Bodies Only
To visualize the results from an ADAMS/Linear simulation, the ASCII version of the ADAMS .res file must be generated. Animation can be obtained using file.gra and file.res in the Model and Results fields, respectively.
Animation - Modal with One or More Flexbodies
MotionView automatically creates a filename.flx file when saving the solver input files that contain one or more flexbodies. To visualize the results from an ADAMS/Linear run, load file.flx and file.flx in the Model and Results fields, respectively.
MotionView calculates all of the animation frames at the time of loading the modal results. This allows instant animation for all modes in the mode set. For large flexbodies, calculating all modes ahead of time may take longer, in which case you can manually add the *StartMode() and *EndMode() statements in the .flx file.
Plotting
Plotting can be done for several files and simulation types.
For the .req file, pick the file from the directory and all signals corresponding to MotionView outputs display in the interface for plotting.
For the .res file (ASCII only), if an ADAMS/Linear run was made, the Eigenvalues are displayed for plotting
For the .res file (ASCII only) with a model that contains flexbodies, the modal participation factors of the flexbody can be plotted.
Note: To view stresses on a flex body from an ADAMS run, the .res file should be requested.