Model Definition Language (MDL)

Model Definition Language (MDL) allows you to:
  • Create mechanical system simulation models.
  • Define custom wizards in MotionView.
An MDL file is an ASCII text file containing a structured list of MDL statements. There are two methods for creating MDL files:
  • Writing a file from scratch.
  • Saving a file from the modeling environment in MotionView.
Once an object is defined using MDL, it can be included any number of times in the model simply by using the object name.
Note: MDL keywords contain no spaces and are not case sensitive; a mix of upper- and lowercase letters is commonly used to improve readability.

Mechanical System Models

In MotionView, a model is an object which holds all the information required to describe a mechanical system, including the loads and motions which are applied to it. A model contains this information in the form of a list of entities. An entity is an object that describes an element such as a point, a vector, a rigid body, a joint or a spring.

The types of entities that can be contained inside of a MotionView model are listed below:
Control Entities
  • ControlSISO
  • SolverDiff
Geometric Entities
  • Graphics
  • Marker
  • Point
  • Vector
Physical Entities
  • Beam
  • Body
  • Bushing
  • Coil spring/Torsion spring
  • Constraint
  • Contact
  • Coupler
  • Field
  • Force
  • Gear
  • Joints
  • Motion
  • Polybeam
Reference Entities
  • Curve
  • Materials
  • SolverArray
  • SolverString
  • SolverVariable
User-Defined Entities
  • Dataset
  • Form
  • Procedure
  • Reader
  • Template
  • Writer
Properties
Entities have properties. Properties are the attributes of an entity. For example, a point entity has an x-coordinate, a y-coordinate and a z-coordinate, while a body entity has mass and inertias. A property can be a simple scalar value or it can be a mathematical expression that makes that property a function of other properties in the model.
Systems
MotionView models are subdivided into systems. A system is a named collection of entities within a model. In addition to containing entities, systems can also contain other systems, allowing for hierarchical model organization.
One benefit of grouping entities into systems is that certain operations can be performed on all the entities in a system at once. Systems can be turned on and off, translated in space, saved to a file or switched from non-compliant to compliant. When an operation, such as translation, is performed on a system, it is automatically performed on all the subsystems within that system as well.
System Attachments
Systems are connected together by system attachments. A system attachment is a reference to an entity that is outside of that system. Most of the entities inside of a system connect to other entities within that system. For system "A" to connect to system "B", though, one or more of system "A"s entities must reference entities that are in system "B". For each system in your model, MotionView maintains a list of all the attachments to outside entities so that you can easily see how your systems connect together.
Analyses
In MotionView, an analysis is a collection of loads, motions, and entities in a model which describe a particular event to be simulated. A model can contain any number of analyses. When a model is run from within MotionView, select the particular analysis that you want to run and MotionView includes the loads and motions described in that analysis when it submits the model to the solver.
Model Assembly Wizard
In MotionView, models are assembled from libraries of pre-defined systems using the Assembly Wizard. When you assemble a model using the Assembly Wizard, you are presented with lists of pre-defined systems to choose from. The Assembly Wizard guides you through the selection process and ensures that you have selected compatible systems. Once you have made your selections, the Assembly Wizard retrieves the systems from the libraries and connects all the systems together in the appropriate hierarchy.
CommandSets
MDL command set statements are used to create a solver command file when a solver input deck is exported from MotionView. A command set can contain MDL command set statements, Templex templates, or a combination of both. The commands in a command set are exported to the solver command file.
The command set definition as well as instantiation must be within a DefineAnalysis block. A DefineAnalysis block can contain multiple command sets, but MotionView allows only one command set to be active at a time (as indicated in the *SetActiveCommandSet() statement). When the solver input deck is exported, MotionView creates an .acf file that contains the elements that are in the active command set.

MDL Model Example

This example creates a pendulum and defines its points, bodies, and joints.

All model files start with *BeginMDL(). The variable name and the label are important for identifying the model. The label is used to call up the file for analysis and solver problems.

Although the order of the statements does not matter, it is recommended that you write your statements from specific to general:
  • Start with the points of the model, p_pivot and p_cm.
  • Define the body as b_link and connect the body to the ground with a revolving joint.
  • Include output statements for the angle of rotation about the x-axis.
  • Add necessary graphics to the model and add values to the specific points and shapes that form the pendulum, in this example, such as sphere and cylinder.
  • Incorporate necessary ACF templates, for problem solutions using the ADAMS solver.
  • Define your output, in this example, as plotting the rotation of the pendulum about the x-axis.
// body_1.mdl //
 
*BeginMDL(pendulum, "Pendulum")
 
points
*Point(p_pivot, "Pivot point 1")
*Point(p_cm, "Pivot point 2")
 
bodies
*Body(b_link, "First link body", p_cm)
 
joints
*RevJoint(j_pivot, "Ground Pivot Joint", B_Ground, b_link, p_pivot, V_Global_X)
 
output
*Output(o_1, "Angular displacement of link_1 about X-Axis", EXPR, `AX({b_link.cm.id, %d})`)
*Output(o_2, "Angular velocity of link_1 about X-Axis", EXPR, `WX({b_link.cm.id, %d})`)
 
graphics
*Graphic(gr_pivot, "Pivot graphic", CYLINDER, b_link, p_pivot, V_Global_X, 0.25, 0.25, 1, -0.5, CAPBOTH)
*Graphic(gr_link_1, "Link graphic", CYLINDER, b_link, p_pivot, p_cm, 0.25, CAPBOTH)
*Graphic(gr_mass, "Mass graphic", SPHERE, b_link, p_cm, 0.5) 
 
Template Definition 
*DefineTemplate(temp_def_acf_template) 
output/reqsave, grsave
sim/dyn, end=2, ste=100
stop
*EndDefine()
 
setsystem
*SetSystem(MODEL)
*SetPoint(p_pivot, 0, 0, 0)
*SetPoint(p_cm, 0, 5, 5)
*SetBody(b_link, 1, 1, 1, 1, 0, 0, 0)
 
template
*Template(temp_acf_template, "ACF Template", ACF, temp_def_acf_template)
 
*EndMDL()

Programmable Wizards

MotionView contains four types of programmable wizards:
  • Assembly Wizard
  • Attachment Wizard
  • Task Wizard
  • User-defined Custom Wizards

Wizards allow you to create interactive dialogs that collect input and execute procedures in MotionView. A wizard is comprised of a sequence of dialog panels that lead you through a specific process.

Custom wizards can be programmed to automate simple tasks such as file translation or perform complex data analysis in MotionView post-processing environment. Wizards can be programmed to instruct you to select curves from a plot, select input files from a file browser, enter data into a text box, or perform other data entry tasks. Once all required data has been entered in a wizard, an MDL procedure can be executed. Wizard procedures can call Unix or DOS shell commands, invoke data file readers, and present MotionView reports.

The Assembly Wizard and Task Wizard allow you to build system models from a library of subsystem definitions.