SimcenterKnowledge

Expressions > Inputs to expressions

Units in expressions

In the expression system, the numerical values, variables, fields, other expressions, and measurements that comprise the formula of an expression can all have dimensions and associated units. Moreover, the expression itself can have dimensions and associated units. The mathematical operations and functions that are included in the formula for the expression determine how the expression system evaluates expressions with dimensions and associated units.

For instructions on how to view a complete listing of units that you can use in expressions and their unit designations, see Find units and unit designations.

Dimensions and units of an expression

Expressions can be dimensional or dimensionless.

  • When you create a user-defined expression, you specify the dependent domain. The dependent domain can be dimensional or dimensionless. If it is dimensional, you can select the units from a list of units for that dimensionality. These units are referred to as measures. If you do not select the units, the expression system assigns the preferred data entry unit for the selected dimensionality to the expression.

  • When the software creates a system expression, the software specifies the dependent domain based on the application. The dependent domain can be dimensional or dimensionless. If it is dimensional, you can select the units for the dependent domain of the expression from a list of units that have the same dimensionality as the expression. If you do not select the units, the expression system assigns the preferred data entry unit for the dimensionality of the expression to the expression.Note: The preferred data entry unit is displayed in the formula entry box when you create the material property, boundary condition, or other expression application.

For information on how to select the units for user-defined expressions and system expressions, see Create a user-defined expression and Create a system-defined expression.

Dimensions of a formula for an expression

Every expression has a corresponding formula. The formula can be dimensional or dimensionless. If the formula is dimensional, it has an associated unit.

Dimensional consistency between an expression and the formula for the expression

The dimensions of an expression must match the dimensions of the formula for the expression. Exceptions to this rule are as follows:

  • If the expression is dimensional and the formula for the expression is dimensionless, the expression system assigns the units of the expression to the numerical results from the formula for the expression.

  • If the expression is dimensionless and the formula for the expression is dimensional, the expression system converts the formula for the expression to base units and then strips the units from the formula for the expression.As a best practice, do not create a dimensionless expression with a dimensional formula.

With the exception of these two situations, if the software detects a mismatch between the dimensions of the expression and the dimensions of the formula for the expression, it issues an error message.

Although not recommended, as a workaround, you can use the REMU function when the dimensions of an expression do not match the dimensions of the formula.

For information on how to use the REMU function, see Utility functions in expressions.

Unit consistency between an expression and the formula for the expression

As long as the dimensions of the expression and the formula for the expression are the same, the units can differ. You can mix units from the same unit system, or you can mix units from the metric and English unit systems.

Units of a numerical value

In expressions, numerical values are dimensionless and unitless. However, you can assign dimensionality and units to a numerical value by appending the unit specification to the numerical value.

For example, to enter 50.0 millimeters in the formula for an expression, type 50.0[mm]. When you assign units to a numerical value, do not include any spaces between the numerical value and the bracketed unit designation.

Formulas defined by a numerical value

Often, the formula for an expression is a numerical value. For example, the software creates a system expression every time you use a numerical value to define a material property. Depending on the context of the application, these expressions can be dimensional or dimensionless. If the expression is dimensional, you can specify the units for the expression by either appending a unit specification to the numerical value or by selecting the units from the units list in the formula entry box. If you append a unit specification to the numerical value, it takes precedence over the unit displayed in the formula entry box. If you enter a numerical value only, the expression system assigns the units displayed in the formula entry box to the numerical value.

Dimensional and unit consistency in formulas with sums and differences

As a best practice, when you create a formula for an expression with a sum or difference, make each term in the sum or difference dimensionally consistent. Thus, formulas such as:

0.5[m]+2.0[m]
500.0[mm]+2.0[m]
350.0[N]+50.0[N]
350.0[N]+50000.0[mN]

are valid.

When the expression system evaluates a sum or difference, it converts each term in the sum or difference to a consistent set of units and then performs the calculation. These consistent set of units are referred to as base units.

With the exception of dimensionless terms, if the terms in a sum or difference are dimensionally inconsistent, the software issues a message.

Undefined units in formulas with sums and differences

If a formula for an expression with sums and differences contains terms with units and terms without units, the expression system assigns the units of the expression to the terms without units.

For example, suppose you type the following formula:

500.0[mm]+200.0

