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
- 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
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 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:
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.if( solvermode == "ADAMS" ) *Template(.....1...) else *Template(.....2...) endif
- 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:
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.*DefineTemplate(........) {if (solvermode == "ADAMS" ) } text for adams {else} text for other {endif} text for all *EndDefine()
- 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:
- 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
*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.
- *SetBush()
- *SetCoilSpring()
- *SetForce()
- *Output()
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
- 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 ( ) 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.
- Plotting
- Plotting can be done for several files and simulation types.