getunits


Purpose

Return information on the current unit system.

Syntax

[ustr,ufact,unum]=getunits('in')
[ustr,ufact,unum]=getunits('silent')
[ustr,ufact,unum]=getunits('in','silent')
[ustr,ufact,unum,ulab]=getunits

Description

GETUNITS has two uses: to find out the current unit system, and to obtain information on any predefined unit system. The input argument is a two- or three-character unit string. If the input argument is omitted, the current working units are returned.

The meaning of the output arguments are as follows:

ustr  - a vector of conversion factors :
ufact - the two-character unit system name

ufact(1) = 1 meter/1 model length unit

ufact(2) = 1 Newton/1 model force unit

ufact(3) = 1 deg K/1 model temperature unit (relative temperature)

ufact(4) = temperature offset from absolute zero

ufact(5) = 1 meter/sec^2/1 model acceleration unit

unum  - the numeric value of the unit system

ulab  - the units label strings

ulab{1,:}  - length units label strings

ulab{2,:}  - force units label strings

ulab{3,:}  - mass units label strings

ulab{4,:}  - temperature units label strings

ulab{5,:}  - time units label strings

ulab{6,:}  - acceleration units label strings

 

All of the output arguments are optional. If no output arguments are requested, then GETUNITS prints a summary of the specified unit system.

The following unit systems are recognized:

unum ustr Name Length Time Mass Force Temp
1 SI Metric_Abs_(SI) meter sec kilogram(kgm) Newton (N) deg_c:K
2 BG British_Grav foot sec lbf-sec^2/ft pound (lbf) deg_F:R
3 MG Metric_Grav meter sec kgf-sec^2/m kilogram (kgf) deg_C:K
4 BA British_Abs foot sec pound(lbm) poundal (pdl) deg_F:R
5 MM Modified_SI mm sec kilogram(kgm) milli-Newton deg_C:K
6 CM Modified_SI cm sec kilogram(kgm) centi-Newton deg_C:K
7 IN British_Grav_(mod) inch sec lbf-sec^2/in pound (lbf) deg_F:R
8 GM Metric_Grav_(mod) mm sec kgf-sec^2/mm kilogram (kgf) deg_C:K
9 US User_defined - sec - - -
10 MN Milli Meter (Newton) mm sec tonne (t) Newton (N) deg_C:K

 

If the 3rd character of USTR is 'g', this indicates that IMAT is treating acceleration units as G's and not engineering units.

The unit system affects all input and output operations to ADF and universal files. On input from an ADF or universal file, data is converted into the selected unit system. On output to an ADF, data is converted back to SI units as required by I-deas. On output to a universal file, a units dataset (164) is written at the beginning of the file to indicate the units of the subsequent datasets. Angular units are in radians.

Passing in the optional string 'silent' suppresses output.

Note: unlike I-deas, changing the unit system does not automatically convert units for existing functions. You should call SETUNITS before any import/output operations, and maintain consistency throughout a session. If you never call SETUNITS, then SI units will be assumed. If GETUNITS is called before SETUNITS, then the user will prompted for a unit system.

Examples

>> getunits('in');
Summary of IN unit system (current default)
Length
.....     39.3701 model units = 1 meter
          1       model unit  =       0.0254 meters
Force
.....    0.224809 model units = 1 Newton
          1       model unit  =      4.44822 Newtons
Mass
.....  0.00571015 model units = 1 kilogram
          1       model unit  =      175.127 kilograms
Temperature
.....         1.8 model units = 1 degree Kelvin
          1       model unit  =     0.555556 degrees Kelvin
Temperature scale
.....         1.8 model units -      459.67 = 1 degree Kelvin
          1       model unit  -      459.67 =     0.555556 degree Kelvin
Acceleration
.....     39.3701 model units = 1 m/s^2
          1       m/s^2       =       0.0254 model units

>> getunits('ing');
Summary of IN unit system (current default)
Length
.....     39.3701 model units = 1 meter
          1       model unit  =       0.0254 meters
Force
.....    0.224809 model units = 1 Newton
          1       model unit  =      4.44822 Newtons
Mass
.....  0.00571015 model units = 1 kilogram
          1       model unit  =      175.127 kilograms
Temperature
.....         1.8 model units = 1 degree Kelvin
          1       model unit  =     0.555556 degrees Kelvin
Temperature scale
.....         1.8 model units -      459.67 = 1 degree Kelvin
          1       model unit  -      459.67 =     0.555556 degree Kelvin
Acceleration
.....     386.089 model units = 1 G
          1       G           =   0.00259008 model units
>>

See Also

setunits