You then select meters as the units for the corresponding expression. For such a case, the expression system calculates the sum as if you had typed:

500.0[mm]+200.0[m]

If all the terms in a formula for an expression with sums and difference are without units, the expression system assigns the units of the expression to the terms.

For example, suppose you type the following formula:

500.0+200.0

You then select millimeters as the units for the corresponding expression. For such a case, the expression system calculates the sum as if you had typed:

500.0[mm]+200.0[mm]

Dimensional and unit consistency in formulas with logical operators

As a best practice, when you create a formula for an expression with a logical operation, make both terms in the logical operation dimensionally consistent. Thus, formulas such as:

if a>10[mm] then 1 else 0
if a>3[in] then 1[mm] else 5[in]
if a>150[m] then 10[N] else 200[mN]

are valid so long as the dimensionality of expression a is length.

When the expression system evaluates the logical operation, it converts each term in the logical operation to base units and then evaluates the logical operation.

With the exception of dimensionless terms, if the terms in a logical operation are dimensionally inconsistent, the software issues a message.

Undefined units in formulas with logical operators

If a formula for an expression includes a logical operation, and the logical operation contains a term with units and a term without units, the expression system assigns the units of the expression to the term without units.

For example, suppose you type the following formula:

if a>10 then 1 else 0

You then select millimeters as the units for the corresponding expression.

You then create a second expression to define the unknown value in the formula, a. When you do so, you select inches as the unit for the second expression and type the following formula:

5

Because the software assigns the unit for the expression that contains the logical operation to the dimensionless operand, when the software evaluates the logical operation, it compares the value for a, which is 5 inches, to 10 mm. Thus, because 5 in = 127 mm, the value for the conditional statement is 1.

Dimensional and unit consistency in formulas with multiplication and division

The operands in multiplication and division do not need to have the same dimensions or units. The dimensions and units of the resulting product or quotient are a combination of the dimensions and units of the operands.

For example, suppose you type the following formula:

5.0[m]/2.5[sec]

The resulting units for the quotient are meters per second.

Undefined units in formulas with multiplication and division

Unlike sums and differences, the expression system does not assign units to an operand without units. For an expression that contains a product or quotient with a unitless operand, the unit designation for the expression determines whether the formula is valid.

For example, a quotient such as:

25.0/4.0[sec]

is valid if the units for the corresponding expression are a measure of frequency such as Hz. Otherwise, it is invalid.

If a product or quotient is invalid, the software issues a message.

For example, suppose you type the following formula:

3.0[mm/sec]*80.0

You then select a length measure such as millimeters as the units for the corresponding expression. For such a case, the expression system does not assume that the dimension for 80.0 is time, and the software issues a message.

Dimensional and unit consistency in formulas with the power of a dimensionless value

When you take a dimensionless value to a power, the power can be a real number and the expression system assigns the units of the expression to the result.

For example, suppose you type the following formula:

4.0^3.0

You then select meters as the units for the corresponding expression. For such a case, the expression system calculates the result to be 64.0 meters.

For the same example, if you specify the expression to be dimensionless, the expression system calculates the result to be 64.0 without associated dimensions.

Dimensional and unit consistency in formulas with the power of a dimensional value

When you take a dimensional value to a power, the power must be either an integer or a real number that is within the tolerance that the expression system uses to convert a real number to an integer. The tolerance that the expression system uses to convert a real number to an integer is extremely small. If the real number exceeds the tolerance, the software issues a message.

For example, if you type:

2.0[m]^3

or

2.0[m]^3.0

the expression system calculates the result to be 8.0 meters cubed.

If you type:

2.0[m]^3.1

the software issues a message.

The software will also issue a message if there is a dimensional mismatch between the result of taking a dimensional value to a power and the dimensions of the expression.

For example, suppose you type the following formula:

50.0[mm]^3

You then select meters squared as the units for the corresponding expression. For such a case, the software issues a message because of the dimensional mismatch between the expression and the formula.

Dimensional and unit consistency in formulas with the root of a dimensionless value

When you take a root of a dimensionless value, the root can be a real number and the expression system assigns the units of the expression to the result.

For example, suppose you type the following formula:

4.0^0.5

You then select meters as the units for the corresponding expression. For such a case, the expression system calculates the result to be 2.0 meters.

For the same example, if you specify the expression to be dimensionless, the expression system calculates the result to be 2.0 without any associated dimensions.

