Notation and Syntax
MotionSolve input format is based on the Extensible Markup Language (XML). The input format is called MotionSolve XML. This section describes the notation and syntax for MotionSolve XML. It also describes how MotionSolve XML files may be generated.
A MotionSolve XML file is divided into elements. Each element defines a specific MotionSolve modeling or command element. Elements are delimited in standard XML fashion:
<Element_Name
…
</Element_Name>
<Element_Name
…
/>
<Element_Name … />
An ellipsis (...) indicates the omission of a section of a statement, typically to provide a shorter version of a more complex syntax. In case a modeling or command element has a nested element, the outer element cannot be written in an abbreviated form.
A MotionSolve XML element contains a set of attributes specific to the modeling or command element being defined. Elements, attributes, and their values are always shown in blue in the manual.
MotionSolve XML attributes are not case sensitive. The following are all equivalent to the solver:
SENSOR_EVENT, Sensor_Event, sensor_event
- Element names are in upper camel with an underscore separating the different words.
For
example:
Sensor_Event, Body_Rigid, Param_Transient, Reference_Marker
- Attribute names are in lower case. For
example:
stability, mass_unit, integrator_type, inertia_xy
An attribute may have one or more values associated with it. Generic values are typically shown in italics as demonstrated below:
<Sensor_Event
ID = "integer"
… >
</Sensor_Event>
<Contact
...
i_graphics_id = "123 456 789 321 654 987"
...
/>
-
<Reference_Variable id = "1" type = "EXPRESSION" expr = "VX(301)" />
-
<Reference_Variable id="1" type="EXPRESSION" expr="VX(301)" />
... ... ...
id = 1234 id=1234 id = 1234
... ... ...
Square brackets ("[" and "]") indicate optional attributes. The "[" and "]" are not part of the element; they are there merely to express the fact that the attributes and its value are optional. For example, in the following statement, the attribute label is optional. This is shown syntactically as:
<Sensor_Event
id = "integer"
[label = "This is a label"]
...
/>
When one member from a set of choices must be chosen, the alternatives are listed within braces ("{" and "}"), and the values are separated by “|”. In the example shown below, either EXPRESSION or USERSUB must be chosen:
<Sensor_Event
id = "integer"
type = {"EXPRESSION" | "USERSUB"}
…
/>
Attribute Values
Attributes may have several different kinds of values. The required value type is always indicated in the format specification for the modeling and command element.
- string implies that the value of the keyword may be any string.
- integer implies that the value must be an integer. Real valued data, if provided where integers are needed, are cast to integer format before they are stored.
- real implies that the value should be a real number. Scientific notation may be used to express real valued data. Integer valued data, if provided where real values are needed, are converted to reals before being stored.
- motionsolve_expression implies the value should be a legal expression that MotionSolve can understand.
- valid_path_name indicates that the value is the complete path name for a specific file. The conventions for this are different for different operating systems.
- boolean values are indicated by "TRUE" or "FALSE". These are never italicized.
- When the value is a specific string or it is shown within "double quotes"; the value itself is not italicized.
... ...
ID.=.1.234 HALT="T.RUE"
...
MotionSolve Expressions
- Numbers
- A number can be integer or real.
- Integer
- A whole number, positive or negative, without decimals.
- Real
- A number, positive or negative, containing one or more decimals. Numbers can be scientific numbers with an "e" to indicate the power of 10.
- Arithmetic Operators
- MotionSolve supports the following arithmetic
operators:
- +
- The addition operator adds two operands.
- -
- The subtraction operator subtracts the second operator from the first one.
- *
- The multiplication operator multiplies both operands.
- /
- The division operator divides the numerator by the denominator.
- **
- The exponentiation operator raises one operand to the power of the other.
- Operator Precedence
- Operator precedence determines the grouping in terms of an expression. This affects how an expression is evaluated. Certain operators have higher precedence than others.
- Angle Input
- All angle inputs to MotionSolve are in radians. To specify the input value in degrees, use ‘D’ or ‘d’ after the value. Adding 'D' at the end of an integer or real number scales the number with PI/180. For example, 180D represents 180 degrees and is equivalent to PI radians.
- Expression
- Expression is a finite combination of numbers, operators, constants, functions, and brackets that is well formed to determine the order of execution. The MotionSolve expression evaluates to a scalar value.
User Subroutine Parameters
usrsub_param_string = "USER(par_1, ..., par_n)"
Example
<Sensor_Event
label = "string"
id = "integer"
value = "real"
{
type = "EXPRESSION"
expr = "motionsolve_expression"
|
type = "USERSUB"
usrsub_dll_name = "valid_path_name"
usrsub_param_string = "USER(par_1, ..., par_n)"
|
type = "USERSUB"
script_name = "valid_path_name"
interpreter = {"string"}
usrsub_param_string = "USER(par_1, ..., par_n)"
}
[compare = { "GE" | "LT" | "EQ" } ]
[evaluate_id = "integer"]
[error_tol = "real"]
[return = {"TRUE" | "FALSE"}]
/>