WOLFRAM SYSTEM MODELER

autoUnit

Convert amount-of-quantity to automatically selected unit

Wolfram Language

In[1]:=
SystemModel["SystemModelerExtras.Experimental.Units.autoUnit"]
Out[1]:=

Information

The call autoUnit(u) represents a unit conversion of the value of quantity u to an automatically selected target unit. When there is a unit conflict which could be resolved using an inUnit unit conversion, it is typically more convenient and maintainable to resolve the conflict using autoUnit instead, since the target unit required by inUnit would only convey redundant information.

The target unit of the conversion must be determined up to unit equivalence by unit inference, and there has to exist a valid conversion from the unit of u to the target unit. This means that over-use of autoUnit must be avoided since each use adds a degree of freedom to the unit inference problem, and at some point there will be too much freedom for allowing the target units to be determined.

It is an error if the unit of u cannot be determined. This will be the case when u has undefined unit due to incompleteness of the unit handling system, but can also happen as a result of disabling all or parts of the unit handling system.

In case the conversion would be different depending on whether u is absolute or relative, it is an error if this information cannot be determined. For example, a conversion from "K" to "degC" requires this information.

After model translation, the call autoUnit(u) will have been replaced by a concrete arithmetic operation on u.

To perform unit conversion to a specific choice of target unit, use inUnit instead.

Syntax

y = autoUnit(u)

Inputs (1)

u

Type: Real

Description: Amount-of-quantity to be converted

Outputs (1)

y

Type: Real

Description: Amount-of-quantity expressed in automatically selected unit