# Symbolica Why do expressions have a Dimension Mismatch (binary operation)?

2021-10-06T23:26:08Z
Symbolica

## Details

Create an expression with a formula containing a constant value fails with

----------------------------------------------
The expression is invalid for update in NX.
Dimension mismatch (binary operation)

Attempt to use the "-" operation on a Length and a Angle.
Expression:

TANG_Length=tan(90-Angle_1)
TANG_Length: Dimension mismatch (binary operation)
----------------------------------------------

- When TANG_Length=tan(90-Angle_1) it has a Dimension mismatch
- When TANG_Length=tan(Angle_1) the expression is valid.

Why is "90" as value not matching?

## Solution

The key to the answer is; how NX interpret the unit of a dimensionless value
at the Right Hand Side (RHS) of the expression. When the units of a value is
not specified on the Right Hand Side (RHS) then the system assumes that the
value is in the units of the Left Hand Side (LHS).

The unit of (LHS) TANG_Length= [mm]. When you use a constant at the (RHS),
then it assumes [mm]. That is why 90[mm] is not matching Angle_1 [degrees] in
this case.

You can solve this by explicitly add the units behind the constant-value (or
expression) to make the units match: 90[degrees] or 90degrees . The expression
will look like:

TANG_Length=tan(90[degrees]- Angle_1)

Other option is to use the new "REMove Unit" function (REMU) in NX 11. With
this function you can remove the unit [degrees] form Angle_1 in the formula.
The expression will look like:

TANG_Length=tan(90-remu(Angle_1))

## Notes and References

See other example in FAQ:
http://solutions.industrysoftware.automation.siemens.com/view.php?si=001-1942214

## Hardware/Software Configuration

Platform: INTL64
OS: window
OS Version: 764SP1
Product: NX
Application: DESIGN
Version: V11.0
Function: EXPRESSION

Ref: 001-8994948

SummaryDetails

Symbolica