Dimensional and unit consistency in formulas with the root of a dimensional value

You can take the root of a dimensional value as long as the result has dimensions to an integer power. Thus, terms such as:

4.0[mm^2]^0.5

and

80.0[N^4]^0.25

are valid, but terms such as:

4.0[mm^3]^0.5

and

80.0[N^4]^0.333

are invalid.

The software issues a message if there is dimensional mismatch between the result of taking a root of a dimensional value and the dimensions of the expression.

Powers with dimensions and units

The expression system evaluates terms where a dimensionless or dimensional value is taken to a dimensional power. The following terms are examples of this.

0.95^0.005[m]
2.0[mm]^5.0[sec]

When the expression system encounters such a situation, it converts the power to the physically equivalent value in the base units and then performs the calculation. This can lead to unexpected results.

As a best practice, never define an expression with a dimensional power.

Unit conversions

The expression system supports metric and English units. You can mix metric and English units in the formula for an expression.

For example, formulas such as:

0.75[m]–6.0[in]
50.0[lbf]/0.5[mm]
400.0[mN/mm^2(kPa)]*15.0[in^2]

are valid.

When the expression system evaluates the formula for an expression, it converts the dimensional values to the base units for the unit system of the part and then performs the calculation.

For example, consider the following formula:

0.008[m]+100.0[lbf]/2500.0[N/mm]-0.5[in]^2

If the part is metric, the expression system converts:

  1. 0.008 meters to 8.0 millimeters

  2. 100.0 pound-force to 444.8 x 103 milli-Newtons

  3. 2500.0 Newtons per millimeter to 2500.0 x 103 milli-Newtons per millimeter

  4. 0.5 inches to 12.7 mm

and then performs the calculation.

Temperature units and conversions

The expression system allows temperatures in Celsius, Kelvin, Fahrenheit, and Rankine. When specifying temperature units, you must designate whether the temperature unit represents a temperature in the context of thermodynamic equilibrium or a temperature difference. This distinction is necessary for the expression system to properly convert temperatures.

For example, suppose you must convert 100 K to Celsius. The correct result depends on what 100 K represents. If 100 K represents temperature in the context of thermodynamic equilibrium and is used for example in an equation of state, the correct answer is -173 C. If 100 K represents temperature difference and is used for example to calculate conduction heat transfer, the correct answer is 100 C.

As a second example, suppose you must convert 100 C to Fahrenheit. If 100 C represents temperature in the context of thermodynamic equilibrium, the correct answer is 212 F. If 100 C represents temperature difference, the correct answer is 180 F.

Note:

In the expression system, temperature in the context of thermodynamic equilibrium is referred to as temperature.

Temperature scale Temperature unit Temperature difference unit
Celsius C dC
Kelvin K dK
Fahrenheit F dF
Rankine R dR

If the formula for an expression only contains temperature difference units, the rules that apply to temperature difference units are the same as the rules that apply to units of length, force, time, and so on. However, if the formula for an expression contains temperatures in the context of thermodynamic equilibrium, special rules apply. For details on these rules, see Temperatures in expressions.

Dimensional and unit consistency in formulas with products that include an angular measure operand

When the software processes an expression whose formula includes the product of an angular measure and a non-angular measure, if necessary, the software first converts the angular unit in the angular measure to radians and then computes the product. The dimensionality of the product is the combined dimensionality of the operands with the angular unit of radians discarded.

Caution:

If an expression was migrated from a version of Simcenter 3D prior to 2019.2 and the expression contains the product of an angular measure and a non-angular measure, special considerations may apply. For more information, see Migrating expressions that include angular measures.

The following table provides examples of products of angular and non-angular measures that are common in engineering, and the values that the software returns for the products.

