Unit objects are used to define a unit system in a project. A project may contain one or more unit systems. If no Unit object is defined, the whole project is assumed to be in uniform unit system.
If a Unit object is defined, the first Unit object must be named 'Internal'. This Unit object is used to define the internal unit system of the project. Keeping a uniform internal unit system makes it easier to write parametric expressions.
Once an internal unit system has been defined, it is possible to define more unit systems to make input easier for the end user.
The author of the project may define multiple unit systems. As an example, these systems may be named Section, Coordinate, Displacement, etc. Any parameter whose unit category matches the name of the Unit object will use that particular Unit system for end-user input. The system of Unit object named 'Internal' will be kept for internal computation.
If a Unit object named 'Default' exists in the project, the unit system of all parameters whose unit category is not defined is assumed to be in 'Default' unit category.
<O T="Unit">
.
.
.
</O>
Parent elements: Project
Child elements: Parameters
The first step to define customizable unit systems in ParamML documents is to define a Unit object named 'Internal'. The units specified for this Unit object determines the internal uniform unit system the ParamML document will use. The units of the internal system cannot be changed by the end-user.
Adding the following Unit object into a project specifies that the project will only use inch, kips, degrees, and Fahrenheit for all the calculations and checks inside.
<O N="Internal" T="Unit" >
<P N="Length" V="INCH" T="Text" />
<P N="Force" V="KIPS" T="Text" />
<P N="Angle" V="DEGREES" T="Text" />
<P N="Temperature" V="FAHRENHEIT" T="Text" />
</O>
The second step is to define one or more end-user customizable Unit objects. End-users usually would want to provide material information in a refined unit system, while the geometry and loads would be provided using a larger unit system.
See below example unit systems. The name of the Unit object is important as it will be used in Example 3 to map parameters to unit systems.
<O N="Geometry and Load" T="Unit">
<P N="Length" V="FEET" D="[INCH/FEET/MILLIMETER/METER]" T="Text" Role="Input" />
<P N="Force" V="KIPS" D="[POUND/KIPS/NEWTON/KILONEWTON]" T="Text" Role="Input" />
<P N="Angle" V="DEGREES" D="[DEGREES/RADIANS]" T="Text" Role="Input" />
<P N="Temperature" V="FAHRENHEIT" D="[FAHRENHEIT/CELSIUS]" T="Text" Role="Input" />
</O>
<O N="Properties" T="Unit">
<P N="Length" V="INCH" D="[INCH/FEET/MILLIMETER/METER]" T="Text" Role="Input" />
<P N="Force" V="KIPS" D="[POUND/KIPS/NEWTON/KILONEWTON]" T="Text" Role="Input" />
<P N="Angle" V="DEGREES" D="[DEGREES/RADIANS]" T="Text" Role="Input" />
<P N="Temperature" V="FAHRENHEIT" D="[FAHRENHEIT/CELSIUS]" T="Text" Role="Input" />
</O>
Now that customizable unit systems have been created for the end user, Unit Parameter and Unit Object need to be specified for each parameter in the ParamML document. This is done by specifying UT and UC attributes on parameters. For example, the parameter c_c is a length and falls under Properties Object. Notice that a Unit Object named "Properties" has been defined in Example 2.
<P N="c_c" V="1.5" T="Expr" UT="Length" UC="Properties" />
See Parameters for more discussion on use of UT and UC attributes.
By specifying the internal unit system (Example 1), user customizable unit systems (Example 2) and the parameter unit information (Example 3), the end user can input parameter values and view design and analysis results with the units they wish. Internally everything stays as uniform units in the unit system that the author used to create the ParamML document.