General Interfacing Aspects

Learn about MotionView interfacing with solvers, MotionView SolverMode, and how to execute solvers.

Interfacing with Solvers

MotionView MDL models can be exported to numerous solvers. Several solvers such as MotionSolve, ADAMS, and Abaqus are programmed to directly map MDL modeling statements to corresponding entities within the solver input deck. In addition to this, Templex templates can be used to export information not contained in MDL and can be used in MotionView to pre-process any solver that requires an ASCII input deck.

Several considerations need to be made when interfacing with solvers. These are outlined below and are explained in more detail in the Help topics listed under See Also.
Gravity, Units, and Solver Parameters
These parameters are unique relative to other entities. A description of each is included within each solver section.
MDL Statement Mapping
Details on mapping between MotionView MDL entities and the corresponding solver entities. It explains the subset of MDL statements that describe a mechanical system and the statements that apply to a particular solver.
MDL CommandSet Mapping
MDL CommandSet statements apply to a solver command file. These statements are order dependent. The mapping of these statements is covered for each solver.
Templex Templates
Within MotionView, Templex templates allow any syntax to be exported directly to a solver input deck. In addition, the data within a template can be parametric and depend on other MDL data values. Templex templates, however, are generally not solver neutral so any functionality that's captured within a template has to be captured for each solver used by that model.
Function Expressions
MotionView supports function expressions that describe properties such as bushing stiffness, motions, and spring damper values. These expressions get passed into the solver input deck as a function for an entity's property. Function expressions can use the Templex statements solvercr and dtor, which are described in each solver section.
User Subroutines
Many entities get their associated values from user subroutines in place of the pre-defined entity values. User subroutines are generally in the form of DLLs or are linked with the solver to create a user executable solver. User subroutines only map to a couple of solvers.
Launching Solvers from MotionView
A solver launch script can be registered using the preference statement *RegisterSolverScript within the *BeginModelDefaults block. These set of statements can be saved in a preference file (*.mvw) and the preference file can be loaded through the File menu. Once the preference file is loaded, the solver scripts are displayed in the Run Solver panel.
Post-Processing
Post-processing methods as they relate to the MotionView MDL file are explained.
Other Items
Some solvers automatically remove redundant constraints while others do not. Depending on the modeling technique used, this may or may not be an issue for the solver. Details are explained in each solver section.

MotionView SolverMode

MotionView contains an implicit variable called SolverMode. In MDL, SolverMode can be used in an "if" context to define topology (include Templex templates). MotionView retains the "if" result for both cases so that when you toggle the solver type, the associated text becomes active within the user interface.

The example below shows how a break event template is constructed through the model library.
*elseif(SolverMode == "MotionSolve")
         *Template(tpl_brake_ms, "Brake event", SOLVER_COMMAND, tpldef_brake_ms, mot_steer…
 *elseif( SolverMode == "ADAMS" )
         *Template(tpl_brake, "Brake event", ACF, tpldef_brake, mot_steer, .. .
 *endif() 
When an MDL model containing the previous text is loaded into MotionView (or also through std_inc), the following template is displayed when the solver mode is selected as ADAMS in MotionView:
PREFERENCES/SIMFAIL=STOPCF                        !Stop if simulation fails

DEACTIVATE/JOINT, ID={j_rackfix_att.idstring}

!Initial static analysis

SIM/STAT

DEACT/MOT, ID={mot_frnt_wheel.l.idstring},{mot_frnt_wheel.r.idstring},{mot_rear_wheel.l.idstring},{mot_rear_wheel.r.idstring}
DEACT/JPRIM, ID = {j_clamp_1_body.idstring}, {j_clamp_2_body.idstring}
{if ds.str_type.value == "Locked"}
MOT/{mot_steer.idstring}, FUN = 0
{elseif ds.str_type.value == "Free"}
DEACT/MOT, ID={mot_steer.idstring}
{endif}

SIM/DYN, END = 4, STEPS = 400

STOP
If the solver mode is selected as MotionSolve in MotionView, the following template is displayed:
<!--Initial static analysis -->
<Simulate
  analysis_type = "Static"
  end_time      = "0.0"
/>
<Deactivate
  element_type = "MOTION"
  element_id = "{mot_frnt_wheel.l.idstring}"
/>
<Deactivate
  element_type = "MOTION"
  element_id = "{mot_frnt_wheel.r.idstring}"
/>
<Deactivate
  element_type = "MOTION"
  element_id = "{mot_rear_wheel.l.idstring}"
/>
<Deactivate
  element_type = "MOTION"
  element_id = "{mot_rear_wheel.r.idstring}"
/>
<Deactivate
  element_type = "JPRIM"
  element_id = "{j_clamp_1_body.idstring}"
/>
<Deactivate
  element_type = "JPRIM"
  element_id = "{j_clamp_2_body.idstring}"
/>    
<Simulate
      analysis_type       = "Transient"
      end_time            = "4"
      print_interval      = "0.01"
  />
  <Stop/>

SolverMode can be used to put "if" logic around any MDL topology.

Solver Execution

MotionView allows you to save the solver input deck and invoke the solver in one step. To do this, a script (or .bat file on PC) must be registered in the preferences.mvw file so that it can be used when you select Run from the Run Solver panel. For MotionSolve, the solver script is registered by default, clicking Run in the Run Solver panel will launch the solver (if installed) in the same install as MotionView. Use the *RegisterSolverScript() preference statement to register the solver script. When registered, the scripts can be selected from the Run Solver panel. For ADAMS, the MotionView installation contains scripts that require you to edit them only once before using. These can be found in the <ALTAIR_HOME>\utility\mbd\launch_scripts\ directory.