Product (1) Expression dimensionality (units) Formula for the expression Value for the expression
Displacement (mm) 25[mm]*3[radians] 75[mm]
25[mm]*3[degrees] 1.3089....[mm]
Velocity (mm/sec) 5[mm]*6[radians/sec] 30[mm/sec]
5[mm]*6[degrees/sec] 0.5235....[mm/sec]
Acceleration (mm/sec^2) 8[mm]*0.4[radians/sec^2] 3.2[mm/sec^2]
8[mm]*0.4[degrees/sec^2] 0.0558....[mm/sec^2]
rω2 25[mm]*2[radians/sec]^2 100[mm/sec^2]
25[mm]*2[degrees/sec]^2 0.0304....[mm/sec^2]
4[mm/sec]*0.5[radians/sec] 2[mm/sec^2]
4[mm/sec]*0.5[degrees/sec] 0.0349....[mm/sec^2]
Moment (mN-mm) 2[mN-mm]*6[radians] 12[mN-mm]
2[mN-mm]*6[degrees] 0.2094....[mN-mm]
Iω2 Energy (microJ) 10[kg-mm^2]*2[radians/sec]^2 40[microJ]
10[kg-mm^2]*2[degrees/sec]^2 0.0121....[microJ]
(1) r denotes radius v denotes velocity θ denotes angular displacement ω denotes angular velocity α denotes angular acceleration T denotes moment I denotes mass moment of inertia

Dimensions and units of variables in the formula for an expression

Variables can be dimensional or dimensionless. If a variable is dimensional, the units for the variable are base units.

Dimensions and units of expressions in the formula for another expression

Expressions can be dimensional or dimensionless. If an expression is dimensional, it has associated units. These units may or may not be the same as the base units for that particular measure. When the expression system encounters a dimensional expression in the formula for an expression, it uses the value of the expression in base units.

Dimensions and units of fields in the formula for an expression

Fields can be dimensional or dimensionless. If a field is dimensional, it has associated units. These units may or may not be the same as the base units for that particular measure. You use the field function to reference fields in the formula for an expression. When the expression system encounters the field function in the formula for an expression, and the field function has a dimensional field as an argument, it uses the value of the field in base units.

Dimensions and units of mathematical functions in the formula for an expression

When you include a mathematical function in the formula for an expression, you should know the following:

  • The recommended dimensions for the argument of the function.

  • The result of incorrect dimensions for the argument of the function.

  • The result of having a dimensionless argument for the function.

  • For dimensional arguments, the units to which the argument of the mathematical function are converted when the expression system evaluates the mathematical function.

For example, suppose you type the following formula for an expression:

sin(0.06[m])

First of all, the argument is dimensionally nonsensical. The only sensible argument for the sine function is an angle. Nonetheless, the expression system evaluates the expression as follows:

  1. The argument is converted to base units. Assuming a metric part, 0.06 meters is converted to 60.0 millimeters.

  2. The units are stripped from the converted value. Thus, 60.0 millimeters is reduced to 60.0 without an associated unit.

  3. Degrees are assigned to the dimensionless numerical value of 60.0.

  4. The sine is calculated for 60.0 degrees.

For the sine function to make sense, the argument must be an angle.

  • If the argument is in degrees or radians, the result of the sine function is what you would expect.For example, if you type:sin(30[degrees])orsin(pi()*1[radians]/6.0)the result is 0.5.

  • If the argument is dimensionless, the software assumes that the argument of the sine function is in degrees.For example, if you type:sin(30.0)the result is 0.5.However, if you type:sin(pi()/6.0)the result is not 0.5. It is the sine of 3.14159... / 6 degrees.

For more information on mathematical functions that are commonly used in CAE applications, see Mathematical functions in expressions.

How do I

Change rename and variable prefix settings

Find units and unit designations

Specify a thermal plugin function

Learn more

Inputs to expressions

Restrictions on auto-generated expressions

Fields in expressions

Migrating expressions that include angular measures

Inconsistent units warnings

Look up more details

Mathematical functions in expressions

Lookup functions in expressions

Utility functions in expressions

Thermal-flow functions in expressions

Auto-generated expressions

Field function

Mapped field function

Mathematical operators in expressions

Temperatures in expressions

Complex numbers in expressions

Quick links

Command reference

Pre/Post video examples

Bulk Entry Descriptions

Simcenter 3D tutorials

Browse Simcenter 3D help by product area

Units in expressions, Simcenter 3D 2021.1 Series

© 2020 Siemens

window.mainLanguage="en_US"

window.delivId=""

window.projectId=""

MathJax.Hub.Config({ TeX: { extensions: ["autoload-all.js"] }, tex2jax: { displayMath: [ ] }, "SVG": { scale: 125 } });

Source: https://docs.sw.siemens.com/en-US/doc/289054037/PL20200601120302950.advanced/xid916979 · retrieved 2026-07-17