setunits


Purpose

Set unit system for IMAT.

Syntax

setunits(ustr)
setunits
setunits('US', [Lfact Ffact Tfact Toffset] )
setunits('ing')
setunits(ustr,'silent')

Description

SETUNITS defines the unit system you want to work in.

setunits(ustr) selects one of eight predefined unit systems. ustr should be a two-character string taken from one of the following:

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 you append a 'g' to the end of the units string ustr, IMAT will treat acceleration quantities as G's and not engineering units. For example, setunits('sig') will treat acceleration units as G's and all other quantities with metric engineering units.

setunits('US',[ Lfact Ffact Tfact Toffset Afact]) sets units to a nonstandard (user-defined) unit system for which Lfact length units equal one meter, Ffact force units equal one Newton, and Tfact temperature units equal one degree Kelvin. Toffset is the offset of absolute temperature. Afact is the conversion factor between one acceleration unit and one meter per second squared. Angular units are in radians.

setunits with no arguments will bring up a graphical prompt for the desired unit system. The optional input string 'silent' will suppress output.

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.

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

>> setunits('in')
Units set to IN

>>

See Also

getunits